fix(#2388): gate shared requirement completion on sibling plans, revert on gaps (#2424)

* fix(#2388): gate shared-ID requirement marking and revert on gaps_found

Adds requirements.ready-ids (execute-plan.md's update_requirements step)
so a requirement ID declared by multiple plans in a phase only marks
Complete once every declaring plan has produced a SUMMARY.md, and
requirements.revert-phase (execute-phase.md's gaps_found branch) so a
gaps_found verdict reverts the phase's own prematurely-Complete IDs
before the gap report renders. Single-plan IDs still mark immediately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(#2388): regenerate fixtures + lint gate-prep

* fix(#2388): repair failing tests after gate verification

* chore(#2388): add changeset (#2424)

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-07-19 07:52:17 -04:00
committed by GitHub
parent b2f4aa9435
commit 8d2f8bcb23
47 changed files with 534 additions and 61 deletions

View File

@@ -59,6 +59,10 @@
* Requirements Operations:
* requirements mark-complete <ids> Mark requirement IDs as complete in REQUIREMENTS.md
* Accepts: REQ-01,REQ-02 or REQ-01 REQ-02 or [REQ-01, REQ-02]
* requirements ready-ids <plan-path> <ids> Read-only: which of <ids> are safe to mark-complete now
* (no sibling *-PLAN.md in the same phase dir still missing its SUMMARY for that ID)
* requirements revert-phase <ids> Revert requirement IDs out of Complete (checkbox + traceability row);
* gaps_found-only, never call on the pass path
*
* Milestone Operations:
* milestone complete <version> Archive milestone, create MILESTONES.md
@@ -1216,8 +1220,19 @@ function dispatchOverlayCapabilityCommand({ command, args, cwd, raw, error, load
const subcommand = args[1];
if (subcommand === 'mark-complete') {
milestone.cmdRequirementsMarkComplete(cwd, args.slice(2), raw);
} else if (subcommand === 'ready-ids') {
// #2388: read-only shared-ID gate — computes which of the given
// requirement IDs are safe to hand to mark-complete right now
// (no sibling *-PLAN.md in the same phase dir still missing its
// *-SUMMARY.md for that ID).
milestone.cmdRequirementsReadyIds(cwd, args.slice(2), raw);
} else if (subcommand === 'revert-phase') {
// #2388: gaps_found-only revert — flips this phase's own
// requirement IDs back out of Complete (checkbox + traceability
// row) before the gap report renders.
milestone.cmdRequirementsRevertPhase(cwd, args.slice(2), raw);
} else {
error('Unknown requirements subcommand. Available: mark-complete', ERROR_REASON.SDK_UNKNOWN_COMMAND);
error('Unknown requirements subcommand. Available: mark-complete, ready-ids, revert-phase', ERROR_REASON.SDK_UNKNOWN_COMMAND);
}
}