@delurio/cli 0.0.0 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 QAuth Labs
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ delurio
2
+ Copyright 2026 delurio Labs
3
+
4
+ This product includes software developed by delurio Labs
5
+ and its contributors.
package/README.md CHANGED
@@ -1,5 +1,64 @@
1
- # @delurio/cli
1
+ # delurio
2
2
 
3
- This version only holds the name. The first release of delurio's open checker, `delurio check`, follows.
3
+ The open checker and page of **delurio-graph/0**, a format for writing a product's flows, screens and API as one graph that people review in words, that is checked against the code, replayed on the real app and turned into tutorials. The format is [SPEC.md](SPEC.md).
4
4
 
5
- https://delur.io
5
+ This package is the part a project's own CI runs: it reads graph files and nothing else. There is no network, no account and no model.
6
+
7
+ ## Install
8
+
9
+ Pin an exact version:
10
+
11
+ ```sh
12
+ npm install --save-dev --save-exact @delurio/cli
13
+ ```
14
+
15
+ or the container image, pinned by its digest:
16
+
17
+ ```sh
18
+ docker run --rm -v "$PWD:/work" -w /work ghcr.io/delurio-labs/delurio@sha256:<digest> check graphs --strict
19
+ ```
20
+
21
+ Node 22.18 or later.
22
+
23
+ ## Check every graph
24
+
25
+ ```sh
26
+ npx delurio check graphs --strict
27
+ ```
28
+
29
+ - **Findings:** one line each, in the GNU error format that compilers, editors and CI logs read:
30
+
31
+ ```
32
+ graphs/billing/payment/flow.yaml:176:7: error: restricted-only-when-retries-ran-out is broken: … [assertion-violated]
33
+ graphs/billing/payment/flow.yaml:176:7: note: start: role = manager, paid = false
34
+ graphs/billing/payment/flow.yaml:176:7: note: step 1: RETRIES_RAN_OUT
35
+ ```
36
+
37
+ - **SARIF:** `--format sarif --output delurio.sarif` writes SARIF 2.1.0 for code scanning. The same input gives the same bytes.
38
+ - **Baseline:** `--baseline <sarif>` fails only on errors that are new since an earlier run.
39
+
40
+ | Exit | Meaning |
41
+ |---|---|
42
+ | 0 | every graph loads, and under `--strict` nothing is wrong |
43
+ | 1 | a graph cannot be loaded, or is written for a newer format than this version reads |
44
+ | 2 | under `--strict`: a guarantee is broken, a catalog key or a sample is missing, the main story cannot be walked, a writing flow has no changes note… |
45
+
46
+ ## A graph's page
47
+
48
+ ```sh
49
+ npx delurio page graphs/billing/payment --out viz/payment
50
+ ```
51
+
52
+ The page shows the flow in words: its main story, every way it ends, its guarantees and whether they hold, its screens as wireframes, and its diagram. `examples/qauth-authorize` is a small graph to try it on.
53
+
54
+ ## What a revision changes, in words
55
+
56
+ ```sh
57
+ npx delurio diff graphs/billing/payment --base origin/main
58
+ ```
59
+
60
+ This prints Markdown for a pull request. It covers what the flow does differently (found by running both revisions) and what changed in the graph.
61
+
62
+ ## Licence
63
+
64
+ Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). The name "delurio" is not licensed with the code.
package/SPEC.md ADDED
@@ -0,0 +1,363 @@
1
+ # delurio-graph/0
2
+
3
+ This is the format of a delurio graph, as the tools in this repository read it today. Everything in it is version 0: the format settles as delurio's own graphs and its first users (qauth among them) are written in it. A part that is still open says so and names the issue that tracks it. Nothing here is a proposal kept apart from the rest; what is written is what v0 is.
4
+
5
+ The tool behaviour behind each part (the page, the video, replay, anchors, kits, the revision diff) is described in `tools/graph-viz/README.md`. This file says what the files mean.
6
+
7
+ Where a standard already covers a part, the format uses it: JSON Schema and OpenAPI for the data and the API, WAI-ARIA for screens, ICU MessageFormat and BCP 47 for words, design tokens for kits, WebVTT for captions, SARIF for findings. What delurio adds is what ties them together: one graph whose flows, screens, pages and API are checked against each other, replayed on the real app and turned into tutorials. §12 lists every standard and what it is used for.
8
+
9
+ ## 1. A graph and its files
10
+
11
+ A graph is a directory of YAML files. Every file starts with the same three keys:
12
+
13
+ ```yaml
14
+ schema: delurio-graph/0
15
+ kind: flow # flow | ui | domain | nav | binding | tutorial | kit
16
+ id: learning.enrollment
17
+ ```
18
+
19
+ | Kind | File | What it says |
20
+ |---|---|---|
21
+ | `flow` | `flow.yaml` | the behaviour: states, events, transitions, a finite context, and guarantees the checker proves |
22
+ | `ui` | `ui.yaml` | what each state shows: the nodes of the screen, their roles, names, texts and the events they send |
23
+ | catalog | `catalog/<locale>.json` | the words of the UI, one file per locale |
24
+ | `domain` | `domain.yaml` | the data and the API: entities, actions, refusals, policies, invariants |
25
+ | `nav` | `nav.yaml` | the pages of an app, the ways between them, and who may open them |
26
+ | `binding` | `binding.yaml` | how a flow maps onto a running app, for replay and recording |
27
+ | `tutorial` | `tutorial.yaml` | an end-user video written against a flow |
28
+ | `kit` | `kit.yaml` | how the UI components look in one product |
29
+ | (generated) | `anchors.lock.yaml`, `viz/`, `video/` | written by the tools; never by hand |
30
+
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 navigation graph is a directory with `nav.yaml` and its catalog.
32
+
33
+ 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).
34
+
35
+ ### Common keys
36
+
37
+ | Key | Meaning |
38
+ |---|---|
39
+ | `title`, `summary` | the graph in plain words, for people |
40
+ | `status` | `proposed`: written before or apart from the code, nobody has approved it. `captured`: read from existing code (capture mode, every element carries `source:`). `approved`: the owner reviewed and accepted it |
41
+ | `source` | on any element: `<repo-relative path>:<line>` or a bare `<path>`, the code that makes the element true. See §9 |
42
+
43
+ ### Text
44
+
45
+ The graph is written in one language, given by the project. Titles, `say` sentences, descriptions and assertion sentences are in that language. Every word a user of the product sees lives in a catalog, one file per locale; the graph refers to it by key. Identifiers (states, events, guards, effects, nodes, catalog keys) are English camelCase; events are UPPER_SNAKE.
46
+
47
+ ## 2. Flow (`kind: flow`)
48
+
49
+ ```yaml
50
+ schema: delurio-graph/0
51
+ kind: flow
52
+ id: qauth.authorize
53
+ status: proposed
54
+ domain: qauth.authorize # the domain this flow's `invoke`s and refusals come from
55
+ ui: qauth.authorize # the UI graph of its screens
56
+ title: Authorize and ask for consent
57
+ summary: >-
58
+ ...
59
+ scope: { shows: ..., world: open, outOfView: [..] }
60
+ decisions: { D1: { question: ..., recommend: ..., affects: [state, ..] } }
61
+ context: { name: { values: [..], initial: any | <value>, say: { <value>: <words> } } }
62
+ guards: { name: "<expression>" }
63
+ effects: { name: { set: { var: value }, havoc: [var] } }
64
+ failures: { <invoking state>: { from: <action>, <class>: [<refusal code>, ..] } }
65
+ main: { given: { var: value }, events: [EVENT, ..] }
66
+ initial: <state>
67
+ states: { <state>: { .. } }
68
+ assertions: [ { id, never: "<expression>", say, source } ]
69
+ ```
70
+
71
+ A flow is a statechart, and its meaning is a subset of SCXML's (W3C Recommendation, 2015). A transition in `on` is an SCXML transition with an event, `always` is a list of eventless transitions, a list of transitions is tried in document order, `invoke` and `type: final` mean what they mean in SCXML, a guard is a `cond` and an effect an `<assign>`; `DONE` and `FAIL.<class>` stand for SCXML's `done.invoke` and `error` events. A flow can therefore be written out as SCXML; that export is an open issue.
72
+
73
+ ### Context
74
+
75
+ The context is a set of variables, each with a finite list of `values`. `initial: any` makes the checker start from every value; a fixed `initial` starts from that one. `say` gives each value in plain words, for the sentence that describes a starting situation. Keep contexts small: a variable stands for the few cases that change behaviour, not for the data itself.
76
+
77
+ ### Guards and effects
78
+
79
+ A guard is a named expression (§3). It may name context variables, other guards and `state`.
80
+
81
+ An effect changes the context when a transition is taken: `set` gives variables new values, `havoc` lets variables take any value of their domain (the checker branches into each), for a change made elsewhere that the flow cannot know in advance.
82
+
83
+ ### States
84
+
85
+ | Key | Meaning |
86
+ |---|---|
87
+ | `title`, `description` | the state in words |
88
+ | `by` | who does the step: `human`, `ai`, `agent` or `ci`. A server step with no actor has none |
89
+ | `goal: true` | the state the flow is for, the one it keeps returning to (for flows that never end) |
90
+ | `includes: [..]` | what the step covers beyond its title |
91
+ | `invoke` | the step runs something: `{ action: <domain action> }`, `{ flow: <flow id> }` (another flow runs and this one waits for its outcome), or `{ external: <name> }` |
92
+ | `on` | event → transition (below) |
93
+ | `always` | an ordered list of transitions taken at once, with no event. The first whose guard holds is taken; the list must cover every context (the checker fails otherwise) |
94
+ | `type: final` | an exit; it has no transitions |
95
+ | `redirect`, `code`, `carries` | on an exit of a web protocol flow: `redirect: success \| error \| never`, the error `code`s, and what a success carries back |
96
+ | `leavesPage: true` | on an exit: the person left (closed the page, went elsewhere) |
97
+ | `response` | on a step with no screen: what the outside world sees, as data: `status`, `code`, `redirect`, `headers`, `body`, or the fields of a tool's answer. The page shows it beside the step, and a replay over HTTP will read it |
98
+ | `source` | the code that makes the state true |
99
+
100
+ A transition is a target state id, or `{ target, guard, effect: [..], say, starts, source }`, or a list of those: the first whose guard holds is taken. `say` is the transition in words; `starts` is under "Several flows" below.
101
+
102
+ ### Events
103
+
104
+ - 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.
105
+ - `NAVIGATE` is the person leaving the page.
106
+ - 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.
107
+
108
+ ### Main story, scope, decisions
109
+
110
+ - `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.
111
+ - `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.
112
+ - `decisions` are the questions still open in this flow, each with a recommendation and the states it affects.
113
+
114
+ ### Assertions and the checker
115
+
116
+ A configuration is a state together with a value for every context variable. The checker starts from every initial configuration and follows every transition whose guard holds, applying its effects, breadth first. An `always` state moves on at once. Every reachable configuration is visited once.
117
+
118
+ 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.
119
+
120
+ 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 an open issue. Paths that cover every transition are an open issue.
121
+
122
+ ### Several flows
123
+
124
+ Nested, parallel and history states are not part of v0, and a flow that uses them does not load. A process that runs beside another is its own flow:
125
+
126
+ - `invoke: { flow: <id> }`: this flow waits for the other one's outcome.
127
+ - `starts: { flow: <flow id>, given: { <variable>: <expression> } }` on a transition: this flow starts the other one and does not wait. `given` is what the started flow begins with: each value is an expression over this flow's context (§3), read where the transition is taken, after its effects; a constant is quoted (`from: "'repo'"`). The other flow's influence back on this flow is written as an event or an effect here. The checker finds the started flow by its id among the graphs beside this one (under the nearest folder called `graphs`) and checks that every situation in which the transition is taken gives each variable a value the started flow can begin with: one of its `values`, and its `initial` when that is fixed. A started flow that is not written yet is a note, not a failure, and is checked once it is. Decided on 22 Oct 2026; the form came with delurio.project.create.
128
+
129
+ ## 3. Expressions
130
+
131
+ Guards and assertions are interpreted, never evaluated as code:
132
+
133
+ ```
134
+ or and not == != in not in ( ) [lists] 'strings' numbers true false null names
135
+ ```
136
+
137
+ A name is a context variable, a named guard or `state`. Every variable has a finite domain, so the checker can visit every reachable configuration. The same language is used by `nav.yaml` (over facts) and `ui.yaml` (`when`).
138
+
139
+ The language is delurio's own. CEL, JSONata or SCXML's ECMAScript data model can name values that have no finite list, and then the checker could no longer visit every configuration.
140
+
141
+ ## 4. UI (`kind: ui`)
142
+
143
+ ```yaml
144
+ schema: delurio-graph/0
145
+ kind: ui
146
+ id: qauth.authorize
147
+ flow: qauth.authorize
148
+ status: proposed
149
+ catalog: catalog/en.json
150
+ locales: [en]
151
+ kit: ../kit # optional: the kit the screens are drawn with
152
+ samples: { client: "Acme Notes" } # values for catalog parameters, on the page and in videos
153
+ changes: { key: Changes.note } # optional: what the flow changes and what follows, in its users' words
154
+ nodes: { <node>: { .. } }
155
+ edges: [ { labelledBy: [node, node] }, { triggers: [node, state] } ]
156
+ rules: [ { id, rule } ]
157
+ ```
158
+
159
+ | Node key | Meaning |
160
+ |---|---|
161
+ | `type` | `page`, `text`, `action`, `field`, `list`, `status`, `alert` |
162
+ | `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 |
163
+ | `role` | the ARIA role the node exposes |
164
+ | `intent` | for actions: `confirm`, `dismiss`, `secondary` |
165
+ | `name` | the accessible name: `{ key, params }` from the catalog, `{ labelledBy: <node> }`, `{ literal }`, or `{ oneOf: [keys] }` |
166
+ | `text` | the visible text, same forms. Kept apart from `name` so that "the visible text is in the name" (WCAG 2.5.3) is checkable |
167
+ | `in`, `unless` | the flow states the node is shown in, and those it is not |
168
+ | `when` | a guard or context flag that must hold for the node to show |
169
+ | `disabledIn` | states where the node is shown but disabled |
170
+ | `emits` | the event the node sends when pressed |
171
+ | `initialFocus` | on a page: the node that has focus when it opens |
172
+ | `repeat` | the node is drawn once per item of this data (`request.scopes`) |
173
+ | `frame` | for a page: whether it may be framed (`never`) |
174
+ | `source` | the code that draws it |
175
+
176
+ `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`).
177
+
178
+ 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.
179
+
180
+ 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 an open issue.
181
+
182
+ ### Catalog
183
+
184
+ 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.
185
+
186
+ 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`.
187
+
188
+ ## 5. Domain (`kind: domain`)
189
+
190
+ ```yaml
191
+ schema: delurio-graph/0
192
+ kind: domain
193
+ id: qauth.authorize
194
+ entities:
195
+ Client:
196
+ fields:
197
+ id: { type: string }
198
+ redirectUris: { type: array, items: { type: string, format: uri, pattern: "^https://" } }
199
+ secret: { type: string, sensitivity: credential }
200
+ lifecycle: [ "none -> active: ..." ]
201
+ Consent:
202
+ key: [userId, clientId]
203
+ required: [userId, clientId, scopes]
204
+ fields:
205
+ userId: { type: string }
206
+ clientId: { type: string, references: Client }
207
+ scopes: { type: array, items: { type: string } }
208
+ policies:
209
+ - { actor: end-user, needs: session, where: "...", read: [..], write: [Consent], do: [decide] }
210
+ actions:
211
+ decide:
212
+ route: POST /authorize/consent
213
+ needs: session
214
+ body: { type: object, required: [decision], properties: { decision: { enum: [allow, deny] } } }
215
+ result: { returns: Consent }
216
+ sideEffects: [audit:consent.decided]
217
+ refusals: { CSRF_MISMATCH: { status: 403, redirect: never } }
218
+ invariants:
219
+ - { id: redirect-uri-exact, rule: "...", spec: RFC 6749 §3.1.2.3 }
220
+ ```
221
+
222
+ **The data.** An entity's `fields` give each field as a JSON Schema (2020-12), and `required` lists the fields that must be present: an entity is the JSON Schema `{ type: object, properties: <fields>, required: <required> }`. `null` is a type like any other: an optional time is `{ type: [string, "null"], format: date-time }`, and an enum that may be empty lists `null` among its values. A `body` or a `result` written out is a JSON Schema too. delurio adds these keywords, which a JSON Schema validator leaves alone:
223
+
224
+ | Keyword | On | Meaning |
225
+ |---|---|---|
226
+ | `key` | an entity | the fields that identify it; `[id]` when left out |
227
+ | `references` | a field | it holds the key of another entity |
228
+ | `unique` | a field | `true`, or `case-insensitive` |
229
+ | `sensitivity` | a field | `credential`, `personal` or `internal`: what may be shown, logged or kept |
230
+ | `lifecycle` | an entity | its states, as `from -> to: why` sentences |
231
+
232
+ 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.
233
+
234
+ **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 no route 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.
235
+
236
+ This form was decided on 22 Oct 2026. Graphs captured before it may still give fields as `{ kind: text }`; they are converted when a tool first reads fields. The OpenAPI export and import are an open issue.
237
+
238
+ No tool checks a domain yet: the revision diff compares it and anchors lock its `source:` keys. Loading it with the flow and checking policies, secrets and `invoke` names is an open issue; generating it from Drizzle and Zod is an open issue; a registry that every API operation and route is covered by a graph is an open issue.
239
+
240
+ ## 6. Navigation (`kind: nav`)
241
+
242
+ ```yaml
243
+ kind: nav
244
+ schema: delurio-graph/0
245
+ id: shop-landing
246
+ title: Landing
247
+ status: captured
248
+ locale: tr
249
+ catalog: catalog/tr.json
250
+ summary: ...
251
+ frames: { site: { title: ..., menu: Footer } }
252
+ facts: { role: { values: [..], say: .. } }
253
+ sets: { staffRoles: [..] }
254
+ guards: { name: "<expression over facts>" }
255
+ personas: { visitor: { title, say, facts: { .. } } }
256
+ pages: { start: { route: /, title: <catalog key>, kind: screen, frame: site, source, opensFor, refusal } }
257
+ entries: [ { from: <page> | frame:<frame> | [..], to: <page>, how: menu, label: <catalog key>, when, clicks, data, back } ]
258
+ goals: [ { id, say, page, for: [persona], within: <clicks> } ]
259
+ notModeled: [ "..." ]
260
+ ```
261
+
262
+ - 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.
263
+ - 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.
264
+ - 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).
265
+ - 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).
266
+ - 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.
267
+
268
+ ## 7. Binding (`kind: binding`) and tutorial (`kind: tutorial`)
269
+
270
+ 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.
271
+
272
+ A **tutorial** is written against a flow: `title`, `audience`, `locale`, `appName`, `voice`, 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.
273
+
274
+ 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: the label people see, 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 label 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"). The video tool does none of the three yet; that is an open issue.
275
+
276
+ ## 8. Kit (`kind: kit`)
277
+
278
+ 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.
279
+
280
+ ## 9. Source anchors
281
+
282
+ `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.
283
+
284
+ `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.
285
+
286
+ ## 10. Checks and findings
287
+
288
+ | Exit | Meaning |
289
+ |---|---|
290
+ | 0 | the graph loads and, under `--strict`, nothing is wrong |
291
+ | 1 | the graph cannot be loaded: a YAML error, an unknown state, an unknown name in an expression, a non-exhaustive `always`, an unsupported construct |
292
+ | 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, or the main story cannot be walked |
293
+
294
+ **As text.** A finding is one line in the GNU error format, which compilers, editors and most CI logs read:
295
+
296
+ ```
297
+ graphs/panel/nav/nav.yaml:42:5: error: the menu entry opens a page that refuses [menu-refused]
298
+ graphs/product/flow.yaml:88:7: note: step 2: CODE_CHANGED from developing, with replayed = false
299
+ ```
300
+
301
+ `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.
302
+
303
+ **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:
304
+
305
+ | delurio | SARIF |
306
+ |---|---|
307
+ | the tool, its version and every rule: id, title, description, help page, default level | `tool.driver` and its `rules` |
308
+ | a rule that stands for a WCAG success criterion | `taxonomies` (WCAG 2.2), linked from the rule by `relationships` |
309
+ | a finding: its rule, level, message, file, line and column | `result`: `ruleId`, `level`, `message`, `locations[0].physicalLocation` with its `region` |
310
+ | the graph element it is about: a state, a node, a page, an action | `logicalLocations`, e.g. `qauth.authorize/states/consent` |
311
+ | the guard or the assertion involved, the app code a `source:` names | `relatedLocations`; the graph's files under the base `SRCROOT`, the app's under `APPROOT` |
312
+ | the path that breaks an assertion: the start, each event, the context at each step, the steps inside an invoked flow | `codeFlows[].threadFlows[].locations`, with `state` for the context and `nestingLevel` for the invoked flow |
313
+ | the flow itself, and the path drawn on it | `run.graphs` and `result.graphTraversals` |
314
+ | 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) |
315
+ | a finding dismissed with a reason (`finding.triage`) | `suppressions`, with `justification` |
316
+ | new, unchanged or gone since a base run (`--baseline <file>`) | `baselineState` |
317
+ | a replay mismatch: the screenshot, the trace, the HTTP exchange | `attachments`, `webRequest`, `webResponse` |
318
+ | a mechanical fix, such as an anchor's new line | `fixes` |
319
+ | the finding's page in the panel; the issue it was sent to | `hostedViewerUri`; `workItemUris` |
320
+ | the files read, with their hashes; the repository and the commit | `artifacts`; `versionControlProvenance` |
321
+ | the exit code; a file that cannot be loaded | `invocations` with `exitCode`; a result of the rule `load` and a `toolExecutionNotification` |
322
+ | which graph and which check, so that uploads stay apart | `automationDetails.id` |
323
+ | the messages in Turkish (`--locale tr`) | `run.language` and a `translations` component |
324
+
325
+ The same input gives the same bytes: no times, no random ids, results in a fixed order. Every file written is valid against the OASIS schema.
326
+
327
+ There is no other machine format: no JSON of delurio's own, and nothing that only one CI reads. A converter for a CI that reads neither (GitLab's Code Quality report, Bitbucket's Code Insights) is written when a customer needs it, outside the checker. The public, pinned, offline CLI that gives both outputs is an open issue.
328
+
329
+ ## 11. Writing a graph
330
+
331
+ - Model the few cases that change behaviour; a guard over hundreds of permission codes is wrong.
332
+ - Quote a YAML list item that contains `: `, or YAML reads it as a map.
333
+ - Say every rule that must hold as an assertion; do not leave it implied by the drawing.
334
+ - In capture mode, describe what the code does today: no new feature, no fix. An invariant the code breaks is modelled as the code has it and reported, not written as an assertion that fails.
335
+ - One process, one flow. A process that runs beside another starts it (`starts:`) or waits for it (`invoke: { flow }`).
336
+
337
+ ## 12. The standards it builds on
338
+
339
+ Where a standard covers a part, delurio uses it rather than writing its own. Surveyed on 22 Oct 2026.
340
+
341
+ | Standard | Used for | How |
342
+ |---|---|---|
343
+ | YAML 1.2 | every graph file | as it is |
344
+ | JSON Schema 2020-12 | the fields of entities, bodies and results (§5); a schema of every kind of graph file, so that editors check and complete them (#1) | as it is, plus the keywords of §5 |
345
+ | OpenAPI 3.1 | an action with a route is an operation (§5) | export and import: #13 |
346
+ | RFC 9457, problem details | the body of a refusal (§5) | as it is |
347
+ | SCXML (W3C, 2015) | what a flow means (§2) | a subset; export: #14 |
348
+ | WAI-ARIA 1.2, Accessible Name and Description Computation 1.2 | roles and names in `ui.yaml` (§4) | as they are |
349
+ | WCAG 2.2 | the UI rules (#4), and their taxonomy in SARIF (§10) | as it is |
350
+ | ICU MessageFormat; MessageFormat 2 | catalog messages (§4) | simple arguments today; MF2 when an app uses it |
351
+ | BCP 47 | locale names (§4) | as it is |
352
+ | Design Tokens Format Module 2025.10 (W3C community group) | kit tokens (§8) | as it is |
353
+ | WebVTT (W3C) | captions and chapters of videos (§7) | as it is; SRT beside it |
354
+ | C2PA and an imperceptible watermark | marking every AI-made video (§7), under Art. 50 of the EU AI Act | #12 |
355
+ | SARIF 2.1.0 (OASIS) | findings for machines (§10) | every part a finding has |
356
+ | GNU error format | findings as text (§10) | as it is |
357
+ | OAuth 2.0 and 2.1 (draft), RFC 9700, OpenID Connect Core, RP-Initiated Logout and Back-Channel Logout, the MCP authorization spec | signing in, signing out and agents' authority, through QAuth | cited with `spec:`, never written again |
358
+ | Model Context Protocol | the tools agents use | as it is |
359
+ | HTML custom elements | `<delurio-player>`, `<delurio-rehber>` | as they are |
360
+ | SPDX | the licence identifiers of the packages | as it is |
361
+ | Semantic Versioning | the versions of the CLI (#1) | as it is |
362
+
363
+ 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.