Skip to content

Preserve passing receipts across late check checkpoints - #1415

Merged
mergify[bot] merged 3 commits into
mainfrom
lean178/1368-preserve-passing-receipt-v2
Nov 26, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
lean178/1368-preserve-passing-receipt-v2

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Preserve a completed pass when an overlapping check writes a checkpoint

Review

Validation

Recorded for 85ce583f8f0e

  • 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

Context and goal

  • Context: A successful stage can save a partial receipt before final validation.
  • Problem: A late checkpoint on the same head and check plan can replace a completed passing receipt and block readiness.
  • Goal: Keep a matching completed pass through a late checkpoint while allowing completed failures to replace it.

Closes #1368

Acceptance

  • The actual check callback leaves a matching completed pass available to readiness after a late checkpoint.
  • If no pass exists or the commands differ, the checkpoint still records stage results.
  • A completed failed receipt replaces a completed pass.

Notes

  • The merge keeps the preservation check under the current worktree writer lock. Focused tests exercised the real CLI callback and interruption recovery.

Base

Base: 3c2697f


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

Architecture-Review: document which completed receipts a checkpoint may replace.

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 claude on 717403809eddedb679d9fc0063f2d514ab7cc5d3, 28.3s: 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.

Comment thread tests/test_cli.py Resolved
Comment thread docs/ARCHITECTURE.md
validation. Runners cannot select stages or mint receipts. Stage admission
for reuse. A checkpoint cannot replace a clean pass for the same head and
settings or satisfy readiness before final worktree validation. Completed
failures still replace passes. Runners cannot select stages or mint receipts. Stage admission

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: Reflow the edited paragraph

The new sentence leaves failures still replace passes. Runners cannot select stages or mint receipts. Stage admission on one line that is much longer than the surrounding ~80-column wrap. Reflow the paragraph so it matches the rest of the file.

@eowca
eowca marked this pull request as ready for review November 26, 2026 02:54
@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

🚫 Left the queue · queue conditions no longer match

5 min in the queue, with no time running CI.

So far

Reason

Pull request #1415 has been dequeued

Queue conditions are not satisfied:

  • -conflict [📌 queue requirement]

To get back in the queue

  • Push a change if one is needed: the pull request is queued again once its queue conditions match.
  • If no change is needed, comment @mergifyio queue to queue it again as it is.

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 added dequeued and removed queued labels Nov 26, 2026
Architecture-Review: unchanged; preserve both the configured workflow pin and matching-input checkpoint protection.

Co-Authored-By: Codex <noreply@openai.com>
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Mergify dequeued the approved head 7174038 after main introduced a conflict in the check callback. The local resolution at eac98e3 preserves the workflow pin and the checkpoint guard, and all 25 focused tests pass. The integrated tree is 20 test lines over the current cap. Hosted eligibility cannot inherit approval across a conflict resolution, and the current reviewer cannot take that merge in a delta until #1259. The remote branch remains at the approved head.

Carry the checkpoint preservation rule into the current worktree state writer and exercise the actual check callback.

Architecture-Review: unchanged; the existing receipt rule is enforced by the current locked state writer.
Co-Authored-By: Codex <noreply@openai.com>
@mergify mergify Bot removed the dequeued label Nov 26, 2026

@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 85ce583f8f0eb1fa7c45fb807aed21962d8b7648, 25.3s: 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.

Comment thread src/loopzero/worktree.py
import stat
import subprocess
from collections.abc import Iterator
from collections.abc import Callable

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: Merge the new Callable import into the existing collections.abc import

The diff adds a second line, from collections.abc import Callable, right below from collections.abc import Iterator. It works, but it is redundant style. cli.py already uses the combined form (from collections.abc import Callable, Iterator). Smallest fix: use one line, from collections.abc import Callable, Iterator.

Comment thread tests/test_cli.py
@@ -4814,3 +4814,26 @@ def test_pr_marks_legacy_same_head_check_unverified(wt, gh, capsys, refresh):
draft = json.loads(gh.calls[-1]["--input"])["body"]
assert "unverified" not in draft
assert_contains(draft, f"Recorded for `{head[:12]}`\n- `echo ok`: exit 0", "Manual validation evidence.")

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: Test silently depends on workflow.toml declaring at least two checks

The 'commands differ' step saves replace(passed, results=results[:1]) and then expects the checkpoint to overwrite it. If the test fixture's workflow ever lists only one check, results[:1] equals passed. The checkpoint would then preserve it, and the test would fail with no clear reason. Add assert len(cfg.checks) > 1 at the top of the fake run_checks so the precondition is explicit.

@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 a0e5234 at 12:17 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 12:13 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1872
  • ✅ Merged 12:17 · a0e5234 · 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

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit a0e5234 into main Nov 26, 2026
21 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1368-preserve-passing-receipt-v2 branch November 26, 2026 12:19
@eowca
eowca restored the lean178/1368-preserve-passing-receipt-v2 branch November 26, 2026 12:20
@eowca
eowca deleted the lean178/1368-preserve-passing-receipt-v2 branch November 26, 2026 12:23
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.

Keep a completed check receipt when an overlapping run writes a checkpoint

1 participant