@harness-engineering/core 0.12.0 → 0.13.1

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.ts CHANGED
@@ -1088,175 +1088,118 @@ declare function removeProvenance(lockfile: Lockfile, packageName: string): {
1088
1088
  */
1089
1089
  declare function removeContributions(config: Record<string, unknown>, contributions: Contributions): Record<string, unknown>;
1090
1090
 
1091
- interface InternalSymbol {
1092
- name: string;
1093
- type: 'function' | 'class' | 'variable' | 'type';
1094
- line: number;
1095
- references: number;
1096
- calledBy: string[];
1097
- }
1098
- interface JSDocComment {
1099
- content: string;
1100
- line: number;
1101
- associatedSymbol?: string;
1102
- }
1103
- interface CodeBlock {
1104
- language: string;
1105
- content: string;
1106
- line: number;
1107
- }
1108
- interface InlineReference {
1109
- reference: string;
1110
- line: number;
1111
- column: number;
1112
- }
1113
- interface SourceFile {
1114
- path: string;
1115
- ast: AST;
1116
- imports: Import[];
1117
- exports: Export[];
1118
- internalSymbols: InternalSymbol[];
1119
- jsDocComments: JSDocComment[];
1120
- }
1121
- interface DocumentationFile {
1122
- path: string;
1123
- type: 'markdown' | 'jsdoc' | 'typedoc' | 'text';
1124
- content: string;
1125
- codeBlocks: CodeBlock[];
1126
- inlineRefs: InlineReference[];
1127
- }
1128
- interface CodeReference {
1129
- docFile: string;
1130
- line: number;
1131
- column: number;
1132
- reference: string;
1133
- context: 'code-block' | 'inline' | 'link' | 'jsdoc';
1134
- resolvedTo?: string;
1135
- }
1136
- interface ExportMap {
1137
- byFile: Map<string, Export[]>;
1138
- byName: Map<string, {
1139
- file: string;
1140
- export: Export;
1141
- }[]>;
1142
- }
1143
- interface CodebaseSnapshot {
1144
- files: SourceFile[];
1145
- dependencyGraph: DependencyGraph;
1146
- exportMap: ExportMap;
1147
- docs: DocumentationFile[];
1148
- codeReferences: CodeReference[];
1149
- entryPoints: string[];
1150
- rootDir: string;
1151
- config: EntropyConfig;
1152
- buildTime: number;
1153
- }
1154
- interface DriftConfig {
1155
- docPaths: string[];
1156
- checkApiSignatures: boolean;
1157
- checkExamples: boolean;
1158
- checkStructure: boolean;
1159
- ignorePatterns: string[];
1160
- }
1161
- interface DeadCodeConfig {
1162
- entryPoints?: string[];
1163
- includeTypes: boolean;
1164
- includeInternals: boolean;
1165
- ignorePatterns: string[];
1166
- treatDynamicImportsAs: 'used' | 'unknown';
1167
- }
1168
- interface EntropyConfig {
1169
- rootDir: string;
1170
- parser?: LanguageParser;
1171
- entryPoints?: string[];
1172
- analyze: {
1173
- drift?: boolean | Partial<DriftConfig>;
1174
- deadCode?: boolean | Partial<DeadCodeConfig>;
1175
- patterns?: boolean | PatternConfig;
1176
- complexity?: boolean | Partial<ComplexityConfig>;
1177
- coupling?: boolean | Partial<CouplingConfig>;
1178
- sizeBudget?: boolean | Partial<SizeBudgetConfig>;
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;
1179
1110
  };
1180
- include?: string[];
1181
- exclude?: string[];
1182
- docPaths?: string[];
1183
1111
  }
1184
- interface DocumentationDrift {
1185
- type: 'api-signature' | 'example-code' | 'structure';
1186
- docFile: string;
1112
+ interface ComplexityConfig {
1113
+ enabled?: boolean;
1114
+ thresholds?: ComplexityThresholds;
1115
+ }
1116
+ interface ComplexityViolation {
1117
+ file: string;
1118
+ function: string;
1187
1119
  line: number;
1188
- reference: string;
1189
- context: string;
1190
- issue: 'NOT_FOUND' | 'RENAMED' | 'SIGNATURE_CHANGED' | 'SYNTAX_ERROR' | 'IMPORT_ERROR';
1191
- details: string;
1192
- suggestion?: string;
1193
- possibleMatches?: string[];
1194
- confidence: 'high' | 'medium' | 'low';
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;
1195
1126
  }
1196
- interface DriftReport {
1197
- drifts: DocumentationDrift[];
1127
+ interface ComplexityReport {
1128
+ violations: ComplexityViolation[];
1198
1129
  stats: {
1199
- docsScanned: number;
1200
- referencesChecked: number;
1201
- driftsFound: number;
1202
- byType: {
1203
- api: number;
1204
- example: number;
1205
- structure: number;
1206
- };
1130
+ filesAnalyzed: number;
1131
+ functionsAnalyzed: number;
1132
+ violationCount: number;
1133
+ errorCount: number;
1134
+ warningCount: number;
1135
+ infoCount: number;
1207
1136
  };
1208
- severity: 'high' | 'medium' | 'low' | 'none';
1209
1137
  }
1210
- interface DeadExport {
1211
- file: string;
1212
- name: string;
1213
- line: number;
1214
- type: 'function' | 'class' | 'variable' | 'type' | 'interface' | 'enum';
1215
- isDefault: boolean;
1216
- reason: 'NO_IMPORTERS' | 'IMPORTERS_ALSO_DEAD';
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
+ };
1217
1152
  }
1218
- interface DeadFile {
1219
- path: string;
1220
- reason: 'NO_IMPORTERS' | 'NOT_ENTRY_POINT' | 'ALL_EXPORTS_DEAD';
1221
- exportCount: number;
1222
- lineCount: number;
1153
+ interface CouplingConfig {
1154
+ enabled?: boolean;
1155
+ thresholds?: CouplingThresholds;
1223
1156
  }
1224
- interface DeadInternal {
1157
+ interface CouplingViolation {
1225
1158
  file: string;
1226
- name: string;
1227
- line: number;
1228
- type: 'function' | 'class' | 'variable';
1229
- reason: 'NEVER_CALLED' | 'ONLY_CALLED_BY_DEAD';
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;
1230
1165
  }
1231
- interface UnusedImport {
1232
- file: string;
1233
- line: number;
1234
- source: string;
1235
- specifiers: string[];
1236
- isFullyUnused: boolean;
1166
+ interface CouplingReport {
1167
+ violations: CouplingViolation[];
1168
+ stats: {
1169
+ filesAnalyzed: number;
1170
+ violationCount: number;
1171
+ warningCount: number;
1172
+ infoCount: number;
1173
+ };
1237
1174
  }
1238
- interface ReachabilityNode {
1239
- file: string;
1240
- reachable: boolean;
1241
- importedBy: string[];
1242
- imports: string[];
1175
+
1176
+ interface SizeBudgetConfig {
1177
+ enabled?: boolean;
1178
+ budgets: Record<string, {
1179
+ warn?: string;
1180
+ }>;
1181
+ dependencyWeight?: {
1182
+ info?: string;
1183
+ };
1243
1184
  }
1244
- interface DeadCodeReport {
1245
- deadExports: DeadExport[];
1246
- deadFiles: DeadFile[];
1247
- deadInternals: DeadInternal[];
1248
- unusedImports: UnusedImport[];
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[];
1249
1195
  stats: {
1250
- filesAnalyzed: number;
1251
- entryPointsUsed: string[];
1252
- totalExports: number;
1253
- deadExportCount: number;
1254
- totalFiles: number;
1255
- deadFileCount: number;
1256
- estimatedDeadLines: number;
1196
+ packagesChecked: number;
1197
+ violationCount: number;
1198
+ warningCount: number;
1199
+ infoCount: number;
1257
1200
  };
1258
- reachabilityTree?: ReachabilityNode;
1259
1201
  }
1202
+
1260
1203
  interface ConfigPattern {
1261
1204
  name: string;
1262
1205
  description: string;
@@ -1294,12 +1237,6 @@ interface ConfigPattern {
1294
1237
  };
1295
1238
  message?: string;
1296
1239
  }
1297
- interface CodePattern {
1298
- name: string;
1299
- description: string;
1300
- severity: 'error' | 'warning';
1301
- check: (file: SourceFile, snapshot: CodebaseSnapshot) => PatternMatch[];
1302
- }
1303
1240
  interface PatternMatch {
1304
1241
  line: number;
1305
1242
  column?: number;
@@ -1308,7 +1245,12 @@ interface PatternMatch {
1308
1245
  }
1309
1246
  interface PatternConfig {
1310
1247
  patterns: ConfigPattern[];
1311
- customPatterns?: CodePattern[];
1248
+ customPatterns?: Array<{
1249
+ name: string;
1250
+ description: string;
1251
+ severity: 'error' | 'warning';
1252
+ check: (...args: unknown[]) => PatternMatch[];
1253
+ }>;
1312
1254
  ignoreFiles?: string[];
1313
1255
  }
1314
1256
  interface PatternViolation {
@@ -1331,115 +1273,187 @@ interface PatternReport {
1331
1273
  };
1332
1274
  passRate: number;
1333
1275
  }
1334
- interface ComplexityThresholds {
1335
- cyclomaticComplexity?: {
1336
- error?: number;
1337
- warn?: number;
1338
- };
1339
- nestingDepth?: {
1340
- warn?: number;
1341
- };
1342
- functionLength?: {
1343
- warn?: number;
1344
- };
1345
- parameterCount?: {
1346
- warn?: number;
1347
- };
1348
- fileLength?: {
1349
- info?: number;
1350
- };
1351
- hotspotPercentile?: {
1352
- error?: number;
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>;
1353
1302
  };
1303
+ include?: string[];
1304
+ exclude?: string[];
1305
+ docPaths?: string[];
1306
+ }
1307
+
1308
+ interface InternalSymbol {
1309
+ name: string;
1310
+ type: 'function' | 'class' | 'variable' | 'type';
1311
+ line: number;
1312
+ references: number;
1313
+ calledBy: string[];
1314
+ }
1315
+ interface JSDocComment {
1316
+ content: string;
1317
+ line: number;
1318
+ associatedSymbol?: string;
1319
+ }
1320
+ interface CodeBlock {
1321
+ language: string;
1322
+ content: string;
1323
+ line: number;
1324
+ }
1325
+ interface InlineReference {
1326
+ reference: string;
1327
+ line: number;
1328
+ column: number;
1329
+ }
1330
+ interface SourceFile {
1331
+ path: string;
1332
+ ast: AST;
1333
+ imports: Import[];
1334
+ exports: Export[];
1335
+ internalSymbols: InternalSymbol[];
1336
+ jsDocComments: JSDocComment[];
1337
+ }
1338
+ interface DocumentationFile {
1339
+ path: string;
1340
+ type: 'markdown' | 'jsdoc' | 'typedoc' | 'text';
1341
+ content: string;
1342
+ codeBlocks: CodeBlock[];
1343
+ inlineRefs: InlineReference[];
1344
+ }
1345
+ interface CodeReference {
1346
+ docFile: string;
1347
+ line: number;
1348
+ column: number;
1349
+ reference: string;
1350
+ context: 'code-block' | 'inline' | 'link' | 'jsdoc';
1351
+ resolvedTo?: string;
1352
+ }
1353
+ interface ExportMap {
1354
+ byFile: Map<string, Export[]>;
1355
+ byName: Map<string, {
1356
+ file: string;
1357
+ export: Export;
1358
+ }[]>;
1354
1359
  }
1355
- interface ComplexityConfig {
1356
- enabled?: boolean;
1357
- thresholds?: ComplexityThresholds;
1360
+ interface CodebaseSnapshot {
1361
+ files: SourceFile[];
1362
+ dependencyGraph: DependencyGraph;
1363
+ exportMap: ExportMap;
1364
+ docs: DocumentationFile[];
1365
+ codeReferences: CodeReference[];
1366
+ entryPoints: string[];
1367
+ rootDir: string;
1368
+ config: EntropyConfig;
1369
+ buildTime: number;
1358
1370
  }
1359
- interface ComplexityViolation {
1360
- file: string;
1361
- function: string;
1371
+
1372
+ interface DocumentationDrift {
1373
+ type: 'api-signature' | 'example-code' | 'structure';
1374
+ docFile: string;
1362
1375
  line: number;
1363
- metric: 'cyclomaticComplexity' | 'nestingDepth' | 'functionLength' | 'parameterCount' | 'fileLength' | 'hotspotScore';
1364
- value: number;
1365
- threshold: number;
1366
- tier: 1 | 2 | 3;
1367
- severity: 'error' | 'warning' | 'info';
1368
- message?: string;
1376
+ reference: string;
1377
+ context: string;
1378
+ issue: 'NOT_FOUND' | 'RENAMED' | 'SIGNATURE_CHANGED' | 'SYNTAX_ERROR' | 'IMPORT_ERROR';
1379
+ details: string;
1380
+ suggestion?: string;
1381
+ possibleMatches?: string[];
1382
+ confidence: 'high' | 'medium' | 'low';
1369
1383
  }
1370
- interface ComplexityReport {
1371
- violations: ComplexityViolation[];
1384
+ interface DriftReport {
1385
+ drifts: DocumentationDrift[];
1372
1386
  stats: {
1373
- filesAnalyzed: number;
1374
- functionsAnalyzed: number;
1375
- violationCount: number;
1376
- errorCount: number;
1377
- warningCount: number;
1378
- infoCount: number;
1387
+ docsScanned: number;
1388
+ referencesChecked: number;
1389
+ driftsFound: number;
1390
+ byType: {
1391
+ api: number;
1392
+ example: number;
1393
+ structure: number;
1394
+ };
1379
1395
  };
1396
+ severity: 'high' | 'medium' | 'low' | 'none';
1380
1397
  }
1381
- interface CouplingThresholds {
1382
- fanOut?: {
1383
- warn?: number;
1384
- };
1385
- fanIn?: {
1386
- info?: number;
1387
- };
1388
- couplingRatio?: {
1389
- warn?: number;
1390
- };
1391
- transitiveDependencyDepth?: {
1392
- info?: number;
1393
- };
1398
+
1399
+ interface DeadExport {
1400
+ file: string;
1401
+ name: string;
1402
+ line: number;
1403
+ type: 'function' | 'class' | 'variable' | 'type' | 'interface' | 'enum';
1404
+ isDefault: boolean;
1405
+ reason: 'NO_IMPORTERS' | 'IMPORTERS_ALSO_DEAD';
1394
1406
  }
1395
- interface CouplingConfig {
1396
- enabled?: boolean;
1397
- thresholds?: CouplingThresholds;
1407
+ interface DeadFile {
1408
+ path: string;
1409
+ reason: 'NO_IMPORTERS' | 'NOT_ENTRY_POINT' | 'ALL_EXPORTS_DEAD';
1410
+ exportCount: number;
1411
+ lineCount: number;
1398
1412
  }
1399
- interface CouplingViolation {
1413
+ interface DeadInternal {
1400
1414
  file: string;
1401
- metric: 'fanOut' | 'fanIn' | 'couplingRatio' | 'transitiveDependencyDepth';
1402
- value: number;
1403
- threshold: number;
1404
- tier: 1 | 2 | 3;
1405
- severity: 'error' | 'warning' | 'info';
1406
- message?: string;
1407
- }
1408
- interface CouplingReport {
1409
- violations: CouplingViolation[];
1410
- stats: {
1411
- filesAnalyzed: number;
1412
- violationCount: number;
1413
- warningCount: number;
1414
- infoCount: number;
1415
- };
1415
+ name: string;
1416
+ line: number;
1417
+ type: 'function' | 'class' | 'variable';
1418
+ reason: 'NEVER_CALLED' | 'ONLY_CALLED_BY_DEAD';
1416
1419
  }
1417
- interface SizeBudgetConfig {
1418
- enabled?: boolean;
1419
- budgets: Record<string, {
1420
- warn?: string;
1421
- }>;
1422
- dependencyWeight?: {
1423
- info?: string;
1424
- };
1420
+ interface UnusedImport {
1421
+ file: string;
1422
+ line: number;
1423
+ source: string;
1424
+ specifiers: string[];
1425
+ isFullyUnused: boolean;
1425
1426
  }
1426
- interface SizeBudgetViolation {
1427
- package: string;
1428
- currentSize: number;
1429
- budgetSize: number;
1430
- unit: 'bytes';
1431
- tier: 2 | 3;
1432
- severity: 'warning' | 'info';
1427
+ interface ReachabilityNode {
1428
+ file: string;
1429
+ reachable: boolean;
1430
+ importedBy: string[];
1431
+ imports: string[];
1433
1432
  }
1434
- interface SizeBudgetReport {
1435
- violations: SizeBudgetViolation[];
1433
+ interface DeadCodeReport {
1434
+ deadExports: DeadExport[];
1435
+ deadFiles: DeadFile[];
1436
+ deadInternals: DeadInternal[];
1437
+ unusedImports: UnusedImport[];
1436
1438
  stats: {
1437
- packagesChecked: number;
1438
- violationCount: number;
1439
- warningCount: number;
1440
- infoCount: number;
1439
+ filesAnalyzed: number;
1440
+ entryPointsUsed: string[];
1441
+ totalExports: number;
1442
+ deadExportCount: number;
1443
+ totalFiles: number;
1444
+ deadFileCount: number;
1445
+ estimatedDeadLines: number;
1441
1446
  };
1447
+ reachabilityTree?: ReachabilityNode;
1442
1448
  }
1449
+
1450
+ interface CodePattern {
1451
+ name: string;
1452
+ description: string;
1453
+ severity: 'error' | 'warning';
1454
+ check: (file: SourceFile, snapshot: CodebaseSnapshot) => PatternMatch[];
1455
+ }
1456
+
1443
1457
  type FixType = 'unused-imports' | 'dead-files' | 'dead-exports' | 'commented-code' | 'orphaned-deps' | 'forbidden-import-replacement' | 'import-ordering' | 'trailing-whitespace' | 'broken-links' | 'sort-imports';
1444
1458
  interface FixConfig {
1445
1459
  dryRun: boolean;
@@ -1514,6 +1528,7 @@ interface SuggestionReport {
1514
1528
  };
1515
1529
  estimatedEffort: 'trivial' | 'small' | 'medium' | 'large';
1516
1530
  }
1531
+
1517
1532
  interface AnalysisError {
1518
1533
  analyzer: 'drift' | 'deadCode' | 'patterns' | 'complexity' | 'coupling' | 'sizeBudget';
1519
1534
  error: EntropyError;
@@ -3134,6 +3149,8 @@ declare class DepDepthCollector implements Collector {
3134
3149
  * Produce a stable violation ID.
3135
3150
  * Formula: sha256(relativePath + ':' + category + ':' + normalizedDetail)
3136
3151
  * Line numbers are excluded to keep IDs stable across unrelated edits.
3152
+ *
3153
+ * @param relativePath - POSIX-normalized relative path (callers must use relativePosix())
3137
3154
  */
3138
3155
  declare function violationId(relativePath: string, category: string, normalizedDetail: string): string;
3139
3156
  /**
@@ -3492,20 +3509,80 @@ declare const HarnessStateSchema: z.ZodObject<{
3492
3509
  type HarnessState = z.infer<typeof HarnessStateSchema>;
3493
3510
  declare const DEFAULT_STATE: HarnessState;
3494
3511
 
3495
- declare function loadState(projectPath: string, stream?: string): Promise<Result<HarnessState, Error>>;
3496
- declare function saveState(projectPath: string, state: HarnessState, stream?: string): Promise<Result<void, Error>>;
3497
- declare function appendLearning(projectPath: string, learning: string, skillName?: string, outcome?: string, stream?: string): Promise<Result<void, Error>>;
3498
- declare function loadRelevantLearnings(projectPath: string, skillName?: string, stream?: string): Promise<Result<string[], Error>>;
3499
- declare function appendFailure(projectPath: string, description: string, skillName: string, type: string, stream?: string): Promise<Result<void, Error>>;
3500
- declare function loadFailures(projectPath: string, stream?: string): Promise<Result<Array<{
3512
+ declare function loadState(projectPath: string, stream?: string, session?: string): Promise<Result<HarnessState, Error>>;
3513
+ declare function saveState(projectPath: string, state: HarnessState, stream?: string, session?: string): Promise<Result<void, Error>>;
3514
+
3515
+ declare function clearLearningsCache(): void;
3516
+ declare function appendLearning(projectPath: string, learning: string, skillName?: string, outcome?: string, stream?: string, session?: string): Promise<Result<void, Error>>;
3517
+ /**
3518
+ * Parse date from a learning entry. Returns the date string or null.
3519
+ * Entries look like: "- **2026-03-25 [skill:X]:** content"
3520
+ * or heading format: "## 2026-03-25 — Task 3: ..."
3521
+ */
3522
+ declare function parseDateFromEntry(entry: string): string | null;
3523
+ interface LearningPattern {
3524
+ tag: string;
3525
+ count: number;
3526
+ entries: string[];
3527
+ }
3528
+ /**
3529
+ * Analyze learning entries for recurring patterns.
3530
+ * Groups entries by [skill:X] and [outcome:Y] tags.
3531
+ * Returns patterns where 3+ entries share the same tag.
3532
+ */
3533
+ declare function analyzeLearningPatterns(entries: string[]): LearningPattern[];
3534
+ interface BudgetedLearningsOptions {
3535
+ intent: string;
3536
+ tokenBudget?: number;
3537
+ skill?: string;
3538
+ session?: string;
3539
+ stream?: string;
3540
+ }
3541
+ /**
3542
+ * Load learnings with token budget, two-tier loading, recency sorting, and relevance filtering.
3543
+ *
3544
+ * - Session learnings (primary): always loaded first if session is provided
3545
+ * - Global learnings (secondary): loaded to fill remaining budget
3546
+ * - Sorted by recency (newest first) within each tier
3547
+ * - Filtered by relevance to intent (matching entries prioritized)
3548
+ * - Capped at tokenBudget (default 1000 tokens)
3549
+ */
3550
+ declare function loadBudgetedLearnings(projectPath: string, options: BudgetedLearningsOptions): Promise<Result<string[], Error>>;
3551
+ declare function loadRelevantLearnings(projectPath: string, skillName?: string, stream?: string, session?: string): Promise<Result<string[], Error>>;
3552
+ interface PruneResult {
3553
+ kept: number;
3554
+ archived: number;
3555
+ patterns: LearningPattern[];
3556
+ }
3557
+ /**
3558
+ * Archive learning entries to .harness/learnings-archive/{YYYY-MM}.md.
3559
+ * Appends to existing archive file if one exists for the current month.
3560
+ */
3561
+ declare function archiveLearnings(projectPath: string, entries: string[], stream?: string): Promise<Result<void, Error>>;
3562
+ /**
3563
+ * Prune global learnings: analyze patterns, archive old entries, keep 20 most recent.
3564
+ *
3565
+ * Pruning triggers when:
3566
+ * - Entry count exceeds 30, OR
3567
+ * - Entries older than 14 days exist AND total count exceeds 20
3568
+ *
3569
+ * Returns the prune result with pattern analysis and counts.
3570
+ */
3571
+ declare function pruneLearnings(projectPath: string, stream?: string): Promise<Result<PruneResult, Error>>;
3572
+
3573
+ declare function clearFailuresCache(): void;
3574
+ declare function appendFailure(projectPath: string, description: string, skillName: string, type: string, stream?: string, session?: string): Promise<Result<void, Error>>;
3575
+ declare function loadFailures(projectPath: string, stream?: string, session?: string): Promise<Result<Array<{
3501
3576
  date: string;
3502
3577
  skill: string;
3503
3578
  type: string;
3504
3579
  description: string;
3505
3580
  }>, Error>>;
3506
- declare function archiveFailures(projectPath: string, stream?: string): Promise<Result<void, Error>>;
3507
- declare function saveHandoff(projectPath: string, handoff: Handoff, stream?: string): Promise<Result<void, Error>>;
3508
- declare function loadHandoff(projectPath: string, stream?: string): Promise<Result<Handoff | null, Error>>;
3581
+ declare function archiveFailures(projectPath: string, stream?: string, session?: string): Promise<Result<void, Error>>;
3582
+
3583
+ declare function saveHandoff(projectPath: string, handoff: Handoff, stream?: string, session?: string): Promise<Result<void, Error>>;
3584
+ declare function loadHandoff(projectPath: string, stream?: string, session?: string): Promise<Result<Handoff | null, Error>>;
3585
+
3509
3586
  declare function runMechanicalGate(projectPath: string): Promise<Result<GateResult, Error>>;
3510
3587
 
3511
3588
  declare const StreamInfoSchema: z.ZodObject<{
@@ -3593,6 +3670,53 @@ declare function archiveStream(projectPath: string, name: string): Promise<Resul
3593
3670
  declare function getStreamForBranch(index: StreamIndex, branch: string): string | null;
3594
3671
  declare function migrateToStreams(projectPath: string): Promise<Result<void, Error>>;
3595
3672
 
3673
+ /**
3674
+ * Resolves the directory path for a session.
3675
+ * Optionally creates the directory if it does not exist.
3676
+ */
3677
+ declare function resolveSessionDir(projectPath: string, sessionSlug: string, options?: {
3678
+ create?: boolean;
3679
+ }): Result<string, Error>;
3680
+ /**
3681
+ * Updates the session index.md file with an entry for the given session.
3682
+ * Creates the file if it does not exist.
3683
+ * Updates existing entries in-place (per-slug line ownership).
3684
+ */
3685
+ declare function updateSessionIndex(projectPath: string, sessionSlug: string, description: string): void;
3686
+
3687
+ /**
3688
+ * Data required to write a session summary.
3689
+ * Required fields: session, lastActive, skill, status, keyContext, nextStep.
3690
+ * Optional fields: phase, spec, plan.
3691
+ */
3692
+ interface SessionSummaryData {
3693
+ session: string;
3694
+ lastActive: string;
3695
+ skill: string;
3696
+ phase?: string;
3697
+ status: string;
3698
+ spec?: string;
3699
+ plan?: string;
3700
+ keyContext: string;
3701
+ nextStep: string;
3702
+ }
3703
+ /**
3704
+ * Writes a session summary to the session directory and updates the session index.
3705
+ * Creates the session directory if it does not exist.
3706
+ * Overwrites any existing summary for this session.
3707
+ */
3708
+ declare function writeSessionSummary(projectPath: string, sessionSlug: string, data: SessionSummaryData): Result<void, Error>;
3709
+ /**
3710
+ * Loads a session's summary.md contents.
3711
+ * Returns the raw markdown string, or null if the file does not exist.
3712
+ */
3713
+ declare function loadSessionSummary(projectPath: string, sessionSlug: string): Result<string | null, Error>;
3714
+ /**
3715
+ * Lists active sessions by reading the session index file.
3716
+ * Returns the raw markdown contents of index.md, or null if it does not exist.
3717
+ */
3718
+ declare function listActiveSessions(projectPath: string): Result<string | null, Error>;
3719
+
3596
3720
  type StepExecutor = (step: WorkflowStep, previousArtifact?: string) => Promise<WorkflowStepResult>;
3597
3721
  declare function executeWorkflow(workflow: Workflow, executor: StepExecutor): Promise<WorkflowResult>;
3598
3722
 
@@ -3797,35 +3921,6 @@ interface RunCIChecksInput {
3797
3921
  }
3798
3922
  declare function runCIChecks(input: RunCIChecksInput): Promise<Result<CICheckReport, Error>>;
3799
3923
 
3800
- /**
3801
- * An index of mechanical findings, queryable by file + line range.
3802
- * Used in Phase 5 (VALIDATE) to determine whether an AI-produced finding
3803
- * overlaps with a mechanical finding and should be excluded.
3804
- */
3805
- declare class ExclusionSet {
3806
- /** Findings indexed by file path for O(1) file lookup */
3807
- private byFile;
3808
- private allFindings;
3809
- constructor(findings: MechanicalFinding[]);
3810
- /**
3811
- * Returns true if any mechanical finding covers the given file + line range.
3812
- *
3813
- * A mechanical finding "covers" a range if:
3814
- * - The file matches, AND
3815
- * - The finding has no line (file-level finding — covers everything), OR
3816
- * - The finding's line falls within [startLine, endLine] inclusive.
3817
- */
3818
- isExcluded(file: string, lineRange: [number, number]): boolean;
3819
- /** Number of findings in the set */
3820
- get size(): number;
3821
- /** Returns a copy of all findings */
3822
- getFindings(): MechanicalFinding[];
3823
- }
3824
- /**
3825
- * Build an ExclusionSet from mechanical findings.
3826
- */
3827
- declare function buildExclusionSet(findings: MechanicalFinding[]): ExclusionSet;
3828
-
3829
3924
  /**
3830
3925
  * A finding produced by a mechanical check (lint, typecheck, security scan, harness validate/deps/docs).
3831
3926
  * Used as input to the exclusion set and reported when the pipeline stops due to mechanical failures.
@@ -3876,6 +3971,7 @@ interface MechanicalCheckOptions {
3876
3971
  /** Only scan these files for security (e.g., changed files from a PR) */
3877
3972
  changedFiles?: string[];
3878
3973
  }
3974
+
3879
3975
  /**
3880
3976
  * Change type detected from commit message prefix or diff heuristic.
3881
3977
  */
@@ -3993,6 +4089,7 @@ interface ContextScopeOptions {
3993
4089
  /** Pre-gathered commit history entries. If provided, included in all bundles. */
3994
4090
  commitHistory?: CommitHistoryEntry[];
3995
4091
  }
4092
+
3996
4093
  /**
3997
4094
  * Model tier — abstract label resolved at runtime from project config.
3998
4095
  * - fast: haiku-class (gate, context phases)
@@ -4071,6 +4168,7 @@ interface FanOutOptions {
4071
4168
  /** Context bundles from Phase 3 (one per domain) */
4072
4169
  bundles: ContextBundle[];
4073
4170
  }
4171
+
4074
4172
  /**
4075
4173
  * Assessment decision — determines exit code and PR review action.
4076
4174
  */
@@ -4145,6 +4243,36 @@ interface EligibilityResult {
4145
4243
  /** Human-readable reason when not eligible */
4146
4244
  reason?: string;
4147
4245
  }
4246
+
4247
+ /**
4248
+ * An index of mechanical findings, queryable by file + line range.
4249
+ * Used in Phase 5 (VALIDATE) to determine whether an AI-produced finding
4250
+ * overlaps with a mechanical finding and should be excluded.
4251
+ */
4252
+ declare class ExclusionSet {
4253
+ /** Findings indexed by file path for O(1) file lookup */
4254
+ private byFile;
4255
+ private allFindings;
4256
+ constructor(findings: MechanicalFinding[]);
4257
+ /**
4258
+ * Returns true if any mechanical finding covers the given file + line range.
4259
+ *
4260
+ * A mechanical finding "covers" a range if:
4261
+ * - The file matches, AND
4262
+ * - The finding has no line (file-level finding — covers everything), OR
4263
+ * - The finding's line falls within [startLine, endLine] inclusive.
4264
+ */
4265
+ isExcluded(file: string, lineRange: [number, number]): boolean;
4266
+ /** Number of findings in the set */
4267
+ get size(): number;
4268
+ /** Returns a copy of all findings */
4269
+ getFindings(): MechanicalFinding[];
4270
+ }
4271
+ /**
4272
+ * Build an ExclusionSet from mechanical findings.
4273
+ */
4274
+ declare function buildExclusionSet(findings: MechanicalFinding[]): ExclusionSet;
4275
+
4148
4276
  /**
4149
4277
  * Configuration mapping abstract model tiers to concrete model identifiers.
4150
4278
  * All tiers are optional — unmapped tiers resolve to undefined (use current model).
@@ -4791,6 +4919,6 @@ declare function getUpdateNotification(currentVersion: string): string | null;
4791
4919
  * release. Kept only as a fallback for consumers that cannot resolve the CLI
4792
4920
  * package at runtime.
4793
4921
  */
4794
- declare const VERSION = "0.11.0";
4922
+ declare const VERSION = "0.13.0";
4795
4923
 
4796
- 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, 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, 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, removeContributions, 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 };
4924
+ 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 };