@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
@@ -0,0 +1,216 @@
1
+ import { EntityGitInputs, EntityGitSnapshot } from './entity-git-snapshot';
2
+ import { EntityRenumberProposal } from './entity-renumber';
3
+ type Entity = EntityGitSnapshot['entities'][number];
4
+ export interface EntityGitFileVersion {
5
+ mode: string;
6
+ bytes: Buffer;
7
+ }
8
+ export type EntityGitObject = {
9
+ commit: string;
10
+ oid: string;
11
+ mode: string;
12
+ path: string;
13
+ } | null;
14
+ export type EntityGitSideRecord<T> = Record<'base' | 'left' | 'right', T>;
15
+ /** @implements A-SPEC-636 — a source-level conflict with the immutable per-side objects of the involved path. */
16
+ export interface EntityGitSourceEvidence {
17
+ kind: 'source';
18
+ file: string;
19
+ reason: string;
20
+ target?: string;
21
+ other?: string;
22
+ objects: EntityGitSideRecord<EntityGitObject>;
23
+ }
24
+ /** @implements A-SPEC-636 — an entity-level numbering, document, reference or mirror conflict with per-side facts. */
25
+ export type EntityGitNumberingEvidence = {
26
+ kind: 'numbering';
27
+ entityId: string;
28
+ reason: 'concurrent-display-id';
29
+ displayIds: EntityGitSideRecord<string | null>;
30
+ } | {
31
+ kind: 'document';
32
+ entityId: string;
33
+ reason: 'unsupported-type' | 'id-mismatch' | 'unsupported-display-id';
34
+ displayIds: EntityGitSideRecord<string | null>;
35
+ } | {
36
+ kind: 'reference';
37
+ entityId: string;
38
+ reference: string;
39
+ reason: 'ambiguous' | 'unresolved' | 'deleted-target';
40
+ targets: EntityGitSideRecord<string | null>;
41
+ } | {
42
+ kind: 'mirror';
43
+ entityIds: string[];
44
+ reason: 'incompatible-mirror-numbers';
45
+ displayIds: Record<string, EntityGitSideRecord<string | null>>;
46
+ };
47
+ /**
48
+ * @implements A-SPEC-637 — non-regular entries (symlinks, gitlinks) identical in base, left and right:
49
+ * excluded from integration and never read as blobs. Anything else non-regular is a refusal.
50
+ */
51
+ export declare function unchangedNonRegular(inputs: EntityGitInputs): Map<string, string>;
52
+ export interface EntityGitMergedSources {
53
+ ok: boolean;
54
+ conflicts: string[];
55
+ evidence: EntityGitSourceEvidence[];
56
+ commits: Record<'base' | 'left' | 'right', string>;
57
+ normalization: EntityGitSources;
58
+ validation: {
59
+ diagnostics: Array<{
60
+ file: string;
61
+ reason: string;
62
+ }>;
63
+ proseCandidates: Array<{
64
+ file: string;
65
+ line: number;
66
+ text: string;
67
+ }>;
68
+ anchors: Array<{
69
+ file: string;
70
+ displayId: string;
71
+ entityId: string;
72
+ }>;
73
+ };
74
+ files: Array<{
75
+ file: string;
76
+ merge: EntityGitFileMerge;
77
+ objects: Record<'base' | 'left' | 'right', {
78
+ commit: string;
79
+ oid: string;
80
+ mode: string;
81
+ path: string;
82
+ } | null>;
83
+ }>;
84
+ excluded: Array<{
85
+ file: string;
86
+ reason: string;
87
+ }>;
88
+ }
89
+ /** Ordinary tracked files only; excluded canonical paths remain obligations of the integration executor. */
90
+ export declare function planEntityGitMergedSources(root: string, revisions: {
91
+ base: string;
92
+ left: string;
93
+ right: string;
94
+ }, storeLocator: string): Promise<EntityGitMergedSources>;
95
+ export interface EntityGitFileMerge {
96
+ ok: boolean;
97
+ result: EntityGitFileVersion | null;
98
+ reason: string;
99
+ inputs: {
100
+ base: EntityGitFileVersion | null;
101
+ left: EntityGitFileVersion | null;
102
+ right: EntityGitFileVersion | null;
103
+ };
104
+ }
105
+ /** Merge already-normalized bytes. Scratch files are not a materialized Holmes workspace. */
106
+ /**
107
+ * @implements A-SPEC-652.6 — the environment `git merge-file` runs in: the caller's GIT_* stripped,
108
+ * the system and global configs blocked, the ceiling at the scratch parent. The "empty global
109
+ * config" is `os.devNull` on POSIX; on Windows `os.devNull` is `\\.\nul`, which git cannot open as
110
+ * a config file (`fatal: unable to access '\\.\nul': Invalid argument`, status 128 — measured
111
+ * 2026-09-15), so every content merge there was reported as a merge-tool-failure conflict. `NUL`
112
+ * is the spelling git accepts on that platform.
113
+ */
114
+ export declare function mergeToolEnv(base: NodeJS.ProcessEnv, scratch: string, platform?: NodeJS.Platform): NodeJS.ProcessEnv;
115
+ export declare function mergeEntityGitFile(base: EntityGitFileVersion | null, left: EntityGitFileVersion | null, right: EntityGitFileVersion | null): EntityGitFileMerge;
116
+ export interface EntityGitSourceBranch {
117
+ files: Array<{
118
+ file: string;
119
+ oid: string;
120
+ mode: string;
121
+ before: string;
122
+ after: string;
123
+ anchors: Array<{
124
+ displayId: string;
125
+ entityId: string;
126
+ newDisplayId: string;
127
+ targetDeleted?: true;
128
+ }>;
129
+ }>;
130
+ diagnostics: Array<{
131
+ file: string;
132
+ reason: string;
133
+ }>;
134
+ proseCandidates: Array<{
135
+ file: string;
136
+ line: number;
137
+ text: string;
138
+ }>;
139
+ }
140
+ export interface EntityGitSources {
141
+ ok: boolean;
142
+ conflicts: string[];
143
+ evidence?: EntityGitNumberingEvidence[];
144
+ branches: {
145
+ base: EntityGitSourceBranch;
146
+ left: EntityGitSourceBranch;
147
+ right: EntityGitSourceBranch;
148
+ };
149
+ }
150
+ /** Branch proposals retain provenance; ordinary three-way source merging and publication follow separately. */
151
+ export declare function planEntityGitSources(root: string, revisions: {
152
+ base: string;
153
+ left: string;
154
+ right: string;
155
+ }, storeLocator: string): Promise<EntityGitSources>;
156
+ export interface EntityGitNumbering {
157
+ ok: boolean;
158
+ assignments: Array<{
159
+ entityId: string;
160
+ oldDisplayId: string;
161
+ newDisplayId: string;
162
+ }>;
163
+ conflicts: string[];
164
+ /** @implements A-SPEC-636 — one structured record per conflict string, with per-side facts; present only when refused. */
165
+ evidence?: EntityGitNumberingEvidence[];
166
+ }
167
+ export interface EntityGitDocuments {
168
+ ok: boolean;
169
+ conflicts: string[];
170
+ evidence?: EntityGitNumberingEvidence[];
171
+ documents: Array<EntityRenumberProposal['entries'][number] & {
172
+ source: 'base' | 'left' | 'right';
173
+ sourceCommit: string;
174
+ }>;
175
+ branches?: {
176
+ base: EntityRenumberProposal;
177
+ left: EntityRenumberProposal;
178
+ right: EntityRenumberProposal;
179
+ };
180
+ approval?: {
181
+ targets: Array<{
182
+ entityId: string;
183
+ displayId: string;
184
+ reasons: string[];
185
+ }>;
186
+ unsealOrder: string[];
187
+ approveOrder: string[];
188
+ };
189
+ }
190
+ /** Keep each original namespace until references have been rewritten; never merge ID maps first. */
191
+ export declare function planEntityGitDocuments(inputs: EntityGitInputs): EntityGitDocuments;
192
+ /** Namespace proposal only: these assignments still need reference rewriting, authorization and publication. */
193
+ export declare function planEntityGitNumbering(inputs: EntityGitInputs): EntityGitNumbering;
194
+ export interface EntityGitClassification {
195
+ schema: 'holmes-entity-git-classification/1';
196
+ commits: {
197
+ base: string;
198
+ left: string;
199
+ right: string;
200
+ };
201
+ decisions: Array<{
202
+ entityId: string;
203
+ outcome: 'unchanged' | 'left' | 'right' | 'equal' | 'deleted' | 'conflict';
204
+ reason: string;
205
+ base: Entity | null;
206
+ left: Entity | null;
207
+ right: Entity | null;
208
+ }>;
209
+ collisions: Array<{
210
+ displayId: string;
211
+ entityIds: string[];
212
+ }>;
213
+ }
214
+ /** Exact remains the default; meaning mode changes comparison, never retained inputs. */
215
+ export declare function classifyEntityGitChanges(inputs: EntityGitInputs, comparison?: 'exact' | 'meaning'): EntityGitClassification;
216
+ export {};