@harness-engineering/core 0.11.0 → 0.13.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/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Result, WorkflowStep, WorkflowStepResult, Workflow, WorkflowResult, SkillLifecycleHooks, SkillContext, SkillResult, TurnContext, CICheckName, CIFailOnSeverity, CICheckReport, Roadmap, FeatureStatus } from '@harness-engineering/types';
2
2
  export * from '@harness-engineering/types';
3
3
  import { z } from 'zod';
4
- import { C as Collector, A as ArchConfig, a as ConstraintRule, M as MetricResult, b as ArchMetricCategory, c as ArchBaseline, d as ArchDiffResult, T as ThresholdConfig } from './matchers-D20x48U9.mjs';
5
- export { e as ArchBaselineSchema, f as ArchConfigSchema, g as ArchDiffResultSchema, h as ArchHandle, i as ArchMetricCategorySchema, j as ArchitectureOptions, k as CategoryBaseline, l as CategoryBaselineSchema, m as CategoryRegression, n as CategoryRegressionSchema, o as ConstraintRuleSchema, p as MetricResultSchema, q as ThresholdConfigSchema, V as Violation, r as ViolationSchema, s as archMatchers, t as archModule, u as architecture } from './matchers-D20x48U9.mjs';
4
+ import { C as Collector, A as ArchConfig, a as ConstraintRule, M as MetricResult, b as ArchMetricCategory, c as ArchBaseline, d as ArchDiffResult, T as ThresholdConfig } from './matchers-Dj1t5vpg.mjs';
5
+ export { e as ArchBaselineSchema, f as ArchConfigSchema, g as ArchDiffResultSchema, h as ArchHandle, i as ArchMetricCategorySchema, j as ArchitectureOptions, k as CategoryBaseline, l as CategoryBaselineSchema, m as CategoryRegression, n as CategoryRegressionSchema, o as ConstraintRuleSchema, p as MetricResultSchema, q as ThresholdConfigSchema, V as Violation, r as ViolationSchema, s as archMatchers, t as archModule, u as architecture } from './matchers-Dj1t5vpg.mjs';
6
6
 
7
7
  /**
8
8
  * Represents an error code for identifying specific error types.
@@ -522,12 +522,12 @@ declare const ManifestSchema: z.ZodObject<{
522
522
  schema: string;
523
523
  }>, "many">>;
524
524
  }, "strip", z.ZodTypeAny, {
525
- name: string;
526
525
  version: string;
526
+ name: string;
527
527
  include: string[];
528
528
  keywords: string[];
529
- layers?: Record<string, string[]> | undefined;
530
529
  description?: string | undefined;
530
+ layers?: Record<string, string[]> | undefined;
531
531
  minHarnessVersion?: string | undefined;
532
532
  boundaries?: {
533
533
  name: string;
@@ -536,11 +536,11 @@ declare const ManifestSchema: z.ZodObject<{
536
536
  schema: string;
537
537
  }[] | undefined;
538
538
  }, {
539
- name: string;
540
539
  version: string;
540
+ name: string;
541
541
  include: string[];
542
- layers?: Record<string, string[]> | undefined;
543
542
  description?: string | undefined;
543
+ layers?: Record<string, string[]> | undefined;
544
544
  minHarnessVersion?: string | undefined;
545
545
  keywords?: string[] | undefined;
546
546
  boundaries?: {
@@ -675,12 +675,12 @@ declare const BundleSchema: z.ZodObject<{
675
675
  schema: string;
676
676
  }>, "many">>;
677
677
  }, "strip", z.ZodTypeAny, {
678
- name: string;
679
678
  version: string;
679
+ name: string;
680
680
  include: string[];
681
681
  keywords: string[];
682
- layers?: Record<string, string[]> | undefined;
683
682
  description?: string | undefined;
683
+ layers?: Record<string, string[]> | undefined;
684
684
  minHarnessVersion?: string | undefined;
685
685
  boundaries?: {
686
686
  name: string;
@@ -689,11 +689,11 @@ declare const BundleSchema: z.ZodObject<{
689
689
  schema: string;
690
690
  }[] | undefined;
691
691
  }, {
692
- name: string;
693
692
  version: string;
693
+ name: string;
694
694
  include: string[];
695
- layers?: Record<string, string[]> | undefined;
696
695
  description?: string | undefined;
696
+ layers?: Record<string, string[]> | undefined;
697
697
  minHarnessVersion?: string | undefined;
698
698
  keywords?: string[] | undefined;
699
699
  boundaries?: {
@@ -799,15 +799,15 @@ declare const BundleSchema: z.ZodObject<{
799
799
  }>;
800
800
  contributions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
801
801
  }, "strip", z.ZodTypeAny, {
802
- name: string;
803
802
  version: string;
803
+ name: string;
804
804
  manifest: {
805
- name: string;
806
805
  version: string;
806
+ name: string;
807
807
  include: string[];
808
808
  keywords: string[];
809
- layers?: Record<string, string[]> | undefined;
810
809
  description?: string | undefined;
810
+ layers?: Record<string, string[]> | undefined;
811
811
  minHarnessVersion?: string | undefined;
812
812
  boundaries?: {
813
813
  name: string;
@@ -842,14 +842,14 @@ declare const BundleSchema: z.ZodObject<{
842
842
  minHarnessVersion?: string | undefined;
843
843
  contributions?: Record<string, unknown> | undefined;
844
844
  }, {
845
- name: string;
846
845
  version: string;
846
+ name: string;
847
847
  manifest: {
848
- name: string;
849
848
  version: string;
849
+ name: string;
850
850
  include: string[];
851
- layers?: Record<string, string[]> | undefined;
852
851
  description?: string | undefined;
852
+ layers?: Record<string, string[]> | undefined;
853
853
  minHarnessVersion?: string | undefined;
854
854
  keywords?: string[] | undefined;
855
855
  boundaries?: {
@@ -898,16 +898,16 @@ declare const LockfilePackageSchema: z.ZodObject<{
898
898
  integrity: z.ZodOptional<z.ZodString>;
899
899
  provenance: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
900
900
  }, "strip", z.ZodTypeAny, {
901
- source: string;
902
901
  version: string;
902
+ source: string;
903
903
  installedAt: string;
904
904
  contributions?: Record<string, unknown> | null | undefined;
905
905
  resolved?: string | undefined;
906
906
  integrity?: string | undefined;
907
907
  provenance?: string[] | undefined;
908
908
  }, {
909
- source: string;
910
909
  version: string;
910
+ source: string;
911
911
  installedAt: string;
912
912
  contributions?: Record<string, unknown> | null | undefined;
913
913
  resolved?: string | undefined;
@@ -926,16 +926,16 @@ declare const LockfileSchema: z.ZodEffects<z.ZodObject<{
926
926
  integrity: z.ZodOptional<z.ZodString>;
927
927
  provenance: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
928
928
  }, "strip", z.ZodTypeAny, {
929
- source: string;
930
929
  version: string;
930
+ source: string;
931
931
  installedAt: string;
932
932
  contributions?: Record<string, unknown> | null | undefined;
933
933
  resolved?: string | undefined;
934
934
  integrity?: string | undefined;
935
935
  provenance?: string[] | undefined;
936
936
  }, {
937
- source: string;
938
937
  version: string;
938
+ source: string;
939
939
  installedAt: string;
940
940
  contributions?: Record<string, unknown> | null | undefined;
941
941
  resolved?: string | undefined;
@@ -944,8 +944,8 @@ declare const LockfileSchema: z.ZodEffects<z.ZodObject<{
944
944
  }>>;
945
945
  }, "strip", z.ZodTypeAny, {
946
946
  packages: Record<string, {
947
- source: string;
948
947
  version: string;
948
+ source: string;
949
949
  installedAt: string;
950
950
  contributions?: Record<string, unknown> | null | undefined;
951
951
  resolved?: string | undefined;
@@ -956,8 +956,8 @@ declare const LockfileSchema: z.ZodEffects<z.ZodObject<{
956
956
  lockfileVersion?: 1 | undefined;
957
957
  }, {
958
958
  packages: Record<string, {
959
- source: string;
960
959
  version: string;
960
+ source: string;
961
961
  installedAt: string;
962
962
  contributions?: Record<string, unknown> | null | undefined;
963
963
  resolved?: string | undefined;
@@ -968,8 +968,8 @@ declare const LockfileSchema: z.ZodEffects<z.ZodObject<{
968
968
  lockfileVersion?: 1 | undefined;
969
969
  }>, {
970
970
  packages: Record<string, {
971
- source: string;
972
971
  version: string;
972
+ source: string;
973
973
  installedAt: string;
974
974
  contributions?: Record<string, unknown> | null | undefined;
975
975
  resolved?: string | undefined;
@@ -980,8 +980,8 @@ declare const LockfileSchema: z.ZodEffects<z.ZodObject<{
980
980
  lockfileVersion?: 1 | undefined;
981
981
  }, {
982
982
  packages: Record<string, {
983
- source: string;
984
983
  version: string;
984
+ source: string;
985
985
  installedAt: string;
986
986
  contributions?: Record<string, unknown> | null | undefined;
987
987
  resolved?: string | undefined;
@@ -1060,7 +1060,7 @@ declare function readLockfile(lockfilePath: string): Promise<Result<Lockfile | n
1060
1060
  /**
1061
1061
  * Write a lockfile to disk using atomic write.
1062
1062
  */
1063
- declare function writeLockfile(lockfilePath: string, lockfile: Lockfile): Promise<void>;
1063
+ declare function writeLockfile(lockfilePath: string, lockfile: Lockfile): Promise<Result<void, Error>>;
1064
1064
  /**
1065
1065
  * Add or replace a package entry in the lockfile (immutable).
1066
1066
  *
@@ -1078,6 +1078,233 @@ declare function removeProvenance(lockfile: Lockfile, packageName: string): {
1078
1078
  contributions: Contributions | null;
1079
1079
  };
1080
1080
 
1081
+ /**
1082
+ * Remove contributions from a config object.
1083
+ *
1084
+ * Uses the contributions record (as stored in the lockfile) to identify
1085
+ * exactly which rules/layers/thresholds to remove from each section.
1086
+ *
1087
+ * Returns a new config object; does not mutate the input.
1088
+ */
1089
+ declare function removeContributions(config: Record<string, unknown>, contributions: Contributions): Record<string, unknown>;
1090
+
1091
+ interface ComplexityThresholds {
1092
+ cyclomaticComplexity?: {
1093
+ error?: number;
1094
+ warn?: number;
1095
+ };
1096
+ nestingDepth?: {
1097
+ warn?: number;
1098
+ };
1099
+ functionLength?: {
1100
+ warn?: number;
1101
+ };
1102
+ parameterCount?: {
1103
+ warn?: number;
1104
+ };
1105
+ fileLength?: {
1106
+ info?: number;
1107
+ };
1108
+ hotspotPercentile?: {
1109
+ error?: number;
1110
+ };
1111
+ }
1112
+ interface ComplexityConfig {
1113
+ enabled?: boolean;
1114
+ thresholds?: ComplexityThresholds;
1115
+ }
1116
+ interface ComplexityViolation {
1117
+ file: string;
1118
+ function: string;
1119
+ line: number;
1120
+ metric: 'cyclomaticComplexity' | 'nestingDepth' | 'functionLength' | 'parameterCount' | 'fileLength' | 'hotspotScore';
1121
+ value: number;
1122
+ threshold: number;
1123
+ tier: 1 | 2 | 3;
1124
+ severity: 'error' | 'warning' | 'info';
1125
+ message?: string;
1126
+ }
1127
+ interface ComplexityReport {
1128
+ violations: ComplexityViolation[];
1129
+ stats: {
1130
+ filesAnalyzed: number;
1131
+ functionsAnalyzed: number;
1132
+ violationCount: number;
1133
+ errorCount: number;
1134
+ warningCount: number;
1135
+ infoCount: number;
1136
+ };
1137
+ }
1138
+
1139
+ interface CouplingThresholds {
1140
+ fanOut?: {
1141
+ warn?: number;
1142
+ };
1143
+ fanIn?: {
1144
+ info?: number;
1145
+ };
1146
+ couplingRatio?: {
1147
+ warn?: number;
1148
+ };
1149
+ transitiveDependencyDepth?: {
1150
+ info?: number;
1151
+ };
1152
+ }
1153
+ interface CouplingConfig {
1154
+ enabled?: boolean;
1155
+ thresholds?: CouplingThresholds;
1156
+ }
1157
+ interface CouplingViolation {
1158
+ file: string;
1159
+ metric: 'fanOut' | 'fanIn' | 'couplingRatio' | 'transitiveDependencyDepth';
1160
+ value: number;
1161
+ threshold: number;
1162
+ tier: 1 | 2 | 3;
1163
+ severity: 'error' | 'warning' | 'info';
1164
+ message?: string;
1165
+ }
1166
+ interface CouplingReport {
1167
+ violations: CouplingViolation[];
1168
+ stats: {
1169
+ filesAnalyzed: number;
1170
+ violationCount: number;
1171
+ warningCount: number;
1172
+ infoCount: number;
1173
+ };
1174
+ }
1175
+
1176
+ interface SizeBudgetConfig {
1177
+ enabled?: boolean;
1178
+ budgets: Record<string, {
1179
+ warn?: string;
1180
+ }>;
1181
+ dependencyWeight?: {
1182
+ info?: string;
1183
+ };
1184
+ }
1185
+ interface SizeBudgetViolation {
1186
+ package: string;
1187
+ currentSize: number;
1188
+ budgetSize: number;
1189
+ unit: 'bytes';
1190
+ tier: 2 | 3;
1191
+ severity: 'warning' | 'info';
1192
+ }
1193
+ interface SizeBudgetReport {
1194
+ violations: SizeBudgetViolation[];
1195
+ stats: {
1196
+ packagesChecked: number;
1197
+ violationCount: number;
1198
+ warningCount: number;
1199
+ infoCount: number;
1200
+ };
1201
+ }
1202
+
1203
+ interface ConfigPattern {
1204
+ name: string;
1205
+ description: string;
1206
+ severity: 'error' | 'warning';
1207
+ files: string[];
1208
+ rule: {
1209
+ type: 'must-export';
1210
+ names: string[];
1211
+ } | {
1212
+ type: 'must-export-default';
1213
+ kind?: 'class' | 'function' | 'object';
1214
+ } | {
1215
+ type: 'no-export';
1216
+ names: string[];
1217
+ } | {
1218
+ type: 'must-import';
1219
+ from: string;
1220
+ names?: string[];
1221
+ } | {
1222
+ type: 'no-import';
1223
+ from: string;
1224
+ } | {
1225
+ type: 'naming';
1226
+ match: string;
1227
+ convention: 'camelCase' | 'PascalCase' | 'UPPER_SNAKE' | 'kebab-case';
1228
+ } | {
1229
+ type: 'max-exports';
1230
+ count: number;
1231
+ } | {
1232
+ type: 'max-lines';
1233
+ count: number;
1234
+ } | {
1235
+ type: 'require-jsdoc';
1236
+ for: ('function' | 'class' | 'export')[];
1237
+ };
1238
+ message?: string;
1239
+ }
1240
+ interface PatternMatch {
1241
+ line: number;
1242
+ column?: number;
1243
+ message: string;
1244
+ suggestion?: string;
1245
+ }
1246
+ interface PatternConfig {
1247
+ patterns: ConfigPattern[];
1248
+ customPatterns?: Array<{
1249
+ name: string;
1250
+ description: string;
1251
+ severity: 'error' | 'warning';
1252
+ check: (...args: unknown[]) => PatternMatch[];
1253
+ }>;
1254
+ ignoreFiles?: string[];
1255
+ }
1256
+ interface PatternViolation {
1257
+ pattern: string;
1258
+ file: string;
1259
+ line: number;
1260
+ column?: number;
1261
+ severity: 'error' | 'warning';
1262
+ message: string;
1263
+ suggestion?: string;
1264
+ }
1265
+ interface PatternReport {
1266
+ violations: PatternViolation[];
1267
+ stats: {
1268
+ filesChecked: number;
1269
+ patternsApplied: number;
1270
+ violationCount: number;
1271
+ errorCount: number;
1272
+ warningCount: number;
1273
+ };
1274
+ passRate: number;
1275
+ }
1276
+
1277
+ interface DriftConfig {
1278
+ docPaths: string[];
1279
+ checkApiSignatures: boolean;
1280
+ checkExamples: boolean;
1281
+ checkStructure: boolean;
1282
+ ignorePatterns: string[];
1283
+ }
1284
+ interface DeadCodeConfig {
1285
+ entryPoints?: string[];
1286
+ includeTypes: boolean;
1287
+ includeInternals: boolean;
1288
+ ignorePatterns: string[];
1289
+ treatDynamicImportsAs: 'used' | 'unknown';
1290
+ }
1291
+ interface EntropyConfig {
1292
+ rootDir: string;
1293
+ parser?: LanguageParser;
1294
+ entryPoints?: string[];
1295
+ analyze: {
1296
+ drift?: boolean | Partial<DriftConfig>;
1297
+ deadCode?: boolean | Partial<DeadCodeConfig>;
1298
+ patterns?: boolean | PatternConfig;
1299
+ complexity?: boolean | Partial<ComplexityConfig>;
1300
+ coupling?: boolean | Partial<CouplingConfig>;
1301
+ sizeBudget?: boolean | Partial<SizeBudgetConfig>;
1302
+ };
1303
+ include?: string[];
1304
+ exclude?: string[];
1305
+ docPaths?: string[];
1306
+ }
1307
+
1081
1308
  interface InternalSymbol {
1082
1309
  name: string;
1083
1310
  type: 'function' | 'class' | 'variable' | 'type';
@@ -1141,36 +1368,7 @@ interface CodebaseSnapshot {
1141
1368
  config: EntropyConfig;
1142
1369
  buildTime: number;
1143
1370
  }
1144
- interface DriftConfig {
1145
- docPaths: string[];
1146
- checkApiSignatures: boolean;
1147
- checkExamples: boolean;
1148
- checkStructure: boolean;
1149
- ignorePatterns: string[];
1150
- }
1151
- interface DeadCodeConfig {
1152
- entryPoints?: string[];
1153
- includeTypes: boolean;
1154
- includeInternals: boolean;
1155
- ignorePatterns: string[];
1156
- treatDynamicImportsAs: 'used' | 'unknown';
1157
- }
1158
- interface EntropyConfig {
1159
- rootDir: string;
1160
- parser?: LanguageParser;
1161
- entryPoints?: string[];
1162
- analyze: {
1163
- drift?: boolean | Partial<DriftConfig>;
1164
- deadCode?: boolean | Partial<DeadCodeConfig>;
1165
- patterns?: boolean | PatternConfig;
1166
- complexity?: boolean | Partial<ComplexityConfig>;
1167
- coupling?: boolean | Partial<CouplingConfig>;
1168
- sizeBudget?: boolean | Partial<SizeBudgetConfig>;
1169
- };
1170
- include?: string[];
1171
- exclude?: string[];
1172
- docPaths?: string[];
1173
- }
1371
+
1174
1372
  interface DocumentationDrift {
1175
1373
  type: 'api-signature' | 'example-code' | 'structure';
1176
1374
  docFile: string;
@@ -1197,6 +1395,7 @@ interface DriftReport {
1197
1395
  };
1198
1396
  severity: 'high' | 'medium' | 'low' | 'none';
1199
1397
  }
1398
+
1200
1399
  interface DeadExport {
1201
1400
  file: string;
1202
1401
  name: string;
@@ -1220,216 +1419,41 @@ interface DeadInternal {
1220
1419
  }
1221
1420
  interface UnusedImport {
1222
1421
  file: string;
1223
- line: number;
1224
- source: string;
1225
- specifiers: string[];
1226
- isFullyUnused: boolean;
1227
- }
1228
- interface ReachabilityNode {
1229
- file: string;
1230
- reachable: boolean;
1231
- importedBy: string[];
1232
- imports: string[];
1233
- }
1234
- interface DeadCodeReport {
1235
- deadExports: DeadExport[];
1236
- deadFiles: DeadFile[];
1237
- deadInternals: DeadInternal[];
1238
- unusedImports: UnusedImport[];
1239
- stats: {
1240
- filesAnalyzed: number;
1241
- entryPointsUsed: string[];
1242
- totalExports: number;
1243
- deadExportCount: number;
1244
- totalFiles: number;
1245
- deadFileCount: number;
1246
- estimatedDeadLines: number;
1247
- };
1248
- reachabilityTree?: ReachabilityNode;
1249
- }
1250
- interface ConfigPattern {
1251
- name: string;
1252
- description: string;
1253
- severity: 'error' | 'warning';
1254
- files: string[];
1255
- rule: {
1256
- type: 'must-export';
1257
- names: string[];
1258
- } | {
1259
- type: 'must-export-default';
1260
- kind?: 'class' | 'function' | 'object';
1261
- } | {
1262
- type: 'no-export';
1263
- names: string[];
1264
- } | {
1265
- type: 'must-import';
1266
- from: string;
1267
- names?: string[];
1268
- } | {
1269
- type: 'no-import';
1270
- from: string;
1271
- } | {
1272
- type: 'naming';
1273
- match: string;
1274
- convention: 'camelCase' | 'PascalCase' | 'UPPER_SNAKE' | 'kebab-case';
1275
- } | {
1276
- type: 'max-exports';
1277
- count: number;
1278
- } | {
1279
- type: 'max-lines';
1280
- count: number;
1281
- } | {
1282
- type: 'require-jsdoc';
1283
- for: ('function' | 'class' | 'export')[];
1284
- };
1285
- message?: string;
1286
- }
1287
- interface CodePattern {
1288
- name: string;
1289
- description: string;
1290
- severity: 'error' | 'warning';
1291
- check: (file: SourceFile, snapshot: CodebaseSnapshot) => PatternMatch[];
1292
- }
1293
- interface PatternMatch {
1294
- line: number;
1295
- column?: number;
1296
- message: string;
1297
- suggestion?: string;
1298
- }
1299
- interface PatternConfig {
1300
- patterns: ConfigPattern[];
1301
- customPatterns?: CodePattern[];
1302
- ignoreFiles?: string[];
1303
- }
1304
- interface PatternViolation {
1305
- pattern: string;
1306
- file: string;
1307
- line: number;
1308
- column?: number;
1309
- severity: 'error' | 'warning';
1310
- message: string;
1311
- suggestion?: string;
1312
- }
1313
- interface PatternReport {
1314
- violations: PatternViolation[];
1315
- stats: {
1316
- filesChecked: number;
1317
- patternsApplied: number;
1318
- violationCount: number;
1319
- errorCount: number;
1320
- warningCount: number;
1321
- };
1322
- passRate: number;
1323
- }
1324
- interface ComplexityThresholds {
1325
- cyclomaticComplexity?: {
1326
- error?: number;
1327
- warn?: number;
1328
- };
1329
- nestingDepth?: {
1330
- warn?: number;
1331
- };
1332
- functionLength?: {
1333
- warn?: number;
1334
- };
1335
- parameterCount?: {
1336
- warn?: number;
1337
- };
1338
- fileLength?: {
1339
- info?: number;
1340
- };
1341
- hotspotPercentile?: {
1342
- error?: number;
1343
- };
1344
- }
1345
- interface ComplexityConfig {
1346
- enabled?: boolean;
1347
- thresholds?: ComplexityThresholds;
1348
- }
1349
- interface ComplexityViolation {
1350
- file: string;
1351
- function: string;
1352
- line: number;
1353
- metric: 'cyclomaticComplexity' | 'nestingDepth' | 'functionLength' | 'parameterCount' | 'fileLength' | 'hotspotScore';
1354
- value: number;
1355
- threshold: number;
1356
- tier: 1 | 2 | 3;
1357
- severity: 'error' | 'warning' | 'info';
1358
- message?: string;
1359
- }
1360
- interface ComplexityReport {
1361
- violations: ComplexityViolation[];
1362
- stats: {
1363
- filesAnalyzed: number;
1364
- functionsAnalyzed: number;
1365
- violationCount: number;
1366
- errorCount: number;
1367
- warningCount: number;
1368
- infoCount: number;
1369
- };
1370
- }
1371
- interface CouplingThresholds {
1372
- fanOut?: {
1373
- warn?: number;
1374
- };
1375
- fanIn?: {
1376
- info?: number;
1377
- };
1378
- couplingRatio?: {
1379
- warn?: number;
1380
- };
1381
- transitiveDependencyDepth?: {
1382
- info?: number;
1383
- };
1384
- }
1385
- interface CouplingConfig {
1386
- enabled?: boolean;
1387
- thresholds?: CouplingThresholds;
1388
- }
1389
- interface CouplingViolation {
1390
- file: string;
1391
- metric: 'fanOut' | 'fanIn' | 'couplingRatio' | 'transitiveDependencyDepth';
1392
- value: number;
1393
- threshold: number;
1394
- tier: 1 | 2 | 3;
1395
- severity: 'error' | 'warning' | 'info';
1396
- message?: string;
1397
- }
1398
- interface CouplingReport {
1399
- violations: CouplingViolation[];
1400
- stats: {
1401
- filesAnalyzed: number;
1402
- violationCount: number;
1403
- warningCount: number;
1404
- infoCount: number;
1405
- };
1406
- }
1407
- interface SizeBudgetConfig {
1408
- enabled?: boolean;
1409
- budgets: Record<string, {
1410
- warn?: string;
1411
- }>;
1412
- dependencyWeight?: {
1413
- info?: string;
1414
- };
1415
- }
1416
- interface SizeBudgetViolation {
1417
- package: string;
1418
- currentSize: number;
1419
- budgetSize: number;
1420
- unit: 'bytes';
1421
- tier: 2 | 3;
1422
- severity: 'warning' | 'info';
1422
+ line: number;
1423
+ source: string;
1424
+ specifiers: string[];
1425
+ isFullyUnused: boolean;
1423
1426
  }
1424
- interface SizeBudgetReport {
1425
- violations: SizeBudgetViolation[];
1427
+ interface ReachabilityNode {
1428
+ file: string;
1429
+ reachable: boolean;
1430
+ importedBy: string[];
1431
+ imports: string[];
1432
+ }
1433
+ interface DeadCodeReport {
1434
+ deadExports: DeadExport[];
1435
+ deadFiles: DeadFile[];
1436
+ deadInternals: DeadInternal[];
1437
+ unusedImports: UnusedImport[];
1426
1438
  stats: {
1427
- packagesChecked: number;
1428
- violationCount: number;
1429
- warningCount: number;
1430
- infoCount: number;
1439
+ filesAnalyzed: number;
1440
+ entryPointsUsed: string[];
1441
+ totalExports: number;
1442
+ deadExportCount: number;
1443
+ totalFiles: number;
1444
+ deadFileCount: number;
1445
+ estimatedDeadLines: number;
1431
1446
  };
1447
+ reachabilityTree?: ReachabilityNode;
1448
+ }
1449
+
1450
+ interface CodePattern {
1451
+ name: string;
1452
+ description: string;
1453
+ severity: 'error' | 'warning';
1454
+ check: (file: SourceFile, snapshot: CodebaseSnapshot) => PatternMatch[];
1432
1455
  }
1456
+
1433
1457
  type FixType = 'unused-imports' | 'dead-files' | 'dead-exports' | 'commented-code' | 'orphaned-deps' | 'forbidden-import-replacement' | 'import-ordering' | 'trailing-whitespace' | 'broken-links' | 'sort-imports';
1434
1458
  interface FixConfig {
1435
1459
  dryRun: boolean;
@@ -1504,6 +1528,7 @@ interface SuggestionReport {
1504
1528
  };
1505
1529
  estimatedEffort: 'trivial' | 'small' | 'medium' | 'large';
1506
1530
  }
1531
+
1507
1532
  interface AnalysisError {
1508
1533
  analyzer: 'drift' | 'deadCode' | 'patterns' | 'complexity' | 'coupling' | 'sizeBudget';
1509
1534
  error: EntropyError;
@@ -1827,12 +1852,12 @@ declare const PatternConfigSchema: z.ZodObject<{
1827
1852
  match: z.ZodString;
1828
1853
  convention: z.ZodEnum<["camelCase", "PascalCase", "UPPER_SNAKE", "kebab-case"]>;
1829
1854
  }, "strip", z.ZodTypeAny, {
1830
- match: string;
1831
1855
  type: "naming";
1856
+ match: string;
1832
1857
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
1833
1858
  }, {
1834
- match: string;
1835
1859
  type: "naming";
1860
+ match: string;
1836
1861
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
1837
1862
  }>, z.ZodObject<{
1838
1863
  type: z.ZodLiteral<"max-exports">;
@@ -1864,10 +1889,10 @@ declare const PatternConfigSchema: z.ZodObject<{
1864
1889
  }>]>;
1865
1890
  message: z.ZodOptional<z.ZodString>;
1866
1891
  }, "strip", z.ZodTypeAny, {
1892
+ severity: "error" | "warning";
1893
+ description: string;
1867
1894
  files: string[];
1868
1895
  name: string;
1869
- description: string;
1870
- severity: "error" | "warning";
1871
1896
  rule: {
1872
1897
  type: "must-export";
1873
1898
  names: string[];
@@ -1885,8 +1910,8 @@ declare const PatternConfigSchema: z.ZodObject<{
1885
1910
  type: "no-import";
1886
1911
  from: string;
1887
1912
  } | {
1888
- match: string;
1889
1913
  type: "naming";
1914
+ match: string;
1890
1915
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
1891
1916
  } | {
1892
1917
  type: "max-exports";
@@ -1900,10 +1925,10 @@ declare const PatternConfigSchema: z.ZodObject<{
1900
1925
  };
1901
1926
  message?: string | undefined;
1902
1927
  }, {
1928
+ severity: "error" | "warning";
1929
+ description: string;
1903
1930
  files: string[];
1904
1931
  name: string;
1905
- description: string;
1906
- severity: "error" | "warning";
1907
1932
  rule: {
1908
1933
  type: "must-export";
1909
1934
  names: string[];
@@ -1921,8 +1946,8 @@ declare const PatternConfigSchema: z.ZodObject<{
1921
1946
  type: "no-import";
1922
1947
  from: string;
1923
1948
  } | {
1924
- match: string;
1925
1949
  type: "naming";
1950
+ match: string;
1926
1951
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
1927
1952
  } | {
1928
1953
  type: "max-exports";
@@ -1940,10 +1965,10 @@ declare const PatternConfigSchema: z.ZodObject<{
1940
1965
  ignoreFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1941
1966
  }, "strip", z.ZodTypeAny, {
1942
1967
  patterns: {
1968
+ severity: "error" | "warning";
1969
+ description: string;
1943
1970
  files: string[];
1944
1971
  name: string;
1945
- description: string;
1946
- severity: "error" | "warning";
1947
1972
  rule: {
1948
1973
  type: "must-export";
1949
1974
  names: string[];
@@ -1961,8 +1986,8 @@ declare const PatternConfigSchema: z.ZodObject<{
1961
1986
  type: "no-import";
1962
1987
  from: string;
1963
1988
  } | {
1964
- match: string;
1965
1989
  type: "naming";
1990
+ match: string;
1966
1991
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
1967
1992
  } | {
1968
1993
  type: "max-exports";
@@ -1980,10 +2005,10 @@ declare const PatternConfigSchema: z.ZodObject<{
1980
2005
  ignoreFiles?: string[] | undefined;
1981
2006
  }, {
1982
2007
  patterns: {
2008
+ severity: "error" | "warning";
2009
+ description: string;
1983
2010
  files: string[];
1984
2011
  name: string;
1985
- description: string;
1986
- severity: "error" | "warning";
1987
2012
  rule: {
1988
2013
  type: "must-export";
1989
2014
  names: string[];
@@ -2001,8 +2026,8 @@ declare const PatternConfigSchema: z.ZodObject<{
2001
2026
  type: "no-import";
2002
2027
  from: string;
2003
2028
  } | {
2004
- match: string;
2005
2029
  type: "naming";
2030
+ match: string;
2006
2031
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2007
2032
  } | {
2008
2033
  type: "max-exports";
@@ -2121,12 +2146,12 @@ declare const EntropyConfigSchema: z.ZodObject<{
2121
2146
  match: z.ZodString;
2122
2147
  convention: z.ZodEnum<["camelCase", "PascalCase", "UPPER_SNAKE", "kebab-case"]>;
2123
2148
  }, "strip", z.ZodTypeAny, {
2124
- match: string;
2125
2149
  type: "naming";
2150
+ match: string;
2126
2151
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2127
2152
  }, {
2128
- match: string;
2129
2153
  type: "naming";
2154
+ match: string;
2130
2155
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2131
2156
  }>, z.ZodObject<{
2132
2157
  type: z.ZodLiteral<"max-exports">;
@@ -2158,10 +2183,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2158
2183
  }>]>;
2159
2184
  message: z.ZodOptional<z.ZodString>;
2160
2185
  }, "strip", z.ZodTypeAny, {
2186
+ severity: "error" | "warning";
2187
+ description: string;
2161
2188
  files: string[];
2162
2189
  name: string;
2163
- description: string;
2164
- severity: "error" | "warning";
2165
2190
  rule: {
2166
2191
  type: "must-export";
2167
2192
  names: string[];
@@ -2179,8 +2204,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2179
2204
  type: "no-import";
2180
2205
  from: string;
2181
2206
  } | {
2182
- match: string;
2183
2207
  type: "naming";
2208
+ match: string;
2184
2209
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2185
2210
  } | {
2186
2211
  type: "max-exports";
@@ -2194,10 +2219,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2194
2219
  };
2195
2220
  message?: string | undefined;
2196
2221
  }, {
2222
+ severity: "error" | "warning";
2223
+ description: string;
2197
2224
  files: string[];
2198
2225
  name: string;
2199
- description: string;
2200
- severity: "error" | "warning";
2201
2226
  rule: {
2202
2227
  type: "must-export";
2203
2228
  names: string[];
@@ -2215,8 +2240,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2215
2240
  type: "no-import";
2216
2241
  from: string;
2217
2242
  } | {
2218
- match: string;
2219
2243
  type: "naming";
2244
+ match: string;
2220
2245
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2221
2246
  } | {
2222
2247
  type: "max-exports";
@@ -2234,10 +2259,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2234
2259
  ignoreFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2235
2260
  }, "strip", z.ZodTypeAny, {
2236
2261
  patterns: {
2262
+ severity: "error" | "warning";
2263
+ description: string;
2237
2264
  files: string[];
2238
2265
  name: string;
2239
- description: string;
2240
- severity: "error" | "warning";
2241
2266
  rule: {
2242
2267
  type: "must-export";
2243
2268
  names: string[];
@@ -2255,8 +2280,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2255
2280
  type: "no-import";
2256
2281
  from: string;
2257
2282
  } | {
2258
- match: string;
2259
2283
  type: "naming";
2284
+ match: string;
2260
2285
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2261
2286
  } | {
2262
2287
  type: "max-exports";
@@ -2274,10 +2299,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2274
2299
  ignoreFiles?: string[] | undefined;
2275
2300
  }, {
2276
2301
  patterns: {
2302
+ severity: "error" | "warning";
2303
+ description: string;
2277
2304
  files: string[];
2278
2305
  name: string;
2279
- description: string;
2280
- severity: "error" | "warning";
2281
2306
  rule: {
2282
2307
  type: "must-export";
2283
2308
  names: string[];
@@ -2295,8 +2320,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2295
2320
  type: "no-import";
2296
2321
  from: string;
2297
2322
  } | {
2298
- match: string;
2299
2323
  type: "naming";
2324
+ match: string;
2300
2325
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2301
2326
  } | {
2302
2327
  type: "max-exports";
@@ -2330,10 +2355,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2330
2355
  } | undefined;
2331
2356
  patterns?: boolean | {
2332
2357
  patterns: {
2358
+ severity: "error" | "warning";
2359
+ description: string;
2333
2360
  files: string[];
2334
2361
  name: string;
2335
- description: string;
2336
- severity: "error" | "warning";
2337
2362
  rule: {
2338
2363
  type: "must-export";
2339
2364
  names: string[];
@@ -2351,8 +2376,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2351
2376
  type: "no-import";
2352
2377
  from: string;
2353
2378
  } | {
2354
- match: string;
2355
2379
  type: "naming";
2380
+ match: string;
2356
2381
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2357
2382
  } | {
2358
2383
  type: "max-exports";
@@ -2386,10 +2411,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2386
2411
  } | undefined;
2387
2412
  patterns?: boolean | {
2388
2413
  patterns: {
2414
+ severity: "error" | "warning";
2415
+ description: string;
2389
2416
  files: string[];
2390
2417
  name: string;
2391
- description: string;
2392
- severity: "error" | "warning";
2393
2418
  rule: {
2394
2419
  type: "must-export";
2395
2420
  names: string[];
@@ -2407,8 +2432,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2407
2432
  type: "no-import";
2408
2433
  from: string;
2409
2434
  } | {
2410
- match: string;
2411
2435
  type: "naming";
2436
+ match: string;
2412
2437
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2413
2438
  } | {
2414
2439
  type: "max-exports";
@@ -2448,10 +2473,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2448
2473
  } | undefined;
2449
2474
  patterns?: boolean | {
2450
2475
  patterns: {
2476
+ severity: "error" | "warning";
2477
+ description: string;
2451
2478
  files: string[];
2452
2479
  name: string;
2453
- description: string;
2454
- severity: "error" | "warning";
2455
2480
  rule: {
2456
2481
  type: "must-export";
2457
2482
  names: string[];
@@ -2469,8 +2494,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2469
2494
  type: "no-import";
2470
2495
  from: string;
2471
2496
  } | {
2472
- match: string;
2473
2497
  type: "naming";
2498
+ match: string;
2474
2499
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2475
2500
  } | {
2476
2501
  type: "max-exports";
@@ -2512,10 +2537,10 @@ declare const EntropyConfigSchema: z.ZodObject<{
2512
2537
  } | undefined;
2513
2538
  patterns?: boolean | {
2514
2539
  patterns: {
2540
+ severity: "error" | "warning";
2541
+ description: string;
2515
2542
  files: string[];
2516
2543
  name: string;
2517
- description: string;
2518
- severity: "error" | "warning";
2519
2544
  rule: {
2520
2545
  type: "must-export";
2521
2546
  names: string[];
@@ -2533,8 +2558,8 @@ declare const EntropyConfigSchema: z.ZodObject<{
2533
2558
  type: "no-import";
2534
2559
  from: string;
2535
2560
  } | {
2536
- match: string;
2537
2561
  type: "naming";
2562
+ match: string;
2538
2563
  convention: "camelCase" | "PascalCase" | "UPPER_SNAKE" | "kebab-case";
2539
2564
  } | {
2540
2565
  type: "max-exports";
@@ -3250,13 +3275,13 @@ declare const FailureEntrySchema: z.ZodObject<{
3250
3275
  description: z.ZodString;
3251
3276
  }, "strip", z.ZodTypeAny, {
3252
3277
  type: string;
3253
- description: string;
3254
3278
  date: string;
3279
+ description: string;
3255
3280
  skill: string;
3256
3281
  }, {
3257
3282
  type: string;
3258
- description: string;
3259
3283
  date: string;
3284
+ description: string;
3260
3285
  skill: string;
3261
3286
  }>;
3262
3287
  type FailureEntry = z.infer<typeof FailureEntrySchema>;
@@ -3319,14 +3344,14 @@ declare const GateResultSchema: z.ZodObject<{
3319
3344
  output: z.ZodOptional<z.ZodString>;
3320
3345
  duration: z.ZodOptional<z.ZodNumber>;
3321
3346
  }, "strip", z.ZodTypeAny, {
3322
- name: string;
3323
3347
  passed: boolean;
3348
+ name: string;
3324
3349
  command: string;
3325
3350
  output?: string | undefined;
3326
3351
  duration?: number | undefined;
3327
3352
  }, {
3328
- name: string;
3329
3353
  passed: boolean;
3354
+ name: string;
3330
3355
  command: string;
3331
3356
  output?: string | undefined;
3332
3357
  duration?: number | undefined;
@@ -3334,8 +3359,8 @@ declare const GateResultSchema: z.ZodObject<{
3334
3359
  }, "strip", z.ZodTypeAny, {
3335
3360
  passed: boolean;
3336
3361
  checks: {
3337
- name: string;
3338
3362
  passed: boolean;
3363
+ name: string;
3339
3364
  command: string;
3340
3365
  output?: string | undefined;
3341
3366
  duration?: number | undefined;
@@ -3343,8 +3368,8 @@ declare const GateResultSchema: z.ZodObject<{
3343
3368
  }, {
3344
3369
  passed: boolean;
3345
3370
  checks: {
3346
- name: string;
3347
3371
  passed: boolean;
3372
+ name: string;
3348
3373
  command: string;
3349
3374
  output?: string | undefined;
3350
3375
  duration?: number | undefined;
@@ -3407,13 +3432,13 @@ declare const HarnessStateSchema: z.ZodObject<{
3407
3432
  description: z.ZodString;
3408
3433
  status: z.ZodEnum<["open", "resolved"]>;
3409
3434
  }, "strip", z.ZodTypeAny, {
3435
+ status: "resolved" | "open";
3410
3436
  id: string;
3411
3437
  description: string;
3412
- status: "resolved" | "open";
3413
3438
  }, {
3439
+ status: "resolved" | "open";
3414
3440
  id: string;
3415
3441
  description: string;
3416
- status: "resolved" | "open";
3417
3442
  }>, "many">>;
3418
3443
  progress: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<["pending", "in_progress", "complete"]>>>;
3419
3444
  lastSession: z.ZodOptional<z.ZodObject<{
@@ -3439,9 +3464,9 @@ declare const HarnessStateSchema: z.ZodObject<{
3439
3464
  decision: string;
3440
3465
  }[];
3441
3466
  blockers: {
3467
+ status: "resolved" | "open";
3442
3468
  id: string;
3443
3469
  description: string;
3444
- status: "resolved" | "open";
3445
3470
  }[];
3446
3471
  schemaVersion: 1;
3447
3472
  position: {
@@ -3463,9 +3488,9 @@ declare const HarnessStateSchema: z.ZodObject<{
3463
3488
  decision: string;
3464
3489
  }[] | undefined;
3465
3490
  blockers?: {
3491
+ status: "resolved" | "open";
3466
3492
  id: string;
3467
3493
  description: string;
3468
- status: "resolved" | "open";
3469
3494
  }[] | undefined;
3470
3495
  position?: {
3471
3496
  task?: string | undefined;
@@ -3482,20 +3507,80 @@ declare const HarnessStateSchema: z.ZodObject<{
3482
3507
  type HarnessState = z.infer<typeof HarnessStateSchema>;
3483
3508
  declare const DEFAULT_STATE: HarnessState;
3484
3509
 
3485
- declare function loadState(projectPath: string, stream?: string): Promise<Result<HarnessState, Error>>;
3486
- declare function saveState(projectPath: string, state: HarnessState, stream?: string): Promise<Result<void, Error>>;
3487
- declare function appendLearning(projectPath: string, learning: string, skillName?: string, outcome?: string, stream?: string): Promise<Result<void, Error>>;
3488
- declare function loadRelevantLearnings(projectPath: string, skillName?: string, stream?: string): Promise<Result<string[], Error>>;
3489
- declare function appendFailure(projectPath: string, description: string, skillName: string, type: string, stream?: string): Promise<Result<void, Error>>;
3490
- declare function loadFailures(projectPath: string, stream?: string): Promise<Result<Array<{
3510
+ declare function loadState(projectPath: string, stream?: string, session?: string): Promise<Result<HarnessState, Error>>;
3511
+ declare function saveState(projectPath: string, state: HarnessState, stream?: string, session?: string): Promise<Result<void, Error>>;
3512
+
3513
+ declare function clearLearningsCache(): void;
3514
+ declare function appendLearning(projectPath: string, learning: string, skillName?: string, outcome?: string, stream?: string, session?: string): Promise<Result<void, Error>>;
3515
+ /**
3516
+ * Parse date from a learning entry. Returns the date string or null.
3517
+ * Entries look like: "- **2026-03-25 [skill:X]:** content"
3518
+ * or heading format: "## 2026-03-25 — Task 3: ..."
3519
+ */
3520
+ declare function parseDateFromEntry(entry: string): string | null;
3521
+ interface LearningPattern {
3522
+ tag: string;
3523
+ count: number;
3524
+ entries: string[];
3525
+ }
3526
+ /**
3527
+ * Analyze learning entries for recurring patterns.
3528
+ * Groups entries by [skill:X] and [outcome:Y] tags.
3529
+ * Returns patterns where 3+ entries share the same tag.
3530
+ */
3531
+ declare function analyzeLearningPatterns(entries: string[]): LearningPattern[];
3532
+ interface BudgetedLearningsOptions {
3533
+ intent: string;
3534
+ tokenBudget?: number;
3535
+ skill?: string;
3536
+ session?: string;
3537
+ stream?: string;
3538
+ }
3539
+ /**
3540
+ * Load learnings with token budget, two-tier loading, recency sorting, and relevance filtering.
3541
+ *
3542
+ * - Session learnings (primary): always loaded first if session is provided
3543
+ * - Global learnings (secondary): loaded to fill remaining budget
3544
+ * - Sorted by recency (newest first) within each tier
3545
+ * - Filtered by relevance to intent (matching entries prioritized)
3546
+ * - Capped at tokenBudget (default 1000 tokens)
3547
+ */
3548
+ declare function loadBudgetedLearnings(projectPath: string, options: BudgetedLearningsOptions): Promise<Result<string[], Error>>;
3549
+ declare function loadRelevantLearnings(projectPath: string, skillName?: string, stream?: string, session?: string): Promise<Result<string[], Error>>;
3550
+ interface PruneResult {
3551
+ kept: number;
3552
+ archived: number;
3553
+ patterns: LearningPattern[];
3554
+ }
3555
+ /**
3556
+ * Archive learning entries to .harness/learnings-archive/{YYYY-MM}.md.
3557
+ * Appends to existing archive file if one exists for the current month.
3558
+ */
3559
+ declare function archiveLearnings(projectPath: string, entries: string[], stream?: string): Promise<Result<void, Error>>;
3560
+ /**
3561
+ * Prune global learnings: analyze patterns, archive old entries, keep 20 most recent.
3562
+ *
3563
+ * Pruning triggers when:
3564
+ * - Entry count exceeds 30, OR
3565
+ * - Entries older than 14 days exist AND total count exceeds 20
3566
+ *
3567
+ * Returns the prune result with pattern analysis and counts.
3568
+ */
3569
+ declare function pruneLearnings(projectPath: string, stream?: string): Promise<Result<PruneResult, Error>>;
3570
+
3571
+ declare function clearFailuresCache(): void;
3572
+ declare function appendFailure(projectPath: string, description: string, skillName: string, type: string, stream?: string, session?: string): Promise<Result<void, Error>>;
3573
+ declare function loadFailures(projectPath: string, stream?: string, session?: string): Promise<Result<Array<{
3491
3574
  date: string;
3492
3575
  skill: string;
3493
3576
  type: string;
3494
3577
  description: string;
3495
3578
  }>, Error>>;
3496
- declare function archiveFailures(projectPath: string, stream?: string): Promise<Result<void, Error>>;
3497
- declare function saveHandoff(projectPath: string, handoff: Handoff, stream?: string): Promise<Result<void, Error>>;
3498
- declare function loadHandoff(projectPath: string, stream?: string): Promise<Result<Handoff | null, Error>>;
3579
+ declare function archiveFailures(projectPath: string, stream?: string, session?: string): Promise<Result<void, Error>>;
3580
+
3581
+ declare function saveHandoff(projectPath: string, handoff: Handoff, stream?: string, session?: string): Promise<Result<void, Error>>;
3582
+ declare function loadHandoff(projectPath: string, stream?: string, session?: string): Promise<Result<Handoff | null, Error>>;
3583
+
3499
3584
  declare function runMechanicalGate(projectPath: string): Promise<Result<GateResult, Error>>;
3500
3585
 
3501
3586
  declare const StreamInfoSchema: z.ZodObject<{
@@ -3583,6 +3668,53 @@ declare function archiveStream(projectPath: string, name: string): Promise<Resul
3583
3668
  declare function getStreamForBranch(index: StreamIndex, branch: string): string | null;
3584
3669
  declare function migrateToStreams(projectPath: string): Promise<Result<void, Error>>;
3585
3670
 
3671
+ /**
3672
+ * Resolves the directory path for a session.
3673
+ * Optionally creates the directory if it does not exist.
3674
+ */
3675
+ declare function resolveSessionDir(projectPath: string, sessionSlug: string, options?: {
3676
+ create?: boolean;
3677
+ }): Result<string, Error>;
3678
+ /**
3679
+ * Updates the session index.md file with an entry for the given session.
3680
+ * Creates the file if it does not exist.
3681
+ * Updates existing entries in-place (per-slug line ownership).
3682
+ */
3683
+ declare function updateSessionIndex(projectPath: string, sessionSlug: string, description: string): void;
3684
+
3685
+ /**
3686
+ * Data required to write a session summary.
3687
+ * Required fields: session, lastActive, skill, status, keyContext, nextStep.
3688
+ * Optional fields: phase, spec, plan.
3689
+ */
3690
+ interface SessionSummaryData {
3691
+ session: string;
3692
+ lastActive: string;
3693
+ skill: string;
3694
+ phase?: string;
3695
+ status: string;
3696
+ spec?: string;
3697
+ plan?: string;
3698
+ keyContext: string;
3699
+ nextStep: string;
3700
+ }
3701
+ /**
3702
+ * Writes a session summary to the session directory and updates the session index.
3703
+ * Creates the session directory if it does not exist.
3704
+ * Overwrites any existing summary for this session.
3705
+ */
3706
+ declare function writeSessionSummary(projectPath: string, sessionSlug: string, data: SessionSummaryData): Result<void, Error>;
3707
+ /**
3708
+ * Loads a session's summary.md contents.
3709
+ * Returns the raw markdown string, or null if the file does not exist.
3710
+ */
3711
+ declare function loadSessionSummary(projectPath: string, sessionSlug: string): Result<string | null, Error>;
3712
+ /**
3713
+ * Lists active sessions by reading the session index file.
3714
+ * Returns the raw markdown contents of index.md, or null if it does not exist.
3715
+ */
3716
+ declare function listActiveSessions(projectPath: string): Result<string | null, Error>;
3717
+
3586
3718
  type StepExecutor = (step: WorkflowStep, previousArtifact?: string) => Promise<WorkflowStepResult>;
3587
3719
  declare function executeWorkflow(workflow: Workflow, executor: StepExecutor): Promise<WorkflowResult>;
3588
3720
 
@@ -3714,9 +3846,9 @@ declare const SecurityConfigSchema: z.ZodObject<{
3714
3846
  } | undefined;
3715
3847
  }>>;
3716
3848
  }, "strip", z.ZodTypeAny, {
3717
- rules: Record<string, "error" | "warning" | "info" | "off">;
3718
3849
  enabled: boolean;
3719
3850
  strict: boolean;
3851
+ rules: Record<string, "error" | "warning" | "info" | "off">;
3720
3852
  exclude: string[];
3721
3853
  external?: {
3722
3854
  semgrep?: {
@@ -3728,9 +3860,9 @@ declare const SecurityConfigSchema: z.ZodObject<{
3728
3860
  } | undefined;
3729
3861
  } | undefined;
3730
3862
  }, {
3731
- rules?: Record<string, "error" | "warning" | "info" | "off"> | undefined;
3732
3863
  enabled?: boolean | undefined;
3733
3864
  strict?: boolean | undefined;
3865
+ rules?: Record<string, "error" | "warning" | "info" | "off"> | undefined;
3734
3866
  exclude?: string[] | undefined;
3735
3867
  external?: {
3736
3868
  semgrep?: {
@@ -3787,35 +3919,6 @@ interface RunCIChecksInput {
3787
3919
  }
3788
3920
  declare function runCIChecks(input: RunCIChecksInput): Promise<Result<CICheckReport, Error>>;
3789
3921
 
3790
- /**
3791
- * An index of mechanical findings, queryable by file + line range.
3792
- * Used in Phase 5 (VALIDATE) to determine whether an AI-produced finding
3793
- * overlaps with a mechanical finding and should be excluded.
3794
- */
3795
- declare class ExclusionSet {
3796
- /** Findings indexed by file path for O(1) file lookup */
3797
- private byFile;
3798
- private allFindings;
3799
- constructor(findings: MechanicalFinding[]);
3800
- /**
3801
- * Returns true if any mechanical finding covers the given file + line range.
3802
- *
3803
- * A mechanical finding "covers" a range if:
3804
- * - The file matches, AND
3805
- * - The finding has no line (file-level finding — covers everything), OR
3806
- * - The finding's line falls within [startLine, endLine] inclusive.
3807
- */
3808
- isExcluded(file: string, lineRange: [number, number]): boolean;
3809
- /** Number of findings in the set */
3810
- get size(): number;
3811
- /** Returns a copy of all findings */
3812
- getFindings(): MechanicalFinding[];
3813
- }
3814
- /**
3815
- * Build an ExclusionSet from mechanical findings.
3816
- */
3817
- declare function buildExclusionSet(findings: MechanicalFinding[]): ExclusionSet;
3818
-
3819
3922
  /**
3820
3923
  * A finding produced by a mechanical check (lint, typecheck, security scan, harness validate/deps/docs).
3821
3924
  * Used as input to the exclusion set and reported when the pipeline stops due to mechanical failures.
@@ -3866,6 +3969,7 @@ interface MechanicalCheckOptions {
3866
3969
  /** Only scan these files for security (e.g., changed files from a PR) */
3867
3970
  changedFiles?: string[];
3868
3971
  }
3972
+
3869
3973
  /**
3870
3974
  * Change type detected from commit message prefix or diff heuristic.
3871
3975
  */
@@ -3983,6 +4087,7 @@ interface ContextScopeOptions {
3983
4087
  /** Pre-gathered commit history entries. If provided, included in all bundles. */
3984
4088
  commitHistory?: CommitHistoryEntry[];
3985
4089
  }
4090
+
3986
4091
  /**
3987
4092
  * Model tier — abstract label resolved at runtime from project config.
3988
4093
  * - fast: haiku-class (gate, context phases)
@@ -4061,6 +4166,7 @@ interface FanOutOptions {
4061
4166
  /** Context bundles from Phase 3 (one per domain) */
4062
4167
  bundles: ContextBundle[];
4063
4168
  }
4169
+
4064
4170
  /**
4065
4171
  * Assessment decision — determines exit code and PR review action.
4066
4172
  */
@@ -4135,6 +4241,36 @@ interface EligibilityResult {
4135
4241
  /** Human-readable reason when not eligible */
4136
4242
  reason?: string;
4137
4243
  }
4244
+
4245
+ /**
4246
+ * An index of mechanical findings, queryable by file + line range.
4247
+ * Used in Phase 5 (VALIDATE) to determine whether an AI-produced finding
4248
+ * overlaps with a mechanical finding and should be excluded.
4249
+ */
4250
+ declare class ExclusionSet {
4251
+ /** Findings indexed by file path for O(1) file lookup */
4252
+ private byFile;
4253
+ private allFindings;
4254
+ constructor(findings: MechanicalFinding[]);
4255
+ /**
4256
+ * Returns true if any mechanical finding covers the given file + line range.
4257
+ *
4258
+ * A mechanical finding "covers" a range if:
4259
+ * - The file matches, AND
4260
+ * - The finding has no line (file-level finding — covers everything), OR
4261
+ * - The finding's line falls within [startLine, endLine] inclusive.
4262
+ */
4263
+ isExcluded(file: string, lineRange: [number, number]): boolean;
4264
+ /** Number of findings in the set */
4265
+ get size(): number;
4266
+ /** Returns a copy of all findings */
4267
+ getFindings(): MechanicalFinding[];
4268
+ }
4269
+ /**
4270
+ * Build an ExclusionSet from mechanical findings.
4271
+ */
4272
+ declare function buildExclusionSet(findings: MechanicalFinding[]): ExclusionSet;
4273
+
4138
4274
  /**
4139
4275
  * Configuration mapping abstract model tiers to concrete model identifiers.
4140
4276
  * All tiers are optional — unmapped tiers resolve to undefined (use current model).
@@ -4542,12 +4678,12 @@ declare const QuestionSchema: z.ZodObject<{
4542
4678
  default: z.ZodOptional<z.ZodString>;
4543
4679
  }, "strip", z.ZodTypeAny, {
4544
4680
  text: string;
4545
- default?: string | undefined;
4546
4681
  options?: string[] | undefined;
4682
+ default?: string | undefined;
4547
4683
  }, {
4548
4684
  text: string;
4549
- default?: string | undefined;
4550
4685
  options?: string[] | undefined;
4686
+ default?: string | undefined;
4551
4687
  }>;
4552
4688
  declare const ConfirmationSchema: z.ZodObject<{
4553
4689
  text: z.ZodString;
@@ -4591,12 +4727,12 @@ declare const EmitInteractionInputSchema: z.ZodObject<{
4591
4727
  default: z.ZodOptional<z.ZodString>;
4592
4728
  }, "strip", z.ZodTypeAny, {
4593
4729
  text: string;
4594
- default?: string | undefined;
4595
4730
  options?: string[] | undefined;
4731
+ default?: string | undefined;
4596
4732
  }, {
4597
4733
  text: string;
4598
- default?: string | undefined;
4599
4734
  options?: string[] | undefined;
4735
+ default?: string | undefined;
4600
4736
  }>>;
4601
4737
  confirmation: z.ZodOptional<z.ZodObject<{
4602
4738
  text: z.ZodString;
@@ -4636,8 +4772,8 @@ declare const EmitInteractionInputSchema: z.ZodObject<{
4636
4772
  stream?: string | undefined;
4637
4773
  question?: {
4638
4774
  text: string;
4639
- default?: string | undefined;
4640
4775
  options?: string[] | undefined;
4776
+ default?: string | undefined;
4641
4777
  } | undefined;
4642
4778
  confirmation?: {
4643
4779
  text: string;
@@ -4657,8 +4793,8 @@ declare const EmitInteractionInputSchema: z.ZodObject<{
4657
4793
  stream?: string | undefined;
4658
4794
  question?: {
4659
4795
  text: string;
4660
- default?: string | undefined;
4661
4796
  options?: string[] | undefined;
4797
+ default?: string | undefined;
4662
4798
  } | undefined;
4663
4799
  confirmation?: {
4664
4800
  text: string;
@@ -4679,22 +4815,15 @@ type Confirmation = z.infer<typeof ConfirmationSchema>;
4679
4815
  type Transition = z.infer<typeof TransitionSchema>;
4680
4816
  type EmitInteractionInput = z.infer<typeof EmitInteractionInputSchema>;
4681
4817
 
4682
- interface Quiz$1 {
4683
- questions: {
4684
- question: string;
4685
- answer: string;
4686
- }[];
4687
- }
4688
- interface Content$1 {
4818
+ interface Content {
4689
4819
  codeTranslation: string;
4690
- quiz: Quiz$1;
4691
4820
  }
4692
4821
  interface BlueprintModule {
4693
4822
  id: string;
4694
4823
  title: string;
4695
4824
  description: string;
4696
4825
  files: string[];
4697
- content?: Content$1;
4826
+ content?: Content;
4698
4827
  }
4699
4828
  interface Hotspot {
4700
4829
  file: string;
@@ -4728,16 +4857,6 @@ declare class BlueprintGenerator {
4728
4857
  generate(data: BlueprintData, options: BlueprintOptions): Promise<void>;
4729
4858
  }
4730
4859
 
4731
- interface Content {
4732
- codeTranslation: string;
4733
- quiz: Quiz;
4734
- }
4735
- interface Quiz {
4736
- questions: {
4737
- question: string;
4738
- answer: string;
4739
- }[];
4740
- }
4741
4860
  declare class ContentPipeline {
4742
4861
  generateModuleContent(module: BlueprintModule): Promise<Content>;
4743
4862
  }
@@ -4800,4 +4919,4 @@ declare function getUpdateNotification(currentVersion: string): string | null;
4800
4919
  */
4801
4920
  declare const VERSION = "0.11.0";
4802
4921
 
4803
- export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content$1 as Content, ContentPipeline, type ContextBundle, type ContextError, type ContextFile, type ContextFilterResult, type ContextScopeOptions, type Contributions, ContributionsSchema, type Convention, CouplingCollector, type CouplingConfig, type CouplingReport, type CouplingThresholds, type CouplingViolation, type CoverageOptions, type CoverageReport, type CriticalPathEntry, CriticalPathResolver, type CriticalPathSet, type CustomRule, type CustomRuleResult, DEFAULT_PROVIDER_TIERS, DEFAULT_SECURITY_CONFIG, DEFAULT_STATE, DEFAULT_STREAM_INDEX, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DeduplicateFindingsOptions, DepDepthCollector, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DetectStaleResult, type DiffInfo, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, type EligibilityResult, type EmitInteractionInput, EmitInteractionInputSchema, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, ExclusionSet, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FanOutOptions, type FeedbackAgentConfig, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type FindingSeverity, type Fix, type FixConfig, type FixResult, type FixType, ForbiddenImportCollector, type ForbiddenImportViolation, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type GitHubInlineComment, type GraphAdapter, type GraphComplexityData, type GraphCouplingData, type GraphCoverageData, type GraphCriticalPathData, type GraphDependencyData, type GraphHarnessCheckData, type GraphImpactData, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Hotspot, type HotspotContext, type Import, type InlineReference, type IntegrityReport, type InteractionType, InteractionTypeSchema, type InternalSymbol, type JSDocComment, type LanguageParser, type Layer, type LayerConfig, LayerViolationCollector, type Lockfile, type LockfilePackage, LockfilePackageSchema, LockfileSchema, type LogEntry, type LogFilter, type Manifest, ManifestSchema, type MechanicalCheckOptions, type MechanicalCheckResult, type MechanicalCheckStatus, type MechanicalFinding, type MergeResult, type Metric, MetricResult, type ModelProvider, type ModelTier, type ModelTierConfig, type ModuleDependency, ModuleSizeCollector, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type OrphanedDep, type ParseError, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineContext, type PipelineFlags, type PipelineOptions, type PipelineResult, type PrMetadata, type PriorReview, ProjectScanner, type ProviderDefaults, type Question, QuestionSchema, type Quiz$1 as Quiz, REQUIRED_SECTIONS, type ReachabilityNode, RegressionDetector, type RegressionReport, type RegressionResult, type ReviewAgentDescriptor, type ReviewAssessment, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewDomain, type ReviewFinding, type ReviewItem, type ReviewOutputOptions, type ReviewPipelineResult, type ReviewStrength, type RuleOverride, RuleRegistry, type RunCIChecksInput, type RunPipelineOptions, SECURITY_DESCRIPTOR, type SafetyLevel, type ScanResult, type SecurityCategory, type SecurityConfidence, type SecurityConfig, SecurityConfigSchema, type SecurityFinding, type SecurityRule, SecurityScanner, type SecuritySeverity, type SelfReviewConfig, SharableBoundaryConfigSchema, SharableForbiddenImportSchema, SharableLayerSchema, SharableSecurityRulesSchema, type SizeBudgetConfig, type SizeBudgetReport, type SizeBudgetViolation, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StaleConstraint, type StepExecutor, type StreamIndex, StreamIndexSchema, type StreamInfo, StreamInfoSchema, type StructureValidation, type Suggestion, type SuggestionReport, type SyncChange, type SyncOptions, type TelemetryAdapter, type TelemetryHealth, ThresholdConfig, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type Transition, TransitionSchema, type TurnExecutor, TypeScriptParser, type UnusedImport, type UpdateCheckState, VERSION, type ValidateFindingsOptions, type ValidationError, type WorkflowPhase, addProvenance, analyzeDiff, appendFailure, appendLearning, applyFixes, applyHotspotDowngrade, archiveFailures, archiveStream, buildDependencyGraph, buildExclusionSet, buildSnapshot, checkDocCoverage, checkEligibility, classifyFinding, configureFeedback, constraintRuleId, contextBudget, contextFilter, createBoundaryValidator, createCommentedCodeFixes, createError, createFixes, createForbiddenImportFixes, createOrphanedDepFixes, createParseError, createSelfReview, createStream, cryptoRules, deduplicateCleanupFindings, deduplicateFindings, deepMergeConstraints, defaultCollectors, defineLayer, deserializationRules, detectChangeType, detectCircularDeps, detectCircularDepsInFiles, detectComplexityViolations, detectCouplingViolations, detectDeadCode, detectDocDrift, detectPatternViolations, detectSizeBudgetViolations, detectStack, detectStaleConstraints, determineAssessment, diff, executeWorkflow, expressRules, extractBundle, extractMarkdownLinks, extractSections, fanOutReview, formatFindingBlock, formatGitHubComment, formatGitHubSummary, formatTerminalOutput, generateAgentsMap, generateSuggestions, getActionEmitter, getExitCode, getFeedbackConfig, getPhaseCategories, getStreamForBranch, getUpdateNotification, goRules, injectionRules, isSmallSuggestion, isUpdateCheckEnabled, listStreams, loadFailures, loadHandoff, loadRelevantLearnings, loadState, loadStreamIndex, logAgentAction, migrateToStreams, networkRules, nodeRules, parseDiff, parseManifest, parseRoadmap, parseSecurityConfig, parseSize, pathTraversalRules, previewFix, reactRules, readCheckState, readLockfile, removeProvenance, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resolveFileToLayer, resolveModelTier, resolveRuleSeverity, resolveStreamPath, resolveThresholds, runAll, runArchitectureAgent, runBugDetectionAgent, runCIChecks, runComplianceAgent, runMechanicalChecks, runMechanicalGate, runMultiTurnPipeline, runPipeline, runReviewPipeline, runSecurityAgent, saveHandoff, saveState, saveStreamIndex, scopeContext, secretRules, serializeRoadmap, setActiveStream, shouldRunCheck, spawnBackgroundCheck, syncConstraintNodes, syncRoadmap, touchStream, trackAction, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateFindings, validateKnowledgeMap, validatePatternConfig, violationId, writeConfig, writeLockfile, xssRules };
4922
+ export { AGENT_DESCRIPTORS, ARCHITECTURE_DESCRIPTOR, type AST, type ActionContext, type ActionEvent, type ActionEventHandler, type ActionEventType, type ActionResult, type ActionSink, type ActionTracker, type ActionType, type AgentAction, AgentActionEmitter, type AgentExecutor, type AgentMapLink, type AgentMapSection, type AgentMapValidation, type AgentProcess, type AgentReviewResult, type AgentType, type AgentsMapConfig, ArchBaseline, ArchBaselineManager, ArchConfig, ArchDiffResult, ArchMetricCategory, BUG_DETECTION_DESCRIPTOR, type BaseError, type Baseline, BaselineManager, type BaselinesFile, type BenchmarkResult, type BenchmarkRunOptions, BenchmarkRunner, type BlueprintData, BlueprintGenerator, type BlueprintModule, type BlueprintOptions, type BoundaryDefinition, type BoundaryValidation, type BoundaryValidator, type BoundaryViolation, type BrokenLink, type BudgetedLearningsOptions, type Bundle, type BundleConstraints, BundleConstraintsSchema, BundleSchema, COMPLIANCE_DESCRIPTOR, type ChangeType, type ChangedFile, ChecklistBuilder, type CircularDependency, CircularDepsCollector, type CircularDepsResult, type CleanupFinding, type CodeBlock, type CodeChanges, type CodePattern, type CodeReference, type CodebaseSnapshot, Collector, type CommentedCodeBlock, type CommitFormat, type CommitHistoryEntry, type CommitValidation, ComplexityCollector, type ComplexityConfig, type ComplexityReport, type ComplexityThresholds, type ComplexityViolation, type ConfigError, type ConfigPattern, type Confirmation, ConfirmationSchema, type ConflictReport, ConsoleSink, type ConstraintError, type ConstraintNodeStore, ConstraintRule, type Content, ContentPipeline, type ContextBundle, type ContextError, type ContextFile, type ContextFilterResult, type ContextScopeOptions, type Contributions, ContributionsSchema, type Convention, CouplingCollector, type CouplingConfig, type CouplingReport, type CouplingThresholds, type CouplingViolation, type CoverageOptions, type CoverageReport, type CriticalPathEntry, CriticalPathResolver, type CriticalPathSet, type CustomRule, type CustomRuleResult, DEFAULT_PROVIDER_TIERS, DEFAULT_SECURITY_CONFIG, DEFAULT_STATE, DEFAULT_STREAM_INDEX, type DeadCodeConfig, type DeadCodeReport, type DeadExport, type DeadFile, type DeadInternal, type DeduplicateFindingsOptions, DepDepthCollector, type DependencyEdge, type DependencyGraph, type DependencyValidation, type DependencyViolation, type DetectStaleResult, type DiffInfo, type DocumentationDrift, type DocumentationFile, type DocumentationGap, type DriftConfig, type DriftReport, type EligibilityResult, type EmitInteractionInput, EmitInteractionInputSchema, EntropyAnalyzer, type EntropyConfig, EntropyConfigSchema, type EntropyError, type EntropyReport, ExclusionSet, type ExecutorHealth, type Export, type ExportMap, type FailureEntry, FailureEntrySchema, type FanOutOptions, type FeedbackAgentConfig, type FeedbackConfig, type FeedbackError$1 as FeedbackError, type FileCategory, FileSink, type FindingSeverity, type Fix, type FixConfig, type FixResult, type FixType, ForbiddenImportCollector, type ForbiddenImportViolation, type ForbiddenPattern, type GateConfig, GateConfigSchema, type GateResult, GateResultSchema, type GenerationSection, type GitHubInlineComment, type GraphAdapter, type GraphComplexityData, type GraphCouplingData, type GraphCoverageData, type GraphCriticalPathData, type GraphDependencyData, type GraphHarnessCheckData, type GraphImpactData, type Handoff, HandoffSchema, type HarnessState, HarnessStateSchema, type HealthCheckResult, type Hotspot, type HotspotContext, type Import, type InlineReference, type IntegrityReport, type InteractionType, InteractionTypeSchema, type InternalSymbol, type JSDocComment, type LanguageParser, type Layer, type LayerConfig, LayerViolationCollector, type LearningPattern, type Lockfile, type LockfilePackage, LockfilePackageSchema, LockfileSchema, type LogEntry, type LogFilter, type Manifest, ManifestSchema, type MechanicalCheckOptions, type MechanicalCheckResult, type MechanicalCheckStatus, type MechanicalFinding, type MergeResult, type Metric, MetricResult, type ModelProvider, type ModelTier, type ModelTierConfig, type ModuleDependency, ModuleSizeCollector, NoOpExecutor, NoOpSink, NoOpTelemetryAdapter, type OrphanedDep, type ParseError, type PatternConfig, PatternConfigSchema, type PatternMatch, type PatternReport, type PatternViolation, type PeerReview, type PeerReviewOptions, type PipelineContext, type PipelineFlags, type PipelineOptions, type PipelineResult, type PrMetadata, type PriorReview, ProjectScanner, type ProviderDefaults, type PruneResult, type Question, QuestionSchema, REQUIRED_SECTIONS, type ReachabilityNode, RegressionDetector, type RegressionReport, type RegressionResult, type ReviewAgentDescriptor, type ReviewAssessment, type ReviewChecklist, type ReviewComment, type ReviewContext, type ReviewDomain, type ReviewFinding, type ReviewItem, type ReviewOutputOptions, type ReviewPipelineResult, type ReviewStrength, type RuleOverride, RuleRegistry, type RunCIChecksInput, type RunPipelineOptions, SECURITY_DESCRIPTOR, type SafetyLevel, type ScanResult, type SecurityCategory, type SecurityConfidence, type SecurityConfig, SecurityConfigSchema, type SecurityFinding, type SecurityRule, SecurityScanner, type SecuritySeverity, type SelfReviewConfig, type SessionSummaryData, SharableBoundaryConfigSchema, SharableForbiddenImportSchema, SharableLayerSchema, SharableSecurityRulesSchema, type SizeBudgetConfig, type SizeBudgetReport, type SizeBudgetViolation, type SkillExecutor, type SourceFile, type Span, type SpanEvent, type StaleConstraint, type StepExecutor, type StreamIndex, StreamIndexSchema, type StreamInfo, StreamInfoSchema, type StructureValidation, type Suggestion, type SuggestionReport, type SyncChange, type SyncOptions, type TelemetryAdapter, type TelemetryHealth, ThresholdConfig, type TimeRange, type TokenBudget, type TokenBudgetOverrides, type Trace, type Transition, TransitionSchema, type TurnExecutor, TypeScriptParser, type UnusedImport, type UpdateCheckState, VERSION, type ValidateFindingsOptions, type ValidationError, type WorkflowPhase, addProvenance, analyzeDiff, analyzeLearningPatterns, appendFailure, appendLearning, applyFixes, applyHotspotDowngrade, archiveFailures, archiveLearnings, archiveStream, buildDependencyGraph, buildExclusionSet, buildSnapshot, checkDocCoverage, checkEligibility, classifyFinding, clearFailuresCache, clearLearningsCache, configureFeedback, constraintRuleId, contextBudget, contextFilter, createBoundaryValidator, createCommentedCodeFixes, createError, createFixes, createForbiddenImportFixes, createOrphanedDepFixes, createParseError, createSelfReview, createStream, cryptoRules, deduplicateCleanupFindings, deduplicateFindings, deepMergeConstraints, defaultCollectors, defineLayer, deserializationRules, detectChangeType, detectCircularDeps, detectCircularDepsInFiles, detectComplexityViolations, detectCouplingViolations, detectDeadCode, detectDocDrift, detectPatternViolations, detectSizeBudgetViolations, detectStack, detectStaleConstraints, determineAssessment, diff, executeWorkflow, expressRules, extractBundle, extractMarkdownLinks, extractSections, fanOutReview, formatFindingBlock, formatGitHubComment, formatGitHubSummary, formatTerminalOutput, generateAgentsMap, generateSuggestions, getActionEmitter, getExitCode, getFeedbackConfig, getPhaseCategories, getStreamForBranch, getUpdateNotification, goRules, injectionRules, isSmallSuggestion, isUpdateCheckEnabled, listActiveSessions, listStreams, loadBudgetedLearnings, loadFailures, loadHandoff, loadRelevantLearnings, loadSessionSummary, loadState, loadStreamIndex, logAgentAction, migrateToStreams, networkRules, nodeRules, parseDateFromEntry, parseDiff, parseManifest, parseRoadmap, parseSecurityConfig, parseSize, pathTraversalRules, previewFix, pruneLearnings, reactRules, readCheckState, readLockfile, removeContributions, removeProvenance, requestMultiplePeerReviews, requestPeerReview, resetFeedbackConfig, resolveFileToLayer, resolveModelTier, resolveRuleSeverity, resolveSessionDir, resolveStreamPath, resolveThresholds, runAll, runArchitectureAgent, runBugDetectionAgent, runCIChecks, runComplianceAgent, runMechanicalChecks, runMechanicalGate, runMultiTurnPipeline, runPipeline, runReviewPipeline, runSecurityAgent, saveHandoff, saveState, saveStreamIndex, scopeContext, secretRules, serializeRoadmap, setActiveStream, shouldRunCheck, spawnBackgroundCheck, syncConstraintNodes, syncRoadmap, touchStream, trackAction, updateSessionIndex, validateAgentsMap, validateBoundaries, validateCommitMessage, validateConfig, validateDependencies, validateFileStructure, validateFindings, validateKnowledgeMap, validatePatternConfig, violationId, writeConfig, writeLockfile, writeSessionSummary, xssRules };