|
| 1 | +# Terminal proof planning |
| 2 | + |
| 3 | +Status: fresh constrained generation and local proof at runtime head |
| 4 | +`ca48d41487affa905cb775da8a985d1b128b18c3`, with the generator and documentation |
| 5 | +fix still uncommitted. Exact final-head replay remains pending. This record does |
| 6 | +not authorize a commit, publication, or live mutation. |
| 7 | + |
| 8 | +## Claim and provenance |
| 9 | + |
| 10 | +The planner should describe a one-shot terminal proof once, while the parser and |
| 11 | +driver preserve every intentional command and all existing failure gates. Entry |
| 12 | +runs automatically before steps; a run step is another execution, never a |
| 13 | +restatement of entry. |
| 14 | + |
| 15 | +[The successful entry and failed replay on PR 1240](https://github.com/openclaw/clawsweeper/pull/1240#issuecomment-5403433718) |
| 16 | +exposed a plan that ran a non-overwriting proof twice. The |
| 17 | +[PR 1254 producer artifact](https://github.com/openclaw/clawsweeper/actions/runs/33033345816) |
| 18 | +also repeated entry as its first run: that run failed waiting for entry, even |
| 19 | +though the captured output later contained exit zero and successful validation. |
| 20 | +Those are distinct failure observations. The producer and this base have identical |
| 21 | +terminal drivers. Independent real-tmux probes confirmed that a previous-command |
| 22 | +timeout remains failed even if entry finishes successfully during final capture: |
| 23 | +the requested next command never ran. That probe deliberately injected capture |
| 24 | +latency to establish the ordering, not to claim the producer experienced it. The |
| 25 | +original artifact lacks status-sample timestamps, so no distinct driver status bug |
| 26 | +is established. Driver supervision, deadlines, and failure latching are unchanged. |
| 27 | + |
| 28 | +[PR 1256](https://github.com/openclaw/clawsweeper/pull/1256), present in the base, |
| 29 | +silently removed an exact leading duplicate. This change removes only that |
| 30 | +normalization, restores command-preservation tests, and clarifies the production |
| 31 | +prompt and schema descriptions. Its cold-build/final-output verification changes |
| 32 | +remain intact. The public schema's properties, types, required fields, enums, |
| 33 | +and bounds are unchanged. |
| 34 | + |
| 35 | +Release-note context, retained here following the release-owned changelog |
| 36 | +disposition in PR 1256: terminal proof planning now explicitly separates automatic |
| 37 | +entry execution from subsequent commands, avoids accidental one-shot replays for |
| 38 | +media, and preserves intentional repeated commands. |
| 39 | + |
| 40 | +## Reproduce |
| 41 | + |
| 42 | +Use Node 24 or newer, the repository pnpm, real tmux, and an authenticated Codex |
| 43 | +CLI with the built-in ChatGPT-backed provider. The generation helper currently |
| 44 | +attests macOS Seatbelt and CLI `0.150.0-alpha.13`; other platforms or versions |
| 45 | +must be re-attested, not allowed to fall back to full access. Do not put private |
| 46 | +model identifiers or raw agent transcripts in proof records. Run from this |
| 47 | +checkout after building: |
| 48 | + |
| 49 | +```bash |
| 50 | +pnpm run build |
| 51 | +mkdir -p .artifacts/terminal-proof-planning |
| 52 | +node scripts/e2e/terminal-proof-planning.mjs prepare .artifacts/terminal-proof-planning/fast fast |
| 53 | +``` |
| 54 | + |
| 55 | +`prepare` uses the production review-prompt assembly and full decision schema. |
| 56 | +The only extra input is a synthetic, fully supplied local fixture review request; |
| 57 | +it supplies commands and expected output, not a hand-written plan. It writes the |
| 58 | +exact prompt/schema inputs and their hashes. Generate the decision with real |
| 59 | +Codex inference, without executing any commands from the prompt: |
| 60 | + |
| 61 | +```bash |
| 62 | +proof_bundle="$PWD/.artifacts/terminal-proof-planning/fast" |
| 63 | +node scripts/e2e/terminal-proof-generate.mjs "$proof_bundle" |
| 64 | +node scripts/e2e/terminal-proof-planning.mjs run "$proof_bundle" fast |
| 65 | +``` |
| 66 | + |
| 67 | +An optional second helper argument selects the host-approved model for this |
| 68 | +invocation only; it is never written into the sanitized receipt. User routing |
| 69 | +configuration is intentionally ignored. Authentication uses the existing login; |
| 70 | +no credentials are copied or extracted. |
| 71 | + |
| 72 | +Generation is a distinct constrained workflow. The helper supplies the entire |
| 73 | +production prompt and schema as data to `codex exec --ignore-user-config |
| 74 | +--ignore-rules --ephemeral --strict-config`, with approval `never` and the named |
| 75 | +`terminal-proof` permission profile. That profile allows minimal OS reads and |
| 76 | +reads of an empty workspace, no writable paths, and no child network access. |
| 77 | +The CLI adds read access to its bundled shell and executable shim; the helper |
| 78 | +also verifies those effective runtime roots from the session-start trace. |
| 79 | +Shell execution, image reads, web search, MCP, plugins, skills, hooks, and nested |
| 80 | +agents are disabled; no executable fixture is placed in the workspace. Ancestor |
| 81 | +project configuration is refused and project instructions are disabled. Only |
| 82 | +the CLI's own inference/authentication transport may contact the configured |
| 83 | +service. A temporary cwd or a textual instruction alone is not this boundary. |
| 84 | + |
| 85 | +Before inference, a trusted sandbox probe must fail to read a harmless sentinel |
| 86 | +outside the workspace and fail to create a file inside it. After inference, the |
| 87 | +helper checks actual startup settings and the model-facing request's tool |
| 88 | +inventory, requires zero tool calls, and only then copies the generated decision |
| 89 | +into the bundle. This CLI has no blanket no-tools flag: its remaining |
| 90 | +`apply_patch` tool is restricted by the same read/write sandbox. Model metadata |
| 91 | +can require Code Mode despite feature flags, so the helper fingerprints the |
| 92 | +inspected `exec`/`wait` wrappers: their V8 environment has no Node, filesystem, |
| 93 | +or network primitives and exposes only sandboxed `apply_patch`. An optional |
| 94 | +user-message tool has no filesystem or network authority. Unexpected tools, |
| 95 | +changed wrapper definitions, missing trace evidence, or failed checks stop the |
| 96 | +helper. Do not replay a decision until its attestation passes. |
| 97 | + |
| 98 | +Repeat with a fresh directory and `delayed` instead of `fast` in both script |
| 99 | +invocations. The delayed command emits a startup line, then takes 34 seconds, |
| 100 | +longer than entry startup polling. No driver timeout is extended. Existing |
| 101 | +directories are refused; use new names for subsequent captures. |
| 102 | +Inspect temporary Codex diagnostics locally if generation fails; do not copy |
| 103 | +them into the proof bundle or public artifacts. The helper retains only the |
| 104 | +structured decision and sanitized `generation.json` in the bundle. Local raw |
| 105 | +traces are diagnostic evidence, never publication artifacts. |
| 106 | + |
| 107 | +The replay script parses the full model decision through the production parser, |
| 108 | +requires the generated plan to survive unchanged, checks its command allowlist, |
| 109 | +and executes it through the production terminal driver on a dedicated real tmux |
| 110 | +server. It requires all five assertions to be observed, not merely schema-v1 |
| 111 | +successful-exit fallback. Files and invocation traces prove single execution and |
| 112 | +byte preservation on a refused replay. Hand-written negative controls are clearly |
| 113 | +marked separately from model-generated proof: an exact leading duplicate must |
| 114 | +execute and fail, identical later commands must observe a changed state, exit 7 |
| 115 | +must fail, and a silent 40-second command must hit the real 30-second timeout. |
| 116 | + |
| 117 | +`inputs.json`, `decision.json`, `generation.json`, |
| 118 | +per-scenario `live-verification.json`, and `receipt.json` remain under ignored |
| 119 | +`.artifacts/terminal-proof-planning/`. Compact receipts beside this note record |
| 120 | +actual results, provenance, and hashes; no raw transcripts are included. The |
| 121 | +source-hash guard rejects replay after any recorded implementation input changes. |
| 122 | +The receipt distinguishes the runtime head, original base, source hashes, and |
| 123 | +generator hash. It does not claim proof of a later commit. |
| 124 | + |
| 125 | +## Observed results |
| 126 | + |
| 127 | +Both fresh constrained Codex generations passed on local macOS with Node `v24.19.0` and |
| 128 | +tmux `3.7c`. The fast plan put the command only in entry and chose static text. |
| 129 | +The delayed plan chose setup entry, one run, and expectations, with no explicit |
| 130 | +wait; existing expectation polling observed the delayed completion. |
| 131 | +Both observed all five success assertions and invoked the proof exactly once. |
| 132 | +Both refused a replay with exit 17 and preserved the original result bytes. In |
| 133 | +each run, the exact leading duplicate executed and failed, the intentional later |
| 134 | +repeat observed changed file state, exit 7 failed, and the silent command hit the |
| 135 | +existing 30-second timeout. `receipt.json` records normalized plans, outcomes, |
| 136 | +generation provenance, source hashes, and hashes of the full ignored receipts. |
| 137 | + |
| 138 | +Each generation trace shows one actual inference request and zero tool calls, |
| 139 | +approval `never`, the active `terminal-proof` profile, restricted filesystem |
| 140 | +reads, no writable paths, and restricted network access. The harmless outside |
| 141 | +sentinel read and workspace write were both denied. The generated workspace |
| 142 | +remained empty. No model-directed fixture execution occurred during generation. |
| 143 | + |
| 144 | +The latest receipt comes from two fresh inference calls using the final helper |
| 145 | +unchanged, followed by real-tmux execution. Both calls passed the built-in |
| 146 | +permission and tool-inventory checks directly; neither decision was edited, |
| 147 | +reused from an earlier generation, or retrospectively re-attested. Diagnostic |
| 148 | +attempts during helper development remain local and are not the published proof. |
| 149 | + |
| 150 | +This receipt supersedes the full-access generation receipt preserved at |
| 151 | +[the previous head](https://github.com/openclaw/clawsweeper/blob/ca48d41487affa905cb775da8a985d1b128b18c3/docs/proof/terminal-proof-planning/receipt.json). |
| 152 | +The earlier four runtime demonstrations are historical observations, not evidence |
| 153 | +of isolated generation. None of their decisions was reused here. These two new |
| 154 | +observations are not a guarantee of all future planner output. |
| 155 | + |
| 156 | +Focused validation passed all 138 tests: |
| 157 | + |
| 158 | +```bash |
| 159 | +node --test test/decision-parser.test.ts test/review-prompt-policy.test.ts \ |
| 160 | + test/review-prompt-context.test.ts test/live-proof.test.ts |
| 161 | +``` |
| 162 | + |
| 163 | +Build, helper syntax/lint/format, documentation checks, and `git diff --check` |
| 164 | +passed. The full repository suite was not rerun for this narrow correction: |
| 165 | +the earlier run's 49 diagnosed host-fixture failures (Git pruning, offline pnpm, |
| 166 | +and timing) remain outside this patch. No full-suite success is claimed; CI must |
| 167 | +run again after the parent-reviewed commit. |
| 168 | + |
| 169 | +## Limits |
| 170 | + |
| 171 | +This is a controlled terminal fixture, not Worker/apply functional correctness, |
| 172 | +live GitHub behavior, or evidence that every future model plan is correct. The |
| 173 | +driver runs with recording disabled even if the planner chooses a media payoff; |
| 174 | +setup/action/expectation execution can be verified, but video recording and |
| 175 | +publication are not claimed. No accounts, target services, live apply/close, |
| 176 | +workflow changes, or external artifact uploads are used by the fixture. |
| 177 | + |
| 178 | +OpenClaw Bay is unaffected: the schema shape, verification lifecycle, publication |
| 179 | +contract, and observer-only ownership are unchanged. The PR 1254 artifact does not |
| 180 | +prove when the supervised entry exited; later target JSON saying exit zero is not |
| 181 | +authority to erase a timeout or pass an unexecuted run. |
0 commit comments