iterate-kernel 0.1.4 → 0.1.6
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/README.md +16 -7
- package/dist/convergence.d.ts +90 -0
- package/dist/convergence.d.ts.map +1 -0
- package/dist/convergence.js +97 -0
- package/dist/convergence.js.map +1 -0
- package/dist/decision-log-entry.d.ts +46 -0
- package/dist/decision-log-entry.d.ts.map +1 -1
- package/dist/decision-log-entry.js +44 -1
- package/dist/decision-log-entry.js.map +1 -1
- package/dist/decision-log-transcribe.d.ts +77 -0
- package/dist/decision-log-transcribe.d.ts.map +1 -0
- package/dist/decision-log-transcribe.js +200 -0
- package/dist/decision-log-transcribe.js.map +1 -0
- package/dist/decision-log.d.ts +16 -0
- package/dist/decision-log.d.ts.map +1 -1
- package/dist/decision-log.js +12 -0
- package/dist/decision-log.js.map +1 -1
- package/dist/dimension-context.d.ts +10 -10
- package/dist/errors.d.ts +15 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -1
- package/dist/evidence-pack.d.ts +38 -38
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/invariant-report.d.ts +271 -0
- package/dist/invariant-report.d.ts.map +1 -0
- package/dist/invariant-report.js +145 -0
- package/dist/invariant-report.js.map +1 -0
- package/dist/parse.d.ts +7 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +18 -10
- package/dist/parse.js.map +1 -1
- package/dist/provider-registration.d.ts +132 -0
- package/dist/provider-registration.d.ts.map +1 -0
- package/dist/provider-registration.js +119 -0
- package/dist/provider-registration.js.map +1 -0
- package/dist/schemas.d.ts +8 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +8 -0
- package/dist/schemas.js.map +1 -1
- package/fixtures/convergence.ok-01.json +252 -0
- package/fixtures/decision-log-entry.ok-02.json +20 -0
- package/fixtures/decision-record-transcription.ok-01.json +260 -0
- package/fixtures/invariant-report.ok-01.json +306 -0
- package/fixtures/provider-registration.ok-01.json +309 -0
- package/fixtures/run-plan.ok-01.json +1 -1
- package/package.json +17 -1
- package/schemas/convergence-round-state.schema.json +37 -0
- package/schemas/decision-log-entry.schema.json +20 -0
- package/schemas/invariant-report.schema.json +108 -0
- package/schemas/provider-registration.schema.json +63 -0
- package/schemas/reverification-request.schema.json +89 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comment": "Cross-implementation anchor for the provider-registration contract (kernel/src/provider-registration.ts): how a judgement producer says what it offers, so both harnesses consume the same provider through the same shape (5.7 R40 scenario 5). Rules a second implementation must reproduce, stated here so it need not read the TypeScript: (1) schemaVersion is exactly `iterate.provider/0.1`. (2) Required: `id` and `kind` and `version` and `methods`. `id` matches `^[a-z0-9]+(?:-[a-z0-9]+)*$` and is <=64 chars; `kind` is `ae-diagnosis|report-render|evidence-source`; `version` is 1..64 chars; `origin` is optional and one of `kernel|glasspane|iterate|plugin`. (3) `methods` is 1..32 entries, each with a required `name` (same kebab pattern, <=64) and a required `requires` array (0..16 entries, same kebab pattern, <=64 each). An empty `requires` is a claim the provider makes — 'this needs nothing' — not an absence. (4) A method name repeated inside one registration is refused, not collapsed: the two declarations can carry different prerequisites, and last-write-wins would let a provider offer a method under prerequisites nobody agreed to. JSON Schema cannot express name-level uniqueness (`uniqueItems` compares whole objects), so the case named `duplicate-method-differs-only-by-requires` below is the documented shape where the published schema accepts and the validator refuses. (5) REGISTRY SEMANTICS, which are functions rather than schema features: registering an id already present is refused rather than overwriting it (a silent override means one product runs a provider the other never saw); resolution is exact — no default provider, no fuzzy match, no 'the only one registered'; asking a provider for a method it does not offer is refused and the error names what it does offer; a registry is replaced whole on each registration, never mutated, so a half-applied registration cannot leave one map with the provider and the next without it. (6) What two harnesses must not do is let the same id mean two different things across the boundary, so the ids in common between two registries are a question to settle before a run, not during one. PROVENANCE: the diagnosis classes and the prerequisite names are the evidence-pack contract's own vocabulary (`DiagnosisClassSchema` values T0..T9/NO_ANOMALY/INCONCLUSIVE, and `SignalsSchema` keys axEvent/handlerProbe/stateDiff/pixelDiff/responsiveness/crash rendered in kebab case) — a provider that requires `pixel-diff` is requiring the signal an evidence pack actually carries. `glasspane-engine` is the engine that produces those packs, and the report-render provider is the engine's markdown/HTML report (the two renderings shipped as `report.ok-01.md` and `report.ok-01.html` in this same corpus). The version strings are the package/engine versions at the time of writing, not placeholders.",
|
|
3
|
+
"input": {
|
|
4
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
5
|
+
"id": "glasspane-engine-ae",
|
|
6
|
+
"kind": "ae-diagnosis",
|
|
7
|
+
"version": "1.11.0",
|
|
8
|
+
"origin": "glasspane",
|
|
9
|
+
"methods": [
|
|
10
|
+
{
|
|
11
|
+
"name": "diagnose",
|
|
12
|
+
"requires": ["ax-event", "attribution", "circuit-breaker"]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "diagnose-pixel",
|
|
16
|
+
"requires": ["ax-event", "pixel-diff", "attribution", "circuit-breaker"]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "diagnose-probed",
|
|
20
|
+
"requires": ["ax-event", "handler-probe", "state-diff", "attribution"]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"expectedMethods": ["diagnose", "diagnose-pixel", "diagnose-probed"],
|
|
25
|
+
"cases": [
|
|
26
|
+
{
|
|
27
|
+
"name": "duplicate-method-differs-only-by-requires",
|
|
28
|
+
"input": {
|
|
29
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
30
|
+
"id": "glasspane-engine-ae",
|
|
31
|
+
"kind": "ae-diagnosis",
|
|
32
|
+
"version": "1.11.0",
|
|
33
|
+
"methods": [
|
|
34
|
+
{
|
|
35
|
+
"name": "diagnose",
|
|
36
|
+
"requires": []
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "diagnose",
|
|
40
|
+
"requires": ["pixel-diff"]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"expect": "refused",
|
|
45
|
+
"path": "methods.1.name",
|
|
46
|
+
"jsonSchemaAccepts": true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "uppercase-id",
|
|
50
|
+
"input": {
|
|
51
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
52
|
+
"id": "GlasspaneEngine",
|
|
53
|
+
"kind": "ae-diagnosis",
|
|
54
|
+
"version": "1.11.0",
|
|
55
|
+
"methods": [
|
|
56
|
+
{
|
|
57
|
+
"name": "diagnose",
|
|
58
|
+
"requires": []
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"expect": "refused",
|
|
63
|
+
"path": "id"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "unknown-kind",
|
|
67
|
+
"input": {
|
|
68
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
69
|
+
"id": "glasspane-engine-ae",
|
|
70
|
+
"kind": "vibes",
|
|
71
|
+
"version": "1.11.0",
|
|
72
|
+
"methods": [
|
|
73
|
+
{
|
|
74
|
+
"name": "diagnose",
|
|
75
|
+
"requires": []
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"expect": "refused",
|
|
80
|
+
"path": "kind"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "no-methods",
|
|
84
|
+
"input": {
|
|
85
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
86
|
+
"id": "glasspane-engine-ae",
|
|
87
|
+
"kind": "ae-diagnosis",
|
|
88
|
+
"version": "1.11.0",
|
|
89
|
+
"methods": []
|
|
90
|
+
},
|
|
91
|
+
"expect": "refused",
|
|
92
|
+
"path": "methods"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "empty-version",
|
|
96
|
+
"input": {
|
|
97
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
98
|
+
"id": "glasspane-engine-ae",
|
|
99
|
+
"kind": "ae-diagnosis",
|
|
100
|
+
"version": "",
|
|
101
|
+
"methods": [
|
|
102
|
+
{
|
|
103
|
+
"name": "diagnose",
|
|
104
|
+
"requires": []
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"expect": "refused",
|
|
109
|
+
"path": "version"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "method-without-requires",
|
|
113
|
+
"input": {
|
|
114
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
115
|
+
"id": "iterate-report-render",
|
|
116
|
+
"kind": "report-render",
|
|
117
|
+
"version": "0.1.4",
|
|
118
|
+
"origin": "iterate",
|
|
119
|
+
"methods": [
|
|
120
|
+
{
|
|
121
|
+
"name": "render-markdown"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"expect": "refused",
|
|
126
|
+
"path": "methods.0.requires"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"name": "uppercase-requires-name",
|
|
130
|
+
"input": {
|
|
131
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
132
|
+
"id": "iterate-report-render",
|
|
133
|
+
"kind": "report-render",
|
|
134
|
+
"version": "0.1.4",
|
|
135
|
+
"methods": [
|
|
136
|
+
{
|
|
137
|
+
"name": "render-markdown",
|
|
138
|
+
"requires": ["SSH"]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"expect": "refused",
|
|
143
|
+
"path": "methods.0.requires.0"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "extra-top-level-key",
|
|
147
|
+
"input": {
|
|
148
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
149
|
+
"id": "glasspane-engine-ae",
|
|
150
|
+
"kind": "ae-diagnosis",
|
|
151
|
+
"version": "1.11.0",
|
|
152
|
+
"methods": [
|
|
153
|
+
{
|
|
154
|
+
"name": "diagnose",
|
|
155
|
+
"requires": []
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"default": true
|
|
159
|
+
},
|
|
160
|
+
"expect": "refused",
|
|
161
|
+
"path": "",
|
|
162
|
+
"messageIncludes": "default"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "no-origin",
|
|
166
|
+
"input": {
|
|
167
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
168
|
+
"id": "iterate-report-render",
|
|
169
|
+
"kind": "report-render",
|
|
170
|
+
"version": "0.1.4",
|
|
171
|
+
"methods": [
|
|
172
|
+
{
|
|
173
|
+
"name": "render-markdown",
|
|
174
|
+
"requires": ["decision-log"]
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "render-html",
|
|
178
|
+
"requires": ["decision-log", "evidence-pack"]
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"expect": "accepted"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"registry": {
|
|
186
|
+
"note": "The registry half of the contract is functions, and its cases are in kernel/test/provider-registration.test.mjs. What is pinned here is the two-harness shape: one registry per consumer, ids that must not silently mean different things, and a resolution that refuses rather than guessing.",
|
|
187
|
+
"glasspane": [
|
|
188
|
+
{
|
|
189
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
190
|
+
"id": "glasspane-engine-ae",
|
|
191
|
+
"kind": "ae-diagnosis",
|
|
192
|
+
"version": "1.11.0",
|
|
193
|
+
"origin": "glasspane",
|
|
194
|
+
"methods": [
|
|
195
|
+
{
|
|
196
|
+
"name": "diagnose",
|
|
197
|
+
"requires": ["ax-event", "attribution", "circuit-breaker"]
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
203
|
+
"id": "glasspane-evidence",
|
|
204
|
+
"kind": "evidence-source",
|
|
205
|
+
"version": "1.11.0",
|
|
206
|
+
"origin": "glasspane",
|
|
207
|
+
"methods": [
|
|
208
|
+
{
|
|
209
|
+
"name": "capture",
|
|
210
|
+
"requires": ["ax-tree"]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"name": "last-evidence",
|
|
214
|
+
"requires": []
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"iterate": [
|
|
220
|
+
{
|
|
221
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
222
|
+
"id": "iterate-report-render",
|
|
223
|
+
"kind": "report-render",
|
|
224
|
+
"version": "0.1.4",
|
|
225
|
+
"origin": "iterate",
|
|
226
|
+
"methods": [
|
|
227
|
+
{
|
|
228
|
+
"name": "render-markdown",
|
|
229
|
+
"requires": ["decision-log"]
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
235
|
+
"id": "iterate-engine-ae",
|
|
236
|
+
"kind": "ae-diagnosis",
|
|
237
|
+
"version": "0.1.4",
|
|
238
|
+
"origin": "iterate",
|
|
239
|
+
"methods": [
|
|
240
|
+
{
|
|
241
|
+
"name": "diagnose",
|
|
242
|
+
"requires": ["evidence-pack"]
|
|
243
|
+
}
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
],
|
|
247
|
+
"idsInCommon": [],
|
|
248
|
+
"collision": {
|
|
249
|
+
"note": "What must be caught before a run: the same id offered by both sides. `glasspane-ae` means two different diagnoses here — one requiring the AX event stream, one requiring an evidence pack — so 'the AE provider' would name a different judgement in each product while both looked satisfied. `providerIdsInCommon` returns exactly the ids to settle, and the answer is a rename or one registry, never 'whichever map was consulted first'.",
|
|
250
|
+
"a": [
|
|
251
|
+
{
|
|
252
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
253
|
+
"id": "glasspane-ae",
|
|
254
|
+
"kind": "ae-diagnosis",
|
|
255
|
+
"version": "1.11.0",
|
|
256
|
+
"origin": "glasspane",
|
|
257
|
+
"methods": [
|
|
258
|
+
{
|
|
259
|
+
"name": "diagnose",
|
|
260
|
+
"requires": ["ax-event"]
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
266
|
+
"id": "shared-render",
|
|
267
|
+
"kind": "report-render",
|
|
268
|
+
"version": "1.11.0",
|
|
269
|
+
"origin": "glasspane",
|
|
270
|
+
"methods": [
|
|
271
|
+
{
|
|
272
|
+
"name": "render-markdown",
|
|
273
|
+
"requires": []
|
|
274
|
+
}
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
],
|
|
278
|
+
"b": [
|
|
279
|
+
{
|
|
280
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
281
|
+
"id": "glasspane-ae",
|
|
282
|
+
"kind": "ae-diagnosis",
|
|
283
|
+
"version": "0.1.4",
|
|
284
|
+
"origin": "iterate",
|
|
285
|
+
"methods": [
|
|
286
|
+
{
|
|
287
|
+
"name": "diagnose",
|
|
288
|
+
"requires": ["evidence-pack"]
|
|
289
|
+
}
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"schemaVersion": "iterate.provider/0.1",
|
|
294
|
+
"id": "shared-render",
|
|
295
|
+
"kind": "report-render",
|
|
296
|
+
"version": "0.1.4",
|
|
297
|
+
"origin": "iterate",
|
|
298
|
+
"methods": [
|
|
299
|
+
{
|
|
300
|
+
"name": "render-markdown",
|
|
301
|
+
"requires": []
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"expect": ["glasspane-ae", "shared-render"]
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"comment": "Cross-implementation anchor for the run-plan contract (kernel/src/run-plan.ts): what a plan is, and how to digest one so two shells and a ledger can say 'this run was held to this plan'. Rules a second implementation must reproduce, stated here so it need not read the TypeScript: (1) schemaVersion is exactly `iterate.run-plan/0.1`. (2) `dimensions` is 1..64 entries, each an object with a required `id` matching `^[a-z0-9]+(?:-[a-z0-9]+)*$` and at most 64 chars, and optional `label` (<=256) and `focus` (<=4096); no other keys. An empty plan is refused: a run with nothing to verify has a configuration problem, and reporting 0/0 dimensions as success is how that gets hidden. (3) Planned order is the caller's and is never sorted. (4) A repeated id is refused, not collapsed — the two entries can carry different focus, so collapsing picks one silently. JSON Schema cannot express id-level uniqueness (`uniqueItems` compares whole objects), so that rule lives on the validator side; the case named `duplicate-ids-differ-only-by-focus` below is the documented shape where the published schema accepts and the validator refuses. (5) `source`, when present, has a required `kind` in `config|recipe|session|manual` and an optional non-empty `name` <=512; nothing here reads a config file to invent a source. (6) The digest is `rp_` + sha256 of the canonical JSON form: UTF-16-code-unit-sorted keys, no insignificant whitespace, arrays in order, strings as JSON escapes them; numbers use the host's shortest roundtrip form, which is why none appear in this fixture — that concern is pinned by the canonical-JSON cases in the C35 suite instead. Provenance: the nine ids and both focus strings are taken verbatim from GlassPane's own iterate.config.yaml (`dimensions:` and `dimension_sets.engine|gui.focus`), because a vocabulary invented for a fixture would let both sides agree on something neither product uses.",
|
|
2
|
+
"comment": "Cross-implementation anchor for the run-plan contract (kernel/src/run-plan.ts): what a plan is, and how to digest one so two shells and a ledger can say 'this run was held to this plan'. Rules a second implementation must reproduce, stated here so it need not read the TypeScript: (1) schemaVersion is exactly `iterate.run-plan/0.1`. (2) `dimensions` is 1..64 entries, each an object with a required `id` matching `^[a-z0-9]+(?:-[a-z0-9]+)*$` and at most 64 chars, and optional `label` (<=256) and `focus` (<=4096); no other keys. An empty plan is refused: a run with nothing to verify has a configuration problem, and reporting 0/0 dimensions as success is how that gets hidden. (3) Planned order is the caller's and is never sorted. (4) A repeated id is refused, not collapsed — the two entries can carry different focus, so collapsing picks one silently. JSON Schema cannot express id-level uniqueness (`uniqueItems` compares whole objects), so that rule lives on the validator side; the case named `duplicate-ids-differ-only-by-focus` below is the documented shape where the published schema accepts and the validator refuses. (5) `source`, when present, has a required `kind` in `config|recipe|session|manual` and an optional non-empty `name` <=512; nothing here reads a config file to invent a source. (6) The digest is `rp_` + sha256 of the canonical JSON form: UTF-16-code-unit-sorted keys, no insignificant whitespace, arrays in order, strings as JSON escapes them; numbers use the host's shortest roundtrip form, which is why none appear in this fixture — that concern is pinned by the canonical-JSON cases in the C35 suite instead. Provenance: the nine ids and both focus strings are taken verbatim from GlassPane's own iterate.config.yaml (`dimensions:` and `dimension_sets.engine|gui.focus`), because a vocabulary invented for a fixture would let both sides agree on something neither product uses. The one `label` value is NOT from that config — it has no label vocabulary at all — and is written here to pin that a label is accepted, is optional, and is part of the digest; treat that string as fixture vocabulary, not as a name either product displays.",
|
|
3
3
|
"input": {
|
|
4
4
|
"schemaVersion": "iterate.run-plan/0.1",
|
|
5
5
|
"dimensions": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iterate-kernel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "iterate ecosystem shared kernel: schemas, the evidence->decision transcription, the decision-log audit chain and public validators. Verification reasoning stays in the engine; this layer transcribes.",
|
|
6
6
|
"type": "module",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"types": "./dist/canonical-json.d.ts",
|
|
15
15
|
"default": "./dist/canonical-json.js"
|
|
16
16
|
},
|
|
17
|
+
"./convergence": {
|
|
18
|
+
"types": "./dist/convergence.d.ts",
|
|
19
|
+
"default": "./dist/convergence.js"
|
|
20
|
+
},
|
|
17
21
|
"./decision-log": {
|
|
18
22
|
"types": "./dist/decision-log.d.ts",
|
|
19
23
|
"default": "./dist/decision-log.js"
|
|
@@ -22,6 +26,10 @@
|
|
|
22
26
|
"types": "./dist/decision-log-entry.d.ts",
|
|
23
27
|
"default": "./dist/decision-log-entry.js"
|
|
24
28
|
},
|
|
29
|
+
"./decision-log-transcribe": {
|
|
30
|
+
"types": "./dist/decision-log-transcribe.d.ts",
|
|
31
|
+
"default": "./dist/decision-log-transcribe.js"
|
|
32
|
+
},
|
|
25
33
|
"./dimension-context": {
|
|
26
34
|
"types": "./dist/dimension-context.d.ts",
|
|
27
35
|
"default": "./dist/dimension-context.js"
|
|
@@ -42,10 +50,18 @@
|
|
|
42
50
|
"types": "./dist/index.d.ts",
|
|
43
51
|
"default": "./dist/index.js"
|
|
44
52
|
},
|
|
53
|
+
"./invariant-report": {
|
|
54
|
+
"types": "./dist/invariant-report.d.ts",
|
|
55
|
+
"default": "./dist/invariant-report.js"
|
|
56
|
+
},
|
|
45
57
|
"./parse": {
|
|
46
58
|
"types": "./dist/parse.d.ts",
|
|
47
59
|
"default": "./dist/parse.js"
|
|
48
60
|
},
|
|
61
|
+
"./provider-registration": {
|
|
62
|
+
"types": "./dist/provider-registration.d.ts",
|
|
63
|
+
"default": "./dist/provider-registration.js"
|
|
64
|
+
},
|
|
49
65
|
"./recipe-config": {
|
|
50
66
|
"types": "./dist/recipe-config.d.ts",
|
|
51
67
|
"default": "./dist/recipe-config.js"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.iterate.dev/convergence-round-state-0.1.json",
|
|
4
|
+
"title": "ConvergenceRoundState",
|
|
5
|
+
"description": "What a caller states about the round that just finished, which the convergence rules turn into an action (5.7 R40 scenario 4). Every field is a verdict somebody else produced; this contract moves none of them. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/convergence.ts`, which is the definition; this file mirrors it. The ordering that decides which verdict wins (breaker, then budget, then errored check, then findings, then evidence, then invariants, then converged) is arithmetic in the validator and cannot be expressed in JSON Schema — a schema-only implementation must re-implement `convergenceDecision` and be tested against the cases in `fixtures/convergence.ok-01.json`.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["round", "maxRounds", "invariantState", "openFindings", "evidenceComplete", "breakerLevel"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": "iterate.convergence/0.1"
|
|
12
|
+
},
|
|
13
|
+
"round": {
|
|
14
|
+
"type": "integer",
|
|
15
|
+
"minimum": 1
|
|
16
|
+
},
|
|
17
|
+
"maxRounds": {
|
|
18
|
+
"type": "integer",
|
|
19
|
+
"minimum": 1
|
|
20
|
+
},
|
|
21
|
+
"invariantState": {
|
|
22
|
+
"enum": ["pass", "fail", "error", "unmeasured"]
|
|
23
|
+
},
|
|
24
|
+
"openFindings": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 0
|
|
27
|
+
},
|
|
28
|
+
"evidenceComplete": {
|
|
29
|
+
"type": "boolean"
|
|
30
|
+
},
|
|
31
|
+
"breakerLevel": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 0,
|
|
34
|
+
"maximum": 3
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -40,6 +40,26 @@
|
|
|
40
40
|
"createdAt": {
|
|
41
41
|
"type": "string",
|
|
42
42
|
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
|
|
43
|
+
},
|
|
44
|
+
"kind": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"pattern": "^[a-z][a-z0-9_]{0,31}$",
|
|
47
|
+
"description": "What sort of decision this line records, in the recording ecosystem's own vocabulary (iterate uses round_start / review_result / atomic_fix / …, the GlassPane fork records tool executions). Deliberately NOT an enum: the kernel does not own either vocabulary, and enumerating them would make every new producer kind a kernel release. See the module doc in src/decision-log-entry.ts."
|
|
48
|
+
},
|
|
49
|
+
"round": {
|
|
50
|
+
"type": "integer",
|
|
51
|
+
"minimum": 0,
|
|
52
|
+
"description": "Loop position the decision belongs to, when the producer counts rounds. Optional because a one-off tool execution is not part of a round."
|
|
53
|
+
},
|
|
54
|
+
"dimension": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
57
|
+
"maxLength": 64,
|
|
58
|
+
"description": "The dimension this decision was serving, using the same id rule as dimension-context (DIMENSION_ID_PATTERN / DIMENSION_ID_MAX_LENGTH, imported not restated). This is what lets a recorded decision count toward 'N/M dimensions verified' from either ecosystem."
|
|
59
|
+
},
|
|
60
|
+
"payload": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"description": "Structured detail carried alongside the human-readable summary — the field the legacy 'data' object maps onto. NOTE A BOUND THE SCHEMA CANNOT STATE: the canonical-JSON form of this object is limited to PAYLOAD_MAX_CANONICAL_LENGTH (8192) characters by the TypeScript validator and the Python port, because an unbounded field in a hash-chained ledger lets a line's bytes and digest grow without limit. JSON Schema has no way to bound serialized length, so this is a documented divergence, pinned as a named case in kernel/test/decision-log-entry.test.mjs rather than silently allowed."
|
|
43
63
|
}
|
|
44
64
|
}
|
|
45
65
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.iterate.dev/invariant-report-0.1.json",
|
|
4
|
+
"title": "InvariantReport",
|
|
5
|
+
"description": "What the invariant runner observed when it checked a recipe's invariants (5.7 R40 scenario 1: the failure that has to reach the other harness). Whoever runs the checks produces this; whoever decides whether to re-verify reads it. A check kind of `refused` means the runner declined to execute a configured command because it carries shell metacharacters or is empty — it is a violation, so a report whose only failing check was refused is `fail`, never `error`. NOTE ON SOURCE OF TRUTH: the check-name and detail constraints are duplicated from `src/invariant-report.ts`, which is the definition; this file mirrors it. The outcome-vs-checks rule IS expressible here and is expressed twice on purpose: the `allOf` branches below and the zod `superRefine` must refuse the same reports, so a second implementation that only validates JSON Schema still cannot carry a pass over a failed check.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "outcome", "checks"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": "iterate.invariant-report/0.1"
|
|
12
|
+
},
|
|
13
|
+
"outcome": {
|
|
14
|
+
"enum": ["pass", "fail", "error"]
|
|
15
|
+
},
|
|
16
|
+
"checks": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"minItems": 1,
|
|
19
|
+
"maxItems": 256,
|
|
20
|
+
"items": {
|
|
21
|
+
"$ref": "#/$defs/invariantCheck"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"round": {
|
|
25
|
+
"type": "integer",
|
|
26
|
+
"minimum": 1
|
|
27
|
+
},
|
|
28
|
+
"durationMs": {
|
|
29
|
+
"type": "integer",
|
|
30
|
+
"minimum": 0
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"allOf": [
|
|
34
|
+
{
|
|
35
|
+
"if": {
|
|
36
|
+
"properties": {
|
|
37
|
+
"outcome": {
|
|
38
|
+
"const": "pass"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": ["outcome"]
|
|
42
|
+
},
|
|
43
|
+
"then": {
|
|
44
|
+
"properties": {
|
|
45
|
+
"checks": {
|
|
46
|
+
"items": {
|
|
47
|
+
"properties": {
|
|
48
|
+
"ok": {
|
|
49
|
+
"const": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"required": ["ok"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"if": {
|
|
60
|
+
"properties": {
|
|
61
|
+
"outcome": {
|
|
62
|
+
"const": "fail"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": ["outcome"]
|
|
66
|
+
},
|
|
67
|
+
"then": {
|
|
68
|
+
"properties": {
|
|
69
|
+
"checks": {
|
|
70
|
+
"contains": {
|
|
71
|
+
"properties": {
|
|
72
|
+
"ok": {
|
|
73
|
+
"const": false
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"required": ["ok"]
|
|
77
|
+
},
|
|
78
|
+
"minContains": 1
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"$defs": {
|
|
85
|
+
"invariantCheck": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"required": ["name", "kind", "ok"],
|
|
89
|
+
"properties": {
|
|
90
|
+
"name": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"minLength": 1,
|
|
93
|
+
"maxLength": 256
|
|
94
|
+
},
|
|
95
|
+
"kind": {
|
|
96
|
+
"enum": ["ensure", "command", "refused"]
|
|
97
|
+
},
|
|
98
|
+
"ok": {
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
},
|
|
101
|
+
"detail": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"maxLength": 4096
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.iterate.dev/provider-registration-0.1.json",
|
|
4
|
+
"title": "ProviderRegistration",
|
|
5
|
+
"description": "Metadata for one judgement producer, so both harnesses can consume the same provider through the same shape (5.7 R40 scenario 5). It declares who provides what and what they need; it never carries a judgement, which stays in the engine and the reviewers. NOTE ON SOURCE OF TRUTH: the field constraints are duplicated from `src/provider-registration.ts`, which is the definition; this file mirrors it. METHOD-LEVEL UNIQUENESS IS ENFORCED BY ZOD ONLY: `uniqueItems` compares whole objects, so two methods with the same name but different `requires` pass this schema and are refused by `ProviderRegistrationSchema`. The registry semantics (refusing to overwrite an id, no default provider, no fuzzy resolve) are functions in the validator, not schema features.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "id", "kind", "version", "methods"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": "iterate.provider/0.1"
|
|
12
|
+
},
|
|
13
|
+
"id": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
16
|
+
"maxLength": 64
|
|
17
|
+
},
|
|
18
|
+
"kind": {
|
|
19
|
+
"enum": ["ae-diagnosis", "report-render", "evidence-source"]
|
|
20
|
+
},
|
|
21
|
+
"version": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1,
|
|
24
|
+
"maxLength": 64
|
|
25
|
+
},
|
|
26
|
+
"origin": {
|
|
27
|
+
"enum": ["kernel", "glasspane", "iterate", "plugin"]
|
|
28
|
+
},
|
|
29
|
+
"methods": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"minItems": 1,
|
|
32
|
+
"maxItems": 32,
|
|
33
|
+
"uniqueItems": true,
|
|
34
|
+
"items": {
|
|
35
|
+
"$ref": "#/$defs/providerMethod"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"$defs": {
|
|
40
|
+
"providerMethod": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["name", "requires"],
|
|
44
|
+
"properties": {
|
|
45
|
+
"name": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
48
|
+
"maxLength": 64
|
|
49
|
+
},
|
|
50
|
+
"requires": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"maxItems": 16,
|
|
53
|
+
"uniqueItems": true,
|
|
54
|
+
"items": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
|
|
57
|
+
"maxLength": 64
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|