SDK-backed Plan contracts and truthful mutation outcomes

Merged
UN
3mo ago
+1391-99

Summary

  • route governed Plan creation through the complete shared create contract across CLI, SDK, MCP, help, and generated schemas
  • preserve implements and verifies as first-class directed relationship kinds during Plan promotion
  • initialize linked-test sandboxes non-interactively and expose truthful delete outcomes (deleted / would_delete) with previous lifecycle state
  • add focused agent-contract regressions, generated docs/changelog evidence, and tighten the static-quality suppression budget

pm items

Verification

  • pnpm release:gates repository-owned gates passed
  • 336 test files / 6,084 tests passed
  • coverage: 100% statements, branches, functions, and lines
  • packed tarball installed and exercised in an isolated temporary project
  • strict governed Plan creation, semantic relationship promotion, linked-test execution, delete preview/apply, and SDK registry behavior manually verified
  • pnpm changelog:pm:check and pnpm contracts:check passed
  • Sentry/telemetry gate: 0 critical, 0 high; telemetry error rate 0.52%; no missing error-code rows
  • pm validate --check-resolution --check-history-drift: no history drift; selected items have complete closeout metadata (277 historical resolution warnings remain outside this PR)
  • zero pm items remain in progress

Closes #635
Closes #638
Closes #641
Closes #642


Summary by cubic

Unifies Plan creation behind the shared SDK/CLI/MCP create contract and completes strict MCP metadata parity, including the canonical estimate key. Makes delete mutations report truthful outcomes and applies them only to deletion projections; also preserves implements/verifies during Plan promotion and removes interactive linked-test init.

  • Bug Fixes
    • Plan creation forwards strict metadata via the shared create contract; restored required-key contract, moved governed fields to an MCP optional-key allowlist, exposed the canonical estimate key, and added parity regression coverage (addresses #635).
    • Plan link promotion keeps implements and verifies as first-class directed kinds in the relationship registry (addresses #641).
    • Linked-test sandboxes initialize non-interactively with deterministic, structured remediation on failure (addresses #642).
    • Delete envelopes now return outcome (deleted | would_delete), deleted boolean, and previous_status; projections map status to the delete outcome only for deletions, keeping lifecycle for other mutations (addresses #638).