Close items on trackers with strict close validation using GitHub facts and acceptance criteria
pm github closeout --apply supplied only a close reason, so trackers with strict close validation refused the first eligible item and stopped the batch. The command now supplies all three structured fields through the pinned SDK for both default and strict validation, without overriding tracker policy:
resolution: linked PR URL and 12-character merge/head SHAs.expected_result: the item's acceptance criteria verbatim, or the fixed GitHub-facts fallback when absent.actual_result: verified merge time and successful check names, with no platform, coverage or test-execution claims.
Item titles, PR body prose and comments never supply these fields. Individual SDK refusals become skip rows with sanitized diagnostic codes or a generic failure class. Remaining closes continue, closed and failed report the outcomes, and any failed apply ends with a CommandError carrying exit code 1 and the completed report.
Before/after: the historical strict pm-rust tracker rejected closeout for PR 81 before this change. Installing the built tarball only in a scratch clone at f182da3~1 now plans and closes all seven eligible items, retains two eligibility skips, and reports zero failures. Two readbacks show the written fields; repeat apply writes no item/history bytes. No scratch changes were pushed. See the plan, readbacks and acceptance proof.
Both behavioral revert proofs fail as required: removing the structured close options prevents the strict tracker's two eligible closes; removing per-item recovery throws the first real lock_conflict before remaining closes. Both changes were restored before acceptance.
Validation used an isolated HOME, GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_NOSYSTEM=1:
npm run release:check: 661/661 tests, zero fail/skip/cancel/todo; exact 100/100/100/100 coverage over 13 authored modules at unchanged thresholds; all other release checks pass.bun run release:check: the same 661/661 and exact coverage results; all other release checks pass.pm test pm-github-2o9k --run --progress: linkednode --test test/closeout.test.tspasses 71/71, including real default/strict trackers, acceptance-criteria fallback, privacy, lock/policy refusals and the public command's partial-failure exit.npm run changelog:full, thennpm run changelog:check: pass after final tracker writes.
The reusable sync workflow and caller workflows are outside this change. The item remains in progress and is released for orchestrator verification.
Delivers pm-github-2o9k. Extends pm-github-t4i2.
Summary by cubic
Makes pm github closeout --apply pass the structured close fields (resolution, expected_result, actual_result) that trackers with strict close validation require. Previously the command supplied only a close reason, so a strict tracker refused the first eligible item and stopped the batch.
resolutionandactual_resultcome only from verified GitHub facts: PR URL, merge/head SHAs, merge time, and passing check names.expected_resultis the item's acceptance criteria verbatim, or a fixed GitHub-facts fallback when the item has none; PR body, comments, and item titles never supply any field.- Check evidence no longer overstates the gate: under the required rule the text reads
required checks satisfied; successful head checks: <names>(the list holds every successful head check, optional ones included), and under the fallback rule it states the applied policy so it never claims "required checks passing" when only neutral or skipped runs ran. - An individual SDK refusal becomes a skip row with a sanitized diagnostic code or generic failure class, and remaining closes continue instead of aborting.
- Any failed close produces a
CommandErrorwith exit code 1 carrying the full report; eligibility skips alone do not fail the command.
Validation
- A packed build against a strict pm-rust tracker closed all seven eligible items with zero failures; a repeat apply wrote no item/history bytes.
- Both npm and bun release gates pass 663/663 tests with exact 100% coverage, including the new fallback check-policy and optional-checks tests.
- Also closes
pm-github-wrmt(delivered by PR 122);pm-github-l1ottracks the separate changelog-generator mismatch that failed today's scheduled release.
Delivers pm-github-2o9k.
Summary by Sourcery
Make GitHub closeout satisfy strict tracker validation with factual structured fields and resilient partial-failure handling.
New Features:
- Populate structured close-validation fields from verified GitHub facts and tracker acceptance criteria for both default and strict validation.
- Continue processing eligible items after individual close refusals and report successful and failed writes separately.
Bug Fixes:
- Prevent strict trackers from rejecting otherwise eligible GitHub closeouts because required structured fields were missing.
- Prevent closeout batches from stopping at the first SDK refusal while preserving sanitized diagnostics and partial results.
Enhancements:
- Use policy-aware check evidence that distinguishes required-check success from fallback behavior without making unsupported platform, coverage, or test-execution claims.
- Return a complete failure report through CommandError with exit code 1 when any close write fails, while keeping eligibility skips non-failing.
- Document strict-tracker acceptance evidence and closeout output semantics.
Documentation:
- Document the expanded closeout report, structured fields, privacy guarantees, and failure behavior.
- Add a strict closeout acceptance proof covering real tracker writes, idempotency, and behavioral revert checks.
Tests:
- Expand closeout coverage for default and strict validation, acceptance-criteria fallback, check-policy wording, privacy, refusal recovery, partial-failure reporting, and idempotent apply behavior.
Chores:
- Record tracker history and issue updates for the delivered work and related changelog-generator mismatch.