Skip to content

Show reusable local checks in status - #1423

Closed
eowca wants to merge 4 commits into
mainfrom
lean178/1301-status-receipt-v2
Closed

eowca wants to merge 4 commits into
mainfrom
lean178/1301-status-receipt-v2

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Show reusable local checks in status

Context and goal

  • Goal: Show builders when local checks already passed and let them go directly to opening a PR.
  • Problem: Status tells builders to rerun local checks even when the worktree has a reusable passing receipt. The wall-clock audit counted 22 heavy-slot runs after a green run at the same recorded head, base and command.
  • Context: Readiness already validates the local receipt against the head and effective check settings. Status now uses the same verifier.

Fixes #1301

Replaces #1316 after a merge conflict in the status tests required a fresh review.

Acceptance

  • A clean head with a matching successful receipt displays the pass before PR lookup and points to loopzero pr when no PR exists.
  • Missing, partial, failed, stale and fingerprint-mismatched receipts and dirty worktrees cannot show a reusable pass.
  • An open PR shows the local result and the live readiness reasons. Readiness still verifies the local receipt and all remote requirements.

Base

Base: 2ef0b72

Notes

The offline no-PR replay failed on main because the local line was absent at lookup. The focused status suite passes with the fix, covering receipt rejection and pending hosted CI.

Validation

Recorded for 462bb6b991ab (not current head) (unverified, run loopzero check)

  • 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

  • primary, claude, f41fe72, approve

eowca and others added 4 commits November 26, 2026 02:31
Architecture-Review: unchanged; status uses readiness's existing receipt verifier without changing any gate.
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; the test still sends the signal when the gh child starts.
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 f41fe7240eda28012d166dd625a38de33087a418, 31.1s: approve (0 critical, 0 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)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/cli.py
print(f"dirty: {'yes' if worktree.is_dirty(wt) else 'no'}")
dirty = worktree.is_dirty(wt)
print(f"dirty: {'yes' if dirty else 'no'}")
checked = not dirty and _current_check_report(wt, config, head) is not 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: Receipt is verified twice when a PR exists

When a PR exists, cmd_status checks the receipt once through _current_check_report to print the status line. Then _readiness (cli.py:286-287) loads the same receipt again and recomputes sandbox.settings_fingerprint. If a check runner is configured, that also re-hashes the runner executable. The two results should agree, but the work is duplicated, and the line and the readiness reason could drift if either path changes later. Smallest fix: compute _load_report plus _check_report_problem once in status and pass the result to _readiness through an optional parameter. Alternatively, accept the extra cost, since status is not a hot path.

Comment thread src/loopzero/cli.py
dirty = worktree.is_dirty(wt)
print(f"dirty: {'yes' if dirty else 'no'}")
checked = not dirty and _current_check_report(wt, config, head) is not None
print(f"local checks: {'passed' if checked else 'no reusable pass'}", flush=True)

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: New label breaks the aligned status columns

Every other status line pads its label to a 10-character column (dirty: , pr: , ready: ). local checks: is wider and misaligns the output. Consider a shorter label that fits the column, such as checks: passed or local: passed, and update the test strings to match. This is cosmetic only.

Comment thread tests/test_cli.py
assert sum(1 for c in gh.calls if c["argv"][:2] == ["api", reviews_key()[4:]]) == 1


@pytest.mark.parametrize("receipt", ["pass", "missing", "partial", "failed", "stale", "fingerprint"])

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: Clean-tree dirty receipt is not covered in the no-PR test

The acceptance criteria include rejecting dirty worktrees and dirty receipts. test_status_full covers a dirty worktree only with a PR present. The new parametrized test has no case for a receipt whose "dirty": true on a clean tree. Adding a "dirty" parameter that sets report["dirty"] = True would cover the report.dirty branch of _check_report_problem on the no-PR path.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Owner queue route for f41fe7240eda: the local receipt guard rejects the remote worker’s incompatible settings fingerprint. The heavy-slot check passed every stage at this head. Required hosted checks are green, and the fresh review approved this head.

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

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

So far

  • ✅ Entered the queue Thu 26 Nov, 02:55 · rule main · triggered by @eowca with the @mergifyio queue command
  • ❌ Checks failed · draft #1441
  • 🚫 Left the queue 03:00 · f41fe72

The failure is in this pull request. It failed tested alone on top of main.

Reason

The merge conditions cannot be satisfied due to failing checks

  • checks

Failing checks:

To get back in the queue

  • Push a fix: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, comment @mergifyio queue to queue it again as it is.

Merge conditions not met when it left the queue

  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-neutral = checks
    • check-skipped = checks
    • check-success = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility
    • check-success = Loop-zero Eligibility
1 merge condition met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@mergify mergify Bot mentioned this pull request Nov 26, 2026
10 of 30 tasks
@mergify mergify Bot added dequeued and removed queued labels Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Parked at the approved head. Mergify candidate #1441 measured 13,886 test lines against TESTS_CAP=13,850. Its base already measured 13,850. The source-head full suite and both required hosted checks passed.

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing on Lean's decision from the test-line supply audit (#575 (comment)): this PR's test and source cost on a full cap outweighs its measured benefit. The approved work stays in the branch history. Reopen or replace it only with new evidence of a material, measured saving or failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show reusable local checks in loopzero status before GitHub lookup

1 participant