Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR sanitizes hook names and custom emoji before printing enable and disable confirmations. Example: Run openclaw hooks enable escape-hook for a hook named café followed by a newline and operator-forged.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: current main still exposes terminal controls in successful hook toggle confirmations, and this focused fix has no actionable introduced defects. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe hooks CLI discovers hook metadata, commits enablement through the existing config owner, and renders the committed result as a terminal confirmation. flowchart LR
A[Hook descriptors] --> B[Hook discovery and selection]
B --> C[Config mutation owner]
C --> D[Committed hook metadata]
D --> E[Terminal text sanitizer]
E --> F[Trusted styling and confirmation]
Technical reviewBest possible solution: Land the existing sanitizer calls at the confirmation boundary while preserving raw metadata and config mutation semantics. Do we have a high-confidence way to reproduce the issue? Current-main interpolation directly explains the supplied failing-base built-CLI traces; this read-only review executed no target code. Is this the best way to solve the issue? The patch is the smallest complete fix: it reuses the established sanitizer in the existing output owner and adds focused coverage for both commands and emoji branches. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bb3df792e23f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +32, Docs +4. Total +36 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 26, 2026, 2:55 AM ET / 06:55 UTC. |
fix(cli): escape terminal controls in untrusted values through one owner CLI human-readable output printed user-controlled values such as config paths, names, directories, binding descriptions, plugin metadata and dead-letter scopes without neutralizing terminal control sequences, so a crafted value could inject ANSI, OSC 8 or C1 sequences into the terminal. Earlier fixes wrapped one call site at a time. A single owner now does this: `terminalText` in terminal-core's safe-text escapes interpolated values before styling, and the display-only `displayPath` delegates to it. Raw path shortening, JSON output and the trusted styling of `renderTable` are unchanged, and the per-site wrapping is replaced. This absorbs #184685, #184666, #184324, #184303, #176763, #176773 and #172873 by @Alix-007 and #184861 by @qingminglong, whose original commits are kept, and moves the earlier merged per-site fixes onto the same owner. Evidence: built CLI in a secretless container, with ESC/CSI, OSC 8 and C1 sequences injected into values for eleven commands across eight families. Main printed the raw sequences; this change printed them neutralized, normal colored output and JSON values were unchanged, and dead-letter errors keep their stderr and JSON contracts. Raw-byte captures: #185927 (comment). Production +81. Co-authored-by: Alix-007 <[email protected]> Co-authored-by: qingminlong <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @Alix-007. This is now fixed at the root in #185927 (2d2b465): one |
fix(cli): escape terminal controls in untrusted values through one owner CLI human-readable output printed user-controlled values such as config paths, names, directories, binding descriptions, plugin metadata and dead-letter scopes without neutralizing terminal control sequences, so a crafted value could inject ANSI, OSC 8 or C1 sequences into the terminal. Earlier fixes wrapped one call site at a time. A single owner now does this: `terminalText` in terminal-core's safe-text escapes interpolated values before styling, and the display-only `displayPath` delegates to it. Raw path shortening, JSON output and the trusted styling of `renderTable` are unchanged, and the per-site wrapping is replaced. This absorbs openclaw#184685, openclaw#184666, openclaw#184324, openclaw#184303, openclaw#176763, openclaw#176773 and openclaw#172873 by @Alix-007 and openclaw#184861 by @qingminglong, whose original commits are kept, and moves the earlier merged per-site fixes onto the same owner. Evidence: built CLI in a secretless container, with ESC/CSI, OSC 8 and C1 sequences injected into values for eleven commands across eight families. Main printed the raw sequences; this change printed them neutralized, normal colored output and JSON values were unchanged, and dead-letter errors keep their stderr and JSON contracts. Raw-byte captures: openclaw#185927 (comment). Production +81. Co-authored-by: Alix-007 <[email protected]> Co-authored-by: qingminlong <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @obviyus for the shared fix and the clear guidance! |
What Problem This Solves
successful hooks enable/disable confirmations print control sequences and injected line breaks from discovered hook names and custom emoji, after the config mutation has already succeeded.
Why This Change Was Made
Reuse the established terminal-text sanitizer at the human display boundary. Trusted report separators remain separate; raw operation inputs and persisted values do not pass through display conversion.
User Impact
Hook toggle confirmations show readable escaped metadata instead of terminal actions or forged status lines. Both custom-emoji and default-icon branches are covered. The original hook key, selection policy, descriptor, and existing per-hook env values are preserved; enabled bits still follow the requested command. No configuration, protocol/schema, permission, migration or upgrade action changes.
Evidence
Scenario: Successful hook enable/disable acknowledgements safely render names and custom emoji without changing raw metadata or config-key writes.
Entry: hooks enable / hooks disable through normal built openclaw.mjs; disputed owner ran unmocked: src/cli/hooks-cli.ts executed unmocked
Same command on base
f4ae32fand head2633b01:node proof-hooks.mjs "$CHECKOUT" "$PHASE"Readback (subprocess,disk): Normal-built CLI discovers three actual workspace hooks from HOOK.md, commits enable/disable config changes, then prints the acknowledgement. Separate hooks info --json processes return original metadata; direct config and descriptor hash readback verifies exact keys, preserved env fields and unchanged source files.
Proof harness: proof-common.mjs sha256=8a6d2e48b1b076878e98641b0791f7fb064f44bbff9522fe43d1d34c6ffb007f; proof-hooks.mjs sha256=0c27781d6201b121bd900ee67029ece46d3f4ac929d86bdc61ed0721c4598c75
Control: Authoritative captured CLI control counts: baseline [6,6,3,3], head [0,0,0,0]. Ordinary same-entry command controls succeed with exit0; independent original-value JSON/disk checks pass. Both actions, with and without custom emoji, succeed with correct persisted enabled bits. The ordinary hook succeeds unchanged. All six commands preserve per-hook env metadata; all descriptors remain byte-identical. A marker-capable synthetic handler has zero invocations. Unicode retained; GREEN acknowledgements contain no embedded action controls or forged rows.
Other callers checked: Affected human output owner and raw JSON/readback siblings inspected. Existing terminal-core sanitizer reused; no new input validation, storage, backend policy or protocol.
Tests: pnpm test src/cli/hooks-cli.toggle.test.ts --maxWorkers=1 => Tests 25 passed (25); exit 0 (measured cost: 24.03 seconds measured command wall time, including native wrapper/worker preparation and artifact verification; not just assertion duration. The first cold run took 136.252s and hit the existing Gateway-owner refusal case's 120s timeout; worker preparation alone took108.437s, and24 other cases passed. The unmodified full-file rerun passed all25 in 24.03s using retained compiler outputs; no test, timeout or assertion was changed.)
Not tested: Isolated Linux local config and workspace hooks only. This tests toggling and rendering, not dispatching a hook event or reloading a live Gateway. No production service/channel, remote report, error-diagnostic, Windows/macOS or whole CI claim. Upstream required CI has not run before PR creation.
Product head:
2633b012684f8ba8dee340d1559f1d55ef2cb166; baseline:f4ae32fe1b035ce86561887e897d75c13557adbc. Linux, Node26.12.1, pnpm12.15.0; normal clean cliStartup build on each revision. Exact commands, captured outputs and independent readback are below.Focused regression:
pnpm test src/cli/hooks-cli.toggle.test.ts --maxWorkers=1→ Tests 25 passed (25); 24.03s measured wall time including native preparation. Existing owner controls remain in the suite.Cold-run note: The first cold run took 136.252s and hit the existing Gateway-owner refusal case's 120s timeout; worker preparation alone took108.437s, and24 other cases passed. The unmodified full-file rerun passed all25 in 24.03s using retained compiler outputs; no test, timeout or assertion was changed.
3 files; production +2/−2 LOC; tests +32/−0 LOC. Simplification: existing sanitizer and canonical owner retained, no new helper/state/test-only production seam.
Existing-solutions/sibling preflight: The existing terminal-core sanitizer is already used by read-only hook reports. fix(cli): prevent descriptor controls in skill and hook reports #172872 fixed those reports, and fix(hooks): stop executing escape sequences from hook manifest metadata #175978/fix(skills): stop executing escape sequences embedded in SKILL.md descriptions #175601 were closed as superseded; none covered the successful mutation acknowledgement. Full toggle owner and refusal/JSON/report siblings were inspected; no viable competing open PR or Alix/Leon production-file overlap was found.
Full base-to-candidate independent P0–P3 source review: pass, no findings. The explicitly authorized GPT6.1 Sol subagent fallback was used; this is not an official autoreview-helper success.
Isolation/cleanup: independent HOME/state/config and synthetic local data; no production service, credentials or channels touched. Fixtures retained for audit in their generated temporary directories and removable as those individual directories. No service started or deployment performed.
Limits: Isolated Linux local config and workspace hooks only. This tests toggling and rendering, not dispatching a hook event or reloading a live Gateway. No production service/channel, remote report, error-diagnostic, Windows/macOS or whole CI claim. Upstream required CI remains pending after creation.
Actual baseline and exact-head CLI output with independent readback
Streams are JSON-escaped for safe inspection; generated temporary roots are replaced with
$FIXTURE.{ "phase": "red", "head": "f4ae32fe1b035ce86561887e897d75c13557adbc", "at": "2026-10-26T06:11:11.279Z", "runs": [ { "label": "escape-hook-enable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "enable", "escape-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "✓ Enabled hook: café\u001b[31m\noperator-forged\tend\rrow\u0007 café\u001b[31m\noperator-forged\tend\rrow\u0007\n", "stderr": "", "seconds": 8.058437974 }, { "label": "escape-hook-disable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "disable", "escape-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "Disabled hook: café\u001b[31m\noperator-forged\tend\rrow\u0007 café\u001b[31m\noperator-forged\tend\rrow\u0007\n", "stderr": "", "seconds": 8.430883318 }, { "label": "escape-hook-json", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "info", "escape-hook", "--agent", "main", "--json" ], "code": 0, "signal": null, "stdout": "{\n \"name\": \"café\\u001b[31m\\noperator-forged\\tend\\rrow\\u0007\",\n \"description\": \"Toggle an isolated synthetic hook without invoking its handler.\",\n \"source\": \"openclaw-workspace\",\n \"filePath\": \"$FIXTURE/workspace/hooks/escape-hook/HOOK.md\",\n \"baseDir\": \"$FIXTURE/workspace/hooks/escape-hook\",\n \"handlerPath\": \"$FIXTURE/workspace/hooks/escape-hook/handler.ts\",\n \"hookKey\": \"escape-hook\",\n \"emoji\": \"café\\u001b[31m\\noperator-forged\\tend\\rrow\\u0007\",\n \"events\": [\n \"command:new\"\n ],\n \"unknownEvents\": [],\n \"always\": false,\n \"enabledByConfig\": false,\n \"requirementsSatisfied\": true,\n \"loadable\": false,\n \"blockedReason\": \"disabled in config\",\n \"managedByPlugin\": false,\n \"requirements\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"missing\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"configChecks\": [],\n \"install\": [],\n \"eligible\": false,\n \"disabled\": true\n}\n", "stderr": "", "seconds": 6.292225198 }, { "label": "escape-no-emoji-enable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "enable", "escape-no-emoji", "--agent", "main" ], "code": 0, "signal": null, "stdout": "✓ Enabled hook: café\u001b[31m\noperator-forged\tend\rrow\u0007-plain\n", "stderr": "", "seconds": 8.533007392 }, { "label": "escape-no-emoji-disable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "disable", "escape-no-emoji", "--agent", "main" ], "code": 0, "signal": null, "stdout": "Disabled hook: café\u001b[31m\noperator-forged\tend\rrow\u0007-plain\n", "stderr": "", "seconds": 8.282131095 }, { "label": "escape-no-emoji-json", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "info", "escape-no-emoji", "--agent", "main", "--json" ], "code": 0, "signal": null, "stdout": "{\n \"name\": \"café\\u001b[31m\\noperator-forged\\tend\\rrow\\u0007-plain\",\n \"description\": \"Toggle an isolated synthetic hook without invoking its handler.\",\n \"source\": \"openclaw-workspace\",\n \"filePath\": \"$FIXTURE/workspace/hooks/escape-no-emoji/HOOK.md\",\n \"baseDir\": \"$FIXTURE/workspace/hooks/escape-no-emoji\",\n \"handlerPath\": \"$FIXTURE/workspace/hooks/escape-no-emoji/handler.ts\",\n \"hookKey\": \"escape-no-emoji\",\n \"events\": [\n \"command:new\"\n ],\n \"unknownEvents\": [],\n \"always\": false,\n \"enabledByConfig\": false,\n \"requirementsSatisfied\": true,\n \"loadable\": false,\n \"blockedReason\": \"disabled in config\",\n \"managedByPlugin\": false,\n \"requirements\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"missing\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"configChecks\": [],\n \"install\": [],\n \"eligible\": false,\n \"disabled\": true\n}\n", "stderr": "", "seconds": 5.952977191999999 }, { "label": "ordinary-hook-enable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "enable", "ordinary-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "✓ Enabled hook: ordinary-hook\n", "stderr": "", "seconds": 8.486553697999996 }, { "label": "ordinary-hook-disable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "disable", "ordinary-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "Disabled hook: ordinary-hook\n", "stderr": "", "seconds": 8.395312948000006 }, { "label": "ordinary-hook-json", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "info", "ordinary-hook", "--agent", "main", "--json" ], "code": 0, "signal": null, "stdout": "{\n \"name\": \"ordinary-hook\",\n \"description\": \"Toggle an isolated synthetic hook without invoking its handler.\",\n \"source\": \"openclaw-workspace\",\n \"filePath\": \"$FIXTURE/workspace/hooks/ordinary-hook/HOOK.md\",\n \"baseDir\": \"$FIXTURE/workspace/hooks/ordinary-hook\",\n \"handlerPath\": \"$FIXTURE/workspace/hooks/ordinary-hook/handler.ts\",\n \"hookKey\": \"ordinary-hook\",\n \"events\": [\n \"command:new\"\n ],\n \"unknownEvents\": [],\n \"always\": false,\n \"enabledByConfig\": false,\n \"requirementsSatisfied\": true,\n \"loadable\": false,\n \"blockedReason\": \"disabled in config\",\n \"managedByPlugin\": false,\n \"requirements\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"missing\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"configChecks\": [],\n \"install\": [],\n \"eligible\": false,\n \"disabled\": true\n}\n", "stderr": "", "seconds": 6.096037522000006 } ], "observations": [ { "label": "escape-hook-enable", "controls": 6, "forgedLine": true, "escapedLine": false, "unicode": true }, { "label": "escape-hook-disable", "controls": 6, "forgedLine": true, "escapedLine": false, "unicode": true }, { "label": "escape-no-emoji-enable", "controls": 3, "forgedLine": true, "escapedLine": false, "unicode": true }, { "label": "escape-no-emoji-disable", "controls": 3, "forgedLine": true, "escapedLine": false, "unicode": true } ], "readback": { "escape-hook-enable": { "key": "escape-hook", "enabled": true, "envPreserved": true }, "escape-hook-disable": { "key": "escape-hook", "enabled": false, "envPreserved": true }, "escape-hook-raw": { "name": "café\u001b[31m\noperator-forged\tend\rrow\u0007", "emoji": "café\u001b[31m\noperator-forged\tend\rrow\u0007", "hookKey": "escape-hook", "enabledByConfig": false }, "escape-no-emoji-enable": { "key": "escape-no-emoji", "enabled": true, "envPreserved": true }, "escape-no-emoji-disable": { "key": "escape-no-emoji", "enabled": false, "envPreserved": true }, "escape-no-emoji-raw": { "name": "café\u001b[31m\noperator-forged\tend\rrow\u0007-plain", "emoji": null, "hookKey": "escape-no-emoji", "enabledByConfig": false }, "ordinary-hook-enable": { "key": "ordinary-hook", "enabled": true, "envPreserved": true }, "ordinary-hook-disable": { "key": "ordinary-hook", "enabled": false, "envPreserved": true }, "ordinary-hook-raw": { "name": "ordinary-hook", "emoji": null, "hookKey": "ordinary-hook", "enabledByConfig": false }, "descriptorHashes": [ "4b79eeae2e7f8070e533aa0f324d40eb3c9cc540f43677f2a14f7eb0722d80b2", "13604d6b79e9216e387871fa05d9dd288d728d5d12310e5baf1bf79e2a72bafa", "7d75bce1a8281b8921c2894cef81daac85b5b133e2f2adab8eb5e5ef8eb9e7f2" ], "metadataUnchanged": true, "handlerInvocationCount": 0 }, "result": "PASS" }{ "phase": "green", "head": "2633b012684f8ba8dee340d1559f1d55ef2cb166", "at": "2026-10-26T06:34:13.171Z", "runs": [ { "label": "escape-hook-enable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "enable", "escape-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "✓ Enabled hook: café\\noperator-forged\\tend\\rrow café\\noperator-forged\\tend\\rrow\n", "stderr": "", "seconds": 10.215180133 }, { "label": "escape-hook-disable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "disable", "escape-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "Disabled hook: café\\noperator-forged\\tend\\rrow café\\noperator-forged\\tend\\rrow\n", "stderr": "", "seconds": 10.741528057000002 }, { "label": "escape-hook-json", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "info", "escape-hook", "--agent", "main", "--json" ], "code": 0, "signal": null, "stdout": "{\n \"name\": \"café\\u001b[31m\\noperator-forged\\tend\\rrow\\u0007\",\n \"description\": \"Toggle an isolated synthetic hook without invoking its handler.\",\n \"source\": \"openclaw-workspace\",\n \"filePath\": \"$FIXTURE/workspace/hooks/escape-hook/HOOK.md\",\n \"baseDir\": \"$FIXTURE/workspace/hooks/escape-hook\",\n \"handlerPath\": \"$FIXTURE/workspace/hooks/escape-hook/handler.ts\",\n \"hookKey\": \"escape-hook\",\n \"emoji\": \"café\\u001b[31m\\noperator-forged\\tend\\rrow\\u0007\",\n \"events\": [\n \"command:new\"\n ],\n \"unknownEvents\": [],\n \"always\": false,\n \"enabledByConfig\": false,\n \"requirementsSatisfied\": true,\n \"loadable\": false,\n \"blockedReason\": \"disabled in config\",\n \"managedByPlugin\": false,\n \"requirements\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"missing\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"configChecks\": [],\n \"install\": [],\n \"eligible\": false,\n \"disabled\": true\n}\n", "stderr": "", "seconds": 7.267616737 }, { "label": "escape-no-emoji-enable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "enable", "escape-no-emoji", "--agent", "main" ], "code": 0, "signal": null, "stdout": "✓ Enabled hook: café\\noperator-forged\\tend\\rrow-plain\n", "stderr": "", "seconds": 9.218923438999997 }, { "label": "escape-no-emoji-disable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "disable", "escape-no-emoji", "--agent", "main" ], "code": 0, "signal": null, "stdout": "Disabled hook: café\\noperator-forged\\tend\\rrow-plain\n", "stderr": "", "seconds": 9.479547767999996 }, { "label": "escape-no-emoji-json", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "info", "escape-no-emoji", "--agent", "main", "--json" ], "code": 0, "signal": null, "stdout": "{\n \"name\": \"café\\u001b[31m\\noperator-forged\\tend\\rrow\\u0007-plain\",\n \"description\": \"Toggle an isolated synthetic hook without invoking its handler.\",\n \"source\": \"openclaw-workspace\",\n \"filePath\": \"$FIXTURE/workspace/hooks/escape-no-emoji/HOOK.md\",\n \"baseDir\": \"$FIXTURE/workspace/hooks/escape-no-emoji\",\n \"handlerPath\": \"$FIXTURE/workspace/hooks/escape-no-emoji/handler.ts\",\n \"hookKey\": \"escape-no-emoji\",\n \"events\": [\n \"command:new\"\n ],\n \"unknownEvents\": [],\n \"always\": false,\n \"enabledByConfig\": false,\n \"requirementsSatisfied\": true,\n \"loadable\": false,\n \"blockedReason\": \"disabled in config\",\n \"managedByPlugin\": false,\n \"requirements\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"missing\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"configChecks\": [],\n \"install\": [],\n \"eligible\": false,\n \"disabled\": true\n}\n", "stderr": "", "seconds": 6.726077805000001 }, { "label": "ordinary-hook-enable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "enable", "ordinary-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "✓ Enabled hook: ordinary-hook\n", "stderr": "", "seconds": 8.599397127999996 }, { "label": "ordinary-hook-disable", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "disable", "ordinary-hook", "--agent", "main" ], "code": 0, "signal": null, "stdout": "Disabled hook: ordinary-hook\n", "stderr": "", "seconds": 9.082924941999991 }, { "label": "ordinary-hook-json", "args": [ "$CHECKOUT/openclaw.mjs", "hooks", "info", "ordinary-hook", "--agent", "main", "--json" ], "code": 0, "signal": null, "stdout": "{\n \"name\": \"ordinary-hook\",\n \"description\": \"Toggle an isolated synthetic hook without invoking its handler.\",\n \"source\": \"openclaw-workspace\",\n \"filePath\": \"$FIXTURE/workspace/hooks/ordinary-hook/HOOK.md\",\n \"baseDir\": \"$FIXTURE/workspace/hooks/ordinary-hook\",\n \"handlerPath\": \"$FIXTURE/workspace/hooks/ordinary-hook/handler.ts\",\n \"hookKey\": \"ordinary-hook\",\n \"events\": [\n \"command:new\"\n ],\n \"unknownEvents\": [],\n \"always\": false,\n \"enabledByConfig\": false,\n \"requirementsSatisfied\": true,\n \"loadable\": false,\n \"blockedReason\": \"disabled in config\",\n \"managedByPlugin\": false,\n \"requirements\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"missing\": {\n \"bins\": [],\n \"anyBins\": [],\n \"env\": [],\n \"config\": [],\n \"os\": []\n },\n \"configChecks\": [],\n \"install\": [],\n \"eligible\": false,\n \"disabled\": true\n}\n", "stderr": "", "seconds": 6.461100876000011 } ], "observations": [ { "label": "escape-hook-enable", "controls": 0, "forgedLine": false, "escapedLine": true, "unicode": true }, { "label": "escape-hook-disable", "controls": 0, "forgedLine": false, "escapedLine": true, "unicode": true }, { "label": "escape-no-emoji-enable", "controls": 0, "forgedLine": false, "escapedLine": true, "unicode": true }, { "label": "escape-no-emoji-disable", "controls": 0, "forgedLine": false, "escapedLine": true, "unicode": true } ], "readback": { "escape-hook-enable": { "key": "escape-hook", "enabled": true, "envPreserved": true }, "escape-hook-disable": { "key": "escape-hook", "enabled": false, "envPreserved": true }, "escape-hook-raw": { "name": "café\u001b[31m\noperator-forged\tend\rrow\u0007", "emoji": "café\u001b[31m\noperator-forged\tend\rrow\u0007", "hookKey": "escape-hook", "enabledByConfig": false }, "escape-no-emoji-enable": { "key": "escape-no-emoji", "enabled": true, "envPreserved": true }, "escape-no-emoji-disable": { "key": "escape-no-emoji", "enabled": false, "envPreserved": true }, "escape-no-emoji-raw": { "name": "café\u001b[31m\noperator-forged\tend\rrow\u0007-plain", "emoji": null, "hookKey": "escape-no-emoji", "enabledByConfig": false }, "ordinary-hook-enable": { "key": "ordinary-hook", "enabled": true, "envPreserved": true }, "ordinary-hook-disable": { "key": "ordinary-hook", "enabled": false, "envPreserved": true }, "ordinary-hook-raw": { "name": "ordinary-hook", "emoji": null, "hookKey": "ordinary-hook", "enabledByConfig": false }, "descriptorHashes": [ "4b79eeae2e7f8070e533aa0f324d40eb3c9cc540f43677f2a14f7eb0722d80b2", "13604d6b79e9216e387871fa05d9dd288d728d5d12310e5baf1bf79e2a72bafa", "7d75bce1a8281b8921c2894cef81daac85b5b133e2f2adab8eb5e5ef8eb9e7f2" ], "metadataUnchanged": true, "handlerInvocationCount": 0 }, "result": "PASS" }Replay scripts and validation receipts
Save both scripts together outside the product checkouts. CHECKOUT is the absolute clean checkout of either recorded SHA; PHASE=red for baseline or green for head. Build normally; do not copy dist or modify build stamps.
proof-common.mjs:proof-hooks.mjs:Frozen source hashes and measured validation receipts:
{ "sourceReview": { "verdict": "pass", "findings": [], "base": "f4ae32fe1b035ce86561887e897d75c13557adbc", "scope": "Independent P0-P3 adversarial source review of complete frozen hooks diff, complete hooks-cli owner and toggle tests, report/selection/commit/acknowledgment flow and neighboring refusal/JSON contracts, terminal-core safe-text/decorative helpers, docs, TASK competition analysis and real normal-built CLI baseline proof scripts/receipts. Reused unchanged contribution/testing/test-audit instructions from prior batch as documented in TASK. No product edits, builds/tests, auth attempts or external actions by reviewer.", "sha256": { "src/cli/hooks-cli.ts": "04f5505ca10fd503f2b0ffaf970576c2b7fa2ab7ef8ca367af45fef545cad137", "src/cli/hooks-cli.toggle.test.ts": "858f0cfbf88519e78ae7787567196bd5da29584ee5c6bd1984059bcc6a6ffcb5", "docs/cli/hooks.md": "7e22b762570a070862a13807de2d9c5b13a30dd142b20d8e8598a404fa7a5afe" } }, "hashes": { "src/cli/hooks-cli.ts": "04f5505ca10fd503f2b0ffaf970576c2b7fa2ab7ef8ca367af45fef545cad137", "src/cli/hooks-cli.toggle.test.ts": "858f0cfbf88519e78ae7787567196bd5da29584ee5c6bd1984059bcc6a6ffcb5", "docs/cli/hooks.md": "7e22b762570a070862a13807de2d9c5b13a30dd142b20d8e8598a404fa7a5afe" }, "focusedCheck": { "command": "pnpm test src/cli/hooks-cli.toggle.test.ts --maxWorkers=1", "tests": "Tests 25 passed (25)", "seconds": 24.03, "exit": 0 }, "gates": { "format-check": { "command": "node-or-pnpm --import ./scripts/tsx.mjs scripts/run-format.mts --check src/cli/hooks-cli.ts src/cli/hooks-cli.toggle.test.ts docs/cli/hooks.md", "seconds": 0.494, "exit": 0 }, "lint": { "command": "node-or-pnpm scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/cli/hooks-cli.ts src/cli/hooks-cli.toggle.test.ts", "seconds": 28.754, "exit": 0 }, "types": { "command": "node-or-pnpm scripts/run-tsgo.mjs -p $BATCH/hooks.tsconfig.json", "seconds": 102.028, "exit": 0 }, "build": { "command": "node-or-pnpm --import ./scripts/tsx.mjs scripts/build-all.mts cliStartup", "seconds": 302.137, "exit": 0 } } }