Skip to content

Attest hosted Mergify candidates against the trusted workflow base - #1853

Merged
mergify[bot] merged 2 commits into
mainfrom
lean178/1257-hosted-default-base
Nov 26, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
lean178/1257-hosted-default-base

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 trunk alongside main. Focused candidate and hosted suites passed. Net +5 source and +11 test lines.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Review

Validation

Recorded for 26a3d82556ea

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/loopzero/candidate.py
def attest_candidate(
event: JsonObject,
*,
base_branch: str = "main",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/loopzero/candidate.py
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)}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/test_candidate.py
return deepcopy(values[path])
return {"object": {"sha": sha}} if (sha := next(reads)) else {}

if base_branch != "main":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eowca
eowca marked this pull request as ready for review November 26, 2026 11:58
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 51d679a at 12:05 UTC

7 min in the queue, 5 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 11:59 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1864
  • ✅ Merged 12:05 · 51d679a · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit 51d679a into main Nov 26, 2026
16 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1257-hosted-default-base branch November 26, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the trusted default base in hosted Mergify candidate attestation

1 participant