Repository navigation
Reuse the PR reads that bracket hosted eligibility - #1766
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on 6e91c778eb37c9bed5390c02200504183b017c06, 66.7s: request_changes (0 critical, 1 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.
| source.get("number"), | ||
| source.get("merged"), | ||
| source.get("mergeable") is False, | ||
| tuple(label["name"] for label in source.get("labels", [])), |
There was a problem hiding this comment.
suggestion: Malformed labels in the candidate source fingerprint escape as an untyped exception
tuple(label["name"] for label in source.get("labels", [])) raises a bare TypeError or KeyError if labels is null or a label lacks name. It runs at line 532, before source_policy, outside the typed CandidateError path. A malformed payload should be rejected as a CandidateError, which is how every other malformed field in _attest_source is handled. github._pr_labels has the same shape but is wrapped into a GhError by pr_from_rest. Validate labels as a list of objects with string names via _require, or build the fingerprint after the snapshot has been normalized.
| return latest | ||
|
|
||
|
|
||
| def source_fingerprint(pr: github.PR) -> tuple[object, ...]: |
There was a problem hiding this comment.
suggestion: Two independent source fingerprints encode the same eligibility-relevant fields
eligibility.source_fingerprint (for PR: state, base_ref, conflict, hold) and candidate._source_fingerprint (for raw JSON: merged, mergeable is False, all labels, state, base ref) now separately define what must not drift before publication. Hosted candidate safety relies on the candidate fingerprint being a superset of the eligibility one, but nothing enforces that. If a field is later added to one, the other can silently stop covering it.
Consider deriving the candidate's eligibility-relevant part from eligibility.source_fingerprint(github.pr_from_rest(source)) and keeping only the repository and body extras locally. At minimum, add a comment cross-referencing the two functions.
Architecture-Review: unchanged; hosted eligibility stays bound to the same live source and skips merged sources. Co-Authored-By: Codex <codex@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on 94ae8dff3fc072580b584b1263d4bfa6079d6b77, 20.7s: 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.
| ready, message = result.ready, "; ".join(result.reasons) or "Reviewed source head" | ||
| if github.pr_view(cfg.repo, number).head_sha != head: | ||
| raise LoopZeroError("head changed before publication; refresh eligibility") | ||
| if _landed_before_publication(cfg.repo, number, head, snapshot): |
There was a problem hiding this comment.
suggestion: Landed-source skip leaves a self-written pending status on the merged head
When the source merges while eligibility is being evaluated, _landed_before_publication returns True and _run exits 0. By then _run has already written pending (line 80). If an earlier run had published success for this head, the commit now shows pending for good, and with fast-forward or rebase merges that commit is on main. The early return at line 74 does not have this problem because it runs before anything is published. The skip only needs to stop a late refresh from turning a landed head red. Smallest fix: when ready is true, publish the computed verdict as usual, and skip only the non-success states. Otherwise, document that a merged head may keep pending.
| base = source.get("base") | ||
| base_repo = base.get("repo") if isinstance(base, dict) else None | ||
| labels = source.get("labels", []) | ||
| if not isinstance(labels, list) or any(not isinstance(label, dict) or not isinstance(label.get("name"), str) for label in labels): |
There was a problem hiding this comment.
suggestion: New label validation in candidate fingerprint has no test
_source_fingerprint now raises CandidateError("invalid source PR labels") for malformed labels. Before this change it failed with a bare KeyError/TypeError. No test in this diff covers the new path, so a regression could reintroduce an unclassified exception and skip the typed candidate error handling. Add a small case to the candidate tests with labels like [{}] or "x" that expects CandidateError. The 120+ character line could also be wrapped to match the surrounding style.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Reuse the PR reads that bracket hosted eligibility
Context and goal
Closes #1404
Acceptance
Base
Base: 3973d04
Notes
Carries the snapshot reuse from #1456. Keep the current typed candidate retry, trusted review publisher logic, and outage handling.
Validation
Recorded for
94ae8dff3fc0uv 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 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review