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,260 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comment": "Cross-implementation anchor for kernel/src/decision-log-transcribe.ts: how a decision record that the iterate ledgers ALREADY write maps onto the canonical ledger draft (5.8 R40 scenario 3, the 'three formats, one shape' convergence). A second implementation (the Python port in iterate-harness) is coded from this file, not from the TypeScript. Rules: (1) the record is an object with exactly the keys timestamp/round/type/data; an unknown key is REFUSED, never dropped. (2) type -> kind verbatim and must match ^[a-z][a-z0-9_]{0,31}$; no case folding, no renaming. (3) round is copied and must be an integer >= 0; data -> payload in full, and the canonical-JSON length of payload must stay <= 8192 characters. (4) createdAt is timestamp normalized to ISO-8601 UTC milliseconds ('Z', 3 digits). The INPUT must match ^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?(Z|\\+\\-[0-9]{2}:[0-9]{2})$ -- an explicit zone is required, any offset converts to UTC, and fractional seconds TRUNCATE toward zero (drop the tail, never round up). Anything else is refused, including host-guessable spellings like 11/10/2026 02:28: one runtime reads those as US month/day and another refuses them, and a ledger whose dates depend on which runtime converted it is not evidence. (5) outcome is READ, never inferred from tone: data.outcome then data.status when one of pass|fail|blocked|inconclusive; else data.passed===true -> pass, data.passed===false -> fail; else inconclusive. (6) summary is the record's own sentence, first present and non-blank of data.summary, data.message, data.reason; when it carries none the label is `<kind> (round <round>)` (or just `<kind>` when round is absent) -- a label, not a claim; a sentence over SUMMARY_MAX_LENGTH=2048 is refused rather than truncated. (7) dimension is data.dimension when it matches ^[a-z0-9]+(?:-[a-z0-9]+)*$ and is <= 64 chars, otherwise ABSENT -- never substituted by kind or method name. (8) operationId is data.operationId when it matches ^op_[0-9A-HJKMNP-TV-Z]{26}$, otherwise absent. (9) entryId is supplied by the caller (ledger-owned randomness), which is why this fixture pins a literal id per case: a transcription that minted ids could not be compared across implementations. (10) SIZE-CASE EXPANSION, so no 9 KB literals clutter this file: when a case carries `blobRepeat: N`, set record.data[ case.blobKey ?? 'blob' ] to N repetitions of 'x' BEFORE transcribing; when it carries `summaryRepeat: N`, set record.data.summary to N repetitions of 's'. Expectations otherwise compare field by field; an absent field in `expect` must be absent from the result, not null.",
|
|
3
|
+
"cases": [
|
|
4
|
+
{
|
|
5
|
+
"id": "review-result-full",
|
|
6
|
+
"record": {
|
|
7
|
+
"timestamp": "2026-10-11T02:28:11.042345+00:00",
|
|
8
|
+
"round": 3,
|
|
9
|
+
"type": "review_result",
|
|
10
|
+
"data": {
|
|
11
|
+
"summary": "round 3 review: 2 findings, 1 blocking, across 2 dimensions",
|
|
12
|
+
"outcome": "fail",
|
|
13
|
+
"dimension": "ui-consistency",
|
|
14
|
+
"operationId": "op_0123456789ABCDEFGHJKMNPQRT",
|
|
15
|
+
"findings": [
|
|
16
|
+
{
|
|
17
|
+
"dimension": "ui-consistency",
|
|
18
|
+
"file": "src/client/index.ts",
|
|
19
|
+
"severity": "medium",
|
|
20
|
+
"summary": "hard-coded colour outside the token set"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"dimension": "accessibility",
|
|
24
|
+
"file": "src/client/index.ts",
|
|
25
|
+
"severity": "blocking",
|
|
26
|
+
"summary": "focus ring removed"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
32
|
+
"expect": {
|
|
33
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
34
|
+
"summary": "round 3 review: 2 findings, 1 blocking, across 2 dimensions",
|
|
35
|
+
"outcome": "fail",
|
|
36
|
+
"createdAt": "2026-10-11T02:28:11.042Z",
|
|
37
|
+
"kind": "review_result",
|
|
38
|
+
"round": 3,
|
|
39
|
+
"dimension": "ui-consistency",
|
|
40
|
+
"operationId": "op_0123456789ABCDEFGHJKMNPQRT",
|
|
41
|
+
"payload": {
|
|
42
|
+
"summary": "round 3 review: 2 findings, 1 blocking, across 2 dimensions",
|
|
43
|
+
"outcome": "fail",
|
|
44
|
+
"dimension": "ui-consistency",
|
|
45
|
+
"operationId": "op_0123456789ABCDEFGHJKMNPQRT",
|
|
46
|
+
"findings": [
|
|
47
|
+
{
|
|
48
|
+
"dimension": "ui-consistency",
|
|
49
|
+
"file": "src/client/index.ts",
|
|
50
|
+
"severity": "medium",
|
|
51
|
+
"summary": "hard-coded colour outside the token set"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"dimension": "accessibility",
|
|
55
|
+
"file": "src/client/index.ts",
|
|
56
|
+
"severity": "blocking",
|
|
57
|
+
"summary": "focus ring removed"
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "cst-timestamp-normalizes-to-utc-millis",
|
|
65
|
+
"record": {
|
|
66
|
+
"timestamp": "2026-10-11T10:28:11.042+08:00",
|
|
67
|
+
"round": 7,
|
|
68
|
+
"type": "validation",
|
|
69
|
+
"data": {
|
|
70
|
+
"passed": true,
|
|
71
|
+
"command": "pytest -q"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
75
|
+
"expect": {
|
|
76
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
77
|
+
"summary": "validation (round 7)",
|
|
78
|
+
"outcome": "pass",
|
|
79
|
+
"createdAt": "2026-10-11T02:28:11.042Z",
|
|
80
|
+
"kind": "validation",
|
|
81
|
+
"round": 7,
|
|
82
|
+
"payload": {
|
|
83
|
+
"passed": true,
|
|
84
|
+
"command": "pytest -q"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "passed-false-is-fail-not-inconclusive",
|
|
90
|
+
"record": {
|
|
91
|
+
"timestamp": "2026-10-11T02:28:11.999Z",
|
|
92
|
+
"round": 1,
|
|
93
|
+
"type": "atomic_fix",
|
|
94
|
+
"data": {
|
|
95
|
+
"passed": false,
|
|
96
|
+
"message": "guard post-check still red",
|
|
97
|
+
"status": "error"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
101
|
+
"expect": {
|
|
102
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
103
|
+
"summary": "guard post-check still red",
|
|
104
|
+
"outcome": "fail",
|
|
105
|
+
"createdAt": "2026-10-11T02:28:11.999Z",
|
|
106
|
+
"kind": "atomic_fix",
|
|
107
|
+
"round": 1,
|
|
108
|
+
"payload": {
|
|
109
|
+
"passed": false,
|
|
110
|
+
"message": "guard post-check still red",
|
|
111
|
+
"status": "error"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"id": "silent-record-stays-inconclusive",
|
|
117
|
+
"record": {
|
|
118
|
+
"timestamp": "2026-10-11T02:28:11.000Z",
|
|
119
|
+
"type": "decision",
|
|
120
|
+
"data": {
|
|
121
|
+
"note": "deferred architectural fix to round 4"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
125
|
+
"expect": {
|
|
126
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
127
|
+
"summary": "decision",
|
|
128
|
+
"outcome": "inconclusive",
|
|
129
|
+
"createdAt": "2026-10-11T02:28:11.000Z",
|
|
130
|
+
"kind": "decision",
|
|
131
|
+
"payload": {
|
|
132
|
+
"note": "deferred architectural fix to round 4"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "dimension-that-is-not-a-kernel-id-is-absent-not-guessed",
|
|
138
|
+
"record": {
|
|
139
|
+
"timestamp": "2026-10-11T02:28:11.000Z",
|
|
140
|
+
"round": 2,
|
|
141
|
+
"type": "report",
|
|
142
|
+
"data": {
|
|
143
|
+
"summary": "report for round 2",
|
|
144
|
+
"outcome": "pass",
|
|
145
|
+
"dimension": "UI Consistency"
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
149
|
+
"expect": {
|
|
150
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
151
|
+
"summary": "report for round 2",
|
|
152
|
+
"outcome": "pass",
|
|
153
|
+
"createdAt": "2026-10-11T02:28:11.000Z",
|
|
154
|
+
"kind": "report",
|
|
155
|
+
"round": 2,
|
|
156
|
+
"payload": {
|
|
157
|
+
"summary": "report for round 2",
|
|
158
|
+
"outcome": "pass",
|
|
159
|
+
"dimension": "UI Consistency"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "unknown-key-refuses",
|
|
165
|
+
"record": {
|
|
166
|
+
"timestamp": "2026-10-11T02:28:11.000Z",
|
|
167
|
+
"round": 1,
|
|
168
|
+
"type": "decision",
|
|
169
|
+
"author": "agent",
|
|
170
|
+
"data": {}
|
|
171
|
+
},
|
|
172
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
173
|
+
"expectError": "KERNEL_E_DECISION_RECORD"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "kind-needing-rewrite-refuses",
|
|
177
|
+
"record": {
|
|
178
|
+
"timestamp": "2026-10-11T02:28:11.000Z",
|
|
179
|
+
"round": 1,
|
|
180
|
+
"type": "Review Result",
|
|
181
|
+
"data": {}
|
|
182
|
+
},
|
|
183
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
184
|
+
"expectError": "KERNEL_E_DECISION_KIND"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "negative-round-refuses",
|
|
188
|
+
"record": {
|
|
189
|
+
"timestamp": "2026-10-11T02:28:11.000Z",
|
|
190
|
+
"round": -1,
|
|
191
|
+
"type": "decision",
|
|
192
|
+
"data": {}
|
|
193
|
+
},
|
|
194
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
195
|
+
"expectError": "KERNEL_E_DECISION_ROUND"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"id": "unparseable-timestamp-refuses",
|
|
199
|
+
"record": {
|
|
200
|
+
"timestamp": "11/10/2026 02:28",
|
|
201
|
+
"round": 1,
|
|
202
|
+
"type": "decision",
|
|
203
|
+
"data": {}
|
|
204
|
+
},
|
|
205
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
206
|
+
"expectError": "KERNEL_E_DECISION_TIMESTAMP"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "payload-over-the-bound-refuses",
|
|
210
|
+
"record": {
|
|
211
|
+
"timestamp": "2026-10-11T02:28:11.000Z",
|
|
212
|
+
"round": 1,
|
|
213
|
+
"type": "report",
|
|
214
|
+
"data": {
|
|
215
|
+
"blob": "x"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
219
|
+
"blobRepeat": 9000,
|
|
220
|
+
"blobKey": "blob",
|
|
221
|
+
"expectError": "KERNEL_E_DECISION_PAYLOAD"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"id": "sentence-over-summary-max-refuses",
|
|
225
|
+
"record": {
|
|
226
|
+
"timestamp": "2026-10-11T02:28:11.000Z",
|
|
227
|
+
"round": 1,
|
|
228
|
+
"type": "report",
|
|
229
|
+
"data": {
|
|
230
|
+
"summary": "s"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
234
|
+
"summaryRepeat": 2049,
|
|
235
|
+
"expectError": "KERNEL_E_DECISION_SUMMARY"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"id": "naive-local-timestamp-refuses",
|
|
239
|
+
"record": {
|
|
240
|
+
"timestamp": "11/10/2026 02:28",
|
|
241
|
+
"round": 1,
|
|
242
|
+
"type": "decision",
|
|
243
|
+
"data": {}
|
|
244
|
+
},
|
|
245
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
246
|
+
"expectError": "KERNEL_E_DECISION_TIMESTAMP"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"id": "zone-less-timestamp-refuses",
|
|
250
|
+
"record": {
|
|
251
|
+
"timestamp": "2026-10-11T02:28:11.042",
|
|
252
|
+
"round": 1,
|
|
253
|
+
"type": "decision",
|
|
254
|
+
"data": {}
|
|
255
|
+
},
|
|
256
|
+
"entryId": "dl_0123456789ABCDEFGHJKMNPQRT",
|
|
257
|
+
"expectError": "KERNEL_E_DECISION_TIMESTAMP"
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comment": "Cross-implementation anchor for the invariant-report contract (kernel/src/invariant-report.ts): what a run may state about its own invariant checks, and how to digest one so a re-verification can cite the failure it answers. Rules a second implementation must reproduce, stated here so it need not read the TypeScript: (1) schemaVersion is exactly `iterate.invariant-report/0.1`. (2) `outcome` is `pass|fail|error`. (3) `checks` is 1..256 entries, each an object with required `name` (1..256 chars), required `kind` in `ensure|command|refused`, required `ok` boolean, and optional `detail` (<=4096); no other keys. (4) THE ONE RULE THAT MATTERS: `outcome` must follow from `checks`. `pass` requires every check to have ok true. `fail` requires at least one check with ok false. `error` is unconstrained. A report that says pass over a failed check is refused by both validators — the JSON Schema expresses this with `allOf`/`if`/`then`/`contains`, so a schema-only consumer refuses it too. (5) `kind` `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`. `error` is reserved for checks that could not be evaluated at all, and it produces no re-verification request. (6) `round` (>=1) and `durationMs` (>=0) are optional integers. (7) The digest is `iv_` + 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 (integral values print without a fraction). (8) A re-verification request is `iterate.reverification/0.1` with `trigger.kind` exactly `invariant`, `trigger.reportDigest` matching `^iv_[0-9a-f]{64}$`, and `targets` carrying at least one of `recipeSteps` (1..64), `dimensions` (1..64 kebab-case ids <=64 chars), `operationIds` (1..64 matching `^op_[0-9A-HJKMNP-TV-Z]{26}$`); an empty target set is refused, by `anyOf` in the schema and by `superRefine` in the validator. PROVENANCE: every name, kind and detail string below was captured from `iterate_harness.defensive.invariants.check_invariants` running against the real repo — the ensure entries are the config's own `invariants.ensure` plus a file the run does not have, the command label is the real `<module>:<command>` format, the `exit 1 | ...` tail is real npm output truncated the way the runner truncates it (last three lines, joined by ' | '), and `python:ruff check src/ ; rm -rf /` is the metacharacter case the runner refuses with the exact string it uses. The runner records only violations plus a count, so the ok=true entries here are the configured check names minus the violating ones — that is how a producer derives `checks`, not an invention for this fixture.",
|
|
3
|
+
"input": {
|
|
4
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
5
|
+
"outcome": "fail",
|
|
6
|
+
"round": 3,
|
|
7
|
+
"durationMs": 917,
|
|
8
|
+
"checks": [
|
|
9
|
+
{
|
|
10
|
+
"name": "ensure:README.md",
|
|
11
|
+
"kind": "ensure",
|
|
12
|
+
"ok": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "ensure:iterate.config.yaml",
|
|
16
|
+
"kind": "ensure",
|
|
17
|
+
"ok": false,
|
|
18
|
+
"detail": "missing file: iterate.config.yaml"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "typescript:npm run compile",
|
|
22
|
+
"kind": "command",
|
|
23
|
+
"ok": false,
|
|
24
|
+
"detail": "exit 1 | npm error To see a list of scripts, run: | npm error npm run | npm error A complete log of this run can be found in: /Users/ethanlin/.npm/_logs/2026-10-11T01_07_36_468Z-debug-0.log"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "python:ruff check src/ ; rm -rf /",
|
|
28
|
+
"kind": "refused",
|
|
29
|
+
"ok": false,
|
|
30
|
+
"detail": "refused: unsafe command (shell metacharacter or empty)"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"expectedDigest": "iv_81373b5040663b9f56a4a0bc671ab55e0d92bc33e5980b5580f3e7cec5902332",
|
|
35
|
+
"expectedFailingChecks": [
|
|
36
|
+
"ensure:iterate.config.yaml",
|
|
37
|
+
"typescript:npm run compile",
|
|
38
|
+
"python:ruff check src/ ; rm -rf /"
|
|
39
|
+
],
|
|
40
|
+
"passInput": {
|
|
41
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
42
|
+
"outcome": "pass",
|
|
43
|
+
"round": 4,
|
|
44
|
+
"checks": [
|
|
45
|
+
{
|
|
46
|
+
"name": "ensure:README.md",
|
|
47
|
+
"kind": "ensure",
|
|
48
|
+
"ok": true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "typescript:npm run compile",
|
|
52
|
+
"kind": "command",
|
|
53
|
+
"ok": true
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"passDigest": "iv_2038dfde43106446a87212196d1e6738ed4cdd9c1a90d6d55f94429401e8e501",
|
|
58
|
+
"errorInput": {
|
|
59
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
60
|
+
"outcome": "error",
|
|
61
|
+
"checks": [
|
|
62
|
+
{
|
|
63
|
+
"name": "python:pytest tests/ -x -q --timeout=60",
|
|
64
|
+
"kind": "command",
|
|
65
|
+
"ok": false,
|
|
66
|
+
"detail": "not measured: the runner could not start (timeout=60 requires pytest-timeout)"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"errorDigest": "iv_7fe700d844d8c7ee60ce34220b55e6cbfca220d4aed27de0b22f091159c0c063",
|
|
71
|
+
"cases": [
|
|
72
|
+
{
|
|
73
|
+
"name": "pass-over-a-failed-check",
|
|
74
|
+
"input": {
|
|
75
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
76
|
+
"outcome": "pass",
|
|
77
|
+
"checks": [
|
|
78
|
+
{
|
|
79
|
+
"name": "ensure:README.md",
|
|
80
|
+
"kind": "ensure",
|
|
81
|
+
"ok": false,
|
|
82
|
+
"detail": "missing file: README.md"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"expect": "refused",
|
|
87
|
+
"path": "outcome"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "fail-with-every-check-ok",
|
|
91
|
+
"input": {
|
|
92
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
93
|
+
"outcome": "fail",
|
|
94
|
+
"checks": [
|
|
95
|
+
{
|
|
96
|
+
"name": "ensure:README.md",
|
|
97
|
+
"kind": "ensure",
|
|
98
|
+
"ok": true
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"expect": "refused",
|
|
103
|
+
"path": "outcome"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "no-checks",
|
|
107
|
+
"input": {
|
|
108
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
109
|
+
"outcome": "pass",
|
|
110
|
+
"checks": []
|
|
111
|
+
},
|
|
112
|
+
"expect": "refused",
|
|
113
|
+
"path": "checks"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "unknown-check-kind",
|
|
117
|
+
"input": {
|
|
118
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
119
|
+
"outcome": "fail",
|
|
120
|
+
"checks": [
|
|
121
|
+
{
|
|
122
|
+
"name": "ensure:README.md",
|
|
123
|
+
"kind": "vibes",
|
|
124
|
+
"ok": false
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"expect": "refused",
|
|
129
|
+
"path": "checks.0.kind"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "check-without-ok",
|
|
133
|
+
"input": {
|
|
134
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
135
|
+
"outcome": "fail",
|
|
136
|
+
"checks": [
|
|
137
|
+
{
|
|
138
|
+
"name": "ensure:README.md",
|
|
139
|
+
"kind": "ensure",
|
|
140
|
+
"detail": "missing file: README.md"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"expect": "refused",
|
|
145
|
+
"path": "checks.0.ok"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "invented-outcome",
|
|
149
|
+
"input": {
|
|
150
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
151
|
+
"outcome": "probably",
|
|
152
|
+
"checks": [
|
|
153
|
+
{
|
|
154
|
+
"name": "ensure:README.md",
|
|
155
|
+
"kind": "ensure",
|
|
156
|
+
"ok": true
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"expect": "refused",
|
|
161
|
+
"path": "outcome"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "extra-top-level-key",
|
|
165
|
+
"input": {
|
|
166
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
167
|
+
"outcome": "pass",
|
|
168
|
+
"checks": [
|
|
169
|
+
{
|
|
170
|
+
"name": "ensure:README.md",
|
|
171
|
+
"kind": "ensure",
|
|
172
|
+
"ok": true
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"note": "not part of the contract"
|
|
176
|
+
},
|
|
177
|
+
"expect": "refused",
|
|
178
|
+
"path": "",
|
|
179
|
+
"messageIncludes": "note"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "zero-round",
|
|
183
|
+
"input": {
|
|
184
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
185
|
+
"outcome": "pass",
|
|
186
|
+
"round": 0,
|
|
187
|
+
"checks": [
|
|
188
|
+
{
|
|
189
|
+
"name": "ensure:README.md",
|
|
190
|
+
"kind": "ensure",
|
|
191
|
+
"ok": true
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"expect": "refused",
|
|
196
|
+
"path": "round"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "error-report-is-accepted",
|
|
200
|
+
"input": {
|
|
201
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
202
|
+
"outcome": "error",
|
|
203
|
+
"checks": [
|
|
204
|
+
{
|
|
205
|
+
"name": "python:pytest tests/ -x -q --timeout=60",
|
|
206
|
+
"kind": "command",
|
|
207
|
+
"ok": false
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"expect": "accepted",
|
|
212
|
+
"digest": "iv_6d79b3b909a22c2185b11265ecf34ec04b6e7054530a96797f3dc02034ca2e2b"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "refused-command-only",
|
|
216
|
+
"input": {
|
|
217
|
+
"schemaVersion": "iterate.invariant-report/0.1",
|
|
218
|
+
"outcome": "fail",
|
|
219
|
+
"checks": [
|
|
220
|
+
{
|
|
221
|
+
"name": "ensure:README.md",
|
|
222
|
+
"kind": "ensure",
|
|
223
|
+
"ok": true
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "python:ruff check src/ ; rm -rf /",
|
|
227
|
+
"kind": "refused",
|
|
228
|
+
"ok": false,
|
|
229
|
+
"detail": "refused: unsafe command (shell metacharacter or empty)"
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
"expect": "accepted",
|
|
234
|
+
"failingChecks": ["python:ruff check src/ ; rm -rf /"]
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"reverificationCases": [
|
|
238
|
+
{
|
|
239
|
+
"name": "empty-targets",
|
|
240
|
+
"targets": {},
|
|
241
|
+
"expect": "refused"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"name": "dimensions-only",
|
|
245
|
+
"targets": {
|
|
246
|
+
"dimensions": ["spec-compliance", "frontend-backend"]
|
|
247
|
+
},
|
|
248
|
+
"expect": "accepted"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "recipe-step-and-operation",
|
|
252
|
+
"targets": {
|
|
253
|
+
"recipeSteps": [
|
|
254
|
+
{
|
|
255
|
+
"kind": "assert",
|
|
256
|
+
"params": {
|
|
257
|
+
"selector": "id:gp-run-button"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"operationIds": ["op_AAAAAAAAAAAAAAAAAAAAAAAAAA"]
|
|
262
|
+
},
|
|
263
|
+
"expect": "accepted"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "uppercase-dimension",
|
|
267
|
+
"targets": {
|
|
268
|
+
"dimensions": ["Spec-Compliance"]
|
|
269
|
+
},
|
|
270
|
+
"expect": "refused"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "bad-operation-id",
|
|
274
|
+
"targets": {
|
|
275
|
+
"operationIds": ["op_short"]
|
|
276
|
+
},
|
|
277
|
+
"expect": "refused"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "unknown-target-kind",
|
|
281
|
+
"targets": {
|
|
282
|
+
"dimensions": ["security"],
|
|
283
|
+
"screenshots": ["a.png"]
|
|
284
|
+
},
|
|
285
|
+
"expect": "refused"
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"request": {
|
|
289
|
+
"schemaVersion": "iterate.reverification/0.1",
|
|
290
|
+
"trigger": {
|
|
291
|
+
"kind": "invariant",
|
|
292
|
+
"reportDigest": "iv_81373b5040663b9f56a4a0bc671ab55e0d92bc33e5980b5580f3e7cec5902332"
|
|
293
|
+
},
|
|
294
|
+
"targets": {
|
|
295
|
+
"recipeSteps": [
|
|
296
|
+
{
|
|
297
|
+
"kind": "assert",
|
|
298
|
+
"params": {
|
|
299
|
+
"selector": "id:gp-run-button"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
],
|
|
303
|
+
"dimensions": ["spec-compliance"]
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|