@holmes-lab/holmes-kit 0.19.6 → 0.20.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 (139) hide show
  1. package/CHANGELOG.md +143 -0
  2. package/README.md +9 -2
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/cli/approve-status.d.ts +24 -0
  5. package/dist/holmes/cli/approve-status.js +166 -0
  6. package/dist/holmes/cli/approve-watch.d.ts +6 -0
  7. package/dist/holmes/cli/approve-watch.js +6 -0
  8. package/dist/holmes/cli/approve.d.ts +27 -0
  9. package/dist/holmes/cli/approve.js +68 -7
  10. package/dist/holmes/cli/cli-execution.d.ts +2 -0
  11. package/dist/holmes/cli/cli-execution.js +24 -0
  12. package/dist/holmes/cli/doctor-check.d.ts +15 -0
  13. package/dist/holmes/cli/doctor-check.js +2 -0
  14. package/dist/holmes/cli/doctor.d.ts +2 -8
  15. package/dist/holmes/cli/doctor.js +12 -3
  16. package/dist/holmes/cli/gitignore-merge.d.ts +0 -5
  17. package/dist/holmes/cli/gitignore-merge.js +6 -2
  18. package/dist/holmes/cli/index.js +176 -139
  19. package/dist/holmes/cli/npx-cache-check.d.ts +16 -0
  20. package/dist/holmes/cli/npx-cache-check.js +130 -0
  21. package/dist/holmes/cli/playbook-skills.d.ts +2 -22
  22. package/dist/holmes/cli/playbook-skills.js +10 -54
  23. package/dist/holmes/cli/probe-process.d.ts +17 -2
  24. package/dist/holmes/cli/probe-process.js +44 -11
  25. package/dist/holmes/governance/approval-grants.d.ts +22 -0
  26. package/dist/holmes/governance/approval-grants.js +55 -1
  27. package/dist/holmes/governance/approval-queue.d.ts +43 -4
  28. package/dist/holmes/governance/approval-queue.js +91 -13
  29. package/dist/holmes/governance/display-id-aliases.d.ts +29 -0
  30. package/dist/holmes/governance/display-id-aliases.js +86 -0
  31. package/dist/holmes/governance/ledger-store.d.ts +42 -14
  32. package/dist/holmes/governance/ledger-store.js +49 -3
  33. package/dist/holmes/governance/ledger-timeline.d.ts +3 -1
  34. package/dist/holmes/governance/ledger-timeline.js +11 -1
  35. package/dist/holmes/governance/provenance-chain.d.ts +2 -0
  36. package/dist/holmes/governance/provenance-chain.js +13 -2
  37. package/dist/holmes/governance/provenance-ledger.d.ts +28 -0
  38. package/dist/holmes/governance/provenance-ledger.js +69 -16
  39. package/dist/holmes/governance/session-context.d.ts +3 -0
  40. package/dist/holmes/governance/session-context.js +26 -8
  41. package/dist/holmes/guardrail/risk-classifier.js +2 -2
  42. package/dist/holmes/guardrail/write-target.js +2 -1
  43. package/dist/holmes/hooks/pre-tool-use.js +12 -1
  44. package/dist/holmes/hooks/stop.js +14 -3
  45. package/dist/holmes/mcp/handlers/adoption.d.ts +118 -0
  46. package/dist/holmes/mcp/handlers/adoption.js +186 -0
  47. package/dist/holmes/mcp/handlers/entity-integration.d.ts +100 -0
  48. package/dist/holmes/mcp/handlers/entity-integration.js +324 -0
  49. package/dist/holmes/mcp/handlers/entity-renumber.d.ts +137 -0
  50. package/dist/holmes/mcp/handlers/entity-renumber.js +228 -0
  51. package/dist/holmes/mcp/handlers/entity-store.d.ts +78 -0
  52. package/dist/holmes/mcp/handlers/entity-store.js +212 -0
  53. package/dist/holmes/mcp/handlers/graph-operations.d.ts +90 -0
  54. package/dist/holmes/mcp/handlers/graph-operations.js +260 -0
  55. package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +34 -0
  56. package/dist/holmes/mcp/handlers/maintenance-analysis.js +288 -0
  57. package/dist/holmes/mcp/handlers/maintenance-evidence.d.ts +40 -0
  58. package/dist/holmes/mcp/handlers/maintenance-evidence.js +104 -0
  59. package/dist/holmes/mcp/handlers/operator-inspection.d.ts +167 -0
  60. package/dist/holmes/mcp/handlers/operator-inspection.js +284 -0
  61. package/dist/holmes/mcp/handlers/phase-queries.d.ts +34 -0
  62. package/dist/holmes/mcp/handlers/phase-queries.js +86 -0
  63. package/dist/holmes/mcp/handlers/review-evidence.d.ts +47 -0
  64. package/dist/holmes/mcp/handlers/review-evidence.js +370 -0
  65. package/dist/holmes/mcp/handlers/review-queries.d.ts +68 -0
  66. package/dist/holmes/mcp/handlers/review-queries.js +79 -0
  67. package/dist/holmes/mcp/handlers/risk-assessment.d.ts +25 -0
  68. package/dist/holmes/mcp/handlers/risk-assessment.js +181 -0
  69. package/dist/holmes/mcp/handlers/slice-orchestration.d.ts +72 -0
  70. package/dist/holmes/mcp/handlers/slice-orchestration.js +373 -0
  71. package/dist/holmes/mcp/handlers/spec-approval.d.ts +105 -0
  72. package/dist/holmes/mcp/handlers/spec-approval.js +504 -0
  73. package/dist/holmes/mcp/handlers/spec-authoring.d.ts +57 -0
  74. package/dist/holmes/mcp/handlers/spec-authoring.js +326 -0
  75. package/dist/holmes/mcp/handlers/spec-lifecycle.d.ts +122 -0
  76. package/dist/holmes/mcp/handlers/spec-lifecycle.js +339 -0
  77. package/dist/holmes/mcp/handlers/spec-queries.d.ts +30 -0
  78. package/dist/holmes/mcp/handlers/spec-queries.js +74 -0
  79. package/dist/holmes/mcp/handlers/taint-screening.d.ts +48 -0
  80. package/dist/holmes/mcp/handlers/taint-screening.js +183 -0
  81. package/dist/holmes/mcp/handlers/test-execution.d.ts +63 -0
  82. package/dist/holmes/mcp/handlers/test-execution.js +210 -0
  83. package/dist/holmes/mcp/handlers/workspace-identity.d.ts +30 -0
  84. package/dist/holmes/mcp/handlers/workspace-identity.js +68 -0
  85. package/dist/holmes/mcp/handlers/workspace-queries.d.ts +77 -0
  86. package/dist/holmes/mcp/handlers/workspace-queries.js +193 -0
  87. package/dist/holmes/mcp/handlers.d.ts +661 -424
  88. package/dist/holmes/mcp/handlers.js +270 -3251
  89. package/dist/holmes/mcp/server-specs-dir.d.ts +2 -0
  90. package/dist/holmes/mcp/server-specs-dir.js +71 -0
  91. package/dist/holmes/mcp/server.js +12 -2
  92. package/dist/holmes/mcp/tool-schemas.js +43 -2
  93. package/dist/holmes/project/execution-context.d.ts +17 -0
  94. package/dist/holmes/project/execution-context.js +121 -0
  95. package/dist/holmes/project/installer-markers.d.ts +34 -0
  96. package/dist/holmes/project/installer-markers.js +65 -0
  97. package/dist/holmes/project/root.d.ts +12 -1
  98. package/dist/holmes/project/root.js +22 -3
  99. package/dist/holmes/project/workspace-identity.d.ts +29 -0
  100. package/dist/holmes/project/workspace-identity.js +181 -0
  101. package/dist/holmes/review/test-outcomes.d.ts +6 -1
  102. package/dist/holmes/review/test-outcomes.js +23 -5
  103. package/dist/holmes/review/test-runner.d.ts +18 -0
  104. package/dist/holmes/review/test-runner.js +136 -5
  105. package/dist/holmes/rtm/graph-store.d.ts +50 -1
  106. package/dist/holmes/rtm/graph-store.js +244 -3
  107. package/dist/holmes/rtm/incremental.d.ts +1 -0
  108. package/dist/holmes/rtm/incremental.js +12 -3
  109. package/dist/holmes/rtm/localize.js +7 -0
  110. package/dist/holmes/rtm/rtm-graph.d.ts +9 -0
  111. package/dist/holmes/rtm/rtm-graph.js +13 -0
  112. package/dist/holmes/rtm/test-scope.js +4 -1
  113. package/dist/holmes/semantic/vector-cache.d.ts +16 -1
  114. package/dist/holmes/semantic/vector-cache.js +155 -19
  115. package/dist/holmes/spec/approval-status.d.ts +10 -0
  116. package/dist/holmes/spec/approval-status.js +7 -3
  117. package/dist/holmes/spec/entity-git-snapshot.d.ts +50 -0
  118. package/dist/holmes/spec/entity-git-snapshot.js +276 -0
  119. package/dist/holmes/spec/entity-integration-discharge.d.ts +73 -0
  120. package/dist/holmes/spec/entity-integration-discharge.js +233 -0
  121. package/dist/holmes/spec/entity-integration-transaction.d.ts +179 -0
  122. package/dist/holmes/spec/entity-integration-transaction.js +1221 -0
  123. package/dist/holmes/spec/entity-integration.d.ts +216 -0
  124. package/dist/holmes/spec/entity-integration.js +760 -0
  125. package/dist/holmes/spec/entity-renumber-transaction.d.ts +82 -0
  126. package/dist/holmes/spec/entity-renumber-transaction.js +711 -0
  127. package/dist/holmes/spec/entity-renumber.d.ts +32 -0
  128. package/dist/holmes/spec/entity-renumber.js +156 -0
  129. package/dist/holmes/spec/entity-store.d.ts +135 -0
  130. package/dist/holmes/spec/entity-store.js +1053 -0
  131. package/dist/holmes/spec/entity-transaction.d.ts +105 -0
  132. package/dist/holmes/spec/entity-transaction.js +741 -0
  133. package/dist/holmes/spec/renumber.d.ts +58 -0
  134. package/dist/holmes/spec/renumber.js +200 -1
  135. package/dist/holmes/spec/spec-store.d.ts +3 -2
  136. package/dist/holmes/spec/spec-store.js +23 -2
  137. package/dist/holmes/spec/transition-policy.d.ts +36 -0
  138. package/dist/holmes/spec/transition-policy.js +135 -0
  139. package/package.json +5 -2
@@ -1,14 +1,10 @@
1
1
  import { SpecStore } from '../spec/spec-store';
2
2
  import { Spec } from '../spec/spec-parser';
3
- import { MaintenanceGroundTruth, MaintenanceAnalysis } from './maintenance-analyze';
4
- import { Action } from '../guardrail/phase';
5
3
  import { ScannedFile } from '../cpg/cpg-scanner';
6
4
  import { type DecisionRecord, type DecisionCitation } from '../rtm/rtm-builder';
7
5
  import { Basis } from './basis';
8
- import { Finding } from '../review/findings';
9
- import { Approval, Enforcement } from '../guardrail/risk-gate';
6
+ import { Approval } from '../guardrail/risk-gate';
10
7
  import { Elicitor } from './elicit-approval';
11
- import { RiskAction } from '../guardrail/risk-types';
12
8
  /**
13
9
  * @implements A-SPEC-189 §7 (round 10)
14
10
  * A DELIBERATE refusal, distinguished by construction rather than by class.
@@ -27,8 +23,6 @@ export declare class HandlerRefusal extends Error {
27
23
  /** Marker test that survives realm boundaries (jest's instanceof does not). */
28
24
  export declare function isHandlerRefusal(e: unknown): e is Error;
29
25
  import { ChangeSourceInfo } from '../project/change-source';
30
- import { DraftResult } from '../reverse/draft';
31
- import { AnchorMapping } from '../reverse/anchor';
32
26
  /**
33
27
  * @implements A-SPEC-156
34
28
  * Basis is attached HERE, in one place, rather than inside each handler. Measured reasoning: 25
@@ -39,6 +33,7 @@ import { AnchorMapping } from '../reverse/anchor';
39
33
  export interface ElicitOpts {
40
34
  elicit?: Elicitor;
41
35
  clientName?: () => string;
36
+ observeInvocation?: (root: string) => void | Promise<void>;
42
37
  }
43
38
  /**
44
39
  * @implements A-SPEC-299
@@ -67,7 +62,601 @@ export declare function collectDecisions(root: string, scanned: readonly Scanned
67
62
  citations: DecisionCitation[];
68
63
  };
69
64
  declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
70
- spec_create(a: any): Promise<{
65
+ entity_integrate(a: {
66
+ root?: string;
67
+ operation?: string;
68
+ base?: string;
69
+ left?: string;
70
+ right?: string;
71
+ operationId?: string;
72
+ plan?: unknown;
73
+ }): Promise<{
74
+ ok: true;
75
+ state: "completed";
76
+ operationId: string;
77
+ } | {
78
+ ok: true;
79
+ state: "abandoned";
80
+ operationId: string;
81
+ restored: string[];
82
+ untouched: string[];
83
+ preserved: string[];
84
+ } | {
85
+ ok: true;
86
+ record: import("../spec/entity-integration-discharge").DerivedDischargeRecord;
87
+ alreadyDischarged: boolean;
88
+ } | {
89
+ ok: boolean;
90
+ obligations: import("../spec/entity-integration-discharge").DerivedObligationStatus[];
91
+ plan?: undefined;
92
+ target?: undefined;
93
+ executable?: undefined;
94
+ code?: undefined;
95
+ reason?: undefined;
96
+ } | {
97
+ ok: boolean;
98
+ plan: import("../spec/entity-integration-transaction").EntityIntegrationRecoveryInspection;
99
+ target: string;
100
+ executable: boolean;
101
+ obligations?: undefined;
102
+ code?: undefined;
103
+ reason?: undefined;
104
+ } | {
105
+ blockers: string[];
106
+ target?: string | undefined;
107
+ plan?: import("../spec/entity-integration-transaction").EntityIntegrationPlan | undefined;
108
+ preview: import("../spec/entity-integration-transaction").EntityIntegrationCandidate;
109
+ ok: boolean;
110
+ executable: boolean;
111
+ obligations?: undefined;
112
+ code?: undefined;
113
+ reason?: undefined;
114
+ } | {
115
+ ok: boolean;
116
+ code: string;
117
+ reason: string;
118
+ obligations?: undefined;
119
+ plan?: undefined;
120
+ target?: undefined;
121
+ executable?: undefined;
122
+ }>;
123
+ entity_renumber(a: {
124
+ root?: string;
125
+ operation?: string;
126
+ changes?: import("../spec/entity-renumber").EntityRenumberChange[];
127
+ plan?: unknown;
128
+ }): Promise<{
129
+ ok: true;
130
+ state: "completed";
131
+ operationId: string;
132
+ } | {
133
+ restored: string[];
134
+ untouched: string[];
135
+ preserved: string[];
136
+ ok: true;
137
+ state: "abandoned";
138
+ operationId: string;
139
+ } | {
140
+ ok: boolean;
141
+ plan: import("../spec/entity-renumber-transaction").EntityRenumberRecoveryPlan;
142
+ code?: undefined;
143
+ reason?: undefined;
144
+ conflicts?: undefined;
145
+ ids?: undefined;
146
+ executable?: undefined;
147
+ blockers?: undefined;
148
+ inputVersion?: undefined;
149
+ preview?: undefined;
150
+ recoveryAvailable?: undefined;
151
+ } | {
152
+ ok: boolean;
153
+ code: string;
154
+ reason: string;
155
+ plan?: undefined;
156
+ conflicts?: undefined;
157
+ ids?: undefined;
158
+ executable?: undefined;
159
+ blockers?: undefined;
160
+ inputVersion?: undefined;
161
+ preview?: undefined;
162
+ recoveryAvailable?: undefined;
163
+ } | {
164
+ ok: boolean;
165
+ code: string;
166
+ conflicts: string[];
167
+ plan?: undefined;
168
+ reason?: undefined;
169
+ ids?: undefined;
170
+ executable?: undefined;
171
+ blockers?: undefined;
172
+ inputVersion?: undefined;
173
+ preview?: undefined;
174
+ recoveryAvailable?: undefined;
175
+ } | {
176
+ ok: boolean;
177
+ code: string;
178
+ ids: string[];
179
+ reason: string;
180
+ plan?: undefined;
181
+ conflicts?: undefined;
182
+ executable?: undefined;
183
+ blockers?: undefined;
184
+ inputVersion?: undefined;
185
+ preview?: undefined;
186
+ recoveryAvailable?: undefined;
187
+ } | {
188
+ ok: boolean;
189
+ executable: boolean;
190
+ blockers: string[];
191
+ inputVersion: string;
192
+ preview: {
193
+ proposal: import("../spec/entity-renumber").EntityRenumberProposal;
194
+ sources: import("../spec/renumber").SourceRenumberInventory;
195
+ workspaceId: string;
196
+ storeId: string;
197
+ storeLocator: string;
198
+ registrationVersion: string;
199
+ entries: {
200
+ entityId: string;
201
+ documentLocator: string;
202
+ text: string;
203
+ mapping: string;
204
+ mappingVersion: string;
205
+ }[];
206
+ referenceNamespaces: {
207
+ entityId: string;
208
+ displayId: string;
209
+ storeId: string;
210
+ workspaceId: string;
211
+ }[];
212
+ schema: string;
213
+ };
214
+ plan?: undefined;
215
+ code?: undefined;
216
+ reason?: undefined;
217
+ conflicts?: undefined;
218
+ ids?: undefined;
219
+ recoveryAvailable?: undefined;
220
+ } | {
221
+ ok: boolean;
222
+ executable: boolean;
223
+ plan: import("../spec/entity-renumber-transaction").EntityRenumberPlan;
224
+ blockers: never[];
225
+ recoveryAvailable: boolean;
226
+ inputVersion: string;
227
+ preview: {
228
+ proposal: import("../spec/entity-renumber").EntityRenumberProposal;
229
+ sources: import("../spec/renumber").SourceRenumberInventory;
230
+ workspaceId: string;
231
+ storeId: string;
232
+ storeLocator: string;
233
+ registrationVersion: string;
234
+ entries: {
235
+ entityId: string;
236
+ documentLocator: string;
237
+ text: string;
238
+ mapping: string;
239
+ mappingVersion: string;
240
+ }[];
241
+ referenceNamespaces: {
242
+ entityId: string;
243
+ displayId: string;
244
+ storeId: string;
245
+ workspaceId: string;
246
+ }[];
247
+ schema: string;
248
+ };
249
+ code?: undefined;
250
+ reason?: undefined;
251
+ conflicts?: undefined;
252
+ ids?: undefined;
253
+ }>;
254
+ entity_store(a: {
255
+ root?: string;
256
+ operation?: string;
257
+ plan?: unknown;
258
+ }): Promise<{
259
+ ok: true;
260
+ state: "active";
261
+ storeLocator: string;
262
+ storeId: string;
263
+ } | {
264
+ ok: true;
265
+ state: "legacy";
266
+ storeLocator: string;
267
+ storeId?: undefined;
268
+ } | {
269
+ ok: boolean;
270
+ plan: import("../spec/entity-store").EntityAdoptionPlan;
271
+ code?: undefined;
272
+ reason?: undefined;
273
+ } | {
274
+ ok: boolean;
275
+ plan: {
276
+ sourceOwner?: {
277
+ token: string;
278
+ version: string;
279
+ } | undefined;
280
+ lockOwner?: {
281
+ token: string;
282
+ version: string;
283
+ } | undefined;
284
+ schema: "holmes-entity-recovery/1";
285
+ workspaceId: string;
286
+ storeLocator: string;
287
+ operations: ({
288
+ operationId: string;
289
+ kind: "aborted";
290
+ storeId: string;
291
+ journalVersion: null;
292
+ state: "empty";
293
+ targets: Array<{
294
+ locator: string;
295
+ beforeVersion: string | null;
296
+ afterVersion: string | null;
297
+ currentVersion: string | null;
298
+ state: "unchanged" | "applied" | "unapplied" | "conflict";
299
+ }>;
300
+ inventoryConflicts: string[];
301
+ leftovers: string[];
302
+ } | {
303
+ retired?: true | undefined;
304
+ operationId: string;
305
+ kind: "adoption" | "write" | "legacy-renumber";
306
+ storeId: string | null;
307
+ journalVersion: string;
308
+ state: string;
309
+ targets: {
310
+ locator: string;
311
+ beforeVersion: string | null;
312
+ afterVersion: string | null;
313
+ currentVersion: string | null;
314
+ state: string;
315
+ }[];
316
+ inventoryConflicts: string[];
317
+ leftovers?: undefined;
318
+ })[];
319
+ };
320
+ code?: undefined;
321
+ reason?: undefined;
322
+ } | {
323
+ ok: boolean;
324
+ code: string;
325
+ reason: string;
326
+ plan?: undefined;
327
+ }>;
328
+ workspace_identity(a: {
329
+ root: string;
330
+ operation?: import("../project/workspace-identity").IdentityOperation;
331
+ }): Promise<{
332
+ ok: true;
333
+ state: "legacy";
334
+ } | {
335
+ ok: true;
336
+ state: "initialized";
337
+ workspaceId: string;
338
+ } | {
339
+ ok: true;
340
+ state: "registered";
341
+ workspaceId: string;
342
+ replicaId: string;
343
+ } | {
344
+ ok: boolean;
345
+ reason: string;
346
+ code?: undefined;
347
+ } | {
348
+ ok: boolean;
349
+ code: string;
350
+ reason: string;
351
+ }>;
352
+ ledger_reconcile: (a: {
353
+ root?: string;
354
+ nonce: string;
355
+ rationale?: string;
356
+ }) => Promise<{
357
+ ok: boolean;
358
+ reason: string;
359
+ reconciled?: undefined;
360
+ nonce?: undefined;
361
+ pending?: undefined;
362
+ code?: undefined;
363
+ events?: undefined;
364
+ remaining?: undefined;
365
+ } | {
366
+ ok: boolean;
367
+ reconciled: boolean;
368
+ nonce: string;
369
+ pending: string[];
370
+ reason: string;
371
+ code?: undefined;
372
+ events?: undefined;
373
+ remaining?: undefined;
374
+ } | {
375
+ ok: boolean;
376
+ code: string;
377
+ reason: string;
378
+ reconciled?: undefined;
379
+ nonce?: undefined;
380
+ pending?: undefined;
381
+ events?: undefined;
382
+ remaining?: undefined;
383
+ } | {
384
+ ok: boolean;
385
+ reconciled: boolean;
386
+ nonce: string;
387
+ events: {
388
+ replicaId: string | null;
389
+ seq: number;
390
+ hash: string;
391
+ ts: string;
392
+ }[];
393
+ remaining: string[];
394
+ reason?: undefined;
395
+ pending?: undefined;
396
+ code?: undefined;
397
+ }>;
398
+ rtm_impact: (a: {
399
+ root: string;
400
+ changed: string[];
401
+ }) => Promise<{
402
+ breadthWarning?: string | undefined;
403
+ rankedImpact: {
404
+ file: string;
405
+ score: number;
406
+ }[];
407
+ reachedByDepth: number[];
408
+ bounded: {
409
+ id: string;
410
+ reason: "hub" | "depth";
411
+ inDegree?: number;
412
+ }[] | undefined;
413
+ summariesOmitted?: number | undefined;
414
+ impacted: string[];
415
+ impactedSummaries: {
416
+ id: string;
417
+ summary: string | null;
418
+ }[];
419
+ }>;
420
+ rtm_reindex: (a: {
421
+ root: string;
422
+ base?: string;
423
+ head?: string;
424
+ since?: string;
425
+ }) => Promise<{
426
+ semanticWarm?: {
427
+ tier: string;
428
+ computed: number;
429
+ cached: number;
430
+ } | undefined;
431
+ changed: number;
432
+ nodes: number;
433
+ edges: number;
434
+ changeSource: ChangeSourceInfo;
435
+ }>;
436
+ context_bundle: (a: {
437
+ root: string;
438
+ seedId: string;
439
+ budget: number;
440
+ }) => Promise<import("../context/bundler").ContextBundle>;
441
+ review_scope: (a: {
442
+ root: string;
443
+ base?: string;
444
+ head?: string;
445
+ since?: string;
446
+ }) => Promise<{
447
+ scopeFallback?: "full" | undefined;
448
+ unscannedChangedFiles: string[];
449
+ testScope: import("../rtm/test-scope").TestScope;
450
+ changeSource: ChangeSourceInfo;
451
+ changedSymbols: string[];
452
+ impactedSpecs: string[];
453
+ acceptanceCriteria: Array<{
454
+ specId: string;
455
+ criteria: string;
456
+ }>;
457
+ unrequestedSymbols: string[];
458
+ coverageGaps: string[];
459
+ obligationGaps: string[];
460
+ }>;
461
+ review_prepare: (a: {
462
+ root: string;
463
+ base?: string;
464
+ head?: string;
465
+ since?: string;
466
+ budget?: number;
467
+ }) => Promise<{
468
+ scopeFallback?: "full" | undefined;
469
+ package: import("../review/package").ReviewPackage;
470
+ unscannedChangedFiles: string[];
471
+ changeSource: ChangeSourceInfo;
472
+ }>;
473
+ review_record: (a: {
474
+ root: string;
475
+ findings: import("../review/findings").Finding[];
476
+ }) => Promise<{
477
+ recorded: number;
478
+ }>;
479
+ review_status: (a: {
480
+ root: string;
481
+ }) => Promise<{
482
+ blocked: boolean;
483
+ open: {
484
+ critical: number;
485
+ important: number;
486
+ minor: number;
487
+ };
488
+ reviewNeeded: import("../review/review-targets").ReviewNeeded[];
489
+ }>;
490
+ risk_check: (a: {
491
+ root?: string;
492
+ action: import("../guardrail/risk-types").RiskAction;
493
+ approval?: Approval;
494
+ changedSymbols?: string[];
495
+ enforcement?: import("../guardrail/risk-gate").Enforcement;
496
+ ts: string;
497
+ actor?: string;
498
+ rationale?: string;
499
+ }) => Promise<{
500
+ assessment: import("../guardrail/risk-types").RiskAssessment;
501
+ gate: import("../guardrail/risk-gate").GateResult;
502
+ }>;
503
+ reverse_scan: (a: {
504
+ root: string;
505
+ maxFlagged?: number;
506
+ }) => Promise<{
507
+ root: string;
508
+ isGit: boolean;
509
+ scanned: number;
510
+ droppedUntracked: number;
511
+ candidates: number;
512
+ anchored: number;
513
+ unanchored: number;
514
+ clusters: import("../reverse/cluster").Cluster[];
515
+ testClusters: import("../reverse/cluster").Cluster[];
516
+ coverage: {
517
+ structurallyResolved: number;
518
+ inTestClusters: number;
519
+ cohesionUnmeasured: number;
520
+ testsMatched: number;
521
+ testsUnmatched: number;
522
+ withDynamicIndicators: number;
523
+ indicators: Partial<Record<import("../reverse/dynamic-wiring").Indicator, number>>;
524
+ uncalibratedIndicatorLanguages: string[];
525
+ ignoreUnsupportedPatterns: string[];
526
+ };
527
+ needsHumanConfirmation: import("../reverse/scan").FlaggedFile[];
528
+ tests: import("../reverse/test-map").TestMapping;
529
+ }>;
530
+ reverse_draft: (a: {
531
+ root: string;
532
+ parentReqId?: string;
533
+ cluster?: string;
534
+ dryRun?: boolean;
535
+ }) => Promise<{
536
+ ok: boolean;
537
+ reason: string;
538
+ availableClusters?: undefined;
539
+ dryRun?: undefined;
540
+ parentReqId?: undefined;
541
+ clusters?: undefined;
542
+ drafted?: undefined;
543
+ skipped?: undefined;
544
+ refused?: undefined;
545
+ } | {
546
+ ok: boolean;
547
+ reason: string;
548
+ availableClusters: string[];
549
+ dryRun?: undefined;
550
+ parentReqId?: undefined;
551
+ clusters?: undefined;
552
+ drafted?: undefined;
553
+ skipped?: undefined;
554
+ refused?: undefined;
555
+ } | {
556
+ ok: boolean;
557
+ dryRun: boolean;
558
+ parentReqId: string;
559
+ clusters: number;
560
+ drafted: import("../reverse/draft").DraftResult[];
561
+ skipped: {
562
+ clusterKey: string;
563
+ reason: string;
564
+ }[];
565
+ refused: {
566
+ clusterKey: string;
567
+ reason: string;
568
+ findings?: unknown[];
569
+ }[];
570
+ reason?: undefined;
571
+ availableClusters?: undefined;
572
+ }>;
573
+ reverse_anchor: (a: {
574
+ root: string;
575
+ mapping: import("../reverse/anchor").AnchorMapping[];
576
+ dryRun?: boolean;
577
+ }) => Promise<{
578
+ blockers: Record<string, string>;
579
+ applied: number;
580
+ dryRun: boolean;
581
+ would: number;
582
+ failed: import("../reverse/anchor").RefusedAnchor[];
583
+ edits: import("../reverse/anchor").AnchorEdit[];
584
+ refused: import("../reverse/anchor").RefusedAnchor[];
585
+ }>;
586
+ spec_slice_init: (a: {
587
+ root?: string;
588
+ sliceName: string;
589
+ title: string;
590
+ objective: string;
591
+ filesToTouch: string[];
592
+ }) => Promise<{
593
+ ok: boolean;
594
+ reason: string;
595
+ existing: string[];
596
+ specsCreated: string[];
597
+ unreadable: string[];
598
+ } | {
599
+ ok: boolean;
600
+ specsCreated: string[];
601
+ unreadable: string[];
602
+ reason?: undefined;
603
+ existing?: undefined;
604
+ }>;
605
+ spec_slice_approve: (a: {
606
+ root?: string;
607
+ sliceName: string;
608
+ }) => Promise<{
609
+ ok: boolean;
610
+ approvedSpecs: string[];
611
+ alreadySealed: string[];
612
+ refused: {
613
+ id: string;
614
+ reason: string;
615
+ }[];
616
+ }>;
617
+ spec_remediate: (a: {
618
+ root?: string;
619
+ targetFile?: string;
620
+ aspecId?: string;
621
+ }) => Promise<{
622
+ ok: boolean;
623
+ actionsTaken: string[];
624
+ refused: {
625
+ id: string;
626
+ reason: string;
627
+ }[];
628
+ }>;
629
+ maintenance_outcome(a: {
630
+ root: string;
631
+ digest: string;
632
+ actualFiles?: string[];
633
+ actualSymbols?: string[];
634
+ actualTests?: string[];
635
+ actualClassification?: string;
636
+ }): Promise<import("./maintenance-evidence").EvidenceArtifact>;
637
+ impact_gate_check(a: {
638
+ root: string;
639
+ target: string;
640
+ digest?: string;
641
+ }): Promise<import("../guardrail/impact-gate").EditEvidenceVerdict>;
642
+ maintenance_calibration(a: {
643
+ root: string;
644
+ minSamples?: number;
645
+ }): Promise<{
646
+ artifacts: number;
647
+ unreadable: string[];
648
+ skippedSchema: number;
649
+ schema: string;
650
+ n: number;
651
+ withoutClassification: number;
652
+ bins: import("./maintenance-evidence").CalibrationBin[];
653
+ brierScore: number | null;
654
+ falsePositives: number;
655
+ falseNegatives: number;
656
+ minSamples: number;
657
+ status: "measured" | "insufficient-data";
658
+ }>;
659
+ spec_create: (a: any) => Promise<{
71
660
  ok: boolean;
72
661
  reason: string;
73
662
  created?: undefined;
@@ -76,7 +665,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
76
665
  ok?: undefined;
77
666
  reason?: undefined;
78
667
  }>;
79
- spec_validate(a: any): Promise<{
668
+ spec_validate: (a: any) => Promise<{
80
669
  ok: boolean;
81
670
  findings: {
82
671
  level: string;
@@ -84,32 +673,9 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
84
673
  message: any;
85
674
  }[];
86
675
  }>;
87
- /**
88
- * @implements A-SPEC-132
89
- * Approval as an ACT: validate → seal → flip → ledger, in one call. This is the designed
90
- * reversal of "no approval tool exists" (which promote-slice documented while it was true) —
91
- * the act now includes digest computation a hand edit cannot perform honestly. Fail-closed on
92
- * the SERVER-environment approval: nothing in the request payload can substitute, because the
93
- * agent authors the payload and the operator authors the environment.
94
- */
95
- /**
96
- * @implements A-SPEC-184
97
- * Raise ONE named document from an older spec format to the current one.
98
- *
99
- * The compatibility policy this implements: older documents are read and left alone by default,
100
- * and rise only when a human points at the one they intend to use. There is deliberately no bulk
101
- * path — 155 documents here and 90 in the measured adoption target, and which of them are still
102
- * live specifications is a judgement only a person holds.
103
- *
104
- * It declares a KIND. It does not confer approval: 37 of this repository's legacy documents read
105
- * `status: Approved`, and carrying that across would mint approvals that never passed the sealing
106
- * act. The old value is preserved as evidence and the document restarts at `draft`.
107
- *
108
- * Takes no `root`: the store is bound at server construction, exactly as `spec_create` is.
109
- */
110
- spec_upgrade(a: {
676
+ spec_upgrade: (a: {
111
677
  id: string;
112
- }): Promise<{
678
+ }) => Promise<{
113
679
  ok: boolean;
114
680
  reason: string;
115
681
  upgraded?: undefined;
@@ -131,28 +697,11 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
131
697
  remaining: import("../spec/validator").Finding[];
132
698
  reason?: undefined;
133
699
  }>;
134
- /**
135
- * Move a document to `outdated` — the only path there.
136
- *
137
- * @implements A-SPEC-222
138
- * `outdated` was in SPEC_STATUSES with no code writing it and no document carrying it: a
139
- * declared state nothing could reach. That mattered the moment 23 deprecated REQs needed
140
- * cleaning up, because the only transition tool sends everything to `draft`, and calling a
141
- * retired document "draft" is a worse lie than the non-canonical word it replaced.
142
- *
143
- * Retirement withdraws authority rather than granting it, so it does NOT need the approval key
144
- * by default. Two cases invert that, and the threshold follows the RISK rather than the name of
145
- * the act:
146
- *
147
- * - A sealed document. The code gate demands an approved T-SPEC naming the target A-SPEC;
148
- * retiring that T-SPEC removes the demand. Unguarded, retirement is an approval bypass.
149
- * - A document an APPROVED spec depends on. That chain is holding something up right now.
150
- */
151
- spec_retire(a: {
700
+ spec_retire: (a: {
152
701
  root?: string;
153
702
  id: string;
154
703
  reason?: string;
155
- }): Promise<{
704
+ }) => Promise<{
156
705
  ok: boolean;
157
706
  reason: string;
158
707
  retired?: undefined;
@@ -171,30 +720,12 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
171
720
  dependents: string[];
172
721
  reason?: undefined;
173
722
  }>;
174
- /**
175
- * @implements A-SPEC-538.1
176
- * The inverse of spec_approve: returns a SEALED (approved) spec to an editable `draft`, clearing
177
- * `approved_digest` and `parent_digests` in ONE act, and records `spec-unsealed`. Hand-editing
178
- * only `status` leaves seal residue that later trips validation; this atomizes the reverse.
179
- *
180
- * Un-sealing WITHDRAWS a seal, so — like retiring a sealed document — it demands a covering
181
- * out-of-band HOLMES_APPROVAL (fail-closed): un-sealing an approved T-SPEC removes the code
182
- * gate's demand, so an unguarded un-seal would be an approval bypass. And it refuses when an
183
- * APPROVED spec depends on the target, because that dependent's `parent_digests` — the snapshot
184
- * drift detection compares against — would silently go stale.
185
- */
186
- spec_renumber(a: {
723
+ spec_renumber: (a: {
187
724
  root?: string;
188
725
  oldBase: string;
189
726
  newBase: string;
190
727
  dryRun?: boolean;
191
- }): Promise<{
192
- ok: boolean;
193
- reason: string;
194
- dryRun?: undefined;
195
- plan?: undefined;
196
- movedSpecs?: undefined;
197
- } | {
728
+ }) => Promise<{
198
729
  ok: boolean;
199
730
  dryRun: boolean;
200
731
  plan: import("../spec/renumber").RenumberPlan;
@@ -206,11 +737,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
206
737
  movedSpecs: number;
207
738
  plan: import("../spec/renumber").RenumberPlan;
208
739
  reason?: undefined;
740
+ } | {
741
+ ok: boolean;
742
+ reason: string;
209
743
  }>;
210
- spec_unseal(a: {
744
+ spec_unseal: (a: {
211
745
  root?: string;
212
746
  id: string;
213
- }): Promise<{
747
+ }) => Promise<{
214
748
  ok: boolean;
215
749
  reason: string;
216
750
  unsealed?: undefined;
@@ -229,30 +763,28 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
229
763
  dependents: string[];
230
764
  reason?: undefined;
231
765
  }>;
232
- /**
233
- * @implements A-SPEC-538.2
234
- * Read-only: report a spec's approval/seal state — sealed?, approved_digest, each parent's seal
235
- * state, and the concrete blockers still standing between it and approval — so a caller need not
236
- * parse files to ask "what is the approval state right now". Reuses `sealOf` and `approvalBlockers`
237
- * (the same predicates the code gate and spec_approve read) so the report cannot drift from the
238
- * acts it describes. No writes, no ledger append.
239
- */
240
- approval_status(a: {
766
+ approval_status: (a: {
241
767
  root?: string;
242
768
  id: string;
243
- }): Promise<{
769
+ }) => Promise<{
244
770
  ok: boolean;
245
771
  reason: string;
246
772
  } | {
247
773
  graphPreview?: {
248
774
  impact?: import("../rtm/impact-advisory").ImpactAdvisory;
249
- density?: import("../rtm/anchor-density").AnchorDensityFinding[];
775
+ density?: Array<import("../rtm/anchor-density").AnchorDensityFinding>;
250
776
  cycles?: {
251
- findings: import("../cpg/cycle-detect").CycleFinding[];
777
+ findings: Array<import("../cpg/cycle-detect").CycleFinding>;
252
778
  note: string;
253
779
  };
254
- architecture?: import("../cpg/arch-observe").ArchObservation[];
780
+ architecture?: Array<import("../cpg/arch-observe").ArchObservation>;
255
781
  graphAsOf?: string;
782
+ graph?: {
783
+ status: "current" | "stale" | "unverified";
784
+ sourceCommit: string | null;
785
+ head: string | null;
786
+ };
787
+ unavailable?: "empty" | "unreadable";
256
788
  } | undefined;
257
789
  id: string;
258
790
  type?: string;
@@ -261,21 +793,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
261
793
  approvedDigest?: string;
262
794
  parents: import("../spec/approval-status").ParentApproval[];
263
795
  blockers: string[];
796
+ resealBlockers: string[];
264
797
  ok: boolean;
265
798
  reason?: undefined;
266
799
  }>;
267
- /**
268
- * @implements A-SPEC-538.3
269
- * Read-only: return the provenance ledger's events in time order (optionally narrowed to one
270
- * spec) so the governance history — approved / unsealed / retired / review-needed … — is legible
271
- * at a glance without reading raw JSONL. Reuses FileLedgerStore.loadAll(); the ordering/filtering/
272
- * projection is the pure `timelineFrom`. No writes. An absent ledger is an empty history, not an
273
- * error.
274
- */
275
- ledger_timeline(a: {
800
+ ledger_timeline: (a: {
276
801
  root?: string;
277
802
  id?: string;
278
- }): Promise<{
803
+ }) => Promise<{
279
804
  ok: boolean;
280
805
  reason: string;
281
806
  events?: undefined;
@@ -284,10 +809,10 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
284
809
  events: import("../governance/ledger-timeline").TimelineEntry[];
285
810
  reason?: undefined;
286
811
  }>;
287
- rtm_dashboard(a: {
812
+ rtm_dashboard: (a: {
288
813
  root?: string;
289
814
  port?: number;
290
- }): Promise<{
815
+ }) => Promise<{
291
816
  ok: boolean;
292
817
  reason: string;
293
818
  url?: undefined;
@@ -300,35 +825,41 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
300
825
  census: import("../server/dashboard-launcher").DashboardCensus;
301
826
  reason?: undefined;
302
827
  }>;
303
- spec_approve(a: {
828
+ spec_approve: (a: {
304
829
  root?: string;
305
830
  id: string;
306
- }): Promise<{
307
- ok: boolean;
831
+ }) => Promise<{
832
+ ok: false;
308
833
  reason: string;
309
- findings?: undefined;
310
- conflict?: undefined;
834
+ findings: import("../spec/validator").Finding[];
835
+ candidate?: undefined;
836
+ digest?: undefined;
837
+ parentDigests?: undefined;
311
838
  } | {
312
839
  ok: boolean;
313
840
  reason: string;
314
- findings: import("../spec/validator").Finding[];
315
841
  conflict?: undefined;
316
842
  } | {
317
843
  ok: boolean;
318
844
  reason: string;
319
845
  conflict: import("../spec/version-conflict").ConflictDetail;
320
- findings?: undefined;
321
846
  } | {
847
+ impactAdvisoryUnavailable?: "empty" | "unreadable" | undefined;
848
+ impactGraph?: {
849
+ status: "current" | "stale" | "unverified";
850
+ sourceCommit: string | null;
851
+ head: string | null;
852
+ graphAsOf?: string;
853
+ } | undefined;
322
854
  anchorDensity?: import("../rtm/anchor-density").AnchorDensityFinding[] | undefined;
323
855
  impactAdvisory?: import("../rtm/impact-advisory").ImpactAdvisory | undefined;
324
856
  approved: string;
325
857
  digest: string;
326
858
  ok?: undefined;
327
859
  reason?: undefined;
328
- findings?: undefined;
329
860
  conflict?: undefined;
330
861
  }>;
331
- spec_list(a: any): Promise<{
862
+ spec_list: (a: any) => Promise<{
332
863
  specs: {
333
864
  legacy?: boolean | undefined;
334
865
  parent?: string | undefined;
@@ -337,14 +868,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
337
868
  status: "draft" | "review" | "approved" | "outdated";
338
869
  }[];
339
870
  }>;
340
- spec_next(): Promise<{
871
+ spec_next: () => Promise<{
341
872
  next: import("../spec/spec-types").SpecType;
342
873
  } | {
343
874
  next: null;
344
875
  }>;
345
- rtm_check(a?: {
876
+ rtm_check: (a?: {
346
877
  root?: string;
347
- }): Promise<{
878
+ }) => Promise<{
348
879
  ok: boolean;
349
880
  reason: string;
350
881
  issues?: undefined;
@@ -363,20 +894,11 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
363
894
  reason?: undefined;
364
895
  gaps?: undefined;
365
896
  }>;
366
- /**
367
- * Pin a REQ's citations: compute the content digest of every cited source that resolves inside
368
- * the repo and record it as `rev`, so an author never hashes a file by hand and the digest is
369
- * always derived from what is actually on disk.
370
- *
371
- * Explicit-invocation only, dry-run by DEFAULT, and never overwrites an existing digest — a
372
- * re-pin would replace evidence of upstream drift with a fresh-looking value, converting the
373
- * detector into a concealer.
374
- */
375
- citation_pin(a: {
897
+ citation_pin: (a: {
376
898
  root: string;
377
899
  id: string;
378
900
  dryRun?: boolean;
379
- }): Promise<{
901
+ }) => Promise<{
380
902
  ok: boolean;
381
903
  reason: string;
382
904
  id?: undefined;
@@ -393,9 +915,9 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
393
915
  citations: unknown[];
394
916
  reason?: undefined;
395
917
  }>;
396
- phase_status(a: {
918
+ phase_status: (a: {
397
919
  root?: string;
398
- }): Promise<{
920
+ }) => Promise<{
399
921
  ok: boolean;
400
922
  reason: string;
401
923
  specs?: undefined;
@@ -410,18 +932,18 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
410
932
  ok?: undefined;
411
933
  reason?: undefined;
412
934
  }>;
413
- phase_check(a: {
414
- action?: Action;
935
+ phase_check: (a: {
936
+ action?: import("../guardrail/phase").Action;
415
937
  target: string;
416
938
  targetAspecId?: string;
417
- }): Promise<import("../guardrail/phase").CheckResult | {
939
+ }) => Promise<import("../guardrail/phase").CheckResult | {
418
940
  decision: string;
419
941
  note: string;
420
942
  }>;
421
- cpg_scan(a: {
943
+ cpg_scan: (a: {
422
944
  root: string;
423
945
  lints?: boolean;
424
- }): Promise<{
946
+ }) => Promise<{
425
947
  files: number;
426
948
  symbols: number;
427
949
  skipped: {
@@ -451,17 +973,10 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
451
973
  }[];
452
974
  skippedCount: number;
453
975
  }>;
454
- /**
455
- * @implements A-SPEC-138
456
- * Call-graph taint REACHABILITY screen: source-named functions that reach sink-named functions
457
- * through call edges. A SCREENING signal that routes a security review, NOT a data-flow proof —
458
- * the result always carries the honesty envelope (kind + limits) and phrases pairs as "reaches",
459
- * never "vulnerable".
460
- */
461
- taint_scan(a: {
976
+ taint_scan: (a: {
462
977
  root: string;
463
978
  dataFlow?: boolean;
464
- }): Promise<{
979
+ }) => Promise<{
465
980
  kind: string;
466
981
  limits: ("name-based matching" | "no def-use" | "no sanitizers" | "call-edge-only")[];
467
982
  maxPaths: number | undefined;
@@ -473,12 +988,10 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
473
988
  } | {
474
989
  dataFlow: {
475
990
  findings: Record<string, unknown>[];
476
- /** Findings the reaching-definition evidence positively refuted (dead or fully sanitized). */
477
991
  refutedByReachingDefs: number;
478
992
  limits: ("no field sensitivity (obj.a and obj.b are one value)" | "no aliasing" | "no path sensitivity" | "no container/element tracking" | "no reflection or dynamic dispatch" | "sink matching is by callee NAME with no receiver type — RE.exec(s) is indistinguishable from child_process.exec(s)" | "no anonymous-function parameters (arrow/function-expression params are not bound)" | "not statement-order sensitive — a variable tainted anywhere in a function is tainted throughout it" | "reports reachability of tainted data to a sink, never exploitability")[];
479
993
  converged: boolean;
480
994
  truncated: number;
481
- /** Which languages this run could actually judge, so a zero is readable. */
482
995
  languagesAnalysed: (string | null)[];
483
996
  };
484
997
  kind: string;
@@ -489,14 +1002,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
489
1002
  ok?: undefined;
490
1003
  reason?: undefined;
491
1004
  }>;
492
- test_run(a: {
1005
+ test_run: (a: {
493
1006
  root: string;
494
1007
  base?: string;
495
1008
  head?: string;
496
1009
  since?: string;
497
1010
  mark?: string;
498
1011
  mutate?: string;
499
- }): Promise<{
1012
+ }) => Promise<{
500
1013
  mutate: {
501
1014
  tspec: string;
502
1015
  aspec: string | undefined;
@@ -528,298 +1041,22 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
528
1041
  changeSource: ChangeSourceInfo;
529
1042
  mutate?: undefined;
530
1043
  }>;
531
- issue_localize(a: {
1044
+ issue_localize: (a: {
532
1045
  root: string;
533
1046
  issue: string;
534
1047
  topN?: number;
535
- }): Promise<import("../rtm/localize").LocalizationReport>;
536
- maintenance_analyze(a: {
1048
+ }) => Promise<import("../rtm/localize").LocalizationReport>;
1049
+ maintenance_analyze: (a: {
537
1050
  root: string;
538
1051
  request: string;
539
1052
  historyLimit?: number;
540
1053
  contextBudget?: number;
541
- groundTruth?: MaintenanceGroundTruth;
1054
+ groundTruth?: import("./maintenance-analyze").MaintenanceGroundTruth;
542
1055
  persist?: boolean;
543
1056
  changedFiles?: string[];
544
- }): Promise<MaintenanceAnalysis & {
1057
+ }) => Promise<import("./maintenance-analyze").MaintenanceAnalysis & {
545
1058
  persistedTo?: string;
546
1059
  bounded?: boolean;
547
1060
  }>;
548
- maintenance_outcome(a: {
549
- root: string;
550
- digest: string;
551
- actualFiles?: string[];
552
- actualSymbols?: string[];
553
- actualTests?: string[];
554
- actualClassification?: string;
555
- }): Promise<import("./maintenance-evidence").EvidenceArtifact>;
556
- impact_gate_check(a: {
557
- root: string;
558
- target: string;
559
- digest?: string;
560
- }): Promise<import("../guardrail/impact-gate").EditEvidenceVerdict>;
561
- maintenance_calibration(a: {
562
- root: string;
563
- minSamples?: number;
564
- }): Promise<{
565
- artifacts: number;
566
- unreadable: string[];
567
- skippedSchema: number;
568
- schema: string;
569
- n: number;
570
- withoutClassification: number;
571
- bins: import("./maintenance-evidence").CalibrationBin[];
572
- brierScore: number | null;
573
- falsePositives: number;
574
- falseNegatives: number;
575
- minSamples: number;
576
- status: "measured" | "insufficient-data";
577
- }>;
578
- rtm_impact(a: {
579
- root: string;
580
- changed: string[];
581
- }): Promise<{
582
- breadthWarning?: string | undefined;
583
- rankedImpact: {
584
- file: string;
585
- score: number;
586
- }[];
587
- reachedByDepth: number[];
588
- bounded: {
589
- id: string;
590
- reason: "hub" | "depth";
591
- inDegree?: number;
592
- }[] | undefined;
593
- summariesOmitted?: number | undefined;
594
- impacted: string[];
595
- impactedSummaries: {
596
- id: string;
597
- summary: string | null;
598
- }[];
599
- }>;
600
- rtm_reindex(a: {
601
- root: string;
602
- base?: string;
603
- head?: string;
604
- since?: string;
605
- }): Promise<{
606
- changed: number;
607
- nodes: number;
608
- edges: number;
609
- changeSource: ChangeSourceInfo;
610
- semanticWarm?: {
611
- tier: string;
612
- computed: number;
613
- cached: number;
614
- };
615
- }>;
616
- context_bundle(a: {
617
- root: string;
618
- seedId: string;
619
- budget: number;
620
- }): Promise<import("../context/bundler").ContextBundle>;
621
- review_scope(a: {
622
- root: string;
623
- base?: string;
624
- head?: string;
625
- since?: string;
626
- }): Promise<{
627
- scopeFallback?: "full" | undefined;
628
- unscannedChangedFiles: string[];
629
- testScope: import("../rtm/test-scope").TestScope;
630
- changeSource: ChangeSourceInfo;
631
- changedSymbols: string[];
632
- impactedSpecs: string[];
633
- acceptanceCriteria: Array<{
634
- specId: string;
635
- criteria: string;
636
- }>;
637
- unrequestedSymbols: string[];
638
- coverageGaps: string[];
639
- obligationGaps: string[];
640
- }>;
641
- review_prepare(a: {
642
- root: string;
643
- base?: string;
644
- head?: string;
645
- since?: string;
646
- budget?: number;
647
- }): Promise<{
648
- scopeFallback?: "full" | undefined;
649
- package: import("../review/package").ReviewPackage;
650
- unscannedChangedFiles: string[];
651
- changeSource: ChangeSourceInfo;
652
- }>;
653
- review_record(a: {
654
- root: string;
655
- findings: Finding[];
656
- }): Promise<{
657
- recorded: number;
658
- }>;
659
- review_status(a: {
660
- root: string;
661
- }): Promise<{
662
- blocked: boolean;
663
- open: {
664
- critical: number;
665
- important: number;
666
- minor: number;
667
- };
668
- reviewNeeded: import("../review/review-targets").ReviewNeeded[];
669
- }>;
670
- risk_check(a: {
671
- root?: string;
672
- action: RiskAction;
673
- approval?: Approval;
674
- changedSymbols?: string[];
675
- enforcement?: Enforcement;
676
- ts: string;
677
- actor?: string;
678
- rationale?: string;
679
- }): Promise<{
680
- assessment: import("../guardrail/risk-types").RiskAssessment;
681
- gate: import("../guardrail/risk-gate").GateResult;
682
- }>;
683
- /**
684
- * Read-only inventory of a brownfield target: candidate clusters, coverage, and what the scan
685
- * could not resolve. Deliberately does NOT call assertRepoTopLevel — a target that is not a git
686
- * repository is a supported case here, reported as `isGit: false`.
687
- */
688
- reverse_scan(a: {
689
- root: string;
690
- maxFlagged?: number;
691
- }): Promise<{
692
- root: string;
693
- isGit: boolean;
694
- scanned: number;
695
- droppedUntracked: number;
696
- candidates: number;
697
- anchored: number;
698
- unanchored: number;
699
- clusters: import("../reverse/cluster").Cluster[];
700
- testClusters: import("../reverse/cluster").Cluster[];
701
- coverage: {
702
- structurallyResolved: number;
703
- inTestClusters: number;
704
- cohesionUnmeasured: number;
705
- testsMatched: number;
706
- testsUnmatched: number;
707
- withDynamicIndicators: number;
708
- indicators: Partial<Record<import("../reverse/dynamic-wiring").Indicator, number>>;
709
- uncalibratedIndicatorLanguages: string[];
710
- ignoreUnsupportedPatterns: string[];
711
- };
712
- needsHumanConfirmation: import("../reverse/scan").FlaggedFile[];
713
- tests: import("../reverse/test-map").TestMapping;
714
- }>;
715
- /**
716
- * Draft H-SPEC/A-SPEC/T-SPEC documents for the recovered clusters under an EXISTING parent REQ.
717
- *
718
- * The REQ is the human's to write and this tool refuses without one — a requirement states
719
- * business intent, which is not in the code. Everything emitted is `status: draft`, and writing
720
- * requires an explicit `dryRun: false`.
721
- *
722
- * WHERE THE DOCUMENTS LAND: in the SERVER's configured spec store (`HOLMES_SPECS`, default
723
- * `.ax/specs` relative to the server's working directory) — not inside `root`. In the intended
724
- * adoption the two are the same directory, because the server runs inside the target it governs;
725
- * pointing `root` at a different repository drafts that repository's slices into THIS store,
726
- * which is a governance decision the caller has to make deliberately.
727
- */
728
- reverse_draft(a: {
729
- root: string;
730
- parentReqId?: string;
731
- cluster?: string;
732
- dryRun?: boolean;
733
- }): Promise<{
734
- ok: boolean;
735
- reason: string;
736
- availableClusters?: undefined;
737
- dryRun?: undefined;
738
- parentReqId?: undefined;
739
- clusters?: undefined;
740
- drafted?: undefined;
741
- skipped?: undefined;
742
- refused?: undefined;
743
- } | {
744
- ok: boolean;
745
- reason: string;
746
- availableClusters: string[];
747
- dryRun?: undefined;
748
- parentReqId?: undefined;
749
- clusters?: undefined;
750
- drafted?: undefined;
751
- skipped?: undefined;
752
- refused?: undefined;
753
- } | {
754
- ok: boolean;
755
- dryRun: boolean;
756
- parentReqId: string;
757
- clusters: number;
758
- drafted: DraftResult[];
759
- skipped: {
760
- clusterKey: string;
761
- reason: string;
762
- }[];
763
- refused: {
764
- clusterKey: string;
765
- reason: string;
766
- findings?: unknown[];
767
- }[];
768
- reason?: undefined;
769
- availableClusters?: undefined;
770
- }>;
771
- /**
772
- * Insert `@implements` anchors into source files. Dry-run by DEFAULT, and anchoring to a
773
- * non-approved A-SPEC is refused — a reverse-engineered draft describes code; description does
774
- * not confer approval.
775
- */
776
- reverse_anchor(a: {
777
- root: string;
778
- mapping: AnchorMapping[];
779
- dryRun?: boolean;
780
- }): Promise<{
781
- blockers: Record<string, string>;
782
- applied: number;
783
- dryRun: boolean;
784
- would: number;
785
- failed: import("../reverse/anchor").RefusedAnchor[];
786
- edits: import("../reverse/anchor").AnchorEdit[];
787
- refused: import("../reverse/anchor").RefusedAnchor[];
788
- }>;
789
- spec_slice_init(a: {
790
- root?: string;
791
- sliceName: string;
792
- title: string;
793
- objective: string;
794
- filesToTouch: string[];
795
- }): Promise<{
796
- ok: boolean;
797
- specsCreated: string[];
798
- unreadable: string[];
799
- }>;
800
- spec_slice_approve(a: {
801
- root?: string;
802
- sliceName: string;
803
- }): Promise<{
804
- ok: boolean;
805
- approvedSpecs: string[];
806
- alreadySealed: string[];
807
- refused: {
808
- id: string;
809
- reason: string;
810
- }[];
811
- }>;
812
- spec_remediate(a: {
813
- root?: string;
814
- targetFile?: string;
815
- aspecId?: string;
816
- }): Promise<{
817
- ok: boolean;
818
- actionsTaken: string[];
819
- refused: {
820
- id: string;
821
- reason: string;
822
- }[];
823
- }>;
824
1061
  };
825
1062
  export {};