fix(live-proof): avoid replaying one-shot terminal proofs - #1259
Conversation
Clarify that terminal entry executes before typed steps so one-shot proofs are planned once. Preserve intentional repeated commands and prove non-overwrite, nonzero-exit, and timeout safety through real tmux.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 3:17 AM ET / 07:17 UTC. ClawSweeper reviewWhat this changesThe PR preserves every declared terminal proof command, updates planner guidance to avoid accidental one-shot replays, and adds a constrained macOS proof generator with parser and driver coverage. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open: the current patch is correct and resolves the prior security finding with an attested constrained generation path; no contributor-facing defect remains in the reviewed diff. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherLive Proof turns a Codex review decision into a supervised browser or terminal verification run and then publishes a normalized receipt. This change affects the terminal-plan parser and the instructions that produce its entry command and subsequent steps. flowchart LR
A[Codex review decision] --> B[Live Proof plan parser]
B --> C[Automatic terminal entry]
C --> D[Typed terminal steps]
D --> E[Supervised terminal driver]
E --> F[Verification receipt]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one explicit command-preserving contract across the parser, schema, prompt, and documentation, with constrained generation remaining fail-closed outside its attested platform and CLI version. Do we have a high-confidence way to reproduce the issue? Yes: current source shows the prior leading entry/run normalization, and the committed controlled real-tmux receipt exercises the restored repeated-command and one-shot paths. Is this the best way to solve the issue? Yes: preserving declared commands avoids silently rewriting a plan, while explicit generator guidance prevents accidental one-shot replays before execution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ff813ac2fa76. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review The main PR body now records the maintainer decision to preserve every declared terminal command, including immediate duplicates, and resolves the applicable rank-up move. Exact-head CI is green, fresh real-tmux fast/delayed replays passed, and committed-branch autoreview is clean. The separately diagnosed local fixture failures remain disclosed. Please review the current head and body; no repair, autofix, or automerge is requested. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Resolves generated terminal Live Verification plans replaying a one-shot proof by placing the same command in both
entryand the firstrun. In PR 1240, entry passed all five assertions, then the replay correctly refused to overwrite the proof output. The trusted PR 1254 producer run also contained a duplicated entry/run command.Why This Change Was Made
Make the contract explicit where plans are generated: terminal
entryexecutes automatically before typed steps, and everyrunis a separate execution. One-shot proofs belong either in entry followed by expectations, or after safe setup as exactly one run. Media guidance must not encourage replay merely to obtain a transition.The base included PR 1256, which silently removed a leading identical run. This restores command-preserving parsing instead. Its cold-build/final-output retention remains intact. Public schema properties/types/required fields/enums/bounds, driver supervision, deadlines, failure gates, and non-overwrite protection are unchanged.
Maintainer Decision and Review Disposition
The maintainer decision is to preserve every declared terminal command, including an immediate
runidentical toentry. Command identity cannot tell the parser whether repetition is intentional. The planner owns avoiding accidental one-shot replay; supervision and target non-overwrite guards remain authoritative. A malformed duplicate plan may fail rather than have its program silently rewritten.Resolved: [P1] Remove the unsandboxed Codex proof command. The public recipe no longer grants full host authority. A dedicated constrained generator ignores user/project configuration and execution rules, disables shell/MCP/web/plugin/agent access, and uses a named restricted filesystem profile with no writable paths or child network access. It tests denied reads/writes, verifies actual startup permissions and tool inventory, and requires zero model tool calls before accepting a decision. The latest proof uses two new generations through the final unchanged helper, not old full-access decisions or retrospective re-attestation.
This applies the review's corresponding rank-up move. The helper is explicitly attested for macOS Seatbelt and Codex CLI
0.150.0-alpha.13; other platforms/versions fail closed pending re-attestation. This is not a blanket no-tools claim: the inspected, fingerprinted Code Mode wrappers expose only sandboxedapply_patch; an optional user-message tool has no host filesystem/network authority. The CLI's own authenticated inference transport is separate from model-directed tool access.User Impact
One-shot terminal proofs can be planned without accidental replay, explicit repeated commands are never silently discarded, and the public reproduction workflow no longer requires unrestricted model execution. Nonzero exits and real timeouts still fail. Release-note context is retained here and in the proof record, following the release-owned changelog disposition in PR 1256.
OpenClaw Bay Impact
Unaffected. Schema v1, verification lifecycle, publication/receipt contracts, and Bay's observer-only ownership do not change.
Documentation Impact
Updated active
docs/live-proof.mdand the production review prompt. The proof record documents the controlled fixture, constrained generation, real-tmux reproduction, and explicit platform/toolchain limits. The latest normalized receipt supersedes the historical full-access receipt without rewriting its history.Evidence
Real Behavior Proof
Claim: the planner describes a one-shot proof once, the constrained generator does not give model-directed tools unrestricted host authority, and parser/driver preserve intentional repetitions and existing failure gates.
Surface: production prompt/schema → actual constrained Codex generation → production parser → production terminal driver/tmux → schema-v1 verification. The generation phase receives a complete synthetic local fixture as data; it does not execute that fixture. The later real-tmux phase uses an allowlisted dependency-free command that exclusively creates an output directory, records invocations, writes stable bytes, and emits five markers.
Environment: local macOS, Node 24.19.0, tmux 3.7c, and the attested Codex CLI. The fast plan runs the proof only in entry; the 34-second delayed plan uses safe setup followed by one run. The helper denies unexpected permissions/tools or trace failures instead of falling back to full access. No driver deadline was raised.
Exact committed head:
a08acddf53cc688d4fd38206898fb35023c9c1f6. Fresh fast and delayed real-tmux replays both passed at this committed head using/opt/homebrew/opt/node@24/bin/node(Node 24.19.0), with that Node directory first onPATH. These are replays of the original constrained-generated decisions, not fresh model calls. Freshpreparebundles recorded this head, and their source hashes, prompt SHA256, and schema SHA256 matched the original generation bundles exactly. Each decision was copied byte-for-byte; its originalgeneration.jsonprovenance was retained at the original path and explicitly referenced by ageneration-reuse.jsonrecord withreusedDecision: trueandfreshModelCall: false. The unchanged helper SHA256 is2b12954b5afe14cb2d451a5457342ca1ad5f29703b2deb5426f162f80692f41e, matching both original generation attestations. Both replays observed all five required named PASS assertions; additional setup/start expectations were allowed and also passed. Each invoked the proof once before direct replay, which exited 17 without changing the result bytes. Duplicate execution, intentionalbeforeafterrepetition, exit-7 failure, and the real 30-second timeout all behaved as required. No timeout or proof contract was changed.Local exact-head artifacts (SHA256):
.artifacts/terminal-proof-planning/safe-head-fast/receipt.json—b8de86e491438253bf6f303c0eebc2905cbeeb7af719c423e02841ad76d3e052. Reuse provenance:.artifacts/terminal-proof-planning/safe-head-fast/generation-reuse.json—9844946e8b316e17ad548ce5dcf519438df356890f0ba6d4635ba0954264cf17..artifacts/terminal-proof-planning/safe-head-delayed/receipt.json—e0aa2508433e27d5b21cab36e169d477570a0fcda90ed953bf490f32273f7af8. Reuse provenance:.artifacts/terminal-proof-planning/safe-head-delayed/generation-reuse.json—24904d465832968e3dd038da30b204e241c1530cfe7b8f454725505b748cc9e0.The committed public normalized receipt retains its actual original runtime head and uncommitted source hashes; it was not rewritten to invent a self-referential commit SHA. These new local receipts provide the exact-head binding.
Observed results: each generated plan invoked the one-shot command once and observed all five named assertions. Direct replay exited 17 and preserved the original bytes. A deliberately duplicated entry/run executed twice and failed its overwrite guard. Identical later commands separated by a file-state change observed
beforeafter. Exit 7 and a silent 40-second command failed under existing gates. File bytes and invocation traces support these assertions independently of printed PASS strings.Provenance: the linked normalized receipt binds the new generation's final-helper hash, prompt/schema/decision hashes, effective permissions/tool inventory, and real-tmux outcomes. Final-head replay binds those same generated decisions and unchanged implementation inputs to the committed head above. Raw agent transcripts and private model identifiers are not included.
Limits: controlled local terminal fixture—not target Worker/apply correctness, hosted review execution, all future model generations, or cross-platform generator support. Recording/transcoding/publication were not tested. No live apply/close, workflow pause, or external proof upload was performed.
PR 1254 status investigation
No separate driver status bug was established. Producer and base drivers are identical. Real tmux probes showed a previous-command gate can expire and final capture can later collect successful output while verification correctly stays failed: the requested next command never executed. The late-capture probe deliberately injected latency, establishing possible ordering rather than the producer's actual timing. The original artifact lacks status-sample timestamps; target JSON containing
exit:0cannot erase a timeout. Driver status logic and deadlines remain unchanged.Validation and landing gates
Current-head CI evidence is available in the PR Checks tab. Landing requires successful CI, CodeQL, and hermetic e2e results attached to
a08acddf53cc688d4fd38206898fb35023c9c1f6, plus clean committed-branch autoreview and a current-head/body ClawSweeper review with no unresolved actionable finding. The final maintainer verification checks those live results rather than freezing a transient pending state in this body.For historical context, the prior runtime head
ca48d41487affa905cb775da8a985d1b128b18c3passed CI, hermetic e2e, and CodeQL. Those runs do not substitute for checks on the new head.The earlier full local
pnpm run checkfinished with 3,712 passed, 49 failed, nine skipped on Node 24.19.0; it is not represented as green. Independent diagnosis reproduced 42 inherited Git-pruning failures deleting fixtureorigin/main, six unavailable pinned-pnpm versions in fresh offline mirrors, and one timing-sensitive setup-budget assertion. Ten representative Git-affected tests passed with process-local pruning disabled; the timing test passed three focused reruns. Owners/fixtures were byte-identical to the base and failed outside the changed parser path. Not every blocked scenario was rerun after removing its host-config blocker. These issues remain a separate follow-up; no global configuration or unrelated tests were changed.The maintainer has explicitly authorized landing after the above gates pass. This does not authorize live apply/close or workflow mutation.