Docs/CLI reference

CLI reference

tama adaptive apply

Applies one previously validated adaptive repair proposal to the live hook and, when mapped, its archived source.

Applies one previously validated adaptive repair proposal to the live hook and, when mapped, its archived source.

#Invocation

DEVICE_HOOK_EDIT_APPROVED=1 tama adaptive apply <proposal-dir>

<proposal-dir> is required and must contain the proposal's report.json and candidate file. Owner consent must set DEVICE_HOOK_EDIT_APPROVED=1 outside the agent session.

#Output and state

Tama backs up the current live script, copies the proposed file over the live script and mapped archive source, records a telemetry warning, then prints applied <hook-id>; backup at <path>. Success exits 0.

#Refusals and failures

  • Missing proposal directory prints adaptive usage and exits 2.
  • Missing owner consent: refusing to modify live hooks: DEVICE_HOOK_EDIT_APPROVED is not 1. Owner consent flow: see https://tama.wisent.com/docs/hook-management.
  • Missing or unreadable report: cannot read <proposal-dir>/report.json: <cause>; invalid JSON: <proposal-dir>/report.json is not JSON: <parser error>; no hook named: <proposal-dir>/report.json names no hookId.
  • A hook without a live script: hook <hook-id> has no live script to apply the proposal to; a candidate that is gone: the proposed file <path> for <hook-id> is not there.
  • A backup or copy that fails names both paths and the cause, for example cannot copy <proposed> over <live>: <cause>.

Every refusal and failure is printed as doctor: <reason> and exits 1; nothing is written before the consent, report, hook and candidate checks pass.

Return to the adaptive command group or the complete CLI tree.