Skip to content

Check the local receipt before fetching remote readiness evidence - #1819

Closed
eowca wants to merge 8 commits into
mainfrom
lean178/1405-bounded-lookup-followup
Closed

eowca wants to merge 8 commits into
mainfrom
lean178/1405-bounded-lookup-followup

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Check the local receipt before fetching remote readiness evidence

Context and goal

  • Context: Ready and merge require a valid local check receipt for the pushed head.
  • Problem: A missing or invalid receipt still triggers remote review, CI and queue lookups.
  • Goal: Stop after PR, head and hold validation when the receipt needs repair.

Closes #1405

Acceptance

  • Missing, stale, dirty or failing receipts and receipts for a different check plan block ready and merge --wait after at most three REST requests. No writes, polling, GraphQL or Mergify calls.
  • Passing matching receipts still evaluate every gate. Hold handling, merged cleanup and status retain their diagnostics.

Notes

Base

main @ 40fab65
Base: 40fab65

Validation

Recorded for bff5500dc1a4

  • 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 1

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

Review

  • primary, codex, bff5500, request_changes

eowca and others added 8 commits November 26, 2026 04:14
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; this clean base update preserves both the receipt-first behavior and the current review rules.
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the readiness short circuit retains branch detail, pushed head, and merge-authority verification.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; this base update preserves bounded PR discovery, receipt validation and merge cleanup.
Co-Authored-By: Codex <noreply@openai.com>

@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 codex on bff5500dc1a4a4aa169de70ce395eff3fdc5fee5, 55.9s: request_changes (0 critical, 2 important, 1 suggestion)

Same-family fallback: independent reviewers failed: claude: not authenticated. Cross-family review is preferred.

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model gpt-6.2-astra (effort medium); CLI-reported model gpt-6.2-astra (effort medium); configured model gpt-6.2-astra (effort medium)
Raw reviewer output
Native Codex transcript retained in the restricted local review receipt; public evidence is publisher-derived, not backend attestation. Exact raw SHA256: f6cff728542e646c0894fba80748992cf1d4ef406c47e3a5275433c659b5641c

Comment thread src/loopzero/cli.py
return github.Readiness(False, (hold,))
if reviews is None:
reviews = _pr_reviews(config.repo, pr.number)
report = _load_report(wt)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

important: Revalidate the receipt before acting on passing remote gates

If another loopzero check replaces a passing receipt with a failed or incomplete one while review and CI reads are in flight, _readiness still returns success using the earlier receipt. ready can mark the PR ready, and merge --wait can merge or request Mergify admission. The poll precheck also misses this when the gates turn green on that same poll. Keep the early rejection and revalidate the current receipt before accepting readiness or performing a gated write. Add a replay that invalidates the receipt during a remote gate read.

Comment thread src/loopzero/cli.py
readiness = initial
initial = None
readiness, initial = initial, None
elif problem := _check_report_problem(_load_report(wt), wt, config, pr.head_sha):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

important: Check the current workflow before diagnosing a receipt during a wait

The poll precheck compares the receipt with the configuration captured when the wait started. If the workflow changes and a fresh check passes under the new plan during the sleep, both ready --wait and merge --wait reject that valid receipt and tell the user to run checks again. The early return bypasses _verify_wait_snapshot, which already distinguishes a needed check from a needed command retry. Reload and compare the workflow before the local receipt precheck, while keeping both local checks ahead of the next PR read.

Comment thread src/loopzero/cli.py
reviews = _pr_reviews(config.repo, pr.number)
report = _load_report(wt)
receipt_problem = _check_report_problem(report, wt, config, head)
if receipt_problem and reviews is None:

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: Make full status diagnostics an explicit choice

Supplying preloaded reviews now also disables the receipt short-circuit. A readiness caller that starts caching reviews would silently resume CI and Mergify lookups for invalid receipts. Give status an explicit diagnostics option so review caching can change independently of gate behavior.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1842, which carries the revised delivery for #1405.

@eowca eowca closed this Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #1842, which merged and delivers receipt-first readiness for #1405.

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.

Check the local receipt before fetching remote readiness evidence

1 participant