Docs/CLI reference

CLI reference

tama violations clean

Scans target repositories, asks Brama for one patch per repository per round, applies it with git apply, rejects rule-gaming, and re-scans until clean or the round limit is reached.

Scans target repositories, asks Brama for one patch per repository per round, applies it with git apply, rejects rule-gaming, and re-scans until clean or the round limit is reached.

#Invocation

tama violations clean (--repo <path> | --tree <dir> | --owner <gh-owner> | --me) [...]
           [--rule size|time-limits|all] [--model <brama-route>] [--max-rounds <n>] [--skip <fragment>]
           [--note <text>] [--dry-run] [--json] [--program <path>] [--clone-dir <dir>]

Target, hook, clone, and JSON options match violations find. --model takes a Brama route, not a provider model name: Brama decides which provider answers it and holds the credentials. The route a run asks for when none is named is the same one every other Tama caller resolves, best; a copy of that default once read -best here, a name the gateway does not serve, and every round came back HTTP 403 while tama model-provider check reported the credential healthy. The default maximum is three rounds. --skip is repeatable, --note adds an operator instruction, and --dry-run prints the brief without asking for a patch.

#Repairing only the size rules

--rule size hands a round the two size rules and nothing else: one file over 300 lines, one folder over 5 files. It reads them through the in-process size pass, so it needs no hook tree, and the brief tells the round that the content rules are not its work — a flagged constant or wording is left exactly as it is, even when it moves into a new module. That is the shape a sweep across many repositories takes, because the size rules are mechanical while the content rules are judgement about what a line of code says. --rule all is the default and replays every rule.

#Repairing waits and time limits

--rule time-limits hands a round every line violations find --time-limits reports — a sleep, a limit on how long work may run, a timer that kills work — and nothing else, through that same in-process pass, so it needs no hook tree either. The brief states the workshop rule and how to keep it: where the code slept so that something could happen first, wait for that outcome itself (the child's exit, the readiness line, the listener accepting, the event) and never for a shorter sleep in a loop; where a limit cut off work that may hang, delete it and let the work run to completion, and where the failure is real, return an error that names the operation, its input and the state seen; where a library carries a limit of its own, switch it off with (None), (0) or : 0 rather than deleting the explicit value. Every other rule is left as it is. tama violations clean --tree <dir> --rule time-limits is the sweep across a workshop; the final rescan is the result.

#Where the model comes from

Every Tama feature that needs a model calls Brama, the one authenticated provider-neutral gateway. No provider CLI is involved: earlier rounds spawned codex exec or kimi -p <brief> --yolo, one of which is not installed on an operator machine and the other refuses that argument pair, so a round exited at once and the loop reported unchanged violation counts round after round.

The address uses TAMA_OBJECTIVE_AUTHORITY_MODEL_ROUTER_URL, STADO_MODEL_ROUTER_URL or BRAMA_URL when one is set; otherwise it uses the shared fleet discovery described in model-provider: the current published resolver adapter or caller-owned stado service directory connect brama --consumer <adapter> --json. Bare URL files are neither read nor written. When local routing is unavailable, Stado can carry the request through a caller-owned resolver relay. A terminal fleet declaration or consumer refusal is returned without opening a relay. No public hostname is substituted. Brama binds loopback on its placement host, so each caller uses its own fleet route rather than reconstructing an address from the serving host's name.

The credential is a Skarbiec token minted for Tama's own consumer — tama by default — read from ~/.stado/<consumer>-skarbiec-token. The token carries its own call:brama#<route> grants and its own expiry, and Brama learns the client and its allowed routes by introspecting it at Skarbiec, so no vault item name, field name or signing secret is configured here. Run tama model-provider check to see which address this machine resolves and what the service answers.

TAMA_CLEAN_AGENT_CMD replaces the model step with a command of your own, run in the repository with the brief in TAMA_CLEAN_BRIEF. That is how a round is pointed at a local agent harness or a test double.

#Output and state

A round journals its model route, exit and violation count, and holds a per-repository lock. Text output reports CLEAN, remaining findings, or LOCKED (another clean in progress); JSON returns results and discovery problems. Unresolved, locked, or discovery-problem results exit 1.

#Refusals and failures

A round that cannot act ends the run and records why in rounds[].rejected instead of repeating the same failure for every allowed round: an unreadable credential, a gateway that refuses the client, a patch that git apply rejects, and a target that is not a Git repository — a patch has nothing to apply to there — are all reported by their own sentence.

A round that leaves more to fix than it found is rejected too: its own patch is undone exactly — nothing it did not write is touched — and the next brief is told what got worse. That gate exists because one round split an oversized module into ten files no crate declared, so the compiler never saw them, the build stayed green, and the violation count went from 54 to 62 while the run reported success.

Setting the disable variable to 1 writes tama violations clean is disabled (TAMA_CLEAN_DISABLED=1), performs no cleanup, and exits 0. A route containing whitespace, an empty option value, a --max-rounds value below 1 or not a number, missing targets, and unknown arguments print usage and exit 2. Missing hook, repo, and tree paths use the same exact ... not found: <path> refusals as the scanner. Rule-gaming rounds are rejected and fed into the next round rather than accepted as clean.

Return to the complete CLI command tree.