Oko/Docs

Command reference

oko defects classes land

Lands the mechanism of one layer of one cause, read where it is named, or takes it back.

Invocation#

Command
oko defects classes land <class> <cause> --layer prevent|detect|recover|measure --kind hook|refusal|test --name NAME --product PRODUCT --revision COMMIT --by SESSION [--json] | unland <class> <cause> --layer LAYER --reason REASON --by SESSION [--json]

Inputs and options#

  • Every cause carries four layers: prevent (stops the shape where it is made: a Tama gate, one shared library function every instance moves to, or a lint), detect (finds an instance that got through), recover (repairs it) and measure (counts it). A layer holds a plan in words until a mechanism lands on it: a Tama hook, a product command's refusal or a real test under tests/, by name and the revision that carries it.
  • A mechanism stands when it is carried by what is installed: a hook in the catalogue of the Tama release installed on the machine, a refusal or test whose revision a published release of its product carries. An instance of an open class closes only once every layer of every cause of its class stands; an instance of a shape at the level that no class ever held does not close at all; an open instance of a closed class's shape is a recurrence its mechanisms let through, and it does not close on its own: the class is reopened (`oko defects reopen`) and the instance closes once the reopened class's mechanisms stand. A class closes only when every layer of every cause stands and none of its instances is still open. `oko defects fix` applies the same gate.
  • The completion probe measures from the install records: a hook was installed when the Tama hook registry carrying it was written, which every install does whole; a refusal or test since the oldest installation of its product's command line, in the unbroken run up to the current one, whose source revision contains the mechanism's (`stado product status <product> --surface cli`). The first reading that finds every layer standing (`show`, `check`, or the closing gate) keeps that moment as `installedAt`, which the listing shows; a change to a cause or a mechanism clears it.

Output and state effect#

  • `land` writes the mechanism on an empty layer; `unland` removes it and notes `cause <id>'s <layer> mechanism <mechanism> taken back by <session>: <reason>` on the class. Both print the class's causes as `cause` does.

Refusals and safe exits#

  • `a layer is one of prevent, detect, recover, measure; got <word>` (exit 2); `a mechanism is a hook, a refusal or a test; got <word>`.
  • `the <layer> layer of cause <cause> already holds <mechanism>; take it back with `oko defects classes unland <class> <cause> --layer <layer> --reason <why> --by <session>` first`.
  • `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>"`.
  • `cause <id> of class <id> has no <layer> mechanism landed` for an `unland` with nothing to take back.

CLI reference#