fix: terminal proof rejects soft-wrapped output - #1285
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 1:19 PM ET / 17:19 UTC. ClawSweeper reviewWhat this changesThe PR makes retained tmux terminal assertions join soft-wrapped rows while preserving hard newlines, whitespace, and visual screen-row output. Merge readinessThis PR remains necessary because current main still captures terminal assertion text without tmux soft-wrap joining. The exact introduced change is narrow, preserves the separate visual viewport, and has sufficient real-tmux proof with no actionable correctness or security finding. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s retained terminal verifier captures tmux pane output to evaluate historical terminal assertions while separately retaining a visual terminal viewport. Command output flows through these captures into assertion results and diagnostic verification receipts. flowchart LR
A[Terminal command output] --> B[tmux pane]
B --> C[Assertion capture]
B --> D[Visual viewport capture]
C --> E[Literal assertion check]
E --> F[Verification receipt]
D --> F
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep the logical assertion capture joined only for tmux soft wraps and retain the physical-row viewport, then land the focused fix through normal maintainer review. Do we have a high-confidence way to reproduce the issue? Yes: current main’s assertion captures omit -J, and the supplied exact-head real-tmux fixture exercises the 160-column soft-wrap case plus hard-newline and nonzero-exit controls. This review inspected the source and submitted trace but did not execute the fixture. Is this the best way to solve the issue? Yes: adding -J only to logical assertion snapshots fixes layout-only wrapping without weakening literal matching or changing the separately captured visual viewport. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ccac077fea2f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review The main PR body now records successful exact-head CI (including |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Resolves a problem where the retained terminal verifier rejects successful output when an expected phrase crosses the terminal's 160-column soft-wrap boundary. The historical symptom was
peerD/ependenciesappearing on adjacent screen rows in this review, despite the command succeeding. That link is context, not a claim that the original OpenClaw tests were rerun here.Why This Change Was Made
Use tmux's wrap metadata (
capture-pane -J) for assertion history and the initialpresentAtStartsnapshot, retaining literalincludesmatching, hard newline boundaries, whitespace, exit-status checks, and command isolation. Final viewport capture deliberately keeps physical screen rows.This repairs the retained verifier only. Automatic generation remains retired by #1280; the intervening historical-proof classification and helper-retirement changes are included in the base. No automatic lane, policy gate, timeout/retry, dependency, schema, or OpenClaw product code changes.
User Impact
Operators using retained terminal tooling can match phrases split only by terminal layout without accepting a true newline inside the phrase, a nonzero exit, or a marker left by a previous command. Visual output remains wrapped as rendered. Ordinary automatic reviews do not resume proof execution.
OpenClaw Bay Impact
Unaffected: no observer fields, projections, routes, controls, lifecycle policy, or proof-credit rules change. Historical receipts remain diagnostic; this patch does not turn terminal PASS into behavioral-proof sufficiency.
Documentation Impact
Reviewed
AGENTS.md,CONTRIBUTING.md,VISION.md,README.md, anddocs/README.md. Updated the compatibility-onlydocs/live-proof.mdto distinguish logical assertion captures from visual viewport rows. Its existing maintainer owner and update triggers remain accurate. No changelog change.Evidence
Tested committed head:
c0eb630aa15632640695ba6d8497ca9d8f8470df.Base:
ccac077fea2f63570bd7d91969ee69abcca310e0.Diff: production +3/-2 (two flags and one comment), tests +82/-9, docs +4/-0; three files only.
pnpm run build;pnpm run check:docs;git diff origin/main..HEAD --check.f72ea010c1d7fd134b1bd0826b3a707778c312bcplus this patch: 173 passed, 0 failed, 0 skipped fornode --test test/live-proof.test.ts test/live-proof-review-environment.test.ts test/live-proof-report.test.ts. This is supporting pre-rebase evidence, not an exact-head full-suite claim.origin/mainpassed. Both named gates used the helper's requested default P0 reporting scope, with no reported findings. No review transcripts are attached.Full-check limitation: the earlier local
pnpm run checkpassed static/docs, all builds, lint, and changed-surface coverage, then stopped making progress in the existingtest/action-ledger-runtime.test.tsimport-bindings pause subprocess. The owned run was stopped after more than 17 minutes. This does not establish a patch regression; the two corresponding main CI runs were green. No ledger changes or gate bypasses are included. Fresh exact-head hosted CI now passed: CI run 33193117080 completed successfully, includingpnpm check, sparse repair build smoke, and Windows Codex launcher. CodeQL run 33193117034 also passed. These results close the local full-check validation gap without changing or bypassing the ledger tests.Review disposition: the first ClawSweeper review assessed the real behavior proof as sufficient and found no actionable correctness or security issue. Its two remaining checklist entries both concerned the then-pending broad CI check; the exact-head success above resolves them. No Rank-up moves were requested. The short three-case real-runtime proof was refreshed on the same unchanged head before requesting the updated review.
Real Behavior Proof
Claim and exercised surface: compiled
driveTerminal→ realmediaProofCommandRunner/tmux PTY →buildLiveVerificationResult→parseLiveVerificationResult. This directly exercises the changed capture boundary and downstream PASS/FAIL interpretation, rather than substituting a mocked capture or treating a generic command exit as proof.Environment: local macOS arm64, Node 24.20.0, pnpm 11.10.0, tmux 3.7c; native local execution, no Crabbox provider/image/lease. Media recording disabled. The tmux manual specifies that
-Jpreserves trailing spaces and joins wrapped lines.Fixture:
prepares pruned esm output with an actual peerDependencies host, padded sopeerDends at column 160. The baseline real-PTY regression on pre-fix production code failed despite exit 0 and showedpeerD\nependencies; the same test after the fix passed. The regression and negative controls are public intest/live-proof-review-environment.test.ts.Run from the repository root with Node 24 and tmux installed:
pnpm run build node --test --test-name-pattern='terminal proof (supervises consecutive commands in the same pane|preserves hard newlines and exact whitespace|does not satisfy a command from the previous pane state|cleanup terminates a signal-resistant descendant in a distinct process group|cannot pass from package-manager echo before a nonzero exit)' test/live-proof-review-environment.test.ts node /tmp/terminal-soft-wrap-runtime.mjsThe standalone script is included below so the runtime reproduction does not depend on inaccessible local files. It records the actual Git HEAD in each receipt and asserts all three outcomes; only its generated fixture directories are removed.
Observed final-head runtime trace (all three expected outcomes verified):
The passing case's returned viewport still contains
peerD\nependencies hostand does not contain the contiguous marker, while its assertion is satisfied. The hard-newline fixture separately proves exact whitespace can match without allowing the contiguous phrase. The package-manager test still uses an actualpnpm runecho followed by exit 7.Artifacts and limits: the trace above and public regression source provide inspectable evidence; the standalone script writes timestamped, exact-head verification receipts to
/tmp/terminal-soft-wrap-runtime-receipts.json. This is a controlled synthetic controller proof, not a rerun of the original OpenClaw 18 tests, a video, a live-channel run, or evidence of automatic proof execution. The fixture's18 passedline is synthetic text only. No foreign PR was mutated, and no historical receipt is being used to grant proof credit.Standalone runtime reproduction — save as /tmp/terminal-soft-wrap-runtime.mjs