Govern executable positional actions and resumable output contracts

Merged
UN
3mo ago
+13896-4844

Summary\n\n- publish typed positional signatures and executable action contracts across CLI help, completion, SDK contracts, MCP parity, aliases, and active packages\n- independently observe 166 live Commander and runtime-action destinations so declared positional contracts cannot validate themselves\n- separate amount-bound rows from nested continuation rows, bind continuation cursors to canonical row content, and reject stale same-cardinality diagnostic cursors\n- deliver executable context-calibration recovery, linked-file and linked-test aliases, token-surface ratchets, generated contracts, SDK surface metadata, and PM-owned changelog output\n\n## PM lineage\n\nDelivered and closed:\n\n- pm-2tan: positional action help\n- pm-ya7x55: executable positional grammar\n- pm-y0htkd: MCP and CLI option parity\n- pm-xa3t0o: executable calibration recovery\n- pm-8nev0o: universal bounded continuation\n\nPreserved follow-up lineage:\n\n- pm-h8tpeh: exhaustive recovery-reference assurance\n- pm-pcy92t: boolean flag invocation semantics\n- pm-e9zh: evidence-backed historical resolution metadata\n\n## Verification\n\n- exact all-source coverage: 521 files, 7,561 tests, 55,159/55,159 statements, 41,185/41,185 branches, 11,405/11,405 functions, 53,241/53,241 lines\n- live grammar: 166 observed / 166 declared, 20 shapes within budget 21, 61 visible top-level commands within ceiling 69, zero findings\n- MCP/CLI parity: 43 create and 48 update parameters, zero findings\n- agent token surface: 112 ratcheted surfaces; token budget: 32 surfaces with bounded recovery negative controls\n- packed artifact: npm/npx workflow with 13 packages plus isolated Bun install, bunx CLI, initialization, contract help, and SDK import\n- ESLint, zero-clone jscpd, 100% source/export/member docstrings, static assurance, graph composition, record integrity, package boundary, SDK surface, contract snapshots, defect evidence, dependency audit, secret scan, and pm-changelog reproducibility pass\n- PM health and history chains are clean; the existing 295-item historical resolution backlog remains unchanged under canonical item pm-e9zh and was not filled with placeholders\n\n## Compatibility\n\nReadRowContract adds only the optional continuation_row_keys field. Existing consumers remain source-compatible while nested resumability becomes explicit. Rich plan, schema, and profile missing-subcommand recovery remains intact while structured help exposes the enforced required arity.

Summary by Sourcery

Govern executable positional command contracts and make nested diagnostic output safely resumable across CLI, SDK, MCP, and package surfaces.

New Features:

  • Publish typed positional command and executable action contracts across CLI help, completion, SDK contracts, MCP parity, aliases, and package-owned commands.
  • Add independently resumable nested diagnostic output with canonical content-bound cursors that reject stale replays.
  • Expose linked-file and linked-test aliases consistently across create/update CLI and SDK surfaces.
  • Add executable context-calibration recovery validation and expand token-surface coverage to positional actions.

Bug Fixes:

  • Prevent positional action help and contracts from diverging from live Commander registrations.
  • Fail closed on positional signature drift, missing command observations, MCP/CLI option mismatches, malformed token budgets, and invalid calibration recovery configuration.
  • Preserve primary amount limits while allowing nested validation diagnostics to continue independently without repeating rows.

Enhancements:

  • Consolidate command grammar, positional signatures, action flags, runtime contracts, and structured help around shared SDK metadata.
  • Refine contracts output so compact summaries remain lightweight while full or command-scoped projections include detailed provenance, budgets, and positional signatures.
  • Strengthen command alias discovery, required subcommand diagnostics, and canonical linked-resource option normalization.

CI:

  • Extend release grammar and token-surface gates with independent live CLI observation, positional-shape budgets, option parity checks, and executable recovery validation.

Documentation:

  • Document positional action discovery, command-scoped contracts, nested continuation row contracts, stale cursor protection, and context-intent calibration recovery.

Tests:

  • Add unit and integration coverage for positional action help and contracts, live command census failures, option parity, linked-resource aliases, resumable validation diagnostics, stale cursors, and token-budget enforcement.

Chores:

  • Refresh generated SDK metadata, contract fixtures, token baselines, changelog output, and PM tracking artifacts.