Skip to content

Keep Loop Zero command output concise - #1322

Closed
eowca wants to merge 3 commits into
mainfrom
lean178/1085-check-output
Closed

eowca wants to merge 3 commits into
mainfrom
lean178/1085-check-output

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Bound check failures and elapsed-time updates

Context and goal

  • Goal: Keep the failure cause and receipt identity visible while keeping check output short.
  • Problem: Long structured failure lines and unchanged 30-second heartbeats dominate transcripts.
  • Context: An oversized failure preview clips long lines and marks omissions. The checked head and full diagnostic tail remain in the check receipt. A silent stage reports at 30 seconds and every five minutes thereafter.

Refs #1086
Refs #1084

Acceptance

  • The large failure fixture stays below 2,500 bytes and retains the failing command, exit code, standalone migration error, final assertion, offline remedy and matching receipt path. Stale or failed receipt publication emits no receipt pointer.
  • A simulated hour-long stage in a 24-stage check stays below 2,400 bytes and retains stage completion, verdict and receipt identity.

Notes

Transcript size

Scenario Before After
Oversized check failure 16,618 bytes 1,355 bytes
Check with one silent hour 5,928 bytes 1,893 bytes

Base

Base: 52ddf36

Validation

(no loopzero check run recorded)


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

Review

  • primary, claude, 1e2c5a0, request_changes

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 1e2c5a09fbf4225de6acfd0a447bddd488671bf4, 58.7s: request_changes (0 critical, 1 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
return 0


def _check_failure_preview(tail: str, limit: int = 1536) -> str:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

important: Failure preview silently drops long lines, including the final error, and adds no omission marker

When the tail is over 1536 bytes, _check_failure_preview removes every line longer than 768 bytes, wherever it is, then keeps the last 1536 bytes. Nothing in the output shows where lines were removed. Many real failures end in one long line, such as a pytest AssertionError: assert {...} == {...}, a compiler diagnostic or a JSON error. That line is dropped, and the terminal shows the earlier lines as if they were a continuous tail. Only the fixture's short final line survives. The only pointer to the full text is the Full diagnostic tail line. That line is not printed when the head moved or the receipt write fails, which happens after printing. In those cases the dropped text is lost from the transcript, whereas before the change all 40 lines were printed. The byte slice can also start partway through a line.

Smallest fix: keep the lines in order and shorten each long line in place, keeping its start and end around a [... N bytes omitted] marker, instead of deleting it. Always keep the last non-empty line. When the cut-off is not at a line boundary, start the preview with a marker. Add a test where the oversized line is the final error line.

Comment thread src/loopzero/sandbox.py Outdated
while not stopped.wait(delay):
status(f"stage {ordinal}/{total}: running "
f"({time.monotonic() - started:.1f}s elapsed)")
delay = 300.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: The five-minute heartbeat interval is a hard-coded number that tests cannot change

delay = 300.0 is a bare literal inside heartbeat(), while the first delay is the module constant FIRST_HEARTBEAT_DELAY. The sandbox tests now only exercise the first heartbeat. A later edit to the repeat interval would not show up in a named constant, and tests could not shorten it. Add a constant such as HEARTBEAT_INTERVAL = 300.0 next to FIRST_HEARTBEAT_DELAY and use it here.

Comment thread src/loopzero/cli.py Outdated
if readiness is not None and args.wait is not None and _pending_checks(config, pr, readiness):
# One waiter and one deadline span source checks and landing: a check created
# by the ready transition must not end the turn between `ready` and the queue.
# Share the merge deadline with checks scheduled after readiness.

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: Unrelated cleanup removes explanatory comments and docstrings

The diff also removes or shortens comments that explain why the code works as it does:

  • _wait_for_checks loses its docstring, which said readiness is omitted for an allowed merge.
  • The _pending_checks docstring no longer says that a skipped result from draft CI is why skips are allowed.
  • The merge comment no longer says that a check created by the ready transition must not end the turn between ready and the queue.
  • The missing-run comment no longer says that missing runs do not prove no workflow was scheduled.

It also makes one-line rewrites that are not needed for this task, such as the env merge, the walrus in cmd_check and the long cmd_ready condition. None of this changes behaviour, but it makes the diff noisier and removes the reasoning behind non-obvious wait rules. Keep the original wording, or move this cleanup to a separate change.

Architecture-Review: unchanged; the bounded preview now marks truncation and keeps excerpts of long lines

Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; preserves guarded receipt publication and the documented output cadence

Co-Authored-By: Codex <noreply@openai.com>
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.

1 participant