Skip to content

Document check and sandbox exit codes - #1705

Merged
mergify[bot] merged 2 commits into
mainfrom
lean178/1703-document-check-exits
Nov 26, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
lean178/1703-document-check-exits

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Document check and sandbox exit codes

Context and goal

  • Context: Exit status drives wrapper retry decisions and readiness handoffs. Closes Document when check exit 1 is not a failed stage #1703.
  • Problem: The contract describes the check exit code as the verdict even when the command rejects a result or cannot start the sandbox.
  • Goal: Tell callers which evidence distinguishes a failed stage from an unusable receipt or a sandbox failure.

Acceptance

Validation

Recorded for e9357260c0da

  • 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
  • Focused CLI tests and scratch probe confirm stage failure, checkout change, receipt rejection, sandbox failure, and usage error outcomes.
  • No production or test code changed.

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

Review

Architecture-Review: unchanged; the contract clarifies existing outcomes without changing execution or trust boundaries.
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 6008661b90103c2bbd941fcfd2293df3e39f6dd8, 24.5s: 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)

Findings without a file location:

  • suggestion: Code comment still says check's exit code is the verdict — This PR removes the line "Its exit code is the verdict" from CONTRACT.md because check exit 1 can also mean a discarded result (cli.py:661), an unverified receipt (cli.py:666) or a command error (cli.py:1819). The comment at cli.py:918 still says # the exit code is the verdict, as for check. The task rules out changing code, so this can wait for a later PR. When someone does touch it, the smallest fix is to drop , as for check from the comment.

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

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

🛑 Queue command cancelled

Queue requested — the merge queue status continues in this comment ↓.

@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.

Architecture-Review: unchanged; the contract retains delivery semantics while shortening surrounding prose.
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 delta review by claude on e9357260c0da03fa89256cfc08254e5edc179c9d, 19.6s: approve (0 critical, 0 important, 4 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 core/CONTRACT.md
5. `loopzero ready --wait` marks eligible PRs ready and activates drafts with
only missing/skipped checks even with mergeability pending. Activation without a
wait exits 3. Both waiters use `--wait[=SECONDS]` (default 1800) on the same
head. Zero can activate or enqueue. Mergeability can time out (exit 3)

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: Shortened text drops 'pending' from the mergeability timeout

The old text said "Pending mergeability can time out (exit 3) with green checks." The new text says "Mergeability can time out (exit 3)". That reads as if any mergeability state can time out, when the case is a still-pending computation. "Zero can activate or enqueue" is also hard to parse now that "seconds" is gone, since --wait=0 is no longer obviously the subject. Smallest fix: write "Pending mergeability can time out" and "--wait=0 can still activate or enqueue". Both still fit on the same lines.

Comment thread core/CONTRACT.md
`--wait` shares a budget across source-check and landing waits. Enqueueing
without `--wait` returns 0 without cleanup.
SHA and deletes the branch and worktree. A cleanup warning follows a verified
merge. Follow its recovery step. Queueing without `--wait` exits 0 without

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 paragraph no longer says that a queue enqueues

The old sentence "A queue initially enqueues" told callers that with a merge queue configured, merge enqueues instead of merging directly. The new "Queueing without --wait exits 0 without cleanup" assumes the reader already knows that, which matters for the step-6 handoff. Consider "With a queue, merge enqueues; without --wait it exits 0 without cleanup."

Comment thread core/CONTRACT.md
Fail closed on missing tools and command errors, preserve the failing command
and output tail, and keep a short, safe detail about the cause or stage when
operator-facing code wraps an error. Stop on terminal failures or quota errors.
Fail closed on missing tools or command errors. Preserve the command and output

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: Failure-rule rewrite drops the scope 'when operator-facing code wraps an error'

The old rule limited the safe cause/stage detail to cases where operator-facing code wraps an error, and asked for a short detail. The new rule "name the cause or stage safely" applies to every failure and drops the brevity limit. This quietly broadens a code-facing requirement in a PR that says it only clarifies check exit codes. If the only goal was to save lines, keep the qualifier, e.g. "name a short, safe cause or stage when wrapping errors".

Comment thread core/CONTRACT.md
and none pending, inspect scheduling, triggers and permissions, then retry.
4. `loopzero review` defaults to independent review of the exact head and posts
one GitHub review with inline findings. Approval exits 0, changes requested 5.
5. `loopzero ready --wait` marks eligible PRs ready and activates drafts with

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: Line-budget rewrites reach into unrelated steps

To stay within the core-docs line cap, this commit rewrites the review, ready and merge text (steps 4–6), which have nothing to do with check/sandbox exit codes. Each rewrite is a chance to change meaning without anyone noticing (see the other findings). Lines 22 and 25 also no longer wrap like the rest of the list (84 and 90 columns). Next time, take the saved lines from the Failure section itself, or wrap the edited lines consistently.

@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 5d49e6d at 09:24 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 09:18 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1753
  • ✅ Merged 09:24 · 5d49e6d · 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 5d49e6d into main Nov 26, 2026
18 checks passed
@eowca
eowca deleted the lean178/1703-document-check-exits branch November 26, 2026 09:24
@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.

Document when check exit 1 is not a failed stage

1 participant