Repository navigation
Attest hosted Mergify candidates against the trusted workflow base - #1853
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 806e786e7243cc3359d76fb7b8f8ebffd18d0cad, 39.5s: approve (0 critical, 0 important, 3 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
| def attest_candidate( | ||
| event: JsonObject, | ||
| *, | ||
| base_branch: str = "main", |
There was a problem hiding this comment.
suggestion: Default base_branch="main" lets future callers silently fall back to main
hosted._run is the only production caller, and it passes cfg.base_branch. Still, the "main" default on attest_candidate means any new caller that forgets the argument will quietly attest against main instead of failing. That cuts against the issue's aim of always using the trusted workflow's base. Smallest fix: make base_branch a required keyword argument. The tests already route through run_attestation/partial, so they can pass base_branch="main" explicitly; that removes the if base_branch != "main" branch in the test fixture.
| first_lineage = live_lineage() | ||
| main_path = f"/repos/{full_name}/git/ref/heads/main" | ||
| main_before = github_get(main_path) if first_lineage[2] else None | ||
| base_path = f"/repos/{full_name}/git/ref/heads/{quote(base_branch)}" |
There was a problem hiding this comment.
suggestion: Renaming the main_* locals adds churn against the 6-line source budget
The net source change is about +5 lines, which fits the budget. But renaming main_path, main_before, main_ref and main_sha to base_*, and adding the branch to the error messages, changes about 25 more source lines. If the budget counts changed lines rather than net additions, this goes over the limit. Keeping the existing local names and only swapping the literal heads/main, "main" and mergify_status(..., "main") uses for base_branch would give the same behavior with a much smaller delta. Also, _attest_candidate_once takes base_branch positionally while the other helpers take it as a keyword. Making it keyword-only would match the existing signature style.
| return deepcopy(values[path]) | ||
| return {"object": {"sha": sha}} if (sha := next(reads)) else {} | ||
|
|
||
| if base_branch != "main": |
There was a problem hiding this comment.
suggestion: The candidate-level trunk test doesn't check which branch the Mergify status is read for
run_attestation's default mergify_status is lambda *_: ..., so the parametrized trunk case passes no matter which branch is sent to the queue status read. test_hosted does cover this through the exact ?branch=trunk match, so this is not a gap in coverage. Asserting the branch in the candidate-level fake would make the unit test check the change on its own.
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on 26a3d82556ea8bf17d13efdc2d57ec16ec8947b7, 9.1s: approve (0 critical, 0 important, 0 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)
Native Claude output is retained in the restricted local review receipt.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Closes #1257
Hosted candidate attestation now uses the base from the workflow loaded from the trusted default branch. It checks candidate and source targets, reads the Mergify queue and verifies reconstructed trees against that base. Candidate metadata cannot select the base.
This changes the hosted eligibility path. IntelFlo pins loop-zero in
eligibility.yml, so its source and candidate eligibility pins must advance to a revision containing this fix to consume it.Offline regressions cover hosted publication and reconstructed Git tree attestation on
trunkalongsidemain. Focused candidate and hosted suites passed. Net +5 source and +11 test lines.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review
Validation
Recorded for
26a3d82556eauv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0