@evomap/evolver-cli 2.0.12 → 2.0.16
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/assetRepair.js +19 -11
- package/dist/autoexecConfig.js +2 -1
- package/dist/cliContracts.js +4 -2
- package/dist/distillObserver.js +17 -2
- package/dist/materialSnapshot.d.ts +2 -0
- package/dist/materialSnapshot.js +8 -0
- package/dist/runtimeSessionSource.d.ts +5 -0
- package/dist/sessionIngest.d.ts +7 -1
- package/dist/sessionIngest.js +25 -1
- package/package.json +7 -7
package/dist/assetRepair.js
CHANGED
|
@@ -32,26 +32,35 @@ export async function runAssetRepairCommand(argv, deps = {}) {
|
|
|
32
32
|
const { refs, rejectionPath, apply, jsonOut } = parsed.value;
|
|
33
33
|
const env = deps.env ?? process.env;
|
|
34
34
|
loadEnvFileFromEnv(env);
|
|
35
|
+
const loaded = await Promise.all(refs.map(async (ref) => {
|
|
36
|
+
try {
|
|
37
|
+
return { ref, record: await loadAssetRef(ref, { ...deps, env }) };
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Ref resolution is the only failure mode here, and its message is caller-controlled text — report the
|
|
41
|
+
// ref we were given, never the underlying error string.
|
|
42
|
+
return { ref, record: undefined };
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
35
45
|
let hubIssuesByIndex;
|
|
36
46
|
try {
|
|
37
47
|
hubIssuesByIndex = rejectionPath === undefined
|
|
38
48
|
? new Map()
|
|
39
|
-
: assetrepair.hubRejectionIssues(JSON.parse(readRejectionBody(rejectionPath, deps))
|
|
49
|
+
: assetrepair.hubRejectionIssues(JSON.parse(readRejectionBody(rejectionPath, deps)), {
|
|
50
|
+
assetTypes: loaded.map((entry) => (typeof entry.record?.type === 'string' ? entry.record.type : undefined)),
|
|
51
|
+
}).byAssetIndex;
|
|
40
52
|
}
|
|
41
53
|
catch {
|
|
42
54
|
return emit({ status: 'invalid_arg', message: 'rejection body is not readable JSON', assets: [] }, jsonOut, stdout, stderr);
|
|
43
55
|
}
|
|
44
56
|
const store = deps.store ?? new assetstore.LocalJsonlProvider(events.assetsDir(env));
|
|
45
57
|
const outcomes = [];
|
|
46
|
-
for (const [index,
|
|
47
|
-
|
|
48
|
-
outcomes.push(
|
|
49
|
-
|
|
50
|
-
catch {
|
|
51
|
-
// Ref resolution is the only failure mode here, and its message is caller-controlled text — report the
|
|
52
|
-
// ref we were given, never the underlying error string.
|
|
53
|
-
outcomes.push({ ref, repair_status: 'not_found', changes: [], blockers: [] });
|
|
58
|
+
for (const [index, entry] of loaded.entries()) {
|
|
59
|
+
if (!entry.record) {
|
|
60
|
+
outcomes.push({ ref: entry.ref, repair_status: 'not_found', changes: [], blockers: [] });
|
|
61
|
+
continue;
|
|
54
62
|
}
|
|
63
|
+
outcomes.push(await repairOne(entry.ref, entry.record, index, { deps, env, store, apply, hubIssuesByIndex }));
|
|
55
64
|
}
|
|
56
65
|
const status = outcomes.some((outcome) => outcome.repair_status === 'not_found')
|
|
57
66
|
? 'not_found'
|
|
@@ -60,8 +69,7 @@ export async function runAssetRepairCommand(argv, deps = {}) {
|
|
|
60
69
|
: 'ok';
|
|
61
70
|
return emit({ status, message: summaryMessage(status, apply), assets: outcomes }, jsonOut, stdout, stderr);
|
|
62
71
|
}
|
|
63
|
-
async function repairOne(ref, index, ctx) {
|
|
64
|
-
const original = await loadAssetRef(ref, { ...ctx.deps, env: ctx.env });
|
|
72
|
+
async function repairOne(ref, original, index, ctx) {
|
|
65
73
|
const hubIssues = [...(ctx.hubIssuesByIndex.get(index) ?? []), ...(ctx.hubIssuesByIndex.get(-1) ?? [])];
|
|
66
74
|
const report = assetrepair.repairAssetRecord(original, { hubIssues });
|
|
67
75
|
const base = {
|
package/dist/autoexecConfig.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { verify } from '@evomap/evolver-core';
|
|
4
|
-
|
|
4
|
+
// Default resident-loop cadence: 30s base, still multiplied by idle sleepMultiplier and single-flight gated.
|
|
5
|
+
const DEFAULT_POLL_MS = 30_000;
|
|
5
6
|
const DEFAULT_TIMEOUT_MS = 600_000;
|
|
6
7
|
const MAX_VALIDATION_PROFILES = 32;
|
|
7
8
|
const MAX_VALIDATION_COMMANDS = 16;
|
package/dist/cliContracts.js
CHANGED
|
@@ -201,7 +201,7 @@ export async function runPublishCommand(args, deps = {}) {
|
|
|
201
201
|
bundle.gates.quality = 'fail';
|
|
202
202
|
if (!bundle.blockReasons.includes('quality_gate_failed'))
|
|
203
203
|
bundle.blockReasons.push('quality_gate_failed');
|
|
204
|
-
return write(dryRunEnvelope(bundle, validationCredits, detail), 0);
|
|
204
|
+
return write(dryRunEnvelope(bundle, validationCredits, detail, validationAttempt), 0);
|
|
205
205
|
}
|
|
206
206
|
return write(publishFailure(reason, publishReasonMessage(reason, runtimeDeps.env), {
|
|
207
207
|
retryable: publishRetryable(reason),
|
|
@@ -309,7 +309,9 @@ async function callHubWithRepair(call, assets, allowRepair) {
|
|
|
309
309
|
return { result: retried, assets: plan.assets, applied: true, entries: plan.entries };
|
|
310
310
|
}
|
|
311
311
|
function planBundleRepair(assets, rejectionBody) {
|
|
312
|
-
const hubIssues = assetrepair.hubRejectionIssues(rejectionBody
|
|
312
|
+
const hubIssues = assetrepair.hubRejectionIssues(rejectionBody, {
|
|
313
|
+
assetTypes: assets.map((asset) => (typeof asset.type === 'string' ? asset.type : undefined)),
|
|
314
|
+
});
|
|
313
315
|
const bundleIssues = hubIssues.byAssetIndex.get(-1) ?? [];
|
|
314
316
|
const repaired = [];
|
|
315
317
|
const entries = [];
|
package/dist/distillObserver.js
CHANGED
|
@@ -47,9 +47,24 @@ export function makeDistillDrain(c) {
|
|
|
47
47
|
for (const source of sources) {
|
|
48
48
|
if (drafted >= draftLimit)
|
|
49
49
|
return { ack: false, drafted };
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
50
|
+
const draftedCandidate = draftGeneCandidate(source.turns, signals.extractSignals(source.turns), source.agent);
|
|
51
|
+
if (!draftedCandidate)
|
|
52
52
|
continue; // too thin to distill
|
|
53
|
+
// Carry producer-resolved task domain into draft signals_match so selection can score domain evidence.
|
|
54
|
+
// Only attach when the source already carries a resolved slug (fail-closed stamp at ingest).
|
|
55
|
+
let candidate = draftedCandidate;
|
|
56
|
+
if (source.taskDomain) {
|
|
57
|
+
try {
|
|
58
|
+
const domainToken = signals.taskDomainSignal(source.taskDomain);
|
|
59
|
+
const existingSignals = candidate.signals_match ?? [];
|
|
60
|
+
if (!existingSignals.includes(domainToken)) {
|
|
61
|
+
candidate = { ...candidate, signals_match: [...existingSignals, domainToken] };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Invalid slug on the source — leave signals_match untouched (never invent).
|
|
66
|
+
}
|
|
67
|
+
}
|
|
53
68
|
// Value/novelty gate (#117 improvement 3): drop thin / near-duplicate drafts BEFORE they reach the human
|
|
54
69
|
// review queue. Ack the material (a deliberate skip, not a failure — nothing to retry).
|
|
55
70
|
const { admission, existing } = await assessDraftAdmissionFromStore(c.store, candidate);
|
|
@@ -14,6 +14,8 @@ interface SnapshotSource {
|
|
|
14
14
|
label: string;
|
|
15
15
|
sessionId?: string;
|
|
16
16
|
resumeIdentityProvenance?: 'canonical_native_transcript';
|
|
17
|
+
/** Optional resolved task domain slug; omitted for old snapshots / unresolved sources. */
|
|
18
|
+
taskDomain?: string;
|
|
17
19
|
evidenceSummary: RuntimeSessionEvidenceSummary;
|
|
18
20
|
turns: SnapshotTurn[];
|
|
19
21
|
}
|
package/dist/materialSnapshot.js
CHANGED
|
@@ -204,11 +204,15 @@ export function buildRuntimeSessionMaterialSnapshot(sources, maxChars = DEFAULT_
|
|
|
204
204
|
const safeSessionId = source.sessionId
|
|
205
205
|
? snapshotIdentity(source.sessionId, SNAPSHOT_IDENTITY_MAX_CHARS)
|
|
206
206
|
: '';
|
|
207
|
+
const safeTaskDomain = source.taskDomain
|
|
208
|
+
? snapshotIdentity(source.taskDomain, SNAPSHOT_AGENT_MAX_CHARS)
|
|
209
|
+
: '';
|
|
207
210
|
snapshotSources.push({
|
|
208
211
|
agent: snapshotIdentity(source.agent, SNAPSHOT_AGENT_MAX_CHARS) || 'unknown',
|
|
209
212
|
label: snapshotIdentity(source.label, SNAPSHOT_IDENTITY_MAX_CHARS) || 'unknown',
|
|
210
213
|
...(safeSessionId ? { sessionId: safeSessionId } : {}),
|
|
211
214
|
...(source.resumeIdentityProvenance ? { resumeIdentityProvenance: source.resumeIdentityProvenance } : {}),
|
|
215
|
+
...(safeTaskDomain ? { taskDomain: safeTaskDomain } : {}),
|
|
212
216
|
evidenceSummary,
|
|
213
217
|
turns,
|
|
214
218
|
});
|
|
@@ -274,11 +278,15 @@ function sourceFromSnapshot(value) {
|
|
|
274
278
|
const resumeIdentityProvenance = value['resumeIdentityProvenance'] === 'canonical_native_transcript'
|
|
275
279
|
? value['resumeIdentityProvenance']
|
|
276
280
|
: undefined;
|
|
281
|
+
const taskDomain = typeof value['taskDomain'] === 'string' && value['taskDomain'].trim()
|
|
282
|
+
? value['taskDomain'].trim()
|
|
283
|
+
: undefined;
|
|
277
284
|
return {
|
|
278
285
|
agent,
|
|
279
286
|
label,
|
|
280
287
|
...(sessionId ? { sessionId } : {}),
|
|
281
288
|
...(resumeIdentityProvenance ? { resumeIdentityProvenance } : {}),
|
|
289
|
+
...(taskDomain ? { taskDomain } : {}),
|
|
282
290
|
turns,
|
|
283
291
|
};
|
|
284
292
|
}
|
|
@@ -4,6 +4,11 @@ export interface RuntimeSessionSource {
|
|
|
4
4
|
label: string;
|
|
5
5
|
sessionId?: string;
|
|
6
6
|
resumeIdentityProvenance?: 'canonical_native_transcript';
|
|
7
|
+
/**
|
|
8
|
+
* Canonical task domain slug when producer resolved exactly one `task_domain:` token.
|
|
9
|
+
* Absent/ambiguous/invalid domains are never invented here — omit the field.
|
|
10
|
+
*/
|
|
11
|
+
taskDomain?: string;
|
|
7
12
|
turns: NormalizedTurn[];
|
|
8
13
|
}
|
|
9
14
|
export interface RuntimeSessionParseDiagnostics {
|
package/dist/sessionIngest.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { events, material as materialNs } from '@evomap/evolver-core';
|
|
2
2
|
import { type RuntimeSessionMaterialSnapshotV1 } from './materialSnapshot.js';
|
|
3
|
-
import { type RuntimeSessionParseDiagnostics } from './runtimeSessionSource.js';
|
|
3
|
+
import { type RuntimeSessionParseDiagnostics, type RuntimeSessionSource } from './runtimeSessionSource.js';
|
|
4
|
+
/**
|
|
5
|
+
* Stamp a resolved canonical task domain onto each source when turn/signal text carries exactly one
|
|
6
|
+
* valid `task_domain:` token. Never invents domains; absent/ambiguous/invalid → leave field unset.
|
|
7
|
+
* Additive only — does not mutate parse diagnostics or turn content.
|
|
8
|
+
*/
|
|
9
|
+
export declare function stampResolvedTaskDomain(sources: readonly RuntimeSessionSource[]): RuntimeSessionSource[];
|
|
4
10
|
/** Material consumer group shared by ingestion and the downstream cycle consumer. */
|
|
5
11
|
export declare const INGEST_CONSUMER_GROUP = "cycle";
|
|
6
12
|
/** Injectable substrate dependencies for session and trace ingestion. */
|
package/dist/sessionIngest.js
CHANGED
|
@@ -5,6 +5,30 @@ import { isCursorStateVscdbPath } from '@evomap/evolver-runtime-adapters';
|
|
|
5
5
|
import { emitSessionRecall } from './autoRecall.js';
|
|
6
6
|
import { buildRuntimeSessionMaterialSnapshot } from './materialSnapshot.js';
|
|
7
7
|
import { isRuntimeSessionSourcePath, parseRuntimeSessionSourcesWithDiagnostics, } from './runtimeSessionSource.js';
|
|
8
|
+
/** Wire-form `task_domain:` tokens embedded in session text (case-insensitive match; resolver fail-closes). */
|
|
9
|
+
const TASK_DOMAIN_TOKEN_RE = /\btask_domain:[A-Za-z0-9][A-Za-z0-9-]{0,63}\b/gi;
|
|
10
|
+
/**
|
|
11
|
+
* Stamp a resolved canonical task domain onto each source when turn/signal text carries exactly one
|
|
12
|
+
* valid `task_domain:` token. Never invents domains; absent/ambiguous/invalid → leave field unset.
|
|
13
|
+
* Additive only — does not mutate parse diagnostics or turn content.
|
|
14
|
+
*/
|
|
15
|
+
export function stampResolvedTaskDomain(sources) {
|
|
16
|
+
return sources.map((source) => {
|
|
17
|
+
const tokens = [];
|
|
18
|
+
for (const turn of source.turns) {
|
|
19
|
+
const text = `${turn.text ?? ''}\n${turn.errorMessage ?? ''}\n${turn.toolResult ?? ''}`;
|
|
20
|
+
for (const match of text.matchAll(TASK_DOMAIN_TOKEN_RE)) {
|
|
21
|
+
tokens.push(match[0].toLowerCase());
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const resolution = signals.resolveTaskDomainSignals(tokens);
|
|
25
|
+
if (resolution.status !== 'resolved')
|
|
26
|
+
return source;
|
|
27
|
+
if (source.taskDomain === resolution.slug)
|
|
28
|
+
return source;
|
|
29
|
+
return { ...source, taskDomain: resolution.slug };
|
|
30
|
+
});
|
|
31
|
+
}
|
|
8
32
|
/** Material consumer group shared by ingestion and the downstream cycle consumer. */
|
|
9
33
|
export const INGEST_CONSUMER_GROUP = 'cycle';
|
|
10
34
|
export function resolveIngestDeps(deps) {
|
|
@@ -115,7 +139,7 @@ export async function runSessionIngestTick(dirs, deps = {}) {
|
|
|
115
139
|
continue;
|
|
116
140
|
}
|
|
117
141
|
try {
|
|
118
|
-
const parsedSources = parsed.sources;
|
|
142
|
+
const parsedSources = stampResolvedTaskDomain(parsed.sources);
|
|
119
143
|
const agent = parsedSources[0] ? toMaterialSourceAgent(parsedSources[0].agent) : undefined;
|
|
120
144
|
if (parsedSources.length === 0 || !agent)
|
|
121
145
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evomap/evolver-cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.16",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@evomap/evolver-core": "2.0.
|
|
27
|
-
"@evomap/evolver-adapter-public": "2.0.
|
|
28
|
-
"@evomap/evolver-mcp": "2.0.
|
|
29
|
-
"@evomap/evolver-proxy": "2.0.
|
|
30
|
-
"@evomap/evolver-runtime-adapters": "2.0.
|
|
31
|
-
"@evomap/evolver-webui": "2.0.
|
|
26
|
+
"@evomap/evolver-core": "2.0.16",
|
|
27
|
+
"@evomap/evolver-adapter-public": "2.0.16",
|
|
28
|
+
"@evomap/evolver-mcp": "2.0.16",
|
|
29
|
+
"@evomap/evolver-proxy": "2.0.16",
|
|
30
|
+
"@evomap/evolver-runtime-adapters": "2.0.16",
|
|
31
|
+
"@evomap/evolver-webui": "2.0.16"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|