The risk
A preview can become false seconds later when a listener, claim, file, setting, or stack changes.
PR #46 gives destructive and configuration-changing MCP operations a durable, five-minute safety handshake. The model can inspect exactly what would happen; the daemon remains the authority that decides whether it still may happen.
A preview can become false seconds later when a listener, claim, file, setting, or stack changes.
The MCP process never gets authority from a remembered answer. It presents a receipt back to the daemon.
Seven consequential action families are now inspectable, stale-safe, explicit, and retryable.
| Family | Preview binds | Execute can do |
|---|---|---|
| Port | listener identity and reclamation evidence | reclaim an eligible owned listener |
| Claims | claim rows, ownership, worktree, and prune candidates | reassign, delete, or prune claims |
| Stack registry | definition, activations, launchers, and prune candidates | apply a definition or prune stacks |
| Settings | current settings fingerprint and desired patch | apply validated settings changes |
| Stack document | canonical path, validated structure, and byte fingerprint | create or safely replace the fixed document |
The CLI/server and Desktop previously risked evolving separate definitions of a safe stack document. This slice introduces shared primitives for the fixed portreeve.stack.json file.
resolve canonical existing directory
→ inspect the fixed filename without following a link
→ require a regular file and at most 1 MiB
→ parse and validate a typed stack definition
→ fingerprint the exact bytes
→ compare the expected fingerprint before atomic replace
MCP reads return the parsed definition and fingerprint, not arbitrary file contents. The Desktop adapter now delegates to these same primitives, retaining its overwrite/cancel behavior.
src/actions/consequential-service.js orchestrates action-specific proposal, evidence, preview, and execution.src/actions/receipt-service.js adds durable asynchronous execute and replay ordering.src/stacks/document.js owns canonical document validation and atomic writes.src/server/server.js exposes focused daemon HTTP/JSON operations.packages/client/src/client.js keeps MCP on the official client boundary.src/mcp/consequential-tools.js registers 16 strict preview/execute tools.apps/desktop/main/stack-document.js reuses the shared document policy.test/mcp/stdio.test.js proves real bridge preview, execute, and replay.453 tests, typecheck, lint, changed-file formatting, documentation checks, and standalone build.
No raw file tool, no generic JSON escape hatch, no project shell execution, and no unsafe any-owner eviction.
Docker snapshots and launcher coordination arrive in I-5; real host evidence-change cases remain I-7.