Repository navigation
fix(source-control): read babysit trust files at the branch tip SHA - #10662
Conversation
The verdict gate read the trusted-actor list and admission rules with ?ref=<branch name>, and the escalation lift read the trusted list the same way, so a tag named like the branch could answer instead. Resolve each branch to its tip with merge_policy.base_tip (git/ref/heads, 40-hex or fail closed) and read at that SHA. The answer-key probe names the files by refs/heads/<branch>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed No security issues found in this change. The PR narrows trust reads rather than widening them. critical-findings: 0 What I read. The whole diff, plus Trust controls. The change narrows who can supply the trusted-actor list and admission rules. It widens nothing.
Residual points, none a finding.
No manifest files ( |
|
claude-review reviewed No blocking or advisory findings on this PR. What I checked, by reading the diff and the changed code:
The PR body says it ran the full suite and ruff. I did not run either, so I treat that as author-claimed and unverified. No |
Post-merge mutation testingKilled 0, survived 0, timeout 0, no coverage 0, invalid 0, not run 8.
The run's summary has the full report. |
…ad through base_tip #10662 patched base_tip in the unattended harness with its own tips, and this branch moved the default branch head read onto base_tip, so the head came from tips["main"] while main_head still answered only the dead git/ref/heads fake: 13 tests failed in the merge group. main_head is now tips["main"], one value as in production, and the unresolved-tip lift test fails only the lift's read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #10648
Summary
Problem: the babysit merge gate read the trusted-actor list and admission rules with
?ref=<branch name>, which a tag named like the branch could answer. This PR reads both at the branch's tip SHA, resolved by full ref, and fails closed when the tip does not resolve.Fix
babysit_verify_evidence.py: a newReader._tipresolves a branch throughmerge_policy.base_tip(git/ref/heads/<branch>, 40-hexobject.sha, elsePolicyReadError) and maps a failure to_Unreadable, the existing fail-closed path (verify:unreadable)._read_trusted_listreads at the reader branch's tip;_task_listreads at the default branch's tip. The run-cache keys stayrepo@branch; the tip is resolved only on a cache miss.babysit_merge.py_lifted_by_person: the same class, found by the sweep.trusted_actors(repo, default)passed the branch name into_file_at's?ref=. It now resolvesbase_tipfirst; a failure is no lift, so the label stays on.babysit_verify_evidence.pyanswer key: the GraphQLobject(expression:)probes for both files namerefs/heads/<branch>:<path>, not<branch>:<path>. A live read-only query against this repository returned the same blob oid forrefs/heads/main:<path>andmain:<path>, andnullfor a missing branch.Verification
TheReadsNameACommit(request paths name the tip SHA, never the branch; a 404, short, uppercase, name-valued, or missingshafails closed with no contents read at the branch name),TheRulesComeFromTheDefaultBranch(rules attrunk's tip, trusted list atfeature-x's),test_the_trust_files_are_probed_by_full_branch_ref, andtest_an_unresolved_default_branch_tip_is_no_lift.babysit-prs/scripts/testssuite: 3337 passed, 3600 subtests passed.scripts/run-ruff.sh checkon the changed files: all checks passed.base_tipitself is unchanged, becausetest_merge_holds_sync.pychecks it againstmerge-holds.mjsbaseTip. It checks the SHA shape, not the objecttype, so the non-commit case is covered by the SHA check.Related
base_tipexists since fix(pr-merge): carry a hold-path lift over a later base merge #10596 and is reused, with no second resolver. Each read keeps its branch: the trusted list uses the reader's branch, and admission uses the default branch. The cache keys stay on branch names._default_branch_headstill resolves throughcommits/<branch>, which feeds the config and the lane-adoption trusted list. Left out of this PR because it is not a?ref=read and about 17 test fakes would need changes._task_listreads them at the default branch.🤖 Generated with Claude Code