Skip to content

Persist observed check failures before final validation - #1426

Merged
mergify[bot] merged 6 commits into
mainfrom
lean178/1416-interrupted-check-failure
Nov 26, 2026
Merged

mergify[bot] merged 6 commits into
mainfrom
lean178/1416-interrupted-check-failure

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Preserve an observed check failure on interruption

Context and goal

Closes #1416

Acceptance

  • A failed stage without an input key replaces the prior clean passing receipt before final validation. Interrupt at final validation and verify that ready refuses the receipt.
  • A successful intermediate checkpoint cannot replace a matching completed pass. Uninterrupted final validation and verdict behavior remain intact.
  • Replay offline in a temporary Git repo with fake GitHub.

Notes

  • Preserve the HEAD check and atomic publication under the task-state lock. Persist only negative evidence early. Final worktree validation remains necessary for a pass.

Base

main @ 8761b03
Base: 8761b03

Validation

Recorded for c886a60681f9

  • 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

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

Review

eowca and others added 2 commits November 26, 2026 03:39
Architecture-Review: document which completed receipts a checkpoint may replace.

Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
@eowca
eowca marked this pull request as draft November 26, 2026 02:50
@eowca
eowca deleted the branch lean178/1368-preserve-passing-receipt-v2 November 26, 2026 12:19
@eowca eowca closed this Nov 26, 2026
@eowca eowca reopened this Nov 26, 2026
@eowca
eowca changed the base branch from lean178/1368-preserve-passing-receipt-v2 to main November 26, 2026 12:20
Keep the passing checkpoint guard for the intermediate marker, and publish a failed stage early only when replacing an existing receipt.

Architecture-Review: unchanged in scope; the merged guide documents failure checkpoint replacement and final validation for a pass.
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 6f4151ae4d97e52de74dee1218c7f7d7986a4739, 28.8s: 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/cli.py
payload["settings_sha256"] = report.settings_sha256
def preserve_pass() -> bool:
def preserve_checkpoint() -> bool:
if report.results[-1] is not sandbox.INCOMPLETE_CHECK:

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: Checkpoint kind is detected by object identity with the INCOMPLETE_CHECK sentinel

preserve_checkpoint tells a success checkpoint from a failure checkpoint with report.results[-1] is not sandbox.INCOMPLETE_CHECK. This works today because _checkpoint_stage and the updated test both pass the module-level singleton. It breaks if any caller builds an equal CheckResult(INCOMPLETE_CHECK_COMMAND, 1, 0.0, ""), which is exactly how the pre-change test built it. That checkpoint would then be treated as negative evidence and overwrite a matching completed pass, which reintroduces the #1368 regression without any visible error. Smallest fix: compare report.results[-1].command == sandbox.INCOMPLETE_CHECK_COMMAND, matching what _check_report_problem already does at cli.py:385.

Comment thread src/loopzero/cli.py
def preserve_pass() -> bool:
def preserve_checkpoint() -> bool:
if report.results[-1] is not sandbox.INCOMPLETE_CHECK:
return not worktree.local_state_files(wt, CHECKS_FILE.name)[0]

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: A failure checkpoint is skipped when no receipt exists; this rule is implicit

For a failed stage, preserve_checkpoint returns not local_state_files(...)[0], so the early write only happens when a receipt already exists. Without a receipt, ready refuses anyway, so this is safe. Still, the condition is non-obvious, and the ARCHITECTURE.md wording ("replaces an existing receipt immediately") is the only explanation. A short comment at this branch, or a mention in the docstring, would stop a future reader from treating it as a bug and 'fixing' it to always write or never write.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Parked after the full slotted check and Claude primary approval on 6f4151ae. The fresh merge preview projects 8,060 source lines against the reserved limit of 8,150 and 13,880 test lines against the cap of 13,850. The test cap blocks queueing by 30 lines. The PR stays a draft.

@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 c886a60681f9b7779e6720a9a9ec8bfc4b922c4f, 24.7s: approve (0 critical, 0 important, 1 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 docs/ARCHITECTURE.md
@@ -545,10 +545,11 @@ the authoritative `checks.json` receipt. Checks lock the task state directory
through execution and receipt publication. A waiter can reuse a newly published
passing receipt when HEAD, settings and declared inputs match. Writers recheck

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: Docs no longer say a checkpoint cannot satisfy readiness

The resolved paragraph drops main's sentence that a checkpoint cannot "satisfy readiness before final worktree validation". It keeps "Final worktree validation is required before publishing a pass." The behaviour has not changed: _checkpoint_stage (sandbox.py:183) still appends INCOMPLETE_CHECK, and _check_report_problem (cli.py:384) rejects that marker. But a reader now has to infer that an intermediate checkpoint never satisfies readiness. Optional fix: add a short clause such as "An intermediate checkpoint is never a pass."

@eowca
eowca marked this pull request as ready for review November 26, 2026 14:56
@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 9f6a95b at 15:05 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 14:57 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1957
  • ✅ Merged 15:05 · 9f6a95b · 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

@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 merged commit 9f6a95b into main Nov 26, 2026
16 checks passed
@eowca
eowca deleted the lean178/1416-interrupted-check-failure branch November 26, 2026 15:05
@mergify mergify Bot removed the queued label Nov 26, 2026
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 failed check from leaving an older passing receipt after interruption

1 participant