@evomap/evolver-cli 2.0.0-beta.5 → 2.0.0-beta.7
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/autoDistillLlm.d.ts +6 -0
- package/dist/autoDistillLlm.js +40 -6
- package/dist/autoexec.d.ts +2 -10
- package/dist/autoexec.js +17 -25
- package/dist/autoexecConfig.d.ts +10 -0
- package/dist/autoexecConfig.js +68 -0
- package/dist/cliContracts.js +22 -1
- package/dist/dashboard.d.ts +11 -1
- package/dist/dashboard.js +173 -12
- package/dist/dispatch.js +4 -0
- package/dist/distillPrimitives.d.ts +5 -1
- package/dist/distillPrimitives.js +1 -1
- package/dist/doctor.js +16 -0
- package/dist/index.js +27 -6
- package/dist/issueReport.d.ts +7 -0
- package/dist/issueReport.js +291 -0
- package/dist/materialSnapshot.d.ts +24 -0
- package/dist/materialSnapshot.js +234 -12
- package/dist/recipe.js +7 -1
- package/dist/reuse.d.ts +5 -3
- package/dist/reuse.js +50 -3
- package/dist/setupHooks.d.ts +5 -0
- package/dist/setupHooks.js +230 -14
- package/dist/workflow.d.ts +39 -0
- package/dist/workflow.js +386 -0
- package/dist/workflowRuntime.d.ts +66 -0
- package/dist/workflowRuntime.js +631 -0
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { loadEnvFileFromEnv } from '@evomap/evolver-mcp';
|
|
|
7
7
|
import { makeInjectEmitter } from './autoexec.js';
|
|
8
8
|
import { listApprovedGenes, provenanceStoreForStore, reviewLedgerForStore } from './reviewFilter.js';
|
|
9
9
|
import { ADAPTERS, parseJsonlLines } from '@evomap/evolver-runtime-adapters';
|
|
10
|
-
import { draftGeneCandidate } from './distillPrimitives.js';
|
|
10
|
+
import { assessDraftAdmission, draftGeneCandidate } from './distillPrimitives.js';
|
|
11
11
|
import { emitSessionRecall } from './autoRecall.js';
|
|
12
12
|
import { isRuntimeSessionSourcePath, parseRuntimeSessionSourcesWithDiagnostics } from './runtimeSessionSource.js';
|
|
13
13
|
import { existsSync, readFileSync, readdirSync, statSync, unlinkSync } from 'node:fs';
|
|
@@ -67,10 +67,11 @@ export function cliUsage() {
|
|
|
67
67
|
' -v, --version Show the installed version',
|
|
68
68
|
'',
|
|
69
69
|
'Proxy options (evolver proxy):',
|
|
70
|
-
' --home <dir>
|
|
71
|
-
' --
|
|
72
|
-
' --
|
|
73
|
-
' --
|
|
70
|
+
' --home <dir> Root for assets, store, settings, and traces',
|
|
71
|
+
' --evomap-home <dir> Identity home for node_id/node_secret; defaults to --home',
|
|
72
|
+
' --store <path> Mailbox store path',
|
|
73
|
+
' --settings <path> Proxy settings file',
|
|
74
|
+
' --env-file <path> Environment file',
|
|
74
75
|
'',
|
|
75
76
|
'Commands:',
|
|
76
77
|
' Daemon: proxy, lifecycle, proxy-token, doctor, setup-hooks',
|
|
@@ -78,7 +79,8 @@ export function cliUsage() {
|
|
|
78
79
|
' Memory: ingest, inject, recall, reuse, reuse-report, narrative, gene-value',
|
|
79
80
|
' Assets: asset-log, asset-trust, asset-health, material, recipe, skill',
|
|
80
81
|
' Hub: login, logout, phub, sync, publish, fetch, buy, orders, atp',
|
|
81
|
-
' Operations: status, cycles, trigger, value, retention, replay, rebuild-views',
|
|
82
|
+
' Operations: status, workflow status, cycles, trigger, value, retention, replay, rebuild-views',
|
|
83
|
+
' issue-report',
|
|
82
84
|
' Tools: dashboard, webui, trajectory-export, migrate, verify',
|
|
83
85
|
' Advanced: anti-gene-benchmark, anti-gene-rollout, reset-local-secret',
|
|
84
86
|
' skill-distill, skill-md-update',
|
|
@@ -708,10 +710,24 @@ export async function runIngest(argv, store, deps = {}, review) {
|
|
|
708
710
|
id: typeof g['id'] === 'string' ? String(g['id']) : undefined,
|
|
709
711
|
signals_match: Array.isArray(g['signals_match']) ? g['signals_match'] : [],
|
|
710
712
|
}));
|
|
713
|
+
let candidateCount = 0;
|
|
714
|
+
let admissionSkipped = 0;
|
|
715
|
+
let lastAdmissionSkipReason = '';
|
|
711
716
|
for (const { source, sigs } of sourceSignalPairs) {
|
|
712
717
|
const candidate = draftGeneCandidate(source.turns, sigs, source.agent);
|
|
713
718
|
if (!candidate)
|
|
714
719
|
continue;
|
|
720
|
+
candidateCount += 1;
|
|
721
|
+
// Same value/novelty gate as the live distillObserver (#562): without it, a bulk ingest over session
|
|
722
|
+
// history floods the human review queue with thin / near-duplicate drafts (118 in one run). A non-admit
|
|
723
|
+
// is a deliberate skip — the rest of the batch still distills; intake below stays the structural gate.
|
|
724
|
+
const admission = assessDraftAdmission(candidate, existing);
|
|
725
|
+
if (!admission.admit) {
|
|
726
|
+
admissionSkipped += 1;
|
|
727
|
+
lastAdmissionSkipReason = admission.reason ?? '';
|
|
728
|
+
process.stdout.write(`\ningest --distill skipped [${source.label}]: ${admission.reason}\n`);
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
715
731
|
const r = algo.intakeGene(candidate, existing);
|
|
716
732
|
if (!r.ok || !r.gene) {
|
|
717
733
|
process.stderr.write(`\ningest --distill rejected: ${r.errors.join('; ')}\n`);
|
|
@@ -721,6 +737,11 @@ export async function runIngest(argv, store, deps = {}, review) {
|
|
|
721
737
|
existing = [...existing, { id: r.gene.id, signals_match: r.gene.signals_match }];
|
|
722
738
|
}
|
|
723
739
|
if (accepted.length === 0) {
|
|
740
|
+
if (candidateCount > 0 && admissionSkipped === candidateCount) {
|
|
741
|
+
const reason = lastAdmissionSkipReason ? ` Last skip reason: ${lastAdmissionSkipReason}.` : '';
|
|
742
|
+
process.stdout.write(`\ningest: all ${candidateCount} draft candidate(s) skipped by admission gate.${reason} Nothing stored.\n`);
|
|
743
|
+
return 0;
|
|
744
|
+
}
|
|
724
745
|
process.stdout.write('\ningest: not enough to distill — need ≥1 strong signal and ≥1 substantive assistant step. Nothing stored.\n');
|
|
725
746
|
return 0;
|
|
726
747
|
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { events, issueReporter } from '@evomap/evolver-core';
|
|
3
|
+
import { loadEnvFileFromEnv } from '@evomap/evolver-mcp';
|
|
4
|
+
import { runDoctorChecks } from './doctor.js';
|
|
5
|
+
import { getCliVersion } from './version.js';
|
|
6
|
+
const GITHUB_FETCH_TIMEOUT_MS = 15_000;
|
|
7
|
+
function parseFlags(argv) {
|
|
8
|
+
const flags = {
|
|
9
|
+
json: false,
|
|
10
|
+
cycleIds: [],
|
|
11
|
+
eventIds: [],
|
|
12
|
+
traceIds: [],
|
|
13
|
+
steps: [],
|
|
14
|
+
diagnosticCodes: [],
|
|
15
|
+
approved: false,
|
|
16
|
+
notCreated: false,
|
|
17
|
+
abandon: false,
|
|
18
|
+
};
|
|
19
|
+
for (let index = 0; index < argv.length; index++) {
|
|
20
|
+
const arg = argv[index];
|
|
21
|
+
const next = () => argv[++index];
|
|
22
|
+
if (arg === '--root')
|
|
23
|
+
flags.root = next() ?? flags.root;
|
|
24
|
+
else if (arg === '--json')
|
|
25
|
+
flags.json = true;
|
|
26
|
+
else if (arg === '--source')
|
|
27
|
+
flags.source = next();
|
|
28
|
+
else if (arg === '--error-class')
|
|
29
|
+
flags.errorClass = next();
|
|
30
|
+
else if (arg === '--failure-class')
|
|
31
|
+
flags.failureClass = next();
|
|
32
|
+
else if (arg === '--cycle') {
|
|
33
|
+
const value = next();
|
|
34
|
+
if (value)
|
|
35
|
+
flags.cycleIds.push(value);
|
|
36
|
+
}
|
|
37
|
+
else if (arg === '--event') {
|
|
38
|
+
const value = next();
|
|
39
|
+
if (value)
|
|
40
|
+
flags.eventIds.push(value);
|
|
41
|
+
}
|
|
42
|
+
else if (arg === '--trace') {
|
|
43
|
+
const value = next();
|
|
44
|
+
if (value)
|
|
45
|
+
flags.traceIds.push(value);
|
|
46
|
+
}
|
|
47
|
+
else if (arg === '--step') {
|
|
48
|
+
const value = next();
|
|
49
|
+
if (value)
|
|
50
|
+
flags.steps.push(value);
|
|
51
|
+
}
|
|
52
|
+
else if (arg === '--diagnostic') {
|
|
53
|
+
const value = next();
|
|
54
|
+
if (value)
|
|
55
|
+
flags.diagnosticCodes.push(value);
|
|
56
|
+
}
|
|
57
|
+
else if (arg === '--repo')
|
|
58
|
+
flags.repo = next();
|
|
59
|
+
else if (arg === '--approve')
|
|
60
|
+
flags.approved = true;
|
|
61
|
+
else if (arg === '--not-created')
|
|
62
|
+
flags.notCreated = true;
|
|
63
|
+
else if (arg === '--abandon')
|
|
64
|
+
flags.abandon = true;
|
|
65
|
+
else if (arg === '--issue-number') {
|
|
66
|
+
const value = Number(next());
|
|
67
|
+
if (Number.isInteger(value) && value > 0)
|
|
68
|
+
flags.issueNumber = value;
|
|
69
|
+
}
|
|
70
|
+
else if (arg === '--issue-url')
|
|
71
|
+
flags.issueUrl = next();
|
|
72
|
+
}
|
|
73
|
+
return flags;
|
|
74
|
+
}
|
|
75
|
+
function reporterOptions(flags, env, deps) {
|
|
76
|
+
const envRoot = env['EVOLVER_ISSUE_REPORT_ROOT']?.trim();
|
|
77
|
+
return {
|
|
78
|
+
rootDir: flags.root ?? (envRoot || join(events.evomapHome(env), 'evolution', 'issue-reporter')),
|
|
79
|
+
workspaceScope: process.cwd(),
|
|
80
|
+
env,
|
|
81
|
+
now: deps.now,
|
|
82
|
+
logger: (entry) => process.stderr.write(`[issue-report] fingerprint=${entry.fingerprint} status=${entry.status}${entry.errorClass ? ` error_class=${entry.errorClass}` : ''}\n`),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function writeResult(value, json) {
|
|
86
|
+
process.stdout.write(json ? `${JSON.stringify(value)}\n` : `${String(value)}\n`);
|
|
87
|
+
}
|
|
88
|
+
function publicDraftState(draft) {
|
|
89
|
+
return { fingerprint: draft.fingerprint, status: draft.status };
|
|
90
|
+
}
|
|
91
|
+
function publicSubmitResult(result) {
|
|
92
|
+
return {
|
|
93
|
+
status: result.status,
|
|
94
|
+
...('errorClass' in result ? { errorClass: result.errorClass } : {}),
|
|
95
|
+
draft: publicDraftState(result.draft),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function githubTransport(token, fetchFn) {
|
|
99
|
+
return {
|
|
100
|
+
async listOpenIssues(input) {
|
|
101
|
+
const controller = new AbortController();
|
|
102
|
+
const timer = setTimeout(() => controller.abort(), GITHUB_FETCH_TIMEOUT_MS);
|
|
103
|
+
timer.unref?.();
|
|
104
|
+
try {
|
|
105
|
+
const response = await fetchFn(`https://api.github.com/repos/${input.repo}/issues?state=open&per_page=${input.perPage}&page=${input.page}`, {
|
|
106
|
+
method: 'GET',
|
|
107
|
+
signal: controller.signal,
|
|
108
|
+
headers: {
|
|
109
|
+
accept: 'application/vnd.github+json',
|
|
110
|
+
authorization: `Bearer ${token}`,
|
|
111
|
+
'user-agent': 'evolver-v2-safe-issue-reporter',
|
|
112
|
+
'x-github-api-version': '2022-11-28',
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
if (!response.ok)
|
|
116
|
+
throw new issueReporter.GithubIssueTransportError('not_created');
|
|
117
|
+
const payload = await response.json();
|
|
118
|
+
if (!Array.isArray(payload))
|
|
119
|
+
throw new issueReporter.GithubIssueTransportError('not_created');
|
|
120
|
+
return {
|
|
121
|
+
issues: payload.map((item) => {
|
|
122
|
+
const record = item;
|
|
123
|
+
return {
|
|
124
|
+
number: Number(record['number']),
|
|
125
|
+
url: String(record['html_url'] ?? ''),
|
|
126
|
+
body: typeof record['body'] === 'string' ? record['body'] : '',
|
|
127
|
+
isPullRequest: record['pull_request'] !== undefined,
|
|
128
|
+
};
|
|
129
|
+
}),
|
|
130
|
+
hasNextPage: /<[^>]+>;\s*rel="next"/.test(response.headers.get('link') ?? ''),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
clearTimeout(timer);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
async createIssue(input) {
|
|
138
|
+
const controller = new AbortController();
|
|
139
|
+
const timer = setTimeout(() => controller.abort(), GITHUB_FETCH_TIMEOUT_MS);
|
|
140
|
+
timer.unref?.();
|
|
141
|
+
try {
|
|
142
|
+
const response = await fetchFn(`https://api.github.com/repos/${input.repo}/issues`, {
|
|
143
|
+
method: 'POST',
|
|
144
|
+
signal: controller.signal,
|
|
145
|
+
headers: {
|
|
146
|
+
accept: 'application/vnd.github+json',
|
|
147
|
+
authorization: `Bearer ${token}`,
|
|
148
|
+
'content-type': 'application/json',
|
|
149
|
+
'user-agent': 'evolver-v2-safe-issue-reporter',
|
|
150
|
+
'x-github-api-version': '2022-11-28',
|
|
151
|
+
},
|
|
152
|
+
body: JSON.stringify({ title: input.title, body: input.body }),
|
|
153
|
+
});
|
|
154
|
+
if (!response.ok) {
|
|
155
|
+
throw new issueReporter.GithubIssueTransportError(response.status >= 400 && response.status < 500 ? 'not_created' : 'ambiguous');
|
|
156
|
+
}
|
|
157
|
+
const payload = await response.json();
|
|
158
|
+
return { number: Number(payload.number), url: String(payload.html_url ?? '') };
|
|
159
|
+
}
|
|
160
|
+
finally {
|
|
161
|
+
clearTimeout(timer);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
export async function runIssueReportCommand(argv, deps = {}) {
|
|
167
|
+
const action = argv[0];
|
|
168
|
+
const fingerprint = argv[1];
|
|
169
|
+
const flags = parseFlags(argv.slice(action === 'submit' || action === 'reject' || action === 'resolve' ? 2 : 1));
|
|
170
|
+
const env = { ...(deps.env ?? process.env) };
|
|
171
|
+
if (action === 'submit' || action === 'resolve') {
|
|
172
|
+
const envLoad = loadEnvFileFromEnv(env);
|
|
173
|
+
if (envLoad.error) {
|
|
174
|
+
process.stderr.write('issue_report_env_file_error\n');
|
|
175
|
+
return 1;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
const options = reporterOptions(flags, env, { ...deps, env });
|
|
179
|
+
if (action === 'draft') {
|
|
180
|
+
let input = null;
|
|
181
|
+
if (flags.cycleIds[0]) {
|
|
182
|
+
input = issueReporter.issueReportInputFromCycle(events.readEvents(), flags.cycleIds[0]);
|
|
183
|
+
}
|
|
184
|
+
else if (flags.source === 'doctor') {
|
|
185
|
+
input = issueReporter.issueReportInputFromDoctor(runDoctorChecks().map(({ name, status }) => ({ name, status })));
|
|
186
|
+
}
|
|
187
|
+
else if (issueReporter.isIssueReportSource(flags.source) && flags.errorClass) {
|
|
188
|
+
input = {
|
|
189
|
+
source: flags.source,
|
|
190
|
+
errorClass: flags.errorClass,
|
|
191
|
+
failureClass: flags.failureClass,
|
|
192
|
+
cycleIds: flags.cycleIds,
|
|
193
|
+
eventIds: flags.eventIds,
|
|
194
|
+
traceIds: flags.traceIds,
|
|
195
|
+
reproductionSteps: flags.steps,
|
|
196
|
+
diagnosticCodes: flags.diagnosticCodes,
|
|
197
|
+
version: getCliVersion(),
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
if (!input) {
|
|
201
|
+
process.stderr.write('用法: evolver issue-report draft (--cycle <id> | --source <doctor|review|event|cycle_failure> --error-class <class>) [--json]\n');
|
|
202
|
+
return 1;
|
|
203
|
+
}
|
|
204
|
+
if (flags.traceIds.length > 0) {
|
|
205
|
+
input.traceIds = [...(input.traceIds ?? []), ...flags.traceIds];
|
|
206
|
+
}
|
|
207
|
+
input.version ??= getCliVersion();
|
|
208
|
+
const result = issueReporter.createIssueDraft(input, options);
|
|
209
|
+
writeResult(flags.json ? result : `${result.status}: ${result.draft.fingerprint}`, flags.json);
|
|
210
|
+
return 0;
|
|
211
|
+
}
|
|
212
|
+
if ((action === 'submit' || action === 'reject' || action === 'resolve') && fingerprint) {
|
|
213
|
+
const lookup = issueReporter.lookupIssueDraft(options.rootDir, fingerprint);
|
|
214
|
+
if (lookup.status !== 'found') {
|
|
215
|
+
if (flags.json && /^[a-f0-9]{20}$/.test(fingerprint)) {
|
|
216
|
+
writeResult({
|
|
217
|
+
status: 'failed',
|
|
218
|
+
errorClass: lookup.status === 'missing' ? 'draft_not_found' : 'unsafe_draft',
|
|
219
|
+
draft: { fingerprint, status: 'draft' },
|
|
220
|
+
}, true);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
process.stderr.write('issue draft not found\n');
|
|
224
|
+
}
|
|
225
|
+
return 1;
|
|
226
|
+
}
|
|
227
|
+
const { draft } = lookup;
|
|
228
|
+
if (action === 'resolve') {
|
|
229
|
+
const repo = flags.repo ?? env['EVOLVER_ISSUE_REPO'];
|
|
230
|
+
const resolution = flags.notCreated
|
|
231
|
+
? { outcome: 'not_created' }
|
|
232
|
+
: flags.abandon
|
|
233
|
+
? { outcome: 'abandoned' }
|
|
234
|
+
: flags.issueNumber && flags.issueUrl && repo
|
|
235
|
+
? { outcome: 'submitted', issueNumber: flags.issueNumber, url: flags.issueUrl, repo }
|
|
236
|
+
: null;
|
|
237
|
+
if (!resolution) {
|
|
238
|
+
process.stderr.write('resolve requires --not-created, --abandon, or --issue-number/--issue-url/--repo\n');
|
|
239
|
+
return 1;
|
|
240
|
+
}
|
|
241
|
+
try {
|
|
242
|
+
const resolved = issueReporter.resolveIssueSubmission(fingerprint, resolution, options);
|
|
243
|
+
writeResult(flags.json ? publicDraftState(resolved) : `${resolved.status}: ${resolved.fingerprint}`, flags.json);
|
|
244
|
+
return 0;
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
const errorClass = error instanceof issueReporter.IssueDraftConflictError
|
|
248
|
+
? error.errorClass
|
|
249
|
+
: 'invalid_resolution';
|
|
250
|
+
writeResult(flags.json ? { status: 'failed', errorClass, draft: publicDraftState(draft) } : `failed: ${draft.fingerprint}`, flags.json);
|
|
251
|
+
return 1;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (action === 'reject') {
|
|
255
|
+
let rejected;
|
|
256
|
+
try {
|
|
257
|
+
rejected = issueReporter.rejectIssueDraft(draft, options);
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
if (!(error instanceof issueReporter.IssueDraftConflictError))
|
|
261
|
+
throw error;
|
|
262
|
+
const result = {
|
|
263
|
+
status: 'rate_limited',
|
|
264
|
+
errorClass: error.errorClass,
|
|
265
|
+
draft: publicDraftState(draft),
|
|
266
|
+
};
|
|
267
|
+
writeResult(flags.json ? result : `${result.status}: ${draft.fingerprint}`, flags.json);
|
|
268
|
+
return 1;
|
|
269
|
+
}
|
|
270
|
+
writeResult(flags.json ? publicDraftState(rejected) : `${rejected.status}: ${rejected.fingerprint}`, flags.json);
|
|
271
|
+
return rejected.status === 'submitted' ? 1 : 0;
|
|
272
|
+
}
|
|
273
|
+
const repo = flags.repo ?? env['EVOLVER_ISSUE_REPO'];
|
|
274
|
+
const token = env['GITHUB_TOKEN'] ?? env['GH_TOKEN'];
|
|
275
|
+
const operatorPolicy = env['EVOLVER_ISSUE_SUBMIT_POLICY']?.trim().toLowerCase() === 'allow';
|
|
276
|
+
if (!repo || !token) {
|
|
277
|
+
process.stderr.write('submit requires --repo and GITHUB_TOKEN/GH_TOKEN\n');
|
|
278
|
+
return 1;
|
|
279
|
+
}
|
|
280
|
+
const result = await issueReporter.submitIssueDraft(draft, {
|
|
281
|
+
repo,
|
|
282
|
+
approved: flags.approved || operatorPolicy,
|
|
283
|
+
approvalSource: operatorPolicy ? 'operator_policy' : flags.approved ? 'human' : undefined,
|
|
284
|
+
transport: githubTransport(token, deps.fetch ?? fetch),
|
|
285
|
+
}, options);
|
|
286
|
+
writeResult(flags.json ? publicSubmitResult(result) : `${result.status}: ${result.draft.fingerprint}`, flags.json);
|
|
287
|
+
return result.status === 'submitted' || result.status === 'already_submitted' ? 0 : 1;
|
|
288
|
+
}
|
|
289
|
+
process.stderr.write('用法: evolver issue-report <draft|submit|reject|resolve> ...\n');
|
|
290
|
+
return 1;
|
|
291
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { schema } from '@evomap/evolver-core';
|
|
2
|
+
import { type RuntimeSessionEvidenceCoverage, type RuntimeSessionEvidenceCounts, type RuntimeSessionEvidenceGapCode, type RuntimeSessionEvidenceSummary } from '@evomap/evolver-runtime-adapters';
|
|
2
3
|
import { type RuntimeSessionSource } from './runtimeSessionSource.js';
|
|
3
4
|
export declare const MATERIAL_RUNTIME_SESSION_SNAPSHOT_SCHEMA = "evolver.material.runtime_session_snapshot.v1";
|
|
4
5
|
interface SnapshotTurn {
|
|
@@ -12,6 +13,7 @@ interface SnapshotSource {
|
|
|
12
13
|
agent: string;
|
|
13
14
|
label: string;
|
|
14
15
|
sessionId?: string;
|
|
16
|
+
evidenceSummary: RuntimeSessionEvidenceSummary;
|
|
15
17
|
turns: SnapshotTurn[];
|
|
16
18
|
}
|
|
17
19
|
export interface RuntimeSessionMaterialSnapshotV1 {
|
|
@@ -19,11 +21,33 @@ export interface RuntimeSessionMaterialSnapshotV1 {
|
|
|
19
21
|
sourceKind: 'runtime_session';
|
|
20
22
|
kind: 'session_log';
|
|
21
23
|
sources: SnapshotSource[];
|
|
24
|
+
sourceCount: number;
|
|
25
|
+
omittedSourceCount: number;
|
|
26
|
+
omittedEvidenceAggregate?: RuntimeSessionEvidenceAggregate;
|
|
22
27
|
truncated: boolean;
|
|
23
28
|
maxChars: number;
|
|
24
29
|
}
|
|
30
|
+
export interface RuntimeSessionEvidenceSummarySource {
|
|
31
|
+
agent: string;
|
|
32
|
+
label: string;
|
|
33
|
+
sessionId?: string;
|
|
34
|
+
evidenceSummary: RuntimeSessionEvidenceSummary;
|
|
35
|
+
}
|
|
36
|
+
export interface RuntimeSessionEvidenceAggregate {
|
|
37
|
+
sourceCount: number;
|
|
38
|
+
coverageCounts: Record<RuntimeSessionEvidenceCoverage, number>;
|
|
39
|
+
counts: RuntimeSessionEvidenceCounts;
|
|
40
|
+
gapCodes: RuntimeSessionEvidenceGapCode[];
|
|
41
|
+
}
|
|
42
|
+
export interface RuntimeSessionEvidenceSummaryCollection {
|
|
43
|
+
sourceCount: number;
|
|
44
|
+
omittedSourceCount: number;
|
|
45
|
+
summaries: RuntimeSessionEvidenceSummarySource[];
|
|
46
|
+
omittedEvidenceAggregate?: RuntimeSessionEvidenceAggregate;
|
|
47
|
+
}
|
|
25
48
|
export declare function buildRuntimeSessionMaterialSnapshot(sources: readonly RuntimeSessionSource[], maxChars?: number): RuntimeSessionMaterialSnapshotV1;
|
|
26
49
|
export declare function runtimeSessionSourcesFromMaterialPayload(payload: unknown): RuntimeSessionSource[];
|
|
50
|
+
export declare function runtimeSessionEvidenceSummariesFromMaterialPayload(payload: unknown): RuntimeSessionEvidenceSummaryCollection | null;
|
|
27
51
|
export declare function materialHasRuntimeSessionSnapshot(material: schema.Material): boolean;
|
|
28
52
|
export declare function materialSourceAvailable(material: schema.Material): boolean;
|
|
29
53
|
export declare function runtimeSessionSourcesForMaterial(material: schema.Material, readSource?: (path: string) => string): RuntimeSessionSource[];
|