CLI reference
tama adaptive repair
Drafts or accepts a candidate hook script, validates it against the hook's evidence corpus, and stages a repair proposal without changing the live hook.
#Invocation
tama adaptive repair <hook-id> [--patch-file <path>] [--json]
<hook-id> is required. --patch-file validates an operator-supplied candidate; without it, Tama sends the hook's repair brief to a model through Brama, on the route Brama declares for this workshop, and validates the script it answers. --json prints the report as one JSON document instead of key: value lines.
#Output and state
A candidate runs through the interpreter its own #! line names, the way the live hook runs: once for every payload labelled must-block (it has to block, by a non-zero exit, a BLOCKED: line or a {"decision":"block"} line), once for every payload labelled must-pass (it has to exit 0 without a block verdict), and once on {}, where a signal counts as a crash. The report carries ok, checked (the runs made), failures ({kind, ts, detail}) and staged; a report that ran nothing carries only ok and the failure saying why.
Tama prints the report as key: value lines, one per field with nested values compact, or as one JSON document with --json. A valid candidate is copied into a timestamped proposal directory with proposed.diff, report.json, and a summary; the live and archived hook files remain unchanged. The report's ok controls exit status: true exits 0, false exits 1.
#Refusals and failures
- Missing hook id, an id beginning with
--, or--patch-filewithout a value prints adaptive usage and exits2. - Unknown or unmapped hook:
unknown hook or no script path: <hook-id>. - Missing candidate:
patch file not found: <path>. - A draft Brama could not give: the reason Brama answered (no declared route, an unreachable gateway, a refused request) or
the model on route <route> drafted an empty script, each followed by; pass --patch-file to propose a script by hand. - A candidate without a
#!line: failuresetup,<path> has no #! line naming its interpreter. No labelled cases: failureinsufficient-evidence. - A failed corpus check reports
validation did not pass; artifacts left in <tmp-dir>.
Failures that are not the candidate's verdict print doctor: <reason> and exit 1: an interpreter that cannot be started (cannot start <program>: <cause>), a payload that cannot be written to it, a corpus entry without a payload, telemetry evidence that is not intact (naming the segment or lake commit and the check it failed), and a diff that ends with trouble.
Return to the adaptive command group or the complete CLI tree.