@rigour-labs/core 2.21.2 → 2.22.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.
@@ -21,8 +21,8 @@ export declare const FixPacketV2Schema: z.ZodObject<{
21
21
  id: string;
22
22
  title: string;
23
23
  details: string;
24
- gate: string;
25
24
  severity: "critical" | "high" | "medium" | "low";
25
+ gate: string;
26
26
  files?: string[] | undefined;
27
27
  hint?: string | undefined;
28
28
  category?: string | undefined;
@@ -33,10 +33,10 @@ export declare const FixPacketV2Schema: z.ZodObject<{
33
33
  title: string;
34
34
  details: string;
35
35
  gate: string;
36
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
36
37
  files?: string[] | undefined;
37
38
  hint?: string | undefined;
38
39
  category?: string | undefined;
39
- severity?: "critical" | "high" | "medium" | "low" | undefined;
40
40
  instructions?: string[] | undefined;
41
41
  metrics?: Record<string, any> | undefined;
42
42
  }>, "many">;
@@ -69,8 +69,8 @@ export declare const FixPacketV2Schema: z.ZodObject<{
69
69
  id: string;
70
70
  title: string;
71
71
  details: string;
72
- gate: string;
73
72
  severity: "critical" | "high" | "medium" | "low";
73
+ gate: string;
74
74
  files?: string[] | undefined;
75
75
  hint?: string | undefined;
76
76
  category?: string | undefined;
@@ -92,10 +92,10 @@ export declare const FixPacketV2Schema: z.ZodObject<{
92
92
  title: string;
93
93
  details: string;
94
94
  gate: string;
95
+ severity?: "critical" | "high" | "medium" | "low" | undefined;
95
96
  files?: string[] | undefined;
96
97
  hint?: string | undefined;
97
98
  category?: string | undefined;
98
- severity?: "critical" | "high" | "medium" | "low" | undefined;
99
99
  instructions?: string[] | undefined;
100
100
  metrics?: Record<string, any> | undefined;
101
101
  }[];
@@ -232,6 +232,67 @@ export declare const GatesSchema: z.ZodObject<{
232
232
  auto_detect_tier?: boolean | undefined;
233
233
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
234
234
  }>>>;
235
+ duplication_drift: z.ZodDefault<z.ZodOptional<z.ZodObject<{
236
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
237
+ similarity_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
238
+ min_body_lines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
239
+ }, "strip", z.ZodTypeAny, {
240
+ enabled: boolean;
241
+ similarity_threshold: number;
242
+ min_body_lines: number;
243
+ }, {
244
+ enabled?: boolean | undefined;
245
+ similarity_threshold?: number | undefined;
246
+ min_body_lines?: number | undefined;
247
+ }>>>;
248
+ hallucinated_imports: z.ZodDefault<z.ZodOptional<z.ZodObject<{
249
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
250
+ check_relative: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
251
+ check_packages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
252
+ ignore_patterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
253
+ }, "strip", z.ZodTypeAny, {
254
+ enabled: boolean;
255
+ check_relative: boolean;
256
+ check_packages: boolean;
257
+ ignore_patterns: string[];
258
+ }, {
259
+ enabled?: boolean | undefined;
260
+ check_relative?: boolean | undefined;
261
+ check_packages?: boolean | undefined;
262
+ ignore_patterns?: string[] | undefined;
263
+ }>>>;
264
+ inconsistent_error_handling: z.ZodDefault<z.ZodOptional<z.ZodObject<{
265
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
266
+ max_strategies_per_type: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
267
+ min_occurrences: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
268
+ ignore_empty_catches: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
269
+ }, "strip", z.ZodTypeAny, {
270
+ enabled: boolean;
271
+ max_strategies_per_type: number;
272
+ min_occurrences: number;
273
+ ignore_empty_catches: boolean;
274
+ }, {
275
+ enabled?: boolean | undefined;
276
+ max_strategies_per_type?: number | undefined;
277
+ min_occurrences?: number | undefined;
278
+ ignore_empty_catches?: boolean | undefined;
279
+ }>>>;
280
+ context_window_artifacts: z.ZodDefault<z.ZodOptional<z.ZodObject<{
281
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
282
+ min_file_lines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
283
+ degradation_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
284
+ signals_required: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
285
+ }, "strip", z.ZodTypeAny, {
286
+ enabled: boolean;
287
+ min_file_lines: number;
288
+ degradation_threshold: number;
289
+ signals_required: number;
290
+ }, {
291
+ enabled?: boolean | undefined;
292
+ min_file_lines?: number | undefined;
293
+ degradation_threshold?: number | undefined;
294
+ signals_required?: number | undefined;
295
+ }>>>;
235
296
  }, "strip", z.ZodTypeAny, {
236
297
  max_file_lines: number;
237
298
  forbid_todos: boolean;
@@ -319,6 +380,29 @@ export declare const GatesSchema: z.ZodObject<{
319
380
  auto_detect_tier: boolean;
320
381
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
321
382
  };
383
+ duplication_drift: {
384
+ enabled: boolean;
385
+ similarity_threshold: number;
386
+ min_body_lines: number;
387
+ };
388
+ hallucinated_imports: {
389
+ enabled: boolean;
390
+ check_relative: boolean;
391
+ check_packages: boolean;
392
+ ignore_patterns: string[];
393
+ };
394
+ inconsistent_error_handling: {
395
+ enabled: boolean;
396
+ max_strategies_per_type: number;
397
+ min_occurrences: number;
398
+ ignore_empty_catches: boolean;
399
+ };
400
+ context_window_artifacts: {
401
+ enabled: boolean;
402
+ min_file_lines: number;
403
+ degradation_threshold: number;
404
+ signals_required: number;
405
+ };
322
406
  }, {
323
407
  max_file_lines?: number | undefined;
324
408
  forbid_todos?: boolean | undefined;
@@ -406,6 +490,29 @@ export declare const GatesSchema: z.ZodObject<{
406
490
  auto_detect_tier?: boolean | undefined;
407
491
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
408
492
  } | undefined;
493
+ duplication_drift?: {
494
+ enabled?: boolean | undefined;
495
+ similarity_threshold?: number | undefined;
496
+ min_body_lines?: number | undefined;
497
+ } | undefined;
498
+ hallucinated_imports?: {
499
+ enabled?: boolean | undefined;
500
+ check_relative?: boolean | undefined;
501
+ check_packages?: boolean | undefined;
502
+ ignore_patterns?: string[] | undefined;
503
+ } | undefined;
504
+ inconsistent_error_handling?: {
505
+ enabled?: boolean | undefined;
506
+ max_strategies_per_type?: number | undefined;
507
+ min_occurrences?: number | undefined;
508
+ ignore_empty_catches?: boolean | undefined;
509
+ } | undefined;
510
+ context_window_artifacts?: {
511
+ enabled?: boolean | undefined;
512
+ min_file_lines?: number | undefined;
513
+ degradation_threshold?: number | undefined;
514
+ signals_required?: number | undefined;
515
+ } | undefined;
409
516
  }>;
410
517
  export declare const CommandsSchema: z.ZodObject<{
411
518
  format: z.ZodOptional<z.ZodString>;
@@ -676,6 +783,67 @@ export declare const ConfigSchema: z.ZodObject<{
676
783
  auto_detect_tier?: boolean | undefined;
677
784
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
678
785
  }>>>;
786
+ duplication_drift: z.ZodDefault<z.ZodOptional<z.ZodObject<{
787
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
788
+ similarity_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
789
+ min_body_lines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
790
+ }, "strip", z.ZodTypeAny, {
791
+ enabled: boolean;
792
+ similarity_threshold: number;
793
+ min_body_lines: number;
794
+ }, {
795
+ enabled?: boolean | undefined;
796
+ similarity_threshold?: number | undefined;
797
+ min_body_lines?: number | undefined;
798
+ }>>>;
799
+ hallucinated_imports: z.ZodDefault<z.ZodOptional<z.ZodObject<{
800
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
801
+ check_relative: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
802
+ check_packages: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
803
+ ignore_patterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
804
+ }, "strip", z.ZodTypeAny, {
805
+ enabled: boolean;
806
+ check_relative: boolean;
807
+ check_packages: boolean;
808
+ ignore_patterns: string[];
809
+ }, {
810
+ enabled?: boolean | undefined;
811
+ check_relative?: boolean | undefined;
812
+ check_packages?: boolean | undefined;
813
+ ignore_patterns?: string[] | undefined;
814
+ }>>>;
815
+ inconsistent_error_handling: z.ZodDefault<z.ZodOptional<z.ZodObject<{
816
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
817
+ max_strategies_per_type: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
818
+ min_occurrences: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
819
+ ignore_empty_catches: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
820
+ }, "strip", z.ZodTypeAny, {
821
+ enabled: boolean;
822
+ max_strategies_per_type: number;
823
+ min_occurrences: number;
824
+ ignore_empty_catches: boolean;
825
+ }, {
826
+ enabled?: boolean | undefined;
827
+ max_strategies_per_type?: number | undefined;
828
+ min_occurrences?: number | undefined;
829
+ ignore_empty_catches?: boolean | undefined;
830
+ }>>>;
831
+ context_window_artifacts: z.ZodDefault<z.ZodOptional<z.ZodObject<{
832
+ enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
833
+ min_file_lines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
834
+ degradation_threshold: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
835
+ signals_required: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
836
+ }, "strip", z.ZodTypeAny, {
837
+ enabled: boolean;
838
+ min_file_lines: number;
839
+ degradation_threshold: number;
840
+ signals_required: number;
841
+ }, {
842
+ enabled?: boolean | undefined;
843
+ min_file_lines?: number | undefined;
844
+ degradation_threshold?: number | undefined;
845
+ signals_required?: number | undefined;
846
+ }>>>;
679
847
  }, "strip", z.ZodTypeAny, {
680
848
  max_file_lines: number;
681
849
  forbid_todos: boolean;
@@ -763,6 +931,29 @@ export declare const ConfigSchema: z.ZodObject<{
763
931
  auto_detect_tier: boolean;
764
932
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
765
933
  };
934
+ duplication_drift: {
935
+ enabled: boolean;
936
+ similarity_threshold: number;
937
+ min_body_lines: number;
938
+ };
939
+ hallucinated_imports: {
940
+ enabled: boolean;
941
+ check_relative: boolean;
942
+ check_packages: boolean;
943
+ ignore_patterns: string[];
944
+ };
945
+ inconsistent_error_handling: {
946
+ enabled: boolean;
947
+ max_strategies_per_type: number;
948
+ min_occurrences: number;
949
+ ignore_empty_catches: boolean;
950
+ };
951
+ context_window_artifacts: {
952
+ enabled: boolean;
953
+ min_file_lines: number;
954
+ degradation_threshold: number;
955
+ signals_required: number;
956
+ };
766
957
  }, {
767
958
  max_file_lines?: number | undefined;
768
959
  forbid_todos?: boolean | undefined;
@@ -850,6 +1041,29 @@ export declare const ConfigSchema: z.ZodObject<{
850
1041
  auto_detect_tier?: boolean | undefined;
851
1042
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
852
1043
  } | undefined;
1044
+ duplication_drift?: {
1045
+ enabled?: boolean | undefined;
1046
+ similarity_threshold?: number | undefined;
1047
+ min_body_lines?: number | undefined;
1048
+ } | undefined;
1049
+ hallucinated_imports?: {
1050
+ enabled?: boolean | undefined;
1051
+ check_relative?: boolean | undefined;
1052
+ check_packages?: boolean | undefined;
1053
+ ignore_patterns?: string[] | undefined;
1054
+ } | undefined;
1055
+ inconsistent_error_handling?: {
1056
+ enabled?: boolean | undefined;
1057
+ max_strategies_per_type?: number | undefined;
1058
+ min_occurrences?: number | undefined;
1059
+ ignore_empty_catches?: boolean | undefined;
1060
+ } | undefined;
1061
+ context_window_artifacts?: {
1062
+ enabled?: boolean | undefined;
1063
+ min_file_lines?: number | undefined;
1064
+ degradation_threshold?: number | undefined;
1065
+ signals_required?: number | undefined;
1066
+ } | undefined;
853
1067
  }>>>;
854
1068
  output: z.ZodDefault<z.ZodOptional<z.ZodObject<{
855
1069
  report_path: z.ZodDefault<z.ZodString>;
@@ -956,6 +1170,29 @@ export declare const ConfigSchema: z.ZodObject<{
956
1170
  auto_detect_tier: boolean;
957
1171
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
958
1172
  };
1173
+ duplication_drift: {
1174
+ enabled: boolean;
1175
+ similarity_threshold: number;
1176
+ min_body_lines: number;
1177
+ };
1178
+ hallucinated_imports: {
1179
+ enabled: boolean;
1180
+ check_relative: boolean;
1181
+ check_packages: boolean;
1182
+ ignore_patterns: string[];
1183
+ };
1184
+ inconsistent_error_handling: {
1185
+ enabled: boolean;
1186
+ max_strategies_per_type: number;
1187
+ min_occurrences: number;
1188
+ ignore_empty_catches: boolean;
1189
+ };
1190
+ context_window_artifacts: {
1191
+ enabled: boolean;
1192
+ min_file_lines: number;
1193
+ degradation_threshold: number;
1194
+ signals_required: number;
1195
+ };
959
1196
  };
960
1197
  output: {
961
1198
  report_path: string;
@@ -1061,6 +1298,29 @@ export declare const ConfigSchema: z.ZodObject<{
1061
1298
  auto_detect_tier?: boolean | undefined;
1062
1299
  forced_tier?: "hobby" | "startup" | "enterprise" | undefined;
1063
1300
  } | undefined;
1301
+ duplication_drift?: {
1302
+ enabled?: boolean | undefined;
1303
+ similarity_threshold?: number | undefined;
1304
+ min_body_lines?: number | undefined;
1305
+ } | undefined;
1306
+ hallucinated_imports?: {
1307
+ enabled?: boolean | undefined;
1308
+ check_relative?: boolean | undefined;
1309
+ check_packages?: boolean | undefined;
1310
+ ignore_patterns?: string[] | undefined;
1311
+ } | undefined;
1312
+ inconsistent_error_handling?: {
1313
+ enabled?: boolean | undefined;
1314
+ max_strategies_per_type?: number | undefined;
1315
+ min_occurrences?: number | undefined;
1316
+ ignore_empty_catches?: boolean | undefined;
1317
+ } | undefined;
1318
+ context_window_artifacts?: {
1319
+ enabled?: boolean | undefined;
1320
+ min_file_lines?: number | undefined;
1321
+ degradation_threshold?: number | undefined;
1322
+ signals_required?: number | undefined;
1323
+ } | undefined;
1064
1324
  } | undefined;
1065
1325
  output?: {
1066
1326
  report_path?: string | undefined;
@@ -1075,10 +1335,15 @@ export type RawCommands = z.input<typeof CommandsSchema>;
1075
1335
  export type RawConfig = z.input<typeof ConfigSchema>;
1076
1336
  export declare const StatusSchema: z.ZodEnum<["PASS", "FAIL", "SKIP", "ERROR"]>;
1077
1337
  export type Status = z.infer<typeof StatusSchema>;
1338
+ export declare const SeveritySchema: z.ZodEnum<["critical", "high", "medium", "low", "info"]>;
1339
+ export type Severity = z.infer<typeof SeveritySchema>;
1340
+ /** Severity weights for score calculation */
1341
+ export declare const SEVERITY_WEIGHTS: Record<Severity, number>;
1078
1342
  export declare const FailureSchema: z.ZodObject<{
1079
1343
  id: z.ZodString;
1080
1344
  title: z.ZodString;
1081
1345
  details: z.ZodString;
1346
+ severity: z.ZodOptional<z.ZodEnum<["critical", "high", "medium", "low", "info"]>>;
1082
1347
  files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1083
1348
  line: z.ZodOptional<z.ZodNumber>;
1084
1349
  endLine: z.ZodOptional<z.ZodNumber>;
@@ -1087,6 +1352,7 @@ export declare const FailureSchema: z.ZodObject<{
1087
1352
  id: string;
1088
1353
  title: string;
1089
1354
  details: string;
1355
+ severity?: "critical" | "high" | "medium" | "low" | "info" | undefined;
1090
1356
  files?: string[] | undefined;
1091
1357
  line?: number | undefined;
1092
1358
  endLine?: number | undefined;
@@ -1095,6 +1361,7 @@ export declare const FailureSchema: z.ZodObject<{
1095
1361
  id: string;
1096
1362
  title: string;
1097
1363
  details: string;
1364
+ severity?: "critical" | "high" | "medium" | "low" | "info" | undefined;
1098
1365
  files?: string[] | undefined;
1099
1366
  line?: number | undefined;
1100
1367
  endLine?: number | undefined;
@@ -1108,6 +1375,7 @@ export declare const ReportSchema: z.ZodObject<{
1108
1375
  id: z.ZodString;
1109
1376
  title: z.ZodString;
1110
1377
  details: z.ZodString;
1378
+ severity: z.ZodOptional<z.ZodEnum<["critical", "high", "medium", "low", "info"]>>;
1111
1379
  files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1112
1380
  line: z.ZodOptional<z.ZodNumber>;
1113
1381
  endLine: z.ZodOptional<z.ZodNumber>;
@@ -1116,6 +1384,7 @@ export declare const ReportSchema: z.ZodObject<{
1116
1384
  id: string;
1117
1385
  title: string;
1118
1386
  details: string;
1387
+ severity?: "critical" | "high" | "medium" | "low" | "info" | undefined;
1119
1388
  files?: string[] | undefined;
1120
1389
  line?: number | undefined;
1121
1390
  endLine?: number | undefined;
@@ -1124,6 +1393,7 @@ export declare const ReportSchema: z.ZodObject<{
1124
1393
  id: string;
1125
1394
  title: string;
1126
1395
  details: string;
1396
+ severity?: "critical" | "high" | "medium" | "low" | "info" | undefined;
1127
1397
  files?: string[] | undefined;
1128
1398
  line?: number | undefined;
1129
1399
  endLine?: number | undefined;
@@ -1132,17 +1402,21 @@ export declare const ReportSchema: z.ZodObject<{
1132
1402
  stats: z.ZodObject<{
1133
1403
  duration_ms: z.ZodNumber;
1134
1404
  score: z.ZodOptional<z.ZodNumber>;
1405
+ severity_breakdown: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1135
1406
  }, "strip", z.ZodTypeAny, {
1136
1407
  duration_ms: number;
1137
1408
  score?: number | undefined;
1409
+ severity_breakdown?: Record<string, number> | undefined;
1138
1410
  }, {
1139
1411
  duration_ms: number;
1140
1412
  score?: number | undefined;
1413
+ severity_breakdown?: Record<string, number> | undefined;
1141
1414
  }>;
1142
1415
  }, "strip", z.ZodTypeAny, {
1143
1416
  stats: {
1144
1417
  duration_ms: number;
1145
1418
  score?: number | undefined;
1419
+ severity_breakdown?: Record<string, number> | undefined;
1146
1420
  };
1147
1421
  status: "PASS" | "FAIL" | "SKIP" | "ERROR";
1148
1422
  summary: Record<string, "PASS" | "FAIL" | "SKIP" | "ERROR">;
@@ -1150,6 +1424,7 @@ export declare const ReportSchema: z.ZodObject<{
1150
1424
  id: string;
1151
1425
  title: string;
1152
1426
  details: string;
1427
+ severity?: "critical" | "high" | "medium" | "low" | "info" | undefined;
1153
1428
  files?: string[] | undefined;
1154
1429
  line?: number | undefined;
1155
1430
  endLine?: number | undefined;
@@ -1159,6 +1434,7 @@ export declare const ReportSchema: z.ZodObject<{
1159
1434
  stats: {
1160
1435
  duration_ms: number;
1161
1436
  score?: number | undefined;
1437
+ severity_breakdown?: Record<string, number> | undefined;
1162
1438
  };
1163
1439
  status: "PASS" | "FAIL" | "SKIP" | "ERROR";
1164
1440
  summary: Record<string, "PASS" | "FAIL" | "SKIP" | "ERROR">;
@@ -1166,6 +1442,7 @@ export declare const ReportSchema: z.ZodObject<{
1166
1442
  id: string;
1167
1443
  title: string;
1168
1444
  details: string;
1445
+ severity?: "critical" | "high" | "medium" | "low" | "info" | undefined;
1169
1446
  files?: string[] | undefined;
1170
1447
  line?: number | undefined;
1171
1448
  endLine?: number | undefined;
@@ -102,6 +102,33 @@ export const GatesSchema = z.object({
102
102
  auto_detect_tier: z.boolean().optional().default(true),
103
103
  forced_tier: z.enum(['hobby', 'startup', 'enterprise']).optional(),
104
104
  }).optional().default({}),
105
+ // v2.16+ AI-Native Drift Detection Gates
106
+ duplication_drift: z.object({
107
+ enabled: z.boolean().optional().default(true),
108
+ similarity_threshold: z.number().min(0).max(1).optional().default(0.8),
109
+ min_body_lines: z.number().optional().default(5),
110
+ }).optional().default({}),
111
+ hallucinated_imports: z.object({
112
+ enabled: z.boolean().optional().default(true),
113
+ check_relative: z.boolean().optional().default(true),
114
+ check_packages: z.boolean().optional().default(true),
115
+ ignore_patterns: z.array(z.string()).optional().default([
116
+ '\\.css$', '\\.scss$', '\\.less$', '\\.svg$', '\\.png$', '\\.jpg$',
117
+ '\\.json$', '\\.wasm$', '\\.graphql$', '\\.gql$',
118
+ ]),
119
+ }).optional().default({}),
120
+ inconsistent_error_handling: z.object({
121
+ enabled: z.boolean().optional().default(true),
122
+ max_strategies_per_type: z.number().optional().default(2),
123
+ min_occurrences: z.number().optional().default(3),
124
+ ignore_empty_catches: z.boolean().optional().default(false),
125
+ }).optional().default({}),
126
+ context_window_artifacts: z.object({
127
+ enabled: z.boolean().optional().default(true),
128
+ min_file_lines: z.number().optional().default(100),
129
+ degradation_threshold: z.number().min(0).max(1).optional().default(0.4),
130
+ signals_required: z.number().optional().default(2),
131
+ }).optional().default({}),
105
132
  });
106
133
  export const CommandsSchema = z.object({
107
134
  format: z.string().optional(),
@@ -122,10 +149,20 @@ export const ConfigSchema = z.object({
122
149
  ignore: z.array(z.string()).optional().default([]),
123
150
  });
124
151
  export const StatusSchema = z.enum(['PASS', 'FAIL', 'SKIP', 'ERROR']);
152
+ export const SeveritySchema = z.enum(['critical', 'high', 'medium', 'low', 'info']);
153
+ /** Severity weights for score calculation */
154
+ export const SEVERITY_WEIGHTS = {
155
+ critical: 20,
156
+ high: 10,
157
+ medium: 5,
158
+ low: 2,
159
+ info: 0,
160
+ };
125
161
  export const FailureSchema = z.object({
126
162
  id: z.string(),
127
163
  title: z.string(),
128
164
  details: z.string(),
165
+ severity: SeveritySchema.optional(),
129
166
  files: z.array(z.string()).optional(),
130
167
  line: z.number().optional(),
131
168
  endLine: z.number().optional(),
@@ -138,5 +175,6 @@ export const ReportSchema = z.object({
138
175
  stats: z.object({
139
176
  duration_ms: z.number(),
140
177
  score: z.number().optional(),
178
+ severity_breakdown: z.record(z.number()).optional(),
141
179
  }),
142
180
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/core",
3
- "version": "2.21.2",
3
+ "version": "2.22.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/gates/base.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { GoldenRecord } from '../services/context-engine.js';
2
- import { Failure } from '../types/index.js';
2
+ import { Failure, Severity } from '../types/index.js';
3
3
 
4
4
  export interface GateContext {
5
5
  cwd: string;
@@ -13,11 +13,12 @@ export abstract class Gate {
13
13
 
14
14
  abstract run(context: GateContext): Promise<Failure[]>;
15
15
 
16
- protected createFailure(details: string, files?: string[], hint?: string, title?: string, line?: number, endLine?: number): Failure {
16
+ protected createFailure(details: string, files?: string[], hint?: string, title?: string, line?: number, endLine?: number, severity?: Severity): Failure {
17
17
  return {
18
18
  id: this.id,
19
19
  title: title || this.title,
20
20
  details,
21
+ severity: severity || 'medium',
21
22
  files,
22
23
  line,
23
24
  endLine,
@@ -38,7 +38,8 @@ export class ContentGate extends Gate {
38
38
  'Remove forbidden comments. address the root cause or create a tracked issue.',
39
39
  undefined,
40
40
  index + 1,
41
- index + 1
41
+ index + 1,
42
+ 'info'
42
43
  ));
43
44
  }
44
45
  }