Vertical slice A of cockpit mode (drive the workflow from inside the outer image instead of the host). Full design + rationale: .scratch/cockpit-mode/prd.md (and the grill output .scratch/cockpit-mode/grill-output.md).
Goal (end-to-end value)
A human can run docker compose exec -it devcontainer claude and drive /grill-me-with-docs → /to-prd → /to-issues entirely from inside the devcontainer, with only the published image, the compose file, and exported credentials — no host Claude, no docker MCP wiring, no host slash commands.
Acceptance criteria
Testing (highest, single seam — logic in TypeScript)
Unit-test the pure orchestrator resolver in the reduce.test.ts / sandbox-runner.test.ts style:
- env-only creds resolve;
orchestrator.env-only resolve; both present → env wins; missing creds yield a clear, asserted result.
- the
AGENTIC_IN_CONTAINER marker check is exercised through this same resolver, not a new bash dry-run script.
Keep the .md commands, the cockpit shim, and /exec logic-free so they need no tests.
Unchanged (do not touch)
Path-match mount (ADR-0011) and per-issue inner-sandbox isolation — the orchestrator still runs inside the devcontainer exactly as today (ADR-0006); cockpit only relocates the driver from host to inside.
Constraints (per repo workflow)
Implement with /tdd per criterion, run shell via /exec, stay scoped to this slice's files, no pushing to main, no new dependencies.
Vertical slice A of cockpit mode (drive the workflow from inside the outer image instead of the host). Full design + rationale:
.scratch/cockpit-mode/prd.md(and the grill output.scratch/cockpit-mode/grill-output.md).Goal (end-to-end value)
A human can run
docker compose exec -it devcontainer claudeand drive/grill-me-with-docs → /to-prd → /to-issuesentirely from inside the devcontainer, with only the published image, the compose file, and exported credentials — no host Claude, no docker MCP wiring, no host slash commands.Acceptance criteria
AGENTIC_IN_CONTAINERis set in the image so any in-container process can detect cockpit context./exec(one corpus): inside the container/execruns the command in the local shell; on the host it routes tomcp__docker__run_commandas today. The slash commands (incl./tdd) are not forked per mode and work unchanged in both. The shim is thin (no precedence/resolution logic).GH_TOKEN/GITHUB_TOKENand a Claude credential (ANTHROPIC_API_KEYorCLAUDE_CODE_OAUTH_TOKEN) from host env into the container. No token values are committed; reference host env vars only.orchestrator.env, with env taking precedence overorchestrator.env, and the resolved set is forwarded to sandcastle's inner sandboxes. Cockpit Claude and the orchestrator resolve from the same source.~/.claude/settings.jsonis baked into the image and installed byclaude-persist-setup(alongside the baked commands/skills), pre-allowing the cockpit workflow (local shell,gh,git,afk/hitl). A workspace.claude/settings.local.jsonstill overrides.docker compose exec -it devcontainer claudeworks with only the compose file and lands in the workspaceworking_dir; a baked in-imagecockpitshim launchesclaudein the right dir. No new host script./exec→ MCP) andorchestrator.envstill work unchanged.CLAUDE.mddocuments both modes (host-driven vs cockpit); a new ADR ("Cockpit mode — drive from inside the outer image") records the decision and relates it to ADR-0006/0011/0016/0017.Testing (highest, single seam — logic in TypeScript)
Unit-test the pure orchestrator resolver in the
reduce.test.ts/sandbox-runner.test.tsstyle:orchestrator.env-only resolve; both present → env wins; missing creds yield a clear, asserted result.AGENTIC_IN_CONTAINERmarker check is exercised through this same resolver, not a new bash dry-run script.Keep the
.mdcommands, thecockpitshim, and/execlogic-free so they need no tests.Unchanged (do not touch)
Path-match mount (ADR-0011) and per-issue inner-sandbox isolation — the orchestrator still runs inside the devcontainer exactly as today (ADR-0006); cockpit only relocates the driver from host to inside.
Constraints (per repo workflow)
Implement with
/tddper criterion, run shell via/exec, stay scoped to this slice's files, no pushing to main, no new dependencies.