Sequences and rules
| Kind | What it holds |
|---|---|
sequence |
What happens between two steps: who calls whom, in order, and how it ends |
rule |
A decision, an invariant, a policy, or a quality target |
constant |
A named value rules, columns, and messages depend on |
sequence
Section titled “sequence”{ "ready": 3, "kind": "sequence", "id": "write.save-note", "display_id": "SEQ-SAVE", "capability": "write", "title": "Save a note", "summary": "The API checks the note's length, stores it, and tells the editor whether it was saved.", "participants": [ // the lanes { "id": "Web", "is": ["system.web"], "label": "Web app" }, { "id": "API", "is": ["system.api"], "label": "API" }, { "id": "DB", "is": ["system.db"], "label": "Database" }, ], "outcomes": [ // the ways it ends; edges map each to a step { "id": "saved", "label": "Saved" }, { "id": "refused", "label": "Too long" }, ], "items": [ { "msg": { "from": "Web", "to": "API", "text": "Save the note", // what it does, in words "interface": "interface.save-note", "http": { "method": "POST", "path": "/api/notes" }, "inputs": [ { "name": "text", "source": "The editor", "source_kind": "surface" }, ], }, }, { "msg": { "from": "API", "to": "API", "text": "Check the note's length", "rules": ["write.length"], }, }, { "alt": { "branches": [ { "when": "The note is over the limit", "outcome": "refused", "items": [ { "msg": { "from": "API", "to": "Web", "text": "Refused with the limit", "reply": true, "results": [ { "status": 400, "code": "note_too_long", "copy": "Notes can be up to {limit} characters.", }, ], }, }, ], }, { "when": "The note is within the limit", "outcome": "saved", "items": [ { "msg": { "from": "API", "to": "DB", "text": "Store the note", "ops": [ { "op": "insert", "entity": "data.notes", "set": ["writer_id", "text", "created_at"], }, ], }, }, { "msg": { "from": "API", "to": "Web", "text": "Saved", "reply": true, "results": [{ "status": 201 }], }, }, ], }, ], }, }, ],}
A sequence as Ready Room draws it: lanes, numbered messages, alt branches, and outcomes mapped to steps.
| Field | Req. | Meaning |
|---|---|---|
capability |
yes | Owning capability (home.capability) |
title |
yes | Plain-words name |
owner |
no | Actor or system id responsible for running this sequence |
participants |
yes | Actor, system, or interface ids, or { id, is?, label? } lanes |
items |
yes | Messages and blocks, in order |
outcomes |
yes | [{ id, label }]; [] for a sequence no edge runs |
trigger |
no | Only when no edge runs it: a schedule, event, or call trigger |
parts, part_of |
no | Parts, over 16 messages (size.sequence) |
How it starts
Section titled “How it starts”| Started by | How |
|---|---|
| an edge | The edge names it in sequence; the sequence has no trigger |
| another sequence | A message invokes it, or a continue: { to } hands off |
| itself | Its own trigger, never an action (field.invalid) |
None of these is a sequence.unreached warning. When the last item is an
alt and there are several outcomes, every branch names one.
{ "edges": [ { "to": "write.write-note.saved", "trigger": "write.save", "sequence": "write.save-note", "outcome": "saved" } ]}{ "ready": 3, "kind": "sequence", "id": "library.purge-archived", "display_id": "SEQ-PURGE", "capability": "library", "title": "Delete old archived notes", "summary": "Each night the API deletes notes archived longer than the retention period.", "trigger": "library.nightly", "participants": [ { "id": "API", "is": ["system.api"], "label": "API" }, { "id": "DB", "is": ["system.db"], "label": "Database" } ], "outcomes": [], "items": [ { "msg": { "from": "API", "to": "DB", "text": "Delete notes archived before the retention period", "constants": ["constant.archive-retention"], "ops": [ { "op": "delete", "entity": "data.notes", "index": "I2", "where": "archived longer than the retention period" } ] } } ]}| Item | Shape |
|---|---|
msg |
A message (below) |
note |
{ over, text, ops?, rules?, tags? } |
alt |
{ branches: [{ when, outcome?, items }] } |
opt |
{ when, items } |
loop |
{ while, max?, items } |
par |
{ branches: [{ label?, items }] } |
break |
{ when, items } |
transaction |
{ label?, items } |
continue |
{ to, text? } |
msg fields: from, to, text (required); reply, interface (the
operation called), call, http, auth, owner, invokes, inputs,
guards, ops, rules, constants, results, timeout, retry,
idempotency, note, tags. source_kind on an input is surface,
parameter, return, stored, payload, session, constant, config, or
derived.
ops fields: op (read, insert, update, upsert, delete, lock,
audit, enqueue, write, append), entity or path (ops.target), by,
index (ops.index), where, join, set, conflict, order, limit,
mode, returns, triggers, shared_with, note. An index names the
intended access path, not the planner’s choice.
A rule used in one capability names it; a rule several use names none and is
shared (home.shared otherwise).
Rule kinds
Section titled “Rule kinds”rule_kind |
Logic | Applied by |
|---|---|---|
decision |
when/then/otherwise?, decision, table, or judge |
rules on a step, edge, message, note, or rule, or its own applies_to |
invariant |
holds, scope? or applies_to? |
its scope or applies_to |
policy |
whenever, then, otherwise?, sequence? |
its sequence, its own applies_to, or rules on a step, edge, message, note, or rule |
quality |
applies_to, measure, target, scope? |
its applies_to |
No logic for its kind is rule.empty; a decision or policy nothing applies is
rule.orphan.
{ "ready": 3, "kind": "rule", "id": "write.length", "display_id": "RULE-NOTE-LENGTH", "capability": "write", "rule_kind": "decision", "title": "A note stays within the length limit", "summary": "Decides whether a note is short enough to save.", "when": "The note is longer than the limit", "then": "Saving is refused and the editor shows the limit", "otherwise": "The note is saved", "constants": ["constant.max-note-length"]}{ "ready": 3, "kind": "rule", "id": "notifications.audience", "display_id": "RULE-NOTIFY-AUDIENCE", "capability": "notifications", "rule_kind": "decision", "title": "Questions reach every member; actions needed reach admins", "summary": "Questions reach every member of the workspace; action-needed items reach its admins only.", "table": { "columns": ["Kind", "Audience", "Recipients"], "rows": [ ["A question", "Members", "Every member of the workspace, any role"], [ "An action needed about billing or the plan", "Admins", "The workspace's admins" ] ] }}{ "ready": 3, "kind": "rule", "id": "rule.own-notes", "display_id": "RULE-OWN-NOTES", "rule_kind": "invariant", "title": "A writer reaches only their own notes", "summary": "Every read and change of a note is limited to the writer who saved it.", "holds": "Every note is read, listed, archived, and deleted only for the writer it belongs to", "scope": ["data.notes"]}{ "ready": 3, "kind": "rule", "id": "library.retention", "display_id": "RULE-PURGE-ARCHIVED", "capability": "library", "rule_kind": "policy", "title": "Archived notes are deleted after the retention period", "summary": "A note archived longer than the retention period is deleted for good.", "whenever": "A note has been archived for longer than the retention period", "then": "The note is deleted and cannot be restored", "sequence": "library.purge-archived", "constants": ["constant.archive-retention"]}{ "ready": 3, "kind": "rule", "id": "write.save-fast", "display_id": "RULE-SAVE-FAST", "capability": "write", "rule_kind": "quality", "title": "Saving feels instant", "summary": "A writer sees a save confirmed within a second.", "applies_to": ["write.save-note"], "measure": "Time from pressing Save to the confirmation, over a week of saves", "target": "Under one second for 95 in 100 saves"}
Decision rules
Section titled “Decision rules”| Field | Meaning |
|---|---|
decision |
A flowchart: { nodes: [{ id, node_kind, text, ops?, refs? }], edges: [{ from, to, label?, undirected? }] } (rule.decision) |
table |
{ columns, rows }, one cell per column (table.shape) |
judge |
A model’s judgment: { evidence, output, gate? } |
default, precedence |
What applies when nothing else does; which condition wins |
inputs, params, calculations, sets |
Inputs, tunable values, formulas, and named lists |
node_kind is input, decision, calc, judge, action, outcome,
data, or note. Node text names things in words; refs carries the links
(text.ref-id).
Every rule may also set applies_to (steps, flows, sequences, interfaces, or
entities it governs), rules (rules it applies), constants, constraints
([{ text, hard? }]), and sources (pointers to authoritative external
documents kept outside Ready Room: [{ name, location?, section?, owner?, version?, kind? }], available on every record kind). A concrete target is a
quality rule, never a DCL. A given/when/then test belongs in the code
repository.
constant
Section titled “constant”Always shared. Prose names the value in words (“the length limit”) and links
the constant from constants.
{ "ready": 3, "kind": "constant", "id": "constant.max-note-length", "display_id": "CONST-MAX-NOTE-LENGTH", "name": "MAX_NOTE_LENGTH", // required: the name code knows "value": "10000", "unit": "characters", "description": "The most characters one note may hold.",}Also: source (path#key, when code owns the value) and table
({ columns, rows }, e.g. tiers with prices).