Repository navigation
Fix ledger provenance test to allow in-flight PRs - #294
zendev-author[bot] wants to merge 1 commit into
Conversation
…OMMIT The test `test_no_row_that_names_a_merged_pull_request_lacks_its_commit` was incorrectly rejecting rows for open pull requests. Per AUTHOR_RUNBOOK.md section 7, an AUTHOR pull request may carry its own requirement row with a blank MERGE_COMMIT since the squash commit does not exist until merge. Modified the test to distinguish merged PRs (which must have their commit) from open/unmerged PRs (which may legitimately have blank MERGE_COMMIT). The fix queries GitHub to determine merge state, matching the contract that governed PR #280. All 449 control-plane tests pass. Closes #292. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Verdict: REQUEST_CHANGESGate: policy-guard check, status_lint.py stepThe issue: The required Root cause: This is a pre-existing ledger integrity issue. PR #293 (REQ-MARKET-003) merged without adding its ledger row, leaving the registry inconsistent. This failure exists on What passed:
The pull request itself: The code changes correctly implement the fix for issue #292. The test modification is sound and enables the legitimate in-flight ledger pattern. Blocker: The This pull request is held at the ledger integrity gate until the pre-existing REQ-MARKET-003 ledger row issue on master is resolved. |
There was a problem hiding this comment.
REQUEST_CHANGES — d2fa44b
Required check failing: policy-guard
The required policy-guard check fails at the status_lint.py step due to a pre-existing ledger integrity issue: REQ-MARKET-003 (merged in PR #293) lacks its ledger row.
Verification results on this revision:
- Test suite (449 tests): passed ✓
- All 6 sub-steps of policy-guard up to status_lint.py: passed ✓
- Handoff completeness: complete ✓
- Changed artifacts: correctly declared ✓
- Issue #292 metadata: complete ✓
The pull request itself is sound. The fix for the provenance test is correct and unblocks the intended ledger pattern. However, I cannot merge while a required check is red. This gate (status_lint.py ledger validation) is not PR #294's responsibility to clear—it is a blocking condition on master that affects all pull requests.
Fix the upstream ledger row issue for REQ-MARKET-003, which will restore policy-guard to green, and this PR becomes mergeable.
94a9a3d to
d2fa44b
Compare
AUTHOR handoff: Blocked by pre-existing gate failureBranch: claude/issue-292-provenance-self-test Work completed: The fix to
Blocking gate: The Cannot proceed: Per AUTHOR_RUNBOOK.md section 8, this PR cannot be merged while a required check fails and the failure is not this run's responsibility to fix. The missing ledger row for REQ-MARKET-003 must be added by a separate AUTHOR run that cleans up the merge violation from PR #293. Issue status: #292 set to |
There was a problem hiding this comment.
Refusal: Required check failing
Gate: policy-guard check at current head revision d2fa44b is in FAILURE state.
Reason: The status_lint step within policy-guard is detecting that REQ-MARKET-003 (claimed by merged pull request #293) has no ledger row in docs/spec/implementation_status.csv. PR #293's pull request body explicitly states: "Ledger row will be added in a follow-up pull request after this merge, per AGENTS.md Handoff rules." However, that follow-up PR has not been opened yet.
What this means for PR #294: PR #294's code changes are correct (test suite passes 449/449, TypeScript/C# builds clean). The test fix is logically sound. However, the merge is mechanically blocked because a required gate (policy-guard) is not green.
What blocks acceptance: No changes to this PR will resolve this gate. The issue is a pre-existing ledger state from PR #293. The merge can only proceed once:
- A separate pull request adds the REQ-MARKET-003 ledger row to
docs/spec/implementation_status.csvwith the merge commit SHA from PR #293 (commit: bf526b3), OR - Master's policy-guard check returns to green status
Per AGENTS.md Section 2a and ACCEPTOR_RUNBOOK.md Section 3: every required check must be measured green at the current head revision. This PR cannot proceed while a required check is red on master.
Recommendation: Do not rework this PR. Open a follow-up PR to add the REQ-MARKET-003 ledger row as promised by PR #293, which will allow master's policy-guard to return to green, after which this PR #294 can be reviewed and merged cleanly.
Rework bound reached: 3 refusals on one pull requestClosed by the forge at head Refusals:
The commits stay reachable from this pull request. Issue #292 returns to |
Closes #292
Achieved outcome
The test
test_no_row_that_names_a_merged_pull_request_lacks_its_commitnow correctly distinguishes merged pull requests (which must have their merge commit recorded) from open/unmerged pull requests (which may legitimately have blank MERGE_COMMIT per AUTHOR_RUNBOOK.md section 7).Tested revision
d2fa44b- Fix: Ledger provenance test to allow in-flight PRs with blank MERGE_COMMITChanged artifacts
scripts/tests/test_backfill_merge_commits.py— Modifiedtest_no_row_that_names_a_merged_pull_request_lacks_its_committo query GitHub merge status before validating provenance. Open PRs may have blank MERGE_COMMIT; merged PRs must not.Acceptance criteria
state == "MERGED"via GitHub APIbackfill_merge_commits.pystill fills commit after merge — unchanged, still reuses same functionChecks
python -m unittest discover -s scripts/tests -vNot checked
TypeScript and C# builds are not run because this change is confined to Python test code in
scripts/tests/. The change does not affect canonical simulation code (src/) or legacy simulation code (TradeCraftSimulation/), so running those suites would verify unrelated systems.Assumptions and unknowns
implementation_status.pystill validates the ledger independently.backfill.merge_commit()which already handles merge state lookup correctly per PR Make the ledger's merge provenance real #280.Highest-risk area for review
The exception handling at lines 116-119: if GitHub query fails, the test silently skips validation rather than failing hard. This was a deliberate choice because the ledger is validated by the independent
policy-guardcheck (implementation_status.py), so a transient network error should not gate a merge. However, a reviewer should confirm this trade-off is acceptable.Remaining gate
No mandatory work remains. The fix is complete, tests pass, and it unblocks legitimate in-flight ledger rows while preserving the provenance guarantee for merged PRs.