2.0 KiB
2.0 KiB
Milestone 3: Workstreams ✓ COMPLETE
Workstream Data Model
-
✓ Implement workstream storage (
internal/storage/workstreams.go
)LoadWorkstreams(path string) (*WorkstreamCollection, error)
SaveWorkstreams(path string, collection *WorkstreamCollection) error
-
✓ 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
GetCurrentWorkstreamName() (string, error)
Workstream Commands
-
✓ Implement onx new (
internal/commands/new.go
)- Validates workstream name
- Creates workstream entry
- Sets as current workstream
- Updates workspace to base commit
- Logs to oplog with transaction wrapper
- Provides helpful next-step guidance
-
✓ Implement onx list (
internal/commands/list.go
)- Reads workstreams.json via storage layer
- Formats output with current indicator (*)
- Shows commit count per workstream
- Color-coded output for status (active=green, merged/abandoned/archived=gray)
--all
flag to show non-active workstreams- Alias:
ls
-
✓ Implement onx switch (
internal/commands/switch.go
)- Validates target workstream exists
- Checkouts latest commit in target workstream
- Updates current_workstream pointer
- Logs to oplog with transaction wrapper
- Shows helpful info about target workstream
-
✓ Add workstream validation
- Validates workstream names (alphanumeric, hyphens, underscores, slashes only)
- Prevents duplicate workstream names
- Prevents reserved names (HEAD, main, master, etc.)
- Integrated in
ValidateWorkstreamName()
function
Integration & Refactoring
- ✓ Refactored
onx save
to use WorkstreamManager - ✓ All commands properly wired in
cmd/onx/main.go
- ✓ All tests passing
- ✓ Build successful