@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
package/dist/spine/ledgers.d.ts
CHANGED
|
@@ -84,10 +84,10 @@ export declare const EmissionLedgerEntrySchema: z.ZodObject<{
|
|
|
84
84
|
kind?: "mined" | undefined;
|
|
85
85
|
};
|
|
86
86
|
unverified: true;
|
|
87
|
-
classifierDisposition: "structural" | "behavioral";
|
|
88
|
-
classifierLedgerRef: string;
|
|
89
87
|
candidateRef: string;
|
|
88
|
+
classifierDisposition: "structural" | "behavioral";
|
|
90
89
|
routing: "compile" | "rag-only";
|
|
90
|
+
classifierLedgerRef: string;
|
|
91
91
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
92
92
|
}, {
|
|
93
93
|
provenance: {
|
|
@@ -97,10 +97,10 @@ export declare const EmissionLedgerEntrySchema: z.ZodObject<{
|
|
|
97
97
|
kind?: "mined" | undefined;
|
|
98
98
|
};
|
|
99
99
|
unverified: true;
|
|
100
|
-
classifierDisposition: "structural" | "behavioral";
|
|
101
|
-
classifierLedgerRef: string;
|
|
102
100
|
candidateRef: string;
|
|
101
|
+
classifierDisposition: "structural" | "behavioral";
|
|
103
102
|
routing: "compile" | "rag-only";
|
|
103
|
+
classifierLedgerRef: string;
|
|
104
104
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
105
105
|
}>;
|
|
106
106
|
export type EmissionLedgerEntry = z.infer<typeof EmissionLedgerEntrySchema>;
|
|
@@ -142,10 +142,10 @@ export declare const EmissionLedgerSchema: z.ZodObject<{
|
|
|
142
142
|
kind?: "mined" | undefined;
|
|
143
143
|
};
|
|
144
144
|
unverified: true;
|
|
145
|
-
classifierDisposition: "structural" | "behavioral";
|
|
146
|
-
classifierLedgerRef: string;
|
|
147
145
|
candidateRef: string;
|
|
146
|
+
classifierDisposition: "structural" | "behavioral";
|
|
148
147
|
routing: "compile" | "rag-only";
|
|
148
|
+
classifierLedgerRef: string;
|
|
149
149
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
150
150
|
}, {
|
|
151
151
|
provenance: {
|
|
@@ -155,10 +155,10 @@ export declare const EmissionLedgerSchema: z.ZodObject<{
|
|
|
155
155
|
kind?: "mined" | undefined;
|
|
156
156
|
};
|
|
157
157
|
unverified: true;
|
|
158
|
-
classifierDisposition: "structural" | "behavioral";
|
|
159
|
-
classifierLedgerRef: string;
|
|
160
158
|
candidateRef: string;
|
|
159
|
+
classifierDisposition: "structural" | "behavioral";
|
|
161
160
|
routing: "compile" | "rag-only";
|
|
161
|
+
classifierLedgerRef: string;
|
|
162
162
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
163
163
|
}>, "many">;
|
|
164
164
|
/**
|
|
@@ -181,10 +181,10 @@ export declare const EmissionLedgerSchema: z.ZodObject<{
|
|
|
181
181
|
kind?: "mined" | undefined;
|
|
182
182
|
};
|
|
183
183
|
unverified: true;
|
|
184
|
-
classifierDisposition: "structural" | "behavioral";
|
|
185
|
-
classifierLedgerRef: string;
|
|
186
184
|
candidateRef: string;
|
|
185
|
+
classifierDisposition: "structural" | "behavioral";
|
|
187
186
|
routing: "compile" | "rag-only";
|
|
187
|
+
classifierLedgerRef: string;
|
|
188
188
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
189
189
|
}[];
|
|
190
190
|
extractionInputsAttestation: {
|
|
@@ -199,10 +199,10 @@ export declare const EmissionLedgerSchema: z.ZodObject<{
|
|
|
199
199
|
kind?: "mined" | undefined;
|
|
200
200
|
};
|
|
201
201
|
unverified: true;
|
|
202
|
-
classifierDisposition: "structural" | "behavioral";
|
|
203
|
-
classifierLedgerRef: string;
|
|
204
202
|
candidateRef: string;
|
|
203
|
+
classifierDisposition: "structural" | "behavioral";
|
|
205
204
|
routing: "compile" | "rag-only";
|
|
205
|
+
classifierLedgerRef: string;
|
|
206
206
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
207
207
|
}[];
|
|
208
208
|
extractionInputsAttestation: {
|
|
@@ -734,10 +734,10 @@ export declare const MinerLedgersSchema: z.ZodObject<{
|
|
|
734
734
|
kind?: "mined" | undefined;
|
|
735
735
|
};
|
|
736
736
|
unverified: true;
|
|
737
|
-
classifierDisposition: "structural" | "behavioral";
|
|
738
|
-
classifierLedgerRef: string;
|
|
739
737
|
candidateRef: string;
|
|
738
|
+
classifierDisposition: "structural" | "behavioral";
|
|
740
739
|
routing: "compile" | "rag-only";
|
|
740
|
+
classifierLedgerRef: string;
|
|
741
741
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
742
742
|
}, {
|
|
743
743
|
provenance: {
|
|
@@ -747,10 +747,10 @@ export declare const MinerLedgersSchema: z.ZodObject<{
|
|
|
747
747
|
kind?: "mined" | undefined;
|
|
748
748
|
};
|
|
749
749
|
unverified: true;
|
|
750
|
-
classifierDisposition: "structural" | "behavioral";
|
|
751
|
-
classifierLedgerRef: string;
|
|
752
750
|
candidateRef: string;
|
|
751
|
+
classifierDisposition: "structural" | "behavioral";
|
|
753
752
|
routing: "compile" | "rag-only";
|
|
753
|
+
classifierLedgerRef: string;
|
|
754
754
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
755
755
|
}>, "many">;
|
|
756
756
|
/**
|
|
@@ -773,10 +773,10 @@ export declare const MinerLedgersSchema: z.ZodObject<{
|
|
|
773
773
|
kind?: "mined" | undefined;
|
|
774
774
|
};
|
|
775
775
|
unverified: true;
|
|
776
|
-
classifierDisposition: "structural" | "behavioral";
|
|
777
|
-
classifierLedgerRef: string;
|
|
778
776
|
candidateRef: string;
|
|
777
|
+
classifierDisposition: "structural" | "behavioral";
|
|
779
778
|
routing: "compile" | "rag-only";
|
|
779
|
+
classifierLedgerRef: string;
|
|
780
780
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
781
781
|
}[];
|
|
782
782
|
extractionInputsAttestation: {
|
|
@@ -791,10 +791,10 @@ export declare const MinerLedgersSchema: z.ZodObject<{
|
|
|
791
791
|
kind?: "mined" | undefined;
|
|
792
792
|
};
|
|
793
793
|
unverified: true;
|
|
794
|
-
classifierDisposition: "structural" | "behavioral";
|
|
795
|
-
classifierLedgerRef: string;
|
|
796
794
|
candidateRef: string;
|
|
795
|
+
classifierDisposition: "structural" | "behavioral";
|
|
797
796
|
routing: "compile" | "rag-only";
|
|
797
|
+
classifierLedgerRef: string;
|
|
798
798
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
799
799
|
}[];
|
|
800
800
|
extractionInputsAttestation: {
|
|
@@ -1189,10 +1189,10 @@ export declare const MinerLedgersSchema: z.ZodObject<{
|
|
|
1189
1189
|
kind?: "mined" | undefined;
|
|
1190
1190
|
};
|
|
1191
1191
|
unverified: true;
|
|
1192
|
-
classifierDisposition: "structural" | "behavioral";
|
|
1193
|
-
classifierLedgerRef: string;
|
|
1194
1192
|
candidateRef: string;
|
|
1193
|
+
classifierDisposition: "structural" | "behavioral";
|
|
1195
1194
|
routing: "compile" | "rag-only";
|
|
1195
|
+
classifierLedgerRef: string;
|
|
1196
1196
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
1197
1197
|
}[];
|
|
1198
1198
|
extractionInputsAttestation: {
|
|
@@ -1255,10 +1255,10 @@ export declare const MinerLedgersSchema: z.ZodObject<{
|
|
|
1255
1255
|
kind?: "mined" | undefined;
|
|
1256
1256
|
};
|
|
1257
1257
|
unverified: true;
|
|
1258
|
-
classifierDisposition: "structural" | "behavioral";
|
|
1259
|
-
classifierLedgerRef: string;
|
|
1260
1258
|
candidateRef: string;
|
|
1259
|
+
classifierDisposition: "structural" | "behavioral";
|
|
1261
1260
|
routing: "compile" | "rag-only";
|
|
1261
|
+
classifierLedgerRef: string;
|
|
1262
1262
|
sourceKind?: "bot" | "mixed" | "human" | undefined;
|
|
1263
1263
|
}[];
|
|
1264
1264
|
extractionInputsAttestation: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively LF-normalize every string in a value. Keeps material-hash
|
|
3
|
+
* determinism SINGLE-HOMED in the hash (Tenet-20, gemini diff-review): a hash
|
|
4
|
+
* built on this is CRLF-invariant regardless of whether the caller pre-normalized,
|
|
5
|
+
* so a future caller cannot silently produce a divergent hash by passing
|
|
6
|
+
* un-normalized CRLF input.
|
|
7
|
+
*/
|
|
8
|
+
export declare function lfDeepNormalize(value: unknown): unknown;
|
|
9
|
+
//# sourceMappingURL=lf-normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lf-normalize.d.ts","sourceRoot":"","sources":["../../src/spine/lf-normalize.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAYvD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// ─── The LF-image primitive, single-homed at a LEAF ──────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// Two distinct hash-material edges normalize newlines the same way — the ADR-112
|
|
4
|
+
// §8 authoring-ledger's `authoringContentHash` material and Prop 310 § Design 10's
|
|
5
|
+
// example-pair hash (Amendment 1 item 3's "different edge" note distinguishes the
|
|
6
|
+
// CALL SITES, not the normalizer). Tenet 20 says they share the primitive rather
|
|
7
|
+
// than mirroring it.
|
|
8
|
+
//
|
|
9
|
+
// It lives in its OWN module, not beside either caller, purely for the module
|
|
10
|
+
// graph: `authoring-ledger.ts` builds its Zod schemas from `authored-rule.ts` at
|
|
11
|
+
// top level, and since Prop 310 slice 3 `authored-rule.ts` builds ITS schemas from
|
|
12
|
+
// `rule-record.ts`. Had `rule-record.ts` kept importing the normalizer from the
|
|
13
|
+
// ledger, that would close a runtime cycle whose top-level Zod construction hits a
|
|
14
|
+
// TDZ `ReferenceError` depending only on which module an entry point loads first —
|
|
15
|
+
// a latent, import-order-dependent crash. A leaf with no imports of its own cannot
|
|
16
|
+
// participate in one. `authoring-ledger.ts` re-exports the symbol, so every
|
|
17
|
+
// existing import path and the package barrel are unchanged.
|
|
18
|
+
/**
|
|
19
|
+
* Recursively LF-normalize every string in a value. Keeps material-hash
|
|
20
|
+
* determinism SINGLE-HOMED in the hash (Tenet-20, gemini diff-review): a hash
|
|
21
|
+
* built on this is CRLF-invariant regardless of whether the caller pre-normalized,
|
|
22
|
+
* so a future caller cannot silently produce a divergent hash by passing
|
|
23
|
+
* un-normalized CRLF input.
|
|
24
|
+
*/
|
|
25
|
+
export function lfDeepNormalize(value) {
|
|
26
|
+
if (typeof value === 'string')
|
|
27
|
+
return value.replace(/\r\n/g, '\n');
|
|
28
|
+
if (Array.isArray(value))
|
|
29
|
+
return value.map(lfDeepNormalize);
|
|
30
|
+
// `typeof` first, then the null guard: `typeof null === 'object'`, so both
|
|
31
|
+
// conjuncts are load-bearing and this is the order the codebase's own
|
|
32
|
+
// object-narrowing rule expects.
|
|
33
|
+
if (typeof value === 'object' && value !== null) {
|
|
34
|
+
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, lfDeepNormalize(v)]));
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=lf-normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lf-normalize.js","sourceRoot":"","sources":["../../src/spine/lf-normalize.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,iFAAiF;AACjF,mFAAmF;AACnF,kFAAkF;AAClF,iFAAiF;AACjF,qBAAqB;AACrB,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF,mFAAmF;AACnF,gFAAgF;AAChF,mFAAmF;AACnF,mFAAmF;AACnF,mFAAmF;AACnF,4EAA4E;AAC5E,6DAA6D;AAE7D;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC5D,2EAA2E;IAC3E,sEAAsE;IACtE,iCAAiC;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAC1F,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* legitimate control (Falsifying Metric §1(i)).
|
|
9
9
|
*
|
|
10
10
|
* This module evaluates that differential against a fixture's declared
|
|
11
|
-
* `preimageSource` (lesson-anchored PRIMARY / commit-pair
|
|
11
|
+
* `preimageSource` (lesson-anchored PRIMARY / Prop 310 record-derived / commit-pair
|
|
12
|
+
* FALLBACK — the record source is classified EXACTLY as `lesson`, since both carry
|
|
13
|
+
* their exemplars inline and differ only in the join key) and reports
|
|
12
14
|
* the raw evidence + a differential-level classification. It is deliberately
|
|
13
15
|
* INERT: it wires nothing into the cert path, mints no §5 run verdict, and emits
|
|
14
16
|
* no controls. Slice C2 consumes this to gate control emission; slice D maps the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preimage-differential.d.ts","sourceRoot":"","sources":["../../src/spine/preimage-differential.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"preimage-differential.d.ts","sourceRoot":"","sources":["../../src/spine/preimage-differential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI3F;;;;GAIG;AACH,MAAM,MAAM,2BAA2B;AACrC,6FAA6F;AAC3F,oBAAoB;AACtB;;;GAGG;GACD,YAAY;AACd;;;;;;;GAOG;GACD,YAAY;AACd,+EAA+E;GAC7E,gBAAgB;AAClB;;;;;GAKG;GACD,oBAAoB;AACtB;;;;GAIG;GACD,oBAAoB,CAAC;AAEzB,MAAM,WAAW,0BAA0B;IACzC,iFAAiF;IACjF,OAAO,EAAE,2BAA2B,CAAC;IACrC,mDAAmD;IACnD,UAAU,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC;;;OAGG;IACH,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,yFAAyF;IACzF,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,0FAA0F;IAC1F,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC,oFAAoF;IACpF,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACxE;AA4FD;;;;;;;;;;;;GAYG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,0BAA0B,CAAC,CAiBrC"}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* legitimate control (Falsifying Metric §1(i)).
|
|
9
9
|
*
|
|
10
10
|
* This module evaluates that differential against a fixture's declared
|
|
11
|
-
* `preimageSource` (lesson-anchored PRIMARY / commit-pair
|
|
11
|
+
* `preimageSource` (lesson-anchored PRIMARY / Prop 310 record-derived / commit-pair
|
|
12
|
+
* FALLBACK — the record source is classified EXACTLY as `lesson`, since both carry
|
|
13
|
+
* their exemplars inline and differ only in the join key) and reports
|
|
12
14
|
* the raw evidence + a differential-level classification. It is deliberately
|
|
13
15
|
* INERT: it wires nothing into the cert path, mints no §5 run verdict, and emits
|
|
14
16
|
* no controls. Slice C2 consumes this to gate control emission; slice D maps the
|
|
@@ -34,8 +36,8 @@ function classifyDifferential(firesOnPreimage, silentOnPostimage) {
|
|
|
34
36
|
return 'vacuous-silent';
|
|
35
37
|
return 'fix-shaped';
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
function evaluateInlineExemplarDifferential(rule, source) {
|
|
40
|
+
const sourceKind = source.kind;
|
|
39
41
|
const pre = runSmokeGate(rule, source.badExample);
|
|
40
42
|
const post = runSmokeGate(rule, source.goodExample);
|
|
41
43
|
// An exemplar with no evaluable code cannot establish a differential. Two
|
|
@@ -60,7 +62,7 @@ function evaluateLessonDifferential(rule, source) {
|
|
|
60
62
|
: post.reason);
|
|
61
63
|
return {
|
|
62
64
|
outcome: 'needs-adjudication',
|
|
63
|
-
sourceKind
|
|
65
|
+
sourceKind,
|
|
64
66
|
firesOnPreimage: preUnevaluable ? null : pre.matched,
|
|
65
67
|
silentOnPostimage: postUnevaluable ? null : !post.matched,
|
|
66
68
|
preimageMatchCount: preUnevaluable ? null : pre.matchCount,
|
|
@@ -72,7 +74,7 @@ function evaluateLessonDifferential(rule, source) {
|
|
|
72
74
|
const silentOnPostimage = !post.matched;
|
|
73
75
|
return {
|
|
74
76
|
outcome: classifyDifferential(firesOnPreimage, silentOnPostimage),
|
|
75
|
-
sourceKind
|
|
77
|
+
sourceKind,
|
|
76
78
|
firesOnPreimage,
|
|
77
79
|
silentOnPostimage,
|
|
78
80
|
preimageMatchCount: pre.matchCount,
|
|
@@ -108,7 +110,8 @@ export async function evaluatePreimageDifferential(rule, fixture) {
|
|
|
108
110
|
const source = fixture.preimageSource;
|
|
109
111
|
switch (source.kind) {
|
|
110
112
|
case 'lesson':
|
|
111
|
-
|
|
113
|
+
case 'record':
|
|
114
|
+
return evaluateInlineExemplarDifferential(rule, source);
|
|
112
115
|
case 'commit':
|
|
113
116
|
return deferredCommitResult();
|
|
114
117
|
default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preimage-differential.js","sourceRoot":"","sources":["../../src/spine/preimage-differential.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"preimage-differential.js","sourceRoot":"","sources":["../../src/spine/preimage-differential.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA+ExD,uDAAuD;AAEvD,SAAS,oBAAoB,CAC3B,eAAwB,EACxB,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;QACd,KAAK,QAAQ;YACX,OAAO,kCAAkC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,KAAK,QAAQ;YACX,OAAO,oBAAoB,EAAE,CAAC;QAChC,OAAO,CAAC,CAAC,CAAC;YACR,0EAA0E;YAC1E,4DAA4D;YAC5D,MAAM,WAAW,GAAU,MAAM,CAAC;YAClC,MAAM,IAAI,KAAK,CACb,4EAA4E,MAAM,CAAE,WAA8B,CAAC,IAAI,CAAC,GAAG,CAC5H,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -210,6 +210,65 @@ describe('evaluatePreimageDifferential — commit source is a typed deferral (sl
|
|
|
210
210
|
expect(result.reason).toContain('slice C2');
|
|
211
211
|
});
|
|
212
212
|
});
|
|
213
|
+
// ─── Prop 310 § Design 10 — the record source classifies exactly as `lesson` ──
|
|
214
|
+
describe('evaluatePreimageDifferential — record source (Prop 310 slice 3)', () => {
|
|
215
|
+
/** The DERIVED record fixture: same inline exemplars, the (ruleId, ordinal) join. */
|
|
216
|
+
function recordFixture(badExample, goodExample) {
|
|
217
|
+
return {
|
|
218
|
+
pr: 130,
|
|
219
|
+
preimageSource: {
|
|
220
|
+
kind: 'record',
|
|
221
|
+
ruleId: '0123456789abcdef',
|
|
222
|
+
ordinal: 0,
|
|
223
|
+
pairHash: 'f'.repeat(64),
|
|
224
|
+
badExample,
|
|
225
|
+
goodExample,
|
|
226
|
+
},
|
|
227
|
+
filePath: 'src/sim/level.rs',
|
|
228
|
+
matchedSpan: 'L10-L12',
|
|
229
|
+
contentHash: 'abc123def456',
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
it('classifies a record source EXACTLY as the lesson source does, for every outcome', async () => {
|
|
233
|
+
// The design's word is "evaluated exactly as `lesson`". Asserted as an EQUALITY
|
|
234
|
+
// against the lesson result (modulo the `sourceKind` label), across the whole
|
|
235
|
+
// outcome vocabulary — a per-outcome spot check would let one branch drift.
|
|
236
|
+
const cases = [
|
|
237
|
+
['console.log("debug")', 'logger.info("ok")'], // differential-holds
|
|
238
|
+
['logger.info("ok")', 'console.log("debug")'], // fix-shaped
|
|
239
|
+
['console.log("a")', 'console.log("b")'], // over-match
|
|
240
|
+
['logger.info("a")', 'logger.warn("b")'], // vacuous-silent
|
|
241
|
+
];
|
|
242
|
+
for (const [bad, good] of cases) {
|
|
243
|
+
const viaLesson = await evaluatePreimageDifferential(regexRule(), lessonFixture(bad, good));
|
|
244
|
+
const viaRecord = await evaluatePreimageDifferential(regexRule(), recordFixture(bad, good));
|
|
245
|
+
expect(viaRecord).toEqual({ ...viaLesson, sourceKind: 'record' });
|
|
246
|
+
}
|
|
247
|
+
// …and the four cases really did cover four DISTINCT outcomes, so the equality
|
|
248
|
+
// above is not four repetitions of one branch.
|
|
249
|
+
const outcomes = new Set();
|
|
250
|
+
for (const [bad, good] of cases) {
|
|
251
|
+
outcomes.add((await evaluatePreimageDifferential(regexRule(), recordFixture(bad, good))).outcome);
|
|
252
|
+
}
|
|
253
|
+
expect(outcomes).toEqual(new Set(['differential-holds', 'fix-shaped', 'over-match', 'vacuous-silent']));
|
|
254
|
+
});
|
|
255
|
+
it('reports sourceKind `record`, never the lesson label', async () => {
|
|
256
|
+
const result = await evaluatePreimageDifferential(regexRule(), recordFixture('console.log("debug")', 'logger.info("ok")'));
|
|
257
|
+
expect(result.outcome).toBe('differential-holds');
|
|
258
|
+
expect(result.sourceKind).toBe('record');
|
|
259
|
+
});
|
|
260
|
+
it('carries the § Design 8 exemplar through an ast-grep rule identically', async () => {
|
|
261
|
+
const result = await evaluatePreimageDifferential(astGrepRule(), recordFixture('debugger;\n', 'const x = 1;\n'));
|
|
262
|
+
expect(result.outcome).toBe('differential-holds');
|
|
263
|
+
expect(result.sourceKind).toBe('record');
|
|
264
|
+
});
|
|
265
|
+
it('a whitespace-only side is needs-adjudication on the record source too', async () => {
|
|
266
|
+
const result = await evaluatePreimageDifferential(regexRule(), recordFixture('console.log("bad")', ' \n '));
|
|
267
|
+
expect(result.outcome).toBe('needs-adjudication');
|
|
268
|
+
expect(result.sourceKind).toBe('record');
|
|
269
|
+
expect(result.reason).toContain('goodExample');
|
|
270
|
+
});
|
|
271
|
+
});
|
|
213
272
|
// ─── determinism (Tenet-15) ─────────────────────────
|
|
214
273
|
describe('evaluatePreimageDifferential — determinism', () => {
|
|
215
274
|
it('is a pure function of (rule, fixture): identical inputs yield identical results', async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preimage-differential.test.js","sourceRoot":"","sources":["../../src/spine/preimage-differential.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,yDAAyD;AAEzD,SAAS,SAAS,CAAC,YAAmC,EAAE;IACtD,OAAO;QACL,UAAU,EAAE,cAAc;QAC1B,aAAa,EAAE,gBAAgB;QAC/B,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE,wBAAwB;QACjC,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,sBAAsB;QAClC,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,YAAmC,EAAE;IACxD,OAAO;QACL,UAAU,EAAE,cAAc;QAC1B,aAAa,EAAE,aAAa;QAC5B,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,mCAAmC;QAC5C,MAAM,EAAE,UAAU;QAClB,cAAc,EAAE,UAAU;QAC1B,UAAU,EAAE,sBAAsB;QAClC,GAAG,SAAS;KACb,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,YAAmC,EAAE;IAC3D,OAAO;QACL,UAAU,EAAE,cAAc;QAC1B,aAAa,EAAE,aAAa;QAC5B,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,6BAA6B;QACtC,MAAM,EAAE,UAAU;QAClB,eAAe,EAAE;YACf,IAAI,EAAE;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AM,4BAA4B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC5D,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Prop 310 § Design 4's exemplar — a compound ast-grep record with every optional block. */
|
|
2
|
+
export declare function design4ExemplarRecord(): Record<string, unknown>;
|
|
3
|
+
/** Prop 310 § Design 8's exemplar — the absence / must-contain shape (the census's rule (c)). */
|
|
4
|
+
export declare function design8ExemplarRecord(): Record<string, unknown>;
|
|
5
|
+
//# sourceMappingURL=record-exemplars.fixture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-exemplars.fixture.d.ts","sourceRoot":"","sources":["../../src/spine/record-exemplars.fixture.ts"],"names":[],"mappings":"AAkBA,6FAA6F;AAC7F,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0B/D;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAa/D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// ─── Prop 310's two spec exemplars, transcribed ONCE ─────────────────────────
|
|
2
|
+
//
|
|
3
|
+
// § Design 4's coherent record and § Design 8's `requires:` record are the
|
|
4
|
+
// spec's own worked examples, and § Design 14's normativity flip makes them
|
|
5
|
+
// normative: an implementation that cannot round-trip them is the bug. Both the
|
|
6
|
+
// lowering suite and the runtime suite exercise them, so they are single-homed
|
|
7
|
+
// here rather than transcribed twice (Tenet 20 — two hand-maintained copies of a
|
|
8
|
+
// normative fixture is how one silently drifts from the spec).
|
|
9
|
+
//
|
|
10
|
+
// NOT a test file (`*.fixture.ts` is outside vitest's `src/**\/*.test.ts`
|
|
11
|
+
// include) and deliberately NOT barrel-exported: this is conformance material,
|
|
12
|
+
// not public API. It is a plain module rather than a test-file export so that
|
|
13
|
+
// importing it cannot re-register another suite's `describe` blocks.
|
|
14
|
+
//
|
|
15
|
+
// Comments are stripped and YAML block scalars are resolved to their parsed
|
|
16
|
+
// values, since these are the PARSED shapes; slice 1's suite carries the same
|
|
17
|
+
// two records in their literal YAML form.
|
|
18
|
+
/** Prop 310 § Design 4's exemplar — a compound ast-grep record with every optional block. */
|
|
19
|
+
export function design4ExemplarRecord() {
|
|
20
|
+
return {
|
|
21
|
+
schemaVersion: 1,
|
|
22
|
+
severity: 'error',
|
|
23
|
+
message: 'Catch blocks must re-throw or route the error — fail-open catch is banned.',
|
|
24
|
+
recoveryHint: 'Re-throw after logging, or route to the error channel.',
|
|
25
|
+
target: {
|
|
26
|
+
type: 'ast-grep',
|
|
27
|
+
language: 'typescript',
|
|
28
|
+
rule: { kind: 'catch_clause', not: { has: { kind: 'throw_statement', stopBy: 'end' } } },
|
|
29
|
+
scope: { fileGlobs: ['packages/**/*.ts'], excludeGlobs: ['**/*.test.ts'] },
|
|
30
|
+
},
|
|
31
|
+
examples: [
|
|
32
|
+
{
|
|
33
|
+
bad: 'try { risky() } catch (e) { log(e) }',
|
|
34
|
+
good: 'try { risky() } catch (e) { log(e); throw e }',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
curation: {
|
|
38
|
+
sourceLesson: 'lesson-77c5e668389fb1a2',
|
|
39
|
+
curatedBy: 'strategy-gemini',
|
|
40
|
+
curatedAt: '2026-06-15T14:00:00Z',
|
|
41
|
+
baseline5Phase: 3,
|
|
42
|
+
},
|
|
43
|
+
verification_shadow: { type: 'rego', source: 'package totem.rules.example\n' },
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** Prop 310 § Design 8's exemplar — the absence / must-contain shape (the census's rule (c)). */
|
|
47
|
+
export function design8ExemplarRecord() {
|
|
48
|
+
return {
|
|
49
|
+
schemaVersion: 1,
|
|
50
|
+
severity: 'warning',
|
|
51
|
+
message: 'git output-consuming commands must pin LC_ALL=C on the same line.',
|
|
52
|
+
target: {
|
|
53
|
+
type: 'regex',
|
|
54
|
+
pattern: '\\bgit\\s+(log|diff|status)\\b',
|
|
55
|
+
scope: { fileGlobs: ['**/*.sh', '**/*.cjs'] },
|
|
56
|
+
},
|
|
57
|
+
requires: { pattern: 'LC_ALL=C', scope: 'line' },
|
|
58
|
+
examples: [{ bad: 'git log --oneline', good: 'LC_ALL=C git log --oneline' }],
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=record-exemplars.fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-exemplars.fixture.js","sourceRoot":"","sources":["../../src/spine/record-exemplars.fixture.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,iFAAiF;AACjF,+DAA+D;AAC/D,EAAE;AACF,0EAA0E;AAC1E,+EAA+E;AAC/E,8EAA8E;AAC9E,qEAAqE;AACrE,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0CAA0C;AAE1C,6FAA6F;AAC7F,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,4EAA4E;QACrF,YAAY,EAAE,wDAAwD;QACtE,MAAM,EAAE;YACN,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,YAAY;YACtB,IAAI,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;YACxF,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,CAAC,cAAc,CAAC,EAAE;SAC3E;QACD,QAAQ,EAAE;YACR;gBACE,GAAG,EAAE,sCAAsC;gBAC3C,IAAI,EAAE,+CAA+C;aACtD;SACF;QACD,QAAQ,EAAE;YACR,YAAY,EAAE,yBAAyB;YACvC,SAAS,EAAE,iBAAiB;YAC5B,SAAS,EAAE,sBAAsB;YACjC,cAAc,EAAE,CAAC;SAClB;QACD,mBAAmB,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,+BAA+B,EAAE;KAC/E,CAAC;AACJ,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,mEAAmE;QAC5E,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,gCAAgC;YACzC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE;SAC9C;QACD,QAAQ,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE;QAChD,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,EAAE,4BAA4B,EAAE,CAAC;KAC7E,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { CompileOutcome } from './compile.js';
|
|
2
|
+
import type { ParsedRuleRecord } from './rule-record.js';
|
|
3
|
+
/** A `target.language` token resolved against the registry, or the reason it did not. */
|
|
4
|
+
export type RecordLanguageResolution = {
|
|
5
|
+
resolved: true;
|
|
6
|
+
/** The declared token, confirmed registered. Resolution is MEMBERSHIP, so this equals `target.language`. */
|
|
7
|
+
language: string;
|
|
8
|
+
/**
|
|
9
|
+
* A registered extension mapping to `language`, used to pin the ast-grep
|
|
10
|
+
* validator to exactly this grammar (see `languageProbeGlobs`).
|
|
11
|
+
*/
|
|
12
|
+
extension: string;
|
|
13
|
+
} | {
|
|
14
|
+
resolved: false;
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Resolve `target.language` against the registry, using `extensionToLanguage` as
|
|
19
|
+
* the authority verbatim (§ Design 6). Deterministic: `registeredExtensions()`
|
|
20
|
+
* returns a sorted snapshot, so the representative extension for a language with
|
|
21
|
+
* several (`.ts`/`.mts`/`.cts` → `typescript`) is always the same one — and every
|
|
22
|
+
* extension of one language maps to the same napi grammar anyway, so the pick
|
|
23
|
+
* cannot change the validation verdict, only the diagnostic.
|
|
24
|
+
*
|
|
25
|
+
* An unresolvable language FAILS LOUD (§ Design 6 / § Failure modes: "Unresolvable
|
|
26
|
+
* `language:` at compile — hard error"). It is surfaced as a `rejected` outcome
|
|
27
|
+
* rather than a throw, matching the incumbent's treatment of every other
|
|
28
|
+
* authored-content validation failure: `rejected` is a counted, reported,
|
|
29
|
+
* NON-silent state, while throws are reserved for producer-contract violations
|
|
30
|
+
* (a malformed id, a payload/type divergence) — see `compileRuleRecord`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveRecordLanguage(language: string): RecordLanguageResolution;
|
|
33
|
+
/**
|
|
34
|
+
* The glob list handed to `validateAstGrepPattern` so it resolves to EXACTLY the
|
|
35
|
+
* declared language.
|
|
36
|
+
*
|
|
37
|
+
* The shipped validator's language input is a glob list (`resolveAstGrepLangs`
|
|
38
|
+
* derives Langs from trailing extensions), so pinning it to one grammar means
|
|
39
|
+
* handing it one glob carrying one registered extension. These globs are a
|
|
40
|
+
* VALIDATOR PROBE and nothing else — they are never the record's globs, never
|
|
41
|
+
* reach the compiled rule, and never touch `sanitizeFileGlobs`.
|
|
42
|
+
*
|
|
43
|
+
* The coupling to `resolveAstGrepLangs`' derivation is pinned by a conformance
|
|
44
|
+
* test (`record-lower.test.ts`: the probe resolves to exactly one Lang, and that
|
|
45
|
+
* Lang equals `extensionToLang(extension)`), so a change to the shipped
|
|
46
|
+
* derivation fails loud here instead of silently un-pinning the record path.
|
|
47
|
+
*/
|
|
48
|
+
export declare function languageProbeGlobs(extension: string): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Check the § Design 6 one-declared-language rule against a record's positive
|
|
51
|
+
* globs. Returns `null` when the scope is consistent, or the rejection reason.
|
|
52
|
+
* ast-grep targets only — the caller does not invoke it for regex.
|
|
53
|
+
*/
|
|
54
|
+
export declare function checkLanguageGlobConsistency(language: string, fileGlobs: readonly string[]): string | null;
|
|
55
|
+
/**
|
|
56
|
+
* NapiConfig siblings of `rule` that V1 cannot express. Named explicitly so the
|
|
57
|
+
* author is told the truth — a typed construct-gap awaiting a version bump with
|
|
58
|
+
* its own sibling home under `target:` — instead of napi's generic
|
|
59
|
+
* "unknown field" error, which would read as a typo in the rule tree.
|
|
60
|
+
*/
|
|
61
|
+
export declare const V1_INEXPRESSIBLE_NAPI_KEYS: readonly ["constraints", "utils"];
|
|
62
|
+
/** Inputs the lowering needs that the record deliberately does not carry (§ Design 1/§ Design 3). */
|
|
63
|
+
export interface CompileRuleRecordOptions {
|
|
64
|
+
/**
|
|
65
|
+
* The ADR-112 §8 producer-minted rule id, supplied at the intake seam. NEVER
|
|
66
|
+
* minted here and never author-set — identity is producer-owned (R17).
|
|
67
|
+
*/
|
|
68
|
+
ruleId: string;
|
|
69
|
+
/** Injected timestamp — no `new Date()` in core (Tenet 15 determinism). */
|
|
70
|
+
now: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Lower a parsed Prop 310 record into a `CompiledRule`.
|
|
74
|
+
*
|
|
75
|
+
* PURE (no IO). Returns a `CompileOutcome`:
|
|
76
|
+
* - `{kind: 'compiled'}` — the record lowered totally.
|
|
77
|
+
* - `{kind: 'rejected', reason}` — an authored-content gate failed (bad regex
|
|
78
|
+
* in the target or in `requires`, an unresolvable `language`, a malformed
|
|
79
|
+
* ast-grep tree, a V1-inexpressible NapiConfig key). Loud and counted, never
|
|
80
|
+
* silent; the reason names the governing § so the author is sent to the spec.
|
|
81
|
+
*
|
|
82
|
+
* THROWS on a producer-contract violation — a missing/malformed `ruleId`, a key
|
|
83
|
+
* with no defined lowering, or an engine-binding divergence. These are bugs in
|
|
84
|
+
* the code that CALLED this function, not defects in the author's record, and
|
|
85
|
+
* they carry the incumbent's fail-loud idiom (`compile.ts: compileCandidate`)
|
|
86
|
+
* verbatim: assert up front, before any validation work, so a violation can
|
|
87
|
+
* never be masked by a coincidental `rejected` outcome.
|
|
88
|
+
*/
|
|
89
|
+
export declare function compileRuleRecord(parsed: ParsedRuleRecord, opts: CompileRuleRecordOptions): CompileOutcome;
|
|
90
|
+
//# sourceMappingURL=record-lower.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-lower.d.ts","sourceRoot":"","sources":["../../src/spine/record-lower.ts"],"names":[],"mappings":"AAgEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAqC,MAAM,kBAAkB,CAAC;AAW5F,yFAAyF;AACzF,MAAM,MAAM,wBAAwB,GAChC;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,4GAA4G;IAC5G,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,wBAAwB,CAahF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAE9D;AAkCD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,MAAM,GAAG,IAAI,CAiBf;AAID;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,mCAAoC,CAAC;AAoH5E,qGAAqG;AACrG,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,wBAAwB,GAC7B,cAAc,CAyKhB"}
|