Skip to content

Stream local check output into a bounded diagnostic tail - #1409

Merged
mergify[bot] merged 2 commits into
mainfrom
lean178/1194-bounded-check-output-v3
Nov 26, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
lean178/1194-bounded-check-output-v3

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Local sandbox stages drain the merged output stream and retain a bounded diagnostic suffix. Verbose and timed-out checks keep the 16 KiB receipt format, exit code and final diagnostic.

Closes #1194

Supersedes #1343. The change carries forward the reviewed fix and resolves its overlap with #1353’s raw review-diff capture. Review commands continue using the existing raw byte capture; local stages use the bounded text capture.

Validation

Recorded for 4eb81754a123

  • 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
  • A 50 MiB regression preserves output order, the final diagnostic, and exit 7 under a 4 MiB parent allocation limit.
  • Thirteen focused sandbox cases, process tests, the raw diff regression, Ruff, and the integrated size budget passed.
  • The timeout test checks the last diagnostic, timeout marker, 16 KiB tail, and early stop.

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

Review

  • primary, claude, 3b649d6, approve

Co-Authored-By: Codex <noreply@openai.com>
@eowca
eowca marked this pull request as draft November 26, 2026 02:35

@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 3b649d6fe937c2c1b6fc51f2bf3cee543c44999a, 45.6s: 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 tests/test_sandbox.py

def test_timeout_is_recorded_with_drained_output(git_repo, bwrap_log):
command = "printf '%20000s\\n' ''; echo last diagnostic >&2; exec sleep 30"
report = sandbox.run_checks(

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: Real-process timeout test depends on a 1s wall-clock window

test_timeout_is_recorded_with_drained_output needs bash to start, run printf and echo last diagnostic >&2 within the real 1s timeout. On a slow or heavily loaded CI host, the deadline can hit before the final diagnostic is written. The endswith("\nlast diagnostic\n\n[loopzero] timed out after 1s") assertion would then fail even though the code is correct. Smallest fix: raise the timeout to a few seconds (the child exec sleep 30 still guarantees a timeout), or have the child signal readiness before it sleeps. The streaming logic itself looks correct. Incremental decode with newline translation matches communicate's text decoding. Parent memory stays bounded at roughly 2×limit plus a 64 KiB chunk. On timeout, the trailing newlines are kept and the original exc.output/ProcTimeout path is reused. The preserve_newlines raw-diff path is rejected by the guard and left unchanged.

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

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

So far

  • ✅ Entered the queue Thu 26 Nov, 02:51 · rule main · triggered by @eowca with the @mergifyio queue command
  • ❌ Checks failed · draft #1437
  • 🚫 Left the queue 02:58 · 3b649d6

Not proven to be this pull request's failure. It failed on top of the pull requests ahead of it, and was not tested alone.

Reason

The merge conditions cannot be satisfied due to failing checks

  • checks

Failing checks:

To get back in the queue

  • If the failure comes from the pull requests it was tested with, or is a flake, comment @mergifyio queue to queue it again as it is.
  • If it is this pull request's, push a fix: the pull request is queued again once its queue conditions match.

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

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify mergify Bot removed the dequeued label Nov 26, 2026
@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 91d2e10 at 07:47 UTC

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

So far

  • ✅ Entered the queue Thu 26 Nov, 07:42 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1661
  • ✅ Merged 07:47 · 91d2e10 · 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 91d2e10 into main Nov 26, 2026
13 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1194-bounded-check-output-v3 branch November 26, 2026 07:47
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 local check output capture bounded before writing the receipt

1 participant