Command reference
oko tasks rules
Prints the operator’s standing rules from every session in scope, in the operator’s words.
Invocation#
oko tasks rules (--open [--hours N] | --session ID ... | --all) [--json]Inputs and options#
- --open selects every live session; --hours N limits by transcript modification time. --session selects one exact session and may repeat. Both read the shared ledger held to the selected sessions, as --all reads it: a selected session's live transcript is read only when it holds more rule readings than the ledger has stored messages for, so a rule the sweep has not stored yet is still printed, and a session with no rule reading is not read at all. --all reads every rule the shared ledger holds, from every session however old, without a live transcript.
- --json selects structured output.
Output and state effect#
- Prints every operator message Oko's model or the receiving session read as a rule (a reading of kind rule, with who read it), oldest first, with its time, session and number; “no standing rules in scope” when there are none. No word list decides it. With --all the shared database is asked for the readings of kind rule only, then for the stored messages of just the sessions those readings name, read side by side; each session is one indexed request by its session key (the id after its last `_`, kept beside every stored message), whatever prefix the harness gave the id, so the answer takes seconds however many messages the ledger holds; a rule whose message has not been stored yet (`oko tasks sweep` stores it) is not printed. Tama’s inject-operator-rules session-start hook reads `--all` into every session after every compaction, so a standing rule does not lapse with the session that gave it.
- The real `tasks-standing-rules` refusal journey requires OKO_TEST_RULE_FAILURE_HOME, an isolated signed-in profile under this checkout’s ignored .build directory; OKO_TEST_RULE_FAILURE_SESSIONS, a JSON array of distinct full session UUIDs with genuinely stored rule readings and unreconciled timestamp origins; and OKO_TEST_SOURCE_REVISION. It reads those rows, invokes `oko tasks rules --all --json` and `oko tasks map --session <id> --session <id> --json`, requires every session’s actual reconciliation cause in both refusals, and independently confirms unchanged origins and readings. Candidate revision, binary and journey hashes, command statuses, causes and readbacks remain under .build/tasks/rule-failures. Only all successful assertions produce a passed result. This read-only journey neither fabricates source rows nor qualifies panic handling or visual presentation.
- The real stored-versus-live standing-rule journey compares complete message text as well as message number and recorded reader; matching only the rule identities is not proof that every word was restored.
Refusals and safe exits#
- Refuses without --open, --session or --all. A missing or unreadable live transcript (with --open or --session) and a failed shared-database read exit unsuccessfully; neither becomes an empty rules list.
- The all-session rule reader joins every started source-allocation read before returning a refusal. Multiple failed sessions retain each session and its underlying cause instead of losing later failures. The subsequent parallel stored-message reads preserve every failed session in the same way. A worker panic preserves its operation and textual panic payload; non-text payloads are identified by their runtime type identity rather than given an invented cause. This failure also prevents standing-rule restoration from treating an incomplete read as an empty instruction set.
- Malformed stored messages refuse with the selected session and actual decoder cause instead of substituting empty text, a zero ordinal or an absent timestamp. A genuinely absent timestamp remains valid. A returned message from a different session, or a response with no requested classification set, also refuses before any rule output is returned.