iterate-kernel 0.1.5 → 0.1.7

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 CHANGED
@@ -34,7 +34,8 @@ APIs it actually uses.
34
34
  | --- | --- |
35
35
  | `evidence-pack` / `parse` | the evidence pack shape, and parsing/validating one |
36
36
  | `evidence-decision` | the **transcription**: evidence (attribution level, circuit-breaker level, pass/fail/inconclusive) → a decision outcome and a human summary. It reads fields the engine already decided; it never infers. |
37
- | `decision-log-entry` / `decision-log` | the append-only decision-log entry and the `opID ↔ entry` hash chain that makes it auditable |
37
+ | `decision-log-entry` / `decision-log` | the append-only decision-log entry and the `opID ↔ entry` hash chain that makes it auditable. The entry carries the producer's own `kind`, its `round`, the `dimension` a decision served and a bounded `payload` — all optional, so chains written before them keep their bytes and their digests. |
38
+ | `decision-log-transcribe` | the mapping from a decision record that the iterate ledgers already write (`{timestamp, round, type, data}` JSONL, produced independently in Python and TypeScript) onto a canonical draft. Rules live in `fixtures/decision-record-transcription.ok-01.json` so the second implementation is coded from the fixture, not from this package. |
38
39
  | `dimension-context` / `parse` | the dimension-coverage transcription: a plan plus what the engine actually recorded → verified / unverified / unplanned, and one line to put in a summary. It validates id *shape*, never which ids exist — that list belongs to whoever configured the run. |
39
40
  | `run-plan` / `parse` | the plan that `dimension-context` needs and refuses to invent: which dimensions a run intends to cover, in the caller's order, with the declared source. It carries a **digest** (`rp_` + sha256 of the canonical form) so a ledger line can state which plan a run was held to, and a reader can notice the plan changed mid-run. Nothing here reads a config file — producing a plan is whoever configures the run's job, and that keeps the kernel from learning a consumer's file format. |
40
41
  | `invariant-report` / `parse` | what the invariant runner may state about its own checks, and the re-verification a failure asks for. It refuses a report that says `pass` while carrying a failed check, and it turns an `error` (a check that could not run) into **no** request: re-verifying the app would answer a question nobody measured. |
@@ -3,8 +3,42 @@ export declare const DECISION_ENTRY_ID_PATTERN: RegExp;
3
3
  /** SHA-256 full hex (64 lowercase chars), or the empty string for the genesis entry. */
4
4
  export declare const PREV_ENTRY_HASH_PATTERN: RegExp;
5
5
  export declare const SUMMARY_MAX_LENGTH = 2048;
6
+ /**
7
+ * What kind of decision an entry records — snake_case producer vocabulary, deliberately
8
+ * NOT an enum here.
9
+ *
10
+ * WHY IT IS NOT ENUMERATED. Each ecosystem has its own set of event kinds and each is
11
+ * the authority on its own list: the iterate loop records `round_start`, `review_result`,
12
+ * `atomic_fix`, `architectural_fix`, `revert`, `validation`, `decision`, `report` (and the
13
+ * plugin's history adds `round_failed`, `resume`), while the GlassPane fork records tool
14
+ * executions. Enumerating them in this package would make the kernel the owner of two
15
+ * vocabularies it does not maintain, and every new kind would need a kernel release —
16
+ * the same reason there is no dimension list in `dimension-context.ts`. The kernel's job
17
+ * is to make the field *comparable* (shape, bound, no silent free-text drift), not to
18
+ * decide what counts as a decision.
19
+ */
20
+ export declare const DECISION_KIND_PATTERN: RegExp;
21
+ /**
22
+ * Upper bound on the canonical-JSON length of `payload`. The legacy logs this shape
23
+ * replaces put an unbounded `data` object on every line; an unbounded field in a
24
+ * hash-chained ledger is a line whose bytes — and therefore whose digest — can grow
25
+ * without limit, so the bound is part of the contract even though JSON Schema cannot
26
+ * state it (see the documented divergence in `schemas/decision-log-entry.schema.json`).
27
+ */
28
+ export declare const PAYLOAD_MAX_CANONICAL_LENGTH = 8192;
6
29
  export declare const DecisionOutcomeSchema: z.ZodEnum<["pass", "fail", "blocked", "inconclusive"]>;
7
30
  export type DecisionOutcome = z.infer<typeof DecisionOutcomeSchema>;
31
+ /**
32
+ * One line of the audit chain.
33
+ *
34
+ * `kind`, `round`, `dimension` and `payload` are all optional so the entries the GlassPane
35
+ * fork already wrote keep parsing and keep their recorded digests: an omitted field is
36
+ * absent from the canonical bytes, not `null`, so widening this shape does not retroactively
37
+ * break a chain. They exist because the ledgers this shape is meant to replace carry that
38
+ * information, and a canonical form that cannot state "which round, what kind, which
39
+ * dimension, against what finding" would force each ecosystem to keep its own log beside
40
+ * the shared one — which is the divergence this entry exists to end.
41
+ */
8
42
  export declare const DecisionLogEntrySchema: z.ZodObject<{
9
43
  entryId: z.ZodString;
10
44
  sequence: z.ZodNumber;
@@ -13,6 +47,10 @@ export declare const DecisionLogEntrySchema: z.ZodObject<{
13
47
  summary: z.ZodString;
14
48
  outcome: z.ZodEnum<["pass", "fail", "blocked", "inconclusive"]>;
15
49
  createdAt: z.ZodString;
50
+ kind: z.ZodOptional<z.ZodString>;
51
+ round: z.ZodOptional<z.ZodNumber>;
52
+ dimension: z.ZodOptional<z.ZodString>;
53
+ payload: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
16
54
  }, "strict", z.ZodTypeAny, {
17
55
  createdAt: string;
18
56
  entryId: string;
@@ -20,7 +58,11 @@ export declare const DecisionLogEntrySchema: z.ZodObject<{
20
58
  prevEntryHash: string;
21
59
  summary: string;
22
60
  outcome: "pass" | "fail" | "blocked" | "inconclusive";
61
+ round?: number | undefined;
62
+ kind?: string | undefined;
23
63
  operationId?: string | undefined;
64
+ dimension?: string | undefined;
65
+ payload?: Record<string, unknown> | undefined;
24
66
  }, {
25
67
  createdAt: string;
26
68
  entryId: string;
@@ -28,7 +70,11 @@ export declare const DecisionLogEntrySchema: z.ZodObject<{
28
70
  prevEntryHash: string;
29
71
  summary: string;
30
72
  outcome: "pass" | "fail" | "blocked" | "inconclusive";
73
+ round?: number | undefined;
74
+ kind?: string | undefined;
31
75
  operationId?: string | undefined;
76
+ dimension?: string | undefined;
77
+ payload?: Record<string, unknown> | undefined;
32
78
  }>;
33
79
  export type DecisionLogEntry = z.infer<typeof DecisionLogEntrySchema>;
34
80
  //# sourceMappingURL=decision-log-entry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decision-log-entry.d.ts","sourceRoot":"","sources":["../src/decision-log-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,yBAAyB,QAAgC,CAAC;AAEvE,wFAAwF;AACxF,eAAO,MAAM,uBAAuB,QAAsB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,eAAO,MAAM,qBAAqB,wDAAsD,CAAC;AACzF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"decision-log-entry.d.ts","sourceRoot":"","sources":["../src/decision-log-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,yBAAyB,QAAgC,CAAC;AAEvE,wFAAwF;AACxF,eAAO,MAAM,uBAAuB,QAAsB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,QAA2B,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,eAAO,MAAM,qBAAqB,wDAAsD,CAAC;AACzF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,10 +1,46 @@
1
1
  import { z } from "zod";
2
+ import { canonicalJson } from "./canonical-json.js";
3
+ import { DIMENSION_ID_MAX_LENGTH, DIMENSION_ID_PATTERN } from "./dimension-context.js";
2
4
  import { ISO_MILLIS_PATTERN, OPERATION_ID_PATTERN } from "./evidence-pack.js";
3
5
  export const DECISION_ENTRY_ID_PATTERN = /^dl_[0-9A-HJKMNP-TV-Z]{26}$/;
4
6
  /** SHA-256 full hex (64 lowercase chars), or the empty string for the genesis entry. */
5
7
  export const PREV_ENTRY_HASH_PATTERN = /^([0-9a-f]{64})?$/;
6
8
  export const SUMMARY_MAX_LENGTH = 2048;
9
+ /**
10
+ * What kind of decision an entry records — snake_case producer vocabulary, deliberately
11
+ * NOT an enum here.
12
+ *
13
+ * WHY IT IS NOT ENUMERATED. Each ecosystem has its own set of event kinds and each is
14
+ * the authority on its own list: the iterate loop records `round_start`, `review_result`,
15
+ * `atomic_fix`, `architectural_fix`, `revert`, `validation`, `decision`, `report` (and the
16
+ * plugin's history adds `round_failed`, `resume`), while the GlassPane fork records tool
17
+ * executions. Enumerating them in this package would make the kernel the owner of two
18
+ * vocabularies it does not maintain, and every new kind would need a kernel release —
19
+ * the same reason there is no dimension list in `dimension-context.ts`. The kernel's job
20
+ * is to make the field *comparable* (shape, bound, no silent free-text drift), not to
21
+ * decide what counts as a decision.
22
+ */
23
+ export const DECISION_KIND_PATTERN = /^[a-z][a-z0-9_]{0,31}$/;
24
+ /**
25
+ * Upper bound on the canonical-JSON length of `payload`. The legacy logs this shape
26
+ * replaces put an unbounded `data` object on every line; an unbounded field in a
27
+ * hash-chained ledger is a line whose bytes — and therefore whose digest — can grow
28
+ * without limit, so the bound is part of the contract even though JSON Schema cannot
29
+ * state it (see the documented divergence in `schemas/decision-log-entry.schema.json`).
30
+ */
31
+ export const PAYLOAD_MAX_CANONICAL_LENGTH = 8192;
7
32
  export const DecisionOutcomeSchema = z.enum(["pass", "fail", "blocked", "inconclusive"]);
33
+ /**
34
+ * One line of the audit chain.
35
+ *
36
+ * `kind`, `round`, `dimension` and `payload` are all optional so the entries the GlassPane
37
+ * fork already wrote keep parsing and keep their recorded digests: an omitted field is
38
+ * absent from the canonical bytes, not `null`, so widening this shape does not retroactively
39
+ * break a chain. They exist because the ledgers this shape is meant to replace carry that
40
+ * information, and a canonical form that cannot state "which round, what kind, which
41
+ * dimension, against what finding" would force each ecosystem to keep its own log beside
42
+ * the shared one — which is the divergence this entry exists to end.
43
+ */
8
44
  export const DecisionLogEntrySchema = z.strictObject({
9
45
  entryId: z.string().regex(DECISION_ENTRY_ID_PATTERN),
10
46
  sequence: z.number().int().min(0),
@@ -12,6 +48,13 @@ export const DecisionLogEntrySchema = z.strictObject({
12
48
  operationId: z.string().regex(OPERATION_ID_PATTERN).optional(),
13
49
  summary: z.string().max(SUMMARY_MAX_LENGTH),
14
50
  outcome: DecisionOutcomeSchema,
15
- createdAt: z.string().regex(ISO_MILLIS_PATTERN)
51
+ createdAt: z.string().regex(ISO_MILLIS_PATTERN),
52
+ kind: z.string().regex(DECISION_KIND_PATTERN).optional(),
53
+ round: z.number().int().min(0).optional(),
54
+ dimension: z.string().regex(DIMENSION_ID_PATTERN).max(DIMENSION_ID_MAX_LENGTH).optional(),
55
+ payload: z
56
+ .record(z.string(), z.unknown())
57
+ .optional()
58
+ .refine((value) => value === undefined || canonicalJson(value).length <= PAYLOAD_MAX_CANONICAL_LENGTH, { message: `payload must stay within ${PAYLOAD_MAX_CANONICAL_LENGTH} characters of canonical JSON` })
16
59
  });
17
60
  //# sourceMappingURL=decision-log-entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decision-log-entry.js","sourceRoot":"","sources":["../src/decision-log-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEvE,wFAAwF;AACxF,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,IA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CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,MAAM,IAAI,4BAA4B,EAC7F,EAAE,OAAO,EAAE,4BAA4B,4BAA4B,+BAA+B,EAAE,CACrG;CACJ,CAAC,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { type DecisionLogEntry } from "./decision-log-entry.js";
2
+ import { type DecisionLogDraft } from "./decision-log.js";
3
+ /**
4
+ * Transcription: one ecosystem's *in use* decision record → the canonical draft this ledger
5
+ * stores.
6
+ *
7
+ * WHY THIS EXISTS IN THE KERNEL AND NOT IN EITHER SHELL. Both ecosystems already keep
8
+ * ledgers, and they are not the same shape: the iterate loop appends
9
+ * `{timestamp, round, type, data}` JSONL from two independent implementations (the Python
10
+ * harness and the TypeScript plugin), and the plugin's history carries kinds the Python
11
+ * validator does not accept. If each shell writes its own log and the kernel only defines
12
+ * the *target* shape, nothing converges — the shared contract becomes a document rather
13
+ * than the file on disk. Mapping rules therefore have to have exactly one owner, and the
14
+ * owner has to be the side both shells already depend on. The direction stays
15
+ * shell → kernel: this module imports nothing from either shell and receives the legacy
16
+ * vocabulary as data.
17
+ *
18
+ * THE RULES, stated so a second implementation can reproduce them without reading
19
+ * TypeScript (and pinned by `fixtures/decision-record-transcription.ok-01.json`):
20
+ *
21
+ * 1. input is an object with exactly the keys `timestamp`, `round`, `type`, `data`;
22
+ * anything else (including extra keys) is refused, not dropped.
23
+ * 2. `type` becomes `kind` verbatim, and must match `DECISION_KIND_PATTERN`. No
24
+ * renaming, no case folding: a kind this module would have to rewrite is a kind it
25
+ * cannot compare across ecosystems.
26
+ * 3. `round` must be an integer >= 0 and is copied; `data` becomes `payload` in full so
27
+ * no recorded detail is lost, and it must stay inside `PAYLOAD_MAX_CANONICAL_LENGTH`.
28
+ * 4. `createdAt` is `timestamp` normalized to ISO-8601 UTC milliseconds. An unparseable
29
+ * timestamp is refused: a ledger entry dated "whenever" cannot be audited.
30
+ * 5. `outcome` is read, never inferred from tone: `data.outcome` / `data.status` when
31
+ * one of the four canonical values; else `data.passed === true` -> `pass`,
32
+ * `=== false` -> `fail`; else `inconclusive`. `inconclusive` is the honest value for
33
+ * "the record does not say", and it is distinguishable from a recorded verdict.
34
+ * 6. `summary` is the record's own sentence (`data.summary`, `data.message`,
35
+ * `data.reason`, in that order). When it carries none, the label
36
+ * `<kind> (round <round>)` is used — a label, not a claim — and if the chosen text
37
+ * exceeds `SUMMARY_MAX_LENGTH` the record is refused rather than truncated.
38
+ * 7. `dimension` is `data.dimension` when it is a kernel dimension id, otherwise absent.
39
+ * Falling back to the kind or the method name is the guessing this ledger exists to
40
+ * prevent (the same rule the fork's compaction collector applies).
41
+ * 8. `operationId` is `data.operationId` when it matches the `op_` id shape, else absent.
42
+ */
43
+ export declare const DECISION_TRANSCRIBE_CODES: {
44
+ readonly record: "KERNEL_E_DECISION_RECORD";
45
+ readonly kind: "KERNEL_E_DECISION_KIND";
46
+ readonly round: "KERNEL_E_DECISION_ROUND";
47
+ readonly timestamp: "KERNEL_E_DECISION_TIMESTAMP";
48
+ readonly summary: "KERNEL_E_DECISION_SUMMARY";
49
+ readonly payload: "KERNEL_E_DECISION_PAYLOAD";
50
+ };
51
+ export type DecisionTranscribeCode = (typeof DECISION_TRANSCRIBE_CODES)[keyof typeof DECISION_TRANSCRIBE_CODES];
52
+ /** Every failure carries code + message + remedy, like the rest of this package. */
53
+ export declare class KernelDecisionTranscribeError extends Error {
54
+ readonly code: DecisionTranscribeCode;
55
+ readonly remedy: string;
56
+ constructor(code: DecisionTranscribeCode, message: string, remedy: string);
57
+ }
58
+ /**
59
+ * Transcribe one legacy record into a ledger draft.
60
+ *
61
+ * `entryId` is supplied by the caller because it is ledger-owned: the ULID's random tail
62
+ * cannot be derived from the record, and a transcription function that minted ids would not
63
+ * be reproducible — which is the whole requirement for the Python and TypeScript sides to be
64
+ * compared against the same fixture.
65
+ */
66
+ export declare function decisionLogDraftFromRecord(record: unknown, entryId: string): DecisionLogDraft;
67
+ /**
68
+ * Whether an on-disk JSONL line is a canonical entry or a legacy record — the check that lets
69
+ * a reader migrate a log that has both in it instead of reporting history as corrupt.
70
+ *
71
+ * A canonical entry is refused by the strict entry schema only when it is genuinely broken,
72
+ * so the classification is by parse success, never by guessing at field names.
73
+ */
74
+ export declare function isLegacyDecisionRecord(line: unknown): boolean;
75
+ /** Re-exported so a consumer can verify a migrated chain without importing two modules. */
76
+ export type TranscribedDecisionLogEntry = DecisionLogEntry;
77
+ //# sourceMappingURL=decision-log-transcribe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-log-transcribe.d.ts","sourceRoot":"","sources":["../src/decision-log-transcribe.ts"],"names":[],"mappings":"AACA,OAAO,EAAuD,KAAK,gBAAgB,EAAwB,MAAM,yBAAyB,CAAC;AAC3I,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,eAAO,MAAM,yBAAyB;;;;;;;CAO5B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,OAAO,yBAAyB,CAAC,CAAC;AAEhH,oFAAoF;AACpF,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAM1E;AA4ED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,CA8E7F;AAGD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAM7D;AAGD,2FAA2F;AAC3F,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,200 @@
1
+ import { canonicalJson } from "./canonical-json.js";
2
+ import { DECISION_KIND_PATTERN, PAYLOAD_MAX_CANONICAL_LENGTH } from "./decision-log-entry.js";
3
+ import {} from "./decision-log.js";
4
+ import { DIMENSION_ID_MAX_LENGTH, DIMENSION_ID_PATTERN } from "./dimension-context.js";
5
+ import { ISO_MILLIS_PATTERN, OPERATION_ID_PATTERN } from "./evidence-pack.js";
6
+ /**
7
+ * Transcription: one ecosystem's *in use* decision record → the canonical draft this ledger
8
+ * stores.
9
+ *
10
+ * WHY THIS EXISTS IN THE KERNEL AND NOT IN EITHER SHELL. Both ecosystems already keep
11
+ * ledgers, and they are not the same shape: the iterate loop appends
12
+ * `{timestamp, round, type, data}` JSONL from two independent implementations (the Python
13
+ * harness and the TypeScript plugin), and the plugin's history carries kinds the Python
14
+ * validator does not accept. If each shell writes its own log and the kernel only defines
15
+ * the *target* shape, nothing converges — the shared contract becomes a document rather
16
+ * than the file on disk. Mapping rules therefore have to have exactly one owner, and the
17
+ * owner has to be the side both shells already depend on. The direction stays
18
+ * shell → kernel: this module imports nothing from either shell and receives the legacy
19
+ * vocabulary as data.
20
+ *
21
+ * THE RULES, stated so a second implementation can reproduce them without reading
22
+ * TypeScript (and pinned by `fixtures/decision-record-transcription.ok-01.json`):
23
+ *
24
+ * 1. input is an object with exactly the keys `timestamp`, `round`, `type`, `data`;
25
+ * anything else (including extra keys) is refused, not dropped.
26
+ * 2. `type` becomes `kind` verbatim, and must match `DECISION_KIND_PATTERN`. No
27
+ * renaming, no case folding: a kind this module would have to rewrite is a kind it
28
+ * cannot compare across ecosystems.
29
+ * 3. `round` must be an integer >= 0 and is copied; `data` becomes `payload` in full so
30
+ * no recorded detail is lost, and it must stay inside `PAYLOAD_MAX_CANONICAL_LENGTH`.
31
+ * 4. `createdAt` is `timestamp` normalized to ISO-8601 UTC milliseconds. An unparseable
32
+ * timestamp is refused: a ledger entry dated "whenever" cannot be audited.
33
+ * 5. `outcome` is read, never inferred from tone: `data.outcome` / `data.status` when
34
+ * one of the four canonical values; else `data.passed === true` -> `pass`,
35
+ * `=== false` -> `fail`; else `inconclusive`. `inconclusive` is the honest value for
36
+ * "the record does not say", and it is distinguishable from a recorded verdict.
37
+ * 6. `summary` is the record's own sentence (`data.summary`, `data.message`,
38
+ * `data.reason`, in that order). When it carries none, the label
39
+ * `<kind> (round <round>)` is used — a label, not a claim — and if the chosen text
40
+ * exceeds `SUMMARY_MAX_LENGTH` the record is refused rather than truncated.
41
+ * 7. `dimension` is `data.dimension` when it is a kernel dimension id, otherwise absent.
42
+ * Falling back to the kind or the method name is the guessing this ledger exists to
43
+ * prevent (the same rule the fork's compaction collector applies).
44
+ * 8. `operationId` is `data.operationId` when it matches the `op_` id shape, else absent.
45
+ */
46
+ export const DECISION_TRANSCRIBE_CODES = {
47
+ record: "KERNEL_E_DECISION_RECORD",
48
+ kind: "KERNEL_E_DECISION_KIND",
49
+ round: "KERNEL_E_DECISION_ROUND",
50
+ timestamp: "KERNEL_E_DECISION_TIMESTAMP",
51
+ summary: "KERNEL_E_DECISION_SUMMARY",
52
+ payload: "KERNEL_E_DECISION_PAYLOAD",
53
+ };
54
+ /** Every failure carries code + message + remedy, like the rest of this package. */
55
+ export class KernelDecisionTranscribeError extends Error {
56
+ code;
57
+ remedy;
58
+ constructor(code, message, remedy) {
59
+ super(`${code}: ${message}`);
60
+ this.name = "KernelDecisionTranscribeError";
61
+ this.code = code;
62
+ this.remedy = remedy;
63
+ }
64
+ }
65
+ const RECORD_KEYS = ["timestamp", "round", "type", "data"];
66
+ const OUTCOMES = ["pass", "fail", "blocked", "inconclusive"];
67
+ const SUMMARY_FIELDS = ["summary", "message", "reason"];
68
+ /**
69
+ * The only timestamp spelling accepted: ISO-8601 date-time with an explicit zone.
70
+ *
71
+ * WHY A PATTERN AND NOT JUST `Date.parse`. `Date.parse("11/10/2026 02:28")` succeeds in V8 by
72
+ * guessing a US-style M/D/Y, while Python's `fromisoformat` refuses the same string — so a
73
+ * transcriber that leaned on the host parser would produce two different ledgers from one
74
+ * record, and a ledger whose dates depend on which runtime converted it is not evidence.
75
+ */
76
+ const ISO_8601_WITH_ZONE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})$/;
77
+ function refuse(code, message, remedy) {
78
+ throw new KernelDecisionTranscribeError(code, message, remedy);
79
+ }
80
+ function isOutcome(value) {
81
+ return typeof value === "string" && OUTCOMES.includes(value);
82
+ }
83
+ /** Rule 4: normalize any ISO-8601-looking timestamp the legacy logs contain to UTC millis. */
84
+ function toIsoMillis(raw) {
85
+ if (typeof raw !== "string" || raw.length === 0) {
86
+ refuse(DECISION_TRANSCRIBE_CODES.timestamp, "the record's `timestamp` is not a non-empty string", "the producer must stamp the record itself; transcription will not substitute the current time, because that would date a decision to when someone converted the file");
87
+ }
88
+ if (!ISO_8601_WITH_ZONE.test(raw)) {
89
+ refuse(DECISION_TRANSCRIBE_CODES.timestamp, `\`${raw}\` is not ISO-8601 with an explicit zone (Z or ±HH:MM)`, "emit the offset the producer actually has; a spelling the host parser has to guess at (11/10/2026, a bare date, local time without an offset) parses differently in each runtime, and a ledger dated by guesswork cannot be audited");
90
+ }
91
+ const ms = Date.parse(raw);
92
+ if (!Number.isFinite(ms)) {
93
+ refuse(DECISION_TRANSCRIBE_CODES.timestamp, `\`${raw}\` is not a real instant`, "check the producer's clock formatting: an ISO-shaped string that is not a valid date (month 13, day 32) is a bug worth stopping the migration for");
94
+ }
95
+ const iso = new Date(ms).toISOString();
96
+ if (!ISO_MILLIS_PATTERN.test(iso)) {
97
+ refuse(DECISION_TRANSCRIBE_CODES.timestamp, `\`${raw}\` normalized to \`${iso}\`, which is not ISO-8601 millisecond UTC`, "the ledger stores second-precision-free UTC; check whether the producer emitted a year outside the representable range");
98
+ }
99
+ return iso;
100
+ }
101
+ function readOutcome(data) {
102
+ if (isOutcome(data.outcome))
103
+ return data.outcome;
104
+ if (isOutcome(data.status))
105
+ return data.status;
106
+ if (data.passed === true)
107
+ return "pass";
108
+ if (data.passed === false)
109
+ return "fail";
110
+ return "inconclusive";
111
+ }
112
+ function readSummary(data, kind, round) {
113
+ for (const field of SUMMARY_FIELDS) {
114
+ const value = data[field];
115
+ if (typeof value === "string" && value.trim().length > 0)
116
+ return value;
117
+ }
118
+ const label = round === undefined ? kind : `${kind} (round ${round})`;
119
+ return label;
120
+ }
121
+ /**
122
+ * Transcribe one legacy record into a ledger draft.
123
+ *
124
+ * `entryId` is supplied by the caller because it is ledger-owned: the ULID's random tail
125
+ * cannot be derived from the record, and a transcription function that minted ids would not
126
+ * be reproducible — which is the whole requirement for the Python and TypeScript sides to be
127
+ * compared against the same fixture.
128
+ */
129
+ export function decisionLogDraftFromRecord(record, entryId) {
130
+ if (record === null || typeof record !== "object" || Array.isArray(record)) {
131
+ refuse(DECISION_TRANSCRIBE_CODES.record, "the record is not an object", "pass the decoded JSONL line as an object");
132
+ }
133
+ const input = record;
134
+ const keys = Object.keys(input);
135
+ for (const key of keys) {
136
+ if (!RECORD_KEYS.includes(key)) {
137
+ refuse(DECISION_TRANSCRIBE_CODES.record, `unrecognised key \`${key}\` on the record`, "a field this module does not know would be silently dropped, and the point of the ledger is that nothing about a decision is dropped — add it to the record's own payload instead");
138
+ }
139
+ }
140
+ const type = input.type;
141
+ if (typeof type !== "string" || !DECISION_KIND_PATTERN.test(type)) {
142
+ refuse(DECISION_TRANSCRIBE_CODES.kind, `\`type\` must match the snake_case kind pattern, got \`${String(type)}\``, "the kind is how a reader from the other ecosystem recognizes what happened; a kind that needs rewriting to be comparable is not comparable");
143
+ }
144
+ let round;
145
+ if (input.round !== undefined) {
146
+ if (typeof input.round !== "number" || !Number.isInteger(input.round) || input.round < 0) {
147
+ refuse(DECISION_TRANSCRIBE_CODES.round, `\`round\` must be an integer >= 0, got \`${String(input.round)}\``, "fix the producer's round counter; transcription will not clamp or renumber, because the round is how a reader locates the decision in the run");
148
+ }
149
+ round = input.round;
150
+ }
151
+ const data = input.data;
152
+ if (data !== undefined && (data === null || typeof data !== "object" || Array.isArray(data))) {
153
+ refuse(DECISION_TRANSCRIBE_CODES.record, "`data` must be an object when present", "pass the decoded payload object, or omit the key");
154
+ }
155
+ const payload = (data ?? {});
156
+ const payloadCanonical = canonicalJson(payload);
157
+ if (payloadCanonical.length > PAYLOAD_MAX_CANONICAL_LENGTH) {
158
+ refuse(DECISION_TRANSCRIBE_CODES.payload, `\`data\` is ${payloadCanonical.length} characters of canonical JSON, over the ${PAYLOAD_MAX_CANONICAL_LENGTH} bound`, "keep the evidence where it belongs (an evidence pack) and record the decision that referenced it; a ledger line that carries a whole report cannot be hashed at a sane size");
159
+ }
160
+ const summary = readSummary(payload, type, round);
161
+ if (summary.length > 2048) {
162
+ refuse(DECISION_TRANSCRIBE_CODES.summary, `the record's own sentence is ${summary.length} characters, over SUMMARY_MAX_LENGTH`, "shorten what the producer writes as `summary`; transcription will not truncate a decision to fit a line");
163
+ }
164
+ const dimension = payload.dimension;
165
+ const operationId = payload.operationId;
166
+ // Conditional spreads rather than assignments: `DecisionLogDraft` is readonly, and an
167
+ // optional field must be *absent* from the object — not present as undefined — because the
168
+ // canonical bytes this becomes are what the next entry's hash covers.
169
+ return {
170
+ entryId,
171
+ summary,
172
+ outcome: readOutcome(payload),
173
+ createdAt: toIsoMillis(input.timestamp),
174
+ kind: type,
175
+ payload,
176
+ ...(round !== undefined ? { round } : {}),
177
+ ...(typeof dimension === "string" && DIMENSION_ID_PATTERN.test(dimension) && dimension.length <= DIMENSION_ID_MAX_LENGTH
178
+ ? { dimension }
179
+ : {}),
180
+ ...(typeof operationId === "string" && OPERATION_ID_PATTERN.test(operationId) ? { operationId } : {})
181
+ };
182
+ }
183
+ /**
184
+ * Whether an on-disk JSONL line is a canonical entry or a legacy record — the check that lets
185
+ * a reader migrate a log that has both in it instead of reporting history as corrupt.
186
+ *
187
+ * A canonical entry is refused by the strict entry schema only when it is genuinely broken,
188
+ * so the classification is by parse success, never by guessing at field names.
189
+ */
190
+ export function isLegacyDecisionRecord(line) {
191
+ if (line === null || typeof line !== "object" || Array.isArray(line))
192
+ return false;
193
+ const keys = Object.keys(line);
194
+ if (keys.length === 0)
195
+ return false;
196
+ if (!keys.includes("type"))
197
+ return false;
198
+ return keys.every((key) => RECORD_KEYS.includes(key));
199
+ }
200
+ //# sourceMappingURL=decision-log-transcribe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-log-transcribe.js","sourceRoot":"","sources":["../src/decision-log-transcribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAA+C,MAAM,yBAAyB,CAAC;AAC3I,OAAO,EAAyB,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,MAAM,EAAE,0BAA0B;IAClC,IAAI,EAAE,wBAAwB;IAC9B,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,6BAA6B;IACxC,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,2BAA2B;CAC5B,CAAC;AAIX,oFAAoF;AACpF,MAAM,OAAO,6BAA8B,SAAQ,KAAK;IAC7C,IAAI,CAAyB;IAC7B,MAAM,CAAS;IAExB,YAAY,IAA4B,EAAE,OAAe,EAAE,MAAc;QACvE,KAAK,CAAC,GAAG,IAAI,KAAK,OAAO,EAAE,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,IAAI;QACV,OAAO;QACP,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,OAAO,SAAS,KAAK,QAAQ,IAAI,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,IAAI,uBAAuB;YACtH,CAAC,CAAC,EAAE,SAAS,EAAE;YACf,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,WAAW,KAAK,QAAQ,IAAI,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtG,CAAC;AACJ,CAAC;AAGD;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAa;IAClD,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACnF,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAA+B,CAAC,CAAC;IAC1D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,WAAiC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/E,CAAC"}
@@ -50,6 +50,10 @@ export interface DecisionLogDraft {
50
50
  readonly outcome: DecisionOutcome;
51
51
  readonly createdAt: string;
52
52
  readonly operationId?: string;
53
+ readonly kind?: string;
54
+ readonly round?: number;
55
+ readonly dimension?: string;
56
+ readonly payload?: Record<string, unknown>;
53
57
  }
54
58
  /**
55
59
  * The draft contract, strict. An unknown key is refused rather than dropped:
@@ -66,18 +70,30 @@ export declare const DecisionLogDraftSchema: import("zod").ZodObject<Omit<{
66
70
  summary: import("zod").ZodString;
67
71
  outcome: import("zod").ZodEnum<["pass", "fail", "blocked", "inconclusive"]>;
68
72
  createdAt: import("zod").ZodString;
73
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
74
+ round: import("zod").ZodOptional<import("zod").ZodNumber>;
75
+ dimension: import("zod").ZodOptional<import("zod").ZodString>;
76
+ payload: import("zod").ZodEffects<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
69
77
  }, "sequence" | "prevEntryHash">, "strict", import("zod").ZodTypeAny, {
70
78
  createdAt: string;
71
79
  entryId: string;
72
80
  summary: string;
73
81
  outcome: "pass" | "fail" | "blocked" | "inconclusive";
82
+ round?: number | undefined;
83
+ kind?: string | undefined;
74
84
  operationId?: string | undefined;
85
+ dimension?: string | undefined;
86
+ payload?: Record<string, unknown> | undefined;
75
87
  }, {
76
88
  createdAt: string;
77
89
  entryId: string;
78
90
  summary: string;
79
91
  outcome: "pass" | "fail" | "blocked" | "inconclusive";
92
+ round?: number | undefined;
93
+ kind?: string | undefined;
80
94
  operationId?: string | undefined;
95
+ dimension?: string | undefined;
96
+ payload?: Record<string, unknown> | undefined;
81
97
  }>;
82
98
  export interface AppendedDecisionLogEntry {
83
99
  readonly entry: DecisionLogEntry;
@@ -1 +1 @@
1
- {"version":3,"file":"decision-log.d.ts","sourceRoot":"","sources":["../src/decision-log.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG9G;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,eAAO,MAAM,kBAAkB;;;;;;;CAOrB,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,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undefined)
205
205
  candidate.operationId = checked.data.operationId;
206
+ // Each optional field is *absent* rather than null when the producer has nothing to say.
207
+ // `canonicalJson` is what gets hashed, so a `null` written here would change the bytes of
208
+ // every new entry — and a chain whose digests depend on how a writer spells "unset" is not
209
+ // recomputable by the Swift engine or by `sha256sum` on the line.
210
+ if (checked.data.kind !== undefined)
211
+ candidate.kind = checked.data.kind;
212
+ if (checked.data.round !== undefined)
213
+ candidate.round = checked.data.round;
214
+ if (checked.data.dimension !== undefined)
215
+ candidate.dimension = checked.data.dimension;
216
+ if (checked.data.payload !== undefined)
217
+ candidate.payload = checked.data.payload;
206
218
  const parsed = DecisionLogEntrySchema.safeParse(candidate);
207
219
  if (!parsed.success) {
208
220
  const detail = parsed.error.issues
@@ -1 +1 @@
1
- {"version":3,"file":"decision-log.js","sourceRoot":"","sources":["../src/decision-log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACxG,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAA+C,MAAM,yBAAyB,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,4BAA4B;IAClC,OAAO,EAAE,+BAA+B;IACxC,KAAK,EAAE,6BAA6B;IACpC,QAAQ,EAAE,gCAAgC;IAC1C,KAAK,EAAE,6BAA6B;IACpC,KAAK,EAAE,6BAA6B;CAC5B,CAAC;AAIX;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAA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