What to build
This is the tracer bullet for the entire wedge. Validate that web → platform-api → EventBus → agent-orchestrator → SandboxProvider → platform-api → PR works end-to-end, with the Agent itself stubbed: instead of calling a real model, the orchestrator runs a hardcoded "edit" (e.g., append a line to README.md) and opens a PR.
The point is to flush every seam from ADR-0007 with code, before slice 8 introduces real model calls. If the seams break, the bug is on the platform, not in the prompt.
This slice is HITL — the Run state machine, event schemas, and cross-service contracts are designed here and will be inherited by every slice after.
- Web UI: on an Issue detail page, an "Assign to Agent" button. After clicking, the Issue shows a Run badge ("queued" → "running" → "succeeded" → links to the PR).
platform-api: POST /issues/:id/assign-agent creates a Run row in agent.runs, publishes run.requested. Endpoint to fetch Run status: GET /runs/:id.
agent-orchestrator: consumes run.requested, transitions through RunStateMachine (queued → running → succeeded|failed|cancelled), acquires a Sandbox via SandboxProvider (E2B at MVP per ADR-0005), runs the stub edit, calls platform-api to create a branch and open a PR, transitions to succeeded.
RunStateMachine is implemented as a pure module (no I/O) and unit tested independently.
SandboxProvider interface and an E2B-backed implementation land in this slice.
- The orchestrator authenticates to
platform-api using a service-to-service JWT.
Decisions to nail in this slice
- Run event schema (versioned).
- The Run-to-PR back-reference (PR carries
created_by_run_id).
- Cancellation semantics (cooperative: cancel request → orchestrator releases sandbox at next checkpoint).
- Sandbox acquisition timeout and failure handling.
Acceptance criteria
Blocked by
What to build
This is the tracer bullet for the entire wedge. Validate that web → platform-api → EventBus → agent-orchestrator → SandboxProvider → platform-api → PR works end-to-end, with the Agent itself stubbed: instead of calling a real model, the orchestrator runs a hardcoded "edit" (e.g., append a line to
README.md) and opens a PR.The point is to flush every seam from ADR-0007 with code, before slice 8 introduces real model calls. If the seams break, the bug is on the platform, not in the prompt.
This slice is HITL — the Run state machine, event schemas, and cross-service contracts are designed here and will be inherited by every slice after.
platform-api:POST /issues/:id/assign-agentcreates a Run row inagent.runs, publishesrun.requested. Endpoint to fetch Run status:GET /runs/:id.agent-orchestrator: consumesrun.requested, transitions throughRunStateMachine(queued → running → succeeded|failed|cancelled), acquires a Sandbox viaSandboxProvider(E2B at MVP per ADR-0005), runs the stub edit, callsplatform-apito create a branch and open a PR, transitions tosucceeded.RunStateMachineis implemented as a pure module (no I/O) and unit tested independently.SandboxProviderinterface and an E2B-backed implementation land in this slice.platform-apiusing a service-to-service JWT.Decisions to nail in this slice
created_by_run_id).Acceptance criteria
cancelledcleanly.RunStateMachinehas unit tests covering happy path, mid-Run cancel, sandbox-acquire failure, and unknown event handling — no I/O involved.SandboxProviderfake exists and is used by tests.failed(not stuck inrunning) within a bounded time.Blocked by