@holmes-lab/holmes-kit 0.40.0 → 0.40.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +234 -0
  2. package/README.md +70 -4
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/cli/index.js +25 -19
  5. package/dist/holmes/cli/interactive-prompt.d.ts +39 -2
  6. package/dist/holmes/cli/interactive-prompt.js +98 -16
  7. package/dist/holmes/config/config.d.ts +17 -0
  8. package/dist/holmes/config/config.js +13 -1
  9. package/dist/holmes/governance/autonomy.d.ts +7 -0
  10. package/dist/holmes/governance/autonomy.js +36 -5
  11. package/dist/holmes/governance/push-gate-runner.d.ts +2 -0
  12. package/dist/holmes/governance/push-gate-runner.js +40 -3
  13. package/dist/holmes/governance/push-gate.d.ts +13 -2
  14. package/dist/holmes/governance/push-gate.js +106 -14
  15. package/dist/holmes/guardrail/advisory-line.d.ts +102 -0
  16. package/dist/holmes/guardrail/advisory-line.js +718 -0
  17. package/dist/holmes/guardrail/impact-gate.d.ts +6 -0
  18. package/dist/holmes/guardrail/impact-gate.js +32 -5
  19. package/dist/holmes/hooks/pre-tool-use.d.ts +11 -0
  20. package/dist/holmes/hooks/pre-tool-use.js +44 -5
  21. package/dist/holmes/hooks/session-start.js +17 -1
  22. package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +13 -0
  23. package/dist/holmes/mcp/handlers/maintenance-analysis.js +59 -2
  24. package/dist/holmes/mcp/handlers/test-execution.d.ts +470 -3
  25. package/dist/holmes/mcp/handlers/test-execution.js +199 -21
  26. package/dist/holmes/mcp/handlers.d.ts +468 -3
  27. package/dist/holmes/mcp/handlers.js +5 -1
  28. package/dist/holmes/mcp/maintenance-analyze.d.ts +5 -0
  29. package/dist/holmes/mcp/maintenance-analyze.js +4 -2
  30. package/dist/holmes/mcp/maintenance-evidence.d.ts +9 -0
  31. package/dist/holmes/mcp/maintenance-evidence.js +4 -1
  32. package/dist/holmes/mcp/tool-schemas.js +13 -7
  33. package/dist/holmes/project/baseline.d.ts +15 -2
  34. package/dist/holmes/project/baseline.js +11 -6
  35. package/dist/holmes/project/bounded-io.d.ts +1 -0
  36. package/dist/holmes/project/bounded-io.js +4 -2
  37. package/dist/holmes/project/change-source.d.ts +4 -0
  38. package/dist/holmes/project/change-source.js +13 -5
  39. package/dist/holmes/project/root.js +3 -1
  40. package/dist/holmes/review/evidence-mode.d.ts +21 -0
  41. package/dist/holmes/review/evidence-mode.js +33 -0
  42. package/dist/holmes/review/head-worktree.d.ts +55 -0
  43. package/dist/holmes/review/head-worktree.js +329 -0
  44. package/dist/holmes/review/mrp.js +13 -3
  45. package/dist/holmes/review/run-provenance.d.ts +45 -0
  46. package/dist/holmes/review/run-provenance.js +314 -0
  47. package/dist/holmes/review/test-evidence.d.ts +174 -0
  48. package/dist/holmes/review/test-evidence.js +330 -2
  49. package/dist/holmes/review/test-reports.d.ts +94 -0
  50. package/dist/holmes/review/test-reports.js +382 -0
  51. package/dist/holmes/review/test-runner.d.ts +176 -65
  52. package/dist/holmes/review/test-runner.js +531 -316
  53. package/dist/holmes/review/test-units.d.ts +159 -0
  54. package/dist/holmes/review/test-units.js +814 -0
  55. package/package.json +1 -1
  56. package/playbooks/publish/PLAYBOOK.md +2 -1
@@ -3,6 +3,8 @@ import { ScannedFile } from '../../cpg/cpg-scanner';
3
3
  import { ChangeSourceInfo } from '../../project/change-source';
4
4
  export interface TestExecutionContext {
5
5
  defaultBaseline: string;
6
+ /** @implements A-SPEC-466.2 — a deliberate refusal, so the caller gets a handler refusal, not an internal error. */
7
+ refusal(reason: string): Error;
6
8
  deriveChangedContext(root: string, args: {
7
9
  base?: string;
8
10
  head?: string;
@@ -23,11 +25,14 @@ export interface TestExecutionContext {
23
25
  export declare function createTestExecutionHandlers(context: TestExecutionContext): {
24
26
  test_run(a: {
25
27
  root: string;
26
- base?: string;
27
- head?: string;
28
+ base?: string | null;
29
+ head?: string | null;
28
30
  since?: string;
29
31
  mark?: string;
30
32
  mutate?: string;
33
+ workers?: number;
34
+ timeoutMinutes?: number | null;
35
+ full?: boolean;
31
36
  }): Promise<{
32
37
  mutate: {
33
38
  tspec: string;
@@ -49,7 +54,313 @@ export declare function createTestExecutionHandlers(context: TestExecutionContex
49
54
  reason: string;
50
55
  }[];
51
56
  };
57
+ workers: null;
58
+ workersIgnored: "mutate" | undefined;
59
+ timeoutMinutes: number;
60
+ } | {
61
+ worktreeLeft?: string | undefined;
62
+ anchorDiagnostics?: {
63
+ hint: string;
64
+ file: string;
65
+ line: number;
66
+ separator: string;
67
+ dropped: string[];
68
+ }[] | undefined;
69
+ calibrationClosed?: string[] | undefined;
70
+ nextCall?: string | undefined;
71
+ notFullBecause?: string | undefined;
72
+ excludeDirsIgnored?: {
73
+ entry: string;
74
+ reason: string;
75
+ }[] | undefined;
76
+ recordFailed?: string[] | undefined;
77
+ ranIn: "head-worktree";
78
+ worktree: {
79
+ createMs: number;
80
+ prepareMs: number;
81
+ runMs: number;
82
+ };
83
+ notBuilt?: string[] | undefined;
84
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
85
+ untestedCode?: {
86
+ root: string;
87
+ sample: string[];
88
+ missingBuildFile?: string;
89
+ }[] | undefined;
90
+ notExecuted?: string[] | undefined;
91
+ notTests?: string[] | undefined;
92
+ implementationCount?: number | undefined;
93
+ environment?: {
94
+ ecosystem: string;
95
+ dir: string;
96
+ reason: string;
97
+ }[] | undefined;
98
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
99
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
100
+ detected?: string[] | undefined;
101
+ testsRun: number;
102
+ testsRunBy: Record<string, number>;
103
+ scopedEvidenceRecorded?: true | undefined;
104
+ baselineSkipped?: "not a full run" | undefined;
105
+ baselineRecorded?: string | undefined;
106
+ scopeFallback?: "full" | undefined;
107
+ timeoutMinutes: number;
108
+ unresolvedFiles: string[];
109
+ changeSource: ChangeSourceInfo;
110
+ workersIgnoredBy: string[];
111
+ workersIgnored: "nothing ran" | "no jest group";
112
+ tier: import("../../rtm/test-scope").RegressionTier;
113
+ mode: "full" | "scoped" | "noop";
114
+ passed: boolean;
115
+ skipped: boolean;
116
+ ranFiles: string[];
117
+ ranWith: string[];
118
+ executedByAspec: Record<string, number>;
119
+ tail: string;
120
+ workers: number | null;
121
+ mutate?: undefined;
122
+ } | {
123
+ worktreeLeft?: string | undefined;
124
+ anchorDiagnostics?: {
125
+ hint: string;
126
+ file: string;
127
+ line: number;
128
+ separator: string;
129
+ dropped: string[];
130
+ }[] | undefined;
131
+ calibrationClosed?: string[] | undefined;
132
+ nextCall?: string | undefined;
133
+ notFullBecause?: string | undefined;
134
+ excludeDirsIgnored?: {
135
+ entry: string;
136
+ reason: string;
137
+ }[] | undefined;
138
+ recordFailed?: string[] | undefined;
139
+ ranIn?: undefined;
140
+ worktree?: undefined;
141
+ notBuilt?: string[] | undefined;
142
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
143
+ untestedCode?: {
144
+ root: string;
145
+ sample: string[];
146
+ missingBuildFile?: string;
147
+ }[] | undefined;
148
+ notExecuted?: string[] | undefined;
149
+ notTests?: string[] | undefined;
150
+ implementationCount?: number | undefined;
151
+ environment?: {
152
+ ecosystem: string;
153
+ dir: string;
154
+ reason: string;
155
+ }[] | undefined;
156
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
157
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
158
+ detected?: string[] | undefined;
159
+ testsRun: number;
160
+ testsRunBy: Record<string, number>;
161
+ scopedEvidenceRecorded?: true | undefined;
162
+ baselineSkipped?: "not a full run" | undefined;
163
+ baselineRecorded?: string | undefined;
164
+ scopeFallback?: "full" | undefined;
165
+ timeoutMinutes: number;
166
+ unresolvedFiles: string[];
167
+ changeSource: ChangeSourceInfo;
168
+ workersIgnoredBy: string[];
169
+ workersIgnored: "nothing ran" | "no jest group";
170
+ tier: import("../../rtm/test-scope").RegressionTier;
171
+ mode: "full" | "scoped" | "noop";
172
+ passed: boolean;
173
+ skipped: boolean;
174
+ ranFiles: string[];
175
+ ranWith: string[];
176
+ executedByAspec: Record<string, number>;
177
+ tail: string;
178
+ workers: number | null;
179
+ mutate?: undefined;
180
+ } | {
181
+ worktreeLeft?: string | undefined;
182
+ anchorDiagnostics?: {
183
+ hint: string;
184
+ file: string;
185
+ line: number;
186
+ separator: string;
187
+ dropped: string[];
188
+ }[] | undefined;
189
+ calibrationClosed?: string[] | undefined;
190
+ nextCall?: string | undefined;
191
+ notFullBecause?: string | undefined;
192
+ excludeDirsIgnored?: {
193
+ entry: string;
194
+ reason: string;
195
+ }[] | undefined;
196
+ recordFailed?: string[] | undefined;
197
+ ranIn: "head-worktree";
198
+ worktree: {
199
+ createMs: number;
200
+ prepareMs: number;
201
+ runMs: number;
202
+ };
203
+ notBuilt?: string[] | undefined;
204
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
205
+ untestedCode?: {
206
+ root: string;
207
+ sample: string[];
208
+ missingBuildFile?: string;
209
+ }[] | undefined;
210
+ notExecuted?: string[] | undefined;
211
+ notTests?: string[] | undefined;
212
+ implementationCount?: number | undefined;
213
+ environment?: {
214
+ ecosystem: string;
215
+ dir: string;
216
+ reason: string;
217
+ }[] | undefined;
218
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
219
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
220
+ detected?: string[] | undefined;
221
+ testsRun: number;
222
+ testsRunBy: Record<string, number>;
223
+ scopedEvidenceRecorded?: true | undefined;
224
+ baselineSkipped?: "not a full run" | undefined;
225
+ baselineRecorded?: string | undefined;
226
+ scopeFallback?: "full" | undefined;
227
+ timeoutMinutes: number;
228
+ unresolvedFiles: string[];
229
+ changeSource: ChangeSourceInfo;
230
+ workersIgnoredBy?: undefined;
231
+ workersIgnored: "nothing ran" | "no jest group";
232
+ tier: import("../../rtm/test-scope").RegressionTier;
233
+ mode: "full" | "scoped" | "noop";
234
+ passed: boolean;
235
+ skipped: boolean;
236
+ ranFiles: string[];
237
+ ranWith: string[];
238
+ executedByAspec: Record<string, number>;
239
+ tail: string;
240
+ workers: number | null;
241
+ mutate?: undefined;
242
+ } | {
243
+ worktreeLeft?: string | undefined;
244
+ anchorDiagnostics?: {
245
+ hint: string;
246
+ file: string;
247
+ line: number;
248
+ separator: string;
249
+ dropped: string[];
250
+ }[] | undefined;
251
+ calibrationClosed?: string[] | undefined;
252
+ nextCall?: string | undefined;
253
+ notFullBecause?: string | undefined;
254
+ excludeDirsIgnored?: {
255
+ entry: string;
256
+ reason: string;
257
+ }[] | undefined;
258
+ recordFailed?: string[] | undefined;
259
+ ranIn?: undefined;
260
+ worktree?: undefined;
261
+ notBuilt?: string[] | undefined;
262
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
263
+ untestedCode?: {
264
+ root: string;
265
+ sample: string[];
266
+ missingBuildFile?: string;
267
+ }[] | undefined;
268
+ notExecuted?: string[] | undefined;
269
+ notTests?: string[] | undefined;
270
+ implementationCount?: number | undefined;
271
+ environment?: {
272
+ ecosystem: string;
273
+ dir: string;
274
+ reason: string;
275
+ }[] | undefined;
276
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
277
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
278
+ detected?: string[] | undefined;
279
+ testsRun: number;
280
+ testsRunBy: Record<string, number>;
281
+ scopedEvidenceRecorded?: true | undefined;
282
+ baselineSkipped?: "not a full run" | undefined;
283
+ baselineRecorded?: string | undefined;
284
+ scopeFallback?: "full" | undefined;
285
+ timeoutMinutes: number;
286
+ unresolvedFiles: string[];
287
+ changeSource: ChangeSourceInfo;
288
+ workersIgnoredBy?: undefined;
289
+ workersIgnored: "nothing ran" | "no jest group";
290
+ tier: import("../../rtm/test-scope").RegressionTier;
291
+ mode: "full" | "scoped" | "noop";
292
+ passed: boolean;
293
+ skipped: boolean;
294
+ ranFiles: string[];
295
+ ranWith: string[];
296
+ executedByAspec: Record<string, number>;
297
+ tail: string;
298
+ workers: number | null;
299
+ mutate?: undefined;
300
+ } | {
301
+ worktreeLeft?: string | undefined;
302
+ anchorDiagnostics?: {
303
+ hint: string;
304
+ file: string;
305
+ line: number;
306
+ separator: string;
307
+ dropped: string[];
308
+ }[] | undefined;
309
+ calibrationClosed?: string[] | undefined;
310
+ nextCall?: string | undefined;
311
+ notFullBecause?: string | undefined;
312
+ excludeDirsIgnored?: {
313
+ entry: string;
314
+ reason: string;
315
+ }[] | undefined;
316
+ recordFailed?: string[] | undefined;
317
+ ranIn: "head-worktree";
318
+ worktree: {
319
+ createMs: number;
320
+ prepareMs: number;
321
+ runMs: number;
322
+ };
323
+ notBuilt?: string[] | undefined;
324
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
325
+ untestedCode?: {
326
+ root: string;
327
+ sample: string[];
328
+ missingBuildFile?: string;
329
+ }[] | undefined;
330
+ notExecuted?: string[] | undefined;
331
+ notTests?: string[] | undefined;
332
+ implementationCount?: number | undefined;
333
+ environment?: {
334
+ ecosystem: string;
335
+ dir: string;
336
+ reason: string;
337
+ }[] | undefined;
338
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
339
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
340
+ detected?: string[] | undefined;
341
+ testsRun: number;
342
+ testsRunBy: Record<string, number>;
343
+ scopedEvidenceRecorded?: true | undefined;
344
+ baselineSkipped?: "not a full run" | undefined;
345
+ baselineRecorded?: string | undefined;
346
+ scopeFallback?: "full" | undefined;
347
+ timeoutMinutes: number;
348
+ unresolvedFiles: string[];
349
+ changeSource: ChangeSourceInfo;
350
+ workersIgnoredBy: string[];
351
+ workersIgnored?: undefined;
352
+ tier: import("../../rtm/test-scope").RegressionTier;
353
+ mode: "full" | "scoped" | "noop";
354
+ passed: boolean;
355
+ skipped: boolean;
356
+ ranFiles: string[];
357
+ ranWith: string[];
358
+ executedByAspec: Record<string, number>;
359
+ tail: string;
360
+ workers: number | null;
361
+ mutate?: undefined;
52
362
  } | {
363
+ worktreeLeft?: string | undefined;
53
364
  anchorDiagnostics?: {
54
365
  hint: string;
55
366
  file: string;
@@ -58,17 +369,173 @@ export declare function createTestExecutionHandlers(context: TestExecutionContex
58
369
  dropped: string[];
59
370
  }[] | undefined;
60
371
  calibrationClosed?: string[] | undefined;
372
+ nextCall?: string | undefined;
373
+ notFullBecause?: string | undefined;
374
+ excludeDirsIgnored?: {
375
+ entry: string;
376
+ reason: string;
377
+ }[] | undefined;
378
+ recordFailed?: string[] | undefined;
379
+ ranIn?: undefined;
380
+ worktree?: undefined;
381
+ notBuilt?: string[] | undefined;
382
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
383
+ untestedCode?: {
384
+ root: string;
385
+ sample: string[];
386
+ missingBuildFile?: string;
387
+ }[] | undefined;
388
+ notExecuted?: string[] | undefined;
389
+ notTests?: string[] | undefined;
390
+ implementationCount?: number | undefined;
391
+ environment?: {
392
+ ecosystem: string;
393
+ dir: string;
394
+ reason: string;
395
+ }[] | undefined;
396
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
397
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
398
+ detected?: string[] | undefined;
399
+ testsRun: number;
400
+ testsRunBy: Record<string, number>;
401
+ scopedEvidenceRecorded?: true | undefined;
402
+ baselineSkipped?: "not a full run" | undefined;
61
403
  baselineRecorded?: string | undefined;
62
404
  scopeFallback?: "full" | undefined;
405
+ timeoutMinutes: number;
406
+ unresolvedFiles: string[];
407
+ changeSource: ChangeSourceInfo;
408
+ workersIgnoredBy: string[];
409
+ workersIgnored?: undefined;
63
410
  tier: import("../../rtm/test-scope").RegressionTier;
64
- mode: "full" | "noop" | "scoped";
411
+ mode: "full" | "scoped" | "noop";
65
412
  passed: boolean;
66
413
  skipped: boolean;
67
414
  ranFiles: string[];
415
+ ranWith: string[];
68
416
  executedByAspec: Record<string, number>;
69
417
  tail: string;
418
+ workers: number | null;
419
+ mutate?: undefined;
420
+ } | {
421
+ worktreeLeft?: string | undefined;
422
+ anchorDiagnostics?: {
423
+ hint: string;
424
+ file: string;
425
+ line: number;
426
+ separator: string;
427
+ dropped: string[];
428
+ }[] | undefined;
429
+ calibrationClosed?: string[] | undefined;
430
+ nextCall?: string | undefined;
431
+ notFullBecause?: string | undefined;
432
+ excludeDirsIgnored?: {
433
+ entry: string;
434
+ reason: string;
435
+ }[] | undefined;
436
+ recordFailed?: string[] | undefined;
437
+ ranIn: "head-worktree";
438
+ worktree: {
439
+ createMs: number;
440
+ prepareMs: number;
441
+ runMs: number;
442
+ };
443
+ notBuilt?: string[] | undefined;
444
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
445
+ untestedCode?: {
446
+ root: string;
447
+ sample: string[];
448
+ missingBuildFile?: string;
449
+ }[] | undefined;
450
+ notExecuted?: string[] | undefined;
451
+ notTests?: string[] | undefined;
452
+ implementationCount?: number | undefined;
453
+ environment?: {
454
+ ecosystem: string;
455
+ dir: string;
456
+ reason: string;
457
+ }[] | undefined;
458
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
459
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
460
+ detected?: string[] | undefined;
461
+ testsRun: number;
462
+ testsRunBy: Record<string, number>;
463
+ scopedEvidenceRecorded?: true | undefined;
464
+ baselineSkipped?: "not a full run" | undefined;
465
+ baselineRecorded?: string | undefined;
466
+ scopeFallback?: "full" | undefined;
467
+ timeoutMinutes: number;
468
+ unresolvedFiles: string[];
469
+ changeSource: ChangeSourceInfo;
470
+ workersIgnoredBy?: undefined;
471
+ workersIgnored?: undefined;
472
+ tier: import("../../rtm/test-scope").RegressionTier;
473
+ mode: "full" | "scoped" | "noop";
474
+ passed: boolean;
475
+ skipped: boolean;
476
+ ranFiles: string[];
477
+ ranWith: string[];
478
+ executedByAspec: Record<string, number>;
479
+ tail: string;
480
+ workers: number | null;
481
+ mutate?: undefined;
482
+ } | {
483
+ worktreeLeft?: string | undefined;
484
+ anchorDiagnostics?: {
485
+ hint: string;
486
+ file: string;
487
+ line: number;
488
+ separator: string;
489
+ dropped: string[];
490
+ }[] | undefined;
491
+ calibrationClosed?: string[] | undefined;
492
+ nextCall?: string | undefined;
493
+ notFullBecause?: string | undefined;
494
+ excludeDirsIgnored?: {
495
+ entry: string;
496
+ reason: string;
497
+ }[] | undefined;
498
+ recordFailed?: string[] | undefined;
499
+ ranIn?: undefined;
500
+ worktree?: undefined;
501
+ notBuilt?: string[] | undefined;
502
+ notDetected?: import("../../review/test-evidence").NotDetected[] | undefined;
503
+ untestedCode?: {
504
+ root: string;
505
+ sample: string[];
506
+ missingBuildFile?: string;
507
+ }[] | undefined;
508
+ notExecuted?: string[] | undefined;
509
+ notTests?: string[] | undefined;
510
+ implementationCount?: number | undefined;
511
+ environment?: {
512
+ ecosystem: string;
513
+ dir: string;
514
+ reason: string;
515
+ }[] | undefined;
516
+ units?: import("../../review/test-runner").UnitResult[] | undefined;
517
+ notRun?: import("../../review/test-evidence").NotRun[] | undefined;
518
+ detected?: string[] | undefined;
519
+ testsRun: number;
520
+ testsRunBy: Record<string, number>;
521
+ scopedEvidenceRecorded?: true | undefined;
522
+ baselineSkipped?: "not a full run" | undefined;
523
+ baselineRecorded?: string | undefined;
524
+ scopeFallback?: "full" | undefined;
525
+ timeoutMinutes: number;
70
526
  unresolvedFiles: string[];
71
527
  changeSource: ChangeSourceInfo;
528
+ workersIgnoredBy?: undefined;
529
+ workersIgnored?: undefined;
530
+ tier: import("../../rtm/test-scope").RegressionTier;
531
+ mode: "full" | "scoped" | "noop";
532
+ passed: boolean;
533
+ skipped: boolean;
534
+ ranFiles: string[];
535
+ ranWith: string[];
536
+ executedByAspec: Record<string, number>;
537
+ tail: string;
538
+ workers: number | null;
72
539
  mutate?: undefined;
73
540
  }>;
74
541
  };