@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
@@ -57,7 +57,7 @@ export declare const AuthoredOriginSchema: z.ZodUnion<[z.ZodObject<{
57
57
  suggestionHash: string;
58
58
  }>]>;
59
59
  export type AuthoredOrigin = z.infer<typeof AuthoredOriginSchema>;
60
- export declare const AUTHORED_RULE_ID_RE: RegExp;
60
+ export { AUTHORED_RULE_ID_RE } from '../compiler-schema.js';
61
61
  /**
62
62
  * ADR-112 §3 — the authored producer's sole output envelope. Parallel to
63
63
  * ADR-111's `CandidateRuleRecord` but carrying the AUTHORED provenance variant,
@@ -111,6 +111,27 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
111
111
  kind: "commit";
112
112
  preimageCommitSha: string;
113
113
  mergeCommitSha: string;
114
+ }>, z.ZodObject<{
115
+ kind: z.ZodLiteral<"record">;
116
+ ruleId: z.ZodString;
117
+ ordinal: z.ZodNumber;
118
+ pairHash: z.ZodString;
119
+ badExample: z.ZodEffects<z.ZodString, string, string>;
120
+ goodExample: z.ZodEffects<z.ZodString, string, string>;
121
+ }, "strict", z.ZodTypeAny, {
122
+ kind: "record";
123
+ badExample: string;
124
+ goodExample: string;
125
+ ruleId: string;
126
+ ordinal: number;
127
+ pairHash: string;
128
+ }, {
129
+ kind: "record";
130
+ badExample: string;
131
+ goodExample: string;
132
+ ruleId: string;
133
+ ordinal: number;
134
+ pairHash: string;
114
135
  }>]>;
115
136
  filePath: z.ZodEffects<z.ZodString, string, string>;
116
137
  matchedSpan: z.ZodEffects<z.ZodString, string, string>;
@@ -126,6 +147,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
126
147
  kind: "commit";
127
148
  preimageCommitSha: string;
128
149
  mergeCommitSha: string;
150
+ } | {
151
+ kind: "record";
152
+ badExample: string;
153
+ goodExample: string;
154
+ ruleId: string;
155
+ ordinal: number;
156
+ pairHash: string;
129
157
  };
130
158
  filePath: string;
131
159
  matchedSpan: string;
@@ -141,6 +169,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
141
169
  kind: "commit";
142
170
  preimageCommitSha: string;
143
171
  mergeCommitSha: string;
172
+ } | {
173
+ kind: "record";
174
+ badExample: string;
175
+ goodExample: string;
176
+ ruleId: string;
177
+ ordinal: number;
178
+ pairHash: string;
144
179
  };
145
180
  filePath: string;
146
181
  matchedSpan: string;
@@ -156,6 +191,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
156
191
  kind: "commit";
157
192
  preimageCommitSha: string;
158
193
  mergeCommitSha: string;
194
+ } | {
195
+ kind: "record";
196
+ badExample: string;
197
+ goodExample: string;
198
+ ruleId: string;
199
+ ordinal: number;
200
+ pairHash: string;
159
201
  };
160
202
  filePath: string;
161
203
  matchedSpan: string;
@@ -171,6 +213,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
171
213
  kind: "commit";
172
214
  preimageCommitSha: string;
173
215
  mergeCommitSha: string;
216
+ } | {
217
+ kind: "record";
218
+ badExample: string;
219
+ goodExample: string;
220
+ ruleId: string;
221
+ ordinal: number;
222
+ pairHash: string;
174
223
  };
175
224
  filePath: string;
176
225
  matchedSpan: string;
@@ -240,6 +289,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
240
289
  kind: "commit";
241
290
  preimageCommitSha: string;
242
291
  mergeCommitSha: string;
292
+ } | {
293
+ kind: "record";
294
+ badExample: string;
295
+ goodExample: string;
296
+ ruleId: string;
297
+ ordinal: number;
298
+ pairHash: string;
243
299
  };
244
300
  filePath: string;
245
301
  matchedSpan: string;
@@ -273,6 +329,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
273
329
  kind: "commit";
274
330
  preimageCommitSha: string;
275
331
  mergeCommitSha: string;
332
+ } | {
333
+ kind: "record";
334
+ badExample: string;
335
+ goodExample: string;
336
+ ruleId: string;
337
+ ordinal: number;
338
+ pairHash: string;
276
339
  };
277
340
  filePath: string;
278
341
  matchedSpan: string;
@@ -334,14 +397,445 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
334
397
  sourceRunId: string;
335
398
  suggestionHash: string;
336
399
  }>]>;
400
+ /**
401
+ * The engine the structural-eligibility whitelist was judged for. Since Prop 310
402
+ * slice 3 it is DERIVED at intake from the record's `target.type`
403
+ * (`parsed.derivedEngine`, § Design 3/R17) and is never author-mirrored — a
404
+ * mirrored engine field is Tenet 20's prohibited copy at record scale.
405
+ */
337
406
  declaredEngine: z.ZodEnum<["regex", "ast", "ast-grep"]>;
338
407
  /** Reference to the §8 authoring-ledger entry (author/date/engine/splitRef/attestations). */
339
408
  authoringLedgerRef: z.ZodEffects<z.ZodString, string, string>;
340
- /** The human-written matcher (same DSL the compiler accepts from the miner). */
341
- dslSource: z.ZodEffects<z.ZodString, string, string>;
409
+ /**
410
+ * Prop 310 § Design 1 — the INGESTED rule record. Replaces the inline
411
+ * `dslSource`: since slice 3 the record file is the only authoring surface, so
412
+ * the matcher reaches the compiler already parsed, never re-serialised into
413
+ * lesson markdown.
414
+ *
415
+ * `contentHash` is the sha256 of the LF-admitted bytes actually ingested, and it
416
+ * is what the §8 attestations bind to (§ Design 1's relocation constraint): the
417
+ * `path` is INFORMATIONAL only, because renaming a record changes no identity
418
+ * (§ Design 1) and must not force re-attestation. `parsed` is the in-memory
419
+ * value the lowering consumes and is never hash material — `contentHash` stands
420
+ * in for it, so the bytes and the attestation can never disagree.
421
+ */
422
+ record: z.ZodObject<{
423
+ /** Repo-relative POSIX path the record was read from — informational, never identity. */
424
+ path: z.ZodEffects<z.ZodString, string, string>;
425
+ /** sha256 of the LF-admitted record bytes — what every attestation binds to. */
426
+ contentHash: z.ZodString;
427
+ /** Slice 1's parsed value (§ Design 3's derived engine + Amendment 1's pair hashes). */
428
+ parsed: z.ZodObject<{
429
+ record: z.ZodObject<{
430
+ schemaVersion: z.ZodLiteral<1>;
431
+ severity: z.ZodEnum<["error", "warning"]>;
432
+ message: z.ZodEffects<z.ZodString, string, string>;
433
+ recoveryHint: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
434
+ target: z.ZodEffects<z.ZodObject<{
435
+ type: z.ZodEnum<["ast-grep", "regex"]>;
436
+ language: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
437
+ pattern: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
438
+ rule: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>;
439
+ scope: z.ZodObject<{
440
+ fileGlobs: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
441
+ excludeGlobs: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>;
442
+ }, "strict", z.ZodTypeAny, {
443
+ fileGlobs: string[];
444
+ excludeGlobs?: string[] | undefined;
445
+ }, {
446
+ fileGlobs: string[];
447
+ excludeGlobs?: string[] | undefined;
448
+ }>;
449
+ }, "strict", z.ZodTypeAny, {
450
+ type: "regex" | "ast-grep";
451
+ scope: {
452
+ fileGlobs: string[];
453
+ excludeGlobs?: string[] | undefined;
454
+ };
455
+ rule?: Record<string, unknown> | undefined;
456
+ pattern?: string | undefined;
457
+ language?: string | undefined;
458
+ }, {
459
+ type: "regex" | "ast-grep";
460
+ scope: {
461
+ fileGlobs: string[];
462
+ excludeGlobs?: string[] | undefined;
463
+ };
464
+ rule?: Record<string, unknown> | undefined;
465
+ pattern?: string | undefined;
466
+ language?: string | undefined;
467
+ }>, {
468
+ type: "regex" | "ast-grep";
469
+ scope: {
470
+ fileGlobs: string[];
471
+ excludeGlobs?: string[] | undefined;
472
+ };
473
+ rule?: Record<string, unknown> | undefined;
474
+ pattern?: string | undefined;
475
+ language?: string | undefined;
476
+ }, {
477
+ type: "regex" | "ast-grep";
478
+ scope: {
479
+ fileGlobs: string[];
480
+ excludeGlobs?: string[] | undefined;
481
+ };
482
+ rule?: Record<string, unknown> | undefined;
483
+ pattern?: string | undefined;
484
+ language?: string | undefined;
485
+ }>;
486
+ examples: z.ZodArray<z.ZodObject<{
487
+ bad: z.ZodEffects<z.ZodString, string, string>;
488
+ good: z.ZodEffects<z.ZodString, string, string>;
489
+ }, "strict", z.ZodTypeAny, {
490
+ bad: string;
491
+ good: string;
492
+ }, {
493
+ bad: string;
494
+ good: string;
495
+ }>, "many">;
496
+ requires: z.ZodOptional<z.ZodObject<{
497
+ pattern: z.ZodEffects<z.ZodString, string, string>;
498
+ scope: z.ZodEnum<["line", "file"]>;
499
+ }, "strict", z.ZodTypeAny, {
500
+ pattern: string;
501
+ scope: "line" | "file";
502
+ }, {
503
+ pattern: string;
504
+ scope: "line" | "file";
505
+ }>>;
506
+ curation: z.ZodOptional<z.ZodEffects<z.ZodObject<{
507
+ sourceLesson: z.ZodEffects<z.ZodString, string, string>;
508
+ curatedBy: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
509
+ curatedAt: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
510
+ baseline5Phase: z.ZodOptional<z.ZodNumber>;
511
+ }, "strict", z.ZodTypeAny, {
512
+ sourceLesson: string;
513
+ curatedBy?: string | undefined;
514
+ curatedAt?: string | undefined;
515
+ baseline5Phase?: number | undefined;
516
+ }, {
517
+ sourceLesson: string;
518
+ curatedBy?: string | undefined;
519
+ curatedAt?: string | undefined;
520
+ baseline5Phase?: number | undefined;
521
+ }>, {
522
+ sourceLesson: string;
523
+ curatedBy?: string | undefined;
524
+ curatedAt?: string | undefined;
525
+ baseline5Phase?: number | undefined;
526
+ }, {
527
+ sourceLesson: string;
528
+ curatedBy?: string | undefined;
529
+ curatedAt?: string | undefined;
530
+ baseline5Phase?: number | undefined;
531
+ }>>;
532
+ verification_shadow: z.ZodOptional<z.ZodObject<{
533
+ type: z.ZodEffects<z.ZodString, string, string>;
534
+ source: z.ZodEffects<z.ZodString, string, string>;
535
+ }, "strict", z.ZodTypeAny, {
536
+ type: string;
537
+ source: string;
538
+ }, {
539
+ type: string;
540
+ source: string;
541
+ }>>;
542
+ }, "strict", z.ZodTypeAny, {
543
+ message: string;
544
+ severity: "error" | "warning";
545
+ examples: {
546
+ bad: string;
547
+ good: string;
548
+ }[];
549
+ schemaVersion: 1;
550
+ target: {
551
+ type: "regex" | "ast-grep";
552
+ scope: {
553
+ fileGlobs: string[];
554
+ excludeGlobs?: string[] | undefined;
555
+ };
556
+ rule?: Record<string, unknown> | undefined;
557
+ pattern?: string | undefined;
558
+ language?: string | undefined;
559
+ };
560
+ requires?: {
561
+ pattern: string;
562
+ scope: "line" | "file";
563
+ } | undefined;
564
+ recoveryHint?: string | undefined;
565
+ curation?: {
566
+ sourceLesson: string;
567
+ curatedBy?: string | undefined;
568
+ curatedAt?: string | undefined;
569
+ baseline5Phase?: number | undefined;
570
+ } | undefined;
571
+ verification_shadow?: {
572
+ type: string;
573
+ source: string;
574
+ } | undefined;
575
+ }, {
576
+ message: string;
577
+ severity: "error" | "warning";
578
+ examples: {
579
+ bad: string;
580
+ good: string;
581
+ }[];
582
+ schemaVersion: 1;
583
+ target: {
584
+ type: "regex" | "ast-grep";
585
+ scope: {
586
+ fileGlobs: string[];
587
+ excludeGlobs?: string[] | undefined;
588
+ };
589
+ rule?: Record<string, unknown> | undefined;
590
+ pattern?: string | undefined;
591
+ language?: string | undefined;
592
+ };
593
+ requires?: {
594
+ pattern: string;
595
+ scope: "line" | "file";
596
+ } | undefined;
597
+ recoveryHint?: string | undefined;
598
+ curation?: {
599
+ sourceLesson: string;
600
+ curatedBy?: string | undefined;
601
+ curatedAt?: string | undefined;
602
+ baseline5Phase?: number | undefined;
603
+ } | undefined;
604
+ verification_shadow?: {
605
+ type: string;
606
+ source: string;
607
+ } | undefined;
608
+ }>;
609
+ derivedEngine: z.ZodEnum<["ast-grep", "regex"]>;
610
+ examplePairHashes: z.ZodArray<z.ZodObject<{
611
+ ordinal: z.ZodNumber;
612
+ hash: z.ZodString;
613
+ }, "strict", z.ZodTypeAny, {
614
+ ordinal: number;
615
+ hash: string;
616
+ }, {
617
+ ordinal: number;
618
+ hash: string;
619
+ }>, "many">;
620
+ }, "strict", z.ZodTypeAny, {
621
+ record: {
622
+ message: string;
623
+ severity: "error" | "warning";
624
+ examples: {
625
+ bad: string;
626
+ good: string;
627
+ }[];
628
+ schemaVersion: 1;
629
+ target: {
630
+ type: "regex" | "ast-grep";
631
+ scope: {
632
+ fileGlobs: string[];
633
+ excludeGlobs?: string[] | undefined;
634
+ };
635
+ rule?: Record<string, unknown> | undefined;
636
+ pattern?: string | undefined;
637
+ language?: string | undefined;
638
+ };
639
+ requires?: {
640
+ pattern: string;
641
+ scope: "line" | "file";
642
+ } | undefined;
643
+ recoveryHint?: string | undefined;
644
+ curation?: {
645
+ sourceLesson: string;
646
+ curatedBy?: string | undefined;
647
+ curatedAt?: string | undefined;
648
+ baseline5Phase?: number | undefined;
649
+ } | undefined;
650
+ verification_shadow?: {
651
+ type: string;
652
+ source: string;
653
+ } | undefined;
654
+ };
655
+ derivedEngine: "regex" | "ast-grep";
656
+ examplePairHashes: {
657
+ ordinal: number;
658
+ hash: string;
659
+ }[];
660
+ }, {
661
+ record: {
662
+ message: string;
663
+ severity: "error" | "warning";
664
+ examples: {
665
+ bad: string;
666
+ good: string;
667
+ }[];
668
+ schemaVersion: 1;
669
+ target: {
670
+ type: "regex" | "ast-grep";
671
+ scope: {
672
+ fileGlobs: string[];
673
+ excludeGlobs?: string[] | undefined;
674
+ };
675
+ rule?: Record<string, unknown> | undefined;
676
+ pattern?: string | undefined;
677
+ language?: string | undefined;
678
+ };
679
+ requires?: {
680
+ pattern: string;
681
+ scope: "line" | "file";
682
+ } | undefined;
683
+ recoveryHint?: string | undefined;
684
+ curation?: {
685
+ sourceLesson: string;
686
+ curatedBy?: string | undefined;
687
+ curatedAt?: string | undefined;
688
+ baseline5Phase?: number | undefined;
689
+ } | undefined;
690
+ verification_shadow?: {
691
+ type: string;
692
+ source: string;
693
+ } | undefined;
694
+ };
695
+ derivedEngine: "regex" | "ast-grep";
696
+ examplePairHashes: {
697
+ ordinal: number;
698
+ hash: string;
699
+ }[];
700
+ }>;
701
+ }, "strict", z.ZodTypeAny, {
702
+ path: string;
703
+ contentHash: string;
704
+ parsed: {
705
+ record: {
706
+ message: string;
707
+ severity: "error" | "warning";
708
+ examples: {
709
+ bad: string;
710
+ good: string;
711
+ }[];
712
+ schemaVersion: 1;
713
+ target: {
714
+ type: "regex" | "ast-grep";
715
+ scope: {
716
+ fileGlobs: string[];
717
+ excludeGlobs?: string[] | undefined;
718
+ };
719
+ rule?: Record<string, unknown> | undefined;
720
+ pattern?: string | undefined;
721
+ language?: string | undefined;
722
+ };
723
+ requires?: {
724
+ pattern: string;
725
+ scope: "line" | "file";
726
+ } | undefined;
727
+ recoveryHint?: string | undefined;
728
+ curation?: {
729
+ sourceLesson: string;
730
+ curatedBy?: string | undefined;
731
+ curatedAt?: string | undefined;
732
+ baseline5Phase?: number | undefined;
733
+ } | undefined;
734
+ verification_shadow?: {
735
+ type: string;
736
+ source: string;
737
+ } | undefined;
738
+ };
739
+ derivedEngine: "regex" | "ast-grep";
740
+ examplePairHashes: {
741
+ ordinal: number;
742
+ hash: string;
743
+ }[];
744
+ };
745
+ }, {
746
+ path: string;
747
+ contentHash: string;
748
+ parsed: {
749
+ record: {
750
+ message: string;
751
+ severity: "error" | "warning";
752
+ examples: {
753
+ bad: string;
754
+ good: string;
755
+ }[];
756
+ schemaVersion: 1;
757
+ target: {
758
+ type: "regex" | "ast-grep";
759
+ scope: {
760
+ fileGlobs: string[];
761
+ excludeGlobs?: string[] | undefined;
762
+ };
763
+ rule?: Record<string, unknown> | undefined;
764
+ pattern?: string | undefined;
765
+ language?: string | undefined;
766
+ };
767
+ requires?: {
768
+ pattern: string;
769
+ scope: "line" | "file";
770
+ } | undefined;
771
+ recoveryHint?: string | undefined;
772
+ curation?: {
773
+ sourceLesson: string;
774
+ curatedBy?: string | undefined;
775
+ curatedAt?: string | undefined;
776
+ baseline5Phase?: number | undefined;
777
+ } | undefined;
778
+ verification_shadow?: {
779
+ type: string;
780
+ source: string;
781
+ } | undefined;
782
+ };
783
+ derivedEngine: "regex" | "ast-grep";
784
+ examplePairHashes: {
785
+ ordinal: number;
786
+ hash: string;
787
+ }[];
788
+ };
789
+ }>;
342
790
  /** Zero-trust mint (ADR-089 / ADR-112 §1) — always literally `true`. */
343
791
  unverified: z.ZodLiteral<true>;
344
792
  }, "strip", z.ZodTypeAny, {
793
+ record: {
794
+ path: string;
795
+ contentHash: string;
796
+ parsed: {
797
+ record: {
798
+ message: string;
799
+ severity: "error" | "warning";
800
+ examples: {
801
+ bad: string;
802
+ good: string;
803
+ }[];
804
+ schemaVersion: 1;
805
+ target: {
806
+ type: "regex" | "ast-grep";
807
+ scope: {
808
+ fileGlobs: string[];
809
+ excludeGlobs?: string[] | undefined;
810
+ };
811
+ rule?: Record<string, unknown> | undefined;
812
+ pattern?: string | undefined;
813
+ language?: string | undefined;
814
+ };
815
+ requires?: {
816
+ pattern: string;
817
+ scope: "line" | "file";
818
+ } | undefined;
819
+ recoveryHint?: string | undefined;
820
+ curation?: {
821
+ sourceLesson: string;
822
+ curatedBy?: string | undefined;
823
+ curatedAt?: string | undefined;
824
+ baseline5Phase?: number | undefined;
825
+ } | undefined;
826
+ verification_shadow?: {
827
+ type: string;
828
+ source: string;
829
+ } | undefined;
830
+ };
831
+ derivedEngine: "regex" | "ast-grep";
832
+ examplePairHashes: {
833
+ ordinal: number;
834
+ hash: string;
835
+ }[];
836
+ };
837
+ };
838
+ ruleId: string;
345
839
  provenance: {
346
840
  kind: "authored";
347
841
  author: string;
@@ -358,6 +852,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
358
852
  kind: "commit";
359
853
  preimageCommitSha: string;
360
854
  mergeCommitSha: string;
855
+ } | {
856
+ kind: "record";
857
+ badExample: string;
858
+ goodExample: string;
859
+ ruleId: string;
860
+ ordinal: number;
861
+ pairHash: string;
361
862
  };
362
863
  filePath: string;
363
864
  matchedSpan: string;
@@ -377,7 +878,6 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
377
878
  }[] | undefined;
378
879
  };
379
880
  unverified: true;
380
- ruleId: string;
381
881
  origin: {
382
882
  kind: "from-scratch";
383
883
  } | {
@@ -385,7 +885,6 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
385
885
  sourceRunId: string;
386
886
  suggestionHash: string;
387
887
  };
388
- dslSource: string;
389
888
  structuralEligibility: {
390
889
  decidable: boolean;
391
890
  basis: string;
@@ -394,6 +893,52 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
394
893
  declaredEngine: "regex" | "ast" | "ast-grep";
395
894
  authoringLedgerRef: string;
396
895
  }, {
896
+ record: {
897
+ path: string;
898
+ contentHash: string;
899
+ parsed: {
900
+ record: {
901
+ message: string;
902
+ severity: "error" | "warning";
903
+ examples: {
904
+ bad: string;
905
+ good: string;
906
+ }[];
907
+ schemaVersion: 1;
908
+ target: {
909
+ type: "regex" | "ast-grep";
910
+ scope: {
911
+ fileGlobs: string[];
912
+ excludeGlobs?: string[] | undefined;
913
+ };
914
+ rule?: Record<string, unknown> | undefined;
915
+ pattern?: string | undefined;
916
+ language?: string | undefined;
917
+ };
918
+ requires?: {
919
+ pattern: string;
920
+ scope: "line" | "file";
921
+ } | undefined;
922
+ recoveryHint?: string | undefined;
923
+ curation?: {
924
+ sourceLesson: string;
925
+ curatedBy?: string | undefined;
926
+ curatedAt?: string | undefined;
927
+ baseline5Phase?: number | undefined;
928
+ } | undefined;
929
+ verification_shadow?: {
930
+ type: string;
931
+ source: string;
932
+ } | undefined;
933
+ };
934
+ derivedEngine: "regex" | "ast-grep";
935
+ examplePairHashes: {
936
+ ordinal: number;
937
+ hash: string;
938
+ }[];
939
+ };
940
+ };
941
+ ruleId: string;
397
942
  provenance: {
398
943
  kind: "authored";
399
944
  author: string;
@@ -410,6 +955,13 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
410
955
  kind: "commit";
411
956
  preimageCommitSha: string;
412
957
  mergeCommitSha: string;
958
+ } | {
959
+ kind: "record";
960
+ badExample: string;
961
+ goodExample: string;
962
+ ruleId: string;
963
+ ordinal: number;
964
+ pairHash: string;
413
965
  };
414
966
  filePath: string;
415
967
  matchedSpan: string;
@@ -429,7 +981,6 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
429
981
  }[] | undefined;
430
982
  };
431
983
  unverified: true;
432
- ruleId: string;
433
984
  origin: {
434
985
  kind: "from-scratch";
435
986
  } | {
@@ -437,7 +988,6 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
437
988
  sourceRunId: string;
438
989
  suggestionHash: string;
439
990
  };
440
- dslSource: string;
441
991
  structuralEligibility: {
442
992
  decidable: boolean;
443
993
  basis: string;
@@ -447,6 +997,52 @@ export declare const AuthoredRuleRecordSchema: z.ZodObject<{
447
997
  authoringLedgerRef: string;
448
998
  }>;
449
999
  export type AuthoredRuleRecord = z.infer<typeof AuthoredRuleRecordSchema>;
1000
+ /**
1001
+ * Prop 310 § Design 10 — the AUTHOR-SIDE positive fixture: the ADR-112 §6 corpus
1002
+ * anchor (`pr` + `filePath` + `matchedSpan` + `contentHash`, the line-drift-stable
1003
+ * locus) plus an ORDINAL REFERENCE into the record's `examples`.
1004
+ *
1005
+ * The author writes the reference; INTAKE derives the fixture's `preimageSource`
1006
+ * from `examples[example]` and the minted `ruleId` (Amendment 1: the record's
1007
+ * `examples` block is the editable home, the envelope derives). So an inline
1008
+ * `preimageSource` here is unknown-key under `.strict()` AND named explicitly by
1009
+ * the intake's migration scan — the author never hand-writes the derived side, and
1010
+ * the derived `AuthoredFixture` never carries the reference back (two homes for
1011
+ * one ordinal is the Tenet-20 mirror).
1012
+ *
1013
+ * Refines are NON-mutating, matching `AuthoredFixtureSchema`'s own hash-stability
1014
+ * discipline: these values land inside the ledger's material hash.
1015
+ */
1016
+ export declare const RecordFixtureInputSchema: z.ZodObject<{
1017
+ /** The PR where the defect was caught/introduced (the in-corpus anchor). */
1018
+ pr: z.ZodNumber;
1019
+ /** File the defect locus lives in. */
1020
+ filePath: z.ZodEffects<z.ZodString, string, string>;
1021
+ /** Line-range or AST-node path — the defect locus, not just the file. */
1022
+ matchedSpan: z.ZodEffects<z.ZodString, string, string>;
1023
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
1024
+ contentHash: z.ZodEffects<z.ZodString, string, string>;
1025
+ /**
1026
+ * The `examples[i]` ordinal this fixture's preimage differential draws from
1027
+ * (§ Design 10's `(ruleId, ordinal)` join key). A dangling ordinal, or two
1028
+ * fixtures of one entry naming the same one, fails LOUD at intake — never a
1029
+ * silent re-pair.
1030
+ */
1031
+ example: z.ZodNumber;
1032
+ }, "strict", z.ZodTypeAny, {
1033
+ pr: number;
1034
+ filePath: string;
1035
+ matchedSpan: string;
1036
+ contentHash: string;
1037
+ example: number;
1038
+ }, {
1039
+ pr: number;
1040
+ filePath: string;
1041
+ matchedSpan: string;
1042
+ contentHash: string;
1043
+ example: number;
1044
+ }>;
1045
+ export type RecordFixtureInput = z.infer<typeof RecordFixtureInputSchema>;
450
1046
  export declare const AuthoredRuleInputSchema: z.ZodObject<{
451
1047
  /** Agent-id or operator handle — attributable (mirrors the provenance field). Trimmed. */
452
1048
  author: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
@@ -459,8 +1055,6 @@ export declare const AuthoredRuleInputSchema: z.ZodObject<{
459
1055
  authoredAt: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
460
1056
  /** The declared DEFECT the rule targets — the pre-image, not its fix (ADR-110 §4 TP-def). Trimmed. */
461
1057
  targetDefect: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
462
- /** The matcher engine the author declares; the eligibility check confirms it can represent the class. */
463
- declaredEngine: z.ZodEnum<["regex", "ast", "ast-grep"]>;
464
1058
  /**
465
1059
  * The structural rule-CLASS the author CLAIMS. Fed to the INDEPENDENT
466
1060
  * `evaluateStructuralEligibility` against the DI whitelist; it is NOT stored
@@ -470,102 +1064,48 @@ export declare const AuthoredRuleInputSchema: z.ZodObject<{
470
1064
  * cause an exact-match miss against the registry.
471
1065
  */
472
1066
  structuralClass: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
473
- /** The human-written matcher (same DSL the compiler accepts from the miner). */
474
- dslSource: z.ZodEffects<z.ZodString, string, string>;
1067
+ /**
1068
+ * Prop 310 § Design 1 — a repo-relative POSIX reference to the rule record,
1069
+ * `.totem/rules/<slug>.rule.yaml`. THE ONLY rule carrier the envelope accepts
1070
+ * (OQ-1 ruling, records-only): an inline `dslSource` / `declaredEngine` /
1071
+ * `preimageSource` is a migration error the intake rejects BY NAME.
1072
+ *
1073
+ * The path's shape (inside `<totemDir>/rules/`, `*.rule.yaml`, no `..`) is
1074
+ * checked at the intake seam, which has the filesystem; this schema only pins
1075
+ * it to a non-empty string. Trimmed: the path is NOT hash material (§ Design 1
1076
+ * — a rename must not force re-attestation), so normalising it costs nothing
1077
+ * and stops a stray space from becoming an unresolvable reference.
1078
+ */
1079
+ record: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
475
1080
  /** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
476
- positiveFixtures: z.ZodArray<z.ZodEffects<z.ZodObject<{
1081
+ positiveFixtures: z.ZodArray<z.ZodObject<{
1082
+ /** The PR where the defect was caught/introduced (the in-corpus anchor). */
477
1083
  pr: z.ZodNumber;
478
- preimageSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
479
- kind: z.ZodLiteral<"lesson">;
480
- lessonRef: z.ZodString;
481
- badExample: z.ZodEffects<z.ZodString, string, string>;
482
- goodExample: z.ZodEffects<z.ZodString, string, string>;
483
- }, "strict", z.ZodTypeAny, {
484
- kind: "lesson";
485
- lessonRef: string;
486
- badExample: string;
487
- goodExample: string;
488
- }, {
489
- kind: "lesson";
490
- lessonRef: string;
491
- badExample: string;
492
- goodExample: string;
493
- }>, z.ZodObject<{
494
- kind: z.ZodLiteral<"commit">;
495
- preimageCommitSha: z.ZodString;
496
- mergeCommitSha: z.ZodString;
497
- }, "strict", z.ZodTypeAny, {
498
- kind: "commit";
499
- preimageCommitSha: string;
500
- mergeCommitSha: string;
501
- }, {
502
- kind: "commit";
503
- preimageCommitSha: string;
504
- mergeCommitSha: string;
505
- }>]>;
1084
+ /** File the defect locus lives in. */
506
1085
  filePath: z.ZodEffects<z.ZodString, string, string>;
1086
+ /** Line-range or AST-node path — the defect locus, not just the file. */
507
1087
  matchedSpan: z.ZodEffects<z.ZodString, string, string>;
1088
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
508
1089
  contentHash: z.ZodEffects<z.ZodString, string, string>;
1090
+ /**
1091
+ * The `examples[i]` ordinal this fixture's preimage differential draws from
1092
+ * (§ Design 10's `(ruleId, ordinal)` join key). A dangling ordinal, or two
1093
+ * fixtures of one entry naming the same one, fails LOUD at intake — never a
1094
+ * silent re-pair.
1095
+ */
1096
+ example: z.ZodNumber;
509
1097
  }, "strict", z.ZodTypeAny, {
510
1098
  pr: number;
511
- preimageSource: {
512
- kind: "lesson";
513
- lessonRef: string;
514
- badExample: string;
515
- goodExample: string;
516
- } | {
517
- kind: "commit";
518
- preimageCommitSha: string;
519
- mergeCommitSha: string;
520
- };
521
- filePath: string;
522
- matchedSpan: string;
523
- contentHash: string;
524
- }, {
525
- pr: number;
526
- preimageSource: {
527
- kind: "lesson";
528
- lessonRef: string;
529
- badExample: string;
530
- goodExample: string;
531
- } | {
532
- kind: "commit";
533
- preimageCommitSha: string;
534
- mergeCommitSha: string;
535
- };
536
- filePath: string;
537
- matchedSpan: string;
538
- contentHash: string;
539
- }>, {
540
- pr: number;
541
- preimageSource: {
542
- kind: "lesson";
543
- lessonRef: string;
544
- badExample: string;
545
- goodExample: string;
546
- } | {
547
- kind: "commit";
548
- preimageCommitSha: string;
549
- mergeCommitSha: string;
550
- };
551
1099
  filePath: string;
552
1100
  matchedSpan: string;
553
1101
  contentHash: string;
1102
+ example: number;
554
1103
  }, {
555
1104
  pr: number;
556
- preimageSource: {
557
- kind: "lesson";
558
- lessonRef: string;
559
- badExample: string;
560
- goodExample: string;
561
- } | {
562
- kind: "commit";
563
- preimageCommitSha: string;
564
- mergeCommitSha: string;
565
- };
566
1105
  filePath: string;
567
1106
  matchedSpan: string;
568
1107
  contentHash: string;
1108
+ example: number;
569
1109
  }>, "many">;
570
1110
  /**
571
1111
  * Declared SILENCE-ONLY near-misses the rule must stay silent on (feeds §6
@@ -645,27 +1185,17 @@ export declare const AuthoredRuleInputSchema: z.ZodObject<{
645
1185
  suggestionHash: string;
646
1186
  }>]>>;
647
1187
  }, "strict", z.ZodTypeAny, {
1188
+ record: string;
648
1189
  author: string;
649
1190
  authoredAt: string;
650
1191
  targetDefect: string;
651
1192
  positiveFixtures: {
652
1193
  pr: number;
653
- preimageSource: {
654
- kind: "lesson";
655
- lessonRef: string;
656
- badExample: string;
657
- goodExample: string;
658
- } | {
659
- kind: "commit";
660
- preimageCommitSha: string;
661
- mergeCommitSha: string;
662
- };
663
1194
  filePath: string;
664
1195
  matchedSpan: string;
665
1196
  contentHash: string;
1197
+ example: number;
666
1198
  }[];
667
- dslSource: string;
668
- declaredEngine: "regex" | "ast" | "ast-grep";
669
1199
  structuralClass: string;
670
1200
  negativeFixtures?: {
671
1201
  filePath: string;
@@ -687,27 +1217,17 @@ export declare const AuthoredRuleInputSchema: z.ZodObject<{
687
1217
  suggestionHash: string;
688
1218
  } | undefined;
689
1219
  }, {
1220
+ record: string;
690
1221
  author: string;
691
1222
  authoredAt: string;
692
1223
  targetDefect: string;
693
1224
  positiveFixtures: {
694
1225
  pr: number;
695
- preimageSource: {
696
- kind: "lesson";
697
- lessonRef: string;
698
- badExample: string;
699
- goodExample: string;
700
- } | {
701
- kind: "commit";
702
- preimageCommitSha: string;
703
- mergeCommitSha: string;
704
- };
705
1226
  filePath: string;
706
1227
  matchedSpan: string;
707
1228
  contentHash: string;
1229
+ example: number;
708
1230
  }[];
709
- dslSource: string;
710
- declaredEngine: "regex" | "ast" | "ast-grep";
711
1231
  structuralClass: string;
712
1232
  negativeFixtures?: {
713
1233
  filePath: string;
@@ -771,8 +1291,6 @@ export declare const AuthoredRulesFileSchema: z.ZodObject<{
771
1291
  authoredAt: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
772
1292
  /** The declared DEFECT the rule targets — the pre-image, not its fix (ADR-110 §4 TP-def). Trimmed. */
773
1293
  targetDefect: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
774
- /** The matcher engine the author declares; the eligibility check confirms it can represent the class. */
775
- declaredEngine: z.ZodEnum<["regex", "ast", "ast-grep"]>;
776
1294
  /**
777
1295
  * The structural rule-CLASS the author CLAIMS. Fed to the INDEPENDENT
778
1296
  * `evaluateStructuralEligibility` against the DI whitelist; it is NOT stored
@@ -782,102 +1300,48 @@ export declare const AuthoredRulesFileSchema: z.ZodObject<{
782
1300
  * cause an exact-match miss against the registry.
783
1301
  */
784
1302
  structuralClass: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
785
- /** The human-written matcher (same DSL the compiler accepts from the miner). */
786
- dslSource: z.ZodEffects<z.ZodString, string, string>;
1303
+ /**
1304
+ * Prop 310 § Design 1 — a repo-relative POSIX reference to the rule record,
1305
+ * `.totem/rules/<slug>.rule.yaml`. THE ONLY rule carrier the envelope accepts
1306
+ * (OQ-1 ruling, records-only): an inline `dslSource` / `declaredEngine` /
1307
+ * `preimageSource` is a migration error the intake rejects BY NAME.
1308
+ *
1309
+ * The path's shape (inside `<totemDir>/rules/`, `*.rule.yaml`, no `..`) is
1310
+ * checked at the intake seam, which has the filesystem; this schema only pins
1311
+ * it to a non-empty string. Trimmed: the path is NOT hash material (§ Design 1
1312
+ * — a rename must not force re-attestation), so normalising it costs nothing
1313
+ * and stops a stray space from becoming an unresolvable reference.
1314
+ */
1315
+ record: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
787
1316
  /** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
788
- positiveFixtures: z.ZodArray<z.ZodEffects<z.ZodObject<{
1317
+ positiveFixtures: z.ZodArray<z.ZodObject<{
1318
+ /** The PR where the defect was caught/introduced (the in-corpus anchor). */
789
1319
  pr: z.ZodNumber;
790
- preimageSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
791
- kind: z.ZodLiteral<"lesson">;
792
- lessonRef: z.ZodString;
793
- badExample: z.ZodEffects<z.ZodString, string, string>;
794
- goodExample: z.ZodEffects<z.ZodString, string, string>;
795
- }, "strict", z.ZodTypeAny, {
796
- kind: "lesson";
797
- lessonRef: string;
798
- badExample: string;
799
- goodExample: string;
800
- }, {
801
- kind: "lesson";
802
- lessonRef: string;
803
- badExample: string;
804
- goodExample: string;
805
- }>, z.ZodObject<{
806
- kind: z.ZodLiteral<"commit">;
807
- preimageCommitSha: z.ZodString;
808
- mergeCommitSha: z.ZodString;
809
- }, "strict", z.ZodTypeAny, {
810
- kind: "commit";
811
- preimageCommitSha: string;
812
- mergeCommitSha: string;
813
- }, {
814
- kind: "commit";
815
- preimageCommitSha: string;
816
- mergeCommitSha: string;
817
- }>]>;
1320
+ /** File the defect locus lives in. */
818
1321
  filePath: z.ZodEffects<z.ZodString, string, string>;
1322
+ /** Line-range or AST-node path — the defect locus, not just the file. */
819
1323
  matchedSpan: z.ZodEffects<z.ZodString, string, string>;
1324
+ /** Span content hash, line-drift-stable (cf. `firingLabelId`). */
820
1325
  contentHash: z.ZodEffects<z.ZodString, string, string>;
1326
+ /**
1327
+ * The `examples[i]` ordinal this fixture's preimage differential draws from
1328
+ * (§ Design 10's `(ruleId, ordinal)` join key). A dangling ordinal, or two
1329
+ * fixtures of one entry naming the same one, fails LOUD at intake — never a
1330
+ * silent re-pair.
1331
+ */
1332
+ example: z.ZodNumber;
821
1333
  }, "strict", z.ZodTypeAny, {
822
1334
  pr: number;
823
- preimageSource: {
824
- kind: "lesson";
825
- lessonRef: string;
826
- badExample: string;
827
- goodExample: string;
828
- } | {
829
- kind: "commit";
830
- preimageCommitSha: string;
831
- mergeCommitSha: string;
832
- };
833
1335
  filePath: string;
834
1336
  matchedSpan: string;
835
1337
  contentHash: string;
1338
+ example: number;
836
1339
  }, {
837
1340
  pr: number;
838
- preimageSource: {
839
- kind: "lesson";
840
- lessonRef: string;
841
- badExample: string;
842
- goodExample: string;
843
- } | {
844
- kind: "commit";
845
- preimageCommitSha: string;
846
- mergeCommitSha: string;
847
- };
848
- filePath: string;
849
- matchedSpan: string;
850
- contentHash: string;
851
- }>, {
852
- pr: number;
853
- preimageSource: {
854
- kind: "lesson";
855
- lessonRef: string;
856
- badExample: string;
857
- goodExample: string;
858
- } | {
859
- kind: "commit";
860
- preimageCommitSha: string;
861
- mergeCommitSha: string;
862
- };
863
- filePath: string;
864
- matchedSpan: string;
865
- contentHash: string;
866
- }, {
867
- pr: number;
868
- preimageSource: {
869
- kind: "lesson";
870
- lessonRef: string;
871
- badExample: string;
872
- goodExample: string;
873
- } | {
874
- kind: "commit";
875
- preimageCommitSha: string;
876
- mergeCommitSha: string;
877
- };
878
1341
  filePath: string;
879
1342
  matchedSpan: string;
880
1343
  contentHash: string;
1344
+ example: number;
881
1345
  }>, "many">;
882
1346
  /**
883
1347
  * Declared SILENCE-ONLY near-misses the rule must stay silent on (feeds §6
@@ -957,27 +1421,17 @@ export declare const AuthoredRulesFileSchema: z.ZodObject<{
957
1421
  suggestionHash: string;
958
1422
  }>]>>;
959
1423
  }, "strict", z.ZodTypeAny, {
1424
+ record: string;
960
1425
  author: string;
961
1426
  authoredAt: string;
962
1427
  targetDefect: string;
963
1428
  positiveFixtures: {
964
1429
  pr: number;
965
- preimageSource: {
966
- kind: "lesson";
967
- lessonRef: string;
968
- badExample: string;
969
- goodExample: string;
970
- } | {
971
- kind: "commit";
972
- preimageCommitSha: string;
973
- mergeCommitSha: string;
974
- };
975
1430
  filePath: string;
976
1431
  matchedSpan: string;
977
1432
  contentHash: string;
1433
+ example: number;
978
1434
  }[];
979
- dslSource: string;
980
- declaredEngine: "regex" | "ast" | "ast-grep";
981
1435
  structuralClass: string;
982
1436
  negativeFixtures?: {
983
1437
  filePath: string;
@@ -999,27 +1453,17 @@ export declare const AuthoredRulesFileSchema: z.ZodObject<{
999
1453
  suggestionHash: string;
1000
1454
  } | undefined;
1001
1455
  }, {
1456
+ record: string;
1002
1457
  author: string;
1003
1458
  authoredAt: string;
1004
1459
  targetDefect: string;
1005
1460
  positiveFixtures: {
1006
1461
  pr: number;
1007
- preimageSource: {
1008
- kind: "lesson";
1009
- lessonRef: string;
1010
- badExample: string;
1011
- goodExample: string;
1012
- } | {
1013
- kind: "commit";
1014
- preimageCommitSha: string;
1015
- mergeCommitSha: string;
1016
- };
1017
1462
  filePath: string;
1018
1463
  matchedSpan: string;
1019
1464
  contentHash: string;
1465
+ example: number;
1020
1466
  }[];
1021
- dslSource: string;
1022
- declaredEngine: "regex" | "ast" | "ast-grep";
1023
1467
  structuralClass: string;
1024
1468
  negativeFixtures?: {
1025
1469
  filePath: string;
@@ -1043,27 +1487,17 @@ export declare const AuthoredRulesFileSchema: z.ZodObject<{
1043
1487
  }>, "many">;
1044
1488
  }, "strict", z.ZodTypeAny, {
1045
1489
  rules: {
1490
+ record: string;
1046
1491
  author: string;
1047
1492
  authoredAt: string;
1048
1493
  targetDefect: string;
1049
1494
  positiveFixtures: {
1050
1495
  pr: number;
1051
- preimageSource: {
1052
- kind: "lesson";
1053
- lessonRef: string;
1054
- badExample: string;
1055
- goodExample: string;
1056
- } | {
1057
- kind: "commit";
1058
- preimageCommitSha: string;
1059
- mergeCommitSha: string;
1060
- };
1061
1496
  filePath: string;
1062
1497
  matchedSpan: string;
1063
1498
  contentHash: string;
1499
+ example: number;
1064
1500
  }[];
1065
- dslSource: string;
1066
- declaredEngine: "regex" | "ast" | "ast-grep";
1067
1501
  structuralClass: string;
1068
1502
  negativeFixtures?: {
1069
1503
  filePath: string;
@@ -1091,27 +1525,17 @@ export declare const AuthoredRulesFileSchema: z.ZodObject<{
1091
1525
  freezeCommitment?: string | undefined;
1092
1526
  }, {
1093
1527
  rules: {
1528
+ record: string;
1094
1529
  author: string;
1095
1530
  authoredAt: string;
1096
1531
  targetDefect: string;
1097
1532
  positiveFixtures: {
1098
1533
  pr: number;
1099
- preimageSource: {
1100
- kind: "lesson";
1101
- lessonRef: string;
1102
- badExample: string;
1103
- goodExample: string;
1104
- } | {
1105
- kind: "commit";
1106
- preimageCommitSha: string;
1107
- mergeCommitSha: string;
1108
- };
1109
1534
  filePath: string;
1110
1535
  matchedSpan: string;
1111
1536
  contentHash: string;
1537
+ example: number;
1112
1538
  }[];
1113
- dslSource: string;
1114
- declaredEngine: "regex" | "ast" | "ast-grep";
1115
1539
  structuralClass: string;
1116
1540
  negativeFixtures?: {
1117
1541
  filePath: string;