@holmes-lab/holmes-kit 0.19.5 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/README.md +17 -1
  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/gitignore-merge.d.ts +0 -5
  13. package/dist/holmes/cli/gitignore-merge.js +6 -2
  14. package/dist/holmes/cli/index.js +176 -139
  15. package/dist/holmes/cli/playbook-skills.d.ts +2 -22
  16. package/dist/holmes/cli/playbook-skills.js +10 -54
  17. package/dist/holmes/governance/approval-grants.d.ts +22 -0
  18. package/dist/holmes/governance/approval-grants.js +55 -1
  19. package/dist/holmes/governance/approval-queue.d.ts +43 -4
  20. package/dist/holmes/governance/approval-queue.js +86 -12
  21. package/dist/holmes/governance/display-id-aliases.d.ts +29 -0
  22. package/dist/holmes/governance/display-id-aliases.js +86 -0
  23. package/dist/holmes/governance/ledger-store.d.ts +42 -14
  24. package/dist/holmes/governance/ledger-store.js +49 -3
  25. package/dist/holmes/governance/ledger-timeline.d.ts +3 -1
  26. package/dist/holmes/governance/ledger-timeline.js +11 -1
  27. package/dist/holmes/governance/provenance-chain.d.ts +2 -0
  28. package/dist/holmes/governance/provenance-chain.js +13 -2
  29. package/dist/holmes/governance/provenance-ledger.d.ts +28 -0
  30. package/dist/holmes/governance/provenance-ledger.js +69 -16
  31. package/dist/holmes/governance/session-context.d.ts +3 -0
  32. package/dist/holmes/governance/session-context.js +26 -8
  33. package/dist/holmes/guardrail/risk-classifier.js +2 -2
  34. package/dist/holmes/guardrail/write-target.js +2 -1
  35. package/dist/holmes/hooks/pre-tool-use.js +12 -1
  36. package/dist/holmes/hooks/stop.js +14 -3
  37. package/dist/holmes/mcp/handlers/adoption.d.ts +118 -0
  38. package/dist/holmes/mcp/handlers/adoption.js +186 -0
  39. package/dist/holmes/mcp/handlers/entity-integration.d.ts +100 -0
  40. package/dist/holmes/mcp/handlers/entity-integration.js +324 -0
  41. package/dist/holmes/mcp/handlers/entity-renumber.d.ts +137 -0
  42. package/dist/holmes/mcp/handlers/entity-renumber.js +228 -0
  43. package/dist/holmes/mcp/handlers/entity-store.d.ts +78 -0
  44. package/dist/holmes/mcp/handlers/entity-store.js +212 -0
  45. package/dist/holmes/mcp/handlers/graph-operations.d.ts +90 -0
  46. package/dist/holmes/mcp/handlers/graph-operations.js +260 -0
  47. package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +34 -0
  48. package/dist/holmes/mcp/handlers/maintenance-analysis.js +288 -0
  49. package/dist/holmes/mcp/handlers/maintenance-evidence.d.ts +40 -0
  50. package/dist/holmes/mcp/handlers/maintenance-evidence.js +104 -0
  51. package/dist/holmes/mcp/handlers/operator-inspection.d.ts +167 -0
  52. package/dist/holmes/mcp/handlers/operator-inspection.js +284 -0
  53. package/dist/holmes/mcp/handlers/phase-queries.d.ts +34 -0
  54. package/dist/holmes/mcp/handlers/phase-queries.js +86 -0
  55. package/dist/holmes/mcp/handlers/review-evidence.d.ts +47 -0
  56. package/dist/holmes/mcp/handlers/review-evidence.js +370 -0
  57. package/dist/holmes/mcp/handlers/review-queries.d.ts +68 -0
  58. package/dist/holmes/mcp/handlers/review-queries.js +79 -0
  59. package/dist/holmes/mcp/handlers/risk-assessment.d.ts +25 -0
  60. package/dist/holmes/mcp/handlers/risk-assessment.js +181 -0
  61. package/dist/holmes/mcp/handlers/slice-orchestration.d.ts +55 -0
  62. package/dist/holmes/mcp/handlers/slice-orchestration.js +324 -0
  63. package/dist/holmes/mcp/handlers/spec-approval.d.ts +105 -0
  64. package/dist/holmes/mcp/handlers/spec-approval.js +504 -0
  65. package/dist/holmes/mcp/handlers/spec-authoring.d.ts +57 -0
  66. package/dist/holmes/mcp/handlers/spec-authoring.js +326 -0
  67. package/dist/holmes/mcp/handlers/spec-lifecycle.d.ts +122 -0
  68. package/dist/holmes/mcp/handlers/spec-lifecycle.js +339 -0
  69. package/dist/holmes/mcp/handlers/spec-queries.d.ts +30 -0
  70. package/dist/holmes/mcp/handlers/spec-queries.js +74 -0
  71. package/dist/holmes/mcp/handlers/taint-screening.d.ts +48 -0
  72. package/dist/holmes/mcp/handlers/taint-screening.js +183 -0
  73. package/dist/holmes/mcp/handlers/test-execution.d.ts +63 -0
  74. package/dist/holmes/mcp/handlers/test-execution.js +210 -0
  75. package/dist/holmes/mcp/handlers/workspace-identity.d.ts +30 -0
  76. package/dist/holmes/mcp/handlers/workspace-identity.js +68 -0
  77. package/dist/holmes/mcp/handlers/workspace-queries.d.ts +77 -0
  78. package/dist/holmes/mcp/handlers/workspace-queries.js +193 -0
  79. package/dist/holmes/mcp/handlers.d.ts +653 -424
  80. package/dist/holmes/mcp/handlers.js +267 -3250
  81. package/dist/holmes/mcp/server.js +2 -1
  82. package/dist/holmes/mcp/tool-schemas.js +43 -2
  83. package/dist/holmes/project/execution-context.d.ts +17 -0
  84. package/dist/holmes/project/execution-context.js +120 -0
  85. package/dist/holmes/project/installer-markers.d.ts +34 -0
  86. package/dist/holmes/project/installer-markers.js +65 -0
  87. package/dist/holmes/project/root.d.ts +3 -1
  88. package/dist/holmes/project/root.js +4 -3
  89. package/dist/holmes/project/workspace-identity.d.ts +29 -0
  90. package/dist/holmes/project/workspace-identity.js +181 -0
  91. package/dist/holmes/review/test-outcomes.d.ts +6 -1
  92. package/dist/holmes/review/test-outcomes.js +23 -5
  93. package/dist/holmes/review/test-runner.d.ts +18 -0
  94. package/dist/holmes/review/test-runner.js +132 -4
  95. package/dist/holmes/rtm/graph-store.d.ts +50 -1
  96. package/dist/holmes/rtm/graph-store.js +244 -3
  97. package/dist/holmes/rtm/incremental.d.ts +1 -0
  98. package/dist/holmes/rtm/incremental.js +12 -3
  99. package/dist/holmes/rtm/localize.js +7 -0
  100. package/dist/holmes/rtm/rtm-graph.d.ts +9 -0
  101. package/dist/holmes/rtm/rtm-graph.js +13 -0
  102. package/dist/holmes/semantic/vector-cache.d.ts +16 -1
  103. package/dist/holmes/semantic/vector-cache.js +155 -19
  104. package/dist/holmes/spec/approval-status.d.ts +10 -0
  105. package/dist/holmes/spec/approval-status.js +7 -3
  106. package/dist/holmes/spec/entity-git-snapshot.d.ts +50 -0
  107. package/dist/holmes/spec/entity-git-snapshot.js +276 -0
  108. package/dist/holmes/spec/entity-integration-discharge.d.ts +73 -0
  109. package/dist/holmes/spec/entity-integration-discharge.js +233 -0
  110. package/dist/holmes/spec/entity-integration-transaction.d.ts +179 -0
  111. package/dist/holmes/spec/entity-integration-transaction.js +1221 -0
  112. package/dist/holmes/spec/entity-integration.d.ts +207 -0
  113. package/dist/holmes/spec/entity-integration.js +747 -0
  114. package/dist/holmes/spec/entity-renumber-transaction.d.ts +82 -0
  115. package/dist/holmes/spec/entity-renumber-transaction.js +711 -0
  116. package/dist/holmes/spec/entity-renumber.d.ts +32 -0
  117. package/dist/holmes/spec/entity-renumber.js +156 -0
  118. package/dist/holmes/spec/entity-store.d.ts +135 -0
  119. package/dist/holmes/spec/entity-store.js +1051 -0
  120. package/dist/holmes/spec/entity-transaction.d.ts +89 -0
  121. package/dist/holmes/spec/entity-transaction.js +701 -0
  122. package/dist/holmes/spec/renumber.d.ts +58 -0
  123. package/dist/holmes/spec/renumber.js +200 -1
  124. package/dist/holmes/spec/spec-store.d.ts +3 -2
  125. package/dist/holmes/spec/spec-store.js +23 -2
  126. package/dist/holmes/spec/transition-policy.d.ts +36 -0
  127. package/dist/holmes/spec/transition-policy.js +135 -0
  128. package/package.json +1 -1
@@ -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,593 @@ 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
+ specsCreated: string[];
595
+ unreadable: string[];
596
+ }>;
597
+ spec_slice_approve: (a: {
598
+ root?: string;
599
+ sliceName: string;
600
+ }) => Promise<{
601
+ ok: boolean;
602
+ approvedSpecs: string[];
603
+ alreadySealed: string[];
604
+ refused: {
605
+ id: string;
606
+ reason: string;
607
+ }[];
608
+ }>;
609
+ spec_remediate: (a: {
610
+ root?: string;
611
+ targetFile?: string;
612
+ aspecId?: string;
613
+ }) => Promise<{
614
+ ok: boolean;
615
+ actionsTaken: string[];
616
+ refused: {
617
+ id: string;
618
+ reason: string;
619
+ }[];
620
+ }>;
621
+ maintenance_outcome(a: {
622
+ root: string;
623
+ digest: string;
624
+ actualFiles?: string[];
625
+ actualSymbols?: string[];
626
+ actualTests?: string[];
627
+ actualClassification?: string;
628
+ }): Promise<import("./maintenance-evidence").EvidenceArtifact>;
629
+ impact_gate_check(a: {
630
+ root: string;
631
+ target: string;
632
+ digest?: string;
633
+ }): Promise<import("../guardrail/impact-gate").EditEvidenceVerdict>;
634
+ maintenance_calibration(a: {
635
+ root: string;
636
+ minSamples?: number;
637
+ }): Promise<{
638
+ artifacts: number;
639
+ unreadable: string[];
640
+ skippedSchema: number;
641
+ schema: string;
642
+ n: number;
643
+ withoutClassification: number;
644
+ bins: import("./maintenance-evidence").CalibrationBin[];
645
+ brierScore: number | null;
646
+ falsePositives: number;
647
+ falseNegatives: number;
648
+ minSamples: number;
649
+ status: "measured" | "insufficient-data";
650
+ }>;
651
+ spec_create: (a: any) => Promise<{
71
652
  ok: boolean;
72
653
  reason: string;
73
654
  created?: undefined;
@@ -76,7 +657,7 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
76
657
  ok?: undefined;
77
658
  reason?: undefined;
78
659
  }>;
79
- spec_validate(a: any): Promise<{
660
+ spec_validate: (a: any) => Promise<{
80
661
  ok: boolean;
81
662
  findings: {
82
663
  level: string;
@@ -84,32 +665,9 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
84
665
  message: any;
85
666
  }[];
86
667
  }>;
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: {
668
+ spec_upgrade: (a: {
111
669
  id: string;
112
- }): Promise<{
670
+ }) => Promise<{
113
671
  ok: boolean;
114
672
  reason: string;
115
673
  upgraded?: undefined;
@@ -131,28 +689,11 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
131
689
  remaining: import("../spec/validator").Finding[];
132
690
  reason?: undefined;
133
691
  }>;
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: {
692
+ spec_retire: (a: {
152
693
  root?: string;
153
694
  id: string;
154
695
  reason?: string;
155
- }): Promise<{
696
+ }) => Promise<{
156
697
  ok: boolean;
157
698
  reason: string;
158
699
  retired?: undefined;
@@ -171,30 +712,12 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
171
712
  dependents: string[];
172
713
  reason?: undefined;
173
714
  }>;
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: {
715
+ spec_renumber: (a: {
187
716
  root?: string;
188
717
  oldBase: string;
189
718
  newBase: string;
190
719
  dryRun?: boolean;
191
- }): Promise<{
192
- ok: boolean;
193
- reason: string;
194
- dryRun?: undefined;
195
- plan?: undefined;
196
- movedSpecs?: undefined;
197
- } | {
720
+ }) => Promise<{
198
721
  ok: boolean;
199
722
  dryRun: boolean;
200
723
  plan: import("../spec/renumber").RenumberPlan;
@@ -206,11 +729,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
206
729
  movedSpecs: number;
207
730
  plan: import("../spec/renumber").RenumberPlan;
208
731
  reason?: undefined;
732
+ } | {
733
+ ok: boolean;
734
+ reason: string;
209
735
  }>;
210
- spec_unseal(a: {
736
+ spec_unseal: (a: {
211
737
  root?: string;
212
738
  id: string;
213
- }): Promise<{
739
+ }) => Promise<{
214
740
  ok: boolean;
215
741
  reason: string;
216
742
  unsealed?: undefined;
@@ -229,30 +755,28 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
229
755
  dependents: string[];
230
756
  reason?: undefined;
231
757
  }>;
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: {
758
+ approval_status: (a: {
241
759
  root?: string;
242
760
  id: string;
243
- }): Promise<{
761
+ }) => Promise<{
244
762
  ok: boolean;
245
763
  reason: string;
246
764
  } | {
247
765
  graphPreview?: {
248
766
  impact?: import("../rtm/impact-advisory").ImpactAdvisory;
249
- density?: import("../rtm/anchor-density").AnchorDensityFinding[];
767
+ density?: Array<import("../rtm/anchor-density").AnchorDensityFinding>;
250
768
  cycles?: {
251
- findings: import("../cpg/cycle-detect").CycleFinding[];
769
+ findings: Array<import("../cpg/cycle-detect").CycleFinding>;
252
770
  note: string;
253
771
  };
254
- architecture?: import("../cpg/arch-observe").ArchObservation[];
772
+ architecture?: Array<import("../cpg/arch-observe").ArchObservation>;
255
773
  graphAsOf?: string;
774
+ graph?: {
775
+ status: "current" | "stale" | "unverified";
776
+ sourceCommit: string | null;
777
+ head: string | null;
778
+ };
779
+ unavailable?: "empty" | "unreadable";
256
780
  } | undefined;
257
781
  id: string;
258
782
  type?: string;
@@ -261,21 +785,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
261
785
  approvedDigest?: string;
262
786
  parents: import("../spec/approval-status").ParentApproval[];
263
787
  blockers: string[];
788
+ resealBlockers: string[];
264
789
  ok: boolean;
265
790
  reason?: undefined;
266
791
  }>;
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: {
792
+ ledger_timeline: (a: {
276
793
  root?: string;
277
794
  id?: string;
278
- }): Promise<{
795
+ }) => Promise<{
279
796
  ok: boolean;
280
797
  reason: string;
281
798
  events?: undefined;
@@ -284,10 +801,10 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
284
801
  events: import("../governance/ledger-timeline").TimelineEntry[];
285
802
  reason?: undefined;
286
803
  }>;
287
- rtm_dashboard(a: {
804
+ rtm_dashboard: (a: {
288
805
  root?: string;
289
806
  port?: number;
290
- }): Promise<{
807
+ }) => Promise<{
291
808
  ok: boolean;
292
809
  reason: string;
293
810
  url?: undefined;
@@ -300,35 +817,41 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
300
817
  census: import("../server/dashboard-launcher").DashboardCensus;
301
818
  reason?: undefined;
302
819
  }>;
303
- spec_approve(a: {
820
+ spec_approve: (a: {
304
821
  root?: string;
305
822
  id: string;
306
- }): Promise<{
307
- ok: boolean;
823
+ }) => Promise<{
824
+ ok: false;
308
825
  reason: string;
309
- findings?: undefined;
310
- conflict?: undefined;
826
+ findings: import("../spec/validator").Finding[];
827
+ candidate?: undefined;
828
+ digest?: undefined;
829
+ parentDigests?: undefined;
311
830
  } | {
312
831
  ok: boolean;
313
832
  reason: string;
314
- findings: import("../spec/validator").Finding[];
315
833
  conflict?: undefined;
316
834
  } | {
317
835
  ok: boolean;
318
836
  reason: string;
319
837
  conflict: import("../spec/version-conflict").ConflictDetail;
320
- findings?: undefined;
321
838
  } | {
839
+ impactAdvisoryUnavailable?: "empty" | "unreadable" | undefined;
840
+ impactGraph?: {
841
+ status: "current" | "stale" | "unverified";
842
+ sourceCommit: string | null;
843
+ head: string | null;
844
+ graphAsOf?: string;
845
+ } | undefined;
322
846
  anchorDensity?: import("../rtm/anchor-density").AnchorDensityFinding[] | undefined;
323
847
  impactAdvisory?: import("../rtm/impact-advisory").ImpactAdvisory | undefined;
324
848
  approved: string;
325
849
  digest: string;
326
850
  ok?: undefined;
327
851
  reason?: undefined;
328
- findings?: undefined;
329
852
  conflict?: undefined;
330
853
  }>;
331
- spec_list(a: any): Promise<{
854
+ spec_list: (a: any) => Promise<{
332
855
  specs: {
333
856
  legacy?: boolean | undefined;
334
857
  parent?: string | undefined;
@@ -337,14 +860,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
337
860
  status: "draft" | "review" | "approved" | "outdated";
338
861
  }[];
339
862
  }>;
340
- spec_next(): Promise<{
863
+ spec_next: () => Promise<{
341
864
  next: import("../spec/spec-types").SpecType;
342
865
  } | {
343
866
  next: null;
344
867
  }>;
345
- rtm_check(a?: {
868
+ rtm_check: (a?: {
346
869
  root?: string;
347
- }): Promise<{
870
+ }) => Promise<{
348
871
  ok: boolean;
349
872
  reason: string;
350
873
  issues?: undefined;
@@ -363,20 +886,11 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
363
886
  reason?: undefined;
364
887
  gaps?: undefined;
365
888
  }>;
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: {
889
+ citation_pin: (a: {
376
890
  root: string;
377
891
  id: string;
378
892
  dryRun?: boolean;
379
- }): Promise<{
893
+ }) => Promise<{
380
894
  ok: boolean;
381
895
  reason: string;
382
896
  id?: undefined;
@@ -393,9 +907,9 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
393
907
  citations: unknown[];
394
908
  reason?: undefined;
395
909
  }>;
396
- phase_status(a: {
910
+ phase_status: (a: {
397
911
  root?: string;
398
- }): Promise<{
912
+ }) => Promise<{
399
913
  ok: boolean;
400
914
  reason: string;
401
915
  specs?: undefined;
@@ -410,18 +924,18 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
410
924
  ok?: undefined;
411
925
  reason?: undefined;
412
926
  }>;
413
- phase_check(a: {
414
- action?: Action;
927
+ phase_check: (a: {
928
+ action?: import("../guardrail/phase").Action;
415
929
  target: string;
416
930
  targetAspecId?: string;
417
- }): Promise<import("../guardrail/phase").CheckResult | {
931
+ }) => Promise<import("../guardrail/phase").CheckResult | {
418
932
  decision: string;
419
933
  note: string;
420
934
  }>;
421
- cpg_scan(a: {
935
+ cpg_scan: (a: {
422
936
  root: string;
423
937
  lints?: boolean;
424
- }): Promise<{
938
+ }) => Promise<{
425
939
  files: number;
426
940
  symbols: number;
427
941
  skipped: {
@@ -451,17 +965,10 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
451
965
  }[];
452
966
  skippedCount: number;
453
967
  }>;
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: {
968
+ taint_scan: (a: {
462
969
  root: string;
463
970
  dataFlow?: boolean;
464
- }): Promise<{
971
+ }) => Promise<{
465
972
  kind: string;
466
973
  limits: ("name-based matching" | "no def-use" | "no sanitizers" | "call-edge-only")[];
467
974
  maxPaths: number | undefined;
@@ -473,12 +980,10 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
473
980
  } | {
474
981
  dataFlow: {
475
982
  findings: Record<string, unknown>[];
476
- /** Findings the reaching-definition evidence positively refuted (dead or fully sanitized). */
477
983
  refutedByReachingDefs: number;
478
984
  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
985
  converged: boolean;
480
986
  truncated: number;
481
- /** Which languages this run could actually judge, so a zero is readable. */
482
987
  languagesAnalysed: (string | null)[];
483
988
  };
484
989
  kind: string;
@@ -489,14 +994,14 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
489
994
  ok?: undefined;
490
995
  reason?: undefined;
491
996
  }>;
492
- test_run(a: {
997
+ test_run: (a: {
493
998
  root: string;
494
999
  base?: string;
495
1000
  head?: string;
496
1001
  since?: string;
497
1002
  mark?: string;
498
1003
  mutate?: string;
499
- }): Promise<{
1004
+ }) => Promise<{
500
1005
  mutate: {
501
1006
  tspec: string;
502
1007
  aspec: string | undefined;
@@ -528,298 +1033,22 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
528
1033
  changeSource: ChangeSourceInfo;
529
1034
  mutate?: undefined;
530
1035
  }>;
531
- issue_localize(a: {
1036
+ issue_localize: (a: {
532
1037
  root: string;
533
1038
  issue: string;
534
1039
  topN?: number;
535
- }): Promise<import("../rtm/localize").LocalizationReport>;
536
- maintenance_analyze(a: {
1040
+ }) => Promise<import("../rtm/localize").LocalizationReport>;
1041
+ maintenance_analyze: (a: {
537
1042
  root: string;
538
1043
  request: string;
539
1044
  historyLimit?: number;
540
1045
  contextBudget?: number;
541
- groundTruth?: MaintenanceGroundTruth;
1046
+ groundTruth?: import("./maintenance-analyze").MaintenanceGroundTruth;
542
1047
  persist?: boolean;
543
1048
  changedFiles?: string[];
544
- }): Promise<MaintenanceAnalysis & {
1049
+ }) => Promise<import("./maintenance-analyze").MaintenanceAnalysis & {
545
1050
  persistedTo?: string;
546
1051
  bounded?: boolean;
547
1052
  }>;
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
1053
  };
825
1054
  export {};