projects/agent-native/slices/safety-mcp-audit/plan.md
Spec: projects/agent-native/slices/safety-mcp-audit/spec.md
Branch: tml-2969-s3-ai-safety-checkpoint-through-prisma-mcp-audit-pin from origin/main
(independent of S1/S2). Fresh worktree — budget pnpm install + turbo build per
learnings.md before any gate.
packages/cli/src/__tests__/mcp-safety.vitest.ts encodes the desired contract against the
real server over stdio (SDK Client + StdioClientTransport spawning the built CLI with
a curated env): agent-marker case → tool result carries
PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION and the stop-and-relay instruction, no
success; no-marker case → no consent text. The test may be red at hand-off only if
the probe proves today's runCommand swallows the text (that is the desired-contract,
fix-pending state).MCP.ts changes yet.runCommand error-propagation fix lands (own commit); the migrate-reset tool
description mentions the AI-agent gate and consent protocol; packages/cli typecheck +
the new vitest file green; captures of the final tool-result payload for the PR.MCP.ts only (description; runCommand only if D1 proved it necessary).| Dispatch | Size | dispatch-INVEST note |
|---|---|---|
| 1 | M | One outcome: probed + pinned contract. Setup cost is environmental, not scope. |
| 2 | S | One outcome: contract closed and documented. |
Slice-DoD condition 1 (both-directions test, DB-free) ← D1 (authored) + D2 (green); condition 2 (description) ← D2. CI-green + reviewer-accept inherited via the slice PR.