@mmnto/totem 1.81.0 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-schema.d.ts +530 -731
- package/dist/compiler-schema.d.ts.map +1 -1
- package/dist/compiler-schema.js +84 -3
- package/dist/compiler-schema.js.map +1 -1
- package/dist/compiler-schema.test.js +42 -3
- package/dist/compiler-schema.test.js.map +1 -1
- package/dist/compiler.d.ts +1 -1
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +1 -1
- package/dist/compiler.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/spine/authored-rule.d.ts +137 -306
- package/dist/spine/authored-rule.d.ts.map +1 -1
- package/dist/spine/authored-rule.js +16 -4
- package/dist/spine/authored-rule.js.map +1 -1
- package/dist/spine/authoring-ledger.d.ts +24 -9
- package/dist/spine/authoring-ledger.d.ts.map +1 -1
- package/dist/spine/authoring-ledger.js +22 -7
- package/dist/spine/authoring-ledger.js.map +1 -1
- package/dist/spine/authoring-ledger.test.js +13 -1
- package/dist/spine/authoring-ledger.test.js.map +1 -1
- package/dist/spine/candidate-rule.d.ts +11 -0
- package/dist/spine/candidate-rule.d.ts.map +1 -1
- package/dist/spine/candidate-rule.js.map +1 -1
- package/dist/spine/compile.d.ts.map +1 -1
- package/dist/spine/compile.js +30 -2
- package/dist/spine/compile.js.map +1 -1
- package/dist/spine/compile.test.js +86 -0
- package/dist/spine/compile.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -278,6 +278,117 @@ export declare const AuthoredFixtureSchema: z.ZodEffects<z.ZodObject<{
|
|
|
278
278
|
contentHash: string;
|
|
279
279
|
}>;
|
|
280
280
|
export type AuthoredFixture = z.infer<typeof AuthoredFixtureSchema>;
|
|
281
|
+
/**
|
|
282
|
+
* ADR-112 §3/§6 (strategy#770) — the source of a SILENCE-ONLY near-miss: the one
|
|
283
|
+
* exemplar a negative control's matcher must stay SILENT on. Source-pluggable per §4
|
|
284
|
+
* (a synthetic lesson `example` PRIMARY / a `commitSha` state FALLBACK) but ONE side
|
|
285
|
+
* only — a near-miss has NO must-fire leg, so this is NOT the positiveFixtures
|
|
286
|
+
* bad/good `preimageSource` pair (a negative control is a one-leg silence assertion,
|
|
287
|
+
* a positive control a two-leg differential — §6 L142 arity). `z.discriminatedUnion`
|
|
288
|
+
* + `.strict()` branches mirror `PreimageSourceSchema` (cross-branch key fails LOUD,
|
|
289
|
+
* FM(d)); refines are NON-mutating for manifest-hash stability.
|
|
290
|
+
*/
|
|
291
|
+
export declare const NearMissSourceSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
292
|
+
kind: z.ZodLiteral<"lesson">;
|
|
293
|
+
/** The synthetic near-miss exemplar the matcher must stay SILENT on (§6). */
|
|
294
|
+
example: z.ZodEffects<z.ZodString, string, string>;
|
|
295
|
+
/**
|
|
296
|
+
* OPTIONAL immutable lesson id — a synthetic near-miss may have no lesson origin,
|
|
297
|
+
* so unlike the positiveFixtures `lessonRef` it is optional; but WHEN present it
|
|
298
|
+
* carries the same §8 discipline (the 16-hex `hashLesson` codomain, never a
|
|
299
|
+
* path/mutable alias), so it can't be a free-form mutable alias.
|
|
300
|
+
*/
|
|
301
|
+
lessonRef: z.ZodOptional<z.ZodString>;
|
|
302
|
+
}, "strict", z.ZodTypeAny, {
|
|
303
|
+
kind: "lesson";
|
|
304
|
+
example: string;
|
|
305
|
+
lessonRef?: string | undefined;
|
|
306
|
+
}, {
|
|
307
|
+
kind: "lesson";
|
|
308
|
+
example: string;
|
|
309
|
+
lessonRef?: string | undefined;
|
|
310
|
+
}>, z.ZodObject<{
|
|
311
|
+
kind: z.ZodLiteral<"commit">;
|
|
312
|
+
/** The commit whose state the matcher must stay SILENT on (§6, land-then-fix fallback). */
|
|
313
|
+
commitSha: z.ZodString;
|
|
314
|
+
}, "strict", z.ZodTypeAny, {
|
|
315
|
+
kind: "commit";
|
|
316
|
+
commitSha: string;
|
|
317
|
+
}, {
|
|
318
|
+
kind: "commit";
|
|
319
|
+
commitSha: string;
|
|
320
|
+
}>]>;
|
|
321
|
+
export type NearMissSource = z.infer<typeof NearMissSourceSchema>;
|
|
322
|
+
/**
|
|
323
|
+
* ADR-112 §3/§6 (strategy#770) — a declared near-miss the rule must stay SILENT on,
|
|
324
|
+
* feeding §6 `controls.negative[]` (a fire on it is a §3.3 cull, never a corpus FP).
|
|
325
|
+
* SILENCE-ONLY: a locus (`filePath` + `matchedSpan`) + the one-side `nearMissSource`.
|
|
326
|
+
* It deliberately carries NO `pr` (a synthetic near-miss has no corpus position — the
|
|
327
|
+
* §5 leakage guard targets corpus-drawn fixtures, so there is nothing to train-side-
|
|
328
|
+
* attest), NO `contentHash`, and NO bad/good pair / anti-vacuity `superRefine` (there
|
|
329
|
+
* is no pair to be vacuously identical). `.strict()` so a leftover positiveFixtures
|
|
330
|
+
* key (e.g. `preimageSource`/`pr`) from a mis-migrated fixture fails LOUD (FM(d)).
|
|
331
|
+
*/
|
|
332
|
+
export declare const AuthoredNegativeFixtureSchema: z.ZodObject<{
|
|
333
|
+
/** File the near-miss locus lives in. */
|
|
334
|
+
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
335
|
+
/** Line-range or AST-node path — the near-miss locus, not just the file. */
|
|
336
|
+
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
337
|
+
/** The §4-pluggable silence target — ONE side (the matcher must not fire on it). */
|
|
338
|
+
nearMissSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
339
|
+
kind: z.ZodLiteral<"lesson">;
|
|
340
|
+
/** The synthetic near-miss exemplar the matcher must stay SILENT on (§6). */
|
|
341
|
+
example: z.ZodEffects<z.ZodString, string, string>;
|
|
342
|
+
/**
|
|
343
|
+
* OPTIONAL immutable lesson id — a synthetic near-miss may have no lesson origin,
|
|
344
|
+
* so unlike the positiveFixtures `lessonRef` it is optional; but WHEN present it
|
|
345
|
+
* carries the same §8 discipline (the 16-hex `hashLesson` codomain, never a
|
|
346
|
+
* path/mutable alias), so it can't be a free-form mutable alias.
|
|
347
|
+
*/
|
|
348
|
+
lessonRef: z.ZodOptional<z.ZodString>;
|
|
349
|
+
}, "strict", z.ZodTypeAny, {
|
|
350
|
+
kind: "lesson";
|
|
351
|
+
example: string;
|
|
352
|
+
lessonRef?: string | undefined;
|
|
353
|
+
}, {
|
|
354
|
+
kind: "lesson";
|
|
355
|
+
example: string;
|
|
356
|
+
lessonRef?: string | undefined;
|
|
357
|
+
}>, z.ZodObject<{
|
|
358
|
+
kind: z.ZodLiteral<"commit">;
|
|
359
|
+
/** The commit whose state the matcher must stay SILENT on (§6, land-then-fix fallback). */
|
|
360
|
+
commitSha: z.ZodString;
|
|
361
|
+
}, "strict", z.ZodTypeAny, {
|
|
362
|
+
kind: "commit";
|
|
363
|
+
commitSha: string;
|
|
364
|
+
}, {
|
|
365
|
+
kind: "commit";
|
|
366
|
+
commitSha: string;
|
|
367
|
+
}>]>;
|
|
368
|
+
}, "strict", z.ZodTypeAny, {
|
|
369
|
+
filePath: string;
|
|
370
|
+
matchedSpan: string;
|
|
371
|
+
nearMissSource: {
|
|
372
|
+
kind: "lesson";
|
|
373
|
+
example: string;
|
|
374
|
+
lessonRef?: string | undefined;
|
|
375
|
+
} | {
|
|
376
|
+
kind: "commit";
|
|
377
|
+
commitSha: string;
|
|
378
|
+
};
|
|
379
|
+
}, {
|
|
380
|
+
filePath: string;
|
|
381
|
+
matchedSpan: string;
|
|
382
|
+
nearMissSource: {
|
|
383
|
+
kind: "lesson";
|
|
384
|
+
example: string;
|
|
385
|
+
lessonRef?: string | undefined;
|
|
386
|
+
} | {
|
|
387
|
+
kind: "commit";
|
|
388
|
+
commitSha: string;
|
|
389
|
+
};
|
|
390
|
+
}>;
|
|
391
|
+
export type AuthoredNegativeFixture = z.infer<typeof AuthoredNegativeFixtureSchema>;
|
|
281
392
|
/**
|
|
282
393
|
* ADR-112 §3 — the AUTHORED variant of the `ProvenanceRecord` union. A
|
|
283
394
|
* hand-authored rule is anchored to a real historical DEFECT (the pre-image,
|
|
@@ -405,115 +516,69 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
|
|
|
405
516
|
matchedSpan: string;
|
|
406
517
|
contentHash: string;
|
|
407
518
|
}>, "many">;
|
|
408
|
-
/**
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
519
|
+
/**
|
|
520
|
+
* Declared SILENCE-ONLY near-misses the rule must stay silent on (feeds §6
|
|
521
|
+
* `controls.negative[]`). The silence-only `nearMissSource` shape, NOT the
|
|
522
|
+
* positiveFixtures bad/good pair (strategy#770 — different arity, §6 L142).
|
|
523
|
+
*/
|
|
524
|
+
negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
525
|
+
/** File the near-miss locus lives in. */
|
|
526
|
+
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
527
|
+
/** Line-range or AST-node path — the near-miss locus, not just the file. */
|
|
528
|
+
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
529
|
+
/** The §4-pluggable silence target — ONE side (the matcher must not fire on it). */
|
|
530
|
+
nearMissSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
414
531
|
kind: z.ZodLiteral<"lesson">;
|
|
415
|
-
/**
|
|
416
|
-
|
|
532
|
+
/** The synthetic near-miss exemplar the matcher must stay SILENT on (§6). */
|
|
533
|
+
example: z.ZodEffects<z.ZodString, string, string>;
|
|
417
534
|
/**
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
535
|
+
* OPTIONAL immutable lesson id — a synthetic near-miss may have no lesson origin,
|
|
536
|
+
* so unlike the positiveFixtures `lessonRef` it is optional; but WHEN present it
|
|
537
|
+
* carries the same §8 discipline (the 16-hex `hashLesson` codomain, never a
|
|
538
|
+
* path/mutable alias), so it can't be a free-form mutable alias.
|
|
422
539
|
*/
|
|
423
|
-
|
|
424
|
-
/** The fixed POSTIMAGE exemplar the matcher must stay SILENT on (§4) — a lesson `goodExample`. */
|
|
425
|
-
goodExample: z.ZodEffects<z.ZodString, string, string>;
|
|
540
|
+
lessonRef: z.ZodOptional<z.ZodString>;
|
|
426
541
|
}, "strict", z.ZodTypeAny, {
|
|
427
542
|
kind: "lesson";
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
goodExample: string;
|
|
543
|
+
example: string;
|
|
544
|
+
lessonRef?: string | undefined;
|
|
431
545
|
}, {
|
|
432
546
|
kind: "lesson";
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
goodExample: string;
|
|
547
|
+
example: string;
|
|
548
|
+
lessonRef?: string | undefined;
|
|
436
549
|
}>, z.ZodObject<{
|
|
437
550
|
kind: z.ZodLiteral<"commit">;
|
|
438
|
-
/** The
|
|
439
|
-
|
|
440
|
-
/** The PR's merge/squash commit — the post-fix (defect-absent) anchor; the matcher must stay SILENT on this. */
|
|
441
|
-
mergeCommitSha: z.ZodString;
|
|
551
|
+
/** The commit whose state the matcher must stay SILENT on (§6, land-then-fix fallback). */
|
|
552
|
+
commitSha: z.ZodString;
|
|
442
553
|
}, "strict", z.ZodTypeAny, {
|
|
443
554
|
kind: "commit";
|
|
444
|
-
|
|
445
|
-
mergeCommitSha: string;
|
|
555
|
+
commitSha: string;
|
|
446
556
|
}, {
|
|
447
557
|
kind: "commit";
|
|
448
|
-
|
|
449
|
-
mergeCommitSha: string;
|
|
558
|
+
commitSha: string;
|
|
450
559
|
}>]>;
|
|
451
|
-
/** File the defect locus lives in. */
|
|
452
|
-
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
453
|
-
/** Line-range or AST-node path — the defect locus, not just the file. */
|
|
454
|
-
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
455
|
-
/** Span content hash, line-drift-stable (cf. `firingLabelId`). */
|
|
456
|
-
contentHash: z.ZodEffects<z.ZodString, string, string>;
|
|
457
560
|
}, "strict", z.ZodTypeAny, {
|
|
458
|
-
pr: number;
|
|
459
|
-
preimageSource: {
|
|
460
|
-
kind: "lesson";
|
|
461
|
-
lessonRef: string;
|
|
462
|
-
badExample: string;
|
|
463
|
-
goodExample: string;
|
|
464
|
-
} | {
|
|
465
|
-
kind: "commit";
|
|
466
|
-
preimageCommitSha: string;
|
|
467
|
-
mergeCommitSha: string;
|
|
468
|
-
};
|
|
469
561
|
filePath: string;
|
|
470
562
|
matchedSpan: string;
|
|
471
|
-
|
|
472
|
-
}, {
|
|
473
|
-
pr: number;
|
|
474
|
-
preimageSource: {
|
|
563
|
+
nearMissSource: {
|
|
475
564
|
kind: "lesson";
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
goodExample: string;
|
|
565
|
+
example: string;
|
|
566
|
+
lessonRef?: string | undefined;
|
|
479
567
|
} | {
|
|
480
568
|
kind: "commit";
|
|
481
|
-
|
|
482
|
-
mergeCommitSha: string;
|
|
483
|
-
};
|
|
484
|
-
filePath: string;
|
|
485
|
-
matchedSpan: string;
|
|
486
|
-
contentHash: string;
|
|
487
|
-
}>, {
|
|
488
|
-
pr: number;
|
|
489
|
-
preimageSource: {
|
|
490
|
-
kind: "lesson";
|
|
491
|
-
lessonRef: string;
|
|
492
|
-
badExample: string;
|
|
493
|
-
goodExample: string;
|
|
494
|
-
} | {
|
|
495
|
-
kind: "commit";
|
|
496
|
-
preimageCommitSha: string;
|
|
497
|
-
mergeCommitSha: string;
|
|
569
|
+
commitSha: string;
|
|
498
570
|
};
|
|
571
|
+
}, {
|
|
499
572
|
filePath: string;
|
|
500
573
|
matchedSpan: string;
|
|
501
|
-
|
|
502
|
-
}, {
|
|
503
|
-
pr: number;
|
|
504
|
-
preimageSource: {
|
|
574
|
+
nearMissSource: {
|
|
505
575
|
kind: "lesson";
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
goodExample: string;
|
|
576
|
+
example: string;
|
|
577
|
+
lessonRef?: string | undefined;
|
|
509
578
|
} | {
|
|
510
579
|
kind: "commit";
|
|
511
|
-
|
|
512
|
-
mergeCommitSha: string;
|
|
580
|
+
commitSha: string;
|
|
513
581
|
};
|
|
514
|
-
filePath: string;
|
|
515
|
-
matchedSpan: string;
|
|
516
|
-
contentHash: string;
|
|
517
582
|
}>, "many">>;
|
|
518
583
|
}, "strip", z.ZodTypeAny, {
|
|
519
584
|
kind: "authored";
|
|
@@ -537,20 +602,16 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
|
|
|
537
602
|
contentHash: string;
|
|
538
603
|
}[];
|
|
539
604
|
negativeFixtures?: {
|
|
540
|
-
|
|
541
|
-
|
|
605
|
+
filePath: string;
|
|
606
|
+
matchedSpan: string;
|
|
607
|
+
nearMissSource: {
|
|
542
608
|
kind: "lesson";
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
goodExample: string;
|
|
609
|
+
example: string;
|
|
610
|
+
lessonRef?: string | undefined;
|
|
546
611
|
} | {
|
|
547
612
|
kind: "commit";
|
|
548
|
-
|
|
549
|
-
mergeCommitSha: string;
|
|
613
|
+
commitSha: string;
|
|
550
614
|
};
|
|
551
|
-
filePath: string;
|
|
552
|
-
matchedSpan: string;
|
|
553
|
-
contentHash: string;
|
|
554
615
|
}[] | undefined;
|
|
555
616
|
}, {
|
|
556
617
|
kind: "authored";
|
|
@@ -574,20 +635,16 @@ export declare const AuthoredProvenanceRecordSchema: z.ZodObject<{
|
|
|
574
635
|
contentHash: string;
|
|
575
636
|
}[];
|
|
576
637
|
negativeFixtures?: {
|
|
577
|
-
|
|
578
|
-
|
|
638
|
+
filePath: string;
|
|
639
|
+
matchedSpan: string;
|
|
640
|
+
nearMissSource: {
|
|
579
641
|
kind: "lesson";
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
goodExample: string;
|
|
642
|
+
example: string;
|
|
643
|
+
lessonRef?: string | undefined;
|
|
583
644
|
} | {
|
|
584
645
|
kind: "commit";
|
|
585
|
-
|
|
586
|
-
mergeCommitSha: string;
|
|
646
|
+
commitSha: string;
|
|
587
647
|
};
|
|
588
|
-
filePath: string;
|
|
589
|
-
matchedSpan: string;
|
|
590
|
-
contentHash: string;
|
|
591
648
|
}[] | undefined;
|
|
592
649
|
}>;
|
|
593
650
|
export type AuthoredProvenanceRecord = z.infer<typeof AuthoredProvenanceRecordSchema>;
|
|
@@ -721,115 +778,69 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
721
778
|
matchedSpan: string;
|
|
722
779
|
contentHash: string;
|
|
723
780
|
}>, "many">;
|
|
724
|
-
/**
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
781
|
+
/**
|
|
782
|
+
* Declared SILENCE-ONLY near-misses the rule must stay silent on (feeds §6
|
|
783
|
+
* `controls.negative[]`). The silence-only `nearMissSource` shape, NOT the
|
|
784
|
+
* positiveFixtures bad/good pair (strategy#770 — different arity, §6 L142).
|
|
785
|
+
*/
|
|
786
|
+
negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
787
|
+
/** File the near-miss locus lives in. */
|
|
788
|
+
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
789
|
+
/** Line-range or AST-node path — the near-miss locus, not just the file. */
|
|
790
|
+
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
791
|
+
/** The §4-pluggable silence target — ONE side (the matcher must not fire on it). */
|
|
792
|
+
nearMissSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
730
793
|
kind: z.ZodLiteral<"lesson">;
|
|
731
|
-
/**
|
|
732
|
-
|
|
794
|
+
/** The synthetic near-miss exemplar the matcher must stay SILENT on (§6). */
|
|
795
|
+
example: z.ZodEffects<z.ZodString, string, string>;
|
|
733
796
|
/**
|
|
734
|
-
*
|
|
735
|
-
*
|
|
736
|
-
*
|
|
737
|
-
*
|
|
797
|
+
* OPTIONAL immutable lesson id — a synthetic near-miss may have no lesson origin,
|
|
798
|
+
* so unlike the positiveFixtures `lessonRef` it is optional; but WHEN present it
|
|
799
|
+
* carries the same §8 discipline (the 16-hex `hashLesson` codomain, never a
|
|
800
|
+
* path/mutable alias), so it can't be a free-form mutable alias.
|
|
738
801
|
*/
|
|
739
|
-
|
|
740
|
-
/** The fixed POSTIMAGE exemplar the matcher must stay SILENT on (§4) — a lesson `goodExample`. */
|
|
741
|
-
goodExample: z.ZodEffects<z.ZodString, string, string>;
|
|
802
|
+
lessonRef: z.ZodOptional<z.ZodString>;
|
|
742
803
|
}, "strict", z.ZodTypeAny, {
|
|
743
804
|
kind: "lesson";
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
goodExample: string;
|
|
805
|
+
example: string;
|
|
806
|
+
lessonRef?: string | undefined;
|
|
747
807
|
}, {
|
|
748
808
|
kind: "lesson";
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
goodExample: string;
|
|
809
|
+
example: string;
|
|
810
|
+
lessonRef?: string | undefined;
|
|
752
811
|
}>, z.ZodObject<{
|
|
753
812
|
kind: z.ZodLiteral<"commit">;
|
|
754
|
-
/** The
|
|
755
|
-
|
|
756
|
-
/** The PR's merge/squash commit — the post-fix (defect-absent) anchor; the matcher must stay SILENT on this. */
|
|
757
|
-
mergeCommitSha: z.ZodString;
|
|
813
|
+
/** The commit whose state the matcher must stay SILENT on (§6, land-then-fix fallback). */
|
|
814
|
+
commitSha: z.ZodString;
|
|
758
815
|
}, "strict", z.ZodTypeAny, {
|
|
759
816
|
kind: "commit";
|
|
760
|
-
|
|
761
|
-
mergeCommitSha: string;
|
|
817
|
+
commitSha: string;
|
|
762
818
|
}, {
|
|
763
819
|
kind: "commit";
|
|
764
|
-
|
|
765
|
-
mergeCommitSha: string;
|
|
820
|
+
commitSha: string;
|
|
766
821
|
}>]>;
|
|
767
|
-
/** File the defect locus lives in. */
|
|
768
|
-
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
769
|
-
/** Line-range or AST-node path — the defect locus, not just the file. */
|
|
770
|
-
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
771
|
-
/** Span content hash, line-drift-stable (cf. `firingLabelId`). */
|
|
772
|
-
contentHash: z.ZodEffects<z.ZodString, string, string>;
|
|
773
822
|
}, "strict", z.ZodTypeAny, {
|
|
774
|
-
pr: number;
|
|
775
|
-
preimageSource: {
|
|
776
|
-
kind: "lesson";
|
|
777
|
-
lessonRef: string;
|
|
778
|
-
badExample: string;
|
|
779
|
-
goodExample: string;
|
|
780
|
-
} | {
|
|
781
|
-
kind: "commit";
|
|
782
|
-
preimageCommitSha: string;
|
|
783
|
-
mergeCommitSha: string;
|
|
784
|
-
};
|
|
785
823
|
filePath: string;
|
|
786
824
|
matchedSpan: string;
|
|
787
|
-
|
|
788
|
-
}, {
|
|
789
|
-
pr: number;
|
|
790
|
-
preimageSource: {
|
|
791
|
-
kind: "lesson";
|
|
792
|
-
lessonRef: string;
|
|
793
|
-
badExample: string;
|
|
794
|
-
goodExample: string;
|
|
795
|
-
} | {
|
|
796
|
-
kind: "commit";
|
|
797
|
-
preimageCommitSha: string;
|
|
798
|
-
mergeCommitSha: string;
|
|
799
|
-
};
|
|
800
|
-
filePath: string;
|
|
801
|
-
matchedSpan: string;
|
|
802
|
-
contentHash: string;
|
|
803
|
-
}>, {
|
|
804
|
-
pr: number;
|
|
805
|
-
preimageSource: {
|
|
825
|
+
nearMissSource: {
|
|
806
826
|
kind: "lesson";
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
goodExample: string;
|
|
827
|
+
example: string;
|
|
828
|
+
lessonRef?: string | undefined;
|
|
810
829
|
} | {
|
|
811
830
|
kind: "commit";
|
|
812
|
-
|
|
813
|
-
mergeCommitSha: string;
|
|
831
|
+
commitSha: string;
|
|
814
832
|
};
|
|
833
|
+
}, {
|
|
815
834
|
filePath: string;
|
|
816
835
|
matchedSpan: string;
|
|
817
|
-
|
|
818
|
-
}, {
|
|
819
|
-
pr: number;
|
|
820
|
-
preimageSource: {
|
|
836
|
+
nearMissSource: {
|
|
821
837
|
kind: "lesson";
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
goodExample: string;
|
|
838
|
+
example: string;
|
|
839
|
+
lessonRef?: string | undefined;
|
|
825
840
|
} | {
|
|
826
841
|
kind: "commit";
|
|
827
|
-
|
|
828
|
-
mergeCommitSha: string;
|
|
842
|
+
commitSha: string;
|
|
829
843
|
};
|
|
830
|
-
filePath: string;
|
|
831
|
-
matchedSpan: string;
|
|
832
|
-
contentHash: string;
|
|
833
844
|
}>, "many">>;
|
|
834
845
|
}, "strip", z.ZodTypeAny, {
|
|
835
846
|
kind: "authored";
|
|
@@ -853,20 +864,16 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
853
864
|
contentHash: string;
|
|
854
865
|
}[];
|
|
855
866
|
negativeFixtures?: {
|
|
856
|
-
|
|
857
|
-
|
|
867
|
+
filePath: string;
|
|
868
|
+
matchedSpan: string;
|
|
869
|
+
nearMissSource: {
|
|
858
870
|
kind: "lesson";
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
goodExample: string;
|
|
871
|
+
example: string;
|
|
872
|
+
lessonRef?: string | undefined;
|
|
862
873
|
} | {
|
|
863
874
|
kind: "commit";
|
|
864
|
-
|
|
865
|
-
mergeCommitSha: string;
|
|
875
|
+
commitSha: string;
|
|
866
876
|
};
|
|
867
|
-
filePath: string;
|
|
868
|
-
matchedSpan: string;
|
|
869
|
-
contentHash: string;
|
|
870
877
|
}[] | undefined;
|
|
871
878
|
}, {
|
|
872
879
|
kind: "authored";
|
|
@@ -890,20 +897,16 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
890
897
|
contentHash: string;
|
|
891
898
|
}[];
|
|
892
899
|
negativeFixtures?: {
|
|
893
|
-
|
|
894
|
-
|
|
900
|
+
filePath: string;
|
|
901
|
+
matchedSpan: string;
|
|
902
|
+
nearMissSource: {
|
|
895
903
|
kind: "lesson";
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
goodExample: string;
|
|
904
|
+
example: string;
|
|
905
|
+
lessonRef?: string | undefined;
|
|
899
906
|
} | {
|
|
900
907
|
kind: "commit";
|
|
901
|
-
|
|
902
|
-
mergeCommitSha: string;
|
|
908
|
+
commitSha: string;
|
|
903
909
|
};
|
|
904
|
-
filePath: string;
|
|
905
|
-
matchedSpan: string;
|
|
906
|
-
contentHash: string;
|
|
907
910
|
}[] | undefined;
|
|
908
911
|
}>, z.ZodObject<{
|
|
909
912
|
/**
|
|
@@ -939,146 +942,36 @@ export declare const ProvenanceRecordSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
939
942
|
}>]>;
|
|
940
943
|
export type ProvenanceRecord = z.infer<typeof ProvenanceRecordSchema>;
|
|
941
944
|
/**
|
|
942
|
-
* ADR-112 — the canonical reader of a provenance record's producer kind. An
|
|
943
|
-
* absent discriminator (every legacy mined record) reads as `'mined'`. Use this
|
|
944
|
-
* + the guards below instead of touching `.kind` directly, so the
|
|
945
|
-
* absent-⇒-mined default lives in exactly one place (Tenet 20).
|
|
946
|
-
*/
|
|
947
|
-
export declare function provenanceKind(p: ProvenanceRecord): 'mined' | 'authored';
|
|
948
|
-
/** ADR-112 — type-narrowing guard for the mined branch (mined-only field reads). */
|
|
949
|
-
export declare function isMinedProvenance(p: ProvenanceRecord): p is MinedProvenanceRecord;
|
|
950
|
-
/** ADR-112 — type-narrowing guard for the authored branch. */
|
|
951
|
-
export declare function isAuthoredProvenance(p: ProvenanceRecord): p is AuthoredProvenanceRecord;
|
|
952
|
-
/**
|
|
953
|
-
* mmnto-ai/totem#2183 — the three **peer** legs of the ADR-110 §3 legitimacy
|
|
954
|
-
* bar, mapping 1:1 onto the strategy#666 Tenet-9 three-check so the Gate-1
|
|
955
|
-
* wind-tunnel reads per-rule eligibility off the marker with no translation
|
|
956
|
-
* layer: `provenance` (§3.1) / `positiveControl` (§3.2) / `negativeControl`
|
|
957
|
-
* (§3.3). Controls are pass/fail booleans, **required** when `legitimacy` is
|
|
958
|
-
* present (never defaulted, so an absent control can't silently read as a
|
|
959
|
-
* failed one); the evidence behind each pass lives in the wind-tunnel manifest.
|
|
960
|
-
*/
|
|
961
|
-
export declare const LegitimacySchema: z.ZodObject<{
|
|
962
|
-
provenance: z.ZodUnion<[z.ZodObject<{
|
|
963
|
-
kind: z.ZodLiteral<"authored">;
|
|
964
|
-
/** Agent-id or operator handle — attributable, never anonymous. */
|
|
965
|
-
author: z.ZodEffects<z.ZodString, string, string>;
|
|
966
|
-
/** ISO-8601 authoring date — a real calendar date (`YYYY-MM-DD`) or a full timestamp. */
|
|
967
|
-
authoredAt: z.ZodEffects<z.ZodString, string, string>;
|
|
968
|
-
/** The declared DEFECT the rule targets — the pre-image, not its fix. */
|
|
969
|
-
targetDefect: z.ZodEffects<z.ZodString, string, string>;
|
|
970
|
-
/** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
|
|
971
|
-
positiveFixtures: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
972
|
-
/** The PR where the defect was caught/introduced (the in-corpus anchor). */
|
|
973
|
-
pr: z.ZodNumber;
|
|
974
|
-
/** The §4 preimage-differential source — lesson-anchored (PRIMARY) or commit-pair (FALLBACK). */
|
|
975
|
-
preimageSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
976
|
-
kind: z.ZodLiteral<"lesson">;
|
|
977
|
-
/** IMMUTABLE lesson id/hash (the 16-hex `hashLesson` codomain) — never a path/mutable alias (§4/§8). */
|
|
978
|
-
lessonRef: z.ZodString;
|
|
979
|
-
/**
|
|
980
|
-
* The defect PREIMAGE exemplar the matcher must FIRE on (§4). This is a lesson
|
|
981
|
-
* corpus `badExample` — distinct from `CompiledRuleBaseSchema.badExample` (an
|
|
982
|
-
* optional human-readable code snippet on a compiled rule); here it is the
|
|
983
|
-
* load-bearing positive-control preimage, so non-empty is required.
|
|
984
|
-
*/
|
|
985
|
-
badExample: z.ZodEffects<z.ZodString, string, string>;
|
|
986
|
-
/** The fixed POSTIMAGE exemplar the matcher must stay SILENT on (§4) — a lesson `goodExample`. */
|
|
987
|
-
goodExample: z.ZodEffects<z.ZodString, string, string>;
|
|
988
|
-
}, "strict", z.ZodTypeAny, {
|
|
989
|
-
kind: "lesson";
|
|
990
|
-
lessonRef: string;
|
|
991
|
-
badExample: string;
|
|
992
|
-
goodExample: string;
|
|
993
|
-
}, {
|
|
994
|
-
kind: "lesson";
|
|
995
|
-
lessonRef: string;
|
|
996
|
-
badExample: string;
|
|
997
|
-
goodExample: string;
|
|
998
|
-
}>, z.ZodObject<{
|
|
999
|
-
kind: z.ZodLiteral<"commit">;
|
|
1000
|
-
/** The PARENT (pre-fix) commit where the DEFECT is present — the matcher must FIRE on this (ADR-112 §4). */
|
|
1001
|
-
preimageCommitSha: z.ZodString;
|
|
1002
|
-
/** The PR's merge/squash commit — the post-fix (defect-absent) anchor; the matcher must stay SILENT on this. */
|
|
1003
|
-
mergeCommitSha: z.ZodString;
|
|
1004
|
-
}, "strict", z.ZodTypeAny, {
|
|
1005
|
-
kind: "commit";
|
|
1006
|
-
preimageCommitSha: string;
|
|
1007
|
-
mergeCommitSha: string;
|
|
1008
|
-
}, {
|
|
1009
|
-
kind: "commit";
|
|
1010
|
-
preimageCommitSha: string;
|
|
1011
|
-
mergeCommitSha: string;
|
|
1012
|
-
}>]>;
|
|
1013
|
-
/** File the defect locus lives in. */
|
|
1014
|
-
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
1015
|
-
/** Line-range or AST-node path — the defect locus, not just the file. */
|
|
1016
|
-
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
1017
|
-
/** Span content hash, line-drift-stable (cf. `firingLabelId`). */
|
|
1018
|
-
contentHash: z.ZodEffects<z.ZodString, string, string>;
|
|
1019
|
-
}, "strict", z.ZodTypeAny, {
|
|
1020
|
-
pr: number;
|
|
1021
|
-
preimageSource: {
|
|
1022
|
-
kind: "lesson";
|
|
1023
|
-
lessonRef: string;
|
|
1024
|
-
badExample: string;
|
|
1025
|
-
goodExample: string;
|
|
1026
|
-
} | {
|
|
1027
|
-
kind: "commit";
|
|
1028
|
-
preimageCommitSha: string;
|
|
1029
|
-
mergeCommitSha: string;
|
|
1030
|
-
};
|
|
1031
|
-
filePath: string;
|
|
1032
|
-
matchedSpan: string;
|
|
1033
|
-
contentHash: string;
|
|
1034
|
-
}, {
|
|
1035
|
-
pr: number;
|
|
1036
|
-
preimageSource: {
|
|
1037
|
-
kind: "lesson";
|
|
1038
|
-
lessonRef: string;
|
|
1039
|
-
badExample: string;
|
|
1040
|
-
goodExample: string;
|
|
1041
|
-
} | {
|
|
1042
|
-
kind: "commit";
|
|
1043
|
-
preimageCommitSha: string;
|
|
1044
|
-
mergeCommitSha: string;
|
|
1045
|
-
};
|
|
1046
|
-
filePath: string;
|
|
1047
|
-
matchedSpan: string;
|
|
1048
|
-
contentHash: string;
|
|
1049
|
-
}>, {
|
|
1050
|
-
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
|
-
filePath: string;
|
|
1062
|
-
matchedSpan: string;
|
|
1063
|
-
contentHash: string;
|
|
1064
|
-
}, {
|
|
1065
|
-
pr: number;
|
|
1066
|
-
preimageSource: {
|
|
1067
|
-
kind: "lesson";
|
|
1068
|
-
lessonRef: string;
|
|
1069
|
-
badExample: string;
|
|
1070
|
-
goodExample: string;
|
|
1071
|
-
} | {
|
|
1072
|
-
kind: "commit";
|
|
1073
|
-
preimageCommitSha: string;
|
|
1074
|
-
mergeCommitSha: string;
|
|
1075
|
-
};
|
|
1076
|
-
filePath: string;
|
|
1077
|
-
matchedSpan: string;
|
|
1078
|
-
contentHash: string;
|
|
1079
|
-
}>, "many">;
|
|
1080
|
-
/** Declared near-misses the rule must stay silent on (feeds §6 negative controls). */
|
|
1081
|
-
negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
945
|
+
* ADR-112 — the canonical reader of a provenance record's producer kind. An
|
|
946
|
+
* absent discriminator (every legacy mined record) reads as `'mined'`. Use this
|
|
947
|
+
* + the guards below instead of touching `.kind` directly, so the
|
|
948
|
+
* absent-⇒-mined default lives in exactly one place (Tenet 20).
|
|
949
|
+
*/
|
|
950
|
+
export declare function provenanceKind(p: ProvenanceRecord): 'mined' | 'authored';
|
|
951
|
+
/** ADR-112 — type-narrowing guard for the mined branch (mined-only field reads). */
|
|
952
|
+
export declare function isMinedProvenance(p: ProvenanceRecord): p is MinedProvenanceRecord;
|
|
953
|
+
/** ADR-112 — type-narrowing guard for the authored branch. */
|
|
954
|
+
export declare function isAuthoredProvenance(p: ProvenanceRecord): p is AuthoredProvenanceRecord;
|
|
955
|
+
/**
|
|
956
|
+
* mmnto-ai/totem#2183 — the three **peer** legs of the ADR-110 §3 legitimacy
|
|
957
|
+
* bar, mapping 1:1 onto the strategy#666 Tenet-9 three-check so the Gate-1
|
|
958
|
+
* wind-tunnel reads per-rule eligibility off the marker with no translation
|
|
959
|
+
* layer: `provenance` (§3.1) / `positiveControl` (§3.2) / `negativeControl`
|
|
960
|
+
* (§3.3). Controls are pass/fail booleans, **required** when `legitimacy` is
|
|
961
|
+
* present (never defaulted, so an absent control can't silently read as a
|
|
962
|
+
* failed one); the evidence behind each pass lives in the wind-tunnel manifest.
|
|
963
|
+
*/
|
|
964
|
+
export declare const LegitimacySchema: z.ZodObject<{
|
|
965
|
+
provenance: z.ZodUnion<[z.ZodObject<{
|
|
966
|
+
kind: z.ZodLiteral<"authored">;
|
|
967
|
+
/** Agent-id or operator handle — attributable, never anonymous. */
|
|
968
|
+
author: z.ZodEffects<z.ZodString, string, string>;
|
|
969
|
+
/** ISO-8601 authoring date — a real calendar date (`YYYY-MM-DD`) or a full timestamp. */
|
|
970
|
+
authoredAt: z.ZodEffects<z.ZodString, string, string>;
|
|
971
|
+
/** The declared DEFECT the rule targets — the pre-image, not its fix. */
|
|
972
|
+
targetDefect: z.ZodEffects<z.ZodString, string, string>;
|
|
973
|
+
/** ≥1 real lc instance the rule claims to catch — ALL train-side (§5). */
|
|
974
|
+
positiveFixtures: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
1082
975
|
/** The PR where the defect was caught/introduced (the in-corpus anchor). */
|
|
1083
976
|
pr: z.ZodNumber;
|
|
1084
977
|
/** The §4 preimage-differential source — lesson-anchored (PRIMARY) or commit-pair (FALLBACK). */
|
|
@@ -1186,6 +1079,70 @@ export declare const LegitimacySchema: z.ZodObject<{
|
|
|
1186
1079
|
filePath: string;
|
|
1187
1080
|
matchedSpan: string;
|
|
1188
1081
|
contentHash: string;
|
|
1082
|
+
}>, "many">;
|
|
1083
|
+
/**
|
|
1084
|
+
* Declared SILENCE-ONLY near-misses the rule must stay silent on (feeds §6
|
|
1085
|
+
* `controls.negative[]`). The silence-only `nearMissSource` shape, NOT the
|
|
1086
|
+
* positiveFixtures bad/good pair (strategy#770 — different arity, §6 L142).
|
|
1087
|
+
*/
|
|
1088
|
+
negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1089
|
+
/** File the near-miss locus lives in. */
|
|
1090
|
+
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
1091
|
+
/** Line-range or AST-node path — the near-miss locus, not just the file. */
|
|
1092
|
+
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
1093
|
+
/** The §4-pluggable silence target — ONE side (the matcher must not fire on it). */
|
|
1094
|
+
nearMissSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
1095
|
+
kind: z.ZodLiteral<"lesson">;
|
|
1096
|
+
/** The synthetic near-miss exemplar the matcher must stay SILENT on (§6). */
|
|
1097
|
+
example: z.ZodEffects<z.ZodString, string, string>;
|
|
1098
|
+
/**
|
|
1099
|
+
* OPTIONAL immutable lesson id — a synthetic near-miss may have no lesson origin,
|
|
1100
|
+
* so unlike the positiveFixtures `lessonRef` it is optional; but WHEN present it
|
|
1101
|
+
* carries the same §8 discipline (the 16-hex `hashLesson` codomain, never a
|
|
1102
|
+
* path/mutable alias), so it can't be a free-form mutable alias.
|
|
1103
|
+
*/
|
|
1104
|
+
lessonRef: z.ZodOptional<z.ZodString>;
|
|
1105
|
+
}, "strict", z.ZodTypeAny, {
|
|
1106
|
+
kind: "lesson";
|
|
1107
|
+
example: string;
|
|
1108
|
+
lessonRef?: string | undefined;
|
|
1109
|
+
}, {
|
|
1110
|
+
kind: "lesson";
|
|
1111
|
+
example: string;
|
|
1112
|
+
lessonRef?: string | undefined;
|
|
1113
|
+
}>, z.ZodObject<{
|
|
1114
|
+
kind: z.ZodLiteral<"commit">;
|
|
1115
|
+
/** The commit whose state the matcher must stay SILENT on (§6, land-then-fix fallback). */
|
|
1116
|
+
commitSha: z.ZodString;
|
|
1117
|
+
}, "strict", z.ZodTypeAny, {
|
|
1118
|
+
kind: "commit";
|
|
1119
|
+
commitSha: string;
|
|
1120
|
+
}, {
|
|
1121
|
+
kind: "commit";
|
|
1122
|
+
commitSha: string;
|
|
1123
|
+
}>]>;
|
|
1124
|
+
}, "strict", z.ZodTypeAny, {
|
|
1125
|
+
filePath: string;
|
|
1126
|
+
matchedSpan: string;
|
|
1127
|
+
nearMissSource: {
|
|
1128
|
+
kind: "lesson";
|
|
1129
|
+
example: string;
|
|
1130
|
+
lessonRef?: string | undefined;
|
|
1131
|
+
} | {
|
|
1132
|
+
kind: "commit";
|
|
1133
|
+
commitSha: string;
|
|
1134
|
+
};
|
|
1135
|
+
}, {
|
|
1136
|
+
filePath: string;
|
|
1137
|
+
matchedSpan: string;
|
|
1138
|
+
nearMissSource: {
|
|
1139
|
+
kind: "lesson";
|
|
1140
|
+
example: string;
|
|
1141
|
+
lessonRef?: string | undefined;
|
|
1142
|
+
} | {
|
|
1143
|
+
kind: "commit";
|
|
1144
|
+
commitSha: string;
|
|
1145
|
+
};
|
|
1189
1146
|
}>, "many">>;
|
|
1190
1147
|
}, "strip", z.ZodTypeAny, {
|
|
1191
1148
|
kind: "authored";
|
|
@@ -1209,20 +1166,16 @@ export declare const LegitimacySchema: z.ZodObject<{
|
|
|
1209
1166
|
contentHash: string;
|
|
1210
1167
|
}[];
|
|
1211
1168
|
negativeFixtures?: {
|
|
1212
|
-
|
|
1213
|
-
|
|
1169
|
+
filePath: string;
|
|
1170
|
+
matchedSpan: string;
|
|
1171
|
+
nearMissSource: {
|
|
1214
1172
|
kind: "lesson";
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
goodExample: string;
|
|
1173
|
+
example: string;
|
|
1174
|
+
lessonRef?: string | undefined;
|
|
1218
1175
|
} | {
|
|
1219
1176
|
kind: "commit";
|
|
1220
|
-
|
|
1221
|
-
mergeCommitSha: string;
|
|
1177
|
+
commitSha: string;
|
|
1222
1178
|
};
|
|
1223
|
-
filePath: string;
|
|
1224
|
-
matchedSpan: string;
|
|
1225
|
-
contentHash: string;
|
|
1226
1179
|
}[] | undefined;
|
|
1227
1180
|
}, {
|
|
1228
1181
|
kind: "authored";
|
|
@@ -1246,20 +1199,16 @@ export declare const LegitimacySchema: z.ZodObject<{
|
|
|
1246
1199
|
contentHash: string;
|
|
1247
1200
|
}[];
|
|
1248
1201
|
negativeFixtures?: {
|
|
1249
|
-
|
|
1250
|
-
|
|
1202
|
+
filePath: string;
|
|
1203
|
+
matchedSpan: string;
|
|
1204
|
+
nearMissSource: {
|
|
1251
1205
|
kind: "lesson";
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
goodExample: string;
|
|
1206
|
+
example: string;
|
|
1207
|
+
lessonRef?: string | undefined;
|
|
1255
1208
|
} | {
|
|
1256
1209
|
kind: "commit";
|
|
1257
|
-
|
|
1258
|
-
mergeCommitSha: string;
|
|
1210
|
+
commitSha: string;
|
|
1259
1211
|
};
|
|
1260
|
-
filePath: string;
|
|
1261
|
-
matchedSpan: string;
|
|
1262
|
-
contentHash: string;
|
|
1263
1212
|
}[] | undefined;
|
|
1264
1213
|
}>, z.ZodObject<{
|
|
1265
1214
|
/**
|
|
@@ -1323,20 +1272,16 @@ export declare const LegitimacySchema: z.ZodObject<{
|
|
|
1323
1272
|
contentHash: string;
|
|
1324
1273
|
}[];
|
|
1325
1274
|
negativeFixtures?: {
|
|
1326
|
-
|
|
1327
|
-
|
|
1275
|
+
filePath: string;
|
|
1276
|
+
matchedSpan: string;
|
|
1277
|
+
nearMissSource: {
|
|
1328
1278
|
kind: "lesson";
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
goodExample: string;
|
|
1279
|
+
example: string;
|
|
1280
|
+
lessonRef?: string | undefined;
|
|
1332
1281
|
} | {
|
|
1333
1282
|
kind: "commit";
|
|
1334
|
-
|
|
1335
|
-
mergeCommitSha: string;
|
|
1283
|
+
commitSha: string;
|
|
1336
1284
|
};
|
|
1337
|
-
filePath: string;
|
|
1338
|
-
matchedSpan: string;
|
|
1339
|
-
contentHash: string;
|
|
1340
1285
|
}[] | undefined;
|
|
1341
1286
|
};
|
|
1342
1287
|
positiveControl: boolean;
|
|
@@ -1369,20 +1314,16 @@ export declare const LegitimacySchema: z.ZodObject<{
|
|
|
1369
1314
|
contentHash: string;
|
|
1370
1315
|
}[];
|
|
1371
1316
|
negativeFixtures?: {
|
|
1372
|
-
|
|
1373
|
-
|
|
1317
|
+
filePath: string;
|
|
1318
|
+
matchedSpan: string;
|
|
1319
|
+
nearMissSource: {
|
|
1374
1320
|
kind: "lesson";
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
goodExample: string;
|
|
1321
|
+
example: string;
|
|
1322
|
+
lessonRef?: string | undefined;
|
|
1378
1323
|
} | {
|
|
1379
1324
|
kind: "commit";
|
|
1380
|
-
|
|
1381
|
-
mergeCommitSha: string;
|
|
1325
|
+
commitSha: string;
|
|
1382
1326
|
};
|
|
1383
|
-
filePath: string;
|
|
1384
|
-
matchedSpan: string;
|
|
1385
|
-
contentHash: string;
|
|
1386
1327
|
}[] | undefined;
|
|
1387
1328
|
};
|
|
1388
1329
|
positiveControl: boolean;
|
|
@@ -1408,7 +1349,18 @@ export declare function deriveRuleClass(rule: {
|
|
|
1408
1349
|
unverified?: boolean;
|
|
1409
1350
|
}): 'hard' | 'advisory';
|
|
1410
1351
|
export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
1411
|
-
/**
|
|
1352
|
+
/**
|
|
1353
|
+
* The rule's stable identity + wind-tunnel firing key.
|
|
1354
|
+
* - MINED / lesson-compiled rules: SHA-256 (first 16 hex chars) of heading + body —
|
|
1355
|
+
* content-derived, detects edits.
|
|
1356
|
+
* - AUTHORED rules (ADR-112 §8/§9): carries the PERSISTED, minted `ruleId` (set at
|
|
1357
|
+
* the compile seam from `CompileInputCandidate.ruleId`), NOT a content hash — the
|
|
1358
|
+
* `firingLabelId ← ruleId` id-unification, so a matcher (`dslSource`) edit never
|
|
1359
|
+
* orphans the rule's ground-truth labels / `controls.positive[].targetRuleId`. For
|
|
1360
|
+
* authored rules this is identity, NOT an edit-detector; it may carry a `-N`
|
|
1361
|
+
* collision suffix. (Authored rules are Gate-1 advisory and live only in the cert
|
|
1362
|
+
* corpus, never the product enforcement path that reads this as a content hash.)
|
|
1363
|
+
*/
|
|
1412
1364
|
lessonHash: z.ZodString;
|
|
1413
1365
|
/** Human-readable heading from the lesson (for diagnostics) */
|
|
1414
1366
|
lessonHeading: z.ZodString;
|
|
@@ -1693,115 +1645,69 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1693
1645
|
matchedSpan: string;
|
|
1694
1646
|
contentHash: string;
|
|
1695
1647
|
}>, "many">;
|
|
1696
|
-
/**
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1648
|
+
/**
|
|
1649
|
+
* Declared SILENCE-ONLY near-misses the rule must stay silent on (feeds §6
|
|
1650
|
+
* `controls.negative[]`). The silence-only `nearMissSource` shape, NOT the
|
|
1651
|
+
* positiveFixtures bad/good pair (strategy#770 — different arity, §6 L142).
|
|
1652
|
+
*/
|
|
1653
|
+
negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1654
|
+
/** File the near-miss locus lives in. */
|
|
1655
|
+
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
1656
|
+
/** Line-range or AST-node path — the near-miss locus, not just the file. */
|
|
1657
|
+
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
1658
|
+
/** The §4-pluggable silence target — ONE side (the matcher must not fire on it). */
|
|
1659
|
+
nearMissSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
1702
1660
|
kind: z.ZodLiteral<"lesson">;
|
|
1703
|
-
/**
|
|
1704
|
-
|
|
1661
|
+
/** The synthetic near-miss exemplar the matcher must stay SILENT on (§6). */
|
|
1662
|
+
example: z.ZodEffects<z.ZodString, string, string>;
|
|
1705
1663
|
/**
|
|
1706
|
-
*
|
|
1707
|
-
*
|
|
1708
|
-
*
|
|
1709
|
-
*
|
|
1664
|
+
* OPTIONAL immutable lesson id — a synthetic near-miss may have no lesson origin,
|
|
1665
|
+
* so unlike the positiveFixtures `lessonRef` it is optional; but WHEN present it
|
|
1666
|
+
* carries the same §8 discipline (the 16-hex `hashLesson` codomain, never a
|
|
1667
|
+
* path/mutable alias), so it can't be a free-form mutable alias.
|
|
1710
1668
|
*/
|
|
1711
|
-
|
|
1712
|
-
/** The fixed POSTIMAGE exemplar the matcher must stay SILENT on (§4) — a lesson `goodExample`. */
|
|
1713
|
-
goodExample: z.ZodEffects<z.ZodString, string, string>;
|
|
1669
|
+
lessonRef: z.ZodOptional<z.ZodString>;
|
|
1714
1670
|
}, "strict", z.ZodTypeAny, {
|
|
1715
1671
|
kind: "lesson";
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
goodExample: string;
|
|
1672
|
+
example: string;
|
|
1673
|
+
lessonRef?: string | undefined;
|
|
1719
1674
|
}, {
|
|
1720
1675
|
kind: "lesson";
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
goodExample: string;
|
|
1676
|
+
example: string;
|
|
1677
|
+
lessonRef?: string | undefined;
|
|
1724
1678
|
}>, z.ZodObject<{
|
|
1725
1679
|
kind: z.ZodLiteral<"commit">;
|
|
1726
|
-
/** The
|
|
1727
|
-
|
|
1728
|
-
/** The PR's merge/squash commit — the post-fix (defect-absent) anchor; the matcher must stay SILENT on this. */
|
|
1729
|
-
mergeCommitSha: z.ZodString;
|
|
1680
|
+
/** The commit whose state the matcher must stay SILENT on (§6, land-then-fix fallback). */
|
|
1681
|
+
commitSha: z.ZodString;
|
|
1730
1682
|
}, "strict", z.ZodTypeAny, {
|
|
1731
1683
|
kind: "commit";
|
|
1732
|
-
|
|
1733
|
-
mergeCommitSha: string;
|
|
1684
|
+
commitSha: string;
|
|
1734
1685
|
}, {
|
|
1735
1686
|
kind: "commit";
|
|
1736
|
-
|
|
1737
|
-
mergeCommitSha: string;
|
|
1687
|
+
commitSha: string;
|
|
1738
1688
|
}>]>;
|
|
1739
|
-
/** File the defect locus lives in. */
|
|
1740
|
-
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
1741
|
-
/** Line-range or AST-node path — the defect locus, not just the file. */
|
|
1742
|
-
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
1743
|
-
/** Span content hash, line-drift-stable (cf. `firingLabelId`). */
|
|
1744
|
-
contentHash: z.ZodEffects<z.ZodString, string, string>;
|
|
1745
1689
|
}, "strict", z.ZodTypeAny, {
|
|
1746
|
-
pr: number;
|
|
1747
|
-
preimageSource: {
|
|
1748
|
-
kind: "lesson";
|
|
1749
|
-
lessonRef: string;
|
|
1750
|
-
badExample: string;
|
|
1751
|
-
goodExample: string;
|
|
1752
|
-
} | {
|
|
1753
|
-
kind: "commit";
|
|
1754
|
-
preimageCommitSha: string;
|
|
1755
|
-
mergeCommitSha: string;
|
|
1756
|
-
};
|
|
1757
|
-
filePath: string;
|
|
1758
|
-
matchedSpan: string;
|
|
1759
|
-
contentHash: string;
|
|
1760
|
-
}, {
|
|
1761
|
-
pr: number;
|
|
1762
|
-
preimageSource: {
|
|
1763
|
-
kind: "lesson";
|
|
1764
|
-
lessonRef: string;
|
|
1765
|
-
badExample: string;
|
|
1766
|
-
goodExample: string;
|
|
1767
|
-
} | {
|
|
1768
|
-
kind: "commit";
|
|
1769
|
-
preimageCommitSha: string;
|
|
1770
|
-
mergeCommitSha: string;
|
|
1771
|
-
};
|
|
1772
1690
|
filePath: string;
|
|
1773
1691
|
matchedSpan: string;
|
|
1774
|
-
|
|
1775
|
-
}>, {
|
|
1776
|
-
pr: number;
|
|
1777
|
-
preimageSource: {
|
|
1692
|
+
nearMissSource: {
|
|
1778
1693
|
kind: "lesson";
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
goodExample: string;
|
|
1694
|
+
example: string;
|
|
1695
|
+
lessonRef?: string | undefined;
|
|
1782
1696
|
} | {
|
|
1783
1697
|
kind: "commit";
|
|
1784
|
-
|
|
1785
|
-
mergeCommitSha: string;
|
|
1698
|
+
commitSha: string;
|
|
1786
1699
|
};
|
|
1700
|
+
}, {
|
|
1787
1701
|
filePath: string;
|
|
1788
1702
|
matchedSpan: string;
|
|
1789
|
-
|
|
1790
|
-
}, {
|
|
1791
|
-
pr: number;
|
|
1792
|
-
preimageSource: {
|
|
1703
|
+
nearMissSource: {
|
|
1793
1704
|
kind: "lesson";
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
goodExample: string;
|
|
1705
|
+
example: string;
|
|
1706
|
+
lessonRef?: string | undefined;
|
|
1797
1707
|
} | {
|
|
1798
1708
|
kind: "commit";
|
|
1799
|
-
|
|
1800
|
-
mergeCommitSha: string;
|
|
1709
|
+
commitSha: string;
|
|
1801
1710
|
};
|
|
1802
|
-
filePath: string;
|
|
1803
|
-
matchedSpan: string;
|
|
1804
|
-
contentHash: string;
|
|
1805
1711
|
}>, "many">>;
|
|
1806
1712
|
}, "strip", z.ZodTypeAny, {
|
|
1807
1713
|
kind: "authored";
|
|
@@ -1825,20 +1731,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1825
1731
|
contentHash: string;
|
|
1826
1732
|
}[];
|
|
1827
1733
|
negativeFixtures?: {
|
|
1828
|
-
|
|
1829
|
-
|
|
1734
|
+
filePath: string;
|
|
1735
|
+
matchedSpan: string;
|
|
1736
|
+
nearMissSource: {
|
|
1830
1737
|
kind: "lesson";
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
goodExample: string;
|
|
1738
|
+
example: string;
|
|
1739
|
+
lessonRef?: string | undefined;
|
|
1834
1740
|
} | {
|
|
1835
1741
|
kind: "commit";
|
|
1836
|
-
|
|
1837
|
-
mergeCommitSha: string;
|
|
1742
|
+
commitSha: string;
|
|
1838
1743
|
};
|
|
1839
|
-
filePath: string;
|
|
1840
|
-
matchedSpan: string;
|
|
1841
|
-
contentHash: string;
|
|
1842
1744
|
}[] | undefined;
|
|
1843
1745
|
}, {
|
|
1844
1746
|
kind: "authored";
|
|
@@ -1862,20 +1764,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1862
1764
|
contentHash: string;
|
|
1863
1765
|
}[];
|
|
1864
1766
|
negativeFixtures?: {
|
|
1865
|
-
|
|
1866
|
-
|
|
1767
|
+
filePath: string;
|
|
1768
|
+
matchedSpan: string;
|
|
1769
|
+
nearMissSource: {
|
|
1867
1770
|
kind: "lesson";
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
goodExample: string;
|
|
1771
|
+
example: string;
|
|
1772
|
+
lessonRef?: string | undefined;
|
|
1871
1773
|
} | {
|
|
1872
1774
|
kind: "commit";
|
|
1873
|
-
|
|
1874
|
-
mergeCommitSha: string;
|
|
1775
|
+
commitSha: string;
|
|
1875
1776
|
};
|
|
1876
|
-
filePath: string;
|
|
1877
|
-
matchedSpan: string;
|
|
1878
|
-
contentHash: string;
|
|
1879
1777
|
}[] | undefined;
|
|
1880
1778
|
}>, z.ZodObject<{
|
|
1881
1779
|
/**
|
|
@@ -1939,20 +1837,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1939
1837
|
contentHash: string;
|
|
1940
1838
|
}[];
|
|
1941
1839
|
negativeFixtures?: {
|
|
1942
|
-
|
|
1943
|
-
|
|
1840
|
+
filePath: string;
|
|
1841
|
+
matchedSpan: string;
|
|
1842
|
+
nearMissSource: {
|
|
1944
1843
|
kind: "lesson";
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
goodExample: string;
|
|
1844
|
+
example: string;
|
|
1845
|
+
lessonRef?: string | undefined;
|
|
1948
1846
|
} | {
|
|
1949
1847
|
kind: "commit";
|
|
1950
|
-
|
|
1951
|
-
mergeCommitSha: string;
|
|
1848
|
+
commitSha: string;
|
|
1952
1849
|
};
|
|
1953
|
-
filePath: string;
|
|
1954
|
-
matchedSpan: string;
|
|
1955
|
-
contentHash: string;
|
|
1956
1850
|
}[] | undefined;
|
|
1957
1851
|
};
|
|
1958
1852
|
positiveControl: boolean;
|
|
@@ -1985,20 +1879,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1985
1879
|
contentHash: string;
|
|
1986
1880
|
}[];
|
|
1987
1881
|
negativeFixtures?: {
|
|
1988
|
-
|
|
1989
|
-
|
|
1882
|
+
filePath: string;
|
|
1883
|
+
matchedSpan: string;
|
|
1884
|
+
nearMissSource: {
|
|
1990
1885
|
kind: "lesson";
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
goodExample: string;
|
|
1886
|
+
example: string;
|
|
1887
|
+
lessonRef?: string | undefined;
|
|
1994
1888
|
} | {
|
|
1995
1889
|
kind: "commit";
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
};
|
|
1999
|
-
filePath: string;
|
|
2000
|
-
matchedSpan: string;
|
|
2001
|
-
contentHash: string;
|
|
1890
|
+
commitSha: string;
|
|
1891
|
+
};
|
|
2002
1892
|
}[] | undefined;
|
|
2003
1893
|
};
|
|
2004
1894
|
positiveControl: boolean;
|
|
@@ -2068,20 +1958,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2068
1958
|
contentHash: string;
|
|
2069
1959
|
}[];
|
|
2070
1960
|
negativeFixtures?: {
|
|
2071
|
-
|
|
2072
|
-
|
|
1961
|
+
filePath: string;
|
|
1962
|
+
matchedSpan: string;
|
|
1963
|
+
nearMissSource: {
|
|
2073
1964
|
kind: "lesson";
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
goodExample: string;
|
|
1965
|
+
example: string;
|
|
1966
|
+
lessonRef?: string | undefined;
|
|
2077
1967
|
} | {
|
|
2078
1968
|
kind: "commit";
|
|
2079
|
-
|
|
2080
|
-
mergeCommitSha: string;
|
|
1969
|
+
commitSha: string;
|
|
2081
1970
|
};
|
|
2082
|
-
filePath: string;
|
|
2083
|
-
matchedSpan: string;
|
|
2084
|
-
contentHash: string;
|
|
2085
1971
|
}[] | undefined;
|
|
2086
1972
|
};
|
|
2087
1973
|
positiveControl: boolean;
|
|
@@ -2141,20 +2027,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2141
2027
|
contentHash: string;
|
|
2142
2028
|
}[];
|
|
2143
2029
|
negativeFixtures?: {
|
|
2144
|
-
|
|
2145
|
-
|
|
2030
|
+
filePath: string;
|
|
2031
|
+
matchedSpan: string;
|
|
2032
|
+
nearMissSource: {
|
|
2146
2033
|
kind: "lesson";
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
goodExample: string;
|
|
2034
|
+
example: string;
|
|
2035
|
+
lessonRef?: string | undefined;
|
|
2150
2036
|
} | {
|
|
2151
2037
|
kind: "commit";
|
|
2152
|
-
|
|
2153
|
-
mergeCommitSha: string;
|
|
2038
|
+
commitSha: string;
|
|
2154
2039
|
};
|
|
2155
|
-
filePath: string;
|
|
2156
|
-
matchedSpan: string;
|
|
2157
|
-
contentHash: string;
|
|
2158
2040
|
}[] | undefined;
|
|
2159
2041
|
};
|
|
2160
2042
|
positiveControl: boolean;
|
|
@@ -2214,20 +2096,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2214
2096
|
contentHash: string;
|
|
2215
2097
|
}[];
|
|
2216
2098
|
negativeFixtures?: {
|
|
2217
|
-
|
|
2218
|
-
|
|
2099
|
+
filePath: string;
|
|
2100
|
+
matchedSpan: string;
|
|
2101
|
+
nearMissSource: {
|
|
2219
2102
|
kind: "lesson";
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
goodExample: string;
|
|
2103
|
+
example: string;
|
|
2104
|
+
lessonRef?: string | undefined;
|
|
2223
2105
|
} | {
|
|
2224
2106
|
kind: "commit";
|
|
2225
|
-
|
|
2226
|
-
mergeCommitSha: string;
|
|
2107
|
+
commitSha: string;
|
|
2227
2108
|
};
|
|
2228
|
-
filePath: string;
|
|
2229
|
-
matchedSpan: string;
|
|
2230
|
-
contentHash: string;
|
|
2231
2109
|
}[] | undefined;
|
|
2232
2110
|
};
|
|
2233
2111
|
positiveControl: boolean;
|
|
@@ -2287,20 +2165,16 @@ export declare const CompiledRuleSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2287
2165
|
contentHash: string;
|
|
2288
2166
|
}[];
|
|
2289
2167
|
negativeFixtures?: {
|
|
2290
|
-
|
|
2291
|
-
|
|
2168
|
+
filePath: string;
|
|
2169
|
+
matchedSpan: string;
|
|
2170
|
+
nearMissSource: {
|
|
2292
2171
|
kind: "lesson";
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
goodExample: string;
|
|
2172
|
+
example: string;
|
|
2173
|
+
lessonRef?: string | undefined;
|
|
2296
2174
|
} | {
|
|
2297
2175
|
kind: "commit";
|
|
2298
|
-
|
|
2299
|
-
mergeCommitSha: string;
|
|
2176
|
+
commitSha: string;
|
|
2300
2177
|
};
|
|
2301
|
-
filePath: string;
|
|
2302
|
-
matchedSpan: string;
|
|
2303
|
-
contentHash: string;
|
|
2304
2178
|
}[] | undefined;
|
|
2305
2179
|
};
|
|
2306
2180
|
positiveControl: boolean;
|
|
@@ -2432,7 +2306,18 @@ export type NonCompilableEntry = z.infer<typeof NonCompilableEntryReadSchema>;
|
|
|
2432
2306
|
export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
2433
2307
|
version: z.ZodLiteral<1>;
|
|
2434
2308
|
rules: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
2435
|
-
/**
|
|
2309
|
+
/**
|
|
2310
|
+
* The rule's stable identity + wind-tunnel firing key.
|
|
2311
|
+
* - MINED / lesson-compiled rules: SHA-256 (first 16 hex chars) of heading + body —
|
|
2312
|
+
* content-derived, detects edits.
|
|
2313
|
+
* - AUTHORED rules (ADR-112 §8/§9): carries the PERSISTED, minted `ruleId` (set at
|
|
2314
|
+
* the compile seam from `CompileInputCandidate.ruleId`), NOT a content hash — the
|
|
2315
|
+
* `firingLabelId ← ruleId` id-unification, so a matcher (`dslSource`) edit never
|
|
2316
|
+
* orphans the rule's ground-truth labels / `controls.positive[].targetRuleId`. For
|
|
2317
|
+
* authored rules this is identity, NOT an edit-detector; it may carry a `-N`
|
|
2318
|
+
* collision suffix. (Authored rules are Gate-1 advisory and live only in the cert
|
|
2319
|
+
* corpus, never the product enforcement path that reads this as a content hash.)
|
|
2320
|
+
*/
|
|
2436
2321
|
lessonHash: z.ZodString;
|
|
2437
2322
|
/** Human-readable heading from the lesson (for diagnostics) */
|
|
2438
2323
|
lessonHeading: z.ZodString;
|
|
@@ -2717,115 +2602,69 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
2717
2602
|
matchedSpan: string;
|
|
2718
2603
|
contentHash: string;
|
|
2719
2604
|
}>, "many">;
|
|
2720
|
-
/**
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2605
|
+
/**
|
|
2606
|
+
* Declared SILENCE-ONLY near-misses the rule must stay silent on (feeds §6
|
|
2607
|
+
* `controls.negative[]`). The silence-only `nearMissSource` shape, NOT the
|
|
2608
|
+
* positiveFixtures bad/good pair (strategy#770 — different arity, §6 L142).
|
|
2609
|
+
*/
|
|
2610
|
+
negativeFixtures: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2611
|
+
/** File the near-miss locus lives in. */
|
|
2612
|
+
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
2613
|
+
/** Line-range or AST-node path — the near-miss locus, not just the file. */
|
|
2614
|
+
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
2615
|
+
/** The §4-pluggable silence target — ONE side (the matcher must not fire on it). */
|
|
2616
|
+
nearMissSource: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
2726
2617
|
kind: z.ZodLiteral<"lesson">;
|
|
2727
|
-
/**
|
|
2728
|
-
|
|
2618
|
+
/** The synthetic near-miss exemplar the matcher must stay SILENT on (§6). */
|
|
2619
|
+
example: z.ZodEffects<z.ZodString, string, string>;
|
|
2729
2620
|
/**
|
|
2730
|
-
*
|
|
2731
|
-
*
|
|
2732
|
-
*
|
|
2733
|
-
*
|
|
2621
|
+
* OPTIONAL immutable lesson id — a synthetic near-miss may have no lesson origin,
|
|
2622
|
+
* so unlike the positiveFixtures `lessonRef` it is optional; but WHEN present it
|
|
2623
|
+
* carries the same §8 discipline (the 16-hex `hashLesson` codomain, never a
|
|
2624
|
+
* path/mutable alias), so it can't be a free-form mutable alias.
|
|
2734
2625
|
*/
|
|
2735
|
-
|
|
2736
|
-
/** The fixed POSTIMAGE exemplar the matcher must stay SILENT on (§4) — a lesson `goodExample`. */
|
|
2737
|
-
goodExample: z.ZodEffects<z.ZodString, string, string>;
|
|
2626
|
+
lessonRef: z.ZodOptional<z.ZodString>;
|
|
2738
2627
|
}, "strict", z.ZodTypeAny, {
|
|
2739
2628
|
kind: "lesson";
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
goodExample: string;
|
|
2629
|
+
example: string;
|
|
2630
|
+
lessonRef?: string | undefined;
|
|
2743
2631
|
}, {
|
|
2744
2632
|
kind: "lesson";
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
goodExample: string;
|
|
2633
|
+
example: string;
|
|
2634
|
+
lessonRef?: string | undefined;
|
|
2748
2635
|
}>, z.ZodObject<{
|
|
2749
2636
|
kind: z.ZodLiteral<"commit">;
|
|
2750
|
-
/** The
|
|
2751
|
-
|
|
2752
|
-
/** The PR's merge/squash commit — the post-fix (defect-absent) anchor; the matcher must stay SILENT on this. */
|
|
2753
|
-
mergeCommitSha: z.ZodString;
|
|
2637
|
+
/** The commit whose state the matcher must stay SILENT on (§6, land-then-fix fallback). */
|
|
2638
|
+
commitSha: z.ZodString;
|
|
2754
2639
|
}, "strict", z.ZodTypeAny, {
|
|
2755
2640
|
kind: "commit";
|
|
2756
|
-
|
|
2757
|
-
mergeCommitSha: string;
|
|
2641
|
+
commitSha: string;
|
|
2758
2642
|
}, {
|
|
2759
2643
|
kind: "commit";
|
|
2760
|
-
|
|
2761
|
-
mergeCommitSha: string;
|
|
2644
|
+
commitSha: string;
|
|
2762
2645
|
}>]>;
|
|
2763
|
-
/** File the defect locus lives in. */
|
|
2764
|
-
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
2765
|
-
/** Line-range or AST-node path — the defect locus, not just the file. */
|
|
2766
|
-
matchedSpan: z.ZodEffects<z.ZodString, string, string>;
|
|
2767
|
-
/** Span content hash, line-drift-stable (cf. `firingLabelId`). */
|
|
2768
|
-
contentHash: z.ZodEffects<z.ZodString, string, string>;
|
|
2769
2646
|
}, "strict", z.ZodTypeAny, {
|
|
2770
|
-
pr: number;
|
|
2771
|
-
preimageSource: {
|
|
2772
|
-
kind: "lesson";
|
|
2773
|
-
lessonRef: string;
|
|
2774
|
-
badExample: string;
|
|
2775
|
-
goodExample: string;
|
|
2776
|
-
} | {
|
|
2777
|
-
kind: "commit";
|
|
2778
|
-
preimageCommitSha: string;
|
|
2779
|
-
mergeCommitSha: string;
|
|
2780
|
-
};
|
|
2781
|
-
filePath: string;
|
|
2782
|
-
matchedSpan: string;
|
|
2783
|
-
contentHash: string;
|
|
2784
|
-
}, {
|
|
2785
|
-
pr: number;
|
|
2786
|
-
preimageSource: {
|
|
2787
|
-
kind: "lesson";
|
|
2788
|
-
lessonRef: string;
|
|
2789
|
-
badExample: string;
|
|
2790
|
-
goodExample: string;
|
|
2791
|
-
} | {
|
|
2792
|
-
kind: "commit";
|
|
2793
|
-
preimageCommitSha: string;
|
|
2794
|
-
mergeCommitSha: string;
|
|
2795
|
-
};
|
|
2796
2647
|
filePath: string;
|
|
2797
2648
|
matchedSpan: string;
|
|
2798
|
-
|
|
2799
|
-
}>, {
|
|
2800
|
-
pr: number;
|
|
2801
|
-
preimageSource: {
|
|
2649
|
+
nearMissSource: {
|
|
2802
2650
|
kind: "lesson";
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
goodExample: string;
|
|
2651
|
+
example: string;
|
|
2652
|
+
lessonRef?: string | undefined;
|
|
2806
2653
|
} | {
|
|
2807
2654
|
kind: "commit";
|
|
2808
|
-
|
|
2809
|
-
mergeCommitSha: string;
|
|
2655
|
+
commitSha: string;
|
|
2810
2656
|
};
|
|
2657
|
+
}, {
|
|
2811
2658
|
filePath: string;
|
|
2812
2659
|
matchedSpan: string;
|
|
2813
|
-
|
|
2814
|
-
}, {
|
|
2815
|
-
pr: number;
|
|
2816
|
-
preimageSource: {
|
|
2660
|
+
nearMissSource: {
|
|
2817
2661
|
kind: "lesson";
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
goodExample: string;
|
|
2662
|
+
example: string;
|
|
2663
|
+
lessonRef?: string | undefined;
|
|
2821
2664
|
} | {
|
|
2822
2665
|
kind: "commit";
|
|
2823
|
-
|
|
2824
|
-
mergeCommitSha: string;
|
|
2666
|
+
commitSha: string;
|
|
2825
2667
|
};
|
|
2826
|
-
filePath: string;
|
|
2827
|
-
matchedSpan: string;
|
|
2828
|
-
contentHash: string;
|
|
2829
2668
|
}>, "many">>;
|
|
2830
2669
|
}, "strip", z.ZodTypeAny, {
|
|
2831
2670
|
kind: "authored";
|
|
@@ -2849,20 +2688,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
2849
2688
|
contentHash: string;
|
|
2850
2689
|
}[];
|
|
2851
2690
|
negativeFixtures?: {
|
|
2852
|
-
|
|
2853
|
-
|
|
2691
|
+
filePath: string;
|
|
2692
|
+
matchedSpan: string;
|
|
2693
|
+
nearMissSource: {
|
|
2854
2694
|
kind: "lesson";
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
goodExample: string;
|
|
2695
|
+
example: string;
|
|
2696
|
+
lessonRef?: string | undefined;
|
|
2858
2697
|
} | {
|
|
2859
2698
|
kind: "commit";
|
|
2860
|
-
|
|
2861
|
-
mergeCommitSha: string;
|
|
2699
|
+
commitSha: string;
|
|
2862
2700
|
};
|
|
2863
|
-
filePath: string;
|
|
2864
|
-
matchedSpan: string;
|
|
2865
|
-
contentHash: string;
|
|
2866
2701
|
}[] | undefined;
|
|
2867
2702
|
}, {
|
|
2868
2703
|
kind: "authored";
|
|
@@ -2886,20 +2721,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
2886
2721
|
contentHash: string;
|
|
2887
2722
|
}[];
|
|
2888
2723
|
negativeFixtures?: {
|
|
2889
|
-
|
|
2890
|
-
|
|
2724
|
+
filePath: string;
|
|
2725
|
+
matchedSpan: string;
|
|
2726
|
+
nearMissSource: {
|
|
2891
2727
|
kind: "lesson";
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
goodExample: string;
|
|
2728
|
+
example: string;
|
|
2729
|
+
lessonRef?: string | undefined;
|
|
2895
2730
|
} | {
|
|
2896
2731
|
kind: "commit";
|
|
2897
|
-
|
|
2898
|
-
mergeCommitSha: string;
|
|
2732
|
+
commitSha: string;
|
|
2899
2733
|
};
|
|
2900
|
-
filePath: string;
|
|
2901
|
-
matchedSpan: string;
|
|
2902
|
-
contentHash: string;
|
|
2903
2734
|
}[] | undefined;
|
|
2904
2735
|
}>, z.ZodObject<{
|
|
2905
2736
|
/**
|
|
@@ -2963,20 +2794,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
2963
2794
|
contentHash: string;
|
|
2964
2795
|
}[];
|
|
2965
2796
|
negativeFixtures?: {
|
|
2966
|
-
|
|
2967
|
-
|
|
2797
|
+
filePath: string;
|
|
2798
|
+
matchedSpan: string;
|
|
2799
|
+
nearMissSource: {
|
|
2968
2800
|
kind: "lesson";
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
goodExample: string;
|
|
2801
|
+
example: string;
|
|
2802
|
+
lessonRef?: string | undefined;
|
|
2972
2803
|
} | {
|
|
2973
2804
|
kind: "commit";
|
|
2974
|
-
|
|
2975
|
-
mergeCommitSha: string;
|
|
2805
|
+
commitSha: string;
|
|
2976
2806
|
};
|
|
2977
|
-
filePath: string;
|
|
2978
|
-
matchedSpan: string;
|
|
2979
|
-
contentHash: string;
|
|
2980
2807
|
}[] | undefined;
|
|
2981
2808
|
};
|
|
2982
2809
|
positiveControl: boolean;
|
|
@@ -3009,20 +2836,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
3009
2836
|
contentHash: string;
|
|
3010
2837
|
}[];
|
|
3011
2838
|
negativeFixtures?: {
|
|
3012
|
-
|
|
3013
|
-
|
|
2839
|
+
filePath: string;
|
|
2840
|
+
matchedSpan: string;
|
|
2841
|
+
nearMissSource: {
|
|
3014
2842
|
kind: "lesson";
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
goodExample: string;
|
|
2843
|
+
example: string;
|
|
2844
|
+
lessonRef?: string | undefined;
|
|
3018
2845
|
} | {
|
|
3019
2846
|
kind: "commit";
|
|
3020
|
-
|
|
3021
|
-
mergeCommitSha: string;
|
|
2847
|
+
commitSha: string;
|
|
3022
2848
|
};
|
|
3023
|
-
filePath: string;
|
|
3024
|
-
matchedSpan: string;
|
|
3025
|
-
contentHash: string;
|
|
3026
2849
|
}[] | undefined;
|
|
3027
2850
|
};
|
|
3028
2851
|
positiveControl: boolean;
|
|
@@ -3092,20 +2915,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
3092
2915
|
contentHash: string;
|
|
3093
2916
|
}[];
|
|
3094
2917
|
negativeFixtures?: {
|
|
3095
|
-
|
|
3096
|
-
|
|
2918
|
+
filePath: string;
|
|
2919
|
+
matchedSpan: string;
|
|
2920
|
+
nearMissSource: {
|
|
3097
2921
|
kind: "lesson";
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
goodExample: string;
|
|
2922
|
+
example: string;
|
|
2923
|
+
lessonRef?: string | undefined;
|
|
3101
2924
|
} | {
|
|
3102
2925
|
kind: "commit";
|
|
3103
|
-
|
|
3104
|
-
mergeCommitSha: string;
|
|
2926
|
+
commitSha: string;
|
|
3105
2927
|
};
|
|
3106
|
-
filePath: string;
|
|
3107
|
-
matchedSpan: string;
|
|
3108
|
-
contentHash: string;
|
|
3109
2928
|
}[] | undefined;
|
|
3110
2929
|
};
|
|
3111
2930
|
positiveControl: boolean;
|
|
@@ -3165,20 +2984,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
3165
2984
|
contentHash: string;
|
|
3166
2985
|
}[];
|
|
3167
2986
|
negativeFixtures?: {
|
|
3168
|
-
|
|
3169
|
-
|
|
2987
|
+
filePath: string;
|
|
2988
|
+
matchedSpan: string;
|
|
2989
|
+
nearMissSource: {
|
|
3170
2990
|
kind: "lesson";
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
goodExample: string;
|
|
2991
|
+
example: string;
|
|
2992
|
+
lessonRef?: string | undefined;
|
|
3174
2993
|
} | {
|
|
3175
2994
|
kind: "commit";
|
|
3176
|
-
|
|
3177
|
-
mergeCommitSha: string;
|
|
2995
|
+
commitSha: string;
|
|
3178
2996
|
};
|
|
3179
|
-
filePath: string;
|
|
3180
|
-
matchedSpan: string;
|
|
3181
|
-
contentHash: string;
|
|
3182
2997
|
}[] | undefined;
|
|
3183
2998
|
};
|
|
3184
2999
|
positiveControl: boolean;
|
|
@@ -3238,20 +3053,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
3238
3053
|
contentHash: string;
|
|
3239
3054
|
}[];
|
|
3240
3055
|
negativeFixtures?: {
|
|
3241
|
-
|
|
3242
|
-
|
|
3056
|
+
filePath: string;
|
|
3057
|
+
matchedSpan: string;
|
|
3058
|
+
nearMissSource: {
|
|
3243
3059
|
kind: "lesson";
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
goodExample: string;
|
|
3060
|
+
example: string;
|
|
3061
|
+
lessonRef?: string | undefined;
|
|
3247
3062
|
} | {
|
|
3248
3063
|
kind: "commit";
|
|
3249
|
-
|
|
3250
|
-
mergeCommitSha: string;
|
|
3064
|
+
commitSha: string;
|
|
3251
3065
|
};
|
|
3252
|
-
filePath: string;
|
|
3253
|
-
matchedSpan: string;
|
|
3254
|
-
contentHash: string;
|
|
3255
3066
|
}[] | undefined;
|
|
3256
3067
|
};
|
|
3257
3068
|
positiveControl: boolean;
|
|
@@ -3311,20 +3122,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
3311
3122
|
contentHash: string;
|
|
3312
3123
|
}[];
|
|
3313
3124
|
negativeFixtures?: {
|
|
3314
|
-
|
|
3315
|
-
|
|
3125
|
+
filePath: string;
|
|
3126
|
+
matchedSpan: string;
|
|
3127
|
+
nearMissSource: {
|
|
3316
3128
|
kind: "lesson";
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
goodExample: string;
|
|
3129
|
+
example: string;
|
|
3130
|
+
lessonRef?: string | undefined;
|
|
3320
3131
|
} | {
|
|
3321
3132
|
kind: "commit";
|
|
3322
|
-
|
|
3323
|
-
mergeCommitSha: string;
|
|
3133
|
+
commitSha: string;
|
|
3324
3134
|
};
|
|
3325
|
-
filePath: string;
|
|
3326
|
-
matchedSpan: string;
|
|
3327
|
-
contentHash: string;
|
|
3328
3135
|
}[] | undefined;
|
|
3329
3136
|
};
|
|
3330
3137
|
positiveControl: boolean;
|
|
@@ -3434,20 +3241,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
3434
3241
|
contentHash: string;
|
|
3435
3242
|
}[];
|
|
3436
3243
|
negativeFixtures?: {
|
|
3437
|
-
|
|
3438
|
-
|
|
3244
|
+
filePath: string;
|
|
3245
|
+
matchedSpan: string;
|
|
3246
|
+
nearMissSource: {
|
|
3439
3247
|
kind: "lesson";
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
goodExample: string;
|
|
3248
|
+
example: string;
|
|
3249
|
+
lessonRef?: string | undefined;
|
|
3443
3250
|
} | {
|
|
3444
3251
|
kind: "commit";
|
|
3445
|
-
|
|
3446
|
-
mergeCommitSha: string;
|
|
3252
|
+
commitSha: string;
|
|
3447
3253
|
};
|
|
3448
|
-
filePath: string;
|
|
3449
|
-
matchedSpan: string;
|
|
3450
|
-
contentHash: string;
|
|
3451
3254
|
}[] | undefined;
|
|
3452
3255
|
};
|
|
3453
3256
|
positiveControl: boolean;
|
|
@@ -3516,20 +3319,16 @@ export declare const CompiledRulesFileSchema: z.ZodObject<{
|
|
|
3516
3319
|
contentHash: string;
|
|
3517
3320
|
}[];
|
|
3518
3321
|
negativeFixtures?: {
|
|
3519
|
-
|
|
3520
|
-
|
|
3322
|
+
filePath: string;
|
|
3323
|
+
matchedSpan: string;
|
|
3324
|
+
nearMissSource: {
|
|
3521
3325
|
kind: "lesson";
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
goodExample: string;
|
|
3326
|
+
example: string;
|
|
3327
|
+
lessonRef?: string | undefined;
|
|
3525
3328
|
} | {
|
|
3526
3329
|
kind: "commit";
|
|
3527
|
-
|
|
3528
|
-
mergeCommitSha: string;
|
|
3330
|
+
commitSha: string;
|
|
3529
3331
|
};
|
|
3530
|
-
filePath: string;
|
|
3531
|
-
matchedSpan: string;
|
|
3532
|
-
contentHash: string;
|
|
3533
3332
|
}[] | undefined;
|
|
3534
3333
|
};
|
|
3535
3334
|
positiveControl: boolean;
|