SDK mutation integrity, stale-work context, and Bun-safe release primitives

Merged
UN
3mo ago
+2624-55

Summary

This broad SDK/CLI change set strengthens the project-management-as-context-management baseline across several related acceptance surfaces:

  • introduces SDK-first mutation guardrails with redacted secret detection and advise/block/off policy adapters for CLI and MCP
  • enforces configurable author attribution and preserves audited disposition metadata in append-only workspace history
  • adds SDK stale-work detection plus health/CLI guidance for unclaimed or inactive in-progress items
  • returns typed schema-migration usage failures before strict SDK validation reaches telemetry as a high TypeError
  • keeps the persistent SQLite projection optional so the packed CLI starts under Bun and authoritative document reads remain the fallback
  • makes partial daily-release failure reporting truthful and stabilizes the real all-package acceptance under full-suite load
  • documents the SDK contracts and regenerates the package-owned changelog

pm items

Verification

  • complete coverage: 354 files, 6,212 tests, exact 100/100/100/100
  • aggregate release gates: build, types, static quality, docstrings, package boundaries, security scan, packed smoke, 88-command dogfood, npm pack, compatibility, and live Sentry/telemetry all passed
  • temporary installed-package acceptance: the packed tarball runs with bunx --bun and reports 2026.7.24
  • tracker integrity: health is clean; history drift is zero; only pm-cedo0g remains in progress pending merged release recovery
  • changelog: generated and checked through pm-changelog 2026.7.23

The local Greptile command reported the external free_reviews_limit_reached quota; hosted checks and bot review are required before merge.


Summary by cubic

Adds SDK-first mutation guardrails—author enforcement, redacted secret scanning, and stale-work health—with CLI/MCP parity. Also hardens author-acknowledgment review and keeps the optional SQLite index safe under Bun while returning typed schema migration usage errors.

  • New Features

    • Adds mutation_guard settings: require_attributed_author, secret_guard (off | advise | block), and stale_in_progress_hours.
    • CLI preflight and MCP adapters enforce author attribution and run redacted secret detection before mutations.
    • Stale in-progress detection surfaces unclaimed, inactive work in pm health without changing ownership.
    • Append-only workspace audit events allow acknowledging post-baseline unknown-author history without rewrites.
    • Docs: new Mutation Integrity guide; tests for guardrails and author parity in test tracking.
  • Bug Fixes

    • Hardens author-acknowledgment review: validates item ids, returns a typed error for unreadable history, and keeps stale-work health by falling back to metadata when a stream is corrupt.
    • Optional node:sqlite loading with fallback keeps the packed CLI working under Bun; projection stays optional.
    • Schema migration CLIs now return typed usage errors instead of high-severity SDK TypeErrors.
    • Stabilizes all-package acceptance by giving that test a local 45s budget under full-suite load.
    • Auto-release failure messages now reflect partial publications (tag/npm may exist) for clearer recovery.