A failed command, a saved correction, and the next run #28
AlexMikhalev
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Update: what the model requested, and what actually ran
The hook rewrites the command; OpenCode executes it. I extended the included adapter so one execution record now links the original request, matching compiled rule ID and graph hash, final executed command, tool result and saved output file. The result file carries the same execution ID and its SHA-256 is checked.
The new 66-second demo uses actual saved outputs and synthetic British narration. All 22 regression tests pass, and the downloadable ZIP was extracted and run again with released terraphim-agent 1.21.19 and OpenCode 2.0.20. The adapter source is version 2.0.0; this covers the public example’s sequential whole-command mapping.
Watch the new demo · Download the source, tests and saved evidence · Inspect the execution receipt
The original walkthrough below retains its original recorded outputs.
The adapter normalizes OpenCode V2 after-tool events for learn hook and applies the pre-tool result through mutable event.input. A failure-record correction is explicitly promoted to a tool-preference record, then compiled to the role thesaurus. Returned JSON and actual shell execution are verified separately.
Follow one command from a real failure to a reviewed correction and successful execution. The Harbour hooks example includes a released Terraphim agent, an OpenCode adapter, disabled/enabled rewrite comparisons, host traces and the resulting validation file.
https://terraphim.ai/how-tos/command-rewriting-howto/
Which recurring command correction would you review and scope to a project, rather than applying globally?
Observed result: baseline
python3 validate-brief.py --chekexited 2; after explicit review and promotion, the new host executedpython3 validate-brief.py --check, exited 0 and wrotevalidation.jsonwith Decision, Risk and Owner. The fixed production ZIP was downloaded and rerun successfully.Download the public example · Transcript. The 75-second video uses synthetic British female narration. Agent v1.21.19 with OpenCode 2.0.20 and the included V2 adapter; public sample data only.
All reactions