Skip to content

Cockpit mode — Slice B: autonomous cockpit (detached /afk + monitor) #68

Description

@lsfera

Vertical slice B of cockpit mode. Full design: .scratch/cockpit-mode/prd.md.

Blocked by #67 (Slice A). Not ready-for-agent until #67 closes — relabel then.

Goal (end-to-end value)

From inside the devcontainer, a human can kick off /afk (and /hitl) and walk away: the run is autonomous, doesn't tie up the interactive Claude session, and survives detaching the docker compose exec TTY or exiting the session — while cockpit Claude can report status, tail, and stop it.

Acceptance criteria

  • TS run-mode resolver (the real logic — see Testing): a pure function in the TypeScript orchestrator resolves the run mode — detached when the cockpit marker (AGENTIC_IN_CONTAINER) is set, foreground otherwise. The launcher consumes the resolved mode; it holds no mode logic.
  • Detached /afk in cockpit: the orchestrator is started as a background process inside the container, writing to the existing .sandcastle/logs/ location, decoupled from the interactive session so it survives TTY detach and session exit.
  • Monitoring: cockpit Claude can report the status of a running /afk, tail its log, and stop it on request.
  • /hitl parity: /hitl mirrors the detached + monitored behavior with its human-approval gate (PRs left open; ADR-0009 unchanged).
  • Regression: host-driven /afk//hitl (foreground, via /exec) are unaffected.
  • Docs: the cockpit autonomous flow is documented (kick off, monitor, stop).

Testing (highest, single seam — logic in TypeScript)

Unit-test the pure run-mode resolver in the reduce.test.ts / sandbox-runner.test.ts style: resolves detached under the cockpit marker, foreground otherwise. Keep the launcher/shim/.md thin and logic-free.

Unchanged (do not touch)

Inner-sandbox isolation, path-match mount (ADR-0011), the auto-merge-on-green (ADR-0007) and hitl-merge-gate (ADR-0009) semantics — Slice B changes only how the orchestrator process is launched and monitored in cockpit, not what it does.

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. Depends on #67.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions