@mmnto/totem 2.1.0 → 2.2.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 (47) hide show
  1. package/dist/gate-engine.d.ts +11 -1
  2. package/dist/gate-engine.d.ts.map +1 -1
  3. package/dist/gate-engine.js +27 -5
  4. package/dist/gate-engine.js.map +1 -1
  5. package/dist/gate-types.d.ts +17 -2
  6. package/dist/gate-types.d.ts.map +1 -1
  7. package/dist/index.d.ts +7 -3
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +4 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/parity-detect.d.ts +41 -4
  12. package/dist/parity-detect.d.ts.map +1 -1
  13. package/dist/parity-detect.js +264 -1
  14. package/dist/parity-detect.js.map +1 -1
  15. package/dist/parity-detect.orientation-rows.test.d.ts +17 -0
  16. package/dist/parity-detect.orientation-rows.test.d.ts.map +1 -0
  17. package/dist/parity-detect.orientation-rows.test.js +357 -0
  18. package/dist/parity-detect.orientation-rows.test.js.map +1 -0
  19. package/dist/parity-label-canon.d.ts +160 -0
  20. package/dist/parity-label-canon.d.ts.map +1 -0
  21. package/dist/parity-label-canon.js +220 -0
  22. package/dist/parity-label-canon.js.map +1 -0
  23. package/dist/parity-label-canon.test.d.ts +11 -0
  24. package/dist/parity-label-canon.test.d.ts.map +1 -0
  25. package/dist/parity-label-canon.test.js +296 -0
  26. package/dist/parity-label-canon.test.js.map +1 -0
  27. package/dist/parity-manifest.d.ts +9 -0
  28. package/dist/parity-manifest.d.ts.map +1 -1
  29. package/dist/parity-manifest.js +47 -0
  30. package/dist/parity-manifest.js.map +1 -1
  31. package/dist/parity-manifest.test.js +45 -0
  32. package/dist/parity-manifest.test.js.map +1 -1
  33. package/dist/recurrence-stats.d.ts +10 -10
  34. package/dist/retrospect.d.ts +42 -42
  35. package/dist/transport-shield.d.ts +190 -0
  36. package/dist/transport-shield.d.ts.map +1 -0
  37. package/dist/transport-shield.fold.test.d.ts +2 -0
  38. package/dist/transport-shield.fold.test.d.ts.map +1 -0
  39. package/dist/transport-shield.fold.test.js +439 -0
  40. package/dist/transport-shield.fold.test.js.map +1 -0
  41. package/dist/transport-shield.js +1040 -0
  42. package/dist/transport-shield.js.map +1 -0
  43. package/dist/transport-shield.test.d.ts +2 -0
  44. package/dist/transport-shield.test.d.ts.map +1 -0
  45. package/dist/transport-shield.test.js +298 -0
  46. package/dist/transport-shield.test.js.map +1 -0
  47. package/package.json +1 -1
@@ -84,8 +84,8 @@ export declare const RetrospectFindingSchema: z.ZodDiscriminatedUnion<"classific
84
84
  routeOutReason: z.ZodEnum<["covered by existing compiled rule", "rule-covered class flagged late — retroactive shouldn’t block ship", "frequent across other PRs — file follow-up to compile into a rule", "low/nit severity flagged late in the bot-review loop"]>;
85
85
  }, "strip", z.ZodTypeAny, {
86
86
  file: string;
87
- signature: string;
88
87
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
88
+ signature: string;
89
89
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
90
90
  coveredByRule: boolean;
91
91
  roundNumber: number;
@@ -96,8 +96,8 @@ export declare const RetrospectFindingSchema: z.ZodDiscriminatedUnion<"classific
96
96
  line?: number | undefined;
97
97
  }, {
98
98
  file: string;
99
- signature: string;
100
99
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
100
+ signature: string;
101
101
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
102
102
  coveredByRule: boolean;
103
103
  roundNumber: number;
@@ -129,8 +129,8 @@ export declare const RetrospectFindingSchema: z.ZodDiscriminatedUnion<"classific
129
129
  classification: z.ZodLiteral<"in-pr-fix">;
130
130
  }, "strict", z.ZodTypeAny, {
131
131
  file: string;
132
- signature: string;
133
132
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
133
+ signature: string;
134
134
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
135
135
  coveredByRule: boolean;
136
136
  roundNumber: number;
@@ -140,8 +140,8 @@ export declare const RetrospectFindingSchema: z.ZodDiscriminatedUnion<"classific
140
140
  line?: number | undefined;
141
141
  }, {
142
142
  file: string;
143
- signature: string;
144
143
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
144
+ signature: string;
145
145
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
146
146
  coveredByRule: boolean;
147
147
  roundNumber: number;
@@ -172,8 +172,8 @@ export declare const RetrospectFindingSchema: z.ZodDiscriminatedUnion<"classific
172
172
  classification: z.ZodLiteral<"undetermined">;
173
173
  }, "strict", z.ZodTypeAny, {
174
174
  file: string;
175
- signature: string;
176
175
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
176
+ signature: string;
177
177
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
178
178
  coveredByRule: boolean;
179
179
  roundNumber: number;
@@ -183,8 +183,8 @@ export declare const RetrospectFindingSchema: z.ZodDiscriminatedUnion<"classific
183
183
  line?: number | undefined;
184
184
  }, {
185
185
  file: string;
186
- signature: string;
187
186
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
187
+ signature: string;
188
188
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
189
189
  coveredByRule: boolean;
190
190
  roundNumber: number;
@@ -275,8 +275,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
275
275
  routeOutReason: z.ZodEnum<["covered by existing compiled rule", "rule-covered class flagged late — retroactive shouldn’t block ship", "frequent across other PRs — file follow-up to compile into a rule", "low/nit severity flagged late in the bot-review loop"]>;
276
276
  }, "strip", z.ZodTypeAny, {
277
277
  file: string;
278
- signature: string;
279
278
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
279
+ signature: string;
280
280
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
281
281
  coveredByRule: boolean;
282
282
  roundNumber: number;
@@ -287,8 +287,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
287
287
  line?: number | undefined;
288
288
  }, {
289
289
  file: string;
290
- signature: string;
291
290
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
291
+ signature: string;
292
292
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
293
293
  coveredByRule: boolean;
294
294
  roundNumber: number;
@@ -320,8 +320,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
320
320
  classification: z.ZodLiteral<"in-pr-fix">;
321
321
  }, "strict", z.ZodTypeAny, {
322
322
  file: string;
323
- signature: string;
324
323
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
324
+ signature: string;
325
325
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
326
326
  coveredByRule: boolean;
327
327
  roundNumber: number;
@@ -331,8 +331,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
331
331
  line?: number | undefined;
332
332
  }, {
333
333
  file: string;
334
- signature: string;
335
334
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
335
+ signature: string;
336
336
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
337
337
  coveredByRule: boolean;
338
338
  roundNumber: number;
@@ -363,8 +363,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
363
363
  classification: z.ZodLiteral<"undetermined">;
364
364
  }, "strict", z.ZodTypeAny, {
365
365
  file: string;
366
- signature: string;
367
366
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
367
+ signature: string;
368
368
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
369
369
  coveredByRule: boolean;
370
370
  roundNumber: number;
@@ -374,8 +374,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
374
374
  line?: number | undefined;
375
375
  }, {
376
376
  file: string;
377
- signature: string;
378
377
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
378
+ signature: string;
379
379
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
380
380
  coveredByRule: boolean;
381
381
  roundNumber: number;
@@ -410,8 +410,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
410
410
  routeOutReason: z.ZodEnum<["covered by existing compiled rule", "rule-covered class flagged late — retroactive shouldn’t block ship", "frequent across other PRs — file follow-up to compile into a rule", "low/nit severity flagged late in the bot-review loop"]>;
411
411
  }, "strip", z.ZodTypeAny, {
412
412
  file: string;
413
- signature: string;
414
413
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
414
+ signature: string;
415
415
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
416
416
  coveredByRule: boolean;
417
417
  roundNumber: number;
@@ -422,8 +422,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
422
422
  line?: number | undefined;
423
423
  }, {
424
424
  file: string;
425
- signature: string;
426
425
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
426
+ signature: string;
427
427
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
428
428
  coveredByRule: boolean;
429
429
  roundNumber: number;
@@ -455,8 +455,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
455
455
  classification: z.ZodLiteral<"in-pr-fix">;
456
456
  }, "strict", z.ZodTypeAny, {
457
457
  file: string;
458
- signature: string;
459
458
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
459
+ signature: string;
460
460
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
461
461
  coveredByRule: boolean;
462
462
  roundNumber: number;
@@ -466,8 +466,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
466
466
  line?: number | undefined;
467
467
  }, {
468
468
  file: string;
469
- signature: string;
470
469
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
470
+ signature: string;
471
471
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
472
472
  coveredByRule: boolean;
473
473
  roundNumber: number;
@@ -498,8 +498,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
498
498
  classification: z.ZodLiteral<"undetermined">;
499
499
  }, "strict", z.ZodTypeAny, {
500
500
  file: string;
501
- signature: string;
502
501
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
502
+ signature: string;
503
503
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
504
504
  coveredByRule: boolean;
505
505
  roundNumber: number;
@@ -509,8 +509,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
509
509
  line?: number | undefined;
510
510
  }, {
511
511
  file: string;
512
- signature: string;
513
512
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
513
+ signature: string;
514
514
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
515
515
  coveredByRule: boolean;
516
516
  roundNumber: number;
@@ -545,8 +545,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
545
545
  routeOutReason: z.ZodEnum<["covered by existing compiled rule", "rule-covered class flagged late — retroactive shouldn’t block ship", "frequent across other PRs — file follow-up to compile into a rule", "low/nit severity flagged late in the bot-review loop"]>;
546
546
  }, "strip", z.ZodTypeAny, {
547
547
  file: string;
548
- signature: string;
549
548
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
549
+ signature: string;
550
550
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
551
551
  coveredByRule: boolean;
552
552
  roundNumber: number;
@@ -557,8 +557,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
557
557
  line?: number | undefined;
558
558
  }, {
559
559
  file: string;
560
- signature: string;
561
560
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
561
+ signature: string;
562
562
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
563
563
  coveredByRule: boolean;
564
564
  roundNumber: number;
@@ -590,8 +590,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
590
590
  classification: z.ZodLiteral<"in-pr-fix">;
591
591
  }, "strict", z.ZodTypeAny, {
592
592
  file: string;
593
- signature: string;
594
593
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
594
+ signature: string;
595
595
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
596
596
  coveredByRule: boolean;
597
597
  roundNumber: number;
@@ -601,8 +601,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
601
601
  line?: number | undefined;
602
602
  }, {
603
603
  file: string;
604
- signature: string;
605
604
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
605
+ signature: string;
606
606
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
607
607
  coveredByRule: boolean;
608
608
  roundNumber: number;
@@ -633,8 +633,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
633
633
  classification: z.ZodLiteral<"undetermined">;
634
634
  }, "strict", z.ZodTypeAny, {
635
635
  file: string;
636
- signature: string;
637
636
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
637
+ signature: string;
638
638
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
639
639
  coveredByRule: boolean;
640
640
  roundNumber: number;
@@ -644,8 +644,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
644
644
  line?: number | undefined;
645
645
  }, {
646
646
  file: string;
647
- signature: string;
648
647
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
648
+ signature: string;
649
649
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
650
650
  coveredByRule: boolean;
651
651
  roundNumber: number;
@@ -662,8 +662,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
662
662
  version: 1;
663
663
  undetermined: ({
664
664
  file: string;
665
- signature: string;
666
665
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
666
+ signature: string;
667
667
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
668
668
  coveredByRule: boolean;
669
669
  roundNumber: number;
@@ -674,8 +674,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
674
674
  line?: number | undefined;
675
675
  } | {
676
676
  file: string;
677
- signature: string;
678
677
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
678
+ signature: string;
679
679
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
680
680
  coveredByRule: boolean;
681
681
  roundNumber: number;
@@ -685,8 +685,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
685
685
  line?: number | undefined;
686
686
  } | {
687
687
  file: string;
688
- signature: string;
689
688
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
689
+ signature: string;
690
690
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
691
691
  coveredByRule: boolean;
692
692
  roundNumber: number;
@@ -716,8 +716,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
716
716
  };
717
717
  routeOutCandidates: ({
718
718
  file: string;
719
- signature: string;
720
719
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
720
+ signature: string;
721
721
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
722
722
  coveredByRule: boolean;
723
723
  roundNumber: number;
@@ -728,8 +728,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
728
728
  line?: number | undefined;
729
729
  } | {
730
730
  file: string;
731
- signature: string;
732
731
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
732
+ signature: string;
733
733
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
734
734
  coveredByRule: boolean;
735
735
  roundNumber: number;
@@ -739,8 +739,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
739
739
  line?: number | undefined;
740
740
  } | {
741
741
  file: string;
742
- signature: string;
743
742
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
743
+ signature: string;
744
744
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
745
745
  coveredByRule: boolean;
746
746
  roundNumber: number;
@@ -751,8 +751,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
751
751
  })[];
752
752
  inPrFixes: ({
753
753
  file: string;
754
- signature: string;
755
754
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
755
+ signature: string;
756
756
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
757
757
  coveredByRule: boolean;
758
758
  roundNumber: number;
@@ -763,8 +763,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
763
763
  line?: number | undefined;
764
764
  } | {
765
765
  file: string;
766
- signature: string;
767
766
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
767
+ signature: string;
768
768
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
769
769
  coveredByRule: boolean;
770
770
  roundNumber: number;
@@ -774,8 +774,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
774
774
  line?: number | undefined;
775
775
  } | {
776
776
  file: string;
777
- signature: string;
778
777
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
778
+ signature: string;
779
779
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
780
780
  coveredByRule: boolean;
781
781
  roundNumber: number;
@@ -790,8 +790,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
790
790
  version: 1;
791
791
  undetermined: ({
792
792
  file: string;
793
- signature: string;
794
793
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
794
+ signature: string;
795
795
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
796
796
  coveredByRule: boolean;
797
797
  roundNumber: number;
@@ -802,8 +802,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
802
802
  line?: number | undefined;
803
803
  } | {
804
804
  file: string;
805
- signature: string;
806
805
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
806
+ signature: string;
807
807
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
808
808
  coveredByRule: boolean;
809
809
  roundNumber: number;
@@ -813,8 +813,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
813
813
  line?: number | undefined;
814
814
  } | {
815
815
  file: string;
816
- signature: string;
817
816
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
817
+ signature: string;
818
818
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
819
819
  coveredByRule: boolean;
820
820
  roundNumber: number;
@@ -844,8 +844,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
844
844
  };
845
845
  routeOutCandidates: ({
846
846
  file: string;
847
- signature: string;
848
847
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
848
+ signature: string;
849
849
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
850
850
  coveredByRule: boolean;
851
851
  roundNumber: number;
@@ -856,8 +856,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
856
856
  line?: number | undefined;
857
857
  } | {
858
858
  file: string;
859
- signature: string;
860
859
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
860
+ signature: string;
861
861
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
862
862
  coveredByRule: boolean;
863
863
  roundNumber: number;
@@ -867,8 +867,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
867
867
  line?: number | undefined;
868
868
  } | {
869
869
  file: string;
870
- signature: string;
871
870
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
871
+ signature: string;
872
872
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
873
873
  coveredByRule: boolean;
874
874
  roundNumber: number;
@@ -879,8 +879,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
879
879
  })[];
880
880
  inPrFixes: ({
881
881
  file: string;
882
- signature: string;
883
882
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
883
+ signature: string;
884
884
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
885
885
  coveredByRule: boolean;
886
886
  roundNumber: number;
@@ -891,8 +891,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
891
891
  line?: number | undefined;
892
892
  } | {
893
893
  file: string;
894
- signature: string;
895
894
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
895
+ signature: string;
896
896
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
897
897
  coveredByRule: boolean;
898
898
  roundNumber: number;
@@ -902,8 +902,8 @@ export declare const RetrospectReportSchema: z.ZodObject<{
902
902
  line?: number | undefined;
903
903
  } | {
904
904
  file: string;
905
- signature: string;
906
905
  tool: "unknown" | "override" | "coderabbit" | "gca" | "greptile" | "ghcq" | "sarif";
906
+ signature: string;
907
907
  severityBucket: "high" | "critical" | "medium" | "low" | "nit";
908
908
  coveredByRule: boolean;
909
909
  roundNumber: number;
@@ -0,0 +1,190 @@
1
+ import type { GateEvaluator } from './gate-types.js';
2
+ /**
3
+ * transport-shield (mmnto-ai/totem#2799): a PreToolUse gate over the Bash and
4
+ * PowerShell tools that refuses the KNOWN payload-mangling command shapes before
5
+ * the shell sees them, naming the cure in every refusal.
6
+ *
7
+ * The pattern table lives HERE, once, beside the evaluator (the charter's
8
+ * errata: provenance is the table in core; the CLI only installs). Every row is
9
+ * a pure function of the payload — no filesystem, no environment, no clock
10
+ * beyond the verdict's `checkedAt` — so the same command yields the same
11
+ * verdict on every machine given the same `platform` and `tool` fields, and a
12
+ * test can pin win32 on any runner.
13
+ *
14
+ * Evaluation order is the table order: the first DENY row that fires wins; a
15
+ * WARN row is consulted only when no deny fired. A shape the table lacks is
16
+ * allowed — the gate enumerates known shapes (the charter's positive corpus),
17
+ * and a miss is a corpus gap counted by the charter's metric, never a fail-open
18
+ * of an applicable gate.
19
+ *
20
+ * False-positive budget (ADR-109: a non-exact-match gate ships a stated budget
21
+ * and the fixture that measures it): ZERO denies over the benign corpus in
22
+ * `transport-shield.fold.test.ts` (everyday commands that share a token with a
23
+ * row — `diff -b`, `curl -b`, `grep gh -b`, a Windows path as a sed operand,
24
+ * `<<` inside a quoted argument, a here-string). A deny on a benign command in
25
+ * the field is a corpus row plus a fix, never a hand-carved exemption; the
26
+ * `--pilot` tier exists for a measurement week.
27
+ *
28
+ * Out of scope by design, disclosed: a bare backslash outside the four named
29
+ * contexts (a heredoc body, a sed -i expression, an inline node/python body, a
30
+ * gh --body) is not a shape this gate reads; a heredoc inside a `bash -c "…"`
31
+ * or `sh -c '…'` operand is quoted text to this scanner and is not recursed
32
+ * into (a corpus gap, not a fail-open of an applicable row); a wrapper that
33
+ * takes operands of its own before the program (`sudo -u me gh …`, `timeout
34
+ * 30 gh …`, `npx …`) hides the program from the position anchor — the same
35
+ * class. The scanners read the shell's own grammar where a mis-read would
36
+ * desynchronize them: a `#` that begins a word — after an unquoted blank,
37
+ * newline, `;`, `|`, `&`, an opening `(` or an OPERATOR `)` (a subshell's, a
38
+ * case pattern's) — is a comment to the end of the line, discarded WITHOUT
39
+ * quote processing (POSIX 2.3 rule 9; bash §3.1.3), while a `#` that continues
40
+ * a word is not one: `a#b`, and `$(x)#1` / `<(x)#1`, where the `)` closes a
41
+ * substitution that is part of the word (rules 5 and 8 for `$( … )`; process
42
+ * substitution is a bash extension, bash §3.5.6, that behaves the same way) —
43
+ * the scanners track which `(` each `)` closes. `$(( … ))` / `(( … ))` arithmetic is skipped. So
44
+ * neither an apostrophe in a comment nor a `<<` shift can hide a later heredoc
45
+ * or expose comment text as arguments. For the PowerShell tool the SAME walk
46
+ * reads PowerShell's grammar where it differs from bash's, so there is one
47
+ * model of which text is code and no pre-pass to disagree with it: a `<# … #>`
48
+ * block comment outside quotes is skipped whole (a `<#` inside a string is
49
+ * text; a quote inside a block opens nothing), the backtick is the escape
50
+ * inside a double-quoted string, and a `#` is read by the same word-boundary
51
+ * rule as bash's. Not read, disclosed: PowerShell also begins a comment after a
52
+ * token-ending string, an assignment operator or a `)` (`'a'#b`, `$x=#c`,
53
+ * `$(1)#c`), which the scanners read as word text — the over-scan direction,
54
+ * except when such a comment carries text the scanners read as shell syntax
55
+ * (an odd `'` or `"`, a `<#`, a trailing backslash, an unterminated `$(`) on
56
+ * the line before a later positive: those five carriers, each confirmed by
57
+ * execution, are the miss direction. PowerShell's token boundaries are not
58
+ * derivable from a character walk (`$x=#c` is an assignment and a comment at
59
+ * statement position but one argument after a command; `'a'#b` and `x='a'#c`
60
+ * differ only by where the token began), and five successive folds of the
61
+ * PowerShell reading — a pre-pass, its string tracking, its comment rule, then
62
+ * two token-boundary models inside the scanners — each opened a sibling shape
63
+ * (the bot-round record on mmnto-ai/totem#2804), so they stay disclosed rather
64
+ * than modelled. PowerShell
65
+ * here-strings (`@" … "@`, `@' … '@`) are not parsed either — a quote inside
66
+ * one can desynchronize the quote scan for that tool, the miss direction. The
67
+ * MSYS opt-out is honoured through the shell forms that export
68
+ * the variable to the judged program (MSYS reads its presence, any value): the
69
+ * segment's own `VAR=… prog` prefix, an earlier `export` / `declare -x` /
70
+ * `typeset -x`, a bare assignment under `set -a` or followed by `export NAME`,
71
+ * until an `unset` — never as a substring: a comment, a heredoc body or a
72
+ * quoted string that names the cure opts nothing out. Disclosed over-allow: an
73
+ * export inside a subshell `( … )` or a pipeline element is taken as reaching
74
+ * later segments though the shell would not apply it.
75
+ */
76
+ export declare const TRANSPORT_SHIELD_EVENT = "transport-shield";
77
+ /** The module label every verdict cites as its `provenance.source` (never a path). */
78
+ export declare const TRANSPORT_SHIELD_SOURCE = "transport-shield pattern table";
79
+ /** A heredoc body at or above this many bytes WARNs (the banked ~4 KB harness trap). */
80
+ export declare const HEREDOC_OVERSIZE_BYTES = 4096;
81
+ /** `provenance.matched` is bounded to this many characters. */
82
+ export declare const MATCHED_FRAGMENT_MAX = 80;
83
+ export type TransportTool = 'Bash' | 'PowerShell';
84
+ export interface TransportShieldPayload {
85
+ tool: TransportTool;
86
+ command: string;
87
+ /** The host's `process.platform` — REQUIRED so the verdict never reads it in core. */
88
+ platform: string;
89
+ }
90
+ export type TransportPatternId = 'heredoc-escape' | 'heredoc-oversize' | 'msys-body-slash' | 'sed-i-escape' | 'inline-body-escape' | 'msys-rev-path-subshell';
91
+ export interface TransportMatch {
92
+ /** The offending fragment, raw and as written; the evaluator bounds and sanitizes it for provenance. */
93
+ fragment: string;
94
+ /** One clause naming what matched, for the reason text. */
95
+ detail: string;
96
+ }
97
+ export interface TransportPattern {
98
+ id: TransportPatternId;
99
+ disposition: 'deny' | 'warn';
100
+ /** The safe alternative, in the imperative; joined to the detail in the reason. */
101
+ cure: string;
102
+ find(payload: TransportShieldPayload): TransportMatch | null;
103
+ }
104
+ /**
105
+ * Parse an unknown payload into the gate's shape. Throws `GATE_INVALID` on a
106
+ * missing or non-string `command`, a `tool` outside the pair, or a missing
107
+ * `platform` — never default-allows (ADR-109: an unparseable payload is a
108
+ * broken source). The distributed wrapper never sends such a payload: it exits
109
+ * 0 as not-applicable first, so this branch is reachable only by hand.
110
+ */
111
+ export declare function parseTransportShieldPayload(payload: unknown): TransportShieldPayload;
112
+ export interface HeredocSpan {
113
+ /** The delimiter word as written (quotes stripped). */
114
+ delimiter: string;
115
+ /** Whether the delimiter was quoted (`<<'EOF'` / `<<"EOF"`). */
116
+ quoted: boolean;
117
+ /** Whether the operator was `<<-` (bash strips leading TABS from body and terminator lines). */
118
+ stripTabs: boolean;
119
+ /** The body text between the operator line and the terminator line (or the end). */
120
+ body: string;
121
+ /** True when no terminator line was found — the body runs to the end of the command. */
122
+ unterminated: boolean;
123
+ /** Offsets of the body within the command, for blanking. */
124
+ bodyStart: number;
125
+ bodyEnd: number;
126
+ }
127
+ /**
128
+ * What the scanners read beyond bash's grammar. `powershell` (the PowerShell
129
+ * tool): a `<# … #>` block comment outside quotes is skipped whole (inside a
130
+ * `$( … )` too); the backtick is the escape inside a double-quoted string.
131
+ * Everything else — where a `#` begins a comment, what a quote or an `=` does
132
+ * to a token — is read with bash's rules; the shapes where PowerShell's
133
+ * tokenizer differs are disclosed in the module header, not modelled.
134
+ */
135
+ export interface ScanOptions {
136
+ powershell?: boolean;
137
+ }
138
+ /**
139
+ * Locate every heredoc in a command in ONE pass that tracks shell quoting and
140
+ * SKIPS heredoc bodies: an operator inside a quoted argument is text, `<<<` is
141
+ * a here-string, and an apostrophe inside a body never opens a quote (the
142
+ * fold's own regression, mmnto-ai/totem#2799 pass 2). A body starts after the
143
+ * newline that ends the operator's line and runs to the first line that IS the
144
+ * delimiter — an exact line match, as bash reads it (a `EOF ` with trailing
145
+ * space or a CRLF `EOF\r` does not terminate); for `<<-` leading tabs are
146
+ * stripped first — or to the end of the command when no such line exists. An
147
+ * operator with no newline after it yields a body of the remaining text: the
148
+ * conservative reading, so a truncated command still refuses on its escapes.
149
+ * A `#` that begins a word discards the rest of its line without quote
150
+ * processing, as bash does, and `$(( … ))` / `(( … ))` arithmetic is skipped.
151
+ * `parens` records what each open `(` is — a substitution (`$(`, `<(`, `>(`),
152
+ * which is part of a word, or a grouping operator — so the `)` that closes it
153
+ * can say whether the next character begins a word. With `powershell` set the
154
+ * same walk reads PowerShell's grammar where it differs (see `ScanOptions`).
155
+ */
156
+ export declare function findHeredocs(command: string, opts?: ScanOptions): HeredocSpan[];
157
+ export interface ShellSegment {
158
+ /**
159
+ * Tokens with quotes resolved: single-quoted text literal; inside double
160
+ * quotes a backslash escapes only `$`, backtick, `"`, `\` and newline (POSIX)
161
+ * and is otherwise kept; outside quotes a backslash escapes the next character
162
+ * and backslash-newline is a line continuation (dropped).
163
+ */
164
+ tokens: string[];
165
+ /** The raw text of the segment, for newline and substring checks. */
166
+ raw: string;
167
+ }
168
+ /**
169
+ * A minimal POSIX-shell tokenizer: splits a command into segments at control
170
+ * operators (`&&`, `||`, `|`, `;`, a background `&`, newline) and each segment
171
+ * into words with quotes resolved. Good enough to find an option's value and a
172
+ * program name; it does not expand anything. Command substitutions `$( … )`
173
+ * and process substitutions `<( … )` / `>( … )` stay inside the word that
174
+ * carries them; grouping `(` and `)` are operators that delimit words. A `#`
175
+ * that begins a word discards the rest of its line, as bash does — comment
176
+ * text is never an argument. With `powershell` set the same walk reads
177
+ * PowerShell's grammar where it differs (see `ScanOptions`).
178
+ */
179
+ export declare function tokenizeShell(command: string, opts?: ScanOptions): ShellSegment[];
180
+ /**
181
+ * The pattern table, in evaluation order. Deny rows first, warn rows after.
182
+ * Each `find` reads only the payload.
183
+ */
184
+ export declare const TRANSPORT_PATTERNS: ReadonlyArray<TransportPattern>;
185
+ /**
186
+ * The gate: parse the payload (throws on an invalid one), walk the table, and
187
+ * return the first deny, else the first warn, else allow. Pure over the payload.
188
+ */
189
+ export declare const transportShieldEvaluator: GateEvaluator;
190
+ //# sourceMappingURL=transport-shield.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-shield.d.ts","sourceRoot":"","sources":["../src/transport-shield.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,iBAAiB,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AAEH,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,mCAAmC,CAAC;AAExE,wFAAwF;AACxF,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,CAAC;AAElD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,kBAAkB,GAC1B,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,oBAAoB,GACpB,wBAAwB,CAAC;AAE7B,MAAM,WAAW,cAAc;IAC7B,wGAAwG;IACxG,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,kBAAkB,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,OAAO,EAAE,sBAAsB,GAAG,cAAc,GAAG,IAAI,CAAC;CAC9D;AAID;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,sBAAsB,CA6BpF;AAID,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAC;IAChB,gGAAgG;IAChG,SAAS,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,wFAAwF;IACxF,YAAY,EAAE,OAAO,CAAC;IACtB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAkDD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,WAAW,EAAE,CA8JnF;AAwDD,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;CACb;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,YAAY,EAAE,CAwIrF;AA8QD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,gBAAgB,CAuK7D,CAAC;AAeH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAsCtC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=transport-shield.fold.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport-shield.fold.test.d.ts","sourceRoot":"","sources":["../src/transport-shield.fold.test.ts"],"names":[],"mappings":""}