@usefragments/core 1.8.0 → 1.9.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.
@@ -1,5 +1,5 @@
1
1
  import { Severity } from '../severity.js';
2
- import { n as Violation, F as Finding } from '../index-Cxk3SOQP.js';
2
+ import { n as Violation, F as Finding } from '../index-DtHxs0Pf.js';
3
3
  import 'zod';
4
4
 
5
5
  declare const EXPLAIN_URL_BASE = "https://usefragments.com/errors/";
@@ -6,7 +6,7 @@ import {
6
6
  byCode,
7
7
  byRuleId,
8
8
  explainUrlForCode
9
- } from "../chunk-UUREQ4HD.js";
9
+ } from "../chunk-DGHZQTLH.js";
10
10
  import "../chunk-JNBFJ34I.js";
11
11
  import "../chunk-EIYNNS77.js";
12
12
  import "../chunk-V4VQB57N.js";
@@ -247,6 +247,12 @@ declare const findingSchema: z.ZodObject<{
247
247
  helpUrl: z.ZodOptional<z.ZodString>;
248
248
  message: z.ZodString;
249
249
  fingerprint: z.ZodString;
250
+ /**
251
+ * Fingerprint this finding carried before a fingerprint-identity migration.
252
+ * Emitted only by migrated rules during the grace window so baseline
253
+ * records keyed on the legacy hash keep matching instead of churning.
254
+ */
255
+ previousFingerprint: z.ZodOptional<z.ZodString>;
250
256
  location: z.ZodObject<{
251
257
  file: z.ZodString;
252
258
  line: z.ZodNumber;
@@ -442,6 +448,7 @@ declare const findingSchema: z.ZodObject<{
442
448
  matchedGlob: string;
443
449
  } | undefined;
444
450
  helpUrl?: string | undefined;
451
+ previousFingerprint?: string | undefined;
445
452
  evidenceGrade?: EvidenceGrade | undefined;
446
453
  attributes?: Record<string, unknown> | undefined;
447
454
  }, {
@@ -500,6 +507,7 @@ declare const findingSchema: z.ZodObject<{
500
507
  matchedGlob: string;
501
508
  } | undefined;
502
509
  helpUrl?: string | undefined;
510
+ previousFingerprint?: string | undefined;
503
511
  evidenceGrade?: EvidenceGrade | undefined;
504
512
  attributes?: Record<string, unknown> | undefined;
505
513
  }>;
@@ -642,6 +650,12 @@ declare const validatorResultSchema: z.ZodObject<{
642
650
  helpUrl: z.ZodOptional<z.ZodString>;
643
651
  message: z.ZodString;
644
652
  fingerprint: z.ZodString;
653
+ /**
654
+ * Fingerprint this finding carried before a fingerprint-identity migration.
655
+ * Emitted only by migrated rules during the grace window so baseline
656
+ * records keyed on the legacy hash keep matching instead of churning.
657
+ */
658
+ previousFingerprint: z.ZodOptional<z.ZodString>;
645
659
  location: z.ZodObject<{
646
660
  file: z.ZodString;
647
661
  line: z.ZodNumber;
@@ -837,6 +851,7 @@ declare const validatorResultSchema: z.ZodObject<{
837
851
  matchedGlob: string;
838
852
  } | undefined;
839
853
  helpUrl?: string | undefined;
854
+ previousFingerprint?: string | undefined;
840
855
  evidenceGrade?: EvidenceGrade | undefined;
841
856
  attributes?: Record<string, unknown> | undefined;
842
857
  }, {
@@ -895,6 +910,7 @@ declare const validatorResultSchema: z.ZodObject<{
895
910
  matchedGlob: string;
896
911
  } | undefined;
897
912
  helpUrl?: string | undefined;
913
+ previousFingerprint?: string | undefined;
898
914
  evidenceGrade?: EvidenceGrade | undefined;
899
915
  attributes?: Record<string, unknown> | undefined;
900
916
  }>, "many">>;
@@ -995,6 +1011,7 @@ declare const validatorResultSchema: z.ZodObject<{
995
1011
  matchedGlob: string;
996
1012
  } | undefined;
997
1013
  helpUrl?: string | undefined;
1014
+ previousFingerprint?: string | undefined;
998
1015
  evidenceGrade?: EvidenceGrade | undefined;
999
1016
  attributes?: Record<string, unknown> | undefined;
1000
1017
  }[] | undefined;
@@ -1083,6 +1100,7 @@ declare const validatorResultSchema: z.ZodObject<{
1083
1100
  matchedGlob: string;
1084
1101
  } | undefined;
1085
1102
  helpUrl?: string | undefined;
1103
+ previousFingerprint?: string | undefined;
1086
1104
  evidenceGrade?: EvidenceGrade | undefined;
1087
1105
  attributes?: Record<string, unknown> | undefined;
1088
1106
  }[] | undefined;
@@ -1184,6 +1202,12 @@ declare const governanceVerdictSchema: z.ZodObject<{
1184
1202
  helpUrl: z.ZodOptional<z.ZodString>;
1185
1203
  message: z.ZodString;
1186
1204
  fingerprint: z.ZodString;
1205
+ /**
1206
+ * Fingerprint this finding carried before a fingerprint-identity migration.
1207
+ * Emitted only by migrated rules during the grace window so baseline
1208
+ * records keyed on the legacy hash keep matching instead of churning.
1209
+ */
1210
+ previousFingerprint: z.ZodOptional<z.ZodString>;
1187
1211
  location: z.ZodObject<{
1188
1212
  file: z.ZodString;
1189
1213
  line: z.ZodNumber;
@@ -1379,6 +1403,7 @@ declare const governanceVerdictSchema: z.ZodObject<{
1379
1403
  matchedGlob: string;
1380
1404
  } | undefined;
1381
1405
  helpUrl?: string | undefined;
1406
+ previousFingerprint?: string | undefined;
1382
1407
  evidenceGrade?: EvidenceGrade | undefined;
1383
1408
  attributes?: Record<string, unknown> | undefined;
1384
1409
  }, {
@@ -1437,6 +1462,7 @@ declare const governanceVerdictSchema: z.ZodObject<{
1437
1462
  matchedGlob: string;
1438
1463
  } | undefined;
1439
1464
  helpUrl?: string | undefined;
1465
+ previousFingerprint?: string | undefined;
1440
1466
  evidenceGrade?: EvidenceGrade | undefined;
1441
1467
  attributes?: Record<string, unknown> | undefined;
1442
1468
  }>, "many">>;
@@ -1537,6 +1563,7 @@ declare const governanceVerdictSchema: z.ZodObject<{
1537
1563
  matchedGlob: string;
1538
1564
  } | undefined;
1539
1565
  helpUrl?: string | undefined;
1566
+ previousFingerprint?: string | undefined;
1540
1567
  evidenceGrade?: EvidenceGrade | undefined;
1541
1568
  attributes?: Record<string, unknown> | undefined;
1542
1569
  }[] | undefined;
@@ -1625,6 +1652,7 @@ declare const governanceVerdictSchema: z.ZodObject<{
1625
1652
  matchedGlob: string;
1626
1653
  } | undefined;
1627
1654
  helpUrl?: string | undefined;
1655
+ previousFingerprint?: string | undefined;
1628
1656
  evidenceGrade?: EvidenceGrade | undefined;
1629
1657
  attributes?: Record<string, unknown> | undefined;
1630
1658
  }[] | undefined;
@@ -1743,6 +1771,7 @@ declare const governanceVerdictSchema: z.ZodObject<{
1743
1771
  matchedGlob: string;
1744
1772
  } | undefined;
1745
1773
  helpUrl?: string | undefined;
1774
+ previousFingerprint?: string | undefined;
1746
1775
  evidenceGrade?: EvidenceGrade | undefined;
1747
1776
  attributes?: Record<string, unknown> | undefined;
1748
1777
  }[] | undefined;
@@ -1843,6 +1872,7 @@ declare const governanceVerdictSchema: z.ZodObject<{
1843
1872
  matchedGlob: string;
1844
1873
  } | undefined;
1845
1874
  helpUrl?: string | undefined;
1875
+ previousFingerprint?: string | undefined;
1846
1876
  evidenceGrade?: EvidenceGrade | undefined;
1847
1877
  attributes?: Record<string, unknown> | undefined;
1848
1878
  }[] | undefined;
@@ -2122,6 +2152,12 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2122
2152
  helpUrl: z.ZodOptional<z.ZodString>;
2123
2153
  message: z.ZodString;
2124
2154
  fingerprint: z.ZodString;
2155
+ /**
2156
+ * Fingerprint this finding carried before a fingerprint-identity migration.
2157
+ * Emitted only by migrated rules during the grace window so baseline
2158
+ * records keyed on the legacy hash keep matching instead of churning.
2159
+ */
2160
+ previousFingerprint: z.ZodOptional<z.ZodString>;
2125
2161
  location: z.ZodObject<{
2126
2162
  file: z.ZodString;
2127
2163
  line: z.ZodNumber;
@@ -2317,6 +2353,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2317
2353
  matchedGlob: string;
2318
2354
  } | undefined;
2319
2355
  helpUrl?: string | undefined;
2356
+ previousFingerprint?: string | undefined;
2320
2357
  evidenceGrade?: EvidenceGrade | undefined;
2321
2358
  attributes?: Record<string, unknown> | undefined;
2322
2359
  }, {
@@ -2375,6 +2412,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2375
2412
  matchedGlob: string;
2376
2413
  } | undefined;
2377
2414
  helpUrl?: string | undefined;
2415
+ previousFingerprint?: string | undefined;
2378
2416
  evidenceGrade?: EvidenceGrade | undefined;
2379
2417
  attributes?: Record<string, unknown> | undefined;
2380
2418
  }>, "many">>;
@@ -2607,6 +2645,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2607
2645
  matchedGlob: string;
2608
2646
  } | undefined;
2609
2647
  helpUrl?: string | undefined;
2648
+ previousFingerprint?: string | undefined;
2610
2649
  evidenceGrade?: EvidenceGrade | undefined;
2611
2650
  attributes?: Record<string, unknown> | undefined;
2612
2651
  }[] | undefined;
@@ -2750,6 +2789,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2750
2789
  matchedGlob: string;
2751
2790
  } | undefined;
2752
2791
  helpUrl?: string | undefined;
2792
+ previousFingerprint?: string | undefined;
2753
2793
  evidenceGrade?: EvidenceGrade | undefined;
2754
2794
  attributes?: Record<string, unknown> | undefined;
2755
2795
  }[] | undefined;
@@ -2919,6 +2959,12 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
2919
2959
  helpUrl: z.ZodOptional<z.ZodString>;
2920
2960
  message: z.ZodString;
2921
2961
  fingerprint: z.ZodString;
2962
+ /**
2963
+ * Fingerprint this finding carried before a fingerprint-identity migration.
2964
+ * Emitted only by migrated rules during the grace window so baseline
2965
+ * records keyed on the legacy hash keep matching instead of churning.
2966
+ */
2967
+ previousFingerprint: z.ZodOptional<z.ZodString>;
2922
2968
  location: z.ZodObject<{
2923
2969
  file: z.ZodString;
2924
2970
  line: z.ZodNumber;
@@ -3114,6 +3160,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3114
3160
  matchedGlob: string;
3115
3161
  } | undefined;
3116
3162
  helpUrl?: string | undefined;
3163
+ previousFingerprint?: string | undefined;
3117
3164
  evidenceGrade?: EvidenceGrade | undefined;
3118
3165
  attributes?: Record<string, unknown> | undefined;
3119
3166
  }, {
@@ -3172,6 +3219,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3172
3219
  matchedGlob: string;
3173
3220
  } | undefined;
3174
3221
  helpUrl?: string | undefined;
3222
+ previousFingerprint?: string | undefined;
3175
3223
  evidenceGrade?: EvidenceGrade | undefined;
3176
3224
  attributes?: Record<string, unknown> | undefined;
3177
3225
  }>, "many">>;
@@ -3404,6 +3452,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3404
3452
  matchedGlob: string;
3405
3453
  } | undefined;
3406
3454
  helpUrl?: string | undefined;
3455
+ previousFingerprint?: string | undefined;
3407
3456
  evidenceGrade?: EvidenceGrade | undefined;
3408
3457
  attributes?: Record<string, unknown> | undefined;
3409
3458
  }[] | undefined;
@@ -3547,6 +3596,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3547
3596
  matchedGlob: string;
3548
3597
  } | undefined;
3549
3598
  helpUrl?: string | undefined;
3599
+ previousFingerprint?: string | undefined;
3550
3600
  evidenceGrade?: EvidenceGrade | undefined;
3551
3601
  attributes?: Record<string, unknown> | undefined;
3552
3602
  }[] | undefined;
@@ -3716,6 +3766,12 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3716
3766
  helpUrl: z.ZodOptional<z.ZodString>;
3717
3767
  message: z.ZodString;
3718
3768
  fingerprint: z.ZodString;
3769
+ /**
3770
+ * Fingerprint this finding carried before a fingerprint-identity migration.
3771
+ * Emitted only by migrated rules during the grace window so baseline
3772
+ * records keyed on the legacy hash keep matching instead of churning.
3773
+ */
3774
+ previousFingerprint: z.ZodOptional<z.ZodString>;
3719
3775
  location: z.ZodObject<{
3720
3776
  file: z.ZodString;
3721
3777
  line: z.ZodNumber;
@@ -3911,6 +3967,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3911
3967
  matchedGlob: string;
3912
3968
  } | undefined;
3913
3969
  helpUrl?: string | undefined;
3970
+ previousFingerprint?: string | undefined;
3914
3971
  evidenceGrade?: EvidenceGrade | undefined;
3915
3972
  attributes?: Record<string, unknown> | undefined;
3916
3973
  }, {
@@ -3969,6 +4026,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
3969
4026
  matchedGlob: string;
3970
4027
  } | undefined;
3971
4028
  helpUrl?: string | undefined;
4029
+ previousFingerprint?: string | undefined;
3972
4030
  evidenceGrade?: EvidenceGrade | undefined;
3973
4031
  attributes?: Record<string, unknown> | undefined;
3974
4032
  }>, "many">>;
@@ -4215,6 +4273,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
4215
4273
  matchedGlob: string;
4216
4274
  } | undefined;
4217
4275
  helpUrl?: string | undefined;
4276
+ previousFingerprint?: string | undefined;
4218
4277
  evidenceGrade?: EvidenceGrade | undefined;
4219
4278
  attributes?: Record<string, unknown> | undefined;
4220
4279
  }[] | undefined;
@@ -4358,6 +4417,7 @@ declare const agentFormatSchema: z.ZodUnion<[z.ZodObject<{
4358
4417
  matchedGlob: string;
4359
4418
  } | undefined;
4360
4419
  helpUrl?: string | undefined;
4420
+ previousFingerprint?: string | undefined;
4361
4421
  evidenceGrade?: EvidenceGrade | undefined;
4362
4422
  attributes?: Record<string, unknown> | undefined;
4363
4423
  }[] | undefined;
@@ -4643,6 +4703,12 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
4643
4703
  helpUrl: z.ZodOptional<z.ZodString>;
4644
4704
  message: z.ZodString;
4645
4705
  fingerprint: z.ZodString;
4706
+ /**
4707
+ * Fingerprint this finding carried before a fingerprint-identity migration.
4708
+ * Emitted only by migrated rules during the grace window so baseline
4709
+ * records keyed on the legacy hash keep matching instead of churning.
4710
+ */
4711
+ previousFingerprint: z.ZodOptional<z.ZodString>;
4646
4712
  location: z.ZodObject<{
4647
4713
  file: z.ZodString;
4648
4714
  line: z.ZodNumber;
@@ -4838,6 +4904,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
4838
4904
  matchedGlob: string;
4839
4905
  } | undefined;
4840
4906
  helpUrl?: string | undefined;
4907
+ previousFingerprint?: string | undefined;
4841
4908
  evidenceGrade?: EvidenceGrade | undefined;
4842
4909
  attributes?: Record<string, unknown> | undefined;
4843
4910
  }, {
@@ -4896,6 +4963,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
4896
4963
  matchedGlob: string;
4897
4964
  } | undefined;
4898
4965
  helpUrl?: string | undefined;
4966
+ previousFingerprint?: string | undefined;
4899
4967
  evidenceGrade?: EvidenceGrade | undefined;
4900
4968
  attributes?: Record<string, unknown> | undefined;
4901
4969
  }>, "many">>;
@@ -5128,6 +5196,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5128
5196
  matchedGlob: string;
5129
5197
  } | undefined;
5130
5198
  helpUrl?: string | undefined;
5199
+ previousFingerprint?: string | undefined;
5131
5200
  evidenceGrade?: EvidenceGrade | undefined;
5132
5201
  attributes?: Record<string, unknown> | undefined;
5133
5202
  }[] | undefined;
@@ -5271,6 +5340,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5271
5340
  matchedGlob: string;
5272
5341
  } | undefined;
5273
5342
  helpUrl?: string | undefined;
5343
+ previousFingerprint?: string | undefined;
5274
5344
  evidenceGrade?: EvidenceGrade | undefined;
5275
5345
  attributes?: Record<string, unknown> | undefined;
5276
5346
  }[] | undefined;
@@ -5440,6 +5510,12 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5440
5510
  helpUrl: z.ZodOptional<z.ZodString>;
5441
5511
  message: z.ZodString;
5442
5512
  fingerprint: z.ZodString;
5513
+ /**
5514
+ * Fingerprint this finding carried before a fingerprint-identity migration.
5515
+ * Emitted only by migrated rules during the grace window so baseline
5516
+ * records keyed on the legacy hash keep matching instead of churning.
5517
+ */
5518
+ previousFingerprint: z.ZodOptional<z.ZodString>;
5443
5519
  location: z.ZodObject<{
5444
5520
  file: z.ZodString;
5445
5521
  line: z.ZodNumber;
@@ -5635,6 +5711,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5635
5711
  matchedGlob: string;
5636
5712
  } | undefined;
5637
5713
  helpUrl?: string | undefined;
5714
+ previousFingerprint?: string | undefined;
5638
5715
  evidenceGrade?: EvidenceGrade | undefined;
5639
5716
  attributes?: Record<string, unknown> | undefined;
5640
5717
  }, {
@@ -5693,6 +5770,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5693
5770
  matchedGlob: string;
5694
5771
  } | undefined;
5695
5772
  helpUrl?: string | undefined;
5773
+ previousFingerprint?: string | undefined;
5696
5774
  evidenceGrade?: EvidenceGrade | undefined;
5697
5775
  attributes?: Record<string, unknown> | undefined;
5698
5776
  }>, "many">>;
@@ -5925,6 +6003,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
5925
6003
  matchedGlob: string;
5926
6004
  } | undefined;
5927
6005
  helpUrl?: string | undefined;
6006
+ previousFingerprint?: string | undefined;
5928
6007
  evidenceGrade?: EvidenceGrade | undefined;
5929
6008
  attributes?: Record<string, unknown> | undefined;
5930
6009
  }[] | undefined;
@@ -6068,6 +6147,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6068
6147
  matchedGlob: string;
6069
6148
  } | undefined;
6070
6149
  helpUrl?: string | undefined;
6150
+ previousFingerprint?: string | undefined;
6071
6151
  evidenceGrade?: EvidenceGrade | undefined;
6072
6152
  attributes?: Record<string, unknown> | undefined;
6073
6153
  }[] | undefined;
@@ -6237,6 +6317,12 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6237
6317
  helpUrl: z.ZodOptional<z.ZodString>;
6238
6318
  message: z.ZodString;
6239
6319
  fingerprint: z.ZodString;
6320
+ /**
6321
+ * Fingerprint this finding carried before a fingerprint-identity migration.
6322
+ * Emitted only by migrated rules during the grace window so baseline
6323
+ * records keyed on the legacy hash keep matching instead of churning.
6324
+ */
6325
+ previousFingerprint: z.ZodOptional<z.ZodString>;
6240
6326
  location: z.ZodObject<{
6241
6327
  file: z.ZodString;
6242
6328
  line: z.ZodNumber;
@@ -6432,6 +6518,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6432
6518
  matchedGlob: string;
6433
6519
  } | undefined;
6434
6520
  helpUrl?: string | undefined;
6521
+ previousFingerprint?: string | undefined;
6435
6522
  evidenceGrade?: EvidenceGrade | undefined;
6436
6523
  attributes?: Record<string, unknown> | undefined;
6437
6524
  }, {
@@ -6490,6 +6577,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6490
6577
  matchedGlob: string;
6491
6578
  } | undefined;
6492
6579
  helpUrl?: string | undefined;
6580
+ previousFingerprint?: string | undefined;
6493
6581
  evidenceGrade?: EvidenceGrade | undefined;
6494
6582
  attributes?: Record<string, unknown> | undefined;
6495
6583
  }>, "many">>;
@@ -6736,6 +6824,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6736
6824
  matchedGlob: string;
6737
6825
  } | undefined;
6738
6826
  helpUrl?: string | undefined;
6827
+ previousFingerprint?: string | undefined;
6739
6828
  evidenceGrade?: EvidenceGrade | undefined;
6740
6829
  attributes?: Record<string, unknown> | undefined;
6741
6830
  }[] | undefined;
@@ -6879,6 +6968,7 @@ declare const agentOutputSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
6879
6968
  matchedGlob: string;
6880
6969
  } | undefined;
6881
6970
  helpUrl?: string | undefined;
6971
+ previousFingerprint?: string | undefined;
6882
6972
  evidenceGrade?: EvidenceGrade | undefined;
6883
6973
  attributes?: Record<string, unknown> | undefined;
6884
6974
  }[] | undefined;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { GOVERNANCE_TELEMETRY_FIELDS, GOVERNANCE_TELEMETRY_SOURCE_DISCLOSURE, GOVERNANCE_TELEMETRY_TOP_LEVEL_FIELDS, GovernanceTelemetryCarriage, GovernanceTelemetryField, GovernanceTelemetryTopLevelField } from './governance-telemetry.js';
2
- import { F as Finding, A as AgentFormat, E as EvidenceGrade, a as FindingFix } from './index-Cxk3SOQP.js';
3
- export { b as AGENT_FORMAT_SCHEMA_VERSION, c as AgentErrorEnvelope, d as AgentOutput, G as CanonicalGovernanceVerdict, e as EVIDENCE_ORDER, f as FindingReplaceClassTokenFix, g as FindingReplaceComponentFix, h as FindingReplaceImportFix, i as FindingReplacePropValueFix, j as FindingReplaceStyleValueFix, k as Fix, l as GovernanceVerdictMetadata, I as InspectClaim, m as InspectClaimTier, S as SuppressionDirective, V as ValidatorResult, n as Violation, o as agentErrorEnvelopeSchema, p as agentFormatSchema, q as agentIntegritySchema, r as agentOutputSchema, s as canBlock, t as factEvidenceSchema, u as factLocationSchema, v as findingFixSchema, w as findingReplaceClassTokenFixSchema, x as findingReplaceComponentFixSchema, y as findingReplaceImportFixSchema, z as findingReplacePropValueFixSchema, B as findingReplaceStyleValueFixSchema, C as findingSchema, D as fixSchema, H as governanceVerdictMetadataSchema, J as governanceVerdictSchema, K as normalizeFinding, L as normalizeSeverity, M as normalizeViolation, N as suppressionDirectiveSchema, O as validatorResultSchema, P as violationSchema } from './index-Cxk3SOQP.js';
2
+ import { F as Finding, A as AgentFormat, E as EvidenceGrade, a as FindingFix } from './index-DtHxs0Pf.js';
3
+ export { b as AGENT_FORMAT_SCHEMA_VERSION, c as AgentErrorEnvelope, d as AgentOutput, G as CanonicalGovernanceVerdict, e as EVIDENCE_ORDER, f as FindingReplaceClassTokenFix, g as FindingReplaceComponentFix, h as FindingReplaceImportFix, i as FindingReplacePropValueFix, j as FindingReplaceStyleValueFix, k as Fix, l as GovernanceVerdictMetadata, I as InspectClaim, m as InspectClaimTier, S as SuppressionDirective, V as ValidatorResult, n as Violation, o as agentErrorEnvelopeSchema, p as agentFormatSchema, q as agentIntegritySchema, r as agentOutputSchema, s as canBlock, t as factEvidenceSchema, u as factLocationSchema, v as findingFixSchema, w as findingReplaceClassTokenFixSchema, x as findingReplaceComponentFixSchema, y as findingReplaceImportFixSchema, z as findingReplacePropValueFixSchema, B as findingReplaceStyleValueFixSchema, C as findingSchema, D as fixSchema, H as governanceVerdictMetadataSchema, J as governanceVerdictSchema, K as normalizeFinding, L as normalizeSeverity, M as normalizeViolation, N as suppressionDirectiveSchema, O as validatorResultSchema, P as violationSchema } from './index-DtHxs0Pf.js';
4
4
  import { Severity } from './severity.js';
5
5
  export { SEVERITIES, SEVERITY_RANK, SEVERITY_WEIGHTS, SeverityLevel, compareSeverity, maxSeverity, severityLevel, severitySchema, sortBySeverity } from './severity.js';
6
6
  export { BridgeViolationInput, CODES, CodeCategory, CodeLifecycle, EXPLAIN_URL_BASE, FuiCode, bridgeSourceViolation, bridgeSourceViolations, byCode, byRuleId, explainUrlForCode } from './codes/index.js';
@@ -11682,6 +11682,14 @@ interface MakeFindingInput {
11682
11682
  evidence: FactEvidence[];
11683
11683
  evidenceGrade?: EvidenceGrade;
11684
11684
  fingerprintIdentity: Record<string, unknown>;
11685
+ /**
11686
+ * Legacy identity tuple from before a fingerprint migration. When present,
11687
+ * the finding also carries `previousFingerprint` (the legacy hash) so
11688
+ * baseline classification can match records keyed on the old hash during
11689
+ * the grace window. Position keys are permitted here — legacy identities
11690
+ * are reproduced verbatim, contract violations included.
11691
+ */
11692
+ previousFingerprintIdentity?: Record<string, unknown>;
11685
11693
  fix?: FindingFix;
11686
11694
  attributes?: Record<string, unknown>;
11687
11695
  }
package/dist/index.js CHANGED
@@ -159,7 +159,7 @@ import {
159
159
  suppressionDirectiveSchema,
160
160
  validatorResultSchema,
161
161
  violationSchema
162
- } from "./chunk-UUREQ4HD.js";
162
+ } from "./chunk-DGHZQTLH.js";
163
163
  import {
164
164
  OWNED_PACKAGE_IDENTITY_EPOCH,
165
165
  OWNED_PACKAGE_IDENTITY_SOURCE_SHA256,
@@ -4682,13 +4682,21 @@ function isAriaHidden(props) {
4682
4682
  }
4683
4683
 
4684
4684
  // src/rules/finding.ts
4685
+ var POSITION_IDENTITY_KEYS = ["line", "column", "endLine", "endColumn", "offset", "location"];
4685
4686
  function makeFinding(input) {
4686
4687
  if (input.evidence.length === 0) {
4687
4688
  throw new Error(`makeFinding(${input.ruleId}): findings must carry at least one evidence fact`);
4688
4689
  }
4690
+ const positionKeys = POSITION_IDENTITY_KEYS.filter((key) => key in input.fingerprintIdentity);
4691
+ if (positionKeys.length > 0) {
4692
+ throw new Error(
4693
+ `makeFinding(${input.ruleId}): fingerprintIdentity must not contain position keys (${positionKeys.join(", ")}) \u2014 fingerprints hash what's wrong, never where it sits. Use a source-order occurrence index for repeats of the same identity.`
4694
+ );
4695
+ }
4689
4696
  const fingerprint = hash64Hex(
4690
4697
  canonicalJson({ ruleId: input.ruleId, ...input.fingerprintIdentity })
4691
4698
  );
4699
+ const previousFingerprint = input.previousFingerprintIdentity ? hash64Hex(canonicalJson({ ruleId: input.ruleId, ...input.previousFingerprintIdentity })) : void 0;
4692
4700
  const code = byRuleId.get(input.ruleId);
4693
4701
  return normalizeFinding({
4694
4702
  ruleId: input.ruleId,
@@ -4698,6 +4706,7 @@ function makeFinding(input) {
4698
4706
  helpUrl: code?.explainUrl,
4699
4707
  message: input.message,
4700
4708
  fingerprint,
4709
+ ...previousFingerprint !== void 0 ? { previousFingerprint } : {},
4701
4710
  location: input.location,
4702
4711
  evidence: input.evidence,
4703
4712
  evidenceGrade: input.evidenceGrade ?? "source_backed",
@@ -6746,6 +6755,7 @@ function ruleJsxPreferredImportPath(ix) {
6746
6755
  if (policies.length === 0) return [];
6747
6756
  const findings = [];
6748
6757
  const seen = /* @__PURE__ */ new Set();
6758
+ const occurrences = /* @__PURE__ */ new Map();
6749
6759
  for (const usage of ix.byKind("usage_import")) {
6750
6760
  const bridgeGoverned = policies.some((policy) => bridgeGovernsUnderlyingImport(policy, usage));
6751
6761
  const matches = policies.filter((policy) => {
@@ -6766,6 +6776,9 @@ function ruleJsxPreferredImportPath(ix) {
6766
6776
  const key = `${policy.id}\0${usage.file}\0${usage.source}\0${usage.location.line}\0${usage.location.column}\0${importedIdentity}`;
6767
6777
  if (seen.has(key)) continue;
6768
6778
  seen.add(key);
6779
+ const identityKey = `${usage.file}\0${usage.source}\0${policy.to}\0${importedIdentity}`;
6780
+ const occurrence = occurrences.get(identityKey) ?? 0;
6781
+ occurrences.set(identityKey, occurrence + 1);
6769
6782
  findings.push(
6770
6783
  makeFinding({
6771
6784
  ruleId: RULE_ID8,
@@ -6775,6 +6788,15 @@ function ruleJsxPreferredImportPath(ix) {
6775
6788
  location: usage.location,
6776
6789
  evidence: ix.evidence([usage.id, policy.id]),
6777
6790
  fingerprintIdentity: {
6791
+ file: usage.file,
6792
+ from: usage.source,
6793
+ to: policy.to,
6794
+ imported: policy.imported,
6795
+ occurrence
6796
+ },
6797
+ // Grace window (baseline v1 → v2): the pre-migration hash keyed on
6798
+ // line/column. Drop with the v1 dual-match after one release.
6799
+ previousFingerprintIdentity: {
6778
6800
  file: usage.file,
6779
6801
  from: usage.source,
6780
6802
  to: policy.to,