@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.
- package/CHANGELOG.md +143 -0
- package/README.md +9 -2
- package/dist/.build-id +1 -1
- package/dist/holmes/cli/approve-status.d.ts +24 -0
- package/dist/holmes/cli/approve-status.js +166 -0
- package/dist/holmes/cli/approve-watch.d.ts +6 -0
- package/dist/holmes/cli/approve-watch.js +6 -0
- package/dist/holmes/cli/approve.d.ts +27 -0
- package/dist/holmes/cli/approve.js +68 -7
- package/dist/holmes/cli/cli-execution.d.ts +2 -0
- package/dist/holmes/cli/cli-execution.js +24 -0
- package/dist/holmes/cli/doctor-check.d.ts +15 -0
- package/dist/holmes/cli/doctor-check.js +2 -0
- package/dist/holmes/cli/doctor.d.ts +2 -8
- package/dist/holmes/cli/doctor.js +12 -3
- package/dist/holmes/cli/gitignore-merge.d.ts +0 -5
- package/dist/holmes/cli/gitignore-merge.js +6 -2
- package/dist/holmes/cli/index.js +176 -139
- package/dist/holmes/cli/npx-cache-check.d.ts +16 -0
- package/dist/holmes/cli/npx-cache-check.js +130 -0
- package/dist/holmes/cli/playbook-skills.d.ts +2 -22
- package/dist/holmes/cli/playbook-skills.js +10 -54
- package/dist/holmes/cli/probe-process.d.ts +17 -2
- package/dist/holmes/cli/probe-process.js +44 -11
- package/dist/holmes/governance/approval-grants.d.ts +22 -0
- package/dist/holmes/governance/approval-grants.js +55 -1
- package/dist/holmes/governance/approval-queue.d.ts +43 -4
- package/dist/holmes/governance/approval-queue.js +91 -13
- package/dist/holmes/governance/display-id-aliases.d.ts +29 -0
- package/dist/holmes/governance/display-id-aliases.js +86 -0
- package/dist/holmes/governance/ledger-store.d.ts +42 -14
- package/dist/holmes/governance/ledger-store.js +49 -3
- package/dist/holmes/governance/ledger-timeline.d.ts +3 -1
- package/dist/holmes/governance/ledger-timeline.js +11 -1
- package/dist/holmes/governance/provenance-chain.d.ts +2 -0
- package/dist/holmes/governance/provenance-chain.js +13 -2
- package/dist/holmes/governance/provenance-ledger.d.ts +28 -0
- package/dist/holmes/governance/provenance-ledger.js +69 -16
- package/dist/holmes/governance/session-context.d.ts +3 -0
- package/dist/holmes/governance/session-context.js +26 -8
- package/dist/holmes/guardrail/risk-classifier.js +2 -2
- package/dist/holmes/guardrail/write-target.js +2 -1
- package/dist/holmes/hooks/pre-tool-use.js +12 -1
- package/dist/holmes/hooks/stop.js +14 -3
- package/dist/holmes/mcp/handlers/adoption.d.ts +118 -0
- package/dist/holmes/mcp/handlers/adoption.js +186 -0
- package/dist/holmes/mcp/handlers/entity-integration.d.ts +100 -0
- package/dist/holmes/mcp/handlers/entity-integration.js +324 -0
- package/dist/holmes/mcp/handlers/entity-renumber.d.ts +137 -0
- package/dist/holmes/mcp/handlers/entity-renumber.js +228 -0
- package/dist/holmes/mcp/handlers/entity-store.d.ts +78 -0
- package/dist/holmes/mcp/handlers/entity-store.js +212 -0
- package/dist/holmes/mcp/handlers/graph-operations.d.ts +90 -0
- package/dist/holmes/mcp/handlers/graph-operations.js +260 -0
- package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +34 -0
- package/dist/holmes/mcp/handlers/maintenance-analysis.js +288 -0
- package/dist/holmes/mcp/handlers/maintenance-evidence.d.ts +40 -0
- package/dist/holmes/mcp/handlers/maintenance-evidence.js +104 -0
- package/dist/holmes/mcp/handlers/operator-inspection.d.ts +167 -0
- package/dist/holmes/mcp/handlers/operator-inspection.js +284 -0
- package/dist/holmes/mcp/handlers/phase-queries.d.ts +34 -0
- package/dist/holmes/mcp/handlers/phase-queries.js +86 -0
- package/dist/holmes/mcp/handlers/review-evidence.d.ts +47 -0
- package/dist/holmes/mcp/handlers/review-evidence.js +370 -0
- package/dist/holmes/mcp/handlers/review-queries.d.ts +68 -0
- package/dist/holmes/mcp/handlers/review-queries.js +79 -0
- package/dist/holmes/mcp/handlers/risk-assessment.d.ts +25 -0
- package/dist/holmes/mcp/handlers/risk-assessment.js +181 -0
- package/dist/holmes/mcp/handlers/slice-orchestration.d.ts +72 -0
- package/dist/holmes/mcp/handlers/slice-orchestration.js +373 -0
- package/dist/holmes/mcp/handlers/spec-approval.d.ts +105 -0
- package/dist/holmes/mcp/handlers/spec-approval.js +504 -0
- package/dist/holmes/mcp/handlers/spec-authoring.d.ts +57 -0
- package/dist/holmes/mcp/handlers/spec-authoring.js +326 -0
- package/dist/holmes/mcp/handlers/spec-lifecycle.d.ts +122 -0
- package/dist/holmes/mcp/handlers/spec-lifecycle.js +339 -0
- package/dist/holmes/mcp/handlers/spec-queries.d.ts +30 -0
- package/dist/holmes/mcp/handlers/spec-queries.js +74 -0
- package/dist/holmes/mcp/handlers/taint-screening.d.ts +48 -0
- package/dist/holmes/mcp/handlers/taint-screening.js +183 -0
- package/dist/holmes/mcp/handlers/test-execution.d.ts +63 -0
- package/dist/holmes/mcp/handlers/test-execution.js +210 -0
- package/dist/holmes/mcp/handlers/workspace-identity.d.ts +30 -0
- package/dist/holmes/mcp/handlers/workspace-identity.js +68 -0
- package/dist/holmes/mcp/handlers/workspace-queries.d.ts +77 -0
- package/dist/holmes/mcp/handlers/workspace-queries.js +193 -0
- package/dist/holmes/mcp/handlers.d.ts +661 -424
- package/dist/holmes/mcp/handlers.js +270 -3251
- package/dist/holmes/mcp/server-specs-dir.d.ts +2 -0
- package/dist/holmes/mcp/server-specs-dir.js +71 -0
- package/dist/holmes/mcp/server.js +12 -2
- package/dist/holmes/mcp/tool-schemas.js +43 -2
- package/dist/holmes/project/execution-context.d.ts +17 -0
- package/dist/holmes/project/execution-context.js +121 -0
- package/dist/holmes/project/installer-markers.d.ts +34 -0
- package/dist/holmes/project/installer-markers.js +65 -0
- package/dist/holmes/project/root.d.ts +12 -1
- package/dist/holmes/project/root.js +22 -3
- package/dist/holmes/project/workspace-identity.d.ts +29 -0
- package/dist/holmes/project/workspace-identity.js +181 -0
- package/dist/holmes/review/test-outcomes.d.ts +6 -1
- package/dist/holmes/review/test-outcomes.js +23 -5
- package/dist/holmes/review/test-runner.d.ts +18 -0
- package/dist/holmes/review/test-runner.js +136 -5
- package/dist/holmes/rtm/graph-store.d.ts +50 -1
- package/dist/holmes/rtm/graph-store.js +244 -3
- package/dist/holmes/rtm/incremental.d.ts +1 -0
- package/dist/holmes/rtm/incremental.js +12 -3
- package/dist/holmes/rtm/localize.js +7 -0
- package/dist/holmes/rtm/rtm-graph.d.ts +9 -0
- package/dist/holmes/rtm/rtm-graph.js +13 -0
- package/dist/holmes/rtm/test-scope.js +4 -1
- package/dist/holmes/semantic/vector-cache.d.ts +16 -1
- package/dist/holmes/semantic/vector-cache.js +155 -19
- package/dist/holmes/spec/approval-status.d.ts +10 -0
- package/dist/holmes/spec/approval-status.js +7 -3
- package/dist/holmes/spec/entity-git-snapshot.d.ts +50 -0
- package/dist/holmes/spec/entity-git-snapshot.js +276 -0
- package/dist/holmes/spec/entity-integration-discharge.d.ts +73 -0
- package/dist/holmes/spec/entity-integration-discharge.js +233 -0
- package/dist/holmes/spec/entity-integration-transaction.d.ts +179 -0
- package/dist/holmes/spec/entity-integration-transaction.js +1221 -0
- package/dist/holmes/spec/entity-integration.d.ts +216 -0
- package/dist/holmes/spec/entity-integration.js +760 -0
- package/dist/holmes/spec/entity-renumber-transaction.d.ts +82 -0
- package/dist/holmes/spec/entity-renumber-transaction.js +711 -0
- package/dist/holmes/spec/entity-renumber.d.ts +32 -0
- package/dist/holmes/spec/entity-renumber.js +156 -0
- package/dist/holmes/spec/entity-store.d.ts +135 -0
- package/dist/holmes/spec/entity-store.js +1053 -0
- package/dist/holmes/spec/entity-transaction.d.ts +105 -0
- package/dist/holmes/spec/entity-transaction.js +741 -0
- package/dist/holmes/spec/renumber.d.ts +58 -0
- package/dist/holmes/spec/renumber.js +200 -1
- package/dist/holmes/spec/spec-store.d.ts +3 -2
- package/dist/holmes/spec/spec-store.js +23 -2
- package/dist/holmes/spec/transition-policy.d.ts +36 -0
- package/dist/holmes/spec/transition-policy.js +135 -0
- package/package.json +5 -2
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { EntityByteChange, entityLockOwner } from './entity-transaction';
|
|
2
|
+
import { EntityGitDocuments, EntityGitMergedSources } from './entity-integration';
|
|
3
|
+
import { entitySourcePublicationOwner } from './entity-renumber-transaction';
|
|
4
|
+
import { EntityRenumberEntry } from './entity-renumber';
|
|
5
|
+
export interface EntityIntegrationTransitions {
|
|
6
|
+
unseal: Array<{
|
|
7
|
+
entityId: string;
|
|
8
|
+
displayId: string;
|
|
9
|
+
documentLocator: string;
|
|
10
|
+
before: string;
|
|
11
|
+
after: string;
|
|
12
|
+
}>;
|
|
13
|
+
publication: EntityRenumberEntry[];
|
|
14
|
+
approve: EntityIntegrationTransitions['unseal'];
|
|
15
|
+
completed: EntityRenumberEntry[];
|
|
16
|
+
}
|
|
17
|
+
/** Produces document transitions only; authority and durable application belong to the executor. */
|
|
18
|
+
export declare function prepareEntityIntegrationTransitions(current: EntityRenumberEntry[], desired: EntityRenumberEntry[], readFile: (file: string) => string | null): EntityIntegrationTransitions;
|
|
19
|
+
export interface EntityIntegrationConflictEvidence {
|
|
20
|
+
kind: 'entity' | 'source' | 'numbering' | 'document' | 'reference' | 'mirror' | 'destination';
|
|
21
|
+
/** @implements A-SPEC-637 — the destination path a planned locator collides with (`destination` kind). */
|
|
22
|
+
existing?: string;
|
|
23
|
+
entityId?: string;
|
|
24
|
+
file?: string;
|
|
25
|
+
reason: string;
|
|
26
|
+
objects: EntityGitMergedSources['files'][number]['objects'];
|
|
27
|
+
records?: EntityGitMergedSources['files'][number]['objects'];
|
|
28
|
+
displayIds?: Record<'base' | 'left' | 'right', string | null> | Record<string, Record<'base' | 'left' | 'right', string | null>>;
|
|
29
|
+
targets?: Record<'base' | 'left' | 'right', string | null>;
|
|
30
|
+
reference?: string;
|
|
31
|
+
entityIds?: string[];
|
|
32
|
+
target?: string;
|
|
33
|
+
other?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface EntityIntegrationCandidate {
|
|
36
|
+
schema: 'holmes-entity-integration-candidate/1';
|
|
37
|
+
stage: 'candidate';
|
|
38
|
+
ok: boolean;
|
|
39
|
+
workspaceId: string;
|
|
40
|
+
storeId: string;
|
|
41
|
+
storeLocator: string;
|
|
42
|
+
commits: Record<'base' | 'left' | 'right', string>;
|
|
43
|
+
destinationHead: string;
|
|
44
|
+
indexVersion: string;
|
|
45
|
+
membershipVersion: string;
|
|
46
|
+
changes: EntityByteChange[];
|
|
47
|
+
checks: Array<{
|
|
48
|
+
locator: string;
|
|
49
|
+
version: string | null;
|
|
50
|
+
mode: string | null;
|
|
51
|
+
}>;
|
|
52
|
+
conflicts: string[];
|
|
53
|
+
/** Original Git input objects, not normalized/generated replacement bytes. */
|
|
54
|
+
conflictEvidence?: EntityIntegrationConflictEvidence[];
|
|
55
|
+
pending: Array<{
|
|
56
|
+
file: string;
|
|
57
|
+
reason: string;
|
|
58
|
+
}>;
|
|
59
|
+
/** @implements A-SPEC-637 — non-regular entries identical in every input, left untouched. */
|
|
60
|
+
excluded?: Array<{
|
|
61
|
+
file: string;
|
|
62
|
+
reason: string;
|
|
63
|
+
}>;
|
|
64
|
+
approval: EntityGitDocuments['approval'];
|
|
65
|
+
transitions?: EntityIntegrationTransitions;
|
|
66
|
+
policyInputs: Array<{
|
|
67
|
+
locator: string;
|
|
68
|
+
version: string | null;
|
|
69
|
+
effectiveVersion: string | null;
|
|
70
|
+
}>;
|
|
71
|
+
steps?: EntityIntegrationStep[];
|
|
72
|
+
/**
|
|
73
|
+
* @implements A-SPEC-645 — documents this integration renumbers (old display id from the side's
|
|
74
|
+
* own record, new id from the numbering), present only when non-empty. A side-CREATED document
|
|
75
|
+
* has a `before: null` mapping step, so this is the only place its old id is known; the audit
|
|
76
|
+
* records these so evidence consumers can follow the document after the integration.
|
|
77
|
+
*/
|
|
78
|
+
renumbered?: Array<{
|
|
79
|
+
entityId: string;
|
|
80
|
+
oldDisplayId: string;
|
|
81
|
+
newDisplayId: string;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
export interface EntityIntegrationStep {
|
|
85
|
+
phase: 'unseal' | 'document' | 'mapping' | 'source' | 'approve';
|
|
86
|
+
entityId?: string;
|
|
87
|
+
specId?: string;
|
|
88
|
+
change: EntityByteChange;
|
|
89
|
+
}
|
|
90
|
+
export interface EntityIntegrationPlan {
|
|
91
|
+
schema: 'holmes-entity-integration/1';
|
|
92
|
+
operationId: string;
|
|
93
|
+
workspaceId: string;
|
|
94
|
+
storeId: string;
|
|
95
|
+
storeLocator: string;
|
|
96
|
+
commits: EntityIntegrationCandidate['commits'];
|
|
97
|
+
destination: {
|
|
98
|
+
head: string;
|
|
99
|
+
indexVersion: string;
|
|
100
|
+
membershipVersion: string;
|
|
101
|
+
};
|
|
102
|
+
configVersion: string | null;
|
|
103
|
+
checks: EntityIntegrationCandidate['checks'];
|
|
104
|
+
policyInputs: EntityIntegrationCandidate['policyInputs'];
|
|
105
|
+
steps: EntityIntegrationStep[];
|
|
106
|
+
}
|
|
107
|
+
/** A closed transport contract. Application must additionally regenerate it from current authorized inputs. */
|
|
108
|
+
export declare function validateEntityIntegrationPlan(value: unknown): EntityIntegrationPlan;
|
|
109
|
+
export declare function entityIntegrationTarget(plan: EntityIntegrationPlan): string;
|
|
110
|
+
/** Internal execution core; the public adapter supplies current authority and durable audit. */
|
|
111
|
+
export declare function applyEntityIntegration(root: string, inspected: unknown, authorize: (specId?: string) => void, audit: (plan: EntityIntegrationPlan, verifyOnly?: boolean, renumbered?: NonNullable<EntityIntegrationCandidate['renumbered']>) => void, beforePublish?: (plan: EntityIntegrationPlan, index: number) => void): Promise<{
|
|
112
|
+
ok: true;
|
|
113
|
+
state: 'completed';
|
|
114
|
+
operationId: string;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* @implements A-SPEC-639 — abandon a PENDING integration a third state blocked: claim both dead
|
|
118
|
+
* generations exactly as recovery does, revert the operation's own publications, preserve every
|
|
119
|
+
* foreign byte, audit, and retire the operation as abandoned. A completed operation is refused.
|
|
120
|
+
*/
|
|
121
|
+
export declare function abandonEntityIntegration(root: string, inspected: unknown, authorize: () => void, audit: (plan: EntityIntegrationPlan, outcome: {
|
|
122
|
+
restored: string[];
|
|
123
|
+
untouched: string[];
|
|
124
|
+
preserved: string[];
|
|
125
|
+
}) => void): Promise<{
|
|
126
|
+
ok: true;
|
|
127
|
+
state: 'abandoned';
|
|
128
|
+
operationId: string;
|
|
129
|
+
restored: string[];
|
|
130
|
+
untouched: string[];
|
|
131
|
+
preserved: string[];
|
|
132
|
+
}>;
|
|
133
|
+
export declare function recoverEntityIntegration(root: string, inspected: EntityIntegrationRecoveryInspection, authorize: (specId?: string) => void, audit: (plan: EntityIntegrationPlan, verifyOnly?: boolean) => void, beforePublish?: (plan: EntityIntegrationPlan, index: number) => void): Promise<{
|
|
134
|
+
ok: true;
|
|
135
|
+
state: 'completed';
|
|
136
|
+
operationId: string;
|
|
137
|
+
}>;
|
|
138
|
+
export interface EntityIntegrationRecoveryInspection {
|
|
139
|
+
schema: 'holmes-entity-integration-recovery-inspection/2';
|
|
140
|
+
state: 'pending' | 'completed';
|
|
141
|
+
operationId: string;
|
|
142
|
+
journalVersion: string;
|
|
143
|
+
completionVersion: string | null;
|
|
144
|
+
plan: EntityIntegrationPlan;
|
|
145
|
+
observedPrefixes: number[];
|
|
146
|
+
conflicts: string[];
|
|
147
|
+
storeOwner: ReturnType<typeof entityLockOwner>;
|
|
148
|
+
sourceOwner: ReturnType<typeof entitySourcePublicationOwner>;
|
|
149
|
+
}
|
|
150
|
+
/** Keep the original approval target while binding a lost-response retry to durable completion. */
|
|
151
|
+
export declare function validateEntityIntegrationRecoveryRequest(root: string, inspected: unknown): EntityIntegrationRecoveryInspection;
|
|
152
|
+
/** Observation only; matching bytes do not authorize replay of a journal's program. */
|
|
153
|
+
export declare function inspectEntityIntegrationRecovery(root: string, operationId: string): EntityIntegrationRecoveryInspection;
|
|
154
|
+
/** Re-derive the pending journal program before any recovery writer may use it. */
|
|
155
|
+
export declare function validateEntityIntegrationRecoveryProgram(root: string, operationId: string): Promise<EntityIntegrationRecoveryInspection>;
|
|
156
|
+
/** Executor boundary: a shape-valid plan still needs regeneration and current destination registration. */
|
|
157
|
+
export declare function withValidatedEntityIntegrationPlan<T>(root: string, inspected: unknown, act: (plan: EntityIntegrationPlan, candidate: EntityIntegrationCandidate) => T | Promise<T>): Promise<T>;
|
|
158
|
+
export declare function prepareEntityIntegrationPlan(root: string, revisions: {
|
|
159
|
+
base: string;
|
|
160
|
+
left: string;
|
|
161
|
+
right: string;
|
|
162
|
+
}, storeLocator: string, operationId?: string): Promise<EntityIntegrationPlan>;
|
|
163
|
+
/** Public review keeps the candidate and executable plan within the same owned inspection. */
|
|
164
|
+
export declare function reviewEntityIntegration(root: string, revisions: {
|
|
165
|
+
base: string;
|
|
166
|
+
left: string;
|
|
167
|
+
right: string;
|
|
168
|
+
}, storeLocator: string): Promise<{
|
|
169
|
+
plan?: EntityIntegrationPlan | undefined;
|
|
170
|
+
preview: EntityIntegrationCandidate;
|
|
171
|
+
}>;
|
|
172
|
+
/** Internal compilation, not validation or authorization of a caller-supplied execution payload. */
|
|
173
|
+
export declare function compileEntityIntegrationSteps(candidate: EntityIntegrationCandidate): EntityIntegrationStep[];
|
|
174
|
+
/** A reviewable candidate, not an authorized executable journal or a source of replacement authority. */
|
|
175
|
+
export declare function planEntityIntegrationCandidate(root: string, revisions: {
|
|
176
|
+
base: string;
|
|
177
|
+
left: string;
|
|
178
|
+
right: string;
|
|
179
|
+
}, storeLocator: string): Promise<EntityIntegrationCandidate>;
|