@mmnto/totem 1.118.0 → 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.
Files changed (117) hide show
  1. package/dist/artifacts/admission.d.ts +12 -12
  2. package/dist/artifacts/verdict.d.ts +16 -16
  3. package/dist/compile-manifest.d.ts +89 -0
  4. package/dist/compile-manifest.d.ts.map +1 -1
  5. package/dist/compile-manifest.js +180 -31
  6. package/dist/compile-manifest.js.map +1 -1
  7. package/dist/compile-manifest.test.js +169 -1
  8. package/dist/compile-manifest.test.js.map +1 -1
  9. package/dist/compiler-schema.d.ts +1067 -0
  10. package/dist/compiler-schema.d.ts.map +1 -1
  11. package/dist/compiler-schema.js +204 -1
  12. package/dist/compiler-schema.js.map +1 -1
  13. package/dist/compiler-schema.test.js +92 -0
  14. package/dist/compiler-schema.test.js.map +1 -1
  15. package/dist/compiler.d.ts +2 -6
  16. package/dist/compiler.d.ts.map +1 -1
  17. package/dist/compiler.js +6 -17
  18. package/dist/compiler.js.map +1 -1
  19. package/dist/freeze.d.ts +3 -3
  20. package/dist/index.d.ts +12 -3
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +6 -2
  23. package/dist/index.js.map +1 -1
  24. package/dist/ledger.d.ts +12 -12
  25. package/dist/lesson-format.d.ts +5 -2
  26. package/dist/lesson-format.d.ts.map +1 -1
  27. package/dist/lesson-format.js +16 -5
  28. package/dist/lesson-format.js.map +1 -1
  29. package/dist/lesson-format.test.js +11 -0
  30. package/dist/lesson-format.test.js.map +1 -1
  31. package/dist/regex-safety/apply-rules-bounded.d.ts +11 -0
  32. package/dist/regex-safety/apply-rules-bounded.d.ts.map +1 -1
  33. package/dist/regex-safety/apply-rules-bounded.js +59 -5
  34. package/dist/regex-safety/apply-rules-bounded.js.map +1 -1
  35. package/dist/regex-validation.d.ts +7 -0
  36. package/dist/regex-validation.d.ts.map +1 -0
  37. package/dist/regex-validation.js +32 -0
  38. package/dist/regex-validation.js.map +1 -0
  39. package/dist/rule-engine.d.ts +11 -1
  40. package/dist/rule-engine.d.ts.map +1 -1
  41. package/dist/rule-engine.js +125 -18
  42. package/dist/rule-engine.js.map +1 -1
  43. package/dist/spine/authored-rule.d.ts +669 -245
  44. package/dist/spine/authored-rule.d.ts.map +1 -1
  45. package/dist/spine/authored-rule.js +113 -27
  46. package/dist/spine/authored-rule.js.map +1 -1
  47. package/dist/spine/authored-rule.test.js +170 -4
  48. package/dist/spine/authored-rule.test.js.map +1 -1
  49. package/dist/spine/authoring-ledger.d.ts +69 -10
  50. package/dist/spine/authoring-ledger.d.ts.map +1 -1
  51. package/dist/spine/authoring-ledger.js +46 -25
  52. package/dist/spine/authoring-ledger.js.map +1 -1
  53. package/dist/spine/authoring-ledger.test.js +20 -7
  54. package/dist/spine/authoring-ledger.test.js.map +1 -1
  55. package/dist/spine/candidate-rule.d.ts +18 -1
  56. package/dist/spine/candidate-rule.d.ts.map +1 -1
  57. package/dist/spine/candidate-rule.js.map +1 -1
  58. package/dist/spine/cert-corpus-seed.d.ts +8 -8
  59. package/dist/spine/compile.d.ts +4 -1
  60. package/dist/spine/compile.d.ts.map +1 -1
  61. package/dist/spine/compile.js +50 -3
  62. package/dist/spine/compile.js.map +1 -1
  63. package/dist/spine/compile.test.js +189 -23
  64. package/dist/spine/compile.test.js.map +1 -1
  65. package/dist/spine/frozen-split.d.ts +18 -18
  66. package/dist/spine/ledgers.d.ts +24 -24
  67. package/dist/spine/lf-normalize.d.ts +9 -0
  68. package/dist/spine/lf-normalize.d.ts.map +1 -0
  69. package/dist/spine/lf-normalize.js +38 -0
  70. package/dist/spine/lf-normalize.js.map +1 -0
  71. package/dist/spine/preimage-differential.d.ts +3 -1
  72. package/dist/spine/preimage-differential.d.ts.map +1 -1
  73. package/dist/spine/preimage-differential.js +9 -6
  74. package/dist/spine/preimage-differential.js.map +1 -1
  75. package/dist/spine/preimage-differential.test.js +59 -0
  76. package/dist/spine/preimage-differential.test.js.map +1 -1
  77. package/dist/spine/record-exemplars.fixture.d.ts +5 -0
  78. package/dist/spine/record-exemplars.fixture.d.ts.map +1 -0
  79. package/dist/spine/record-exemplars.fixture.js +61 -0
  80. package/dist/spine/record-exemplars.fixture.js.map +1 -0
  81. package/dist/spine/record-lower.d.ts +90 -0
  82. package/dist/spine/record-lower.d.ts.map +1 -0
  83. package/dist/spine/record-lower.js +418 -0
  84. package/dist/spine/record-lower.js.map +1 -0
  85. package/dist/spine/record-lower.test.d.ts +2 -0
  86. package/dist/spine/record-lower.test.d.ts.map +1 -0
  87. package/dist/spine/record-lower.test.js +562 -0
  88. package/dist/spine/record-lower.test.js.map +1 -0
  89. package/dist/spine/record-runtime.d.ts +215 -0
  90. package/dist/spine/record-runtime.d.ts.map +1 -0
  91. package/dist/spine/record-runtime.js +330 -0
  92. package/dist/spine/record-runtime.js.map +1 -0
  93. package/dist/spine/record-runtime.test.d.ts +2 -0
  94. package/dist/spine/record-runtime.test.d.ts.map +1 -0
  95. package/dist/spine/record-runtime.test.js +814 -0
  96. package/dist/spine/record-runtime.test.js.map +1 -0
  97. package/dist/spine/rule-record.d.ts +864 -0
  98. package/dist/spine/rule-record.d.ts.map +1 -0
  99. package/dist/spine/rule-record.js +781 -0
  100. package/dist/spine/rule-record.js.map +1 -0
  101. package/dist/spine/rule-record.test.d.ts +2 -0
  102. package/dist/spine/rule-record.test.d.ts.map +1 -0
  103. package/dist/spine/rule-record.test.js +1262 -0
  104. package/dist/spine/rule-record.test.js.map +1 -0
  105. package/dist/spine/windtunnel-firing.d.ts.map +1 -1
  106. package/dist/spine/windtunnel-firing.js +28 -1
  107. package/dist/spine/windtunnel-firing.js.map +1 -1
  108. package/dist/spine/windtunnel-lock.d.ts +10 -10
  109. package/dist/stage4-verifier.d.ts.map +1 -1
  110. package/dist/stage4-verifier.js +61 -17
  111. package/dist/stage4-verifier.js.map +1 -1
  112. package/dist/sys/glob.d.ts +30 -0
  113. package/dist/sys/glob.d.ts.map +1 -1
  114. package/dist/sys/glob.js +62 -1
  115. package/dist/sys/glob.js.map +1 -1
  116. package/dist/types.d.ts +1 -1
  117. package/package.json +1 -1
@@ -36,6 +36,16 @@ export declare const AstGrepYamlRuleSchema: z.ZodObject<{
36
36
  rule: z.ZodRecord<z.ZodString, z.ZodUnknown>;
37
37
  }, z.ZodTypeAny, "passthrough">>;
38
38
  export type AstGrepYamlRule = NapiConfig;
39
+ /**
40
+ * A full sha256 digest in lowercase hex — the codomain of every content hash on
41
+ * this seam (Prop 310 § Design 10's CR-blind example-pair hash, the record file's
42
+ * own content hash). Canonical form only, for the same reason `COMMIT_SHA_RE`
43
+ * refuses uppercase: admitting a non-canonical digest is a silent data-quality
44
+ * hole, and normalising it on parse would move the hash basis.
45
+ */
46
+ export declare const SHA256_HEX_RE: RegExp;
47
+ export declare const AUTHORED_RULE_ID_HEX_LEN = 16;
48
+ export declare const AUTHORED_RULE_ID_RE: RegExp;
39
49
  /**
40
50
  * True iff `s` is a well-formed ISO-8601 date/timestamp AND a REAL calendar date.
41
51
  * `Date.parse` alone is insufficient: it NORMALIZES day-overflow (`2026-02-31` → Mar 3,
@@ -110,6 +120,15 @@ export type MinedProvenanceRecord = z.infer<typeof MinedProvenanceWireSchema>;
110
120
  * never a path/mutable alias (§8 identity discipline).
111
121
  * - `commit` (FALLBACK, land-then-fix repos): the pre-fix parent
112
122
  * (`preimageCommitSha` — fire) / post-fix merge (`mergeCommitSha` — silent).
123
+ * - `record` (Prop 310 § Design 10 + Amendment 1): DERIVED at intake from a
124
+ * `.totem/rules/<slug>.rule.yaml` record's `examples[ordinal]` pair, joined by
125
+ * the `(ruleId, ordinal)` key with the CR-blind `pairHash` as drift sensor.
126
+ * The bad/good text is carried inline exactly as the `lesson` branch carries
127
+ * it, so the differential evaluates identically; the key is what differs.
128
+ * Amendment 1 makes the record's `examples` block the EDITABLE home — this
129
+ * branch is the derived side and is never hand-authored (an inline
130
+ * `preimageSource` in the authored envelope is a migration error, rejected by
131
+ * name at intake).
113
132
  *
114
133
  * `z.discriminatedUnion` (not `z.union`): both branches carry a REQUIRED literal
115
134
  * `kind`, so Zod routes a parse error to the matched branch instead of emitting
@@ -158,6 +177,42 @@ export declare const PreimageSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
158
177
  kind: "commit";
159
178
  preimageCommitSha: string;
160
179
  mergeCommitSha: string;
180
+ }>, z.ZodObject<{
181
+ kind: z.ZodLiteral<"record">;
182
+ /**
183
+ * Prop 310 § Design 10 — half of the join key. The ADR-112 §8 producer-minted
184
+ * rule id the record was ingested under; pinned to the mint's codomain so a
185
+ * derivation that lost the id fails LOUD instead of anchoring the pair to a
186
+ * free-text label.
187
+ */
188
+ ruleId: z.ZodString;
189
+ /** The `examples[i]` ordinal within the record — the other half of the join key (§ Design 10). */
190
+ ordinal: z.ZodNumber;
191
+ /**
192
+ * Amendment 1 item 3 — the CR-blind per-pair content hash (`ruleExamplePairHash`),
193
+ * computed over the LF-image of the pair's material. The § Design 10 DRIFT SENSOR:
194
+ * an `examples` edit flips it, which flips the ledger `contentHash`, which reads
195
+ * `revised`. There is no second mechanism.
196
+ */
197
+ pairHash: z.ZodString;
198
+ /** The record's `examples[ordinal].bad` — the defect preimage the matcher must FIRE on (§4). */
199
+ badExample: z.ZodEffects<z.ZodString, string, string>;
200
+ /** The record's `examples[ordinal].good` — the fixed postimage the matcher must stay SILENT on (§4). */
201
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
202
+ }, "strict", z.ZodTypeAny, {
203
+ kind: "record";
204
+ badExample: string;
205
+ goodExample: string;
206
+ ruleId: string;
207
+ ordinal: number;
208
+ pairHash: string;
209
+ }, {
210
+ kind: "record";
211
+ badExample: string;
212
+ goodExample: string;
213
+ ruleId: string;
214
+ ordinal: number;
215
+ pairHash: string;
161
216
  }>]>;
162
217
  export type PreimageSource = z.infer<typeof PreimageSourceSchema>;
163
218
  /**
@@ -209,6 +264,42 @@ export declare const AuthoredFixtureSchema: z.ZodEffects<z.ZodObject<{
209
264
  kind: "commit";
210
265
  preimageCommitSha: string;
211
266
  mergeCommitSha: string;
267
+ }>, z.ZodObject<{
268
+ kind: z.ZodLiteral<"record">;
269
+ /**
270
+ * Prop 310 § Design 10 — half of the join key. The ADR-112 §8 producer-minted
271
+ * rule id the record was ingested under; pinned to the mint's codomain so a
272
+ * derivation that lost the id fails LOUD instead of anchoring the pair to a
273
+ * free-text label.
274
+ */
275
+ ruleId: z.ZodString;
276
+ /** The `examples[i]` ordinal within the record — the other half of the join key (§ Design 10). */
277
+ ordinal: z.ZodNumber;
278
+ /**
279
+ * Amendment 1 item 3 — the CR-blind per-pair content hash (`ruleExamplePairHash`),
280
+ * computed over the LF-image of the pair's material. The § Design 10 DRIFT SENSOR:
281
+ * an `examples` edit flips it, which flips the ledger `contentHash`, which reads
282
+ * `revised`. There is no second mechanism.
283
+ */
284
+ pairHash: z.ZodString;
285
+ /** The record's `examples[ordinal].bad` — the defect preimage the matcher must FIRE on (§4). */
286
+ badExample: z.ZodEffects<z.ZodString, string, string>;
287
+ /** The record's `examples[ordinal].good` — the fixed postimage the matcher must stay SILENT on (§4). */
288
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
289
+ }, "strict", z.ZodTypeAny, {
290
+ kind: "record";
291
+ badExample: string;
292
+ goodExample: string;
293
+ ruleId: string;
294
+ ordinal: number;
295
+ pairHash: string;
296
+ }, {
297
+ kind: "record";
298
+ badExample: string;
299
+ goodExample: string;
300
+ ruleId: string;
301
+ ordinal: number;
302
+ pairHash: string;
212
303
  }>]>;
213
304
  /** File the defect locus lives in. */
214
305
  filePath: z.ZodEffects<z.ZodString, string, string>;
@@ -227,6 +318,13 @@ export declare const AuthoredFixtureSchema: z.ZodEffects<z.ZodObject<{
227
318
  kind: "commit";
228
319
  preimageCommitSha: string;
229
320
  mergeCommitSha: string;
321
+ } | {
322
+ kind: "record";
323
+ badExample: string;
324
+ goodExample: string;
325
+ ruleId: string;
326
+ ordinal: number;
327
+ pairHash: string;
230
328
  };
231
329
  filePath: string;
232
330
  matchedSpan: string;
@@ -242,6 +340,13 @@ export declare const AuthoredFixtureSchema: z.ZodEffects<z.ZodObject<{
242
340
  kind: "commit";
243
341
  preimageCommitSha: string;
244
342
  mergeCommitSha: string;
343
+ } | {
344
+ kind: "record";
345
+ badExample: string;
346
+ goodExample: string;
347
+ ruleId: string;
348
+ ordinal: number;
349
+ pairHash: string;
245
350
  };
246
351
  filePath: string;
247
352
  matchedSpan: string;
@@ -257,6 +362,13 @@ export declare const AuthoredFixtureSchema: z.ZodEffects<z.ZodObject<{
257
362
  kind: "commit";
258
363
  preimageCommitSha: string;
259
364
  mergeCommitSha: string;
365
+ } | {
366
+ kind: "record";
367
+ badExample: string;
368
+ goodExample: string;
369
+ ruleId: string;
370
+ ordinal: number;
371
+ pairHash: string;
260
372
  };
261
373
  filePath: string;
262
374
  matchedSpan: string;
@@ -272,6 +384,13 @@ export declare const AuthoredFixtureSchema: z.ZodEffects<z.ZodObject<{
272
384
  kind: "commit";
273
385
  preimageCommitSha: string;
274
386
  mergeCommitSha: string;
387
+ } | {
388
+ kind: "record";
389
+ badExample: string;
390
+ goodExample: string;
391
+ ruleId: string;
392
+ ordinal: number;
393
+ pairHash: string;
275
394
  };
276
395
  filePath: string;
277
396
  matchedSpan: string;
@@ -448,6 +567,42 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
448
567
  kind: "commit";
449
568
  preimageCommitSha: string;
450
569
  mergeCommitSha: string;
570
+ }>, z.ZodObject<{
571
+ kind: z.ZodLiteral<"record">;
572
+ /**
573
+ * Prop 310 § Design 10 — half of the join key. The ADR-112 §8 producer-minted
574
+ * rule id the record was ingested under; pinned to the mint's codomain so a
575
+ * derivation that lost the id fails LOUD instead of anchoring the pair to a
576
+ * free-text label.
577
+ */
578
+ ruleId: z.ZodString;
579
+ /** The `examples[i]` ordinal within the record — the other half of the join key (§ Design 10). */
580
+ ordinal: z.ZodNumber;
581
+ /**
582
+ * Amendment 1 item 3 — the CR-blind per-pair content hash (`ruleExamplePairHash`),
583
+ * computed over the LF-image of the pair's material. The § Design 10 DRIFT SENSOR:
584
+ * an `examples` edit flips it, which flips the ledger `contentHash`, which reads
585
+ * `revised`. There is no second mechanism.
586
+ */
587
+ pairHash: z.ZodString;
588
+ /** The record's `examples[ordinal].bad` — the defect preimage the matcher must FIRE on (§4). */
589
+ badExample: z.ZodEffects<z.ZodString, string, string>;
590
+ /** The record's `examples[ordinal].good` — the fixed postimage the matcher must stay SILENT on (§4). */
591
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
592
+ }, "strict", z.ZodTypeAny, {
593
+ kind: "record";
594
+ badExample: string;
595
+ goodExample: string;
596
+ ruleId: string;
597
+ ordinal: number;
598
+ pairHash: string;
599
+ }, {
600
+ kind: "record";
601
+ badExample: string;
602
+ goodExample: string;
603
+ ruleId: string;
604
+ ordinal: number;
605
+ pairHash: string;
451
606
  }>]>;
452
607
  /** File the defect locus lives in. */
453
608
  filePath: z.ZodEffects<z.ZodString, string, string>;
@@ -466,6 +621,13 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
466
621
  kind: "commit";
467
622
  preimageCommitSha: string;
468
623
  mergeCommitSha: string;
624
+ } | {
625
+ kind: "record";
626
+ badExample: string;
627
+ goodExample: string;
628
+ ruleId: string;
629
+ ordinal: number;
630
+ pairHash: string;
469
631
  };
470
632
  filePath: string;
471
633
  matchedSpan: string;
@@ -481,6 +643,13 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
481
643
  kind: "commit";
482
644
  preimageCommitSha: string;
483
645
  mergeCommitSha: string;
646
+ } | {
647
+ kind: "record";
648
+ badExample: string;
649
+ goodExample: string;
650
+ ruleId: string;
651
+ ordinal: number;
652
+ pairHash: string;
484
653
  };
485
654
  filePath: string;
486
655
  matchedSpan: string;
@@ -496,6 +665,13 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
496
665
  kind: "commit";
497
666
  preimageCommitSha: string;
498
667
  mergeCommitSha: string;
668
+ } | {
669
+ kind: "record";
670
+ badExample: string;
671
+ goodExample: string;
672
+ ruleId: string;
673
+ ordinal: number;
674
+ pairHash: string;
499
675
  };
500
676
  filePath: string;
501
677
  matchedSpan: string;
@@ -511,6 +687,13 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
511
687
  kind: "commit";
512
688
  preimageCommitSha: string;
513
689
  mergeCommitSha: string;
690
+ } | {
691
+ kind: "record";
692
+ badExample: string;
693
+ goodExample: string;
694
+ ruleId: string;
695
+ ordinal: number;
696
+ pairHash: string;
514
697
  };
515
698
  filePath: string;
516
699
  matchedSpan: string;
@@ -596,6 +779,13 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
596
779
  kind: "commit";
597
780
  preimageCommitSha: string;
598
781
  mergeCommitSha: string;
782
+ } | {
783
+ kind: "record";
784
+ badExample: string;
785
+ goodExample: string;
786
+ ruleId: string;
787
+ ordinal: number;
788
+ pairHash: string;
599
789
  };
600
790
  filePath: string;
601
791
  matchedSpan: string;
@@ -629,6 +819,13 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
629
819
  kind: "commit";
630
820
  preimageCommitSha: string;
631
821
  mergeCommitSha: string;
822
+ } | {
823
+ kind: "record";
824
+ badExample: string;
825
+ goodExample: string;
826
+ ruleId: string;
827
+ ordinal: number;
828
+ pairHash: string;
632
829
  };
633
830
  filePath: string;
634
831
  matchedSpan: string;
@@ -710,6 +907,42 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
710
907
  kind: "commit";
711
908
  preimageCommitSha: string;
712
909
  mergeCommitSha: string;
910
+ }>, z.ZodObject<{
911
+ kind: z.ZodLiteral<"record">;
912
+ /**
913
+ * Prop 310 § Design 10 — half of the join key. The ADR-112 §8 producer-minted
914
+ * rule id the record was ingested under; pinned to the mint's codomain so a
915
+ * derivation that lost the id fails LOUD instead of anchoring the pair to a
916
+ * free-text label.
917
+ */
918
+ ruleId: z.ZodString;
919
+ /** The `examples[i]` ordinal within the record — the other half of the join key (§ Design 10). */
920
+ ordinal: z.ZodNumber;
921
+ /**
922
+ * Amendment 1 item 3 — the CR-blind per-pair content hash (`ruleExamplePairHash`),
923
+ * computed over the LF-image of the pair's material. The § Design 10 DRIFT SENSOR:
924
+ * an `examples` edit flips it, which flips the ledger `contentHash`, which reads
925
+ * `revised`. There is no second mechanism.
926
+ */
927
+ pairHash: z.ZodString;
928
+ /** The record's `examples[ordinal].bad` — the defect preimage the matcher must FIRE on (§4). */
929
+ badExample: z.ZodEffects<z.ZodString, string, string>;
930
+ /** The record's `examples[ordinal].good` — the fixed postimage the matcher must stay SILENT on (§4). */
931
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
932
+ }, "strict", z.ZodTypeAny, {
933
+ kind: "record";
934
+ badExample: string;
935
+ goodExample: string;
936
+ ruleId: string;
937
+ ordinal: number;
938
+ pairHash: string;
939
+ }, {
940
+ kind: "record";
941
+ badExample: string;
942
+ goodExample: string;
943
+ ruleId: string;
944
+ ordinal: number;
945
+ pairHash: string;
713
946
  }>]>;
714
947
  /** File the defect locus lives in. */
715
948
  filePath: z.ZodEffects<z.ZodString, string, string>;
@@ -728,6 +961,13 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
728
961
  kind: "commit";
729
962
  preimageCommitSha: string;
730
963
  mergeCommitSha: string;
964
+ } | {
965
+ kind: "record";
966
+ badExample: string;
967
+ goodExample: string;
968
+ ruleId: string;
969
+ ordinal: number;
970
+ pairHash: string;
731
971
  };
732
972
  filePath: string;
733
973
  matchedSpan: string;
@@ -743,6 +983,13 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
743
983
  kind: "commit";
744
984
  preimageCommitSha: string;
745
985
  mergeCommitSha: string;
986
+ } | {
987
+ kind: "record";
988
+ badExample: string;
989
+ goodExample: string;
990
+ ruleId: string;
991
+ ordinal: number;
992
+ pairHash: string;
746
993
  };
747
994
  filePath: string;
748
995
  matchedSpan: string;
@@ -758,6 +1005,13 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
758
1005
  kind: "commit";
759
1006
  preimageCommitSha: string;
760
1007
  mergeCommitSha: string;
1008
+ } | {
1009
+ kind: "record";
1010
+ badExample: string;
1011
+ goodExample: string;
1012
+ ruleId: string;
1013
+ ordinal: number;
1014
+ pairHash: string;
761
1015
  };
762
1016
  filePath: string;
763
1017
  matchedSpan: string;
@@ -773,6 +1027,13 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
773
1027
  kind: "commit";
774
1028
  preimageCommitSha: string;
775
1029
  mergeCommitSha: string;
1030
+ } | {
1031
+ kind: "record";
1032
+ badExample: string;
1033
+ goodExample: string;
1034
+ ruleId: string;
1035
+ ordinal: number;
1036
+ pairHash: string;
776
1037
  };
777
1038
  filePath: string;
778
1039
  matchedSpan: string;
@@ -858,6 +1119,13 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
858
1119
  kind: "commit";
859
1120
  preimageCommitSha: string;
860
1121
  mergeCommitSha: string;
1122
+ } | {
1123
+ kind: "record";
1124
+ badExample: string;
1125
+ goodExample: string;
1126
+ ruleId: string;
1127
+ ordinal: number;
1128
+ pairHash: string;
861
1129
  };
862
1130
  filePath: string;
863
1131
  matchedSpan: string;
@@ -891,6 +1159,13 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
891
1159
  kind: "commit";
892
1160
  preimageCommitSha: string;
893
1161
  mergeCommitSha: string;
1162
+ } | {
1163
+ kind: "record";
1164
+ badExample: string;
1165
+ goodExample: string;
1166
+ ruleId: string;
1167
+ ordinal: number;
1168
+ pairHash: string;
894
1169
  };
895
1170
  filePath: string;
896
1171
  matchedSpan: string;
@@ -1012,6 +1287,42 @@ export declare const LegitimacySchema: z.ZodObject<{
1012
1287
  kind: "commit";
1013
1288
  preimageCommitSha: string;
1014
1289
  mergeCommitSha: string;
1290
+ }>, z.ZodObject<{
1291
+ kind: z.ZodLiteral<"record">;
1292
+ /**
1293
+ * Prop 310 § Design 10 — half of the join key. The ADR-112 §8 producer-minted
1294
+ * rule id the record was ingested under; pinned to the mint's codomain so a
1295
+ * derivation that lost the id fails LOUD instead of anchoring the pair to a
1296
+ * free-text label.
1297
+ */
1298
+ ruleId: z.ZodString;
1299
+ /** The `examples[i]` ordinal within the record — the other half of the join key (§ Design 10). */
1300
+ ordinal: z.ZodNumber;
1301
+ /**
1302
+ * Amendment 1 item 3 — the CR-blind per-pair content hash (`ruleExamplePairHash`),
1303
+ * computed over the LF-image of the pair's material. The § Design 10 DRIFT SENSOR:
1304
+ * an `examples` edit flips it, which flips the ledger `contentHash`, which reads
1305
+ * `revised`. There is no second mechanism.
1306
+ */
1307
+ pairHash: z.ZodString;
1308
+ /** The record's `examples[ordinal].bad` — the defect preimage the matcher must FIRE on (§4). */
1309
+ badExample: z.ZodEffects<z.ZodString, string, string>;
1310
+ /** The record's `examples[ordinal].good` — the fixed postimage the matcher must stay SILENT on (§4). */
1311
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
1312
+ }, "strict", z.ZodTypeAny, {
1313
+ kind: "record";
1314
+ badExample: string;
1315
+ goodExample: string;
1316
+ ruleId: string;
1317
+ ordinal: number;
1318
+ pairHash: string;
1319
+ }, {
1320
+ kind: "record";
1321
+ badExample: string;
1322
+ goodExample: string;
1323
+ ruleId: string;
1324
+ ordinal: number;
1325
+ pairHash: string;
1015
1326
  }>]>;
1016
1327
  /** File the defect locus lives in. */
1017
1328
  filePath: z.ZodEffects<z.ZodString, string, string>;
@@ -1030,6 +1341,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1030
1341
  kind: "commit";
1031
1342
  preimageCommitSha: string;
1032
1343
  mergeCommitSha: string;
1344
+ } | {
1345
+ kind: "record";
1346
+ badExample: string;
1347
+ goodExample: string;
1348
+ ruleId: string;
1349
+ ordinal: number;
1350
+ pairHash: string;
1033
1351
  };
1034
1352
  filePath: string;
1035
1353
  matchedSpan: string;
@@ -1045,6 +1363,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1045
1363
  kind: "commit";
1046
1364
  preimageCommitSha: string;
1047
1365
  mergeCommitSha: string;
1366
+ } | {
1367
+ kind: "record";
1368
+ badExample: string;
1369
+ goodExample: string;
1370
+ ruleId: string;
1371
+ ordinal: number;
1372
+ pairHash: string;
1048
1373
  };
1049
1374
  filePath: string;
1050
1375
  matchedSpan: string;
@@ -1060,6 +1385,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1060
1385
  kind: "commit";
1061
1386
  preimageCommitSha: string;
1062
1387
  mergeCommitSha: string;
1388
+ } | {
1389
+ kind: "record";
1390
+ badExample: string;
1391
+ goodExample: string;
1392
+ ruleId: string;
1393
+ ordinal: number;
1394
+ pairHash: string;
1063
1395
  };
1064
1396
  filePath: string;
1065
1397
  matchedSpan: string;
@@ -1075,6 +1407,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1075
1407
  kind: "commit";
1076
1408
  preimageCommitSha: string;
1077
1409
  mergeCommitSha: string;
1410
+ } | {
1411
+ kind: "record";
1412
+ badExample: string;
1413
+ goodExample: string;
1414
+ ruleId: string;
1415
+ ordinal: number;
1416
+ pairHash: string;
1078
1417
  };
1079
1418
  filePath: string;
1080
1419
  matchedSpan: string;
@@ -1160,6 +1499,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1160
1499
  kind: "commit";
1161
1500
  preimageCommitSha: string;
1162
1501
  mergeCommitSha: string;
1502
+ } | {
1503
+ kind: "record";
1504
+ badExample: string;
1505
+ goodExample: string;
1506
+ ruleId: string;
1507
+ ordinal: number;
1508
+ pairHash: string;
1163
1509
  };
1164
1510
  filePath: string;
1165
1511
  matchedSpan: string;
@@ -1193,6 +1539,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1193
1539
  kind: "commit";
1194
1540
  preimageCommitSha: string;
1195
1541
  mergeCommitSha: string;
1542
+ } | {
1543
+ kind: "record";
1544
+ badExample: string;
1545
+ goodExample: string;
1546
+ ruleId: string;
1547
+ ordinal: number;
1548
+ pairHash: string;
1196
1549
  };
1197
1550
  filePath: string;
1198
1551
  matchedSpan: string;
@@ -1266,6 +1619,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1266
1619
  kind: "commit";
1267
1620
  preimageCommitSha: string;
1268
1621
  mergeCommitSha: string;
1622
+ } | {
1623
+ kind: "record";
1624
+ badExample: string;
1625
+ goodExample: string;
1626
+ ruleId: string;
1627
+ ordinal: number;
1628
+ pairHash: string;
1269
1629
  };
1270
1630
  filePath: string;
1271
1631
  matchedSpan: string;
@@ -1308,6 +1668,13 @@ export declare const LegitimacySchema: z.ZodObject<{
1308
1668
  kind: "commit";
1309
1669
  preimageCommitSha: string;
1310
1670
  mergeCommitSha: string;
1671
+ } | {
1672
+ kind: "record";
1673
+ badExample: string;
1674
+ goodExample: string;
1675
+ ruleId: string;
1676
+ ordinal: number;
1677
+ pairHash: string;
1311
1678
  };
1312
1679
  filePath: string;
1313
1680
  matchedSpan: string;
@@ -1577,6 +1944,42 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1577
1944
  kind: "commit";
1578
1945
  preimageCommitSha: string;
1579
1946
  mergeCommitSha: string;
1947
+ }>, z.ZodObject<{
1948
+ kind: z.ZodLiteral<"record">;
1949
+ /**
1950
+ * Prop 310 § Design 10 — half of the join key. The ADR-112 §8 producer-minted
1951
+ * rule id the record was ingested under; pinned to the mint's codomain so a
1952
+ * derivation that lost the id fails LOUD instead of anchoring the pair to a
1953
+ * free-text label.
1954
+ */
1955
+ ruleId: z.ZodString;
1956
+ /** The `examples[i]` ordinal within the record — the other half of the join key (§ Design 10). */
1957
+ ordinal: z.ZodNumber;
1958
+ /**
1959
+ * Amendment 1 item 3 — the CR-blind per-pair content hash (`ruleExamplePairHash`),
1960
+ * computed over the LF-image of the pair's material. The § Design 10 DRIFT SENSOR:
1961
+ * an `examples` edit flips it, which flips the ledger `contentHash`, which reads
1962
+ * `revised`. There is no second mechanism.
1963
+ */
1964
+ pairHash: z.ZodString;
1965
+ /** The record's `examples[ordinal].bad` — the defect preimage the matcher must FIRE on (§4). */
1966
+ badExample: z.ZodEffects<z.ZodString, string, string>;
1967
+ /** The record's `examples[ordinal].good` — the fixed postimage the matcher must stay SILENT on (§4). */
1968
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
1969
+ }, "strict", z.ZodTypeAny, {
1970
+ kind: "record";
1971
+ badExample: string;
1972
+ goodExample: string;
1973
+ ruleId: string;
1974
+ ordinal: number;
1975
+ pairHash: string;
1976
+ }, {
1977
+ kind: "record";
1978
+ badExample: string;
1979
+ goodExample: string;
1980
+ ruleId: string;
1981
+ ordinal: number;
1982
+ pairHash: string;
1580
1983
  }>]>;
1581
1984
  /** File the defect locus lives in. */
1582
1985
  filePath: z.ZodEffects<z.ZodString, string, string>;
@@ -1595,6 +1998,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1595
1998
  kind: "commit";
1596
1999
  preimageCommitSha: string;
1597
2000
  mergeCommitSha: string;
2001
+ } | {
2002
+ kind: "record";
2003
+ badExample: string;
2004
+ goodExample: string;
2005
+ ruleId: string;
2006
+ ordinal: number;
2007
+ pairHash: string;
1598
2008
  };
1599
2009
  filePath: string;
1600
2010
  matchedSpan: string;
@@ -1610,6 +2020,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1610
2020
  kind: "commit";
1611
2021
  preimageCommitSha: string;
1612
2022
  mergeCommitSha: string;
2023
+ } | {
2024
+ kind: "record";
2025
+ badExample: string;
2026
+ goodExample: string;
2027
+ ruleId: string;
2028
+ ordinal: number;
2029
+ pairHash: string;
1613
2030
  };
1614
2031
  filePath: string;
1615
2032
  matchedSpan: string;
@@ -1625,6 +2042,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1625
2042
  kind: "commit";
1626
2043
  preimageCommitSha: string;
1627
2044
  mergeCommitSha: string;
2045
+ } | {
2046
+ kind: "record";
2047
+ badExample: string;
2048
+ goodExample: string;
2049
+ ruleId: string;
2050
+ ordinal: number;
2051
+ pairHash: string;
1628
2052
  };
1629
2053
  filePath: string;
1630
2054
  matchedSpan: string;
@@ -1640,6 +2064,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1640
2064
  kind: "commit";
1641
2065
  preimageCommitSha: string;
1642
2066
  mergeCommitSha: string;
2067
+ } | {
2068
+ kind: "record";
2069
+ badExample: string;
2070
+ goodExample: string;
2071
+ ruleId: string;
2072
+ ordinal: number;
2073
+ pairHash: string;
1643
2074
  };
1644
2075
  filePath: string;
1645
2076
  matchedSpan: string;
@@ -1725,6 +2156,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1725
2156
  kind: "commit";
1726
2157
  preimageCommitSha: string;
1727
2158
  mergeCommitSha: string;
2159
+ } | {
2160
+ kind: "record";
2161
+ badExample: string;
2162
+ goodExample: string;
2163
+ ruleId: string;
2164
+ ordinal: number;
2165
+ pairHash: string;
1728
2166
  };
1729
2167
  filePath: string;
1730
2168
  matchedSpan: string;
@@ -1758,6 +2196,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1758
2196
  kind: "commit";
1759
2197
  preimageCommitSha: string;
1760
2198
  mergeCommitSha: string;
2199
+ } | {
2200
+ kind: "record";
2201
+ badExample: string;
2202
+ goodExample: string;
2203
+ ruleId: string;
2204
+ ordinal: number;
2205
+ pairHash: string;
1761
2206
  };
1762
2207
  filePath: string;
1763
2208
  matchedSpan: string;
@@ -1831,6 +2276,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1831
2276
  kind: "commit";
1832
2277
  preimageCommitSha: string;
1833
2278
  mergeCommitSha: string;
2279
+ } | {
2280
+ kind: "record";
2281
+ badExample: string;
2282
+ goodExample: string;
2283
+ ruleId: string;
2284
+ ordinal: number;
2285
+ pairHash: string;
1834
2286
  };
1835
2287
  filePath: string;
1836
2288
  matchedSpan: string;
@@ -1873,6 +2325,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1873
2325
  kind: "commit";
1874
2326
  preimageCommitSha: string;
1875
2327
  mergeCommitSha: string;
2328
+ } | {
2329
+ kind: "record";
2330
+ badExample: string;
2331
+ goodExample: string;
2332
+ ruleId: string;
2333
+ ordinal: number;
2334
+ pairHash: string;
1876
2335
  };
1877
2336
  filePath: string;
1878
2337
  matchedSpan: string;
@@ -1905,6 +2364,124 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1905
2364
  * reader falls back to the legacy engine-type proxy.
1906
2365
  */
1907
2366
  ruleClass: z.ZodOptional<z.ZodEnum<["hard", "advisory"]>>;
2367
+ /**
2368
+ * Prop 310 § Design 7 / mmnto-ai/totem#1574 — first-class structural
2369
+ * exclusions. Entries are POSITIVE-form globs applied as exclusions: a file is
2370
+ * in scope iff it matches some `fileGlobs` entry AND no `excludeGlobs` entry
2371
+ * (`positiveMatch && !excludeMatch`). `!`-negation is a parse error in the
2372
+ * record grammar, so an entry here never carries one.
2373
+ */
2374
+ excludeGlobs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2375
+ /**
2376
+ * Prop 310 § Design 8 — the absence / must-contain block. The rule fires on a
2377
+ * target match at locus L iff `pattern` does NOT match within the declared
2378
+ * scope containing L. `pattern` is a safe-regex2-gated regex evaluated
2379
+ * TEXTUALLY, independent of `engine`; V1 carries exactly one block.
2380
+ *
2381
+ * The scope enum MIRRORS `RequiresScopeSchema` (`spine/rule-record.ts`) rather
2382
+ * than importing it — `compiler-schema.ts` is an import-graph LEAF (zod only)
2383
+ * and `spine/rule-record.ts` transitively imports it, so an import here would
2384
+ * close a cycle. The two are COUPLED by an equality test in
2385
+ * `record-lower.test.ts`, never left to drift on inspection. `block` is
2386
+ * reserved-unimplemented at the grammar (§ Design 8) and therefore can never
2387
+ * reach a compiled rule.
2388
+ */
2389
+ requires: z.ZodOptional<z.ZodObject<{
2390
+ pattern: z.ZodString;
2391
+ scope: z.ZodEnum<["line", "file"]>;
2392
+ }, "strip", z.ZodTypeAny, {
2393
+ pattern: string;
2394
+ scope: "line" | "file";
2395
+ }, {
2396
+ pattern: string;
2397
+ scope: "line" | "file";
2398
+ }>>;
2399
+ /**
2400
+ * Prop 310 § Design 5 / § Design 10 — certification's PRIMARY PREIMAGE SOURCE
2401
+ * (ADR-112 §4), and per Amendment 1 the record's block is the hand-editable
2402
+ * home (the fixture envelope derives). Carried verbatim, in ordinal order: the
2403
+ * `(ruleId, ordinal)` join key is positional, so a reorder is a re-pair.
2404
+ *
2405
+ * Deliberately NOT projected onto the legacy `badExample`/`goodExample` pair —
2406
+ * that would be Tenet 20's prohibited mirror (two hand-editable homes for one
2407
+ * object). Consumers that need a single exemplar read `examples[0]`.
2408
+ */
2409
+ examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
2410
+ bad: z.ZodString;
2411
+ good: z.ZodString;
2412
+ }, "strip", z.ZodTypeAny, {
2413
+ bad: string;
2414
+ good: string;
2415
+ }, {
2416
+ bad: string;
2417
+ good: string;
2418
+ }>, "many">>;
2419
+ /**
2420
+ * Prop 310 § Design 6 — the rule's grammar binding: the single declared
2421
+ * language the ast-grep payload was validated under, resolved against the
2422
+ * Map-backed `extensionToLanguage` registry at compile (built-ins + pack
2423
+ * contributions), never a spec-frozen enum. Present only for record-path
2424
+ * ast-grep rules; the record grammar FORBIDS `language` for regex.
2425
+ */
2426
+ language: z.ZodOptional<z.ZodString>;
2427
+ /**
2428
+ * Prop 310 § Design 9 (Amendment R4) — the classification block, carried
2429
+ * VERBATIM and **NEVER EVALUATED at V1**. Evaluation is gated by the ADR-103
2430
+ * Amendment's proof-required-for-enforcement ruling (and any OPA wiring by
2431
+ * Amendment R1's Q2 perf probe); when SMT lands, the verification result binds
2432
+ * to the emitted artifact via the Amendment's R2 certificate chain. Any reader
2433
+ * that starts EXECUTING this field has crossed the R4 gate — a doctrine change,
2434
+ * not a code change.
2435
+ *
2436
+ * The record key keeps its shipped snake_case name (`verification_shadow`, a
2437
+ * named § Design 4 exception); the COMPILED home is camelCase like every other
2438
+ * field here — the rename happens exactly once, at lowering.
2439
+ */
2440
+ verificationShadow: z.ZodOptional<z.ZodObject<{
2441
+ type: z.ZodString;
2442
+ source: z.ZodString;
2443
+ }, "strip", z.ZodTypeAny, {
2444
+ type: string;
2445
+ source: string;
2446
+ }, {
2447
+ type: string;
2448
+ source: string;
2449
+ }>>;
2450
+ /**
2451
+ * Prop 310 § Design 4 — the optional author-supplied recovery hint. Compiled
2452
+ * home added under § Design 12's total-lowering obligation: the parser admits
2453
+ * the construct, so it either lands here or fails compile loud, and failing
2454
+ * loud on a legal § Design 4 field is not an option. See `record-lower.ts`
2455
+ * § "Total lowering, mechanically".
2456
+ */
2457
+ recoveryHint: z.ZodOptional<z.ZodString>;
2458
+ /**
2459
+ * Prop 310 § Design 4 (R8) — Prop 270 §8's curation-provenance block, carried
2460
+ * under the § Design 4 collision rename (`curation`, not `provenance` — that
2461
+ * name is the ADR-112 producer's own output field). Compiled home added under
2462
+ * § Design 12's total-lowering obligation, same grounds as `recoveryHint`.
2463
+ *
2464
+ * Shape mirrors `RuleCurationSchema` (`spine/rule-record.ts`) for the same
2465
+ * import-graph-leaf reason as `requires.scope` above, and is coupled by test.
2466
+ * The grammar's all-or-none process-trio refinement is a PARSE-stage rule; a
2467
+ * compiled rule only ever carries a record that already satisfied it.
2468
+ */
2469
+ curation: z.ZodOptional<z.ZodObject<{
2470
+ sourceLesson: z.ZodString;
2471
+ curatedBy: z.ZodOptional<z.ZodString>;
2472
+ curatedAt: z.ZodOptional<z.ZodString>;
2473
+ baseline5Phase: z.ZodOptional<z.ZodNumber>;
2474
+ }, "strip", z.ZodTypeAny, {
2475
+ sourceLesson: string;
2476
+ curatedBy?: string | undefined;
2477
+ curatedAt?: string | undefined;
2478
+ baseline5Phase?: number | undefined;
2479
+ }, {
2480
+ sourceLesson: string;
2481
+ curatedBy?: string | undefined;
2482
+ curatedAt?: string | undefined;
2483
+ baseline5Phase?: number | undefined;
2484
+ }>>;
1908
2485
  }, "strip", z.ZodTypeAny, {
1909
2486
  message: string;
1910
2487
  lessonHash: string;
@@ -1952,6 +2529,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1952
2529
  kind: "commit";
1953
2530
  preimageCommitSha: string;
1954
2531
  mergeCommitSha: string;
2532
+ } | {
2533
+ kind: "record";
2534
+ badExample: string;
2535
+ goodExample: string;
2536
+ ruleId: string;
2537
+ ordinal: number;
2538
+ pairHash: string;
1955
2539
  };
1956
2540
  filePath: string;
1957
2541
  matchedSpan: string;
@@ -1974,6 +2558,27 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
1974
2558
  negativeControl: boolean;
1975
2559
  } | undefined;
1976
2560
  ruleClass?: "hard" | "advisory" | undefined;
2561
+ excludeGlobs?: string[] | undefined;
2562
+ requires?: {
2563
+ pattern: string;
2564
+ scope: "line" | "file";
2565
+ } | undefined;
2566
+ examples?: {
2567
+ bad: string;
2568
+ good: string;
2569
+ }[] | undefined;
2570
+ language?: string | undefined;
2571
+ verificationShadow?: {
2572
+ type: string;
2573
+ source: string;
2574
+ } | undefined;
2575
+ recoveryHint?: string | undefined;
2576
+ curation?: {
2577
+ sourceLesson: string;
2578
+ curatedBy?: string | undefined;
2579
+ curatedAt?: string | undefined;
2580
+ baseline5Phase?: number | undefined;
2581
+ } | undefined;
1977
2582
  }, {
1978
2583
  message: string;
1979
2584
  lessonHash: string;
@@ -2021,6 +2626,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
2021
2626
  kind: "commit";
2022
2627
  preimageCommitSha: string;
2023
2628
  mergeCommitSha: string;
2629
+ } | {
2630
+ kind: "record";
2631
+ badExample: string;
2632
+ goodExample: string;
2633
+ ruleId: string;
2634
+ ordinal: number;
2635
+ pairHash: string;
2024
2636
  };
2025
2637
  filePath: string;
2026
2638
  matchedSpan: string;
@@ -2043,6 +2655,27 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
2043
2655
  negativeControl: boolean;
2044
2656
  } | undefined;
2045
2657
  ruleClass?: "hard" | "advisory" | undefined;
2658
+ excludeGlobs?: string[] | undefined;
2659
+ requires?: {
2660
+ pattern: string;
2661
+ scope: "line" | "file";
2662
+ } | undefined;
2663
+ examples?: {
2664
+ bad: string;
2665
+ good: string;
2666
+ }[] | undefined;
2667
+ language?: string | undefined;
2668
+ verificationShadow?: {
2669
+ type: string;
2670
+ source: string;
2671
+ } | undefined;
2672
+ recoveryHint?: string | undefined;
2673
+ curation?: {
2674
+ sourceLesson: string;
2675
+ curatedBy?: string | undefined;
2676
+ curatedAt?: string | undefined;
2677
+ baseline5Phase?: number | undefined;
2678
+ } | undefined;
2046
2679
  }>, {
2047
2680
  message: string;
2048
2681
  lessonHash: string;
@@ -2090,6 +2723,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
2090
2723
  kind: "commit";
2091
2724
  preimageCommitSha: string;
2092
2725
  mergeCommitSha: string;
2726
+ } | {
2727
+ kind: "record";
2728
+ badExample: string;
2729
+ goodExample: string;
2730
+ ruleId: string;
2731
+ ordinal: number;
2732
+ pairHash: string;
2093
2733
  };
2094
2734
  filePath: string;
2095
2735
  matchedSpan: string;
@@ -2112,6 +2752,27 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
2112
2752
  negativeControl: boolean;
2113
2753
  } | undefined;
2114
2754
  ruleClass?: "hard" | "advisory" | undefined;
2755
+ excludeGlobs?: string[] | undefined;
2756
+ requires?: {
2757
+ pattern: string;
2758
+ scope: "line" | "file";
2759
+ } | undefined;
2760
+ examples?: {
2761
+ bad: string;
2762
+ good: string;
2763
+ }[] | undefined;
2764
+ language?: string | undefined;
2765
+ verificationShadow?: {
2766
+ type: string;
2767
+ source: string;
2768
+ } | undefined;
2769
+ recoveryHint?: string | undefined;
2770
+ curation?: {
2771
+ sourceLesson: string;
2772
+ curatedBy?: string | undefined;
2773
+ curatedAt?: string | undefined;
2774
+ baseline5Phase?: number | undefined;
2775
+ } | undefined;
2115
2776
  }, {
2116
2777
  message: string;
2117
2778
  lessonHash: string;
@@ -2159,6 +2820,13 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
2159
2820
  kind: "commit";
2160
2821
  preimageCommitSha: string;
2161
2822
  mergeCommitSha: string;
2823
+ } | {
2824
+ kind: "record";
2825
+ badExample: string;
2826
+ goodExample: string;
2827
+ ruleId: string;
2828
+ ordinal: number;
2829
+ pairHash: string;
2162
2830
  };
2163
2831
  filePath: string;
2164
2832
  matchedSpan: string;
@@ -2181,6 +2849,27 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
2181
2849
  negativeControl: boolean;
2182
2850
  } | undefined;
2183
2851
  ruleClass?: "hard" | "advisory" | undefined;
2852
+ excludeGlobs?: string[] | undefined;
2853
+ requires?: {
2854
+ pattern: string;
2855
+ scope: "line" | "file";
2856
+ } | undefined;
2857
+ examples?: {
2858
+ bad: string;
2859
+ good: string;
2860
+ }[] | undefined;
2861
+ language?: string | undefined;
2862
+ verificationShadow?: {
2863
+ type: string;
2864
+ source: string;
2865
+ } | undefined;
2866
+ recoveryHint?: string | undefined;
2867
+ curation?: {
2868
+ sourceLesson: string;
2869
+ curatedBy?: string | undefined;
2870
+ curatedAt?: string | undefined;
2871
+ baseline5Phase?: number | undefined;
2872
+ } | undefined;
2184
2873
  }>;
2185
2874
  export type CompiledRule = z.infer<typeof CompiledRuleSchema>;
2186
2875
  /**
@@ -2534,6 +3223,42 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2534
3223
  kind: "commit";
2535
3224
  preimageCommitSha: string;
2536
3225
  mergeCommitSha: string;
3226
+ }>, z.ZodObject<{
3227
+ kind: z.ZodLiteral<"record">;
3228
+ /**
3229
+ * Prop 310 § Design 10 — half of the join key. The ADR-112 §8 producer-minted
3230
+ * rule id the record was ingested under; pinned to the mint's codomain so a
3231
+ * derivation that lost the id fails LOUD instead of anchoring the pair to a
3232
+ * free-text label.
3233
+ */
3234
+ ruleId: z.ZodString;
3235
+ /** The `examples[i]` ordinal within the record — the other half of the join key (§ Design 10). */
3236
+ ordinal: z.ZodNumber;
3237
+ /**
3238
+ * Amendment 1 item 3 — the CR-blind per-pair content hash (`ruleExamplePairHash`),
3239
+ * computed over the LF-image of the pair's material. The § Design 10 DRIFT SENSOR:
3240
+ * an `examples` edit flips it, which flips the ledger `contentHash`, which reads
3241
+ * `revised`. There is no second mechanism.
3242
+ */
3243
+ pairHash: z.ZodString;
3244
+ /** The record's `examples[ordinal].bad` — the defect preimage the matcher must FIRE on (§4). */
3245
+ badExample: z.ZodEffects<z.ZodString, string, string>;
3246
+ /** The record's `examples[ordinal].good` — the fixed postimage the matcher must stay SILENT on (§4). */
3247
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
3248
+ }, "strict", z.ZodTypeAny, {
3249
+ kind: "record";
3250
+ badExample: string;
3251
+ goodExample: string;
3252
+ ruleId: string;
3253
+ ordinal: number;
3254
+ pairHash: string;
3255
+ }, {
3256
+ kind: "record";
3257
+ badExample: string;
3258
+ goodExample: string;
3259
+ ruleId: string;
3260
+ ordinal: number;
3261
+ pairHash: string;
2537
3262
  }>]>;
2538
3263
  /** File the defect locus lives in. */
2539
3264
  filePath: z.ZodEffects<z.ZodString, string, string>;
@@ -2552,6 +3277,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2552
3277
  kind: "commit";
2553
3278
  preimageCommitSha: string;
2554
3279
  mergeCommitSha: string;
3280
+ } | {
3281
+ kind: "record";
3282
+ badExample: string;
3283
+ goodExample: string;
3284
+ ruleId: string;
3285
+ ordinal: number;
3286
+ pairHash: string;
2555
3287
  };
2556
3288
  filePath: string;
2557
3289
  matchedSpan: string;
@@ -2567,6 +3299,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2567
3299
  kind: "commit";
2568
3300
  preimageCommitSha: string;
2569
3301
  mergeCommitSha: string;
3302
+ } | {
3303
+ kind: "record";
3304
+ badExample: string;
3305
+ goodExample: string;
3306
+ ruleId: string;
3307
+ ordinal: number;
3308
+ pairHash: string;
2570
3309
  };
2571
3310
  filePath: string;
2572
3311
  matchedSpan: string;
@@ -2582,6 +3321,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2582
3321
  kind: "commit";
2583
3322
  preimageCommitSha: string;
2584
3323
  mergeCommitSha: string;
3324
+ } | {
3325
+ kind: "record";
3326
+ badExample: string;
3327
+ goodExample: string;
3328
+ ruleId: string;
3329
+ ordinal: number;
3330
+ pairHash: string;
2585
3331
  };
2586
3332
  filePath: string;
2587
3333
  matchedSpan: string;
@@ -2597,6 +3343,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2597
3343
  kind: "commit";
2598
3344
  preimageCommitSha: string;
2599
3345
  mergeCommitSha: string;
3346
+ } | {
3347
+ kind: "record";
3348
+ badExample: string;
3349
+ goodExample: string;
3350
+ ruleId: string;
3351
+ ordinal: number;
3352
+ pairHash: string;
2600
3353
  };
2601
3354
  filePath: string;
2602
3355
  matchedSpan: string;
@@ -2682,6 +3435,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2682
3435
  kind: "commit";
2683
3436
  preimageCommitSha: string;
2684
3437
  mergeCommitSha: string;
3438
+ } | {
3439
+ kind: "record";
3440
+ badExample: string;
3441
+ goodExample: string;
3442
+ ruleId: string;
3443
+ ordinal: number;
3444
+ pairHash: string;
2685
3445
  };
2686
3446
  filePath: string;
2687
3447
  matchedSpan: string;
@@ -2715,6 +3475,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2715
3475
  kind: "commit";
2716
3476
  preimageCommitSha: string;
2717
3477
  mergeCommitSha: string;
3478
+ } | {
3479
+ kind: "record";
3480
+ badExample: string;
3481
+ goodExample: string;
3482
+ ruleId: string;
3483
+ ordinal: number;
3484
+ pairHash: string;
2718
3485
  };
2719
3486
  filePath: string;
2720
3487
  matchedSpan: string;
@@ -2788,6 +3555,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2788
3555
  kind: "commit";
2789
3556
  preimageCommitSha: string;
2790
3557
  mergeCommitSha: string;
3558
+ } | {
3559
+ kind: "record";
3560
+ badExample: string;
3561
+ goodExample: string;
3562
+ ruleId: string;
3563
+ ordinal: number;
3564
+ pairHash: string;
2791
3565
  };
2792
3566
  filePath: string;
2793
3567
  matchedSpan: string;
@@ -2830,6 +3604,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2830
3604
  kind: "commit";
2831
3605
  preimageCommitSha: string;
2832
3606
  mergeCommitSha: string;
3607
+ } | {
3608
+ kind: "record";
3609
+ badExample: string;
3610
+ goodExample: string;
3611
+ ruleId: string;
3612
+ ordinal: number;
3613
+ pairHash: string;
2833
3614
  };
2834
3615
  filePath: string;
2835
3616
  matchedSpan: string;
@@ -2862,6 +3643,124 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2862
3643
  * reader falls back to the legacy engine-type proxy.
2863
3644
  */
2864
3645
  ruleClass: z.ZodOptional<z.ZodEnum<["hard", "advisory"]>>;
3646
+ /**
3647
+ * Prop 310 § Design 7 / mmnto-ai/totem#1574 — first-class structural
3648
+ * exclusions. Entries are POSITIVE-form globs applied as exclusions: a file is
3649
+ * in scope iff it matches some `fileGlobs` entry AND no `excludeGlobs` entry
3650
+ * (`positiveMatch && !excludeMatch`). `!`-negation is a parse error in the
3651
+ * record grammar, so an entry here never carries one.
3652
+ */
3653
+ excludeGlobs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3654
+ /**
3655
+ * Prop 310 § Design 8 — the absence / must-contain block. The rule fires on a
3656
+ * target match at locus L iff `pattern` does NOT match within the declared
3657
+ * scope containing L. `pattern` is a safe-regex2-gated regex evaluated
3658
+ * TEXTUALLY, independent of `engine`; V1 carries exactly one block.
3659
+ *
3660
+ * The scope enum MIRRORS `RequiresScopeSchema` (`spine/rule-record.ts`) rather
3661
+ * than importing it — `compiler-schema.ts` is an import-graph LEAF (zod only)
3662
+ * and `spine/rule-record.ts` transitively imports it, so an import here would
3663
+ * close a cycle. The two are COUPLED by an equality test in
3664
+ * `record-lower.test.ts`, never left to drift on inspection. `block` is
3665
+ * reserved-unimplemented at the grammar (§ Design 8) and therefore can never
3666
+ * reach a compiled rule.
3667
+ */
3668
+ requires: z.ZodOptional<z.ZodObject<{
3669
+ pattern: z.ZodString;
3670
+ scope: z.ZodEnum<["line", "file"]>;
3671
+ }, "strip", z.ZodTypeAny, {
3672
+ pattern: string;
3673
+ scope: "line" | "file";
3674
+ }, {
3675
+ pattern: string;
3676
+ scope: "line" | "file";
3677
+ }>>;
3678
+ /**
3679
+ * Prop 310 § Design 5 / § Design 10 — certification's PRIMARY PREIMAGE SOURCE
3680
+ * (ADR-112 §4), and per Amendment 1 the record's block is the hand-editable
3681
+ * home (the fixture envelope derives). Carried verbatim, in ordinal order: the
3682
+ * `(ruleId, ordinal)` join key is positional, so a reorder is a re-pair.
3683
+ *
3684
+ * Deliberately NOT projected onto the legacy `badExample`/`goodExample` pair —
3685
+ * that would be Tenet 20's prohibited mirror (two hand-editable homes for one
3686
+ * object). Consumers that need a single exemplar read `examples[0]`.
3687
+ */
3688
+ examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
3689
+ bad: z.ZodString;
3690
+ good: z.ZodString;
3691
+ }, "strip", z.ZodTypeAny, {
3692
+ bad: string;
3693
+ good: string;
3694
+ }, {
3695
+ bad: string;
3696
+ good: string;
3697
+ }>, "many">>;
3698
+ /**
3699
+ * Prop 310 § Design 6 — the rule's grammar binding: the single declared
3700
+ * language the ast-grep payload was validated under, resolved against the
3701
+ * Map-backed `extensionToLanguage` registry at compile (built-ins + pack
3702
+ * contributions), never a spec-frozen enum. Present only for record-path
3703
+ * ast-grep rules; the record grammar FORBIDS `language` for regex.
3704
+ */
3705
+ language: z.ZodOptional<z.ZodString>;
3706
+ /**
3707
+ * Prop 310 § Design 9 (Amendment R4) — the classification block, carried
3708
+ * VERBATIM and **NEVER EVALUATED at V1**. Evaluation is gated by the ADR-103
3709
+ * Amendment's proof-required-for-enforcement ruling (and any OPA wiring by
3710
+ * Amendment R1's Q2 perf probe); when SMT lands, the verification result binds
3711
+ * to the emitted artifact via the Amendment's R2 certificate chain. Any reader
3712
+ * that starts EXECUTING this field has crossed the R4 gate — a doctrine change,
3713
+ * not a code change.
3714
+ *
3715
+ * The record key keeps its shipped snake_case name (`verification_shadow`, a
3716
+ * named § Design 4 exception); the COMPILED home is camelCase like every other
3717
+ * field here — the rename happens exactly once, at lowering.
3718
+ */
3719
+ verificationShadow: z.ZodOptional<z.ZodObject<{
3720
+ type: z.ZodString;
3721
+ source: z.ZodString;
3722
+ }, "strip", z.ZodTypeAny, {
3723
+ type: string;
3724
+ source: string;
3725
+ }, {
3726
+ type: string;
3727
+ source: string;
3728
+ }>>;
3729
+ /**
3730
+ * Prop 310 § Design 4 — the optional author-supplied recovery hint. Compiled
3731
+ * home added under § Design 12's total-lowering obligation: the parser admits
3732
+ * the construct, so it either lands here or fails compile loud, and failing
3733
+ * loud on a legal § Design 4 field is not an option. See `record-lower.ts`
3734
+ * § "Total lowering, mechanically".
3735
+ */
3736
+ recoveryHint: z.ZodOptional<z.ZodString>;
3737
+ /**
3738
+ * Prop 310 § Design 4 (R8) — Prop 270 §8's curation-provenance block, carried
3739
+ * under the § Design 4 collision rename (`curation`, not `provenance` — that
3740
+ * name is the ADR-112 producer's own output field). Compiled home added under
3741
+ * § Design 12's total-lowering obligation, same grounds as `recoveryHint`.
3742
+ *
3743
+ * Shape mirrors `RuleCurationSchema` (`spine/rule-record.ts`) for the same
3744
+ * import-graph-leaf reason as `requires.scope` above, and is coupled by test.
3745
+ * The grammar's all-or-none process-trio refinement is a PARSE-stage rule; a
3746
+ * compiled rule only ever carries a record that already satisfied it.
3747
+ */
3748
+ curation: z.ZodOptional<z.ZodObject<{
3749
+ sourceLesson: z.ZodString;
3750
+ curatedBy: z.ZodOptional<z.ZodString>;
3751
+ curatedAt: z.ZodOptional<z.ZodString>;
3752
+ baseline5Phase: z.ZodOptional<z.ZodNumber>;
3753
+ }, "strip", z.ZodTypeAny, {
3754
+ sourceLesson: string;
3755
+ curatedBy?: string | undefined;
3756
+ curatedAt?: string | undefined;
3757
+ baseline5Phase?: number | undefined;
3758
+ }, {
3759
+ sourceLesson: string;
3760
+ curatedBy?: string | undefined;
3761
+ curatedAt?: string | undefined;
3762
+ baseline5Phase?: number | undefined;
3763
+ }>>;
2865
3764
  }, "strip", z.ZodTypeAny, {
2866
3765
  message: string;
2867
3766
  lessonHash: string;
@@ -2909,6 +3808,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2909
3808
  kind: "commit";
2910
3809
  preimageCommitSha: string;
2911
3810
  mergeCommitSha: string;
3811
+ } | {
3812
+ kind: "record";
3813
+ badExample: string;
3814
+ goodExample: string;
3815
+ ruleId: string;
3816
+ ordinal: number;
3817
+ pairHash: string;
2912
3818
  };
2913
3819
  filePath: string;
2914
3820
  matchedSpan: string;
@@ -2931,6 +3837,27 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2931
3837
  negativeControl: boolean;
2932
3838
  } | undefined;
2933
3839
  ruleClass?: "hard" | "advisory" | undefined;
3840
+ excludeGlobs?: string[] | undefined;
3841
+ requires?: {
3842
+ pattern: string;
3843
+ scope: "line" | "file";
3844
+ } | undefined;
3845
+ examples?: {
3846
+ bad: string;
3847
+ good: string;
3848
+ }[] | undefined;
3849
+ language?: string | undefined;
3850
+ verificationShadow?: {
3851
+ type: string;
3852
+ source: string;
3853
+ } | undefined;
3854
+ recoveryHint?: string | undefined;
3855
+ curation?: {
3856
+ sourceLesson: string;
3857
+ curatedBy?: string | undefined;
3858
+ curatedAt?: string | undefined;
3859
+ baseline5Phase?: number | undefined;
3860
+ } | undefined;
2934
3861
  }, {
2935
3862
  message: string;
2936
3863
  lessonHash: string;
@@ -2978,6 +3905,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
2978
3905
  kind: "commit";
2979
3906
  preimageCommitSha: string;
2980
3907
  mergeCommitSha: string;
3908
+ } | {
3909
+ kind: "record";
3910
+ badExample: string;
3911
+ goodExample: string;
3912
+ ruleId: string;
3913
+ ordinal: number;
3914
+ pairHash: string;
2981
3915
  };
2982
3916
  filePath: string;
2983
3917
  matchedSpan: string;
@@ -3000,6 +3934,27 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3000
3934
  negativeControl: boolean;
3001
3935
  } | undefined;
3002
3936
  ruleClass?: "hard" | "advisory" | undefined;
3937
+ excludeGlobs?: string[] | undefined;
3938
+ requires?: {
3939
+ pattern: string;
3940
+ scope: "line" | "file";
3941
+ } | undefined;
3942
+ examples?: {
3943
+ bad: string;
3944
+ good: string;
3945
+ }[] | undefined;
3946
+ language?: string | undefined;
3947
+ verificationShadow?: {
3948
+ type: string;
3949
+ source: string;
3950
+ } | undefined;
3951
+ recoveryHint?: string | undefined;
3952
+ curation?: {
3953
+ sourceLesson: string;
3954
+ curatedBy?: string | undefined;
3955
+ curatedAt?: string | undefined;
3956
+ baseline5Phase?: number | undefined;
3957
+ } | undefined;
3003
3958
  }>, {
3004
3959
  message: string;
3005
3960
  lessonHash: string;
@@ -3047,6 +4002,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3047
4002
  kind: "commit";
3048
4003
  preimageCommitSha: string;
3049
4004
  mergeCommitSha: string;
4005
+ } | {
4006
+ kind: "record";
4007
+ badExample: string;
4008
+ goodExample: string;
4009
+ ruleId: string;
4010
+ ordinal: number;
4011
+ pairHash: string;
3050
4012
  };
3051
4013
  filePath: string;
3052
4014
  matchedSpan: string;
@@ -3069,6 +4031,27 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3069
4031
  negativeControl: boolean;
3070
4032
  } | undefined;
3071
4033
  ruleClass?: "hard" | "advisory" | undefined;
4034
+ excludeGlobs?: string[] | undefined;
4035
+ requires?: {
4036
+ pattern: string;
4037
+ scope: "line" | "file";
4038
+ } | undefined;
4039
+ examples?: {
4040
+ bad: string;
4041
+ good: string;
4042
+ }[] | undefined;
4043
+ language?: string | undefined;
4044
+ verificationShadow?: {
4045
+ type: string;
4046
+ source: string;
4047
+ } | undefined;
4048
+ recoveryHint?: string | undefined;
4049
+ curation?: {
4050
+ sourceLesson: string;
4051
+ curatedBy?: string | undefined;
4052
+ curatedAt?: string | undefined;
4053
+ baseline5Phase?: number | undefined;
4054
+ } | undefined;
3072
4055
  }, {
3073
4056
  message: string;
3074
4057
  lessonHash: string;
@@ -3116,6 +4099,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3116
4099
  kind: "commit";
3117
4100
  preimageCommitSha: string;
3118
4101
  mergeCommitSha: string;
4102
+ } | {
4103
+ kind: "record";
4104
+ badExample: string;
4105
+ goodExample: string;
4106
+ ruleId: string;
4107
+ ordinal: number;
4108
+ pairHash: string;
3119
4109
  };
3120
4110
  filePath: string;
3121
4111
  matchedSpan: string;
@@ -3138,6 +4128,27 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3138
4128
  negativeControl: boolean;
3139
4129
  } | undefined;
3140
4130
  ruleClass?: "hard" | "advisory" | undefined;
4131
+ excludeGlobs?: string[] | undefined;
4132
+ requires?: {
4133
+ pattern: string;
4134
+ scope: "line" | "file";
4135
+ } | undefined;
4136
+ examples?: {
4137
+ bad: string;
4138
+ good: string;
4139
+ }[] | undefined;
4140
+ language?: string | undefined;
4141
+ verificationShadow?: {
4142
+ type: string;
4143
+ source: string;
4144
+ } | undefined;
4145
+ recoveryHint?: string | undefined;
4146
+ curation?: {
4147
+ sourceLesson: string;
4148
+ curatedBy?: string | undefined;
4149
+ curatedAt?: string | undefined;
4150
+ baseline5Phase?: number | undefined;
4151
+ } | undefined;
3141
4152
  }>, "many">;
3142
4153
  /**
3143
4154
  * Lessons that could not be compiled into a rule. 4-tuple shape since
@@ -3235,6 +4246,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3235
4246
  kind: "commit";
3236
4247
  preimageCommitSha: string;
3237
4248
  mergeCommitSha: string;
4249
+ } | {
4250
+ kind: "record";
4251
+ badExample: string;
4252
+ goodExample: string;
4253
+ ruleId: string;
4254
+ ordinal: number;
4255
+ pairHash: string;
3238
4256
  };
3239
4257
  filePath: string;
3240
4258
  matchedSpan: string;
@@ -3257,6 +4275,27 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3257
4275
  negativeControl: boolean;
3258
4276
  } | undefined;
3259
4277
  ruleClass?: "hard" | "advisory" | undefined;
4278
+ excludeGlobs?: string[] | undefined;
4279
+ requires?: {
4280
+ pattern: string;
4281
+ scope: "line" | "file";
4282
+ } | undefined;
4283
+ examples?: {
4284
+ bad: string;
4285
+ good: string;
4286
+ }[] | undefined;
4287
+ language?: string | undefined;
4288
+ verificationShadow?: {
4289
+ type: string;
4290
+ source: string;
4291
+ } | undefined;
4292
+ recoveryHint?: string | undefined;
4293
+ curation?: {
4294
+ sourceLesson: string;
4295
+ curatedBy?: string | undefined;
4296
+ curatedAt?: string | undefined;
4297
+ baseline5Phase?: number | undefined;
4298
+ } | undefined;
3260
4299
  }[];
3261
4300
  nonCompilable?: {
3262
4301
  hash: string;
@@ -3313,6 +4352,13 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3313
4352
  kind: "commit";
3314
4353
  preimageCommitSha: string;
3315
4354
  mergeCommitSha: string;
4355
+ } | {
4356
+ kind: "record";
4357
+ badExample: string;
4358
+ goodExample: string;
4359
+ ruleId: string;
4360
+ ordinal: number;
4361
+ pairHash: string;
3316
4362
  };
3317
4363
  filePath: string;
3318
4364
  matchedSpan: string;
@@ -3335,6 +4381,27 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
3335
4381
  negativeControl: boolean;
3336
4382
  } | undefined;
3337
4383
  ruleClass?: "hard" | "advisory" | undefined;
4384
+ excludeGlobs?: string[] | undefined;
4385
+ requires?: {
4386
+ pattern: string;
4387
+ scope: "line" | "file";
4388
+ } | undefined;
4389
+ examples?: {
4390
+ bad: string;
4391
+ good: string;
4392
+ }[] | undefined;
4393
+ language?: string | undefined;
4394
+ verificationShadow?: {
4395
+ type: string;
4396
+ source: string;
4397
+ } | undefined;
4398
+ recoveryHint?: string | undefined;
4399
+ curation?: {
4400
+ sourceLesson: string;
4401
+ curatedBy?: string | undefined;
4402
+ curatedAt?: string | undefined;
4403
+ baseline5Phase?: number | undefined;
4404
+ } | undefined;
3338
4405
  }[];
3339
4406
  nonCompilable?: (string | {
3340
4407
  hash: string;