Hub-and-spoke architecture — the Orchestrator routes typed JSON documents between all specialist agents
Hub-and-spoke: agents never call each other directly. Every message passes through the Orchestrator, which assembles context, validates schemas, enforces retry policy, and records state transitions.
UserStory arrives (from backlog API, CLI, or UI). The Orchestrator creates a row in the State DB with status RECEIVED and loads Config/Constraints.StorySpec containing: acceptance criteria, dependency map, complexity score, ambiguity flags. State becomes ANALYZING → PLANNING.ProjectProfile + relevant file skeletons.StorySpec + ProjectProfile. The Planner returns a Plan JSON: ordered task list with depends_on edges, target files, token budgets, testing strategy, deploy strategy.depends_on allows), sends: task description, target file content, direct dependencies, type definitions, sibling patterns, convention profile. Receives a Patch (unified diff). State: CODING.TestSuite (test file content).StorySpec + conventions. Reviewer uses a different LLM for independence. Returns ReviewReport: list of findings tagged blocking / suggestion / nit. State: REVIEWING.blocking findings exist, the Orchestrator packages them with the original task and sends back to Code Generator. Each retry carries all previous attempts + failure modes as progressive context.allow. (For deploy actions it may return escalate → human approval gate.)npm run build). Build Runner executes in the Sandbox, returns BuildResult with exit code, stdout/stderr, parsed errors. State: TESTING.npm run test -- --coverage. Returns TestReport: pass/fail counts, coverage percentage, structured failure objects with suite name, test name, error message, stack trace.TESTING → CODING → REVIEWING → TESTING.DeployReport. State: DEPLOYING.VerifyReport (pass/fail + evidence). State: VERIFYING.DONE.When multiple stories run concurrently, each gets its own Orchestrator instance running the same state machine. The Coordination Manager sits between them and prevents conflicts through four mechanisms:
UserStory → Story AnalyzerStorySpec + ProjectProfile → PlannerTask + FileContext + Types + Conventions → Code GeneratorTask + AcceptanceCriteria + Code → Test GeneratorPatch + StorySpec + Conventions → Code ReviewerStorySpec ← Story AnalyzerPlan (task list + deps + strategy) ← PlannerPatch (unified diff) ← Code GeneratorTestSuite (test file content) ← Test GeneratorReviewReport (blocking/suggestion/nit) ← Code ReviewerToolCall (command, working_dir, timeout, env) → Build RunnerToolCall (test command + flags) → Test RunnerDeployCommand (strategy, target env) → Deploy EngineVerifyRequest (criteria, deploy URL) → Monitor/VerifierStoryOutcome (full history) → Feedback LoopBuildResult (exit code, stdout, parsed errors) ← Build RunnerTestReport (pass/fail, coverage, failures) ← Test RunnerDeployReport (status, URL, rollback plan) ← Deploy EngineVerifyReport (pass/fail, evidence) ← Monitor/VerifierLessonsWritten (confirmation) ← Feedback Loop