7.9 KiB
Implementation Roadmap
Purpose
This document is the handoff-oriented implementation plan for the project. It is intentionally short and execution-focused.
A new agent should be able to read this file, understand the current project state, and immediately know what to build next without re-deriving the whole design.
Current Status
As of now:
- architecture and workflow docs are written
- CLI surfaces for
inbox,orch, worktree execution, andcouncil-revieware defined - embedded SQLite schema and migrations exist in code
- JSON output shapes are defined for the major flows
- Go module and initial command skeletons exist
inboxandorchboth compile- shared SQLite schema initialization exists
inboxis implemented end-to-end, including send/fetch/claim/renew/update/reply/done/fail/cancel/list/show/watch/wait-replyinboxsupports blocking waits, lease renewal, unread fetches backed by per-agent read cursors,--body-file, artifact attachments, and structured JSON errors with stable exit codes- integration tests cover the main inbox lifecycle, wait/watch flows, artifact persistence, and JSON error contracts
orchcurrently exists as a command skeleton only- no scheduler workflows have been implemented yet
This means the project is past design discovery and ready for orch implementation.
Source Of Truth
Read these docs first:
Use this roadmap for implementation order, not for protocol design.
Project Goal
Build a Go-based local agent orchestration stack with:
inbox: worker-facing durable coordination busorch: leader-facing scheduler and control plane- strict worktree-backed execution for code-writing task attempts
council-review: a user-facing three-reviewer brainstorm workflow implemented on top oforch
Implementation Principles
- Do not redesign the protocol unless implementation reveals a real contradiction.
- Keep
inboxandorchas separate CLIs or command groups, but share one SQLite file. - Prefer one small working path over broad unfinished scaffolding.
- Make JSON output stable early.
- Implement the happy path first, then add wait/retry/cleanup.
Recommended v1 Order
Progress Snapshot
Current implementation status:
Milestone 1: Go Skeletonis completeMilestone 2: Shared DB Layeris complete enough for both CLIsMilestone 3: Inbox Happy Pathis completeMilestone 6: Waiting Primitivesis partially complete throughinbox wait-reply
The next practical coding target is Milestone 4: Orch Core Scheduling.
Milestone 1: Go Skeleton
Goal:
- initialize the Go module
- choose CLI framework and SQLite driver
- create package layout
- make empty commands compile
Recommended shape:
cmd/inboxcmd/orchinternal/dbinternal/storeinternal/protocolinternal/cli
Definition of done:
go build ./...succeedsinbox --helpworksorch --helpworks
Status:
- completed
Milestone 2: Shared DB Layer
Goal:
- create the SQLite connection layer
- enable required pragmas
- add schema initialization and migration mechanism
Minimum scope:
- communication tables for
inbox - scheduling tables for
orch - shared
eventstable
Definition of done:
inbox initinitializes the databaseorchcan open the same database successfully
Status:
- completed for current inbox needs
Completed so far:
- shared DB open layer exists
- required SQLite pragmas are applied
- embedded schema files exist
inbox initapplies schema successfully
Remaining:
- decide whether
orchshould gain an explicit DB bootstrap check or continue to rely oninbox init
Milestone 3: Inbox Happy Path
Goal:
- implement worker-facing coordination primitives first
First commands:
inbox initinbox sendinbox fetchinbox claiminbox updateinbox replyinbox doneinbox failinbox show
Delay if needed:
watchwait-replycancellist
Definition of done:
- one thread can be created, claimed, updated, replied to, and completed
- all major commands support
--json
Status:
- completed
Completed so far:
inbox initinbox sendinbox fetchinbox claiminbox renewinbox updateinbox replyinbox doneinbox failinbox cancelinbox listinbox showinbox watchinbox wait-reply
Milestone 4: Orch Core Scheduling
Goal:
- implement run/task/dependency/attempt orchestration on top of
inbox
First commands:
orch run initorch task addorch dep addorch readyorch dispatchorch reconcileorch blockedorch answerorch status
Delay if needed:
retryreassigncancelcleanupwait
Definition of done:
- a leader can create a run
- add tasks and dependencies
- dispatch a task through
orch - see worker state reflected back after
reconcile
Milestone 5: Strict Worktree Support
Goal:
- ensure code-writing tasks execute in isolated worktrees
First scope:
orch dispatchresolvesbase_ref- strict mode fails when the repo is dirty and no explicit base is provided
- worktree path and branch name are stored on the attempt
Definition of done:
- a code task dispatch creates a real worktree
- the assigned worktree path appears in attempt metadata and inbox payload
Milestone 6: Waiting Primitives
Goal:
- replace blind polling with blocking CLI waits
Commands:
orch waitinbox wait-reply
Definition of done:
- leader can block on new task events
- blocked worker can block on reply events
Milestone 7: Council Review
Goal:
- implement the user-facing three-reviewer brainstorming workflow
First commands:
orch council startorch council waitorch council tallyorch council report
Definition of done:
- one council run can dispatch three reviewers
- tally grouped recommendations into
consensus,majority, andminority - produce stable JSON and a markdown report artifact
Immediate Next Task
If a new agent is taking over now, the next concrete step should be:
- implement
inbox send - implement
inbox fetch - implement
inbox claim - add a small integration test covering
init -> send -> fetch -> claim
This is the smallest meaningful slice because the project already has a compiling skeleton and working schema initialization.
Recommended Driver Choices
Current recommendation:
- CLI framework:
Cobra - SQLite driver: pure-Go driver
Reason:
- command surfaces are already command-group heavy
- pure-Go SQLite keeps distribution simpler
Suggested Early Tests
Add these tests before the codebase grows too much:
- schema init test
- inbox thread lifecycle test
- single-task orch dispatch and reconcile test
- worktree path generation test
- council tally grouping test
Out Of Scope For First Pass
Do not block v1 on these:
- distributed execution
- advanced auth or permissions
- patch-producing council mode
- configurable reviewer counts beyond three
- rich similarity engines for proposal grouping
- background daemons beyond blocking CLI commands
Handoff Notes For Future Agents
- The design phase is complete enough to start coding.
- Avoid reopening major design questions unless implementation forces it.
- The repository already has compiling binaries and working schema init.
- Continue with inbox lifecycle commands before adding advanced orchestration.
- Preserve the separation:
inboxhandles communicationorchhandles schedulingcouncil-reviewis a workflow on top oforch
- Treat this file as the implementation entrypoint for new agents.