Files
onyx-prebootstrap/notes/checklist.md
Tanishq Dubey 3fffd5d409
Some checks failed
CI / Build (pull_request) Failing after 7s
CI / Test (pull_request) Failing after 7s
CI / Lint (pull_request) Failing after 13s
UPdate checklist
2025-10-14 21:29:16 -04:00

1.8 KiB

Milestone 3: Workstreams

Workstream Data Model

  1. Implement workstream storage (internal/storage/workstreams.go)

    type WorkstreamsFile struct {
        CurrentWorkstream string
        Workstreams      map[string]*Workstream
    }
    
    func LoadWorkstreams(path string) (*WorkstreamsFile, error)
    func (w *WorkstreamsFile) Save(path string) error
    
  2. Create workstream manager (internal/core/workstream_manager.go)

    • CreateWorkstream(name string, base string) error
    • GetCurrentWorkstream() (*Workstream, error)
    • SwitchWorkstream(name string) error
    • ListWorkstreams() ([]*Workstream, error)
    • AddCommitToWorkstream(sha, message string) error

Workstream Commands

  1. Implement onx new (internal/commands/new.go)

    func New(repo *Repository, name string) error {
        // 1. Fetch latest from origin/main
        // 2. Create workstream entry
        // 3. Set as current workstream
        // 4. Update workspace to base commit
        // 5. Log to oplog
    }
    
  2. Implement onx list (internal/commands/list.go)

    • Read workstreams.json
    • Format output with current indicator (*)
    • Show commit count per workstream
    • Color code output for better readability
  3. Implement onx switch (internal/commands/switch.go)

    func Switch(repo *Repository, name string) error {
        // 1. Save current ephemeral state
        // 2. Load target workstream
        // 3. Checkout latest commit in workstream
        // 4. Update current_workstream
        // 5. Restore workspace state
        // 6. Log to oplog
    }
    
  4. Add workstream validation

    • Validate workstream names (no special chars)
    • Check for uncommitted changes before switch
    • Prevent duplicate workstream names