Repository navigation
Reuse candidate validation and simplify hosted publication guards - #1863
Conversation
Architecture-Review: unchanged; hosted dispatch and candidate attestation preserve their trust boundaries, checks, and call ordering. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 0661d58486e6f03368638348a87c6071ff28f767, 20.1s: approve (0 critical, 0 important, 2 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.
| return True | ||
| if eligibility.source_fingerprint(current) != eligibility.source_fingerprint(snapshot): | ||
| raise LoopZeroError("source metadata changed before publication; refresh eligibility") | ||
| if snapshot is None or current.state == "MERGED": |
There was a problem hiding this comment.
suggestion: Merged-guard rewrite is behaviour-preserving but harder to read
I traced all four cases (snapshot None or present × MERGED or not) and the result matches the old code: without a snapshot it returns False, a MERGED PR with a snapshot returns True, and otherwise the fingerprint check runs. The problem is readability. if snapshot is None or current.state == "MERGED": return snapshot is not None mixes two separate guards, so a reader has to work out the truth table to see that a MERGED PR without a snapshot returns False. A smaller and clearer fix is to keep the guards flat: if snapshot is None: return False, then if current.state == "MERGED": return True. That costs one extra line and makes the publication-race safeguard obvious.
| _require(app.get("id") == MERGIFY_APP_ID and app.get("slug") == "mergify" | ||
| and isinstance(app_owner, dict) and app_owner.get("login") == MERGIFY_APP_OWNER, | ||
| "Could not resolve the official Mergify GitHub App") | ||
| expected_identity = _identity(_object(github_get("/users/mergify%5Bbot%5D"), "GitHub bot lookup is invalid")) |
There was a problem hiding this comment.
suggestion: Combined lines go past the configured 100-column width
Three joined lines are longer than line-length = 100 in pyproject.toml: the expected_identity = _identity(_object(github_get(...), ...)) call (about 112 columns), the sub_batches _require (about 103), and the pull_requests _require (about 104). The lint rule set doesn't select E501, so CI won't fail, and the file already has longer lines. Still, cutting line count by going over the formatter width will get undone the next time someone runs ruff format, and that would bring back the removed lines. Either confirm that ruff format isn't used in this repo, or keep these calls within 100 columns.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Reuse candidate validation and simplify hosted publication guards
Context and goal
Refs #575
Acceptance
Base
main @ f227668
Base: f227668
Validation
Recorded for
0661d58486e6uv 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(filled by loopzero check)
Review
(filled by loopzero review)
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Coverage comparison
f2276685and0661d584: 2,006 passed, 9 skipped on each head.