@mmnto/totem 1.118.1 → 1.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts/admission.d.ts +12 -12
- package/dist/artifacts/verdict.d.ts +16 -16
- package/dist/compile-manifest.d.ts +89 -0
- package/dist/compile-manifest.d.ts.map +1 -1
- package/dist/compile-manifest.js +180 -31
- package/dist/compile-manifest.js.map +1 -1
- package/dist/compile-manifest.test.js +169 -1
- package/dist/compile-manifest.test.js.map +1 -1
- package/dist/compiler-schema.d.ts +1067 -0
- package/dist/compiler-schema.d.ts.map +1 -1
- package/dist/compiler-schema.js +204 -1
- package/dist/compiler-schema.js.map +1 -1
- package/dist/compiler-schema.test.js +92 -0
- package/dist/compiler-schema.test.js.map +1 -1
- package/dist/compiler.d.ts +2 -6
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +6 -17
- package/dist/compiler.js.map +1 -1
- package/dist/freeze.d.ts +3 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +12 -12
- package/dist/regex-safety/apply-rules-bounded.d.ts +11 -0
- package/dist/regex-safety/apply-rules-bounded.d.ts.map +1 -1
- package/dist/regex-safety/apply-rules-bounded.js +59 -5
- package/dist/regex-safety/apply-rules-bounded.js.map +1 -1
- package/dist/regex-validation.d.ts +7 -0
- package/dist/regex-validation.d.ts.map +1 -0
- package/dist/regex-validation.js +32 -0
- package/dist/regex-validation.js.map +1 -0
- package/dist/rule-engine.d.ts +11 -1
- package/dist/rule-engine.d.ts.map +1 -1
- package/dist/rule-engine.js +125 -18
- package/dist/rule-engine.js.map +1 -1
- package/dist/spine/authored-rule.d.ts +669 -245
- package/dist/spine/authored-rule.d.ts.map +1 -1
- package/dist/spine/authored-rule.js +113 -27
- package/dist/spine/authored-rule.js.map +1 -1
- package/dist/spine/authored-rule.test.js +170 -4
- package/dist/spine/authored-rule.test.js.map +1 -1
- package/dist/spine/authoring-ledger.d.ts +69 -10
- package/dist/spine/authoring-ledger.d.ts.map +1 -1
- package/dist/spine/authoring-ledger.js +46 -25
- package/dist/spine/authoring-ledger.js.map +1 -1
- package/dist/spine/authoring-ledger.test.js +20 -7
- package/dist/spine/authoring-ledger.test.js.map +1 -1
- package/dist/spine/candidate-rule.d.ts +18 -1
- package/dist/spine/candidate-rule.d.ts.map +1 -1
- package/dist/spine/candidate-rule.js.map +1 -1
- package/dist/spine/cert-corpus-seed.d.ts +8 -8
- package/dist/spine/compile.d.ts +4 -1
- package/dist/spine/compile.d.ts.map +1 -1
- package/dist/spine/compile.js +50 -3
- package/dist/spine/compile.js.map +1 -1
- package/dist/spine/compile.test.js +189 -23
- package/dist/spine/compile.test.js.map +1 -1
- package/dist/spine/frozen-split.d.ts +18 -18
- package/dist/spine/ledgers.d.ts +24 -24
- package/dist/spine/lf-normalize.d.ts +9 -0
- package/dist/spine/lf-normalize.d.ts.map +1 -0
- package/dist/spine/lf-normalize.js +38 -0
- package/dist/spine/lf-normalize.js.map +1 -0
- package/dist/spine/preimage-differential.d.ts +3 -1
- package/dist/spine/preimage-differential.d.ts.map +1 -1
- package/dist/spine/preimage-differential.js +9 -6
- package/dist/spine/preimage-differential.js.map +1 -1
- package/dist/spine/preimage-differential.test.js +59 -0
- package/dist/spine/preimage-differential.test.js.map +1 -1
- package/dist/spine/record-exemplars.fixture.d.ts +5 -0
- package/dist/spine/record-exemplars.fixture.d.ts.map +1 -0
- package/dist/spine/record-exemplars.fixture.js +61 -0
- package/dist/spine/record-exemplars.fixture.js.map +1 -0
- package/dist/spine/record-lower.d.ts +90 -0
- package/dist/spine/record-lower.d.ts.map +1 -0
- package/dist/spine/record-lower.js +418 -0
- package/dist/spine/record-lower.js.map +1 -0
- package/dist/spine/record-lower.test.d.ts +2 -0
- package/dist/spine/record-lower.test.d.ts.map +1 -0
- package/dist/spine/record-lower.test.js +562 -0
- package/dist/spine/record-lower.test.js.map +1 -0
- package/dist/spine/record-runtime.d.ts +215 -0
- package/dist/spine/record-runtime.d.ts.map +1 -0
- package/dist/spine/record-runtime.js +330 -0
- package/dist/spine/record-runtime.js.map +1 -0
- package/dist/spine/record-runtime.test.d.ts +2 -0
- package/dist/spine/record-runtime.test.d.ts.map +1 -0
- package/dist/spine/record-runtime.test.js +814 -0
- package/dist/spine/record-runtime.test.js.map +1 -0
- package/dist/spine/rule-record.d.ts +864 -0
- package/dist/spine/rule-record.d.ts.map +1 -0
- package/dist/spine/rule-record.js +781 -0
- package/dist/spine/rule-record.js.map +1 -0
- package/dist/spine/rule-record.test.d.ts +2 -0
- package/dist/spine/rule-record.test.d.ts.map +1 -0
- package/dist/spine/rule-record.test.js +1262 -0
- package/dist/spine/rule-record.test.js.map +1 -0
- package/dist/spine/windtunnel-firing.d.ts.map +1 -1
- package/dist/spine/windtunnel-firing.js +28 -1
- package/dist/spine/windtunnel-firing.js.map +1 -1
- package/dist/spine/windtunnel-lock.d.ts +10 -10
- package/dist/stage4-verifier.d.ts.map +1 -1
- package/dist/stage4-verifier.js +61 -17
- package/dist/stage4-verifier.js.map +1 -1
- package/dist/sys/glob.d.ts +30 -0
- package/dist/sys/glob.d.ts.map +1 -1
- package/dist/sys/glob.js +62 -1
- package/dist/sys/glob.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -86,20 +86,46 @@ export declare const AuthoringLedgerEntrySchema: z.ZodObject<{
|
|
|
86
86
|
*/
|
|
87
87
|
freezeCommitment: z.ZodOptional<z.ZodString>;
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
89
|
+
* Prop 310 § Design 1 — the rule record this entry was authored from. Present
|
|
90
|
+
* iff the rule is record-carried (every rule since slice 3; pre-slice-3 rows
|
|
91
|
+
* omit it and still parse).
|
|
92
|
+
*
|
|
93
|
+
* `contentHash` is what binds the §8 attestations to the EXACT ingested bytes
|
|
94
|
+
* (the § Design 1 attestation-relocation constraint) and is inside the material
|
|
95
|
+
* hash below. `path` is INFORMATIONAL: § Design 1 says renaming a record
|
|
96
|
+
* changes no identity, so the path must not force a re-attestation, and it is
|
|
97
|
+
* deliberately excluded from the material.
|
|
98
|
+
*/
|
|
99
|
+
record: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
path: z.ZodEffects<z.ZodString, string, string>;
|
|
101
|
+
contentHash: z.ZodString;
|
|
102
|
+
}, "strict", z.ZodTypeAny, {
|
|
103
|
+
path: string;
|
|
104
|
+
contentHash: string;
|
|
105
|
+
}, {
|
|
106
|
+
path: string;
|
|
107
|
+
contentHash: string;
|
|
108
|
+
}>>;
|
|
109
|
+
/**
|
|
110
|
+
* Fingerprint of the MATERIAL author input (engine / class / record bytes /
|
|
111
|
+
* fixtures / origin) — identity (`author`/`targetDefect`) AND `authoredAt`
|
|
112
|
+
* EXCLUDED, so a pure timestamp refresh is a no-op (§8: a timestamp drift must
|
|
113
|
+
* not churn the rule) while a matcher/fixture edit appends a new revision row
|
|
114
|
+
* under the SAME `ruleId`. Equal hash on re-read ⇒ no append.
|
|
115
|
+
*
|
|
116
|
+
* `ruleId` enters the material in exactly ONE place since Prop 310 slice 3: as
|
|
117
|
+
* the § Design 10 join key inside each derived
|
|
118
|
+
* `positiveFixtures[].preimageSource`. It is stable per identity (reused from
|
|
119
|
+
* the ledger, never re-minted), so it cannot churn an unchanged rule — the §8
|
|
120
|
+
* "identity is not material" property is preserved in effect, not by absence.
|
|
95
121
|
*/
|
|
96
122
|
contentHash: z.ZodEffects<z.ZodString, string, string>;
|
|
97
123
|
}, "strict", z.ZodTypeAny, {
|
|
124
|
+
ruleId: string;
|
|
98
125
|
contentHash: string;
|
|
99
126
|
author: string;
|
|
100
127
|
authoredAt: string;
|
|
101
128
|
targetDefect: string;
|
|
102
|
-
ruleId: string;
|
|
103
129
|
origin: {
|
|
104
130
|
kind: "from-scratch";
|
|
105
131
|
} | {
|
|
@@ -117,14 +143,18 @@ export declare const AuthoringLedgerEntrySchema: z.ZodObject<{
|
|
|
117
143
|
authoredAfterSplit: true;
|
|
118
144
|
heldOutNonInspectionAttestation: true;
|
|
119
145
|
positiveFixturePrs: number[];
|
|
146
|
+
record?: {
|
|
147
|
+
path: string;
|
|
148
|
+
contentHash: string;
|
|
149
|
+
} | undefined;
|
|
120
150
|
freezeCommitment?: string | undefined;
|
|
121
151
|
negativeFixturePrs?: number[] | undefined;
|
|
122
152
|
}, {
|
|
153
|
+
ruleId: string;
|
|
123
154
|
contentHash: string;
|
|
124
155
|
author: string;
|
|
125
156
|
authoredAt: string;
|
|
126
157
|
targetDefect: string;
|
|
127
|
-
ruleId: string;
|
|
128
158
|
origin: {
|
|
129
159
|
kind: "from-scratch";
|
|
130
160
|
} | {
|
|
@@ -142,12 +172,25 @@ export declare const AuthoringLedgerEntrySchema: z.ZodObject<{
|
|
|
142
172
|
authoredAfterSplit: true;
|
|
143
173
|
heldOutNonInspectionAttestation: true;
|
|
144
174
|
positiveFixturePrs: number[];
|
|
175
|
+
record?: {
|
|
176
|
+
path: string;
|
|
177
|
+
contentHash: string;
|
|
178
|
+
} | undefined;
|
|
145
179
|
freezeCommitment?: string | undefined;
|
|
146
180
|
negativeFixturePrs?: number[] | undefined;
|
|
147
181
|
}>;
|
|
148
182
|
export type AuthoringLedgerEntry = z.infer<typeof AuthoringLedgerEntrySchema>;
|
|
149
183
|
/**
|
|
150
|
-
*
|
|
184
|
+
* The LF-image primitive both hash-material edges share (this ledger's material
|
|
185
|
+
* and Prop 310 § Design 10's example-pair material). DEFINED in `lf-normalize.ts`
|
|
186
|
+
* — a leaf, so the record grammar can use it without closing an import cycle
|
|
187
|
+
* through this module's Zod schemas — and re-exported here, where every existing
|
|
188
|
+
* caller and the package barrel already reach for it. One definition (Tenet 20).
|
|
189
|
+
*/
|
|
190
|
+
export { lfDeepNormalize } from './lf-normalize.js';
|
|
191
|
+
/**
|
|
192
|
+
* Deterministic fingerprint of the MATERIAL author fields (§8 idempotency), the
|
|
193
|
+
* rule's content-addressed record included (Prop 310 § Design 1).
|
|
151
194
|
* SELF-normalizes newlines (CRLF→LF) on every string it hashes, so a Windows-
|
|
152
195
|
* authored and an LF-authored identical rule hash identically REGARDLESS of the
|
|
153
196
|
* caller — the determinism is single-homed in the hash, not the reader (Tenet-20,
|
|
@@ -160,11 +203,27 @@ export type AuthoringLedgerEntry = z.infer<typeof AuthoringLedgerEntrySchema>;
|
|
|
160
203
|
* row — otherwise the rule reads `unchanged`, no row is appended, and the ledger
|
|
161
204
|
* keeps the STALE split. `authoredAt` stays excluded (a timestamp refresh is a
|
|
162
205
|
* no-op, §8); every OTHER ledger-attested mutable field is covered here.
|
|
206
|
+
*
|
|
207
|
+
* IDENTITY (`author`/`targetDefect`) is excluded. `ruleId` is NOT a separate
|
|
208
|
+
* exclusion since Prop 310 slice 3: it rides inside each derived
|
|
209
|
+
* `positiveFixtures[].preimageSource` as the § Design 10 join key. Because the
|
|
210
|
+
* intake reuses an identity's persisted id and never re-mints it, that value is
|
|
211
|
+
* constant across revisions of one rule and cannot make an unchanged rule read
|
|
212
|
+
* `revised`.
|
|
163
213
|
*/
|
|
164
214
|
export declare function authoringContentHash(material: {
|
|
165
215
|
declaredEngine: string;
|
|
166
216
|
structuralClass: string;
|
|
167
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Prop 310 § Design 1 — the sha256 of the LF-admitted RECORD BYTES, standing in
|
|
219
|
+
* for the matcher the pre-slice-3 material carried inline as `dslSource`. The
|
|
220
|
+
* record's PATH is deliberately absent: § Design 1 rules that a rename changes no
|
|
221
|
+
* identity, so a path in the material would force a spurious re-attestation. An
|
|
222
|
+
* `examples` edit still moves this hash (it moves the bytes) AND moves the derived
|
|
223
|
+
* `positiveFixtures[].preimageSource.pairHash` — the § Design 10 drift sensor,
|
|
224
|
+
* with no second mechanism.
|
|
225
|
+
*/
|
|
226
|
+
recordContentHash: string;
|
|
168
227
|
positiveFixtures: unknown;
|
|
169
228
|
negativeFixtures?: unknown;
|
|
170
229
|
origin: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-ledger.d.ts","sourceRoot":"","sources":["../../src/spine/authoring-ledger.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"authoring-ledger.d.ts","sourceRoot":"","sources":["../../src/spine/authoring-ledger.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,wFAAwF;AACxF,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;IAInC,0JAA0J;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAS1J;;;;;;;;;;;;;;OAcG;;IAEH;;;;;;;OAOG;;IAEH;;;;;;;;;;OAUG;;IAEH;;;;;;;;;;OAUG;;;;;;;;;;;IAQH;;;;;;;;;;;;OAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGI,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,+BAA+B,EAAE,OAAO,CAAC;IACzC,sGAAsG;IACtG,qBAAqB,EAAE,OAAO,CAAC;IAC/B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,MAAM,CAKT;AAMD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAsC5E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAuB9F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GACvC,oBAAoB,EAAE,CAIxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GAAG;IACpF,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB,CA2BA"}
|
|
@@ -23,8 +23,10 @@ import * as fs from 'node:fs';
|
|
|
23
23
|
import * as path from 'node:path';
|
|
24
24
|
import { z } from 'zod';
|
|
25
25
|
import { canonicalStringify } from '../compile-manifest.js';
|
|
26
|
+
import { SHA256_HEX_RE } from '../compiler-schema.js';
|
|
26
27
|
import { TotemError } from '../errors.js';
|
|
27
28
|
import { AuthoredOriginSchema, DeclaredEngineSchema, StructEligResultSchema, } from './authored-rule.js';
|
|
29
|
+
import { lfDeepNormalize } from './lf-normalize.js';
|
|
28
30
|
const nonEmpty = (label) => z.string().refine((s) => s.trim().length > 0, { message: `${label} must be non-empty` });
|
|
29
31
|
/** The spine subdirectory + filename the authoring-ledger lives at, under `.totem/`. */
|
|
30
32
|
export const AUTHORING_LEDGER_DIR = 'spine';
|
|
@@ -82,40 +84,52 @@ export const AuthoringLedgerEntrySchema = z
|
|
|
82
84
|
* materialize path fail-louds when a frozen-artifact run meets an
|
|
83
85
|
* uncommitted entry.
|
|
84
86
|
*/
|
|
85
|
-
freezeCommitment: z
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
freezeCommitment: z.string().regex(SHA256_HEX_RE).optional(),
|
|
88
|
+
/**
|
|
89
|
+
* Prop 310 § Design 1 — the rule record this entry was authored from. Present
|
|
90
|
+
* iff the rule is record-carried (every rule since slice 3; pre-slice-3 rows
|
|
91
|
+
* omit it and still parse).
|
|
92
|
+
*
|
|
93
|
+
* `contentHash` is what binds the §8 attestations to the EXACT ingested bytes
|
|
94
|
+
* (the § Design 1 attestation-relocation constraint) and is inside the material
|
|
95
|
+
* hash below. `path` is INFORMATIONAL: § Design 1 says renaming a record
|
|
96
|
+
* changes no identity, so the path must not force a re-attestation, and it is
|
|
97
|
+
* deliberately excluded from the material.
|
|
98
|
+
*/
|
|
99
|
+
record: z
|
|
100
|
+
.object({
|
|
101
|
+
path: nonEmpty('record.path'),
|
|
102
|
+
contentHash: z.string().regex(SHA256_HEX_RE),
|
|
103
|
+
})
|
|
104
|
+
.strict()
|
|
88
105
|
.optional(),
|
|
89
106
|
/**
|
|
90
|
-
* Fingerprint of the MATERIAL author input (engine / class /
|
|
91
|
-
* fixtures / origin) — identity (`author`/`targetDefect
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
107
|
+
* Fingerprint of the MATERIAL author input (engine / class / record bytes /
|
|
108
|
+
* fixtures / origin) — identity (`author`/`targetDefect`) AND `authoredAt`
|
|
109
|
+
* EXCLUDED, so a pure timestamp refresh is a no-op (§8: a timestamp drift must
|
|
110
|
+
* not churn the rule) while a matcher/fixture edit appends a new revision row
|
|
111
|
+
* under the SAME `ruleId`. Equal hash on re-read ⇒ no append.
|
|
112
|
+
*
|
|
113
|
+
* `ruleId` enters the material in exactly ONE place since Prop 310 slice 3: as
|
|
114
|
+
* the § Design 10 join key inside each derived
|
|
115
|
+
* `positiveFixtures[].preimageSource`. It is stable per identity (reused from
|
|
116
|
+
* the ledger, never re-minted), so it cannot churn an unchanged rule — the §8
|
|
117
|
+
* "identity is not material" property is preserved in effect, not by absence.
|
|
96
118
|
*/
|
|
97
119
|
contentHash: nonEmpty('contentHash'),
|
|
98
120
|
})
|
|
99
121
|
.strict();
|
|
100
122
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
123
|
+
* The LF-image primitive both hash-material edges share (this ledger's material
|
|
124
|
+
* and Prop 310 § Design 10's example-pair material). DEFINED in `lf-normalize.ts`
|
|
125
|
+
* — a leaf, so the record grammar can use it without closing an import cycle
|
|
126
|
+
* through this module's Zod schemas — and re-exported here, where every existing
|
|
127
|
+
* caller and the package barrel already reach for it. One definition (Tenet 20).
|
|
106
128
|
*/
|
|
107
|
-
|
|
108
|
-
if (typeof value === 'string')
|
|
109
|
-
return value.replace(/\r\n/g, '\n');
|
|
110
|
-
if (Array.isArray(value))
|
|
111
|
-
return value.map(lfDeepNormalize);
|
|
112
|
-
if (value !== null && typeof value === 'object') {
|
|
113
|
-
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, lfDeepNormalize(v)]));
|
|
114
|
-
}
|
|
115
|
-
return value;
|
|
116
|
-
}
|
|
129
|
+
export { lfDeepNormalize } from './lf-normalize.js';
|
|
117
130
|
/**
|
|
118
|
-
* Deterministic fingerprint of the MATERIAL author fields (§8 idempotency)
|
|
131
|
+
* Deterministic fingerprint of the MATERIAL author fields (§8 idempotency), the
|
|
132
|
+
* rule's content-addressed record included (Prop 310 § Design 1).
|
|
119
133
|
* SELF-normalizes newlines (CRLF→LF) on every string it hashes, so a Windows-
|
|
120
134
|
* authored and an LF-authored identical rule hash identically REGARDLESS of the
|
|
121
135
|
* caller — the determinism is single-homed in the hash, not the reader (Tenet-20,
|
|
@@ -128,6 +142,13 @@ function lfDeepNormalize(value) {
|
|
|
128
142
|
* row — otherwise the rule reads `unchanged`, no row is appended, and the ledger
|
|
129
143
|
* keeps the STALE split. `authoredAt` stays excluded (a timestamp refresh is a
|
|
130
144
|
* no-op, §8); every OTHER ledger-attested mutable field is covered here.
|
|
145
|
+
*
|
|
146
|
+
* IDENTITY (`author`/`targetDefect`) is excluded. `ruleId` is NOT a separate
|
|
147
|
+
* exclusion since Prop 310 slice 3: it rides inside each derived
|
|
148
|
+
* `positiveFixtures[].preimageSource` as the § Design 10 join key. Because the
|
|
149
|
+
* intake reuses an identity's persisted id and never re-mints it, that value is
|
|
150
|
+
* constant across revisions of one rule and cannot make an unchanged rule read
|
|
151
|
+
* `revised`.
|
|
131
152
|
*/
|
|
132
153
|
export function authoringContentHash(material) {
|
|
133
154
|
return createHash('sha256')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-ledger.js","sourceRoot":"","sources":["../../src/spine/authoring-ledger.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,0EAA0E;AAC1E,uEAAuE;AACvE,kFAAkF;AAClF,gFAAgF;AAChF,kFAAkF;AAClF,iFAAiF;AACjF,4CAA4C;AAC5C,EAAE;AACF,qEAAqE;AACrE,2EAA2E;AAC3E,8EAA8E;AAC9E,kEAAkE;AAClE,iFAAiF;AACjF,2EAA2E;AAC3E,2EAA2E;AAC3E,iFAAiF;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,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AG,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YAC7C,MAAM,IAAI,UAAU,CAClB,cAAc,EACd,mCAAmC,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,YAAY,sBAAsB,QAAQ,CAAC,MAAM,UAAU,CAAC,CAAC,MAAM,IAAI,EAC1H,oFAAoF,CACrF,CAAC;QACJ,CAAC;QACD,MAAM,aAAa,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACrD,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,GAAG,EAAE,CAAC;YACzD,MAAM,IAAI,UAAU,CAClB,cAAc,EACd,iCAAiC,CAAC,CAAC,MAAM,8BAA8B,EACvE,oFAAoF,CACrF,CAAC;QACJ,CAAC;QACD,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACpC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QACtE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -96,6 +96,20 @@ describe('authoring-ledger fail-loud round-trip (FM(e))', () => {
|
|
|
96
96
|
fs.writeFileSync(file, '{not valid json\n', 'utf-8');
|
|
97
97
|
expect(() => readAuthoringLedger(dir)).toThrow();
|
|
98
98
|
});
|
|
99
|
+
it('round-trips the Prop 310 record binding (path + contentHash) verbatim', () => {
|
|
100
|
+
const entry = baseEntry({
|
|
101
|
+
record: { path: '.totem/rules/no-console.rule.yaml', contentHash: 'c'.repeat(64) },
|
|
102
|
+
});
|
|
103
|
+
appendAuthoringLedgerEntry(dir, entry);
|
|
104
|
+
expect(readAuthoringLedger(dir)[0]?.record).toEqual(entry.record);
|
|
105
|
+
});
|
|
106
|
+
it('READS a pre-Prop-310 row carrying NO record binding (optional, additive)', () => {
|
|
107
|
+
appendAuthoringLedgerEntry(dir, baseEntry());
|
|
108
|
+
expect(readAuthoringLedger(dir)[0]?.record).toBeUndefined();
|
|
109
|
+
});
|
|
110
|
+
it('fail-loud on a record binding whose contentHash is not a sha256 hex (the attestation basis)', () => {
|
|
111
|
+
expect(() => appendAuthoringLedgerEntry(dir, baseEntry({ record: { path: '.totem/rules/x.rule.yaml', contentHash: 'short' } }))).toThrow();
|
|
112
|
+
});
|
|
99
113
|
it('fail-loud (schema) on an incomplete entry — never reaches disk silently', () => {
|
|
100
114
|
expect(() => appendAuthoringLedgerEntry(dir, { ruleId: 'x' })).toThrow();
|
|
101
115
|
});
|
|
@@ -104,7 +118,8 @@ describe('authoringContentHash (§8 revision detection — material-only)', () =
|
|
|
104
118
|
const material = {
|
|
105
119
|
declaredEngine: 'regex',
|
|
106
120
|
structuralClass: 'forbidden-literal-token',
|
|
107
|
-
|
|
121
|
+
// Prop 310 § Design 1: the matcher's stand-in is the RECORD's content hash.
|
|
122
|
+
recordContentHash: 'a'.repeat(64),
|
|
108
123
|
positiveFixtures: [{ pr: 1 }],
|
|
109
124
|
origin: { kind: 'from-scratch' },
|
|
110
125
|
splitRef: 'split-2026-06-27',
|
|
@@ -119,8 +134,8 @@ describe('authoringContentHash (§8 revision detection — material-only)', () =
|
|
|
119
134
|
it('is deterministic for identical material', () => {
|
|
120
135
|
expect(authoringContentHash(material)).toBe(authoringContentHash({ ...material }));
|
|
121
136
|
});
|
|
122
|
-
it('changes when the
|
|
123
|
-
expect(authoringContentHash(material)).not.toBe(authoringContentHash({ ...material,
|
|
137
|
+
it('changes when the RECORD BYTES change (a revision — Prop 310 § Design 1)', () => {
|
|
138
|
+
expect(authoringContentHash(material)).not.toBe(authoringContentHash({ ...material, recordContentHash: 'b'.repeat(64) }));
|
|
124
139
|
});
|
|
125
140
|
it('changes when an attestation changes (splitRef) — greptile-P1/CR diff-review', () => {
|
|
126
141
|
expect(authoringContentHash(material)).not.toBe(authoringContentHash({ ...material, splitRef: 'split-other' }));
|
|
@@ -140,10 +155,8 @@ describe('authoringContentHash (§8 revision detection — material-only)', () =
|
|
|
140
155
|
expect(withCommitment).not.toBe(authoringContentHash({ ...material, freezeCommitment: 'b'.repeat(64) }));
|
|
141
156
|
});
|
|
142
157
|
it('is CRLF-invariant — self-normalizes newlines regardless of the caller (Tenet-20 single-home)', () => {
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
expect(authoringContentHash({ ...material, dslSource: 'line-a\r\nline-b' })).toBe(authoringContentHash({ ...material, dslSource: 'line-a\nline-b' }));
|
|
146
|
-
// and a nested fixture string (not just dslSource) is normalized too.
|
|
158
|
+
// A nested fixture string is normalized even if the CALLER never normalized —
|
|
159
|
+
// the determinism lives in the hash, not the reader (gemini).
|
|
147
160
|
expect(authoringContentHash({ ...material, positiveFixtures: [{ pr: 1, matchedSpan: 'a\r\nb' }] })).toBe(authoringContentHash({ ...material, positiveFixtures: [{ pr: 1, matchedSpan: 'a\nb' }] }));
|
|
148
161
|
// and a string nested INSIDE the §4 preimageSource union (deeper than matchedSpan) is
|
|
149
162
|
// normalized too — the deep-normalize must reach the new union depth, not just the fixture top.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authoring-ledger.test.js","sourceRoot":"","sources":["../../src/spine/authoring-ledger.test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,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AS,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type ProvenanceRecord } from '../compiler-schema.js';
|
|
3
|
+
import type { ParsedRuleRecord } from './rule-record.js';
|
|
3
4
|
/**
|
|
4
5
|
* Stage-2 classifier disposition (ADR-091 funnel, the gate). A `structural`
|
|
5
6
|
* (syntactic-invariant) candidate is compile-eligible; a `behavioral` candidate
|
|
@@ -23,7 +24,23 @@ export interface CompileInputCandidate {
|
|
|
23
24
|
provenance: ProvenanceRecord;
|
|
24
25
|
classifierDisposition: ClassifierDisposition;
|
|
25
26
|
classifierLedgerRef: string;
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* The lesson-markdown DSL carrier. EXACTLY ONE of `dslSource` / `record` is
|
|
29
|
+
* present on any candidate — the XOR is a producer contract asserted up front
|
|
30
|
+
* in `compileCandidate` (both or neither throws). The MINED producer always
|
|
31
|
+
* carries this one; the AUTHORED producer carries `record` since Prop 310
|
|
32
|
+
* slice 3 made the record the only authoring surface.
|
|
33
|
+
*/
|
|
34
|
+
dslSource?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Prop 310 § Design 1 — the parsed `.totem/rules/<slug>.rule.yaml` record, the
|
|
37
|
+
* other half of the carrier XOR above. Carried ALREADY PARSED (slice 1's
|
|
38
|
+
* `ParsedRuleRecord`): re-serialising a record into lesson markdown just to
|
|
39
|
+
* re-parse it would reintroduce the incumbent grammar this proposal supersedes,
|
|
40
|
+
* so `compileCandidate` dispatches straight to `compileRuleRecord` and never
|
|
41
|
+
* touches `extractManualPattern` on this path.
|
|
42
|
+
*/
|
|
43
|
+
record?: ParsedRuleRecord;
|
|
27
44
|
/**
|
|
28
45
|
* ADR-112 §3 (#2259/#7) — the engine the structural-eligibility whitelist judged
|
|
29
46
|
* this rule for (AUTHORED producer only). When present, `compileCandidate` asserts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-rule.d.ts","sourceRoot":"","sources":["../../src/spine/candidate-rule.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"candidate-rule.d.ts","sourceRoot":"","sources":["../../src/spine/candidate-rule.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,yCAAuC,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,UAAU,CAAC;IAC9C;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,IAAI,CAAC;CAClB;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;IACpC;;;;;;OAMG;;;;;;;;;;;;;;;;;IAEH,4EAA4E;;IAE5E;;;;;;OAMG;;IAIH;;;;;OAKG;;IAIH;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-rule.js","sourceRoot":"","sources":["../../src/spine/candidate-rule.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,wEAAwE;AACxE,gFAAgF;AAChF,yEAAyE;AACzE,yEAAyE;AACzE,8EAA8E;AAC9E,6DAA6D;AAE7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAyB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"candidate-rule.js","sourceRoot":"","sources":["../../src/spine/candidate-rule.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,yEAAyE;AACzE,2EAA2E;AAC3E,4EAA4E;AAC5E,wEAAwE;AACxE,gFAAgF;AAChF,yEAAyE;AACzE,yEAAyE;AACzE,8EAA8E;AAC9E,6DAA6D;AAE7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAyB,MAAM,uBAAuB,CAAC;AAGzF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC;AAyDhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD;;;;;;OAMG;IACH,UAAU,EAAE,yBAAyB;IACrC,4EAA4E;IAC5E,qBAAqB,EAAE,2BAA2B;IAClD;;;;;;OAMG;IACH,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;QACjE,OAAO,EAAE,0DAA0D;KACpE,CAAC;IACF;;;;;OAKG;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;QACvD,OAAO,EAAE,6BAA6B;KACvC,CAAC;IACF;;;;;OAKG;IACH,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;CAC5B,CAAC,CAAC"}
|
|
@@ -32,11 +32,11 @@ export declare const CertCorpusSeedSchema: z.ZodEffects<z.ZodObject<{
|
|
|
32
32
|
includeGlobs: z.ZodArray<z.ZodString, "many">;
|
|
33
33
|
excludeGlobs: z.ZodArray<z.ZodString, "many">;
|
|
34
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
includeGlobs: string[];
|
|
36
35
|
excludeGlobs: string[];
|
|
37
|
-
}, {
|
|
38
36
|
includeGlobs: string[];
|
|
37
|
+
}, {
|
|
39
38
|
excludeGlobs: string[];
|
|
39
|
+
includeGlobs: string[];
|
|
40
40
|
}>;
|
|
41
41
|
excludeRevertPairs: z.ZodDefault<z.ZodBoolean>;
|
|
42
42
|
excludeBotPrs: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -51,8 +51,8 @@ export declare const CertCorpusSeedSchema: z.ZodEffects<z.ZodObject<{
|
|
|
51
51
|
n: number;
|
|
52
52
|
};
|
|
53
53
|
codePathClassifier: {
|
|
54
|
-
includeGlobs: string[];
|
|
55
54
|
excludeGlobs: string[];
|
|
55
|
+
includeGlobs: string[];
|
|
56
56
|
};
|
|
57
57
|
excludeRevertPairs: boolean;
|
|
58
58
|
excludeBotPrs: boolean;
|
|
@@ -67,8 +67,8 @@ export declare const CertCorpusSeedSchema: z.ZodEffects<z.ZodObject<{
|
|
|
67
67
|
n: number;
|
|
68
68
|
};
|
|
69
69
|
codePathClassifier: {
|
|
70
|
-
includeGlobs: string[];
|
|
71
70
|
excludeGlobs: string[];
|
|
71
|
+
includeGlobs: string[];
|
|
72
72
|
};
|
|
73
73
|
excludeRevertPairs?: boolean | undefined;
|
|
74
74
|
excludeBotPrs?: boolean | undefined;
|
|
@@ -200,8 +200,8 @@ export declare const CertCorpusSeedSchema: z.ZodEffects<z.ZodObject<{
|
|
|
200
200
|
n: number;
|
|
201
201
|
};
|
|
202
202
|
codePathClassifier: {
|
|
203
|
-
includeGlobs: string[];
|
|
204
203
|
excludeGlobs: string[];
|
|
204
|
+
includeGlobs: string[];
|
|
205
205
|
};
|
|
206
206
|
excludeRevertPairs: boolean;
|
|
207
207
|
excludeBotPrs: boolean;
|
|
@@ -256,8 +256,8 @@ export declare const CertCorpusSeedSchema: z.ZodEffects<z.ZodObject<{
|
|
|
256
256
|
n: number;
|
|
257
257
|
};
|
|
258
258
|
codePathClassifier: {
|
|
259
|
-
includeGlobs: string[];
|
|
260
259
|
excludeGlobs: string[];
|
|
260
|
+
includeGlobs: string[];
|
|
261
261
|
};
|
|
262
262
|
excludeRevertPairs?: boolean | undefined;
|
|
263
263
|
excludeBotPrs?: boolean | undefined;
|
|
@@ -312,8 +312,8 @@ export declare const CertCorpusSeedSchema: z.ZodEffects<z.ZodObject<{
|
|
|
312
312
|
n: number;
|
|
313
313
|
};
|
|
314
314
|
codePathClassifier: {
|
|
315
|
-
includeGlobs: string[];
|
|
316
315
|
excludeGlobs: string[];
|
|
316
|
+
includeGlobs: string[];
|
|
317
317
|
};
|
|
318
318
|
excludeRevertPairs: boolean;
|
|
319
319
|
excludeBotPrs: boolean;
|
|
@@ -368,8 +368,8 @@ export declare const CertCorpusSeedSchema: z.ZodEffects<z.ZodObject<{
|
|
|
368
368
|
n: number;
|
|
369
369
|
};
|
|
370
370
|
codePathClassifier: {
|
|
371
|
-
includeGlobs: string[];
|
|
372
371
|
excludeGlobs: string[];
|
|
372
|
+
includeGlobs: string[];
|
|
373
373
|
};
|
|
374
374
|
excludeRevertPairs?: boolean | undefined;
|
|
375
375
|
excludeBotPrs?: boolean | undefined;
|
package/dist/spine/compile.d.ts
CHANGED
|
@@ -49,7 +49,10 @@ export interface CompileStageResult {
|
|
|
49
49
|
classifierLedger: ClassifierLedger;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Compile a single compile-routed candidate's
|
|
52
|
+
* Compile a single compile-routed candidate's rule CARRIER into a `CompiledRule`.
|
|
53
|
+
* A candidate carries exactly one: the mined producer's lesson-markdown `dslSource`
|
|
54
|
+
* (parsed here by `extractManualPattern`) or the authored producer's already-parsed
|
|
55
|
+
* Prop 310 `record` (lowered by `compileRuleRecord`). Both/neither throws up front.
|
|
53
56
|
* PURE (no IO). Throws — fail loud, never a silent skip — on a behavioral candidate
|
|
54
57
|
* (FM(c) code backstop) or a structural candidate whose `dslSource` yields no usable
|
|
55
58
|
* pattern (a producer-contract violation: slice-2's `isUsableDsl` preflight should
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/spine/compile.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/spine/compile.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AA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I,EAAE,gBAAgB,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAyF7B"}
|
package/dist/spine/compile.js
CHANGED
|
@@ -26,12 +26,19 @@ import { CompiledRuleSchema, isAuthoredProvenance, } from '../compiler-schema.js
|
|
|
26
26
|
import { extractManualPattern } from '../lesson-pattern.js';
|
|
27
27
|
import { getDefaultBaseline, verifyAgainstCodebase, } from '../stage4-verifier.js';
|
|
28
28
|
import { AUTHORED_RULE_ID_RE } from './authored-rule.js';
|
|
29
|
+
// Prop 310 slice 2's lowering — the record carrier's compile path. `record-lower.ts`
|
|
30
|
+
// imports only the `CompileOutcome` TYPE from this module, so the edge is one-way at
|
|
31
|
+
// runtime.
|
|
32
|
+
import { compileRuleRecord } from './record-lower.js';
|
|
29
33
|
/** Stable, deterministic lesson heading for a candidate (unique via its `clr-…` ledger ref). */
|
|
30
34
|
function candidateHeading(candidate) {
|
|
31
35
|
return `Gate-1 rule candidate (${candidate.classifierLedgerRef})`;
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
34
|
-
* Compile a single compile-routed candidate's
|
|
38
|
+
* Compile a single compile-routed candidate's rule CARRIER into a `CompiledRule`.
|
|
39
|
+
* A candidate carries exactly one: the mined producer's lesson-markdown `dslSource`
|
|
40
|
+
* (parsed here by `extractManualPattern`) or the authored producer's already-parsed
|
|
41
|
+
* Prop 310 `record` (lowered by `compileRuleRecord`). Both/neither throws up front.
|
|
35
42
|
* PURE (no IO). Throws — fail loud, never a silent skip — on a behavioral candidate
|
|
36
43
|
* (FM(c) code backstop) or a structural candidate whose `dslSource` yields no usable
|
|
37
44
|
* pattern (a producer-contract violation: slice-2's `isUsableDsl` preflight should
|
|
@@ -68,9 +75,49 @@ export function compileCandidate(candidate, opts) {
|
|
|
68
75
|
else if (candidate.ruleId !== undefined) {
|
|
69
76
|
throw new Error(`[Totem Error] compileCandidate: non-authored candidate '${candidate.classifierLedgerRef}' must not carry a ruleId — mined identities stay dslSource-derived (ADR-112 §8 authored-only contract)`);
|
|
70
77
|
}
|
|
78
|
+
// ── Prop 310 § Design 1 — the carrier XOR, asserted UP FRONT (before any parse) ──
|
|
79
|
+
//
|
|
80
|
+
// A candidate carries EXACTLY ONE rule carrier: the mined producer's lesson-markdown
|
|
81
|
+
// `dslSource`, or the authored producer's already-parsed `record`. Both or neither is
|
|
82
|
+
// a PRODUCER BUG, not an authoring defect, so it throws with the same fail-loud idiom
|
|
83
|
+
// as the behavioral/ruleId preconditions above rather than returning a `rejected`
|
|
84
|
+
// outcome — and it is asserted before any parse work so a violation can never be
|
|
85
|
+
// masked by a coincidental parse error.
|
|
86
|
+
const record = candidate.record;
|
|
87
|
+
const dslSource = candidate.dslSource;
|
|
88
|
+
if (record !== undefined) {
|
|
89
|
+
if (dslSource !== undefined) {
|
|
90
|
+
throw new Error(`[Totem Error] compileCandidate: candidate '${candidate.classifierLedgerRef}' carries BOTH a record and a dslSource — exactly one rule carrier is a producer contract (Prop 310 § Design 1); compiling either one would silently discard the other`);
|
|
91
|
+
}
|
|
92
|
+
// The record path is ALREADY PARSED (slice 1) and lowers through slice 2's
|
|
93
|
+
// `compileRuleRecord`; `extractManualPattern`/`sanitizeFileGlobs` never run on it.
|
|
94
|
+
// Identity is the same §8 precondition asserted above — reused, never re-derived.
|
|
95
|
+
//
|
|
96
|
+
// The §3 engine binding is a CHAIN of two asserts on this path, and both legs are
|
|
97
|
+
// needed because they bind DIFFERENT edges:
|
|
98
|
+
// 1. here — the whitelist-judged `declaredEngine` vs the record's derived engine
|
|
99
|
+
// (the ADR-112 §3 #2259/#7 guarantee: a rule must not compile under an engine
|
|
100
|
+
// the eligibility check never cleared);
|
|
101
|
+
// 2. inside `compileRuleRecord` — the record's `target.type` vs the payload's
|
|
102
|
+
// actual compilation path (Prop 310 § Design 3's non-tautology condition).
|
|
103
|
+
// Dropping leg 1 on the record path would silently retire a shipped guarantee,
|
|
104
|
+
// since leg 2 says nothing about the whitelist verdict. Three independently
|
|
105
|
+
// originating facts, two asserts, no tautology.
|
|
106
|
+
if (candidate.declaredEngine !== undefined &&
|
|
107
|
+
candidate.declaredEngine !== record.derivedEngine) {
|
|
108
|
+
throw new Error(`[Totem Error] compileCandidate: candidate '${candidate.classifierLedgerRef}' declared engine '${candidate.declaredEngine}' but its record derives engine '${record.derivedEngine}' from target.type — the structural-eligibility whitelist was judged for a different engine (ADR-112 §3); intake DERIVES declaredEngine from the record (Prop 310 § Design 3/R17), so a divergence here is a producer bug`);
|
|
109
|
+
}
|
|
110
|
+
if (authoredLessonHash === undefined) {
|
|
111
|
+
throw new Error(`[Totem Error] compileCandidate: record-carried candidate '${candidate.classifierLedgerRef}' has no authored, minted ruleId — a record candidate is produced only by the ADR-112 §8 authored front-end, which mints identity at the intake seam (Prop 310 § Design 3/R17)`);
|
|
112
|
+
}
|
|
113
|
+
return compileRuleRecord(record, { ruleId: authoredLessonHash, now: opts.now });
|
|
114
|
+
}
|
|
115
|
+
if (dslSource === undefined) {
|
|
116
|
+
throw new Error(`[Totem Error] compileCandidate: candidate '${candidate.classifierLedgerRef}' carries NEITHER a record nor a dslSource — exactly one rule carrier is a producer contract (Prop 310 § Design 1)`);
|
|
117
|
+
}
|
|
71
118
|
// May throw TotemParseError (e.g. a yaml fence under a non-ast-grep engine) — that
|
|
72
119
|
// propagates loudly as a producer bug; it would also have been dropped at extract.
|
|
73
|
-
const mp = extractManualPattern(
|
|
120
|
+
const mp = extractManualPattern(dslSource);
|
|
74
121
|
if (mp === null) {
|
|
75
122
|
throw new Error(`[Totem Error] compileCandidate: structural candidate '${candidate.classifierLedgerRef}' has no usable pattern — slice-2 preflight (isUsableDsl) should have dropped it (preflight↔parser desync)`);
|
|
76
123
|
}
|
|
@@ -94,7 +141,7 @@ export function compileCandidate(candidate, opts) {
|
|
|
94
141
|
const rule = CompiledRuleSchema.parse({
|
|
95
142
|
// §8 id-unification: authored identity is the validated, minted ruleId (asserted
|
|
96
143
|
// up front, above); a mined candidate stays the dslSource-derived content hash.
|
|
97
|
-
lessonHash: authoredLessonHash ?? hashLesson(heading,
|
|
144
|
+
lessonHash: authoredLessonHash ?? hashLesson(heading, dslSource),
|
|
98
145
|
lessonHeading: heading,
|
|
99
146
|
message: mp.message ?? heading,
|
|
100
147
|
engine: mp.engine,
|