Repository navigation
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero primary review by claude on a1ae38bee80738795f2a6d0244eb8791d4577f2e, 64.9s: request_changes (0 critical, 1 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)
Findings without a file location:
- suggestion: Mergify
mark_confirmedwrite is not guarded by the receipt recheck — This change adds_require_receiptbeforemark_ready,mergify.requestandgithub.merge. It does not add one beforemergify.mark_confirmed(cli.py:1748), which is also a remote write on the merge path. It runs after readiness and the extramergify.markers/membershipreads. The acceptance criteria say a receipt replaced during gate evaluation should block writes. If that covers queue bookkeeping, add the same check beforemark_confirmed. Otherwise, document that it is exempt.
Native Claude output is retained in the restricted local review receipt.
| if open_matches: | ||
| newest = max(open_matches, key=lambda row: (row["created_at"], row["number"])) | ||
| return _confirm_branch_pr(repo, branch, endpoint, newest["number"], "OPEN") | ||
| if not list_only: |
There was a problem hiding this comment.
suggestion: list_only makes ready/merge find PRs differently from status and merge --cancel
list_only=True skips the commit-association lookup (_commit_branch_prs) that is still the main path for status (cli.py:1898), merge --cancel (cli.py:1775) and other _require_pr callers. After this change, ready/merge take the open PR from the head-filtered list, while the other commands take the newest commit-associated PR. These can disagree, for example when the list endpoint lags after a PR is opened or reopened. The diff adds no test of pr_for_branch(list_only=True) in test_github.py. Consider either moving all callers to one lookup or adding a test that pins the two-read contract and the open-before-closed fallback order.
| (True, "dirty", "check receipt was recorded in a dirty worktree."), | ||
| (True, "commands", "check receipt's plan differs from the trusted workflow."), | ||
| *((True, condition, "check receipt is incomplete.") for condition in ("empty", "checkpoint")), | ||
| @pytest.mark.parametrize("command", ["ready", "merge"]) |
There was a problem hiding this comment.
suggestion: Rewritten receipt test drops the valid-receipt and recovery-hint cases
The old parametrization included (False, "matching", None), which checked that ready succeeds with a current receipt. It also asserted the full recovery text for legacy/incompatible ("Run loopzero check in this worktree at this head with the same current CLI ..."). The new test_delivery_requires_current_receipt only checks failures and a reason prefix. The 'Valid receipts still run the existing gates' acceptance point and the recovery guidance now depend on coverage elsewhere. Consider adding back a valid case that expects exit 0 and receipt accepted: for both ready and merge.
Architecture-Review: unchanged; readiness still checks the receipt before gates and gated writes. Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the state isolation and readiness ordering both remain in effect. Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; this clean base merge preserves the readiness change. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
loopzero delta review by claude on 5d027df00ce4db0de0e7408b3b4b25997e64000a, 32.2s: 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 sha | ||
| confirmed = state is not None | ||
| if confirmed and not confirmed_marker: | ||
| _require_receipt(wt, config, pr.head_sha) |
There was a problem hiding this comment.
suggestion: New receipt guard before mark_confirmed has no test and is applied inconsistently
The new _require_receipt before mergify.mark_confirmed only runs when the PR is already in the Mergify queue and has no confirmed marker. No test in this delta reaches that state. In the during-gates merge case, membership is None, so the run takes the request path, which was already guarded at line 1752. Also, this write does not admit anything: the PR is already queued. If the receipt is invalid, the command errors, but the PR stays in the queue and can still land. It is just left without the confirmed marker. The same marker write in _wait_for_mergify (line 1698) stays unguarded. Pick one rule and apply it to both: guard both marker writes, or guard neither and keep receipt checks only on admission writes (request and merge). Then add a parametrized case for the guarded path, for example membership returning a state with confirmed_marker=False and the receipt removed during gates.
| report["settings_sha256"] = "0" * 64 | ||
| if condition == "transient": | ||
| monkeypatch.setattr(github, "_retry_sleep", lambda _: None) | ||
| gh.respond(pr_list_key(), {"stdout": "", "exit_code": 1, "stderr": "HTTP 503"}, [{"number": 7}]) |
There was a problem hiding this comment.
suggestion: The transient case also unlinks the receipt, so it mixes two conditions
The transient case removes the receipt and also injects a 503 on the PR list. It checks that a retry happens before the receipt is rejected. It never checks that a transient error with a valid receipt still goes on to the remote gates. That is fine for the acceptance criteria, but the test name suggests broader coverage. Consider naming it missing-after-transient, or add a valid-receipt transient replay, so that a regression that drops the retry for valid receipts would be caught.
|
Superseded by #1842. The approved head’s full check caught the exact Git-call assertion after worktree ownership validation landed. The authorized replacement retains the guarded receipt reads, updates the bound in the existing test, and seeks fresh primary review. |
Check local receipts before remote readiness gates
Context and goal
Closes #1405
Acceptance
Validation notes
Base
Base: 5cfb9c2
Validation
Recorded for
5d027df00ce4uv 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 1Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review