fix(governance): require reconstructable queue provenance - #1147
seonghobae wants to merge 4 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review Please review the exact current Draft head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected_head='ce4f38c9d33050152cb323b35e64d3ab04c9b39c'
parent_ref='fix/bounded-subprocess-current-review-988'
parent_commit='5a855b731f9857d4a177263f94c9987952be224c'
echo '== HEAD =='
git rev-parse HEAD
git status --short
echo '== parent refs =='
git branch -a --contains "$parent_commit" || true
git show -s --format='%H%n%P%n%s' "$parent_commit"
echo '== ancestry and merge base =='
git merge-base HEAD "$parent_commit"
git rev-list --left-right --count "$parent_commit"...HEAD
git merge-base --is-ancestor "$parent_commit" HEAD && echo 'parent_is_ancestor=yes' || echo 'parent_is_ancestor=no'
echo '== parent-relative changed files =='
git diff --name-status "$parent_commit"...HEAD
git diff --stat "$parent_commit"...HEAD
echo '== parent-relative patch =='
git diff --find-renames --find-copies --unified=80 "$parent_commit"...HEAD -- \
scripts/build_pr_queue_governance.py \
tests/test_pr_queue_governance_git_timeout.py \
':!scripts/build_pr_queue_governance.py' ':!tests/test_pr_queue_governance_git_timeout.py'
echo '== source outline =='
ast-grep outline scripts/build_pr_queue_governance.py --items all --match '_source_commit|run|subprocess|RuntimeError' --view expanded || true
echo '== test outline =='
ast-grep outline tests/test_pr_queue_governance_git_timeout.py --items all --view expanded || true
echo '== source and test contract references =='
rg -n -C 5 -e 'def _source_commit\b' -e '_source_commit\s*\(' -e 'rev-parse' -e 'SHA-1|SHA-256|[0-9a-f]' \
scripts/build_pr_queue_governance.py tests/test_pr_queue_governance_git_timeout.pyLength of output: 100947 🏁 Script executed: #!/bin/bash
set -euo pipefail
parent_commit='5a855b731f9857d4a177263f94c9987952be224c'
head_commit='ce4f38c9d33050152cb323b35e64d3ab04c9b39c'
echo '== exact parent-relative patch =='
git diff --find-renames --find-copies --unified=60 "$parent_commit" "$head_commit" -- \
docs/changelog.d/1146-pr-queue-source-provenance.md \
scripts/build_pr_queue_governance.py \
tests/test_pr_queue_governance_git_timeout.py
echo '== commits in reviewed delta =='
git log --format='%H%n%P%n%s%n%b%n---' "$parent_commit..$head_commit"
echo '== complete focused test file =='
cat -n tests/test_pr_queue_governance_git_timeout.py
echo '== source-commit call sites and output-write order =='
rg -n -C 12 -e '\b_source_commit\s*\(' -e 'write_text\s*\(' \
scripts/build_pr_queue_governance.py tests
echo '== changelog fragment =='
cat -n docs/changelog.d/1146-pr-queue-source-provenance.md
echo '== exact current PR metadata and reviews =='
gh pr view 1147 --repo ContextualWisdomLab/fast-mlsirm \
--json number,state,isDraft,headRefOid,baseRefOid,headRefName,baseRefName,reviewDecision,mergeStateStatus,statusCheckRollup,reviews \
--jq '{
number, state, isDraft, headRefOid, baseRefOid, headRefName, baseRefName,
reviewDecision, mergeStateStatus,
reviews: [.reviews[] | {author: .author.login, state, commit: .commit.oid}],
checks: [.statusCheckRollup[] | {
name: (.name // .context),
status,
conclusion,
headSha: (.workflowRun.headSha // null),
workflow: (.workflowName // null)
}]
}'Length of output: 220447
The new Update or split that test to assert the new fail-closed behavior. The focused new tests cover the replacement contract. The reviewed head is
|
|
Closing: this branch is a strict ancestor of its base |
Closes #1146.
Stack and exact scope
This is a direct child of the active PR-queue/procurement writer #1015. At creation the live parent is
fix/bounded-subprocess-current-review-988@5a855b731f9857d4a177263f94c9987952be224c; the child is exactly three commits ahead and zero behind with merge-base equal to that parent. If #1015 moves, inspect the intervening delta and revalidate this stack before integration.The sibling procurement child #1145 changes a different source/test pair; neither child mutates the parent branch.
Defect
build_pr_queue_governance.py::_source_commit()returned"unknown"for every non-timeout Git failure and accepted arbitrary non-emptygit rev-parse HEADoutput. Queue-governance JSON/HTML evidence could therefore be generated without a reconstructable source revision.RED → GREEN
24ace9807f237065060874f007e4ac3a6839b39a: add fail-closed regressions for non-zero Git exit and unavailable Git; reject empty, abbreviated, uppercase, non-hexadecimal, undersized, and oversized identities; preserve the bounded deadline and canonical full SHA-1/SHA-256 compatibility.22691f9dc5f3803d6d2a52a189c0168aef3d74dd: normalize OS/subprocess failures to stable package-ownedRuntimeErrorand require lowercase 40-hex SHA-1 or 64-hex SHA-256 output before returning source identity.ce4f38c9d33050152cb323b35e64d3ab04c9b39c: governed changelog fragment.Effective parent-relative scope is only
scripts/build_pr_queue_governance.py,tests/test_pr_queue_governance_git_timeout.py, and one changelog fragment. Existing queue classification, duplicate/overlap analysis, bounded GitHub transport/retry behavior, HTML/JSON rendering, and protected gates are unchanged.Ownership boundary
Repository-governance provenance/control-plane only. No likelihood, estimator, scoring, fit statistic, uncertainty, recovery, or other production psychometric/statistical arithmetic changes; Rust-first numerical ownership and downstream
psychometrics-commonsownership remain unchanged.Review boundary
Keep Draft until this exact current head has terminal required CI/security/package/provenance evidence and effective independent review requirements are satisfied. Parent/predecessor-head evidence does not transfer; no bypass or self-approval.