PRD 0013: supervise plane foundation #19
Reference in New Issue
Block a user
Delete Branch "prd-0013-supervise-foundation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds PRD 0013 as the shared foundation for the stuck-agent recovery flow (overview in PRD 0012). Defines the MCP sidecar, the three tool definitions (
cred-proxy-block,pipelock-block,capability-block), the host-mounted proposal queue, the read-only current-config mount in the agent container, the minimal TUI dashboard, and the audit log format.Approval handlers are deliberately no-ops in this PRD — after 0013 the operator can see proposals and approve/reject them but no host-side config change happens. The actual remediations land in PRDs 0014 (cred-proxy block), 0015 (pipelock block), and 0016 (capability block).
0013 is a hard prerequisite for 0014–0016.
Phase 2 of PRD 0013. Adds the in-container MCP server: - claude_bottle/supervise_server.py: minimal JSON-RPC over HTTP MCP server. Handles initialize / notifications/initialized / tools/list / tools/call. Each tools/call validates the proposed file syntactically, writes a Proposal to the host-mounted queue, blocks waiting for a Response, archives both files, returns the operator's {status, notes} wrapped in MCP content. - Three tool definitions with JSON Schema inputs: cred-proxy-block (routes.json), pipelock-block (allowlist), capability-block (Dockerfile). - Dockerfile.supervise mirroring the cred-proxy pattern: same pinned python:3.13-alpine, copies supervise.py + supervise_server.py into /app, exposes port 9100. Stdlib-only. Tests cover JSON-RPC parsing, per-tool validation, all three handlers, the queue round-trip via a background responder thread, and an end-to-end HTTP sanity check on a random port. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Phase 4 of PRD 0013. Adds `claude-bottle dashboard` subcommand: - discover_pending() walks ~/.claude-bottle/queue/* and gathers pending proposals across all bottles, sorted FIFO by arrival. - approve / approve-with-final-file / reject helpers write the Response file the sidecar polls, and append an AuditEntry for cred-proxy and pipelock tools. capability-block proposals don't write to an audit log here (PRD 0016 captures via rebuild record). - Stdlib-curses TUI: list view, detail view, $EDITOR shellout for modify-then-approve, inline prompt for reject reason. - `dashboard --once` dumps pending proposals to stdout without bringing up curses — useful for scripted checks and tests. For 0013 the audit entry's diff field is render_diff("", proposed) because we don't yet have access to the live on-disk current file; PRDs 0014 / 0015 fill in real before→after diffs once they own the host-side config writes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>7b1d280088to9f445d61be