Skip to content

Rewrite config to split state and hints architecture #113

@jeevanpillay

Description

@jeevanpillay

Summary

Replace single dual.toml with a two-part architecture:

~/.dual/workspaces.toml — Centralized workspace state

  • WorkspaceState struct with workspace_root + Vec of workspace entries
  • Each entry: repo name, git URL, branch, optional explicit path
  • New src/state.rs module with load/save/add/remove/resolve operations
  • State persisted to disk, survives restarts

.dual.toml per repo — Runtime hints

  • RepoHints struct: image (default: node:20), ports, setup command, env vars
  • Lives in workspace directory root, checked into repo
  • Read-only at runtime, written by dual add

CLI changes

  • dual add — register current repo as workspace + create .dual.toml
  • dual create <repo> <branch> — add branch workspace to state
  • dual launch <workspace> — launch workspace
  • dual list — list all workspaces
  • dual destroy <workspace> — destroy workspace
  • dual open, dual urls, dual proxy, dual shell-rc — retained

All consumers updated

  • clone, container, proxy modules updated to use new state + hints APIs
  • All 98 tests pass (64 lib + 14 main + 3 e2e + 7 fixture + 10 harness)

PR

Phase 1 issues advanced by this work

  • DUAL-21: Workspace state machine — state persistence layer now implemented
  • DUAL-22: Project service/port configuration — .dual.toml hints now cover ports, image, setup, env

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreCore functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions