Docs/CLI reference

CLI reference

tama rules

Reads proposed policy repairs, drafted rules, and unresolved corrections from Oko. It groups evidence across agent sessions without silently installing a hook.

Reads proposed policy repairs, drafted rules, and unresolved corrections from Oko. It groups evidence across agent sessions without silently installing a hook.

#Invocation

tama rules list [--json]
tama rules remove --id <id>
tama rules digest [--json]
tama rules dismiss --id <proposal-id>

#Why a digest

The adaptive bridge queues one repair row per contested hook (see adaptive enforcement). The frustration drafter records runtime rules in ~/.shared-hooks/auto_rules.json. Oko records operator corrections and any cause the operator has named, with links to defects. digest reads all three through their owning interfaces. It groups named causes by defect or identical cause and keeps every still-unexplained correction in one separate proposal. It does not guess a cause or turn a lesson into an enforced rule. An answered correction is not open work.

#Proposals

idkindaction
hook:<hook-id>repair: the operator contested this hook evidence timestama adaptive repair <hook-id> drafts and validates a candidate against the labeled cases
rule:<rule-id>drafted-rule: a rule the drafter recorded, with the quote it was drafted fromtama rules remove --id <rule-id>
cause:<defect-id-or-cause-digest>lesson: unresolved operator corrections grouped by linked defect, or by identical named cause when unlinkedoko defects show <defect-id> inspects a linked defect and its repair plan; oko frustration show <moment-id> inspects an unlinked source
cause:unexplainedlesson: unresolved corrections without a named cause, kept visible together without claiming they share one causeoko frustration list --open lists the moments for inspection

--json prints {"proposals": [...], "dismissed": N, "unreadable": [{"source", "error"}]}. A lesson carries sources with each Oko moment's id, session, operator quote, cause (null when not yet named), linked defect (null when unlinked), reading markers and earlier repetition count, plus the first and last observation. The plain output prints the defect and readings beneath the quote. Two unanswered moments linked to the same defect form one named lesson; unexplained moments form a separate proposal. A linked lesson's action reads the real defect record, including its evidence and repair plan; the source ids can still be inspected with oko frustration show. Tama does not infer a cause from the markers or create or approve a hook. When Oko cannot run or refuses its read, unreadable names oko-frustration and the failed operation. Other proposals remain visible. Reading adaptive evidence may take minutes on a large Transcript Lake.

A damaged auto_rules.json appears as drafted-rules with its path and read or JSON error, while other proposals stay visible. A drafted rule that names no id cannot be grouped, removed or dismissed; it appears as drafted-rules with a drafted rule names no id (id), so it cannot be grouped or removed: <the rule> beside the rules that can be. A field a drafted rule does not carry (its added time, message or user_said) is null in the JSON and printed as null, never as a blank. list, remove and dismiss refuse to treat a damaged file as an empty rule set. A detached drafter's latest failed operation appears as frustration-drafter with its recorded time and error, for example CLASSIFY_FAILED Brama rejected the request ... HTTP 401. NOT_FRUSTRATED, a low-confidence refusal and a recorded rule clear an earlier draft failure. A successful gateway model-list probe does not prove that the drafter's classification request works. Inspect this diagnostic before treating an empty digest as no learning.

#Dismissing

dismiss hides one proposal until new evidence arrives. A hook dismissed at three contests returns at the fourth. A lesson dismissed now returns when Oko records a correction it had not seen, even if an earlier correction has since been answered. Older count-only decisions remain hidden until their evidence count grows. Decisions are kept in ~/.shared-hooks/rule_decisions.json. Which proposal the operator never sees again is his decision, so dismiss needs DEVICE_HOOK_EDIT_APPROVED=1 set outside the agent session; Tama Desktop sets it for the one request its own button sends.

A missing decisions file means no proposal has been dismissed. An unreadable, malformed or invalid rule_decisions.json is different: digest refuses to print proposals rather than reopening hidden decisions. The error names the path and failed read or parse operation. dismiss does not overwrite damaged state. The Desktop digest request returns HTTP 500 with the same error, and the Learned screen shows the refusal instead of an empty history.

#Refusals

  • refusing to dismiss <id>: which proposal the operator never sees again is his decision. Set DEVICE_HOOK_EDIT_APPROVED=1 outside the agent session to dismiss it. — exit 2, nothing written.
  • no open proposal <id> is in the digest — exit 2; the id is not open (already dismissed, or never proposed).
  • refusing to remove <id>: it was drafted from something the operator really said… — remove of a rule whose quote is in a stored operator message, without the approval.

Missing auto_rules.json starts with no drafted rules. An existing file that cannot be read or has no rules array is never replaced with an empty one. A draft and a removal lock the same registry, read its current contents and replace it atomically; concurrent drafts do not overwrite one another. New dispatch entries record outcomes, not the operator's full prompt; older logs may still contain prompts and should be handled as private data.

#Desktop

The Learned screen runs tama request rules/digest and tama request rules/dismiss with {"id": "<proposal-id>"}, and shows the same document.