@delurio/cli 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SPEC.md CHANGED
@@ -12,7 +12,7 @@ A graph is a directory of YAML files. Every file starts with the same three keys
12
12
 
13
13
  ```yaml
14
14
  schema: delurio-graph/0
15
- kind: flow # flow | ui | domain | nav | binding | tutorial | kit
15
+ kind: flow # flow | ui | domain | nav | binding | tutorial | kit | needs | gaps
16
16
  id: learning.enrollment
17
17
  ```
18
18
 
@@ -26,9 +26,11 @@ id: learning.enrollment
26
26
  | `binding` | `binding.yaml` | how a flow maps onto a running app, for replay and recording |
27
27
  | `tutorial` | `tutorial.yaml` | an end-user video written against a flow |
28
28
  | `kit` | `kit.yaml` | how the UI components look in one product |
29
+ | `needs` | `needs.yaml` | what must exist for a flow's users, each need with the evidence that it does or why it does not yet (§13) |
30
+ | `gaps` | `needs.gaps.yaml` | every need of a product's flows that is missing (§13) |
29
31
  | (generated) | `anchors.lock.yaml`, `viz/`, `video/` | written by the tools; never by hand |
30
32
 
31
- A flow directory holds `flow.yaml`; a flow with screens also holds `ui.yaml` and the catalog that `ui.yaml` names. It may hold `domain.yaml`, `binding.yaml` and `tutorial.yaml`. A domain shared by several flows sits in its own directory and each flow names it by id (`domain: learning.api`). A directory holds one domain and a domain sits in one directory, in `domain.yaml` or split across several files (§5). A navigation graph is a directory with `nav.yaml` and its catalog.
33
+ A flow directory holds `flow.yaml`; a flow with screens also holds `ui.yaml` and the catalog that `ui.yaml` names. It may hold `domain.yaml`, `binding.yaml`, `tutorial.yaml` and `needs.yaml`; a product's `needs.gaps.yaml` sits at the root of its graphs (§13). A domain shared by several flows sits in its own directory and each flow names it by id (`domain: learning.api`). A directory holds one domain and a domain sits in one directory, in `domain.yaml` or split across several files (§5). A navigation graph is a directory with `nav.yaml` and its catalog.
32
34
 
33
35
  A graph file is YAML 1.2 without anchors (`&name`), aliases (`*name`), tags (`!name`) or keys that are lists or maps: a value is written where it is used, and a key is a string. No graph needs them, and a YAML reader can take minutes over a small file that uses them, so a file with one cannot be loaded ("unsupported YAML", at its line). `@delurio/cli/yaml` reads a file this way.
34
36
 
@@ -103,14 +105,14 @@ A transition is a target state id, or `{ target, guard, effect: [..], say, start
103
105
 
104
106
  ### Events
105
107
 
106
- - A state with `invoke` ends with `DONE` (success) or `FAIL.<class>`, where the class is a key under `failures` for that state; `failures.<state>.from` names the domain action, and each class lists the refusal codes of that action it stands for.
108
+ - A state with `invoke` ends with `DONE` (success) or `FAIL.<class>`, where the class is a key under `failures` for that state; `failures.<state>.from` names the domain action, and each class lists the refusal codes of that action it stands for, or the transport codes `network`, `timeout` and `5xx` (§5).
107
109
  - `NAVIGATE` is the person leaving the page.
108
110
  - An event caused by someone else (a course team, a webhook, another flow) is an event like any other; its name and `say` make clear who causes it.
109
111
 
110
112
  ### Main story, scope, decisions
111
113
 
112
114
  - `main` is the story the page tells first and the path a tutorial and a replay take by default: the events, in order, from the `given` start. A plain list of events means no `given`. `--strict` fails when the events cannot be walked. Without `main`, the first success exit that passes a screen is the main story.
113
- - `scope` says what the view shows (`shows`) and how to read what it does not draw. `world: open` means that what is not drawn is not ruled out; only `assertions` and `outOfView` are binding. `world: closed` means the flow is complete.
115
+ - `scope` says what the view shows (`shows`) and how to read what it does not draw. `world: open` means that what is not drawn is not ruled out; only `assertions` and `outOfView` are binding. `world: closed` means the flow is complete. What must exist for the flow's users, whether the flow draws it or not, is in its needs (§13).
114
116
  - `decisions` are the questions still open in this flow, each with a recommendation and the states it affects.
115
117
 
116
118
  ### Assertions and the checker
@@ -119,7 +121,9 @@ A configuration is a state together with a value for every context variable. The
119
121
 
120
122
  Each assertion is `never: <expression>`: it holds when no reachable configuration satisfies the expression. A violation is reported with the shortest event path from a starting situation. Under `--strict` a violated assertion exits 2.
121
123
 
122
- The checker does not yet fail on unreachable states, transitions no situation takes, or states with no way out; the page already shows them. That is [#2](https://github.com/delurio-labs/delurio/issues/2). Paths that cover every transition are [#4](https://github.com/delurio-labs/delurio/issues/4).
124
+ `check` gives an error (`state-unreachable`) for a state that no reachable configuration is in: no transition leads to it, or those that do are never taken from a start. It gives one (`state-no-way-out`) for a state that is not an exit (`type: final`) and has no `on`, `always` or `invoke`, so that a flow that reaches it stops there without ending. Both are given at the state and fail `--strict`; the page marks an unreachable state too. Transitions that no situation takes are shown on the page and fail nothing yet; that is [#2](https://github.com/delurio-labs/delurio/issues/2).
125
+
126
+ `cover` in `@delurio/cli/model` gives event paths that together pass every reachable state, or take every reachable transition, from the same starts the checker explores (or the ones a replay is bound to). Each path is a shortest way to the state or transition it is kept for, so it repeats a state only on the way to something not yet covered; the longest are kept first, and a path that covers nothing new is left out. Each has an id, a hash of its start and its transitions, and lists what it covers, and the result lists what no situation reaches. The same flow gives the same paths in the same order. A replay walks them (`--cover`, §7). Why a transition cannot be reached, a coverage report of the walks, and the command that fails on what they did not reach are [#4](https://github.com/delurio-labs/delurio/issues/4).
123
127
 
124
128
  ### Several flows
125
129
 
@@ -152,16 +156,18 @@ catalog: catalog/en.json
152
156
  locales: [en]
153
157
  kit: ../kit # optional: the kit the screens are drawn with
154
158
  samples: { client: "Acme Notes" } # values for catalog parameters, on the page and in videos
155
- changes: { key: Changes.note } # optional: what the flow changes and what follows, in its users' words
159
+ changes: { key: Changes.note } # optional: what the flow changes and what follows, in its users' words; or { missing: <why> }
160
+ task: { key: Authorize.task } # optional: the flow's name as its users know it
161
+ focus: { <state>: <node> } # optional: the node that has focus once a step has led into the state
156
162
  nodes: { <node>: { .. } }
157
- edges: [ { labelledBy: [node, node] }, { triggers: [node, state] } ]
163
+ edges: [ { labelledBy: [node, node] }, { triggers: [node, state] }, { returnsFocus: [dialog, node | [node, ..] | opener] } ]
158
164
  rules: [ { id, rule } ]
159
165
  ```
160
166
 
161
167
  | Node key | Meaning |
162
168
  |---|---|
163
169
  | `type` | `page`, `text`, `action`, `field`, `list`, `status`, `alert` |
164
- | `component` | a kit-neutral component: `Page`, `Heading`, `Text`, `Button`, `LinkButton`, `TextField`, `List`, `ListItem`, `Status`, `Alert`. A kit maps it to the product's own (§8). A `TextField`'s `text` is its label, and the field is named by it |
170
+ | `component` | a kit-neutral component: `Page`, `Heading`, `Text`, `Button`, `LinkButton`, `TextField`, `Checkbox`, `Radio`, `Select`, `List`, `ListItem`, `Status`, `Alert`. A kit maps it to the product's own (§8). A `TextField`'s, a `Checkbox`'s, a `Radio`'s and a `Select`'s `text` is its label, and the control is named by it. A `Checkbox` (role `checkbox` or `switch`) and a `Radio` (role `radio`) say whether they are checked with `checked`; a `Select` (role `combobox`, the HTML `<select>`) is a choice of one option, and its `value` is the option it shows chosen. A `ListItem` whose role is `checkbox` or `radio`, in a `List` whose role is `group` or `radiogroup`, still says the same |
165
171
  | `role` | the ARIA role the node exposes |
166
172
  | `intent` | for actions: `confirm`, `dismiss`, `secondary` |
167
173
  | `name` | the accessible name: `{ key, params }` from the catalog, `{ labelledBy: <node> }`, `{ literal }`, or `{ oneOf: [keys] }` |
@@ -169,23 +175,59 @@ rules: [ { id, rule } ]
169
175
  | `in`, `unless` | the flow states the node is shown in, and those it is not |
170
176
  | `when` | a guard or context flag that must hold for the node to show |
171
177
  | `disabledIn` | states where the node is shown but disabled |
178
+ | `disabledWhen` | an expression over the context (§3): where it holds, the node is shown but disabled, in any state that shows it |
172
179
  | `emits` | the event the node sends when pressed |
173
- | `initialFocus` | on a page: the node that has focus when it opens |
180
+ | `initialFocus` | on a page: the node that has focus when it opens (Focus, below) |
174
181
  | `repeat` | the node is drawn once per item of this data (`request.scopes`) |
175
182
  | `frame` | for a page: whether it may be framed (`never`) |
183
+ | `value` | on a field: what it holds when it is shown, until someone types in it: `{ key, params }`, `{ literal }` or `{ oneOf }`; `{ literal: "" }` is an empty field |
184
+ | `checked` | on a node whose role is `checkbox`, `menuitemcheckbox`, `menuitemradio`, `option`, `radio` or `switch`: whether it is checked (an `option`: selected) when it is shown, as an expression over the context (§3), or `true` or `false` |
185
+ | `script` | on a page: how much of it works without JavaScript. `optional`: the page and its actions; `actions`: the page is drawn and read without it, and only its actions need it. Without `script`, the page needs JavaScript |
176
186
  | `source` | the code that draws it |
177
187
 
178
- `changes` is a catalog message that tells the flow's users, in their own words, what the flow changes and what follows from it: what is created, sent, charged or removed, who sees it, and whether it can be undone. Rehber shows it before it guides the flow and again at the step that makes the change, and it guides a flow whose steps write something only when the flow has one (rehber.install, rehber.guide; Taha, 24 Oct 2026: "readonly olmayan her akış için nelerin değişeceğini ve ne etkilerinin olacağını okuyabilecekleri bi not olsun"). The step that makes the change is found from the graph: the one that leads into a step invoking an action that writes. `graph-viz --strict` fails a flow whose steps invoke a writing action of its domain and whose ui has no `changes`, and a `changes` key missing from any locale's catalog (`tools/graph-viz/README.md`).
188
+ `task` is a catalog message that names the flow as its users know it, in their words and their language: "Edit a note", "Invite a member". Rehber names the task by it in the page's language, and a list of tasks or a video's title can show it. The graph's `title` is in the graph's language, for the people who write and review it; `task` is in every locale. `check` gives an error (`task-locale`) where `task`'s key is missing from, or empty in, the catalog of any locale. A flow without `task` is not held to one; a tool that names it to its users then has no words of theirs for it.
189
+
190
+ `changes` is a catalog message that tells the flow's users, in their own words, what the flow changes and what follows from it: what is created, sent, charged or removed, who sees it, and whether it can be undone. Rehber shows it before it guides the flow and again at the step that makes the change, and it guides a flow whose steps write something only when the flow has one (rehber.install, rehber.guide; Taha, 24 Oct 2026: "readonly olmayan her akış için nelerin değişeceğini ve ne etkilerinin olacağını okuyabilecekleri bi not olsun"). The step that makes the change is found from the graph: the one that leads into a step invoking an action that writes. `check` gives an error (`changes-note-missing`) for a flow whose steps invoke a writing action of its domain and whose ui has no `changes`, and one (`changes-note-locale`) for a `changes` key missing from any locale's catalog.
191
+
192
+ An app may have no such message yet, and a captured graph describes the app as it is (§11). Such a flow says why its note is missing instead of giving one: `changes: { missing: "<why>" }`, such as `missing: the app does not say what an import changes yet`. Its steps that write are then not guided: Rehber guides it as a writing flow without a note (above). The missing note is a gap of the flow, as a missing need is (§13): `check` gives it at `missing`, with its words, as a finding of its own (`changes-note-gap`) at the level `note` in text and in SARIF, which fails nothing, and the summary line counts it (`1 missing changes note`). So each note that is missing is a line that a review reads, and a writing flow that says neither fails as before. Decided on 16 Nov 2026 (d-1116-11).
193
+
194
+ **A `GET` that a policy lists** writes only when it does more than record its call. A policy names everything its actor may do, reads and writes together, so its `write` says what some of the actions of its `do` write, not that each of them does; and a `GET` reads (§5). Such a `GET` writes when one of its `sideEffects` is other than an audit record, `audit:<event>`. An audit record is what the service keeps of the call itself, who read what and when, as a server keeps its access log (RFC 9110 §9.2.1): it is no change that the flow's users make or are told of. So a flow that only reads, through a `GET` that writes an audit record each time it is called, needs no changes note, and one whose `GET` also writes something else, such as the session a sign-in callback opens (`sideEffects: ["a session for the person"]`), still does. An action whose method is not `GET`, and a step inside the service, write as before, whatever their side effects: an audit record beside a write is still a write. Decided on 16 Nov 2026 (d-1116-12).
179
195
 
180
196
  A `role` is a WAI-ARIA 1.2 role, and `name` is the accessible name that Accessible Name and Description Computation 1.2 gives the node; `kit check` reads both from the browser's accessibility tree.
181
197
 
182
- A node is shown in a state when the state is in `in`, not in `unless`, and `when` holds. `edges` records relations the page and the checks use: a node labelled by another, an action that leads to a state. `rules` are written but no tool reads them yet; checking them, together with dialogs, focus return, confirmation before a destructive action and events handled where shown, is [#3](https://github.com/delurio-labs/delurio/issues/3).
198
+ A node is shown in a state when the state is in `in`, not in `unless`, and `when` holds. `edges` records relations the page and the checks use: a node labelled by another, an action that leads to a state, the node a dialog gives the focus back to. `rules` are written but no tool reads them yet; checking them, together with labelled dialogs, confirmation before a destructive action and events handled where shown, is [#3](https://github.com/delurio-labs/delurio/issues/3). The focus return of #3 is partly answered: a dialog says where the focus returns with `returnsFocus` (below), and `check` holds that it starts at a dialog and gives the focus to a node shown where the dialog closes. That every dialog says it is still #3.
199
+
200
+ ### Focus
201
+
202
+ A page that opens gives the focus to its `initialFocus`. `focus` and `returnsFocus` say where it goes after that, when someone acts or a step ends. A page opens when the flow enters a state that shows it from a state that does not, or starts in a state that shows it, however the browser got there: by a step inside the app, or by loading the page anew (a link from an e-mail, a reload, the way back from another site). Its `initialFocus` holds in both; an app that leaves the focus at the document's start after a load does not meet it. The flow moves from one state it stops in to the next: a state with `always` is passed at once, so the focus is never said there. When the flow moves from one state into another, the node that has focus in the new state is the first of these that applies:
203
+
204
+ 1. the node of `{ returnsFocus: [<dialog>, <node>] }` in `edges`, when the dialog closes (the state before shows it and the new one does not) and the new state shows the node. The dialog is a page node whose role is `dialog` or `alertdialog`, and the node is usually the one that opened it, as the dialog pattern of the ARIA Authoring Practices Guide asks. Where several nodes open the same dialog, the second item is the list of them, `[<dialog>, [<node>, ..]]`, or `opener`, `[<dialog>, opener]`: the focus goes back to the node that opened the dialog this time, one of those listed for a list (opener, below);
205
+ 2. the `initialFocus` of a page that opens and has one; when a dialog opens over a page, the dialog's;
206
+ 3. `focus.<state>`, the node that has focus when the flow enters that state from another one: on a page that stays open, the alert a failed step shows, or the status that says a step is done.
207
+
208
+ When none applies, and when the flow moves from a state to itself, the graph says nothing of the focus. `focusAfter` in `@delurio/cli/graph` gives this order.
209
+
210
+ The node that opened a dialog is the one pressed to open it: a node shown in the state before the dialog opened, whose `emits` is the event of the transition into the state that shows the dialog (past states with `always`). A dialog that edits any of four fields, each with its own Edit button, gives the focus back to the Edit button that was pressed. The graph cannot say which one that was, as the four lead to the same state; a replay knows the node it pressed, and gives it to `focusAfter` as its fourth argument. Without it, `focusAfter` gives the one node of a list that the new state shows, and nothing for `opener` or for a list of which the new state shows several. `opener` is a word of the format, not a node: no node is called `opener`. A replay checks, in each state it stops in, that the node the graph gives has the focus: the browser's focused element is that node, found by its role and name or by its binding (§7).
211
+
212
+ A state that `focus` names that is not a state of the flow keeps the graph from loading. `check` gives an error (`focus-not-shown`) where `focus` gives the focus to a node its state does not show (by `in` and `unless`; a replay reads `when`), or a `returnsFocus` to a node no state the dialog closes into shows, and one (`returns-focus-not-dialog`) where a `returnsFocus` starts at a node that is not a dialog. For a list, each node it lists is held so; for `opener`, each node that opens the dialog, and a dialog that no node opens is `focus-not-shown` too.
213
+
214
+ ### What a control holds, and pages without JavaScript
215
+
216
+ `value` is what a field holds when it is shown, until someone types in it. It takes the forms of a node's words except `labelledBy`: `{ key, params }` from the catalog, `{ literal }`, or `{ oneOf }`, and `{ literal: "" }` is an empty field. A replay compares it in each state that shows the field, up to the step at which its walk types in that field. `checked` says whether a control is checked, or for an `option` selected, in each state that shows it: an expression over the context there (§3), or `true` or `false`. A control someone checks during the flow is checked by an event, and the expression reads what that event's effect sets; one that the flow finds already checked is said over the context, such as the radio of the role a member already has (`checked: "role == 'admin'"`). A replay compares it in each state that shows the node. On a node drawn more than once (`repeat`, or words given as `oneOf`), `value` and `checked` hold for each control it draws; controls that differ are written as separate nodes.
217
+
218
+ `disabledIn` lists the states in which a node is shown but disabled. `disabledWhen` disables it by what the context holds, in every state that shows it: a Continue button disabled until a VAT number is typed (`disabledWhen: "not vatGiven"`, where typing it is an event whose effect sets `vatGiven`), or until a box is ticked (`disabledWhen: "not accepted"`, beside the box's `checked: accepted`). A node is disabled where either says so. A replay compares it in each situation it stops in, from the context it has walked to there. A `disabledWhen` that does not parse, or names anything but a variable, a guard or `state`, keeps the graph from loading, as `checked` does.
219
+
220
+ `script` on a page says how much of it works without JavaScript. With `script: optional` the page and its actions work without it: its forms are posted and its links followed by the browser itself, and JavaScript only adds to them. With `script: actions` the page is drawn and can be read without JavaScript, as a page rendered on the server is, but its actions need it. Without `script` the page needs JavaScript, and the graph says nothing of it without. A replay with `--no-js` (§7) walks the flow a second time with JavaScript off. In a state whose page is `optional` it checks what the state shows, as on the first walk, and takes the next step there. In a state whose page is `actions` it checks what the state shows, and takes no step from it: the walk ends there, as it does where a step leads to a page without `script`.
221
+
222
+ While scripts do not run, an action of a page marked `actions` is not there, or it is there disabled and says why. A control that looks ready and does nothing when pressed, a dead button, does not meet this. The app may leave the control out of the page it draws on the server and add it when its script runs, or draw it disabled (`disabled`, or `aria-disabled="true"`) with an accessible description that gives the reason, such as that it needs JavaScript (a `<noscript>` note that `aria-describedby` points at). So in such a state the `--no-js` walk checks each action node the state shows (`type: action`): it is not visible, or it is disabled and its accessible description (Accessible Name and Description Computation 1.2) is not empty. One that is visible and enabled, or disabled with no description, is a mismatch.
223
+
224
+ The `schema` rule refuses `value` on a node that is not a field, `checked` on a node of another role, `script` on a node that is not a page, and a node called `opener`. A `checked` or a `disabledWhen` expression that names neither a variable, a guard nor `state` keeps the graph from loading. A `value` from the catalog is held as a node's text is (`catalog-key-missing`, `sample-missing`).
183
225
 
184
226
  ### Catalog
185
227
 
186
228
  A JSON object from key to an ICU MessageFormat message: the syntax of the catalogs apps already keep (ICU, FormatJS, next-intl), so a captured catalog is copied as it is. Today the tools fill simple arguments: `{param}` is filled from the node's `params`, which name sample or data values. A `plural` or `select` argument is read when a catalog first needs one. MessageFormat 2 (Unicode, stable since CLDR 47) is read when an app's own catalog is written in it.
187
229
 
188
- One file per locale; `ui.yaml` names the one the page uses. A locale is a BCP 47 tag, in the file name (`en.json`, `tr.json`, `pt-BR.json`) and in `locales` and `locale`.
230
+ One file per locale; `ui.yaml` names the one the page uses (`catalog`), and `locales` lists every locale its screens are written in, each in a file of its own beside that one, `<locale>.json`. A `ui.yaml` that names no catalog, or names one that is not there or is not JSON, cannot be loaded. `check` holds every locale's catalog to the same words: a key that a screen uses (a node's `name`, `text` or `value`) and that a locale's catalog lacks is an error (`catalog-key-missing`) at the key in `ui.yaml`, and so is a locale of `locales` whose file is not there. A placeholder with no sample value (`sample-missing`) is looked for in the catalog `ui.yaml` names. A locale is a BCP 47 tag, in the file name (`en.json`, `tr.json`, `pt-BR.json`) and in `locales` and `locale`.
189
231
 
190
232
  ## 5. Domain (`kind: domain`)
191
233
 
@@ -262,7 +304,21 @@ This form was decided on 22 Oct 2026. Graphs captured before it may still give f
262
304
 
263
305
  A value given in two files is an error of `check` at the second one's line (`domain-twice`); so is a file whose id is not its directory's domain, and a domain whose files sit in two directories (`domain-place`). A split keeps a large domain one entity per file, and lets a part generated from the code ([#6](https://github.com/delurio-labs/delurio/issues/6)) and a part written by hand sit side by side; how a generator marks the files it owns is decided there. Decided on 1 Nov 2026.
264
306
 
265
- `check` validates every file of a domain against its schema and reads its files as one, the `changes` rule (§4) reads its actions (one writes when its route or its server function is not a `GET`, when a policy lets someone `write` with it, or when it is a step inside the service that returns an entity), the revision diff compares it, anchors lock its `source:` keys, and the page of a flow that names it lists what each of its steps calls and how: an HTTP operation and its route, a server function and its method, or a step inside the service. Loading it with the flow and checking policies, secrets and `invoke` names is [#5](https://github.com/delurio-labs/delurio/issues/5); generating it from Drizzle and Zod is [#6](https://github.com/delurio-labs/delurio/issues/6); a registry that every API operation and route is covered by a graph is [#7](https://github.com/delurio-labs/delurio/issues/7).
307
+ `check` validates every file of a domain against its schema and reads its files as one, the `changes` rule (§4) reads its actions (one writes when its route or its server function is not a `GET`, when a policy lets someone `write` with it, or when it is a step inside the service that returns an entity; a `GET` that a policy lists writes only when it does more than record its call, §4), the revision diff compares it, anchors lock its `source:` keys, and the page of a flow that names it lists what each of its steps calls and how: an HTTP operation and its route, a server function and its method, or a step inside the service. `check` also reads the domain a flow names, and holds the names the flow gives to it (The names a flow gives, below). Checking secrets (`sensitivity`) and what a policy lets each actor do is [#5](https://github.com/delurio-labs/delurio/issues/5). Generating it from Drizzle and Zod is [#6](https://github.com/delurio-labs/delurio/issues/6); a registry that every API operation and route is covered by a graph is [#7](https://github.com/delurio-labs/delurio/issues/7).
308
+
309
+ **The names it gives.** A domain's names are its own: `check` holds each name a domain gives to what the domain has, all its files read as one, and gives each finding in the file that gives the name, at its line. An action's `result.returns`, and a `references` on a field of an entity or anywhere in a `body`, a `query`, a `result` or a refusal's `body`, name an entity of the domain, as the keywords above say; one that names no entity of it is an error (`entity-unknown`). Where another domain among the graphs checked has an entity of that name, a note says where: a domain does not name another one's entities, and a large one is split across the files of its directory instead (Several files, above). So a name that only another domain has is an error too, with that note (decided on 16 Nov 2026, d-1116-13). An entity's `key` and `required` name its own fields; one that is not a field of the entity is an error (`field-unknown`), and an entity none of whose files gives `fields` yet is not held to them. A policy's `do` names actions of the domain, and its `read` and `write` name entities; one that names what the domain does not have is an error (`policy-unknown`).
310
+
311
+ **The names a flow gives.** A flow's names are held to its domain as the domain's own are. A state's `invoke: { action }` names an action of the domain the flow names, and so does `failures.<state>.from`; one that names no action of it is an error (`invoke-unknown`), and so is a flow whose states invoke actions while the domain it names is not found beside it (under the nearest folder called `graphs`). Each class under `failures.<state>` lists codes of that action's `refusals` (§2), or transport codes (below); any other code is an error (`refusal-unknown`). A state that invokes an `external` or a `flow` is not held to the domain. Decided on 16 Nov 2026 (d-1116-10): these fail `--strict` from the release that first gives them, with no release in which they only warn.
312
+
313
+ **Transport codes.** A call can fail without the action answering it with a code of its own: nothing comes back, or the server fails. Three codes stand for these failures, and a failure class may list them though the action has no refusal of that name:
314
+
315
+ | Code | The call fails because |
316
+ |---|---|
317
+ | `network` | no answer comes back: the address cannot be reached, the network is down, or the connection breaks before the answer |
318
+ | `timeout` | the answer does not come within the time the caller waits for it |
319
+ | `5xx` | the server answers with a status from 500 to 599 that is not one of the action's refusals: it failed, or it is not available |
320
+
321
+ They are the only ones. A failure that the action answers with a code of its own, such as a protocol's `server_error` or a service's `UNAVAILABLE`, is one of its refusals, as `UNAVAILABLE` and `server_error` are in `examples/qauth-authorize`. An action may also give a refusal one of these three names, and that refusal is then its own.
266
322
 
267
323
  ## 6. Navigation (`kind: nav`)
268
324
 
@@ -280,7 +336,7 @@ facts: { role: { values: [..], say: .. } }
280
336
  sets: { staffRoles: [..] }
281
337
  guards: { name: "<expression over facts>" }
282
338
  personas: { visitor: { title, say, facts: { .. } } }
283
- pages: { start: { route: /, title: <catalog key>, kind: screen, frame: site, source, opensFor, refusal } }
339
+ pages: { start: { route: /, title: <catalog key>, kind: screen, frame: site, source, opensFor, refusal, byAddress } }
284
340
  entries: [ { from: <page> | frame:<frame> | [..], to: <page>, how: menu, label: <catalog key>, when, clicks, data, back } ]
285
341
  goals: [ { id, say, page, for: [persona], within: <clicks> } ]
286
342
  notModeled: [ "..." ]
@@ -288,23 +344,56 @@ notModeled: [ "..." ]
288
344
 
289
345
  - A **frame** is the chrome around a page (a menu, a top bar). An entry `from: frame:<f>` is on every page of that frame.
290
346
  - A **page** has a `kind`: `screen`, `placeholder`, `missing`, `redirect` or `external`. `opensFor` is the guard under which it opens; `refusal` says in words how it says no. A page called `start` is required.
347
+ - A page's `route` is the path it opens at. In it, `{name}` stands for one segment of the path, a parameter (`:name` is read the same), and `{...name}` for any number of segments: a catch-all, the page that any other address below it lands on, such as `/{...path}` for the page that says nothing is there, or `/docs/{...slug}`.
348
+ - A page that nothing in the app links to, such as a sign-in page that another site sends people to or a page that any unknown address lands on, says `byAddress: true`: people open it by its address, typed or followed from outside the app, such as a link in an e-mail. A persona whom no way from `start` brings there reaches it so, with no clicks, and goes on from it by its entries; a page that only such a way reaches is counted from it. So such a page is not unreachable: the persona views, the navigation page and the revision diff say "by its address" where they give the way, and a way from `start`, where there is one, stays as it is. Decided on 16 Nov 2026 (d-1116-14).
291
349
  - An **entry** is a way from page to page: `how` is `auto`, `menu`, `picker`, `user`, `link` or `button`; `when` is the guard under which it is offered; `data: true` means it needs an item to exist (a row to click).
292
350
  - A **persona** is a fixed set of facts, so no search is needed: the tool works out each persona's view, menu and reachable pages, and checks every goal (the page is reached within the clicks).
293
351
  - A `nav.yaml` may `extends` a generated `nav.extracted.yaml`: the generated pages and entries come first, and the hand-written file adds to them or overrides single fields.
352
+ - `source` says where a graph was read from: the application's `repo`, the `commit`, its `app` folder, the file of its `menu`, and `locales`, its message file or a list of every file it reads, `{locale}` standing for the locale in each path. `extract` says how the extractor reads the application: its `adapter`, the `names` and `titles` it gives pages, the `locales` it copies into the catalog, and `entries`, fields laid over a generated entry, which the hand-written file cannot change otherwise. `entries` is keyed by an entry's ends, as an entry is cited (`<from>-><to>`, followed by its `how` or its label where two share their ends), and gives `when`, `data`, `label`, `how`, `back` or `clicks`, or `skip: <why>` to leave the entry out.
294
353
 
295
354
  ## 7. Binding (`kind: binding`) and tutorial (`kind: tutorial`)
296
355
 
297
- A **binding** ties a flow to a running app for replay and recording: `apps` (base addresses), `browser`, `data` (JSON or dotenv sources, secrets masked in reports), `signIn`, `accounts`, `scenarios` (each a `given` start, the account, the page to `open`, `setup` and `teardown`), `events` (the actions that cause an event no node on screen sends), `states` (a URL glob or a text a state must show) and `nodes` (a locator for a node that role and name cannot find, or `before` actions such as opening a menu, or `skip` with a reason). It may `extends` a shared binding. An action is one of `goto`, `reload`, `click`, `fill`, `key`, `waitUrl`, `waitText`, `waitResponse`, `run` (a command, with `expect`). A locator is `role`, `name`, `text`, `label`, `testId`, `css`, `hasText`, `within`, `nth`; a string between slashes is a regular expression. Replay over HTTP, with no browser, is an open issue; screenshots of every state on the real app are an open issue.
356
+ A **binding** ties a flow to a running app for replay and recording: `apps` (base addresses), `browser`, `data` (JSON or dotenv sources, read again after each command, secrets masked in reports), `signIn`, `accounts`, `scenarios` (each a `given` start, the account, the page to `open`, `setup` and `teardown`, `javaScript: false` for a walk with JavaScript off, and `enter`, the way the walk comes in), `events` (the actions that cause an event no node on screen sends), `effects` (the checks of what a step changes outside the screen), `states` (a URL glob or a text a state must show, the server `call` a step makes, the account `as` whose screen it is, and `before` actions) and `nodes` (a locator for a node that role and name cannot find, or `before` actions such as opening a menu, `count` for how many elements it finds, or `skip` with a reason). It may `extends` a shared binding. An action is one of `goto`, `reload`, `click`, `fill`, `attach`, `key`, `waitUrl`, `waitText`, `waitResponse`, `run` (a command, with `expect`), and any action may carry `as`. A locator is `frame`, `role`, `name`, `text`, `label`, `testId`, `css`, `hasText`, `within`, `nth`; `frame` is the CSS selector of the iframe the element is drawn in, such as a payment provider's hosted form, and is looked in first; a string between slashes is a regular expression.
357
+
358
+ `fill` types its value into a field. A native `<select>` cannot be typed in, so on one `fill` chooses the option whose visible text is the value; a value that no option shows fails the step, and the failure lists the options there are. `attach` gives a file input its files, in one of two forms. `attach: { <locator>, file: <path> | [<path>, ..] }` gives it fixtures, each a path relative to the binding's file and inside its folder: a path that is absolute, that climbs above the folder with `..`, that does so once its `{placeholders}` are filled in, or that is a link to a file outside the folder is refused. `attach: { <locator>, run: [<command>, <argument>, ..], fileName: <name>, mimeType: <media type> }` gives it what a helper writes to its standard output, as a file of that name: `run` is the command and its arguments, as a list, run with no shell, and the file's media type is `mimeType`, or else follows from the name's extension. Where the locator finds something other than an `<input type="file">`, such as a button drawn over a hidden input, the replay presses it and gives the files to the file chooser it opens.
359
+
360
+ `as: <account>` on an action does it in that account's own browser, with its own cookies, opened and signed in the first time it is used: a step another person takes, such as a second member who approves or an invitee who accepts, is bound to actions `as` that person, and the walk goes on in the first browser after them. A state may carry `as` too: its screen is that person's, so it is checked, and its nodes are pressed, in their browser, while a state without `as` is the scenario's own account's. A state's `before: [actions]` runs when the walk reaches the state, before it is checked, such as that person opening the link an e-mail brought them. So a step another person takes after arriving by a mailed link is bound to its state: `as` the invitee, `before` opening the link. `effects: { <id>: [actions] }` checks what a step leaves outside the screen, such as an e-mail sent or a row written. `<id>` is an effect of the flow (§2) or an action of its domain (§5): the actions run after the walk takes a transition that applies that effect, or after a state that invokes that action ends with `DONE`. They are checks, typically a `run` with `expect` that reads a mail catcher's API or queries the database, and one that fails is a mismatch at that step.
361
+
362
+ `count: <number | "{data.path}">` on a node says how many elements its locator finds, as a number or a value of the binding's data: for a `repeat` node (§4), how many items it shows, and for any other node, how many there are, such as four radios and no fifth. Without it a `repeat` node shows at least one item, and more are accepted. `call: <url glob>` on a state names the server call its `invoke` makes. The replay holds the call until it has checked what the state shows, so a step in progress (its status, the controls in `disabledIn`) is seen as it is, and then lets it go; on a walk through `FAIL.<class>` it compares the call's HTTP status with the `status` of the refusals that the class stands for (§2, `failures`; §5). A scenario with `javaScript: false` is walked with JavaScript off, through the pages marked `script` (§4).
363
+
364
+ The binding's `data` is read when a walk starts, after its `setup`, and again after each `run`, so a command can hand the next action a value it has just written, such as the link or the code of an e-mail that it read from a mail catcher. A source whose file does not exist yet is allowed: the walk fails, naming the file, only when an action uses a value of it (`{<source>.<path>}`) while the file is still missing.
365
+
366
+ A walk reads every screen in one language: the binding's `browser.locale`, a BCP 47 tag the browser is set to, or the replay's `--locale`. Each screen is checked against the flow's catalog of that language (§4), found by the whole tag first and then by its language alone: `tr-TR` reads `catalog/tr.json`, and `pt-BR` reads `pt-BR.json` before `pt.json`. A locale the flow has no catalog for is refused, never checked in another language. A flow the walk enters (`enter`) and a navigation graph are read in the same language. `--locale` may be given more than once: the walks are made in each locale, each with a report of its own. A walk keeps to its language: after a step that switches the app's language, the next screens are still read in the walk's. Without either, the screens are read against the catalog `ui.yaml` names.
367
+
368
+ `browser.ignoreHTTPSErrors: true` opens a page served with a certificate no authority signed, such as an app on a self-signed `https` origin in development; without it, such a page fails the walk.
369
+
370
+ What a person types, or what a scenario's `setup` put in place, the graph may leave to chance (`havoc`, §2), while on the app it is what the scenario made it. So a walk keeps, through a `havoc`, the value its scenario's `given` gives each variable that starts from any value: a refusal is walked from a scenario that types the invalid value, and a way that needs the value changed there is not bound from that scenario (it is listed as not bound), rather than walked from one that set up the opposite. A variable that starts from a fixed value takes the values the `havoc` allows, as in the graph.
371
+
372
+ Where several nodes on the screen send the event a step takes, such as two radios of one choice, the binding's `events.<EVENT>` says which is pressed, when it gives one; otherwise the first of them in `ui.yaml` that the state shows enabled is pressed.
373
+
374
+ The **replay** walks a flow on the app through its binding and checks each state it stops in: the nodes the graph shows there (their role, name and text, whether they are disabled, which one has the focus, what a field holds and whether a control is checked, §4), the state's `url` and `text`, and the `effects` of the step that led there. `replay <flow dir> --bind <binding>` walks the main story (§2). `--to <state>` walks the shortest way to that state that the binding can drive. `--cover states` walks paths that together pass every reachable state, and `--cover transitions` paths that together take every reachable transition, from the binding's scenarios and through the steps it can drive (§2, `cover`). Under `--cover` every scenario of the binding is walked at least once. A path is walked from the first scenario, in the order of the file, that starts where it starts. A scenario that no path is walked from, as it starts where another does (the same `given`, with other data or another account) or reaches nothing the others do not, gets one walk of its own: of the paths that `cover` gives from its start alone, the one that covers the most, or its first screen when it can drive no step. That walk covers nothing new, and its id is that path's with the scenario's name. So one binding holds every scenario of a flow. `--scenario <name>`, given once or more, keeps the walks to those scenarios of the binding, with the other choices as they are (`--cover`, `--to`); a name the binding does not have is refused. The main story is walked from the scenario that starts where it starts, and when none of those given does, it is listed as not bound, with that reason. `--no-js` walks the pages marked `script` a second time with JavaScript off: those marked `optional` with their actions, those marked `actions` read only, their actions absent or disabled with a reason (§4). `--absent` also checks that a node the graph does not show in a state is not visible there; without it, the replay checks only what the graph shows, and a node it leaves out of a state may be there or not. An exit may open another page of the same frame: another address, not only another `#fragment`, or a document loaded anew since the screen checked before it. There `--absent` leaves out what that page draws as well, and the step's report names what it left out: the frame's chrome, the nodes that the screen before showed outside every page node it showed (a menu, a bar, a sidebar beside the page's main content), and a node found by a landmark's role alone, such as a bare `role: main`, which matches the next page's own. A node of the flow's page that is still there, its heading, a field, its dialog, or a landmark found by its name, is still a mismatch, and on an exit that stays on the page nothing is left out. A state or a node that only missing needs are drawn as is planned, not built: every walk leaves it out, and the replay lists it with those needs (§13).
375
+
376
+ `enter` says how a scenario's walk comes into the flow, after the scenario opens its page (`open`). `enter: { nav: <nav graph dir>, bind: <nav binding>, entry: <from>-><to> }` presses that entry of a navigation graph (§6), found as its own replay finds it (below), its menu opened first, and the address must become the route of the entry's page; `bind` may be left out when the entry's label alone finds it. `enter: { flow: <graph dir>, bind: <its binding>, given: { .. }, event: <EVENT> }` walks another flow from `given`, by the shortest way its binding can drive, to the transition on `<EVENT>` whose `starts` names this flow (§2, Several flows), and checks its screens on the way; what that `starts` hands over must be this scenario's own `given`. The paths are relative to the binding's file. On arrival the focus must be on the `initialFocus` of the entered flow's first screen, past its rules and server calls, and the flow's own walk then goes on from its initial state, so that every walk of the flow can begin where a person comes in.
377
+
378
+ A binding may tie a navigation graph (§6) to the app instead of a flow. It names the graph with `nav: <id>` in place of `flow`, has the keys a flow's binding has for the app (`root`, `extends`, `apps`, `browser`, `data`, `signIn`, `accounts`), and gives `samples` for the `:params` of the routes; a page is opened at the first app and its route. Without `personas`, each persona of the graph signs in as the account named like it. `personas.<persona>: { as, setup }` lets one account stand for several personas: `as` names the account, and `setup`, commands (`run`) done before that persona's visits, gives the account the persona's facts, such as its role. A `setup` at the top, also commands only, runs once before the first persona, for instance to sign the people up. The other keys say where the replay finds what the graph names, and each may be left out. `frames.<frame>` gives `find`, the frame's chrome, where its `menu` entries are; `page`, where a page of the frame draws its own entries (`link`, `button`); and `user` and `picker`, each `{ open: [actions], find }`: what opens the person's menu or the switcher, and the open menu, where their entries are found. `pages.<page>` gives `refusal`, a locator for the words in which the page says no (the graph says them in prose, so a refusal is checked only with one); `shows`, what proves the page opened, absent when it refuses; `samples`, the `:params` of its route for this page, over the binding's own, so that two pages on one route open at items of their own (a revision in review and one decided); or `skip` with a reason. `entries.<from>-><to>` is keyed by the entry's ends, as a code comment cites it (`N:<from>-><to>`), `<from>` being a page or `frame:<frame>`, followed by its `how` or its label key where two entries share their ends (`frame:workspace->start picker`). It gives a locator for the entry's element, where its label is not its accessible name or the entry needs an item (`data: true`); `skip` with a reason; or `follow`. Without a locator in the binding, an entry is found by its label, as the accessible name of what its `how` draws: a link (`menu`, `link`), a button (`button`) or a menu item (`user`, `picker`), in the frame's `find`, its `page` or the open menu.
379
+
380
+ `replay <nav graph dir> --bind <binding>` opens every page the binding can open, as every persona it binds, and checks what the graph says that persona meets there: the page stays at the address it was opened at, and it opens, or refuses where its `opensFor` does not hold (its `refusal` shown and its `shows` not); each bound frame's chrome is there on the frame's pages and absent on the others; and each entry of the page or of its frame is shown where its `when` holds for the persona and absent where it does not. An entry that needs an item is checked only where the binding gives its locator. `--persona <id>` and `--page <id>`, each given once or more, keep the walk to those personas and pages. `--follow` also takes each entry shown, once per persona, and checks that it lands on its page's route; a `button` acts, so it is taken only with `follow: true`, and `follow: false` keeps an entry from being taken at all (one that signs out or deletes). `--no-setup` skips the top-level `setup` and uses the people of the last run again. `--locale`, once or more, reads the pages in that language: the entries' labels from the navigation graph's catalog of it, found as a flow's is.
381
+
382
+ Replay over HTTP, with no browser, is an open issue; screenshots of every state on the real app are an open issue.
383
+
384
+ A **tutorial** is written against a flow: `title`, `audience`, `locale`, `appName`, `voice`, `stage`, the `scenario` (the starting context), and `steps`. A step is `intro`, `chapter`, `show <state>`, `cut <state>` (jump, through a scenario the binding names), `reveal`/`focus` (nodes), `press <node>`, `after`, `then`, `card { title, body }`, `end <state>` (the exit the flow ends at, or the screen the video closes on), and `say`. Every step is replayed on the flow, so a tutorial that no longer matches the graph stops at that step. `{word}` in `say` is a sample value or a node's visible text.
298
385
 
299
- A **tutorial** is written against a flow: `title`, `audience`, `locale`, `appName`, `voice`, `stage`, the `scenario` (the starting context), and `steps`. A step is `intro`, `chapter`, `show <state>`, `cut <state>` (jump, through a scenario the binding names), `reveal`/`focus` (nodes), `press <node>`, `after`, `card { title, body }`, `end`, and `say`. Every step is replayed on the flow, so a tutorial that no longer matches the graph stops at that step. `{word}` in `say` is a sample value or a node's visible text.
386
+ `then { <variable>: <value> }` says how a step comes out where an effect leaves it to chance (`havoc`, §2): what the host answered, what a folder held. Of the cases the step's transitions can take, the step takes the one in which these variables have these values. A step without `then` takes the model's first case, and a `then` that no case of the step matches stops the tutorial at that step. So a tutorial can go the way a person meets most, such as a host that lists their repositories, when the graph also allows every other answer.
300
387
 
301
388
  `stage` says what the video shows: the flow's screens (`screen`, the default), or its diagram (`diagram`), for a flow with no screens, such as two programs talking or a job in the background. On the diagram the camera goes from state to state, and the tutorial's own way is drawn as the story, whether or not it is the flow's `main` story; the diagram holds every transition, failures included. No state is passed on its own there: `show <state>` and `end <state>` walk the flow to their state along its normal way (a transition with no event, then `DONE`) and stop the tutorial when that way does not reach it, and every other event is given with `after`. `press`, `reveal` and `focus` point at nodes a diagram does not have, and stop it too. An `end` on the diagram needs no `card`; one it has is shown after the ending.
302
389
 
390
+ `check` reads the `tutorial.yaml` beside a flow and replays it on the flow as the video does, from the start its `scenario` gives: a value of its list for each variable that starts from any value, and none that differs from a fixed `initial`. On the screens, a step that shows no screen passes on its own along its normal way (a transition with no event, then `DONE`), and one with no such way waits for an event given with `after`; on the diagram, `show` and `end` walk as above. A tutorial that no longer matches its flow is an error (`tutorial-mismatch`) that fails `--strict`, at the step where it stops: its `flow` is not the flow beside it; a step names a state, a node, an event, a variable or a value the graph does not have, or a `{word}` that is neither a sample value nor a node with visible text; `show` names a state the flow is not in; `cut` names a state no reachable situation is in, with the nodes it `reveal`s shown; `press` names a node the state does not show, or disables, or that sends no event the state handles; `after` names an event the state does not handle; `reveal` or `focus` names a node the step's screen does not show, or `focus` one shown only `when` something holds and not revealed; `end` names a state the flow is not in, or, given no state, the flow is not at an exit; or a `then` matches no case of its step. Every name is looked for on every step, and the steps are replayed once all are found.
391
+
303
392
  A video is an MP4 file. Its captions are WebVTT (`tutorial.vtt`, what an HTML `<track>` plays, with `tutorial.srt` beside it), and its chapters a WebVTT chapters track (`chapters.vtt`). Every video delurio makes is marked as AI-made in three ways, none of which can be turned off: a first card that says the whole video is made with AI, an imperceptible watermark in the sound and the picture, and signed, time-stamped provenance metadata (C2PA is the candidate). The watermark and the metadata are the machine-readable marking that Art. 50(2) of the EU AI Act asks of a system that generates synthetic audio and video, and the Commission's Code of Practice of 10 June 2026 describes. The disclosure is there because every voice is made from real people's recordings and may resemble one of them, which Art. 50(4) treats as a deep fake to disclose; a catalogue voice is no different from a cloned one in that, and delurio cannot tell which listener would recognise which voice (Taha, 24 Oct 2026: "Klon olmayan sesler de gerçek insan sesinden"). It opens the video, since Art. 50(5) asks for it at the latest at the first exposure, and nothing is burnt into the picture after it (Taha, 25 Oct 2026: "en başta 'videonun tamamı' diye belirtip yazsak yetmez mi"); a clip cut from the middle loses the card but keeps the watermark and the metadata. A lawyer is to confirm this reading. The video tool does not add the watermark or the metadata yet; that is an open issue.
304
393
 
305
394
  ## 8. Kit (`kind: kit`)
306
395
 
307
- A kit says how the components of `ui.yaml` look in one product: `tokens` and `dark` (design tokens files in the Design Tokens Format Module 2025.10 of the W3C Design Tokens Community Group), `css` (scoped to the screen), and per component a `template` with slots (`{text}`, `{name}`, `{intent}`, `{id}`, `{children}`), flags (`{?disabled}..{/disabled}`, `named`, `conditional`), `roles` and `intents`. A kit is data: nothing in it runs or is fetched. `kit check` proves that every node keeps the role, the name and the disabled state the graph expects.
396
+ A kit says how the components of `ui.yaml` look in one product: `tokens` and `dark` (design tokens files in the Design Tokens Format Module 2025.10 of the W3C Design Tokens Community Group), `css` (scoped to the screen), and per component a `template` with slots (`{text}`, `{name}`, `{intent}`, `{id}`, `{children}`), flags (`{?disabled}..{/disabled}`, `named`, `conditional`, `checked`: a node whose `checked` is `true`), `roles` and `intents`. A kit is data: nothing in it runs or is fetched. `kit check` proves that every node keeps the role, the name and the disabled state the graph expects.
308
397
 
309
398
  ## 9. Source anchors
310
399
 
@@ -317,8 +406,10 @@ A kit says how the components of `ui.yaml` look in one product: `tokens` and `da
317
406
  | Exit | Meaning |
318
407
  |---|---|
319
408
  | 0 | the graph loads and, under `--strict`, nothing is wrong |
320
- | 1 | the graph cannot be loaded: a YAML error, unsupported YAML (§1), an unknown state, an unknown name in an expression, a non-exhaustive `always`, an unsupported construct |
321
- | 2 | under `--strict`: an assertion is violated, a catalog key or a sample value is missing, a component has no renderer, the kit does not cover a component, the main story cannot be walked, a domain's files clash or a server function has what only a route has (§5), or a state of a captured flow names no code (§9) |
409
+ | 1 | the graph cannot be loaded: a YAML error, unsupported YAML (§1), an unknown state, an unknown name in an expression or one that does not parse, a non-exhaustive `always`, an unsupported construct, a `ui.yaml` that names no catalog or a catalog that is not there or not JSON (§4) |
410
+ | 2 | under `--strict`: an assertion is violated, a state no situation reaches or a state that is no exit and has no way out (§2), a catalog key is missing from a locale's catalog or a sample value from the samples, a component has no renderer, the kit does not cover a component, the main story cannot be walked, the focus goes to a node that is not shown or a `returnsFocus` does not start at a dialog (§4), a domain's files clash, a server function has what only a route has, a domain names an entity or a field it does not have, a policy names an action or an entity its domain does not have, or a flow invokes an action its domain does not have, names a domain that is not found, or lists a failure code that is neither a refusal of its action nor a transport code (§5), a tutorial no longer matches its flow (§7), a state of a captured flow names no code (§9), or a need's evidence does not resolve, a need that is not missing names none, or a product's gaps and its needs disagree (§13) |
411
+
412
+ A graph that cannot be loaded is a finding of the rule `load`, at its place: the file and the line of what it is about (the transition that goes to a state that does not exist, the guard that does not parse, the `catalog` of `ui.yaml`), or the line and column a parser gave. The other graphs are checked as usual.
322
413
 
323
414
  **As text.** A finding is one line in the GNU error format, which compilers, editors and most CI logs read:
324
415
 
@@ -327,7 +418,7 @@ graphs/panel/nav/nav.yaml:42:5: error: the menu entry opens a page that refuses
327
418
  graphs/product/flow.yaml:88:7: note: step 2: CODE_CHANGED from developing, with replayed = false
328
419
  ```
329
420
 
330
- `error` fails under `--strict` and `warning` does not; the `note` lines after a finding give its path or the places it relates to. On GitHub a problem matcher turns these lines into annotations on the pull request, at no cost and on pull requests from forks too.
421
+ `error` fails under `--strict` and `warning` does not; the `note` lines after a finding give its path or the places it relates to. A gap of a product (§13), and a changes note that a flow says is missing (§4), is a finding at the level `note`, which fails nothing. With `--baseline`, an error the base run had is printed as a `warning`, as it fails nothing, but a `load` error fails the run however often it was seen and is printed as an `error`. The summary on the last line counts the findings at the levels they are printed at; once a flow has needs, the gaps among them (§13); and the changes notes that flows say are missing (§4). On GitHub a problem matcher turns these lines into annotations on the pull request, at no cost and on pull requests from forks too.
331
422
 
332
423
  **As SARIF.** `--format sarif` writes SARIF 2.1.0 (OASIS), which code scanning on GitHub, GitLab and Azure DevOps, SonarQube and the SARIF viewer for VS Code read. A finding of a graph fills every part of SARIF it has:
333
424
 
@@ -342,6 +433,7 @@ graphs/product/flow.yaml:88:7: note: step 2: CODE_CHANGED from developing, with
342
433
  | the flow itself, and the path drawn on it | `run.graphs` and `result.graphTraversals` |
343
434
  | the same finding in a later run, though its lines moved | `fingerprints` (`delurio/v1`: from the rule, the graph and the element, not the line) |
344
435
  | a finding dismissed with a reason (`finding.triage`) | `suppressions`, with `justification` |
436
+ | a gap: a need that is missing and listed (§13), or a changes note that is missing (§4) | a `result` of the rule `need-gap`, or `changes-note-gap`, at `level: note` |
345
437
  | new, unchanged or gone since a base run (`--baseline <file>`) | `baselineState` |
346
438
  | a replay mismatch: the screenshot, the trace, the HTTP exchange | `attachments`, `webRequest`, `webResponse` |
347
439
  | a mechanical fix, such as an anchor's new line | `fixes` |
@@ -374,7 +466,8 @@ Where a standard covers a part, delurio uses it rather than writing its own. Sur
374
466
  | OpenAPI 3.1 | an action with a route is an operation (§5); a server function is not | export and import: #13 |
375
467
  | RFC 9457, problem details | the body of a refusal (§5) | as it is |
376
468
  | SCXML (W3C, 2015) | what a flow means (§2) | a subset; export: #14 |
377
- | WAI-ARIA 1.2, Accessible Name and Description Computation 1.2 | roles and names in `ui.yaml` (§4) | as they are |
469
+ | WAI-ARIA 1.2, Accessible Name and Description Computation 1.2 | roles, names and checked states in `ui.yaml` (§4) | as they are |
470
+ | ARIA Authoring Practices Guide (W3C WAI) | where the focus goes when a dialog opens and closes (§4) | its dialog pattern, as it is |
378
471
  | WCAG 2.2 | the UI rules (#4), and their taxonomy in SARIF (§10) | as it is |
379
472
  | ICU MessageFormat; MessageFormat 2 | catalog messages (§4) | simple arguments today; MF2 when an app uses it |
380
473
  | BCP 47 | locale names (§4) | as it is |
@@ -389,4 +482,99 @@ Where a standard covers a part, delurio uses it rather than writing its own. Sur
389
482
  | SPDX | the licence identifiers of the packages | as it is |
390
483
  | Semantic Versioning | the versions of the CLI (#1) | as it is |
391
484
 
392
- delurio's own, because no standard covers them: one graph whose flows, screens, pages and API are checked against each other; the checker and the guarantees it proves; the expression language (§3); navigation graphs (§6); bindings and tutorials (§7); source anchors (§9); the revision diff in words.
485
+ delurio's own, because no standard covers them: one graph whose flows, screens, pages and API are checked against each other; the checker and the guarantees it proves; the expression language (§3); navigation graphs (§6); bindings and tutorials (§7); source anchors (§9); needs and gaps (§13); the revision diff in words.
486
+
487
+ ## 13. Needs and gaps
488
+
489
+ A flow draws what it does, and `world: open` (§2) leaves out the rest: what is not drawn is not ruled out. So nothing holds a product to what its users need: a feature that is missing is simply not drawn, and no check fails. A flow's needs are a closed list of what must exist for its users, each need with the evidence that it does, or with why it does not yet. The needs that are missing are the product's gaps, listed in one file. A product built in phases is so written whole, the phases to come included: its check passes while every gap is listed, and fails on a gap that is not, or on one that is met and still listed.
490
+
491
+ ### A flow's needs (`kind: needs`)
492
+
493
+ ```yaml
494
+ schema: delurio-graph/0
495
+ kind: needs
496
+ id: example.restoreNote
497
+ status: proposed
498
+ needs:
499
+ - id: restore-from-its-page
500
+ need: The owner of an archived note restores it from the note's own page, and it is active again.
501
+ evidence:
502
+ - state: restoring
503
+ - node: restore
504
+ - source: app/notes.js
505
+ name: restoreNote
506
+ - test: app/notes.test.js
507
+ name: restores an archived note
508
+ - scenario: owner
509
+ - id: only-its-owner
510
+ need: Only the note's owner reads and restores it; to anyone else it is no note at all.
511
+ evidence:
512
+ - source: app/notes.js:12
513
+ - setting: NOTES_SESSION_SECRET
514
+ in: .env.example
515
+ - id: says-when-it-is-erased
516
+ need: The page of an archived note says how long the note is kept before it is erased.
517
+ evidence:
518
+ - node: keptFor
519
+ missing: archived notes are not erased yet; the second phase erases them
520
+ ```
521
+
522
+ A flow's needs are in `needs.yaml`, in the flow's folder beside `flow.yaml`, and its `id` is the flow's. A need has:
523
+
524
+ | Key | Meaning |
525
+ |---|---|
526
+ | `id` | the need's id in its flow, kebab-case |
527
+ | `need` | what must exist, in a sentence of the graph's language, from the users' side: what they can do, or what they are told |
528
+ | `evidence` | what shows that it exists (below) |
529
+ | `missing` | that it does not exist yet, and why or where that is tracked: words, an issue, a finding's id |
530
+ | `note` | the author's own words, which no tool reads |
531
+
532
+ A need without `missing` is met, and its evidence names at least one thing outside the graph: a `source`, a `test`, a `scenario` or a `setting`. What the graph draws (`state`, `node`) says where the need is drawn, and alone shows nothing built. A need with `missing` is a gap. It may name evidence too: where it is drawn, and what exists of it so far. Needs are written from what the flow's users need, never from what the product does today, so a need the product does not meet yet is written all the same, with `missing`. A list is therefore `proposed` or `approved`, never `captured` (§1).
533
+
534
+ | Evidence | What it says | It resolves when |
535
+ |---|---|---|
536
+ | `source: <path>:<line>`, `source: <path>` | the code that makes the need true, an anchor as in §9 | the file exists and has that line; with `name`, the file holds the name |
537
+ | `test: <path>` | a test of the need | the file exists; with `name`, the file holds the test's name as it is written: in quotes, or a test function's name |
538
+ | `scenario: <scenario>` | a scenario of a binding (§7) that walks the need on the app | the binding exists, binds this flow, and has that scenario, its `extends` included; without `binding`, the binding is the flow's own `binding.yaml` |
539
+ | `state: <state>` | a state of the flow the need is drawn as | the flow has that state |
540
+ | `node: <node>` | a node of the flow's screens the need is drawn as | the flow's `ui.yaml` has that node |
541
+ | `setting: <NAME>` | an environment variable a deployment sets for the need | a line of the file `in` names sets it and is not commented out: `NAME=` or `export NAME=`, as a dotenv file has it, or `NAME:` or `- NAME=`, as the `environment` of a Compose file has it |
542
+
543
+ A `source` or a `test` may say what its file holds (`name`), and a `scenario` which binding it is in (`binding: <path>`); a `setting` names the file that sets it (`in: <path>`). A file holds a name when the name is in it and is not part of a longer word. Every path is relative to the application's repository root, as a `source:` anchor's is (§9): the folder `check --app` names, or else the folder `check` runs in, as a CI runs it at the root of the repository it checked out. A piece of evidence is of one kind; a need names as many as it has.
544
+
545
+ Evidence shows that something exists, not that it is right or that it passes. A test is run, and a scenario replayed, by the CI that runs them. Whoever writes and approves the list names only a test or a scenario that walks the need as its users meet it.
546
+
547
+ ### A product's gaps (`kind: gaps`)
548
+
549
+ ```yaml
550
+ schema: delurio-graph/0
551
+ kind: gaps
552
+ id: example.notes
553
+ gaps:
554
+ example.restoreNote: [says-when-it-is-erased]
555
+ ```
556
+
557
+ `needs.gaps.yaml` lists every need of a product's flows that says `missing`: under each flow's id, the ids of its needs. Its `id` is the product's. It sits at the root of the product's graphs, `graphs/needs.gaps.yaml`, and covers the flows under its folder: a flow's gaps are listed in the nearest `needs.gaps.yaml` in its folder or above it, up to the root of its repository (the first folder that holds `.git`).
558
+
559
+ ### What the tools do with them
560
+
561
+ `check` reads every `needs.yaml` and `needs.gaps.yaml` under the folders it is given, validates each against its schema (`schema`), and holds them to each other and to what they name:
562
+
563
+ - `evidence-unresolved`, at a piece of evidence that does not resolve: a file that is not there, a line past the file's end, a name the file does not hold, a binding that is not there or binds another flow, a scenario it does not have, a state or a node the flow does not have, a setting no line of its file sets. So evidence that goes away takes its need with it.
564
+ - `need-no-evidence`, at a need that is not missing and whose evidence names only what the graph draws.
565
+ - `need-unlisted`, at a need that is missing and that its gaps file does not list, or that has no gaps file above it.
566
+ - `gap-met`, at an entry of a gaps file whose need is met now; `gap-unknown`, at an entry that names a flow or a need that no `needs.yaml` under the file's folder has.
567
+ - `need-twice`, at a need whose id is given earlier in its file; `needs-place`, at a `needs.yaml` that is beside no flow, or whose `id` is not the id of the flow beside it.
568
+
569
+ Each is an error, and fails `--strict` (exit 2). A gap that is listed fails nothing: it is a finding of its own, `need-gap`, at the need's `missing`, with its words, at the level `note` in text and in SARIF. Once a flow has needs, the summary line counts the gaps among them:
570
+
571
+ ```
572
+ examples/notes/restore/needs.yaml:47:5: note: need says-when-it-is-erased is missing: archived notes are not erased yet; … [need-gap]
573
+ delurio check: 5 graphs, 0 errors, 0 warnings, 1 gap of 4 needs; exit 0
574
+ ```
575
+
576
+ So the gaps only shrink on their own. A need that is met leaves the list, or `gap-met` fails; a need cannot become a gap unless the list says so, or `need-unlisted` fails. Each new gap is therefore a line added to `needs.gaps.yaml`, which the review of that change reads. With `--baseline` (§10), a gap the base run did not have is `new` in SARIF, and the summary says how many are new: `2 gaps of 4 needs (1 new)`.
577
+
578
+ A tool that walks a flow on the app leaves out what only missing needs are drawn as, rather than failing on it: the states and the nodes that a need with `missing` names as its evidence, and that no met need names. A replay (§7) takes no step into such a state: a walk that would ends before it, and `--cover` keeps no path to it. It does not look for such a node, and it lists what it left out with the needs' ids. A tutorial (§7) whose steps show such a state or node is not made into a video until those needs are met. `check` replays a tutorial on the flow itself, where the planned parts are drawn, and holds it as before. `planned` in `@delurio/cli/needs` gives the planned states and nodes of a flow, each with the needs it waits on.
579
+
580
+ A graph with no `needs.yaml` is checked as before. Decided on 15 Nov 2026.
package/dist/changes.d.ts CHANGED
@@ -5,6 +5,7 @@ export interface DomainAction {
5
5
  result?: {
6
6
  returns?: string;
7
7
  };
8
+ sideEffects?: unknown[];
8
9
  }
9
10
  export interface Domain {
10
11
  id?: string;
@@ -17,7 +18,8 @@ export interface Domain {
17
18
  export interface ChangesCheck {
18
19
  writes: string[];
19
20
  key: string | null;
21
+ missing: string | null;
20
22
  problems: string[];
21
23
  }
22
- export declare function flowDomain(g: Graph): Domain | null;
23
- export declare function checkChanges(g: Graph): ChangesCheck | null;
24
+ export declare function flowDomain(g: Graph, seen?: Map<string, Domain | null>): Domain | null;
25
+ export declare function checkChanges(g: Graph, domainOf?: () => Domain | null): ChangesCheck | null;
package/dist/changes.js CHANGED
@@ -1,8 +1,10 @@
1
1
  // `changes:` in ui.yaml (SPEC.md §4): a flow whose steps write something tells its users, in its own note, what it
2
- // changes and what follows. An action writes when its route or its server function is not a GET, when a policy lets
2
+ // changes and what follows, or says why it has none yet (`missing`, a gap; decided on 16 Nov 2026, d-1116-11). An action writes when its route or its server function is not a GET, when a policy lets
3
3
  // someone `write` with it, or when it is a step inside the service (neither a route nor a server function) that returns
4
4
  // an entity; all three are read from the flow's domain, looked up by id among the graphs beside this one, all its files
5
- // read as one (SPEC.md §5). A flow with no screens, or whose domain is not found, is not checked.
5
+ // read as one (SPEC.md §5). A GET that a policy lists is held to what it does: it writes only when one of its
6
+ // `sideEffects` is more than an audit record of the call (`audit:<event>`), as a policy names reads and writes together
7
+ // (SPEC.md §4, decided on 16 Nov 2026, d-1116-12). A flow with no screens, or whose domain is not found, is not checked.
6
8
  import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
7
9
  import { basename, dirname, join } from 'node:path';
8
10
  import { inReadingOrder, isDomainText, mayBeDomain, mergeDomain } from './domain.js';
@@ -38,16 +40,32 @@ function domainUnder(root, id, depth = 4) {
38
40
  }
39
41
  return null;
40
42
  }
41
- // the domain the flow names, looked up by id among the graphs beside it; null when it names none or it is not found
42
- export function flowDomain(g) {
43
- return g.flow.domain === undefined ? null : domainUnder(rootOf(g.dir), g.flow.domain);
43
+ // the domain the flow names, looked up by id among the graphs beside it; null when it names none or it is not found.
44
+ // `seen` keeps what a run has found, so that the flows that name one domain look it up once
45
+ export function flowDomain(g, seen) {
46
+ if (g.flow.domain === undefined)
47
+ return null;
48
+ const root = rootOf(g.dir);
49
+ const key = `${root}\0${g.flow.domain}`;
50
+ if (seen?.has(key) === true)
51
+ return structuredClone(seen.get(key));
52
+ const found = domainUnder(root, g.flow.domain);
53
+ seen?.set(key, found);
54
+ return seen === undefined ? found : structuredClone(found);
44
55
  }
45
56
  // the HTTP method of an action's route or server function; undefined for a step inside the service
46
57
  const methodOf = (a) => (a?.route ?? a?.serverFn)?.trim().split(/\s+/)[0]?.toUpperCase();
47
- export function checkChanges(g) {
58
+ // a side effect that records the call and changes nothing the flow's users are told of: `audit:<event>` (SPEC.md §5)
59
+ const isAudit = (s) => typeof s === 'string' && s.trimStart().startsWith('audit:');
60
+ // a GET that a writing policy lists writes only when it does more than record that it was called: a policy names its
61
+ // actor's reads and writes together, and a GET reads (SPEC.md §4)
62
+ const writesThroughPolicy = (a) => methodOf(a) !== 'GET' || (Array.isArray(a?.sideEffects) && a.sideEffects.some((s) => !isAudit(s)));
63
+ // `domainOf` finds the flow's domain, called at most once: a caller that reads the domain for another rule as well
64
+ // hands over the one it found
65
+ export function checkChanges(g, domainOf = () => flowDomain(g)) {
48
66
  if (g.ui.absent === true)
49
67
  return null;
50
- const domain = flowDomain(g);
68
+ const domain = domainOf();
51
69
  if (domain === null)
52
70
  return null;
53
71
  const writing = new Set();
@@ -59,12 +77,16 @@ export function checkChanges(g) {
59
77
  for (const p of domain.policies ?? [])
60
78
  if ((p.write ?? []).length > 0)
61
79
  for (const name of p.do ?? [])
62
- writing.add(name);
80
+ if (writesThroughPolicy(domain.actions?.[name]))
81
+ writing.add(name);
63
82
  const invoked = Object.values(g.flow.states).map((s) => s.invoke?.action);
64
83
  const writes = [...new Set(invoked.filter((a) => a !== undefined && writing.has(a)))].sort();
65
84
  const key = g.ui.changes?.key ?? null;
85
+ const said = g.ui.changes?.missing;
86
+ // the note a writing flow says it has no message for yet; a flow that writes nothing is missing none
87
+ const missing = writes.length > 0 && key === null && typeof said === 'string' && said.trim() !== '' ? said.trim() : null;
66
88
  const problems = [];
67
- if (writes.length > 0 && key === null)
89
+ if (writes.length > 0 && key === null && missing === null)
68
90
  problems.push(`its steps write (${writes.join(', ')}), but ui.yaml has no changes note (SPEC.md §4)`);
69
91
  if (key !== null) {
70
92
  for (const locale of g.ui.locales ?? [basename(g.ui.catalog, '.json')]) {
@@ -75,5 +97,5 @@ export function checkChanges(g) {
75
97
  problems.push(`the changes note ${key} is not in the ${locale} catalog`);
76
98
  }
77
99
  }
78
- return { writes, key, problems };
100
+ return { writes, key, missing, problems };
79
101
  }
package/dist/check.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const CHECK_USAGE: string;
2
- type Level = 'error' | 'warning';
2
+ type Level = 'error' | 'warning' | 'note';
3
3
  interface Place {
4
4
  file: string;
5
5
  line: number;