Command reference
oko defects mechanism
Names the mechanism that stops a class's shape where it is made: a Tama hook, the refusal a product command gives, or a real test under tests/.
Invocation#
oko defects mechanism <id> --kind hook|refusal|test --name NAME --product PRODUCT --revision COMMIT --by SESSION [--json]Inputs and options#
- --kind hook names a hook by its id; it must be in the catalogue of the Tama release installed on this machine. --kind refusal names the refusal's error code or words; they must appear in the source of PRODUCT at COMMIT. --kind test names a path under tests/ that must exist in PRODUCT at COMMIT.
- The mechanism is read where it is named before it is written. Closing the class reads it again and needs it installed: a hook in the installed catalogue, a refusal or test whose revision a published release of its product carries.
- A class defect (`--class`) closes only when it names both. Until then `oko defects repaired <id> --revision R` records the repair as a claim and exits 1 with `class defect <id> cannot be closed by <R> yet:` followed by one line per missing step, each with the command that takes it; `oko defects fix` and `oko defects released --close` refuse with the same lines, and Oko Desktop's Defects → Shapes and classes shows the same refusal. A defect that is not a class is not held by this gate.
Output and state effect#
- Writes `mechanism {kind, name, product, revision, recordedIn, recordedAt}` on the defect, replacing an earlier one, and prints `defect <id> is stopped by <kind> <name> of <product>@<revision>`; --json prints the defect. `oko defects show` prints `stopped by <kind> <name> of <product>@<revision>, named by <session> at <time>`, and for a class with none `stopped by nothing named; oko defects mechanism <id> …`.
- The native API's defects domain takes the same as `mechanism {id, kind, name, product, revision, by}`; OkoKit's `nameMechanism` and Oko Desktop's Name the mechanism call it.
Refusals and safe exits#
- `oko defects mechanism requires <id>` and each required flag (exit 2); `a mechanism is a hook, a refusal or a test; got <word>`; a blank value names what is missing.
- `Tama release <release> installed here has no hook <id>`; `this machine has no Tama hook registry, so no hook is installed`; `a test mechanism is a path under tests/; got <path>`; `<checkout> has no <path> at <commit>`; `the source of <checkout> at <commit> does not contain the refusal "<words>"`; a revision that is not a commit of PRODUCT is refused by name.
- When closing reads it again: `its mechanism <kind> <name> of <product>@<revision> is not installed: no published release of <product> carries <product>@<revision>; install a release carrying it, or name one that is`.