@delurio/cli 0.9.0 → 0.10.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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  While the version is 0.x, a release that can judge the same graphs differently (a new check, a stricter schema) bumps the minor; a fix that judges nothing differently bumps the patch.
4
4
 
5
+ ## 0.10.0 (2026-11-16)
6
+
7
+ - New warning of `check`, which fails nothing: `role-missing`, a node of type `field` or `action` that gives no `role` (SPEC.md §4). A screen reader, a replay and `kit check` find a control by its WAI-ARIA role; before, `kit check` expected such a node's type (`field`, `action`) as its role, which no drawn element can have, so every such node was a mismatch. `@delurio/cli/wireframe`'s `Expectation` says so with `roleGiven`, so a kit check holds that node's name and state only.
8
+ - A kit's CSS may say `scroll-behavior` and `overscroll-behavior`. The check of script-like CSS took any `behavior:` for old Internet Explorer's script binding, so a kit made from a product's own CSS was refused for scrolling smoothly. `behavior:` itself is still refused.
9
+ - New rule of `check`, which fails `--strict` (SPEC.md §9): `source-unresolved`, a `source:` anchor whose file is not there, is a folder, or whose line is 0 or past the file's end, at the anchor. Every anchor is held, in a flow, its screens, a navigation graph and a domain: each `source` that the file's schema gives as an anchor (`sourceAnchor`), so a key `source` that means something else (a nav graph's own `source`, a sample value or a parameter of `ui.yaml`, a field of a record) is none. The path is read from the application's repository root, `--app` or the folder `check` runs in, as a need's evidence is; an anchor of a navigation graph too, and where the path is there under its `source.app` the finding says so. Before, only a need's evidence was resolved: of Medaris's 18,843 anchors, the 125 of its navigation pages written from the app folder (`app/page.tsx`) passed, and so did 34 of QAuth's 556 that are past their file's end. A project whose graphs give such anchors can record them with `--baseline`: they are then printed as warnings until they are fixed, and a new one fails.
10
+ - New rule of `check`, a warning, which fails nothing (SPEC.md §9): `citation-unresolved`, a `path:line` in a graph's words (a `description`, a `say`, a `note`, a `rule`, a need's `missing`) whose file is not there or whose line, or a range's last line, is past its end. Only a token that reads as a path from the repository's root is looked at: a folder of the root first, a file with an extension last. Sample values, an entity's records and a need's evidence are not words.
11
+ - A need's `source` evidence is resolved as an anchor is: a folder is now said to be a folder, and a line 0 does not resolve.
12
+ - `check --no-app` checks a project's graphs without its code (SPEC.md §10), as the panel checks a graphs folder alone: the anchors, the citations in words, and a need's `source`, `test`, `setting` and a `scenario` whose binding is named by its path are not looked for, and the output says once how many were not, on a line before the summary (`delurio check: note: --no-app: …`) and as a notification of the run at the level `note` in SARIF (`invocations[0].toolExecutionNotifications`). A need's `state` and `node`, a scenario of the flow's own `binding.yaml` and every other rule are checked as before. `--app` and `--no-app` together are refused (exit 1). Before, such a check gave an `evidence-unresolved` error for every path.
13
+ - SPEC.md §13: a missing need's `state` and `node` name only what is not built yet, as a replay leaves out every state and node that only missing needs name; a gap that is about something built names it in its `need` or `note`. New rule of `check`, a warning: `need-names-built`, at a missing need's `state` that names a state of a captured flow that names its code. Medaris's captured graphs had named 110 built states so, before they were moved to notes. A state of a captured flow that only missing needs name is not built, and `source-missing` no longer asks it for a `source` (SPEC.md §9).
14
+ - An entity may carry `note` (SPEC.md §5), as an action, a refusal and an invariant do. Before, the `schema` rule refused it.
15
+ - Decided on 16 Nov 2026 (SPEC.md §5): an entity or an action written before its code says `planned: <why>`, which a captured domain, whose `status` is given once, could not say of its parts. New rule of `check`, which fails `--strict`: `planned-built`, at the `planned` of an entity or an action that also names its code, with a note where its `source` is. Graphs without `planned` are judged as before.
16
+ - SPEC.md §1: a tool that reads or writes graph files with a YAML 1.1 library, such as PyYAML, reads `on`, `off`, `yes` and `no` as booleans, where the CLI reads YAML 1.2 strings: quote such a name, or read YAML 1.2.
17
+ - The toolchain is current: Node 26 (`engines.node` `>=26`, CI and the release on Node 26, the image on `node:26.13.1-alpine3.24` pinned by its digest), `@types/node` 26.6.6, elkjs 0.12.1, npm 12.2.2 for the staged release, docker/login-action 4.8.0 and sigstore/cosign-installer 4.1.3, each pinned by its commit. TypeScript 7.0.2, ajv 8.20.0, ajv-formats 3.0.1 and yaml 2.9.1 are already the newest stable releases more than 7 days old. The examples give the same findings, SARIF and pages as on Node 22 with elkjs 0.12.0. A project that runs the CLI on Node 22 or 24 is warned by npm that it wants 26.
18
+ - The examples give the same findings as before: none.
19
+
5
20
  ## 0.9.0 (2026-11-16)
6
21
 
7
22
  - `check` parses each file once however many graphs read it. Before, it parsed a flow's domain again for every flow that names it, and every flow again for every flow that starts another: on delurio's own 41 flows it took 12.7 s, of which more than half was parsing the same files again; it now takes 5.8 s. It judges nothing differently: the same graphs give the same findings, in text and in SARIF, as 0.8.0 gives.
package/README.md CHANGED
@@ -25,7 +25,7 @@ or the container image, pinned by its digest:
25
25
  docker run --rm -v "$PWD:/work" -w /work ghcr.io/delurio-labs/delurio@sha256:<digest> check graphs --strict
26
26
  ```
27
27
 
28
- Node 22.18 or later.
28
+ Node 26 or later.
29
29
 
30
30
  ## Check every graph
31
31
 
@@ -50,7 +50,7 @@ Several folders may be given (`check graphs examples`); a graph under two of the
50
50
  |---|---|
51
51
  | 0 | every graph loads, and under `--strict` nothing is wrong |
52
52
  | 1 | a graph cannot be loaded, or is written for a newer format than this version reads |
53
- | 2 | under `--strict`: a guarantee is broken, a state cannot be reached or has no way out, a catalog key is missing from a locale or a sample is missing, the main story cannot be walked, a tutorial no longer matches its flow, a writing flow has no changes note, a domain names an entity or a field it does not have, a flow invokes an action or lists a failure code its domain does not have, a policy names one, a need's evidence is not there or a product's gaps and its needs disagree… |
53
+ | 2 | under `--strict`: a guarantee is broken, a state cannot be reached or has no way out, a catalog key is missing from a locale or a sample is missing, the main story cannot be walked, a tutorial no longer matches its flow, a writing flow has no changes note, a domain names an entity or a field it does not have, a flow invokes an action or lists a failure code its domain does not have, a policy names one, a `source:` anchor names a file or a line that is not there, a need's evidence is not there or a product's gaps and its needs disagree… |
54
54
 
55
55
  ## What a product must have: needs and gaps
56
56
 
@@ -61,7 +61,7 @@ examples/notes/restore/needs.yaml:47:5: note: need says-when-it-is-erased is mis
61
61
  delurio check: 5 graphs, 0 errors, 0 warnings, 1 gap of 4 needs; exit 0
62
62
  ```
63
63
 
64
- `check --strict` fails where evidence names what is not there (a file, a line, a name, a scenario, a state, a node), where a missing need is not in the gaps, and where the gaps list a need that is met or that no flow has. A gap that is listed fails nothing: it is counted, and given as a note. So a product built in phases is written whole, the planned parts included, while its CI stays green, and the gaps only shrink: a need that is met must leave the list, and a new gap is a line added to it, which a review reads. Evidence paths are relative to the repository root, the folder `check` runs in; `--app <dir>` names another.
64
+ `check --strict` fails where evidence names what is not there (a file, a line, a name, a scenario, a state, a node), where a missing need is not in the gaps, and where the gaps list a need that is met or that no flow has. A gap that is listed fails nothing: it is counted, and given as a note. So a product built in phases is written whole, the planned parts included, while its CI stays green, and the gaps only shrink: a need that is met must leave the list, and a new gap is a line added to it, which a review reads. Evidence paths, and every `source:` anchor, are relative to the repository root, the folder `check` runs in; `--app <dir>` names another, and `--no-app` checks the graphs without the code: what they name of it is not looked for, and the output says how much that was.
65
65
 
66
66
  ## A graph's page
67
67
 
package/SPEC.md CHANGED
@@ -32,7 +32,7 @@ id: learning.enrollment
32
32
 
33
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.
34
34
 
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.
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. A tool that writes or reads graph files with a YAML 1.1 library, such as PyYAML, reads a bare `on`, `off`, `yes` or `no` (in any case: `On`, `NO`) as `true` or `false`, where YAML 1.2 reads a string: a state or a value so named is quoted (`"off"`), or the tool uses a YAML 1.2 reader such as ruamel.yaml.
36
36
 
37
37
  A flow with no screen (an HTTP endpoint, a webhook, an MCP tool, a CI job) has no `ui.yaml`: it loads and is checked without one, and its page draws no screens. What such a step answers the outside world is written on its state as `response` (§2).
38
38
 
@@ -41,7 +41,7 @@ A flow with no screen (an HTTP endpoint, a webhook, an MCP tool, a CI job) has n
41
41
  | Key | Meaning |
42
42
  |---|---|
43
43
  | `title`, `summary` | the graph in plain words, for people |
44
- | `status` | `proposed`: written before or apart from the code, nobody has approved it. `captured`: read from existing code (capture mode, every element carries `source:`, §9). `approved`: the owner reviewed and accepted it |
44
+ | `status` | `proposed`: written before or apart from the code, nobody has approved it. `captured`: read from existing code (capture mode, every element carries `source:`, §9). `approved`: the owner reviewed and accepted it. A graph gives it once, a domain in one of its files; an entity or an action written before its code, inside a captured domain, says `planned` (§5), and a planned state of a captured flow is a missing need's (§13) |
45
45
  | `source` | on any element: `<repo-relative path>:<line>` or a bare `<path>`, the code that makes the element true. See §9 |
46
46
 
47
47
  ### Text
@@ -193,7 +193,7 @@ An app may have no such message yet, and a captured graph describes the app as i
193
193
 
194
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).
195
195
 
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.
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. A node of type `field` or `action` with no `role` is a warning of `check` (`role-missing`): a screen reader, a replay and `kit check` find a control by its role, and `kit check` holds such a node's name and state but cannot hold its role.
197
197
 
198
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
199
 
@@ -275,7 +275,7 @@ invariants:
275
275
 
276
276
  A capture may carry more words of its own on a field (`owner`, `note`, `editableBy`, `matching`, `opaque`). They are kept and compared, and no tool reads them.
277
277
 
278
- An action, a refusal and an invariant may carry `note`: the author's own words, which no tool reads. An invariant the code does not keep is still written, with `holds: false` and the `finding` that reports it: the finding's id in the graph's report, such as `MS-7`. A capture describes the code, so the invariant says what should hold and the finding says where it does not. Decided on 25 Oct 2026.
278
+ An entity, an action, a refusal and an invariant may carry `note`: the author's own words, which no tool reads. An invariant the code does not keep is still written, with `holds: false` and the `finding` that reports it: the finding's id in the graph's report, such as `MS-7`. A capture describes the code, so the invariant says what should hold and the finding says where it does not. Decided on 25 Oct 2026.
279
279
 
280
280
  **The API.** An action with a `route` (`METHOD /path`) is one OpenAPI 3.1 operation: its name is the `operationId`, `needs` its security requirement, `query` (a JSON Schema object) its query parameters, `body` its request body, `result` its response (`returns` an entity, a `redirect`, a `status`, or a JSON Schema), and each refusal one more response. When a refusal has a body, it is RFC 9457 problem details with the refusal code as its `type`. So a domain can be written out as an OpenAPI document, and an app that already publishes one names it at the top (`openapi: <file>`) and each action's operation by `operationId`, instead of copying them. An action with `serverFn` is a server function (below), and an action with neither is a step inside the service. `needs`, `policies`, `sideEffects`, `refusals.<code>.redirect` and `invariants` are delurio's own: no standard says who may do what to which data, or what must always hold.
281
281
 
@@ -304,6 +304,17 @@ This form was decided on 22 Oct 2026. Graphs captured before it may still give f
304
304
 
305
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.
306
306
 
307
+ **Planned parts** (decided on 16 Nov 2026, d-1116-19). A domain gives its `status` once, so a captured domain, read from the code, cannot say `proposed` of the part that is written before its code: an action that no route answers yet, an entity that no table holds. Such an entity or action says `planned`, with why or where that is tracked, as a missing need says `missing` (§13):
308
+
309
+ ```yaml
310
+ actions:
311
+ registerInPerson:
312
+ route: POST /lessons/{id}/in-person/registration
313
+ planned: the second phase builds it (#12)
314
+ ```
315
+
316
+ `planned` is on the entity or the action itself, wherever it is given in a split domain, so it says what is not built however the files are cut, and it goes when the part is built, where its `source:` comes. A planned entity or action names no code: one that gives both is an error of `check` at its `planned` (`planned-built`), with a note where its `source` is, so the mark cannot outlive the code. What a planned action holds (its refusals, its fields) is planned with it; a refusal of it that shared code already answers may still name that code. Any domain may give `planned`; in a domain that is `proposed` as a whole it says nothing more. A field, a refusal or a policy cannot say it.
317
+
307
318
  `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
319
 
309
320
  **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`).
@@ -397,9 +408,13 @@ A kit says how the components of `ui.yaml` look in one product: `tokens` and `da
397
408
 
398
409
  ## 9. Source anchors
399
410
 
400
- `source: <path>:<line>` on a state, a transition, a guard, a node, an entity or an action names the code that makes it true, relative to the application's repository root. A bare `<path>` anchors a whole file. In capture mode every element carries one; in create mode an element carries one when the code already exists. `check` reports a state of a captured flow that names no code (`source-missing`). An exit may leave it out: the transition into it names the code, and an exit such as the person leaving the page has no code of its own.
411
+ `source: <path>:<line>` on a state, a transition, a guard, a node, an entity or an action names the code that makes it true, relative to the application's repository root. A bare `<path>` anchors a whole file. In capture mode every element carries one; in create mode an element carries one when the code already exists. `check` reports a state of a captured flow that names no code (`source-missing`). An exit may leave it out: the transition into it names the code, and an exit such as the person leaving the page has no code of its own. So may a state that only missing needs name (§13), which is drawn before it is built.
412
+
413
+ **Every anchor resolves.** `check` holds every anchor to the code, wherever it is written: the file it names exists and is a file, and its line, when it names one, is within the file, from 1 to the file's last line. One that does not is an error (`source-unresolved`), at the anchor: a file that is not there, a folder, or a line past the file's end, as a writer's line number that was off gives. The path is read from the application's repository root, as a need's evidence is (§13): 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. An anchor of a navigation graph is read from that root too, whatever its `source.app` says; where the path is there under `source.app`, the finding says so. An anchor is a `source` that a graph file's schema gives as one (`sourceAnchor` in `schemas/`), in a flow, its screens, a navigation graph or a domain: a key `source` that means something else, such as a navigation graph's own `source`, a sample value or a field of a record, is none. A need's evidence is held by its own rule (`evidence-unresolved`, §13).
401
414
 
402
- `anchors.lock.yaml`, generated beside the graph, records what each anchor pointed at (the line, its neighbours' hashes, the commit). The check finds every line again and says whether it is unchanged, moved, changed, gone or ambiguous. A `file:line` in a description or a comment is not an anchor.
415
+ `anchors.lock.yaml`, generated beside the graph, records what each anchor pointed at (the line, its neighbours' hashes, the commit). The check finds every line again and says whether it is unchanged, moved, changed, gone or ambiguous.
416
+
417
+ **Citations in words.** A `path:line` in a graph's words (a `description`, a `say`, a `note`, a `rule`, a need's `missing`) is not an anchor: no tool keeps it in step with the code, and `anchors.lock.yaml` does not record it. It still cites the code, so `check` holds it to the code as a warning (`citation-unresolved`), which fails nothing: a file that is not there, or a line past its end. Words are not parsed, so only a token that reads as a path from the repository's root is looked at: a folder that the root has, any folders below it, a file with an extension, then `:` and the line, or a range `:<first>-<last>`, whose last line is held. `app/page.tsx:12`, which names no folder of the root, is not looked at, nor is an address or a comment. A sample value, a record of an entity and a need's evidence are not words.
403
418
 
404
419
  ## 10. Checks and findings
405
420
 
@@ -407,7 +422,15 @@ A kit says how the components of `ui.yaml` look in one product: `tokens` and `da
407
422
  |---|---|
408
423
  | 0 | the graph loads and, under `--strict`, nothing is wrong |
409
424
  | 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) |
425
+ | 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, or a planned entity or action names its code (§5), a tutorial no longer matches its flow (§7), a state of a captured flow names no code or an anchor does not resolve (§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) |
426
+
427
+ **Where the code is.** What a graph names of the application is read from the application's repository root: the folder `check --app <dir>` names, or else the folder `check` runs in, as a CI runs it at the root of the repository it checked out. That is every `source:` anchor and every citation in words (§9), and a need's `source`, `test` and `setting`, and a `scenario` whose binding is named by its path (§13). A check that has a project's graphs without its code, such as the panel's check of a graphs folder alone, says `--no-app`: none of these is looked for, and rather than a finding for each, the output says once how many were not, on a line before the summary in text and as a notification of the run (`toolExecutionNotifications`, at the level `note`) in SARIF, as `check examples --no-app` gives it:
428
+
429
+ ```
430
+ delurio check: note: --no-app: 0 source anchors, 0 citations in words and 7 pieces of evidence name files of the application, which are not here, and were not looked for (SPEC.md §10)
431
+ ```
432
+
433
+ Everything else is checked as before, the graph's own evidence included: a need's `state` and `node`, and a scenario of the flow's own `binding.yaml`. `--app` and `--no-app` are not given together.
411
434
 
412
435
  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.
413
436
 
@@ -439,7 +462,7 @@ graphs/product/flow.yaml:88:7: note: step 2: CODE_CHANGED from developing, with
439
462
  | a mechanical fix, such as an anchor's new line | `fixes` |
440
463
  | the finding's page in the panel; the issue it was sent to | `hostedViewerUri`; `workItemUris` |
441
464
  | the files read, with their hashes; the repository and the commit | `artifacts`; `versionControlProvenance` |
442
- | the exit code; a file that cannot be loaded | `invocations` with `exitCode`; a result of the rule `load` and a `toolExecutionNotification` |
465
+ | the exit code; a file that cannot be loaded; what `--no-app` did not look for | `invocations` with `exitCode`; a result of the rule `load` and a `toolExecutionNotification`; a `toolExecutionNotification` at `note` |
443
466
  | which graph and which check, so that uploads stay apart | `automationDetails.id` |
444
467
  | the messages in Turkish (`--locale tr`) | `run.language` and a `translations` component |
445
468
 
@@ -529,7 +552,9 @@ A flow's needs are in `needs.yaml`, in the flow's folder beside `flow.yaml`, and
529
552
  | `missing` | that it does not exist yet, and why or where that is tracked: words, an issue, a finding's id |
530
553
  | `note` | the author's own words, which no tool reads |
531
554
 
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).
555
+ 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.
556
+
557
+ A missing need's `state` and `node` name only what is not built yet: the states and the nodes that will be drawn for it, such as the page that is planned. A tool that walks the flow on the app leaves out every state and node that only missing needs name (below), so a built one named there would not be walked. A gap that is about something built, such as an error page that has no `<main>` yet, names it in its `need` or its `note` (`note: the error page, errorPage, has no main landmark`), not as its evidence. A state of a captured flow that names its code (`source:`, §9) is built, and `check` warns at a missing need's `state` that names one (`need-names-built`). A state of a captured flow that only missing needs name is not built: it names no code, and `source-missing` (§9) does not ask it for one (decided on 16 Nov 2026, d-1116-20). 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
558
 
534
559
  | Evidence | What it says | It resolves when |
535
560
  |---|---|---|
@@ -540,7 +565,7 @@ A need without `missing` is met, and its evidence names at least one thing outsi
540
565
  | `node: <node>` | a node of the flow's screens the need is drawn as | the flow's `ui.yaml` has that node |
541
566
  | `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
567
 
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.
568
+ 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. Under `--no-app` (§10) the evidence that names a file by its path, a `source`, a `test`, a `setting` and a `scenario` with `binding`, is not looked for. A piece of evidence is of one kind; a need names as many as it has.
544
569
 
545
570
  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
571
 
@@ -562,11 +587,12 @@ gaps:
562
587
 
563
588
  - `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
589
  - `need-no-evidence`, at a need that is not missing and whose evidence names only what the graph draws.
590
+ - `need-names-built`, a warning, at a missing need's `state` that names a state of a captured flow that names its code (`source:`), so is built.
565
591
  - `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
592
  - `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
593
  - `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
594
 
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:
595
+ Each but `need-names-built`, a warning, 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
596
 
571
597
  ```
572
598
  examples/notes/restore/needs.yaml:47:5: note: need says-when-it-is-erased is missing: archived notes are not erased yet; … [need-gap]
@@ -0,0 +1,29 @@
1
+ export type AnchorRule = 'source-unresolved' | 'citation-unresolved';
2
+ export interface AnchorProblem {
3
+ rule: AnchorRule;
4
+ file: string;
5
+ line: number;
6
+ column: number;
7
+ message: string;
8
+ graph: string;
9
+ element: string;
10
+ }
11
+ export interface AnchorsCheck {
12
+ problems: AnchorProblem[];
13
+ anchors: number;
14
+ citations: number;
15
+ }
16
+ export declare class AppFiles {
17
+ private readonly kinds;
18
+ private readonly lines;
19
+ readonly root: string;
20
+ constructor(root: string);
21
+ abs(path: string): string;
22
+ kind(path: string): 'file' | 'folder' | null;
23
+ lineCount(path: string): number;
24
+ unresolved(value: string): {
25
+ subject: string;
26
+ reason: string;
27
+ } | null;
28
+ }
29
+ export declare function checkAnchors(files: string[], app: string | null): AnchorsCheck;
@@ -0,0 +1,160 @@
1
+ // Source anchors held to the code they name (SPEC.md §9). Every `source:` that a graph file's schema gives as an anchor
2
+ // names a file of the application's repository, from its root, and, with a line, a line within that file: one that
3
+ // does not is an error (`source-unresolved`), as a need's evidence is (SPEC.md §13). A `path:line` written in a graph's
4
+ // words (a description, a `say`, a note) is no anchor, but it cites the code all the same, so it is held to the code
5
+ // too, as a warning (`citation-unresolved`): words are not parsed, so only a token that reads as a path from the
6
+ // repository's root, a folder of the root first and a file with an extension last, is looked at. Under --no-app neither
7
+ // is looked for, and only counted.
8
+ import { existsSync, readFileSync, statSync } from 'node:fs';
9
+ import { basename, dirname, isAbsolute, join } from 'node:path';
10
+ import { anchorsIn, schemaKindOf } from './schemas.js';
11
+ import { keyAt, readYaml } from './yaml.js';
12
+ const FORMAT = 'delurio-graph/0';
13
+ // the kinds whose files carry anchors; a need's evidence is held by its own rule, and a catalog holds the product's
14
+ // words, which cite nothing
15
+ const ANCHORED = new Set(['flow', 'ui', 'nav', 'domain']);
16
+ const WORDED = new Set(['flow', 'ui', 'nav', 'domain', 'needs']);
17
+ // what is data rather than words: sample values of the screens, records of an entity, the anchors themselves and a nav
18
+ // graph's source; and in a needs file a need's evidence, which its own rule holds (a nav page's evidence is words)
19
+ const NOT_WORDS = new Set(['samples', 'examples', 'source']);
20
+ const NOT_NEEDS_WORDS = new Set([...NOT_WORDS, 'evidence']);
21
+ const lineCount = (body) => body.split('\n').length - (body.endsWith('\n') ? 1 : 0);
22
+ const pointer = (path) => path.map((s) => `/${s.replace(/~/g, '~0').replace(/\//g, '~1')}`).join('');
23
+ // the files of the application, each looked up once per run: whether it is there and is a file, and its lines
24
+ export class AppFiles {
25
+ kinds = new Map();
26
+ lines = new Map();
27
+ root;
28
+ constructor(root) {
29
+ this.root = root;
30
+ }
31
+ abs(path) {
32
+ return isAbsolute(path) ? path : join(this.root, path);
33
+ }
34
+ kind(path) {
35
+ const abs = this.abs(path);
36
+ if (!this.kinds.has(abs))
37
+ this.kinds.set(abs, existsSync(abs) ? (statSync(abs).isFile() ? 'file' : 'folder') : null);
38
+ return this.kinds.get(abs) ?? null;
39
+ }
40
+ lineCount(path) {
41
+ const abs = this.abs(path);
42
+ if (!this.lines.has(abs))
43
+ this.lines.set(abs, lineCount(readFileSync(abs, 'utf8')));
44
+ return this.lines.get(abs) ?? 0;
45
+ }
46
+ // why `<path>[:<line>]` names nothing under the root, or null when it names a file and a line within it: what is
47
+ // wrong (the path, or the path and its line) and what is wrong with it
48
+ unresolved(value) {
49
+ const m = /^(.*?)(?::(\d+))?$/.exec(value);
50
+ const kind = this.kind(m[1]);
51
+ if (kind === null)
52
+ return { subject: m[1], reason: 'does not exist' };
53
+ if (kind === 'folder')
54
+ return { subject: m[1], reason: 'is a folder: an anchor names a file' };
55
+ if (m[2] === undefined)
56
+ return null;
57
+ const line = Number(m[2]);
58
+ const n = this.lineCount(m[1]);
59
+ if (line < 1)
60
+ return { subject: value, reason: `names line ${line}: a file's lines count from 1` };
61
+ return line > n ? { subject: value, reason: `is past the file's end: it has ${n} ${n === 1 ? 'line' : 'lines'}` } : null;
62
+ }
63
+ }
64
+ // a token of words that reads as `<path>:<line>`: a folder, then a file with an extension, then the line, and a range's
65
+ // last line after a dash; not inside an address, a longer path or a word
66
+ const CITATION = /(?<![\p{L}\p{N}_.\/:@~+\-])((?:[\p{L}\p{N}_@.][\p{L}\p{N}_@.()[\]+\-]*\/)+[\p{L}\p{N}_@()[\]+\-.]*?\.[A-Za-z][A-Za-z0-9]*):(\d+)(?:-(\d+))?(?!\d)/gu;
67
+ // the folder given as source.app by a nav graph, or by the nav.yaml beside a generated one, to say where an anchor
68
+ // would have been had it been written from there
69
+ function navApp(file, doc) {
70
+ const own = doc.source?.app;
71
+ if (typeof own === 'string')
72
+ return own;
73
+ const beside = join(dirname(file), 'nav.yaml');
74
+ if (basename(file) === 'nav.yaml' || !existsSync(beside))
75
+ return null;
76
+ try {
77
+ const app = (readYaml(readFileSync(beside, 'utf8'))?.source)?.app;
78
+ return typeof app === 'string' ? app : null;
79
+ }
80
+ catch {
81
+ return null;
82
+ }
83
+ }
84
+ // every anchor and every citation in words of the graph files given, against the application's files under `app`;
85
+ // with `app` null (--no-app), each is counted and none is looked for
86
+ export function checkAnchors(files, app) {
87
+ const out = { problems: [], anchors: 0, citations: 0 };
88
+ const code = app === null ? null : new AppFiles(app);
89
+ for (const file of files) {
90
+ const kind = schemaKindOf(file);
91
+ if (kind === null || !WORDED.has(kind))
92
+ continue;
93
+ let text;
94
+ let doc;
95
+ try {
96
+ text = readFileSync(file, 'utf8');
97
+ doc = readYaml(text);
98
+ }
99
+ catch {
100
+ continue; // the schema rule, or the graph's load, says why
101
+ }
102
+ if (doc === null || typeof doc !== 'object' || Array.isArray(doc))
103
+ continue;
104
+ const own = doc;
105
+ if (typeof own.schema === 'string' && own.schema !== FORMAT)
106
+ continue;
107
+ const graph = typeof own.id === 'string' ? own.id : basename(dirname(file));
108
+ const name = basename(file);
109
+ const problem = (rule, path, message, element) => {
110
+ out.problems.push({ rule, file, ...keyAt(text, path), message, graph, element });
111
+ };
112
+ if (ANCHORED.has(kind)) {
113
+ const navFrom = kind === 'nav' ? navApp(file, own) : null;
114
+ for (const { path, value } of anchorsIn(kind, doc)) {
115
+ if (!/^[^\s:]+(:[0-9]+)?$/.test(value))
116
+ continue; // the schema rule says why
117
+ out.anchors++;
118
+ const why = code?.unresolved(value) ?? null;
119
+ if (why === null)
120
+ continue;
121
+ const where = path.slice(0, -1).join('.') || 'the graph';
122
+ const from = navFrom === null || code === null ? null : join(navFrom, value);
123
+ const there = from !== null && code?.unresolved(from) === null ? `; ${from} is there: an anchor is written from the repository's root, not from source.app` : '';
124
+ problem('source-unresolved', path, `${where}: source ${why.subject} ${why.reason}${there} (SPEC.md §9)`, `${name}#${pointer(path)}`);
125
+ }
126
+ }
127
+ const skip = kind === 'needs' ? NOT_NEEDS_WORDS : NOT_WORDS;
128
+ const words = (value, path) => {
129
+ if (typeof value === 'string') {
130
+ for (const m of value.matchAll(CITATION)) {
131
+ const first = m[1].split('/')[0];
132
+ if (first === '.' || first === '..')
133
+ continue;
134
+ if (code !== null && code.kind(first) !== 'folder')
135
+ continue; // not a path from the repository's root
136
+ out.citations++;
137
+ if (code === null)
138
+ continue;
139
+ const line = Math.max(Number(m[2]), Number(m[3] ?? 0));
140
+ const why = code.unresolved(`${m[1]}:${line}`);
141
+ if (why === null)
142
+ continue;
143
+ const cited = m[0];
144
+ const said = why.subject === m[1] ? `and ${why.subject} ${why.reason}` : `which ${why.reason}`;
145
+ problem('citation-unresolved', path, `${path.join('.')} cites ${cited}, ${said} (SPEC.md §9)`, `${name}#${pointer(path)}/${cited}`);
146
+ }
147
+ return;
148
+ }
149
+ if (Array.isArray(value))
150
+ value.forEach((x, i) => words(x, [...path, String(i)]));
151
+ else if (value !== null && typeof value === 'object') {
152
+ for (const [k, x] of Object.entries(value))
153
+ if (!skip.has(k))
154
+ words(x, [...path, k]);
155
+ }
156
+ };
157
+ words(doc, []);
158
+ }
159
+ return out;
160
+ }
package/dist/check.js CHANGED
@@ -20,12 +20,14 @@ import { checkGoals, findings, loadNav, viewOf } from './nav.js';
20
20
  import { schemaKindOf, validateFile } from './schemas.js';
21
21
  import { inReadingOrder, mergeDomain } from './domain.js';
22
22
  import { checkDomainNames } from './domain-names.js';
23
- import { checkNeeds } from './needs.js';
23
+ import { checkNeeds, planned, readNeeds } from './needs.js';
24
+ import { checkAnchors } from './anchors.js';
24
25
  export const CHECK_USAGE = [
25
- ' node src/cli.ts check <graphs folder>... [--strict] [--baseline <sarif>] [--format sarif --output <file>] [--app <dir>]',
26
+ ' node src/cli.ts check <graphs folder>... [--strict] [--baseline <sarif>] [--format sarif --output <file>] [--app <dir> | --no-app]',
26
27
  ' checks every graph under the folders and writes nothing else: GNU error lines on stdout, or SARIF 2.1.0;',
27
28
  ' exit 0 clean, 1 a graph cannot be loaded or needs a newer format, 2 an error under --strict (new since --baseline);',
28
- ' the evidence of needs is found under --app, the application\'s repository root (default: the working directory)',
29
+ ' the evidence of needs and the source: anchors are found under --app, the application\'s repository root',
30
+ ' (default: the working directory); --no-app checks the graphs without the code, and does not look for them',
29
31
  ].join('\n');
30
32
  const FORMAT = 'delurio-graph/0';
31
33
  const SKIP = new Set(['viz', 'video', 'recording', 'node_modules', '.git']);
@@ -51,13 +53,17 @@ const RULES = [
51
53
  { id: 'changes-note-gap', text: 'A writing flow says why it has no changes note yet: counted, and fails nothing (SPEC.md §4)', level: 'note' },
52
54
  { id: 'task-locale', text: "The flow's name for its users is missing from a locale's catalog (SPEC.md §4)", level: 'error' },
53
55
  { id: 'source-missing', text: 'A state of a captured flow names no code (SPEC.md §9)', level: 'error' },
56
+ { id: 'source-unresolved', text: 'A source anchor names a file that is not there, or a line past its end (SPEC.md §9)', level: 'error' },
57
+ { id: 'citation-unresolved', text: "Words that cite the code name a file that is not there, or a line past its end (SPEC.md §9)", level: 'warning' },
54
58
  { id: 'focus-not-shown', text: 'A focus or a returnsFocus gives the focus to a node that is not shown there (SPEC.md §4)', level: 'error' },
55
59
  { id: 'returns-focus-not-dialog', text: 'A returnsFocus does not start at a dialog (SPEC.md §4)', level: 'error' },
60
+ { id: 'role-missing', text: 'A field or an action gives no role, by which a screen reader finds it (SPEC.md §4)', level: 'warning' },
56
61
  { id: 'state-no-way-out', text: 'A state that is not an exit has no way out (SPEC.md §2)', level: 'error' },
57
62
  { id: 'state-unreachable', text: 'No situation the flow starts in reaches the state (SPEC.md §2)', level: 'error' },
58
63
  { id: 'tutorial-mismatch', text: 'A tutorial no longer matches its flow (SPEC.md §7)', level: 'error' },
59
64
  { id: 'evidence-unresolved', text: "A need's evidence names what is not there (SPEC.md §13)", level: 'error' },
60
65
  { id: 'need-no-evidence', text: 'A need that is not missing names no evidence outside the graph (SPEC.md §13)', level: 'error' },
66
+ { id: 'need-names-built', text: 'A missing need names a state that is built as its evidence (SPEC.md §13)', level: 'warning' },
61
67
  { id: 'need-unlisted', text: "A missing need is not in the product's gaps (SPEC.md §13)", level: 'error' },
62
68
  { id: 'need-twice', text: "A need's id is given twice in its flow's needs (SPEC.md §13)", level: 'error' },
63
69
  { id: 'needs-place', text: 'A needs file is beside no flow, or is the needs of another one (SPEC.md §13)', level: 'error' },
@@ -67,6 +73,7 @@ const RULES = [
67
73
  { id: 'invoke-unknown', text: "An invoke or a failures entry names an action its flow's domain does not have, or the domain is not found (SPEC.md §5)", level: 'error' },
68
74
  { id: 'refusal-unknown', text: 'A failure class lists a code that is neither a refusal of its action nor a transport code (SPEC.md §2, §5)', level: 'error' },
69
75
  { id: 'policy-unknown', text: 'A policy names an action or an entity its domain does not have (SPEC.md §5)', level: 'error' },
76
+ { id: 'planned-built', text: 'A planned entity or action names its code (SPEC.md §5)', level: 'error' },
70
77
  { id: 'graph-warning', text: 'Another warning of the graph', level: 'error' },
71
78
  { id: 'nav-problem', text: 'A problem of the navigation graph', level: 'error' },
72
79
  { id: 'nav-note', text: 'A note on the navigation graph', level: 'warning' },
@@ -280,10 +287,19 @@ function checkFlow(dir, domains) {
280
287
  }
281
288
  }
282
289
  // a captured flow is read from code, so every state names the code that makes it true; an exit may leave it out, as
283
- // the transition into it names that code (SPEC.md §9)
290
+ // the transition into it names that code, and so may a state that only missing needs name, which is not built yet
291
+ // (SPEC.md §9, §13)
284
292
  if (g.flow.status === 'captured') {
293
+ let needs = null;
294
+ try {
295
+ needs = readNeeds(dir);
296
+ }
297
+ catch {
298
+ // a needs.yaml that cannot be read plans nothing; its schema check says why
299
+ }
300
+ const notBuilt = planned(needs).states;
285
301
  for (const [name, st] of Object.entries(g.flow.states)) {
286
- if (st.source !== undefined || st.type === 'final')
302
+ if (st.source !== undefined || st.type === 'final' || notBuilt.has(name))
287
303
  continue;
288
304
  out.push(result('source-missing', file, keyAt(flowText, ['states', name]), `state ${name} names no code: in a captured flow every state but an exit carries source: <path>:<line> (SPEC.md §9)`, g.flow.id, `states/${name}`));
289
305
  }
@@ -331,6 +347,39 @@ function checkServerFunctions(parts, doc, id) {
331
347
  }
332
348
  return out;
333
349
  }
350
+ // an entity or an action that says it is planned, written before its code, and names its code all the same (SPEC.md
351
+ // §5): at its `planned`, with a note where its `source` is given, as the two may come from two files of a split domain
352
+ function checkPlanned(parts, doc, id) {
353
+ const out = [];
354
+ const read = parts.map((p) => {
355
+ try {
356
+ return readYaml(p.text);
357
+ }
358
+ catch {
359
+ return null;
360
+ }
361
+ });
362
+ const given = (section, name, key) => {
363
+ const i = read.findIndex((d) => d?.[section]?.[name]?.[key] !== undefined);
364
+ return i < 0 ? null : { file: parts[i].file, ...keyAt(parts[i].text, [section, name, key]) };
365
+ };
366
+ for (const [section, word] of [['entities', 'entity'], ['actions', 'action']]) {
367
+ const items = (doc[section] ?? {});
368
+ if (items === null || typeof items !== 'object')
369
+ continue;
370
+ for (const [name, item] of Object.entries(items)) {
371
+ if (item === null || typeof item !== 'object' || typeof item.planned !== 'string' || typeof item.source !== 'string')
372
+ continue;
373
+ const at = given(section, name, 'planned');
374
+ const src = given(section, name, 'source');
375
+ if (at === null)
376
+ continue;
377
+ const notes = src === null ? [] : [{ file: rel(src.file), line: src.line, column: src.column, message: `its source is given here` }];
378
+ out.push(result('planned-built', at.file, at, `the ${word} ${name} says it is planned (${item.planned}), and names its code, ${item.source}: a planned ${word} has no code yet; once it is built, take out planned (SPEC.md §5)`, id, `${section}/${name}/planned`, notes));
379
+ }
380
+ }
381
+ return out;
382
+ }
334
383
  // whether a domain's file gives the entity
335
384
  function givesEntity(text, entity) {
336
385
  try {
@@ -374,6 +423,7 @@ function checkDomains(files) {
374
423
  out.push(result(p.rule, p.file, p, p.message, id, p.element, notes));
375
424
  }
376
425
  out.push(...checkServerFunctions(parts, merged.doc, id));
426
+ out.push(...checkPlanned(parts, merged.doc, id));
377
427
  for (const p of checkDomainNames(parts, merged.doc, id, elsewhere(id))) {
378
428
  out.push(result(p.rule, p.file, p, p.message, id, p.element, p.notes.map((n) => ({ ...n, file: rel(n.file) }))));
379
429
  }
@@ -429,7 +479,7 @@ function toolVersion() {
429
479
  const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
430
480
  return pkg.version ?? '0.0.0';
431
481
  }
432
- function sarif(results, exitCode) {
482
+ function sarif(results, exitCode, said) {
433
483
  const used = RULES.filter((r) => results.some((x) => x.rule === r.id));
434
484
  return {
435
485
  $schema: 'https://json.schemastore.org/sarif-2.1.0.json',
@@ -445,7 +495,13 @@ function sarif(results, exitCode) {
445
495
  },
446
496
  },
447
497
  automationDetails: { id: 'delurio/check/' },
448
- invocations: [{ executionSuccessful: exitCode !== 1, exitCode }],
498
+ invocations: [
499
+ {
500
+ executionSuccessful: exitCode !== 1,
501
+ exitCode,
502
+ ...(said.length === 0 ? {} : { toolExecutionNotifications: said.map((text) => ({ level: 'note', message: { text } })) }),
503
+ },
504
+ ],
449
505
  results: results.map((r) => ({
450
506
  ruleId: r.rule,
451
507
  ruleIndex: used.findIndex((u) => u.id === r.rule),
@@ -503,7 +559,13 @@ function checkRun(args) {
503
559
  console.error(`--app ${appGiven} is not a folder\nusage:\n${CHECK_USAGE}`);
504
560
  return 1;
505
561
  }
506
- const app = resolve(appGiven ?? '.');
562
+ // --no-app: the graphs are here without the application's code, so what they name of it is not looked for (SPEC.md §10)
563
+ const noApp = args.includes('--no-app');
564
+ if (noApp && appGiven !== undefined) {
565
+ console.error(`--app names the application's code and --no-app says it is not here: give one of them\nusage:\n${CHECK_USAGE}`);
566
+ return 1;
567
+ }
568
+ const app = noApp ? null : resolve(appGiven ?? '.');
507
569
  const results = [];
508
570
  const domains = new Map(); // the domains found, for every flow that names one
509
571
  let broken = false;
@@ -537,16 +599,27 @@ function checkRun(args) {
537
599
  const needs = checkNeeds(files, app);
538
600
  for (const p of needs.problems)
539
601
  results.push(result(p.rule, p.file, p, p.message, p.graph, p.element));
602
+ // every source anchor, and every citation of the code in a graph's words, held to the application's files (SPEC.md §9)
603
+ const anchors = checkAnchors(files, app);
604
+ for (const p of anchors.problems)
605
+ results.push(result(p.rule, p.file, p, p.message, p.graph, p.element));
540
606
  results.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line || a.column - b.column || a.rule.localeCompare(b.rule) || a.message.localeCompare(b.message));
541
607
  if (baseline !== undefined) {
542
608
  const prints = baselinePrints(baseline);
543
609
  for (const r of results)
544
610
  r.baselineState = prints.has(fingerprint(r)) ? 'unchanged' : 'new';
545
611
  }
612
+ // what --no-app did not look for, said once rather than as a finding each (SPEC.md §10)
613
+ const said = [];
614
+ if (noApp) {
615
+ const of = (n, one, many) => `${n} ${n === 1 ? one : many}`;
616
+ const what = [count(anchors.anchors, 'source anchor'), of(anchors.citations, 'citation in words', 'citations in words'), of(needs.notLookedFor, 'piece of evidence', 'pieces of evidence')];
617
+ said.push(`--no-app: ${what.slice(0, -1).join(', ')} and ${what[what.length - 1]} name files of the application, which are not here, and were not looked for (SPEC.md §10)`);
618
+ }
546
619
  const failing = results.filter((r) => r.level === 'error' && !BREAKING.has(r.rule) && (r.baselineState === undefined || r.baselineState === 'new'));
547
620
  const exitCode = broken ? 1 : strict && failing.length > 0 ? 2 : 0;
548
621
  if (format === 'sarif') {
549
- const text = `${JSON.stringify(sarif(results, exitCode), null, 2)}\n`;
622
+ const text = `${JSON.stringify(sarif(results, exitCode, said), null, 2)}\n`;
550
623
  if (output === undefined)
551
624
  process.stdout.write(text);
552
625
  else
@@ -568,6 +641,8 @@ function checkRun(args) {
568
641
  const notes = results.filter((r) => r.rule === 'changes-note-gap');
569
642
  const newNotes = notes.filter((r) => r.baselineState === 'new').length;
570
643
  const missingNotes = notes.length === 0 ? '' : `, ${count(notes.length, 'missing changes note')}${newNotes > 0 ? ` (${newNotes} new)` : ''}`;
644
+ for (const s of said)
645
+ console.error(`delurio check: note: ${s}`);
571
646
  console.error(`delurio check: ${count(graphs, 'graph')}, ${count(errors, 'error')}, ${count(warnings, 'warning')}${gaps}${missingNotes}; exit ${exitCode}`);
572
647
  }
573
648
  return exitCode;
package/dist/kit.js CHANGED
@@ -304,7 +304,8 @@ function checkCss(css, where) {
304
304
  };
305
305
  if (css.includes('<'))
306
306
  fail('"<" is not allowed in kit CSS (percent-encode it in a data: URL)');
307
- if (/expression\(|javascript:|-moz-binding|behavior\s*:/i.test(css))
307
+ // `behavior:` is old Internet Explorer's script binding; `scroll-behavior` and `overscroll-behavior` are not
308
+ if (/expression\(|javascript:|-moz-binding|(?:^|[^-\w])behavior\s*:/i.test(css))
308
309
  fail('script-like CSS is not allowed');
309
310
  let depth = 0;
310
311
  let prelude = '';
package/dist/needs.d.ts CHANGED
@@ -25,7 +25,7 @@ export interface Needs {
25
25
  status?: string;
26
26
  needs: Need[];
27
27
  }
28
- export type NeedRule = 'evidence-unresolved' | 'need-no-evidence' | 'need-unlisted' | 'need-gap' | 'need-twice' | 'needs-place' | 'gap-met' | 'gap-unknown';
28
+ export type NeedRule = 'evidence-unresolved' | 'need-no-evidence' | 'need-names-built' | 'need-unlisted' | 'need-gap' | 'need-twice' | 'needs-place' | 'gap-met' | 'gap-unknown';
29
29
  export interface NeedProblem {
30
30
  rule: NeedRule;
31
31
  file: string;
@@ -40,6 +40,7 @@ export interface NeedsCheck {
40
40
  files: number;
41
41
  needs: number;
42
42
  gaps: number;
43
+ notLookedFor: number;
43
44
  }
44
45
  export declare function readNeeds(dir: string): Needs | null;
45
46
  export interface Planned {
@@ -47,4 +48,4 @@ export interface Planned {
47
48
  nodes: Map<string, string[]>;
48
49
  }
49
50
  export declare function planned(needs: Needs | null): Planned;
50
- export declare function checkNeeds(files: string[], app: string): NeedsCheck;
51
+ export declare function checkNeeds(files: string[], app: string | null): NeedsCheck;
package/dist/needs.js CHANGED
@@ -7,6 +7,7 @@
7
7
  import { existsSync, readFileSync, statSync } from 'node:fs';
8
8
  import { basename, dirname, isAbsolute, join } from 'node:path';
9
9
  import { keyAt, readYaml } from './yaml.js';
10
+ import { AppFiles } from './anchors.js';
10
11
  export const NEEDS_FILE = 'needs.yaml';
11
12
  export const GAPS_FILE = 'needs.gaps.yaml';
12
13
  const FORMAT = 'delurio-graph/0';
@@ -81,7 +82,6 @@ const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
81
82
  const holds = (body, name) => new RegExp(`(?<![\\w$])${escapeRe(name)}(?![\\w$])`).test(body);
82
83
  // a line of the file sets the variable and is not commented out: NAME=, export NAME=, NAME: or - NAME=
83
84
  const sets = (body, name) => new RegExp(`^[ \\t]*(?:-[ \\t]*)?(?:export[ \\t]+)?${escapeRe(name)}[ \\t]*[=:]`, 'm').test(body);
84
- const lineCount = (body) => body.split('\n').length - (body.endsWith('\n') ? 1 : 0);
85
85
  const fileAt = (ctx, path) => {
86
86
  const abs = isAbsolute(path) ? path : join(ctx.app, path);
87
87
  return existsSync(abs) && statSync(abs).isFile() ? abs : null;
@@ -103,6 +103,9 @@ function scenariosOf(file, seen = new Set()) {
103
103
  out.add(s);
104
104
  return out;
105
105
  }
106
+ // whether a piece of evidence names a file of the application by its path from the repository's root: a source, a test,
107
+ // the file a setting is set in, a binding named by its path (SPEC.md §13)
108
+ const namesAppFile = (kind, e) => kind === 'source' || kind === 'test' || kind === 'setting' || (kind === 'scenario' && text(e.binding) !== null);
106
109
  // why a piece of evidence does not resolve, or null when it does (or when what it names cannot be read, which is
107
110
  // reported where it is)
108
111
  function unresolved(ctx, kind, e) {
@@ -110,14 +113,11 @@ function unresolved(ctx, kind, e) {
110
113
  const name = text(e.name);
111
114
  switch (kind) {
112
115
  case 'source': {
113
- const m = /^(.*?)(?::(\d+))?$/.exec(value);
114
- const abs = fileAt(ctx, m[1]);
115
- if (abs === null)
116
- return `source ${m[1]} does not exist`;
117
- const body = readFileSync(abs, 'utf8');
118
- if (m[2] !== undefined && Number(m[2]) > lineCount(body))
119
- return `source ${value} is past the file's end: it has ${lineCount(body)} lines`;
120
- return name !== null && !holds(body, name) ? `source ${m[1]} holds no ${name}` : null;
116
+ const why = ctx.code.unresolved(value);
117
+ if (why !== null)
118
+ return `source ${why.subject} ${why.reason}`;
119
+ const path = /^(.*?)(?::\d+)?$/.exec(value)[1];
120
+ return name !== null && !holds(readFileSync(ctx.code.abs(path), 'utf8'), name) ? `source ${path} holds no ${name}` : null;
121
121
  }
122
122
  case 'test': {
123
123
  const abs = fileAt(ctx, value);
@@ -158,6 +158,16 @@ function unresolved(ctx, kind, e) {
158
158
  }
159
159
  }
160
160
  }
161
+ // the states of a captured flow that name their code (SPEC.md §9), which are therefore built, each with its anchor
162
+ function builtStates(flow) {
163
+ const out = new Map();
164
+ if (flow?.status !== 'captured' || !isMap(flow.states))
165
+ return out;
166
+ for (const [name, st] of Object.entries(flow.states))
167
+ if (isMap(st) && typeof st.source === 'string')
168
+ out.set(name, st.source);
169
+ return out;
170
+ }
161
171
  // the nodes of a ui.yaml, or null when it cannot be read
162
172
  function nodesOf(file) {
163
173
  const read = readDoc(file);
@@ -180,10 +190,12 @@ function gapsReader() {
180
190
  };
181
191
  }
182
192
  // every needs file and gaps file among `files` (the graph files under the folders checked), with the application's
183
- // repository root that evidence paths are relative to
193
+ // repository root that evidence paths are relative to; with `app` null (--no-app), evidence that names a file of the
194
+ // application is counted and not looked for, and the rest is held as before
184
195
  export function checkNeeds(files, app) {
185
- const out = { problems: [], files: 0, needs: 0, gaps: 0 };
196
+ const out = { problems: [], files: 0, needs: 0, gaps: 0, notLookedFor: 0 };
186
197
  const gapsOf = gapsReader();
198
+ const code = new AppFiles(app ?? '.');
187
199
  // each needs file's flow and the state of each of its needs, by the gaps file that covers it; null for a needs file
188
200
  // that cannot be read, whose entries are then not judged
189
201
  const covered = new Map();
@@ -221,10 +233,13 @@ export function checkNeeds(files, app) {
221
233
  }
222
234
  const uiFile = join(dir, 'ui.yaml');
223
235
  const ctx = {
224
- app,
236
+ app: app ?? '.',
237
+ code,
238
+ lookFor: app !== null,
225
239
  dir,
226
240
  flowId,
227
241
  states: flow === null ? null : new Set(isMap(flow.doc.states) ? Object.keys(flow.doc.states) : []),
242
+ built: builtStates(flow?.doc ?? null),
228
243
  nodes: !existsSync(flowFile) ? null : existsSync(uiFile) ? nodesOf(uiFile) : 'none',
229
244
  };
230
245
  const key = flowId ?? ownId ?? graph; // the flow, as the gaps name it
@@ -256,9 +271,18 @@ export function checkNeeds(files, app) {
256
271
  kinds++;
257
272
  if (!IN_GRAPH.has(kind))
258
273
  outside = true;
274
+ if (!ctx.lookFor && namesAppFile(kind, e)) {
275
+ out.notLookedFor++;
276
+ return;
277
+ }
259
278
  const why = unresolved(ctx, kind, e);
260
279
  if (why !== null)
261
280
  problem('evidence-unresolved', file, body, [...at, 'evidence', String(j), kind], `need ${id}: ${why} (SPEC.md §13)`, graph, `needs/${id}/evidence/${kind}:${String(e[kind])}`);
281
+ // a missing need names only what is not built: a walk leaves out a state that only missing needs name
282
+ const built = kind === 'state' && isMissing(item) ? ctx.built.get(e.state) : undefined;
283
+ if (built !== undefined) {
284
+ problem('need-names-built', file, body, [...at, 'evidence', String(j), kind], `need ${id} is missing, and names state ${String(e.state)}, which is built: it names its code (source: ${built}). A walk on the app leaves out a state that only missing needs name, so a missing need names only what is not built yet; say in its note that it is about ${String(e.state)} (SPEC.md §13)`, graph, `needs/${id}/built/state:${String(e.state)}`);
285
+ }
262
286
  });
263
287
  const missing = isMissing(item);
264
288
  const state = missing ? 'missing' : outside ? 'met' : 'unproven';
package/dist/schemas.d.ts CHANGED
@@ -7,4 +7,9 @@ export interface SchemaFinding {
7
7
  element: string;
8
8
  }
9
9
  export declare function schemaKindOf(file: string): SchemaKind | null;
10
+ export interface AnchorPlace {
11
+ path: string[];
12
+ value: string;
13
+ }
14
+ export declare function anchorsIn(kind: SchemaKind, data: unknown): AnchorPlace[];
10
15
  export declare function validateFile(file: string): SchemaFinding[];
package/dist/schemas.js CHANGED
@@ -73,6 +73,56 @@ function chain(root, schema) {
73
73
  }
74
74
  return out;
75
75
  }
76
+ const ANCHOR = '#/$defs/sourceAnchor';
77
+ const patterns = new Map();
78
+ const matches = (pattern, name) => {
79
+ let re = patterns.get(pattern);
80
+ if (re === undefined)
81
+ patterns.set(pattern, (re = new RegExp(pattern, 'u')));
82
+ return re.test(name);
83
+ };
84
+ const refAt = (root, ref) => ref.slice(2).split('/').reduce((x, k) => x?.[k], root);
85
+ // every source anchor in a graph file's value (SPEC.md §9): each `source` whose schema is the kind's `sourceAnchor`,
86
+ // found by walking the value along its schema, so a key `source` that the schema gives another meaning (a nav graph's
87
+ // `source`, a sample value or a parameter of ui.yaml, a field of a record) is none. Where the schema has alternatives,
88
+ // every one that the value's shape reaches is walked.
89
+ export function anchorsIn(kind, data) {
90
+ const root = schemas().roots[kind];
91
+ const out = new Map();
92
+ const visit = (schema, value, path, seen) => {
93
+ if (schema === null || typeof schema !== 'object' || seen.has(schema))
94
+ return;
95
+ seen.add(schema);
96
+ const s = schema;
97
+ if (s.$ref === ANCHOR) {
98
+ if (typeof value === 'string')
99
+ out.set(path.join('\0'), { path, value });
100
+ return;
101
+ }
102
+ if (typeof s.$ref === 'string' && s.$ref.startsWith('#/'))
103
+ visit(refAt(root, s.$ref), value, path, seen);
104
+ for (const k of ['allOf', 'anyOf', 'oneOf'])
105
+ for (const branch of s[k] ?? [])
106
+ visit(branch, value, path, seen);
107
+ for (const k of ['then', 'else'])
108
+ visit(s[k], value, path, seen);
109
+ if (Array.isArray(value)) {
110
+ const prefix = s.prefixItems ?? [];
111
+ value.forEach((x, i) => visit(i < prefix.length ? prefix[i] : s.items, x, [...path, String(i)], new Set()));
112
+ return;
113
+ }
114
+ if (value === null || typeof value !== 'object')
115
+ return;
116
+ const properties = (s.properties ?? {});
117
+ const byPattern = Object.entries((s.patternProperties ?? {}));
118
+ for (const [k, x] of Object.entries(value)) {
119
+ const sub = Object.hasOwn(properties, k) ? properties[k] : (byPattern.find(([p]) => matches(p, k))?.[1] ?? s.additionalProperties);
120
+ visit(sub, x, [...path, k], new Set());
121
+ }
122
+ };
123
+ visit(root, data, [], new Set());
124
+ return [...out.values()];
125
+ }
76
126
  // edits between two names, a swap of two neighbours counting as one (titel, title)
77
127
  function distance(a, b) {
78
128
  const d = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array(b.length).fill(0)]);
@@ -1,6 +1,6 @@
1
1
  import type { Graph } from './graph.ts';
2
2
  export interface UiProblem {
3
- rule: 'focus-not-shown' | 'returns-focus-not-dialog' | 'task-locale';
3
+ rule: 'focus-not-shown' | 'returns-focus-not-dialog' | 'task-locale' | 'role-missing';
4
4
  path: string[];
5
5
  message: string;
6
6
  element: string;
package/dist/ui-check.js CHANGED
@@ -115,6 +115,12 @@ export function checkUi(g, warn) {
115
115
  for (const n of Object.values(nodes))
116
116
  if (n.value !== undefined)
117
117
  words(n.value);
118
+ // a control with no role: a screen reader, a replay and kit check find a field or an action by its WAI-ARIA role
119
+ for (const [id, n] of Object.entries(nodes)) {
120
+ if (n.role !== undefined || (n.type !== 'field' && n.type !== 'action'))
121
+ continue;
122
+ out.push({ rule: 'role-missing', path: ['nodes', id], element: `nodes/${id}`, message: `${id} is ${n.type === 'field' ? 'a field' : 'an action'} with no role: a screen reader, a replay and kit check find a control by its WAI-ARIA role (textbox, combobox, button, link, ...), and kit check holds only its name and state (SPEC.md §4)` });
123
+ }
118
124
  // the flow's name for its users, in the catalog of every locale, as the changes note is
119
125
  const task = g.ui.task?.key;
120
126
  if (g.ui.absent !== true && typeof task === 'string') {
@@ -8,6 +8,8 @@ export interface Expectation {
8
8
  id: string;
9
9
  index: number;
10
10
  role: string;
11
+ /** False when ui.yaml gives a control (a field or an action) no role: `role` is then its type, which no element is. */
12
+ roleGiven: boolean;
11
13
  name: string | undefined;
12
14
  disabled: boolean;
13
15
  }
package/dist/wireframe.js CHANGED
@@ -242,6 +242,8 @@ export function renderStageScreen(g, state, reveal, warn, kit = null) {
242
242
  const items = shown.map(([id, node]) => ({ id, node, disabled: (node.disabledIn ?? []).includes(state), focus: false }));
243
243
  return `<div class="wf${kit === null ? '' : ' kit'}" role="group" aria-label="Screen: ${esc(titleOf(g.flow, state))}">${renderWireframe(g, state, items, warn, true, kit)}</div>`;
244
244
  }
245
+ // a node's type that is no WAI-ARIA role: a field or an action with no `role` says nothing a screen reader can find
246
+ const NO_ARIA_TYPES = new Set(['field', 'action']);
245
247
  // For `kit check`: every screen with all its nodes (flags revealed, no annotations), and what each node must expose.
246
248
  export function renderCheckScreens(g, kit, warn) {
247
249
  const html = [];
@@ -257,11 +259,12 @@ export function renderCheckScreens(g, kit, warn) {
257
259
  if (n.component === 'Page')
258
260
  continue; // the screen itself: nothing is drawn for it
259
261
  if (n.component === 'ListItem') {
260
- texts(g, n, warn).forEach((line, index) => expected.push({ state, id: it.id, index, role: n.role ?? 'listitem', name: line, disabled: it.disabled }));
262
+ texts(g, n, warn).forEach((line, index) => expected.push({ state, id: it.id, index, role: n.role ?? 'listitem', roleGiven: true, name: line, disabled: it.disabled }));
261
263
  continue;
262
264
  }
263
265
  const role = n.role ?? (n.type === 'text' ? 'text' : n.type);
264
- expected.push({ state, id: it.id, index: 0, role, name: role === 'text' ? texts(g, n, warn)[0] : accessibleName(g, n, warn), disabled: it.disabled });
266
+ const roleGiven = n.role !== undefined || !NO_ARIA_TYPES.has(n.type);
267
+ expected.push({ state, id: it.id, index: 0, role, roleGiven, name: role === 'text' ? texts(g, n, warn)[0] : accessibleName(g, n, warn), disabled: it.disabled });
265
268
  }
266
269
  }
267
270
  return { html: html.join('\n'), expected };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delurio/cli",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "The open checker and page of delurio-graph/0: check every graph in a project's own CI, offline, with GNU error lines and SARIF.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "./package.json": "./package.json"
22
22
  },
23
23
  "files": ["dist", "schemas", "SPEC.md", "NOTICE", "CHANGELOG.md"],
24
- "engines": { "node": ">=22.18" },
24
+ "engines": { "node": ">=26" },
25
25
  "repository": { "type": "git", "url": "git+https://github.com/delurio-labs/delurio.git" },
26
26
  "homepage": "https://delur.io",
27
27
  "bugs": "https://github.com/delurio-labs/delurio/issues",
@@ -34,11 +34,11 @@
34
34
  "dependencies": {
35
35
  "ajv": "8.20.0",
36
36
  "ajv-formats": "3.0.1",
37
- "elkjs": "0.12.0",
37
+ "elkjs": "0.12.1",
38
38
  "yaml": "2.9.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@types/node": "22.20.5",
41
+ "@types/node": "26.6.6",
42
42
  "typescript": "7.0.2"
43
43
  }
44
44
  }
@@ -86,6 +86,8 @@
86
86
  "items": { "type": "object" },
87
87
  "examples": [[{ "userId": "0199f9a0-11aa-7b22-8c33-4d44e55f6601", "clientId": "0199f9b2-3c4d-7e5f-8a6b-7c8d9e0f1a2b", "scopes": ["openid"] }]]
88
88
  },
89
+ "note": { "type": "string", "description": "The author's own words about the entity, which no tool reads (SPEC.md §5)." },
90
+ "planned": { "type": "string", "minLength": 1, "description": "The entity is written before its code: no code makes it true yet. Why, or where that is tracked: words, an issue. It names no code (`source`) while it says so (SPEC.md §5).", "examples": ["the second phase builds it (#12)"] },
89
91
  "source": { "$ref": "#/$defs/sourceAnchor" }
90
92
  }
91
93
  },
@@ -244,6 +246,7 @@
244
246
  "examples": [["audit:consent.decided"]]
245
247
  },
246
248
  "note": { "type": "string", "description": "The author's own words about the action, which no tool reads (SPEC.md §5)." },
249
+ "planned": { "type": "string", "minLength": 1, "description": "The action is written before its code: no code makes it true yet. Why, or where that is tracked: words, an issue. It names no code (`source`) while it says so (SPEC.md §5).", "examples": ["the second phase builds it (#12)"] },
247
250
  "source": { "$ref": "#/$defs/sourceAnchor" }
248
251
  }
249
252
  },