opencode-swarm 7.154.3 → 7.156.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.
- package/dist/cli/{coder-settlement-7c9h07f5.js → coder-settlement-jm7024zm.js} +6 -6
- package/dist/cli/{config-doctor-8zjz6dej.js → config-doctor-q9v8yscr.js} +2 -2
- package/dist/cli/{core-dn8bn81g.js → core-ev3bn503.js} +1 -1
- package/dist/cli/{curation-policy-2jkbybw7.js → curation-policy-jabphe51.js} +4 -4
- package/dist/cli/{curator-v12rhct2.js → curator-dnjf9ser.js} +28 -28
- package/dist/cli/{curator-llm-factory-mxdjw6kz.js → curator-llm-factory-cnatbky1.js} +28 -28
- package/dist/cli/{dispatch-w0rzasz3.js → dispatch-7r46tfr9.js} +10 -8
- package/dist/cli/{evidence-summary-service-zzvvcaa9.js → evidence-summary-service-5drv65qh.js} +10 -10
- package/dist/cli/{gate-evidence-16jkjre9.js → gate-evidence-dcyvst7g.js} +4 -4
- package/dist/cli/{guardrail-explain-11fx66cx.js → guardrail-explain-z8f6qhz2.js} +29 -29
- package/dist/cli/{guardrail-log-ahvfn58c.js → guardrail-log-zwec6ann.js} +3 -3
- package/dist/cli/{guardrail-reset-zp5xe0n5.js → guardrail-reset-ga6e11r9.js} +28 -28
- package/dist/cli/{hashing-mjwn6j4y.js → hashing-r4hbav6j.js} +1 -1
- package/dist/cli/{hive-promoter-k6y06jj8.js → hive-promoter-mpez5tqh.js} +28 -28
- package/dist/cli/{index-d7r6y724.js → index-00hyhg47.js} +3 -3
- package/dist/cli/{index-vntggpez.js → index-0q8kywcf.js} +1 -1
- package/dist/cli/{index-gbkdj7ay.js → index-164c64z8.js} +2 -2
- package/dist/cli/{index-9nw6z98k.js → index-17h6ewqp.js} +49 -30
- package/dist/cli/{index-qdnmnq65.js → index-4m3j9q9z.js} +2 -2
- package/dist/cli/{index-g1bh7980.js → index-5r3zrw81.js} +2 -2
- package/dist/cli/{index-y3kw1zpm.js → index-5w87j6j4.js} +24 -4
- package/dist/cli/{index-wkagbmpt.js → index-68098cfj.js} +5 -1
- package/dist/cli/{index-0f4b9ywa.js → index-6bqqzfbe.js} +1 -1
- package/dist/cli/{index-a6xjn2zt.js → index-6g6qwr8z.js} +5 -5
- package/dist/cli/{index-ed13peqr.js → index-85p1850w.js} +1 -1
- package/dist/cli/{index-s23q9v6t.js → index-98j6z038.js} +5 -5
- package/dist/cli/{index-6vcrkz80.js → index-9n555qz4.js} +4 -4
- package/dist/cli/{index-zak50rve.js → index-aqg7c1z9.js} +1 -1
- package/dist/cli/{index-q0prhdds.js → index-b91qwpms.js} +1 -1
- package/dist/cli/{index-n7nnz0jp.js → index-dfmr6pj5.js} +6 -6
- package/dist/cli/{index-bhjkxasn.js → index-ew6fykvv.js} +1 -1
- package/dist/cli/{index-4n557t8w.js → index-fd7wj6fy.js} +3 -3
- package/dist/cli/{index-94e20w95.js → index-fjcm6wwf.js} +1 -1
- package/dist/cli/{index-kck2gtxk.js → index-fpg4tzf7.js} +1 -1
- package/dist/cli/{index-4dt91x6e.js → index-g37454vj.js} +1 -1
- package/dist/cli/{index-env8fk17.js → index-gthnsbzf.js} +2 -2
- package/dist/cli/{index-ckp0z9d4.js → index-kxk8cnx7.js} +2 -2
- package/dist/cli/{index-s5p8ryar.js → index-mdypz60w.js} +1 -1
- package/dist/cli/{index-m0fy8jra.js → index-ppx8bnzd.js} +3945 -1045
- package/dist/cli/{index-7fyv62b2.js → index-q2khkey7.js} +4 -4
- package/dist/cli/{index-2rgm3hgq.js → index-sfdg1xg5.js} +4 -4
- package/dist/cli/{index-v6xkgxts.js → index-sm2t1awr.js} +2 -2
- package/dist/cli/{index-y8552snf.js → index-txdagbh7.js} +6 -1
- package/dist/cli/{index-qxj63890.js → index-wn0xm2e8.js} +1 -1
- package/dist/cli/{index-7qky94rr.js → index-za6bb2fd.js} +1 -1
- package/dist/cli/{index-ymgsmjba.js → index-zdgdf0e9.js} +4 -4
- package/dist/cli/index.js +28 -28
- package/dist/cli/{knowledge-escalator-yew2fbxb.js → knowledge-escalator-cq4e6v2j.js} +9 -9
- package/dist/cli/{knowledge-events-zfg423hp.js → knowledge-events-sr5fqqaq.js} +7 -7
- package/dist/cli/{knowledge-link-ydv6shg2.js → knowledge-link-4frk38w8.js} +3 -3
- package/dist/cli/{knowledge-store-zcv9stzz.js → knowledge-store-2dww3dqz.js} +4 -4
- package/dist/cli/{knowledge-validator-q68wx2bf.js → knowledge-validator-yprsj4ye.js} +6 -6
- package/dist/cli/{pending-delegations-yet1rza6.js → pending-delegations-7qvag076.js} +1 -1
- package/dist/cli/{pr-subscriptions-mp7fyh1r.js → pr-subscriptions-00evnffe.js} +2 -2
- package/dist/cli/{runner-s89ja08q.js → runner-gheaxd5r.js} +5 -5
- package/dist/cli/{scan-cursor-38bzfhwf.js → scan-cursor-6awybk8b.js} +5 -5
- package/dist/cli/{schema-9hqyt4t6.js → schema-bf3smw7k.js} +5 -1
- package/dist/cli/{scope-persistence-dd9s9q2b.js → scope-persistence-kc42c6ph.js} +5 -5
- package/dist/cli/{skill-generator-b28ezazm.js → skill-generator-9k1ztt7c.js} +11 -11
- package/dist/cli/{worktree-collision-ownership-zw65t2p9.js → worktree-collision-ownership-ej10dhwe.js} +3 -3
- package/dist/cli/{worktree-isolation-0ag393t0.js → worktree-isolation-r7qqy6ca.js} +28 -28
- package/dist/commands/close.d.ts +2 -0
- package/dist/commands/command-dispatch.d.ts +2 -1
- package/dist/commands/harness.d.ts +14 -0
- package/dist/commands/index.d.ts +3 -1
- package/dist/commands/registry.d.ts +114 -1
- package/dist/config/schema.d.ts +42 -0
- package/dist/harness/contracts.d.ts +492 -0
- package/dist/harness/factory.d.ts +72 -0
- package/dist/harness/hash.d.ts +4 -0
- package/dist/harness/index.d.ts +6 -0
- package/dist/harness/patch.d.ts +3 -0
- package/dist/harness/public-api.d.ts +105 -0
- package/dist/harness/source-candidate.d.ts +45 -0
- package/dist/harness/store.d.ts +256 -0
- package/dist/hooks/repo-graph-injection.d.ts +40 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +420 -378
- package/dist/lang/manifest-files.d.ts +25 -0
- package/dist/memory/reflection-service.d.ts +8 -2
- package/dist/memory/schema.d.ts +4 -4
- package/dist/security/write-authority.d.ts +2 -1
- package/dist/tools/repo-graph/indexed-storage.d.ts +136 -0
- package/dist/tools/repo-graph/query.d.ts +7 -0
- package/package.json +2 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { lstatSync } from 'node:fs';
|
|
2
|
+
import type { HarnessEvolutionConfig } from '../config/schema.js';
|
|
3
|
+
import { type HarnessCandidateFileV1, type HarnessCandidateManifestV1 } from './contracts.js';
|
|
4
|
+
export type HarnessSourceCandidateFileV1 = HarnessCandidateFileV1;
|
|
5
|
+
export type HarnessSourceCandidateV1 = HarnessCandidateManifestV1 & {
|
|
6
|
+
/** Inert evidence only. No production API applies this patch. */
|
|
7
|
+
patch?: string;
|
|
8
|
+
};
|
|
9
|
+
type ValidationFailureCode = 'ALLOWLIST_EMPTY' | 'INVALID_BASE_SHA' | 'STALE_BASE' | 'PATCH_TOO_LARGE' | 'UNSUPPORTED_PATCH' | 'PATH_REJECTED' | 'PATH_NOT_ALLOWLISTED' | 'PROTECTED_PATH' | 'GIT_FAILED' | 'UNTRACKED_PATH' | 'UNSUPPORTED_TRACKED_MODE' | 'SYMLINK_PATH' | 'HARDLINK_PATH' | 'BINARY_FILE' | 'FILE_TOO_LARGE' | 'TOTAL_TOO_LARGE' | 'FILE_COUNT_EXCEEDED' | 'LINE_COUNT_EXCEEDED' | 'PATH_CHANGED_DURING_VALIDATION' | 'PATCH_DOES_NOT_APPLY';
|
|
10
|
+
export type SourceCandidateValidationResult = {
|
|
11
|
+
ok: true;
|
|
12
|
+
candidate: HarnessSourceCandidateV1;
|
|
13
|
+
} | {
|
|
14
|
+
ok: false;
|
|
15
|
+
code: ValidationFailureCode;
|
|
16
|
+
reason: string;
|
|
17
|
+
};
|
|
18
|
+
interface GitCommandResult {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
code: number;
|
|
21
|
+
stdout: string;
|
|
22
|
+
stderr: string;
|
|
23
|
+
}
|
|
24
|
+
interface GitBinaryCommandResult {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
code: number;
|
|
27
|
+
stdout: Uint8Array;
|
|
28
|
+
stderr: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function validateSourceCandidate(args: {
|
|
31
|
+
directory: string;
|
|
32
|
+
config: HarnessEvolutionConfig;
|
|
33
|
+
candidateId: string;
|
|
34
|
+
baseSha: string;
|
|
35
|
+
origin: string;
|
|
36
|
+
patch: string;
|
|
37
|
+
}): Promise<SourceCandidateValidationResult>;
|
|
38
|
+
declare function runGitCommand(directory: string, args: string[]): Promise<GitCommandResult>;
|
|
39
|
+
declare function runGitBinaryCommand(directory: string, args: string[], maxOutputBytes?: number): Promise<GitBinaryCommandResult>;
|
|
40
|
+
export declare const _internals: {
|
|
41
|
+
runGitCommand: typeof runGitCommand;
|
|
42
|
+
runGitBinaryCommand: typeof runGitBinaryCommand;
|
|
43
|
+
lstatSync: typeof lstatSync;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { type WriteApprovalRequest } from '../security/write-authority.js';
|
|
2
|
+
import { type BlueprintPatchV1, type HarnessBlueprintV1, type PromptArtifactV1 } from './contracts.js';
|
|
3
|
+
import type { HarnessSourceCandidateV1 } from './source-candidate.js';
|
|
4
|
+
type RetainedCandidateBinding = {
|
|
5
|
+
candidateId: string;
|
|
6
|
+
manifestHash: string;
|
|
7
|
+
};
|
|
8
|
+
export interface StoredHarnessCandidateV1 {
|
|
9
|
+
v: 1;
|
|
10
|
+
candidate: HarnessSourceCandidateV1;
|
|
11
|
+
promptArtifacts?: PromptArtifactV1[];
|
|
12
|
+
baseBlueprint?: HarnessBlueprintV1;
|
|
13
|
+
targetBlueprint?: HarnessBlueprintV1;
|
|
14
|
+
blueprintPatch?: BlueprintPatchV1;
|
|
15
|
+
recordedAt: string;
|
|
16
|
+
}
|
|
17
|
+
export interface HarnessVersionV1 {
|
|
18
|
+
v: 1;
|
|
19
|
+
versionId: string;
|
|
20
|
+
candidateId: string;
|
|
21
|
+
manifestHash: string;
|
|
22
|
+
allowedPathDigest: string;
|
|
23
|
+
generation: number;
|
|
24
|
+
sourceKind: 'activation' | 'rollback';
|
|
25
|
+
parentVersionId: string | null;
|
|
26
|
+
restoredFromVersionId: string | null;
|
|
27
|
+
approvalFactId: string;
|
|
28
|
+
blueprint?: HarnessBlueprintV1;
|
|
29
|
+
recordedAt: string;
|
|
30
|
+
}
|
|
31
|
+
export interface HarnessCurrentProjectionV1 {
|
|
32
|
+
v: 1;
|
|
33
|
+
currentVersionId: string | null;
|
|
34
|
+
currentCandidateId: string | null;
|
|
35
|
+
currentManifestHash: string | null;
|
|
36
|
+
currentHash: string;
|
|
37
|
+
generation: number;
|
|
38
|
+
versionIds: string[];
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
ledgerHeadSegment: string | null;
|
|
41
|
+
ledgerHeadSeq: number;
|
|
42
|
+
ledgerHeadHash: string;
|
|
43
|
+
}
|
|
44
|
+
export interface HarnessLedgerRecordV1 {
|
|
45
|
+
v: 1;
|
|
46
|
+
seq: number;
|
|
47
|
+
timestamp: string;
|
|
48
|
+
kind: 'candidate_recorded' | 'activated' | 'rolled_back' | 'recovered_tail' | 'compacted';
|
|
49
|
+
candidateId: string;
|
|
50
|
+
versionId: string | null;
|
|
51
|
+
parentVersionId: string | null;
|
|
52
|
+
restoredFromVersionId: string | null;
|
|
53
|
+
approvalFactId: string | null;
|
|
54
|
+
payloadHash: string;
|
|
55
|
+
generation: number;
|
|
56
|
+
currentHashBefore: string;
|
|
57
|
+
currentHashAfter: string;
|
|
58
|
+
nextCurrentVersionId: string | null;
|
|
59
|
+
nextCurrentCandidateId: string | null;
|
|
60
|
+
nextCurrentManifestHash: string | null;
|
|
61
|
+
nextVersionIds: string[];
|
|
62
|
+
nextUpdatedAt: string;
|
|
63
|
+
ledgerSegment: string;
|
|
64
|
+
prunedVersionIds: string[];
|
|
65
|
+
recoverySegment: string | null;
|
|
66
|
+
recoveredBytes: number | null;
|
|
67
|
+
retainedCandidates: RetainedCandidateBinding[];
|
|
68
|
+
compactedRecords: number | null;
|
|
69
|
+
hashBefore: string;
|
|
70
|
+
hashAfter: string;
|
|
71
|
+
}
|
|
72
|
+
export type RecordHarnessCandidateResult = {
|
|
73
|
+
status: 'recorded';
|
|
74
|
+
candidate: StoredHarnessCandidateV1;
|
|
75
|
+
retentionReconciled: boolean;
|
|
76
|
+
retentionFailures: string[];
|
|
77
|
+
} | {
|
|
78
|
+
status: 'conflict';
|
|
79
|
+
reason: string;
|
|
80
|
+
};
|
|
81
|
+
export type ActivateHarnessCandidateResult = {
|
|
82
|
+
status: 'activated';
|
|
83
|
+
version: HarnessVersionV1;
|
|
84
|
+
current: HarnessCurrentProjectionV1;
|
|
85
|
+
projectionReconciled: boolean;
|
|
86
|
+
prunedArtifactsReconciled: boolean;
|
|
87
|
+
prunedArtifactFailures: string[];
|
|
88
|
+
retentionReconciled: boolean;
|
|
89
|
+
retentionFailures: string[];
|
|
90
|
+
} | {
|
|
91
|
+
status: 'candidate_not_found';
|
|
92
|
+
reason: string;
|
|
93
|
+
} | {
|
|
94
|
+
status: 'candidate_not_activatable';
|
|
95
|
+
reason: string;
|
|
96
|
+
} | {
|
|
97
|
+
status: 'consumer_mismatch';
|
|
98
|
+
reason: string;
|
|
99
|
+
} | {
|
|
100
|
+
status: 'approval_required';
|
|
101
|
+
reason: string;
|
|
102
|
+
} | {
|
|
103
|
+
status: 'retention_conflict';
|
|
104
|
+
reason: string;
|
|
105
|
+
maxVersions: number;
|
|
106
|
+
requiredVersionIds: string[];
|
|
107
|
+
} | {
|
|
108
|
+
status: 'stale_current';
|
|
109
|
+
reason: string;
|
|
110
|
+
};
|
|
111
|
+
export type RollbackHarnessVersionResult = {
|
|
112
|
+
status: 'rolled_back';
|
|
113
|
+
version: HarnessVersionV1;
|
|
114
|
+
current: HarnessCurrentProjectionV1;
|
|
115
|
+
projectionReconciled: boolean;
|
|
116
|
+
prunedArtifactsReconciled: boolean;
|
|
117
|
+
prunedArtifactFailures: string[];
|
|
118
|
+
retentionReconciled: boolean;
|
|
119
|
+
retentionFailures: string[];
|
|
120
|
+
} | {
|
|
121
|
+
status: 'version_not_found';
|
|
122
|
+
reason: string;
|
|
123
|
+
} | {
|
|
124
|
+
status: 'consumer_mismatch';
|
|
125
|
+
reason: string;
|
|
126
|
+
} | {
|
|
127
|
+
status: 'approval_required';
|
|
128
|
+
reason: string;
|
|
129
|
+
} | {
|
|
130
|
+
status: 'retention_conflict';
|
|
131
|
+
reason: string;
|
|
132
|
+
maxVersions: number;
|
|
133
|
+
requiredVersionIds: string[];
|
|
134
|
+
} | {
|
|
135
|
+
status: 'stale_current';
|
|
136
|
+
reason: string;
|
|
137
|
+
};
|
|
138
|
+
export type SaveHarnessVersionResult = {
|
|
139
|
+
status: 'saved';
|
|
140
|
+
version: HarnessVersionV1;
|
|
141
|
+
} | {
|
|
142
|
+
status: 'conflict';
|
|
143
|
+
reason: string;
|
|
144
|
+
};
|
|
145
|
+
export interface HarnessHistoryResult {
|
|
146
|
+
records: HarnessLedgerRecordV1[];
|
|
147
|
+
truncated: boolean;
|
|
148
|
+
quarantinePath: string | null;
|
|
149
|
+
totalRecordCount: number;
|
|
150
|
+
limit: number;
|
|
151
|
+
totalSegments: number;
|
|
152
|
+
}
|
|
153
|
+
export type HarnessLedgerAuditResult = {
|
|
154
|
+
outcome: 'ok';
|
|
155
|
+
records: HarnessLedgerRecordV1[];
|
|
156
|
+
truncated: boolean;
|
|
157
|
+
quarantinePath: string | null;
|
|
158
|
+
totalSegments: number;
|
|
159
|
+
} | {
|
|
160
|
+
outcome: 'scope_exceeded';
|
|
161
|
+
maxSegments: number;
|
|
162
|
+
totalSegments: number;
|
|
163
|
+
replayBoundExceeded?: true;
|
|
164
|
+
maxReplayRecords?: number;
|
|
165
|
+
};
|
|
166
|
+
export declare class HarnessStoreIntegrityError extends Error {
|
|
167
|
+
readonly artifactPath: string;
|
|
168
|
+
readonly code = "HARNESS_STORE_INTEGRITY";
|
|
169
|
+
constructor(artifactPath: string, message: string);
|
|
170
|
+
}
|
|
171
|
+
export declare class HarnessReplayBoundExceededError extends Error {
|
|
172
|
+
readonly maxReplayRecords: number;
|
|
173
|
+
readonly code = "HARNESS_REPLAY_BOUND_EXCEEDED";
|
|
174
|
+
constructor(maxReplayRecords: number);
|
|
175
|
+
}
|
|
176
|
+
declare function appendLedgerLine(directory: string, line: string, expectedSegmentName?: string): void;
|
|
177
|
+
declare function removeVersionArtifact(filePath: string): void;
|
|
178
|
+
declare function writeCurrentProjection(directory: string, current: HarnessCurrentProjectionV1): Promise<void>;
|
|
179
|
+
declare function removeCandidateArtifact(directory: string): void;
|
|
180
|
+
declare function removeLedgerArtifact(target: string): void;
|
|
181
|
+
export declare function buildHarnessActivationApprovalRequest(args: {
|
|
182
|
+
targetSessionId: string;
|
|
183
|
+
candidate: StoredHarnessCandidateV1;
|
|
184
|
+
expectedCurrentHash: string | null;
|
|
185
|
+
expectedCurrentGeneration: number;
|
|
186
|
+
targetContentHash: string;
|
|
187
|
+
allowedPathDigest: string;
|
|
188
|
+
}): WriteApprovalRequest;
|
|
189
|
+
export declare function buildHarnessRollbackApprovalRequest(args: {
|
|
190
|
+
targetSessionId: string;
|
|
191
|
+
currentVersionId: string;
|
|
192
|
+
targetVersionId: string;
|
|
193
|
+
expectedCurrentHash: string;
|
|
194
|
+
expectedCurrentGeneration: number;
|
|
195
|
+
targetContentHash: string;
|
|
196
|
+
allowedPathDigest: string;
|
|
197
|
+
}): WriteApprovalRequest;
|
|
198
|
+
export declare function recordHarnessCandidate(args: {
|
|
199
|
+
directory: string;
|
|
200
|
+
candidate: StoredHarnessCandidateV1;
|
|
201
|
+
maxReplayRecords?: number;
|
|
202
|
+
maxInactiveCandidates?: number;
|
|
203
|
+
}): Promise<RecordHarnessCandidateResult>;
|
|
204
|
+
export declare function saveHarnessVersion(args: {
|
|
205
|
+
directory: string;
|
|
206
|
+
version: HarnessVersionV1;
|
|
207
|
+
}): Promise<SaveHarnessVersionResult>;
|
|
208
|
+
export declare function loadHarnessCurrent(directory: string, maxReplayRecords?: number): Promise<HarnessCurrentProjectionV1>;
|
|
209
|
+
/** Explicitly reconcile the derived projection; read paths never mutate state. */
|
|
210
|
+
export declare function reconcileHarnessCurrent(directory: string, maxReplayRecords?: number): Promise<HarnessCurrentProjectionV1>;
|
|
211
|
+
export declare function loadHarnessCandidate(directory: string, candidateId: string, maxReplayRecords?: number): Promise<StoredHarnessCandidateV1 | null>;
|
|
212
|
+
export declare function loadHarnessPromptArtifact(directory: string, candidateId: string, promptHash: string): PromptArtifactV1 | null;
|
|
213
|
+
export declare function loadHarnessVersion(directory: string, versionId: string): Promise<HarnessVersionV1 | null>;
|
|
214
|
+
export declare function listHarnessHistory(directory: string, options?: number | {
|
|
215
|
+
maxReplayRecords?: number;
|
|
216
|
+
limit?: number;
|
|
217
|
+
}): Promise<HarnessHistoryResult>;
|
|
218
|
+
export declare function auditHarnessLedger(directory: string, options: {
|
|
219
|
+
maxReplayRecords?: number;
|
|
220
|
+
maxSegments: number;
|
|
221
|
+
}): Promise<HarnessLedgerAuditResult>;
|
|
222
|
+
export declare function recoverHarnessCorruptTail(directory: string, maxReplayRecords?: number): Promise<HarnessHistoryResult>;
|
|
223
|
+
export declare function activateHarnessCandidate(args: {
|
|
224
|
+
directory: string;
|
|
225
|
+
candidateId: string;
|
|
226
|
+
consumerSessionId: string;
|
|
227
|
+
targetSessionId?: string;
|
|
228
|
+
expectedCurrentHash: string | null;
|
|
229
|
+
expectedCurrentGeneration: number;
|
|
230
|
+
targetContentHash: string;
|
|
231
|
+
allowedPathDigest: string;
|
|
232
|
+
maxVersions?: number;
|
|
233
|
+
maxReplayRecords?: number;
|
|
234
|
+
maxInactiveCandidates?: number;
|
|
235
|
+
}): Promise<ActivateHarnessCandidateResult>;
|
|
236
|
+
export declare function rollbackHarnessVersion(args: {
|
|
237
|
+
directory: string;
|
|
238
|
+
targetVersionId: string;
|
|
239
|
+
consumerSessionId: string;
|
|
240
|
+
targetSessionId?: string;
|
|
241
|
+
expectedCurrentHash: string;
|
|
242
|
+
expectedCurrentGeneration: number;
|
|
243
|
+
targetContentHash: string;
|
|
244
|
+
allowedPathDigest: string;
|
|
245
|
+
maxVersions?: number;
|
|
246
|
+
maxReplayRecords?: number;
|
|
247
|
+
maxInactiveCandidates?: number;
|
|
248
|
+
}): Promise<RollbackHarnessVersionResult>;
|
|
249
|
+
export declare const _storeInternals: {
|
|
250
|
+
appendLedgerLine: typeof appendLedgerLine;
|
|
251
|
+
writeCurrentProjection: typeof writeCurrentProjection;
|
|
252
|
+
removeVersionArtifact: typeof removeVersionArtifact;
|
|
253
|
+
removeCandidateArtifact: typeof removeCandidateArtifact;
|
|
254
|
+
removeLedgerArtifact: typeof removeLedgerArtifact;
|
|
255
|
+
};
|
|
256
|
+
export {};
|
|
@@ -16,25 +16,65 @@
|
|
|
16
16
|
* bounded workspace probe gates use of the graph. Uncertified graphs and
|
|
17
17
|
* complete drift above the configured refresh cap are suppressed;
|
|
18
18
|
* inconclusive probes remain usable as freshness-unknown, without mutation.
|
|
19
|
+
*
|
|
20
|
+
* Storage modes (issue #1534): when `options.storage === 'indexed'`, the two
|
|
21
|
+
* FILE-SCOPED block builders may, on a full-graph LRU miss, serve a bounded
|
|
22
|
+
* subgraph read from `.swarm/repo-memory.sqlite` instead of parsing the whole
|
|
23
|
+
* JSON document. The kill switch, the stat gate and the freshness probe all
|
|
24
|
+
* run first and are unchanged, and the LRU hit — the common case — never
|
|
25
|
+
* touches SQLite. Whole-graph consumers (`buildLaneOrientationBlock`,
|
|
26
|
+
* `semantic-diff-injection`) always get the full JSON graph.
|
|
19
27
|
*/
|
|
20
28
|
import { loadPluginConfigWithMetaAsync } from '../config/loader';
|
|
21
29
|
import { type FreshnessOptions, probeFreshness, type RepoGraph } from '../tools/repo-graph';
|
|
30
|
+
import { loadSubgraphForFiles } from '../tools/repo-graph/indexed-storage';
|
|
22
31
|
export interface RepoGraphInjectionOptions extends FreshnessOptions {
|
|
23
32
|
enabled?: boolean;
|
|
24
33
|
refreshCap?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Resolved `repo_graph.storage` mode (issue #1534). Passed in by the caller
|
|
36
|
+
* — this module deliberately never reads config synchronously (see the
|
|
37
|
+
* `loadPluginConfigWithMetaAsync` note on `_internals`), so the mode rides
|
|
38
|
+
* in beside `enabled` / `refreshCap`. Anything other than `'indexed'`
|
|
39
|
+
* (including `undefined`) keeps every path on the JSON document.
|
|
40
|
+
*/
|
|
41
|
+
storage?: 'json' | 'indexed';
|
|
25
42
|
}
|
|
26
43
|
export declare const _internals: {
|
|
27
44
|
probeFreshness: typeof probeFreshness;
|
|
28
45
|
cacheSize: () => number;
|
|
46
|
+
subgraphCacheSize: () => number;
|
|
29
47
|
renderLaneOrientationBlock: typeof renderLaneOrientationBlock;
|
|
30
48
|
orientationFreshnessLine: typeof orientationFreshnessLine;
|
|
31
49
|
loadPluginConfigWithMetaAsync: typeof loadPluginConfigWithMetaAsync;
|
|
50
|
+
loadSubgraphForFiles: typeof loadSubgraphForFiles;
|
|
51
|
+
subgraphCacheKey: typeof subgraphCacheKey;
|
|
32
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* Cache key for a subgraph request. The graph artifact's `{mtimeMs, size, ino}`
|
|
55
|
+
* is part of the key, so a graph change invalidates every cached subgraph for
|
|
56
|
+
* that directory without an explicit sweep — the identical invalidation
|
|
57
|
+
* contract the full-graph LRU uses. Files are sorted because the closure is a
|
|
58
|
+
* set union and is order-independent; the caller's own array order (which does
|
|
59
|
+
* drive `BlastRadiusResult.target` and the rendered target list) is never read
|
|
60
|
+
* from this key. NUL is the separator because it is the one character that
|
|
61
|
+
* cannot appear in a path component, so no two distinct requests can collide
|
|
62
|
+
* by concatenation.
|
|
63
|
+
*/
|
|
64
|
+
declare function subgraphCacheKey(directoryKey: string, stat: {
|
|
65
|
+
mtimeMs: number;
|
|
66
|
+
size: number;
|
|
67
|
+
ino: number;
|
|
68
|
+
}, files: readonly string[], depth: number): string;
|
|
33
69
|
/**
|
|
34
70
|
* Load the repo graph for `directory`, using a bounded per-directory cache that
|
|
35
71
|
* invalidates on file mtime/size change and a shared content-freshness gate.
|
|
36
72
|
* Returns null if no graph exists or its workspace alignment is unsafe.
|
|
37
73
|
*
|
|
74
|
+
* Always returns the WHOLE graph — `semantic-diff-injection` and
|
|
75
|
+
* `buildLaneOrientationBlock` are whole-graph consumers and must never receive
|
|
76
|
+
* a bounded subgraph.
|
|
77
|
+
*
|
|
38
78
|
* Exported only for tests; production callers use the buildXxxBlock helpers below.
|
|
39
79
|
*/
|
|
40
80
|
export declare function getCachedGraph(directory: string, options?: RepoGraphInjectionOptions): Promise<RepoGraph | null>;
|
package/dist/index.d.ts
CHANGED
|
@@ -63,3 +63,5 @@ export type { EvaluatePrReviewRecoveryV1Options } from './evaluation/pr-review-r
|
|
|
63
63
|
export { evaluatePrReviewRecoveryV1 } from './evaluation/pr-review-recovery.js';
|
|
64
64
|
export type { EvaluateCandidateV1Options, EvaluateCandidateV1Result, } from './evaluation/public-api.js';
|
|
65
65
|
export { evaluateCandidateV1, evaluationV1, } from './evaluation/public-api.js';
|
|
66
|
+
export type { AgentBlueprintV1, BlueprintPatchV1, HarnessBlueprintV1, HarnessCandidateManifestV1, OrchestrationSpecV1, PromptArtifactV1, ToolSpecV1, } from './harness/contracts.js';
|
|
67
|
+
export { harnessMutationV1 } from './harness/public-api.js';
|