iterate-kernel 0.1.5 → 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 +2 -1
- 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/evidence-pack.d.ts +38 -38
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/provider-registration.d.ts +4 -4
- package/fixtures/decision-log-entry.ok-02.json +20 -0
- package/fixtures/decision-record-transcription.ok-01.json +260 -0
- package/package.json +5 -1
- package/schemas/decision-log-entry.schema.json +20 -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
|
+
}
|
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",
|
|
@@ -26,6 +26,10 @@
|
|
|
26
26
|
"types": "./dist/decision-log-entry.d.ts",
|
|
27
27
|
"default": "./dist/decision-log-entry.js"
|
|
28
28
|
},
|
|
29
|
+
"./decision-log-transcribe": {
|
|
30
|
+
"types": "./dist/decision-log-transcribe.d.ts",
|
|
31
|
+
"default": "./dist/decision-log-transcribe.js"
|
|
32
|
+
},
|
|
29
33
|
"./dimension-context": {
|
|
30
34
|
"types": "./dist/dimension-context.d.ts",
|
|
31
35
|
"default": "./dist/dimension-context.js"
|
|
@@ -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
|
}
|