@evomap/evolver-cli 2.0.0-beta.8 → 2.0.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.
Files changed (91) hide show
  1. package/dist/antiGeneBenchmark.js +2 -0
  2. package/dist/antiGeneRollout.js +9 -3
  3. package/dist/assetHealth.js +2 -0
  4. package/dist/assetTrust.js +14 -1
  5. package/dist/atp.d.ts +10 -5
  6. package/dist/atp.js +119 -26
  7. package/dist/atpAutoBuyer.d.ts +120 -0
  8. package/dist/atpAutoBuyer.js +814 -0
  9. package/dist/atpAutoDeliver.js +2 -2
  10. package/dist/autoDistillLlm.js +2 -1
  11. package/dist/autoDistillTranscript.js +3 -2
  12. package/dist/autoexec.d.ts +101 -13
  13. package/dist/autoexec.js +794 -91
  14. package/dist/cli.js +13 -0
  15. package/dist/cliContracts.d.ts +23 -2
  16. package/dist/cliContracts.js +504 -54
  17. package/dist/commands.d.ts +1 -0
  18. package/dist/commands.js +1 -0
  19. package/dist/curriculumCapabilityGaps.d.ts +6 -0
  20. package/dist/curriculumCapabilityGaps.js +24 -0
  21. package/dist/cycleConsumer.d.ts +13 -0
  22. package/dist/cycleConsumer.js +186 -20
  23. package/dist/dashboard.js +47 -9
  24. package/dist/dispatch.js +8 -2
  25. package/dist/distillAdmission.d.ts +13 -0
  26. package/dist/distillAdmission.js +35 -0
  27. package/dist/distillObserver.js +4 -6
  28. package/dist/distillPrimitives.d.ts +11 -12
  29. package/dist/distillPrimitives.js +115 -21
  30. package/dist/doctor.js +120 -11
  31. package/dist/identityHome.d.ts +9 -0
  32. package/dist/identityHome.js +47 -0
  33. package/dist/index.d.ts +70 -40
  34. package/dist/index.js +586 -200
  35. package/dist/learningTrace.d.ts +15 -0
  36. package/dist/learningTrace.js +73 -0
  37. package/dist/lifecycle.d.ts +67 -1
  38. package/dist/lifecycle.js +738 -44
  39. package/dist/localMemoryGraph.d.ts +90 -3
  40. package/dist/localMemoryGraph.js +2031 -231
  41. package/dist/login.d.ts +1 -1
  42. package/dist/login.js +3 -3
  43. package/dist/materialPackage.js +3 -6
  44. package/dist/materialSnapshot.d.ts +9 -1
  45. package/dist/materialSnapshot.js +23 -6
  46. package/dist/memoryGraphOps.d.ts +8 -0
  47. package/dist/memoryGraphOps.js +140 -0
  48. package/dist/migrate/assetFormatMap.d.ts +61 -0
  49. package/dist/migrate/assetFormatMap.js +53 -0
  50. package/dist/migrate/envTranslate.d.ts +26 -0
  51. package/dist/migrate/envTranslate.js +147 -0
  52. package/dist/migrate/fieldMap.d.ts +4 -2
  53. package/dist/migrate/fieldMap.js +9 -5
  54. package/dist/migrate/oauthImport.d.ts +66 -0
  55. package/dist/migrate/oauthImport.js +667 -0
  56. package/dist/migrate/v1Import.d.ts +92 -1
  57. package/dist/migrate/v1Import.js +1481 -141
  58. package/dist/promptRecallHook.d.ts +24 -0
  59. package/dist/promptRecallHook.js +425 -0
  60. package/dist/recallVerifyReport.d.ts +37 -0
  61. package/dist/recallVerifyReport.js +244 -0
  62. package/dist/recipe.d.ts +7 -1
  63. package/dist/recipe.js +426 -56
  64. package/dist/requiredSandboxValidation.d.ts +5 -0
  65. package/dist/requiredSandboxValidation.js +4 -0
  66. package/dist/reuse.d.ts +9 -0
  67. package/dist/reuse.js +159 -58
  68. package/dist/runtimeCapabilities.js +15 -15
  69. package/dist/runtimeSessionSource.d.ts +3 -2
  70. package/dist/runtimeSessionSource.js +63 -11
  71. package/dist/selectionPolicyConfig.d.ts +8 -0
  72. package/dist/selectionPolicyConfig.js +18 -0
  73. package/dist/semanticIdfConfig.d.ts +2 -0
  74. package/dist/semanticIdfConfig.js +4 -0
  75. package/dist/sessionIngest.d.ts +37 -0
  76. package/dist/sessionIngest.js +156 -0
  77. package/dist/setupHooks.js +95 -1
  78. package/dist/skill2gep.d.ts +13 -9
  79. package/dist/skill2gep.js +42 -30
  80. package/dist/skillDistill.d.ts +8 -4
  81. package/dist/skillDistill.js +38 -9
  82. package/dist/solo/mode.js +1 -0
  83. package/dist/sync.d.ts +12 -0
  84. package/dist/sync.js +1246 -151
  85. package/dist/thesis.d.ts +1 -1
  86. package/dist/thesis.js +20 -3
  87. package/dist/trajectoryExport.js +21 -3
  88. package/dist/v1Compat.d.ts +1 -0
  89. package/dist/v1Compat.js +9 -0
  90. package/dist/workflowRuntime.js +24 -18
  91. package/package.json +11 -8
@@ -5,5 +5,6 @@ export declare const listCycles: typeof events.listCycles;
5
5
  export declare const showCycle: typeof events.showCycle;
6
6
  export declare const listTriggers: typeof events.listTriggers;
7
7
  export declare const dailySummary: typeof events.dailySummary;
8
+ export declare const dailyCapsuleCount: typeof events.dailyCapsuleCount;
8
9
  export declare const buildNarrativeSnapshot: typeof events.buildNarrativeSnapshot;
9
10
  export declare const buildRetentionReport: typeof events.buildRetentionReport;
package/dist/commands.js CHANGED
@@ -6,5 +6,6 @@ export const listCycles = events.listCycles;
6
6
  export const showCycle = events.showCycle;
7
7
  export const listTriggers = events.listTriggers;
8
8
  export const dailySummary = events.dailySummary;
9
+ export const dailyCapsuleCount = events.dailyCapsuleCount;
9
10
  export const buildNarrativeSnapshot = events.buildNarrativeSnapshot;
10
11
  export const buildRetentionReport = events.buildRetentionReport;
@@ -0,0 +1,6 @@
1
+ type CapabilityGapsEnv = Readonly<Record<string, string | undefined>>;
2
+ export declare function resolveCurriculumMailboxPath(env?: CapabilityGapsEnv): string;
3
+ /** Read one immutable lifecycle snapshot per curriculum preparation without creating a proxy database. */
4
+ export declare function readPersistedCapabilityGaps(env?: CapabilityGapsEnv): string[];
5
+ export declare function makeCurriculumCapabilityGapsProvider(env?: CapabilityGapsEnv): () => readonly string[];
6
+ export {};
@@ -0,0 +1,24 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { events, mailbox, signals } from '@evomap/evolver-core';
4
+ export function resolveCurriculumMailboxPath(env = process.env) {
5
+ const configured = env['EVOLVER_PROXY_STORE']?.trim();
6
+ return configured && configured.length > 0
7
+ ? configured
8
+ : join(events.evomapHome(env), 'proxy', 'mailbox.db');
9
+ }
10
+ /** Read one immutable lifecycle snapshot per curriculum preparation without creating a proxy database. */
11
+ export function readPersistedCapabilityGaps(env = process.env) {
12
+ const path = resolveCurriculumMailboxPath(env);
13
+ if (!existsSync(path))
14
+ return [];
15
+ try {
16
+ return signals.capabilityGapsFromState(mailbox.readMailboxState(path, signals.CAPABILITY_GAPS_STATE_KEY));
17
+ }
18
+ catch {
19
+ return [];
20
+ }
21
+ }
22
+ export function makeCurriculumCapabilityGapsProvider(env = process.env) {
23
+ return () => readPersistedCapabilityGaps(env);
24
+ }
@@ -1,4 +1,5 @@
1
1
  import { assetstore, algo, events, exec, material as materialNs, personality, verify } from '@evomap/evolver-core';
2
+ import { type ConfiguredSelectionGuard, type ConfiguredSelectionPolicy } from './selectionPolicyConfig.js';
2
3
  type RunnerName = NonNullable<exec.AutonomousSafety['runner']>;
3
4
  type SleepFn = (ms: number, signal?: AbortSignal) => Promise<void>;
4
5
  type SandboxedValidationRunner = typeof verify.runSandboxedValidation;
@@ -60,6 +61,8 @@ export interface MaterialCycleOptions {
60
61
  validationCmds?: readonly string[];
61
62
  validate?: exec.AutoExecDeps['validate'];
62
63
  runner?: RunnerName;
64
+ /** Resume the single native Claude Code or Cursor session represented by each material. Default false. */
65
+ resume?: boolean;
63
66
  timeoutMs?: number;
64
67
  signal?: AbortSignal;
65
68
  safety?: Partial<exec.AutonomousSafety>;
@@ -91,6 +94,16 @@ export interface MaterialCycleDeps {
91
94
  safety?: Partial<exec.AutonomousSafety>;
92
95
  sleep?: SleepFn;
93
96
  watchStateWriter?: (path: string, state: MaterialCycleWatchState) => void;
97
+ /** User home whose native runtime directories may contribute resumable session identities. */
98
+ nativeSessionHome?: string;
99
+ /** Override semantic IDF composition; otherwise resolved from EVOLVER_SEMANTIC_IDF. */
100
+ disableSemanticIdf?: boolean;
101
+ /** Override plateau selection policy; otherwise resolved from EVOLVER_SELECTION_POLICY. */
102
+ selectionPolicy?: ConfiguredSelectionPolicy;
103
+ /** Override the relevance guard; otherwise resolved from EVOLVER_SELECTION_GUARD. */
104
+ selectionGuard?: ConfiguredSelectionGuard;
105
+ /** Override the optional score floor; otherwise resolved from EVOLVER_SELECTION_FLOOR. */
106
+ selectionFloor?: number;
94
107
  }
95
108
  export declare function cycleIdForMaterial(materialId: string): string;
96
109
  export declare function cycleLockPathForMaterial(materialStorePath: string, materialId: string): string;
@@ -1,18 +1,24 @@
1
1
  import { accessSync, constants, lstatSync, mkdirSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
2
3
  import { basename, dirname, join, resolve } from 'node:path';
3
4
  import { assetstore, algo, events, exec, material as materialNs, personality, schema, signals, util, verify } from '@evomap/evolver-core';
4
- import { materialHasRuntimeSessionSnapshot, materialSourceAvailable, runtimeSessionSourcesForMaterial } from './materialSnapshot.js';
5
+ import { MATERIAL_RUNTIME_SESSION_SNAPSHOT_SCHEMA, materialHasRuntimeSessionSnapshot, materialSourceAvailable, runtimeSessionEvidenceSummariesFromMaterialPayload, runtimeSessionSourcesForMaterial, runtimeSessionSourcesForMaterialDetails, } from './materialSnapshot.js';
6
+ import { runRequiredSandboxedValidation } from './requiredSandboxValidation.js';
5
7
  import { signalTokens } from './distillPrimitives.js';
6
8
  import { readEvents, showCycle } from './commands.js';
7
9
  import { RUNTIME_CAPABILITY_MATRIX, runtimeCapabilities } from './runtimeCapabilities.js';
10
+ import { parseRuntimeSessionSources } from './runtimeSessionSource.js';
8
11
  import { LocalMemoryGraph, resolveLocalMemoryUserIdentity } from './localMemoryGraph.js';
12
+ import { makeCurriculumCapabilityGapsProvider } from './curriculumCapabilityGaps.js';
13
+ import { semanticIdfEnabled } from './semanticIdfConfig.js';
14
+ import { selectionFloorFromEnv, selectionGuardFromEnv, selectionPolicyFromEnv, } from './selectionPolicyConfig.js';
9
15
  const CYCLE_GROUP = 'cycle';
10
16
  const DEFAULT_LIMIT = 5;
11
17
  const DEFAULT_WATCH_IDLE_MS = 1000;
12
18
  const DEFAULT_WATCH_MAX_IDLE_MS = 30_000;
13
19
  const DEFAULT_WATCH_BACKOFF = 2;
14
- const CYCLE_USAGE = 'usage: evolver cycle capabilities [--json] | evolver cycle show <id> | evolver cycle status [--json] | evolver cycle recover [--limit N] [--json] | evolver cycle watch --repo <path> [--idle-ms N] [--max-idle N] [--state-file <path>] [--validation-cmd <cmd>] [--timeout-ms N] [--json] | evolver cycle --repo <path> [--limit N] [--target <path>] [--expected-effect <text>] [--runner claude|codex|cursor|gemini] [--validation-cmd <cmd>] [--timeout-ms N]\n';
15
- const WATCH_USAGE = 'usage: evolver cycle watch --repo <path> [--limit N] [--idle-ms N] [--max-idle-ms N] [--max-idle N] [--max-iterations N] [--state-file <path>] [--target <path>] [--expected-effect <text>] [--runner claude|codex|cursor|gemini] [--validation-cmd <cmd>] [--timeout-ms N] [--json]\n';
20
+ const CYCLE_USAGE = 'usage: evolver cycle capabilities [--json] | evolver cycle show <id> | evolver cycle status [--json] | evolver cycle recover [--limit N] [--json] | evolver cycle watch --repo <path> [--resume] [--idle-ms N] [--max-idle N] [--state-file <path>] [--validation-cmd <cmd>] [--timeout-ms N] [--json] | evolver cycle --repo <path> [--resume] [--limit N] [--target <path>] [--expected-effect <text>] [--runner claude|codex|gemini] [--validation-cmd <cmd>] [--timeout-ms N]\n';
21
+ const WATCH_USAGE = 'usage: evolver cycle watch --repo <path> [--resume] [--limit N] [--idle-ms N] [--max-idle-ms N] [--max-idle N] [--max-iterations N] [--state-file <path>] [--target <path>] [--expected-effect <text>] [--runner claude|codex|gemini] [--validation-cmd <cmd>] [--timeout-ms N] [--json]\n';
16
22
  class CycleWatchStateWriteError extends Error {
17
23
  constructor() {
18
24
  super('cycle watch state file write failed');
@@ -36,6 +42,22 @@ function parseFlags(argv) {
36
42
  }
37
43
  return out;
38
44
  }
45
+ function parseSwitchFlag(argv, name) {
46
+ const flag = `--${name}`;
47
+ let present = false;
48
+ for (let i = 0; i < argv.length; i++) {
49
+ const arg = argv[i];
50
+ if (arg?.startsWith(`${flag}=`))
51
+ return null;
52
+ if (arg !== flag)
53
+ continue;
54
+ const next = argv[i + 1];
55
+ if (next !== undefined && !next.startsWith('--'))
56
+ return null;
57
+ present = true;
58
+ }
59
+ return present;
60
+ }
39
61
  function parseRepeatedFlag(argv, name) {
40
62
  const values = [];
41
63
  const flag = `--${name}`;
@@ -62,18 +84,13 @@ function parseRepeatedFlag(argv, name) {
62
84
  function makeCycleValidationHook(validationCmds, fallback, runSandboxedValidation = verify.runSandboxedValidation) {
63
85
  if (validationCmds.length === 0)
64
86
  return fallback;
65
- let warnedNoIsolation = false;
66
87
  return (task) => {
67
88
  const fallbackHook = fallback?.(task);
68
89
  return async (mutation, decision, cwd) => {
69
90
  const fallbackResult = fallbackHook ? await fallbackHook(mutation, decision, cwd) : null;
70
91
  if (fallbackResult && !fallbackResult.passed)
71
92
  return fallbackResult;
72
- const result = await runSandboxedValidation(task.validationCmds ?? validationCmds, cwd);
73
- if (!result.isolated && !warnedNoIsolation) {
74
- warnedNoIsolation = true;
75
- process.stdout.write(' warning: validation runs WITHOUT network/FS isolation on this platform; non-namespace hardening still applies.\n');
76
- }
93
+ const result = await runRequiredSandboxedValidation(task.validationCmds ?? validationCmds, cwd, {}, runSandboxedValidation);
77
94
  return { passed: result.passed, score: result.score };
78
95
  };
79
96
  };
@@ -97,14 +114,14 @@ function parseRunner(value) {
97
114
  if (value === undefined || value === 'claude')
98
115
  return { ok: true, runner: 'claude' };
99
116
  if (value.trim() === '')
100
- return { ok: false, error: 'runner value is required (supported: claude, codex, cursor, gemini)' };
101
- if (value === 'codex' || value === 'cursor' || value === 'gemini')
117
+ return { ok: false, error: 'runner value is required (supported: claude, codex, gemini)' };
118
+ if (value === 'codex' || value === 'gemini')
102
119
  return { ok: true, runner: value };
103
- if (value === 'antigravity' || value === 'kimi' || value === 'kiro' || value === 'opencode') {
120
+ if (value === 'cursor' || value === 'antigravity' || value === 'kimi' || value === 'kiro' || value === 'opencode') {
104
121
  const capability = RUNTIME_CAPABILITY_MATRIX[value].execute;
105
122
  return { ok: false, error: `runner '${value}' execute capability is ${capability.status}: ${capability.evidence}` };
106
123
  }
107
- return { ok: false, error: `unknown runner '${value}' (supported: claude, codex, cursor, gemini)` };
124
+ return { ok: false, error: `unknown runner '${value}' (supported: claude, codex, gemini)` };
108
125
  }
109
126
  function resolveMaterialRunner(material, requestedRunner) {
110
127
  const sourceAgent = material.sourceAgent;
@@ -114,10 +131,10 @@ function resolveMaterialRunner(material, requestedRunner) {
114
131
  runner = 'claude';
115
132
  break;
116
133
  case 'codex':
117
- case 'cursor':
118
134
  case 'gemini':
119
135
  runner = sourceAgent;
120
136
  break;
137
+ case 'cursor':
121
138
  case 'antigravity':
122
139
  case 'kimi': {
123
140
  const capability = RUNTIME_CAPABILITY_MATRIX[sourceAgent].execute;
@@ -172,8 +189,25 @@ function resolveMaterialCycleDeps(deps = {}) {
172
189
  store,
173
190
  now: () => Date.now(),
174
191
  personality: personalityStore,
192
+ capabilityGaps: makeCurriculumCapabilityGapsProvider(),
175
193
  });
176
- return { materialStore, consumer, store, provenance, review, ingestor, engine, personality: personalityStore, memoryGraph };
194
+ const selectionFloor = deps.selectionFloor ?? selectionFloorFromEnv();
195
+ return {
196
+ materialStore,
197
+ consumer,
198
+ store,
199
+ provenance,
200
+ review,
201
+ ingestor,
202
+ engine,
203
+ personality: personalityStore,
204
+ memoryGraph,
205
+ nativeSessionHome: deps.nativeSessionHome ?? homedir(),
206
+ disableSemanticIdf: deps.disableSemanticIdf ?? !semanticIdfEnabled(),
207
+ selectionPolicy: deps.selectionPolicy ?? selectionPolicyFromEnv(),
208
+ selectionGuard: deps.selectionGuard ?? selectionGuardFromEnv(),
209
+ ...(selectionFloor !== undefined ? { selectionFloor } : {}),
210
+ };
177
211
  }
178
212
  export function cycleIdForMaterial(materialId) {
179
213
  return `autoexec-material-${materialId}`;
@@ -273,8 +307,7 @@ function fallbackSignalTokens(sigs) {
273
307
  }
274
308
  return [...out];
275
309
  }
276
- function materialSignals(material) {
277
- const sources = runtimeSessionSourcesForMaterial(material);
310
+ function materialSignals(sources) {
278
311
  const sigs = sources.flatMap((source) => signals.extractSignals(source.turns));
279
312
  const tokens = signalTokens(sigs);
280
313
  return {
@@ -282,6 +315,82 @@ function materialSignals(material) {
282
315
  sourceCount: sources.length,
283
316
  };
284
317
  }
318
+ function resolveMaterialResume(material, runner, sources, liveSources) {
319
+ if (material.sourceAgent !== 'claude-code' && material.sourceAgent !== 'cursor') {
320
+ const capability = material.sourceAgent
321
+ ? RUNTIME_CAPABILITY_MATRIX[material.sourceAgent].resume
322
+ : undefined;
323
+ return {
324
+ ok: false,
325
+ error: capability
326
+ ? `sourceAgent '${material.sourceAgent}' resume capability is ${capability.status}: ${capability.evidence}`
327
+ : 'runtime_session material has no resumable sourceAgent',
328
+ };
329
+ }
330
+ const expectedRunner = material.sourceAgent === 'cursor' ? 'cursor' : 'claude';
331
+ if (runner !== expectedRunner) {
332
+ return { ok: false, error: `resume identity harness does not match runner '${runner}'` };
333
+ }
334
+ if (material.sourceAgent === 'cursor' && basename(material.sourcePath).toLowerCase() === 'state.vscdb') {
335
+ return { ok: false, error: 'Cursor state.vscdb composer identity is ingest-only and cannot be resumed' };
336
+ }
337
+ const hasSnapshotSchema = typeof material.payload === 'object'
338
+ && material.payload !== null
339
+ && material.payload['schema'] === MATERIAL_RUNTIME_SESSION_SNAPSHOT_SCHEMA;
340
+ const snapshot = runtimeSessionEvidenceSummariesFromMaterialPayload(material.payload);
341
+ if (hasSnapshotSchema && !snapshot) {
342
+ return { ok: false, error: 'resume identity snapshot metadata is invalid' };
343
+ }
344
+ if (snapshot && (snapshot.sourceCount !== 1 || snapshot.omittedSourceCount !== 0)) {
345
+ return {
346
+ ok: false,
347
+ error: `resume identity is ambiguous for sourceAgent '${material.sourceAgent}': snapshot reports ${snapshot.sourceCount} sessions (${snapshot.omittedSourceCount} omitted)`,
348
+ };
349
+ }
350
+ const snapshotSource = snapshot?.summaries[0];
351
+ if (snapshot && snapshotSource?.agent !== material.sourceAgent) {
352
+ return { ok: false, error: `resume identity harness does not match sourceAgent '${material.sourceAgent}' in snapshot` };
353
+ }
354
+ const snapshotSessionId = snapshotSource?.sessionId?.trim();
355
+ if (snapshot && !snapshotSessionId) {
356
+ return { ok: false, error: `resume identity missing from snapshot for sourceAgent '${material.sourceAgent}'` };
357
+ }
358
+ if (!liveSources && snapshotSource?.resumeIdentityProvenance !== 'canonical_native_transcript') {
359
+ return {
360
+ ok: false,
361
+ error: `resume identity snapshot lacks verified native transcript provenance for sourceAgent '${material.sourceAgent}'`,
362
+ };
363
+ }
364
+ // Signals may safely fall back to the durable snapshot, but resume identity must retain live provenance.
365
+ // Otherwise an existing transcript with a new path-bound identity and no parseable turns can be filtered out,
366
+ // making the stale snapshot identity appear to match itself and resuming the wrong native session.
367
+ const identitySources = liveSources ?? sources;
368
+ if (identitySources.length === 0) {
369
+ return { ok: false, error: `resume identity missing for sourceAgent '${material.sourceAgent}'` };
370
+ }
371
+ if (identitySources.some((source) => source.agent !== material.sourceAgent)) {
372
+ return { ok: false, error: `resume identity harness does not match sourceAgent '${material.sourceAgent}'` };
373
+ }
374
+ if (identitySources.length !== 1) {
375
+ return { ok: false, error: `resume identity is ambiguous for sourceAgent '${material.sourceAgent}': expected one session, found ${identitySources.length}` };
376
+ }
377
+ const sessionId = identitySources[0].sessionId?.trim();
378
+ if (!sessionId) {
379
+ return { ok: false, error: `resume identity missing for sourceAgent '${material.sourceAgent}'` };
380
+ }
381
+ if (snapshotSessionId && sessionId !== snapshotSessionId) {
382
+ return { ok: false, error: `resume identity does not match snapshot for sourceAgent '${material.sourceAgent}'` };
383
+ }
384
+ const resume = { runner, sessionId };
385
+ try {
386
+ exec.validateAgentSessionResume(resume, runner);
387
+ }
388
+ catch (error) {
389
+ const code = error instanceof exec.AgentSessionResumeError ? error.code : 'invalid_session_id';
390
+ return { ok: false, error: `resume identity is invalid for sourceAgent '${material.sourceAgent}' (${code})` };
391
+ }
392
+ return { ok: true, resume };
393
+ }
285
394
  async function emitConsumed(ingestor, material, item, extra = {}) {
286
395
  await ingestor.ingest({
287
396
  type: 'cycle.consumed',
@@ -361,9 +470,18 @@ async function processMaterial(material, opts, deps) {
361
470
  ackOne(deps.consumer, material);
362
471
  return item;
363
472
  }
364
- let extracted;
473
+ let sources;
474
+ let liveResumeSources;
365
475
  try {
366
- extracted = materialSignals(material);
476
+ const resolvedSources = runtimeSessionSourcesForMaterialDetails(material, undefined, deps.nativeSessionHome);
477
+ const sourceAvailable = materialSourceAvailable(material);
478
+ if (opts.resume && sourceAvailable && resolvedSources.sourceError) {
479
+ throw resolvedSources.sourceError;
480
+ }
481
+ sources = resolvedSources.sources;
482
+ // A successful read is authoritative even if the source disappears before the availability check.
483
+ // Discarding captured provenance here could resume a stale snapshot identity.
484
+ liveResumeSources = opts.resume ? resolvedSources.liveSources : undefined;
367
485
  }
368
486
  catch (error) {
369
487
  const reason = error instanceof Error ? error.message : String(error);
@@ -372,6 +490,22 @@ async function processMaterial(material, opts, deps) {
372
490
  ackOne(deps.consumer, material);
373
491
  return item;
374
492
  }
493
+ const resume = opts.resume
494
+ ? resolveMaterialResume(material, runner.runner, sources, liveResumeSources)
495
+ : undefined;
496
+ if (resume && !resume.ok) {
497
+ const item = {
498
+ materialId: material.materialId,
499
+ action: 'fail',
500
+ status: 'refused',
501
+ cycleId,
502
+ reason: resume.error,
503
+ };
504
+ await emitConsumed(deps.ingestor, material, item);
505
+ ackOne(deps.consumer, material);
506
+ return item;
507
+ }
508
+ const extracted = materialSignals(sources);
375
509
  if (extracted.sourceCount === 0 || extracted.signals.length === 0) {
376
510
  const reason = extracted.sourceCount === 0 ? 'no parseable runtime session source' : 'no cycle-worthy session signals';
377
511
  const item = { materialId: material.materialId, action: 'fail', status: 'no_signals', cycleId, reason };
@@ -379,6 +513,19 @@ async function processMaterial(material, opts, deps) {
379
513
  ackOne(deps.consumer, material);
380
514
  return item;
381
515
  }
516
+ if ((runner.runner === 'claude' || runner.runner === 'codex') && !opts.agent) {
517
+ const runnerName = runner.runner === 'claude' ? 'Claude' : 'Codex';
518
+ const item = {
519
+ materialId: material.materialId,
520
+ action: 'fail',
521
+ status: 'refused',
522
+ cycleId,
523
+ reason: `execute capability is unsupported: built-in ${runnerName} requires a verified host filesystem sandbox`,
524
+ };
525
+ await emitConsumed(deps.ingestor, material, item);
526
+ ackOne(deps.consumer, material);
527
+ return item;
528
+ }
382
529
  const repo = resolve(opts.repo);
383
530
  const task = {
384
531
  id: `material-${material.materialId}`,
@@ -393,6 +540,7 @@ async function processMaterial(material, opts, deps) {
393
540
  ...(opts.timeoutMs !== undefined ? { timeoutMs: opts.timeoutMs } : {}),
394
541
  ...opts.safety,
395
542
  runner: runner.runner,
543
+ ...(resume?.ok ? { resume: resume.resume } : {}),
396
544
  ...(opts.signal ? { signal: opts.signal } : {}),
397
545
  };
398
546
  const verdict = await exec.runAutoExecTask({
@@ -402,6 +550,10 @@ async function processMaterial(material, opts, deps) {
402
550
  review: deps.review,
403
551
  personality: deps.personality,
404
552
  memoryGraph: deps.memoryGraph,
553
+ ...(deps.disableSemanticIdf ? { disableSemanticIdf: true } : {}),
554
+ ...(deps.selectionPolicy !== 'engine-health' ? { selectionPolicy: deps.selectionPolicy } : {}),
555
+ selectionGuard: deps.selectionGuard,
556
+ ...(deps.selectionFloor !== undefined ? { selectionFloor: deps.selectionFloor } : {}),
405
557
  ...(opts.validate ? { validate: opts.validate } : {}),
406
558
  ...(opts.agent ? { agent: opts.agent } : {}),
407
559
  ...(opts.git ? { git: opts.git } : {}),
@@ -418,6 +570,7 @@ async function processMaterial(material, opts, deps) {
418
570
  signalCount: extracted.signals.length,
419
571
  signals: extracted.signals,
420
572
  runner: runner.runner,
573
+ ...(resume?.ok && verdict.status === 'solidified' ? { resumedSession: true } : {}),
421
574
  });
422
575
  ackOne(deps.consumer, material);
423
576
  return item;
@@ -864,7 +1017,13 @@ export async function runCycleCommand(argv, injectedDeps = {}) {
864
1017
  return 0;
865
1018
  }
866
1019
  if (argv[0] === 'watch') {
867
- const flags = parseFlags(argv.slice(1));
1020
+ const watchArgv = argv.slice(1);
1021
+ const flags = parseFlags(watchArgv);
1022
+ const resume = parseSwitchFlag(watchArgv, 'resume');
1023
+ if (resume === null) {
1024
+ process.stderr.write(WATCH_USAGE);
1025
+ return 1;
1026
+ }
868
1027
  const runner = parseRunner(flags['runner']);
869
1028
  if (!runner.ok) {
870
1029
  process.stderr.write(`${runner.error}\n`);
@@ -906,6 +1065,7 @@ export async function runCycleCommand(argv, injectedDeps = {}) {
906
1065
  try {
907
1066
  result = await runMaterialCycleWatch({
908
1067
  repo,
1068
+ ...(resume ? { resume: true } : {}),
909
1069
  limit: parsePositiveInt(flags['limit'], DEFAULT_LIMIT),
910
1070
  target: flags['target'] || '.',
911
1071
  expectedEffect: flags['expected-effect'] || 'evolve from consumed session material',
@@ -1006,6 +1166,11 @@ export async function runCycleCommand(argv, injectedDeps = {}) {
1006
1166
  return result.stopped === 'cancelled' ? cancellation.exitCode() : 0;
1007
1167
  }
1008
1168
  const flags = parseFlags(argv);
1169
+ const resume = parseSwitchFlag(argv, 'resume');
1170
+ if (resume === null) {
1171
+ process.stderr.write(CYCLE_USAGE);
1172
+ return 1;
1173
+ }
1009
1174
  const runner = parseRunner(flags['runner']);
1010
1175
  if (!runner.ok) {
1011
1176
  process.stderr.write(`${runner.error}\n`);
@@ -1033,6 +1198,7 @@ export async function runCycleCommand(argv, injectedDeps = {}) {
1033
1198
  try {
1034
1199
  result = await runMaterialCycleConsumer({
1035
1200
  repo,
1201
+ ...(resume ? { resume: true } : {}),
1036
1202
  limit: parsePositiveInt(flags['limit'], DEFAULT_LIMIT),
1037
1203
  target: flags['target'] || '.',
1038
1204
  expectedEffect: flags['expected-effect'] || 'evolve from consumed session material',
package/dist/dashboard.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { spawn } from 'node:child_process';
2
- import { assetstore, events, ops, personality, workflow } from '@evomap/evolver-core';
2
+ import { lstatSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { assetstore, events, mailbox, ops, personality, workflow } from '@evomap/evolver-core';
3
5
  import { loadPriceTable } from '@evomap/evolver-adapter-public';
4
6
  import { loadEnvFileFromEnv } from '@evomap/evolver-mcp';
5
7
  import { createGithubPrDiagnosticsProvider, readLogDiagnostics, readPersonalityDiagnostics, WebUIServer, } from '@evomap/evolver-webui';
@@ -201,9 +203,11 @@ export function createDashboardServer(memoryGraphStatus, env = process.env) {
201
203
  });
202
204
  const logFile = lifecyclePaths(resolvedEnv).logFile;
203
205
  const githubPrDiagnostics = createGithubPrDiagnosticsProvider({ cwd: process.cwd() });
204
- return new WebUIServer({
206
+ const mailboxStore = openDashboardMailbox(resolvedEnv);
207
+ const server = new WebUIServer({
205
208
  eventsPath,
206
209
  store,
210
+ ...(mailboxStore ? { mailbox: mailboxStore } : {}),
207
211
  valueSummary: (window, eventSnapshot) => ops.loadValueSummary({
208
212
  traces: ops.readTraceRecords(tracesDir),
209
213
  events: eventSnapshot,
@@ -220,6 +224,42 @@ export function createDashboardServer(memoryGraphStatus, env = process.env) {
220
224
  memoryGraphStatus,
221
225
  workflow: createDashboardWorkflowProvider(resolvedEnv),
222
226
  });
227
+ if (!mailboxStore)
228
+ return server;
229
+ let closed = false;
230
+ return {
231
+ token: server.token,
232
+ launchTicket: server.launchTicket,
233
+ listen: (port) => server.listen(port),
234
+ close: async () => {
235
+ if (closed)
236
+ return;
237
+ closed = true;
238
+ try {
239
+ await server.close();
240
+ }
241
+ catch (error) {
242
+ if (error.code !== 'ERR_SERVER_NOT_RUNNING')
243
+ throw error;
244
+ }
245
+ finally {
246
+ mailboxStore.close();
247
+ }
248
+ },
249
+ };
250
+ }
251
+ function openDashboardMailbox(env) {
252
+ const configured = env['EVOLVER_PROXY_STORE']?.trim();
253
+ const path = configured || join(events.evomapHome(env), 'proxy', 'mailbox.db');
254
+ try {
255
+ const stat = lstatSync(path);
256
+ if (!stat.isFile() || stat.isSymbolicLink())
257
+ return undefined;
258
+ return new mailbox.MailboxStore({ path });
259
+ }
260
+ catch {
261
+ return undefined;
262
+ }
223
263
  }
224
264
  export function dashboardOpenCommand(url, platform = process.platform) {
225
265
  if (platform === 'win32')
@@ -340,13 +380,11 @@ export async function runDashboardCommand(argv, deps = {}, options = {}) {
340
380
  return 1;
341
381
  }
342
382
  finally {
343
- if (listening) {
344
- try {
345
- await server.close();
346
- }
347
- catch {
348
- // The process is already shutting down; avoid replacing the command result with a close race.
349
- }
383
+ try {
384
+ await server.close();
385
+ }
386
+ catch {
387
+ // The command result takes precedence over a close race or an unbound HTTP server.
350
388
  }
351
389
  }
352
390
  }
package/dist/dispatch.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // this module holds the dispatch DATA so the surface is importable and assertable (see commandSurface.test.ts).
4
4
  // The "phantom command" trap this guards against: an installer baking `evolver <verb>` into a user's runtime
5
5
  // config for a verb the CLI never actually dispatches — a green build hides it, the user hits a usage error.
6
- import { runCli, runMigrate, runAssetLog, runDistill, runIngest, runInject, runReview, } from './index.js';
6
+ import { runCli, runMigrate, runAssetLog, runDistill, runIngest, runInject, runReview, runDaily, } from './index.js';
7
7
  import { runAutoExec } from './autoexec.js';
8
8
  import { runAtpCommand, runBuyCommand, runOrdersCommand, runVerifyCommand } from './atp.js';
9
9
  import { runLogin, runLogout } from './login.js';
@@ -17,6 +17,7 @@ import { runReuseCommand } from './reuse.js';
17
17
  import { runPublishCommand } from './cliContracts.js';
18
18
  import { runRecallCommand } from './recall.js';
19
19
  import { runReuseReportCommand } from './reuseReport.js';
20
+ import { runRecallVerifyReportCommand } from './recallVerifyReport.js';
20
21
  import { runDoctorCommand } from './doctor.js';
21
22
  import { runPhubCommand } from './phub.js';
22
23
  import { runTrajectoryExport } from './trajectoryExport.js';
@@ -31,8 +32,9 @@ import { runDashboardCommand } from './dashboard.js';
31
32
  import { runIssueReportCommand } from './issueReport.js';
32
33
  import { runAssetTrustCommand } from './assetTrust.js';
33
34
  import { runAssetHealthCommand } from './assetHealth.js';
34
- import { runV1FetchCompat, runV1RunCompat, runV1SolidifyCompat, runV1WebuiCompat } from './v1Compat.js';
35
+ import { runV1FetchCompat, runV1RunCompat, runV1SolidifyCompat, runV1WebuiCompat, runV1ExecCompat } from './v1Compat.js';
35
36
  import { runWorkflowCommand } from './workflow.js';
37
+ import { runMemoryGraphCommand } from './memoryGraphOps.js';
36
38
  export async function runProxyCommand(argv, importer = () => import('@evomap/evolver-proxy/bin/evolver-proxy')) {
37
39
  const { runProxyCli } = await importer();
38
40
  return runProxyCli({ argv: ['proxy', ...argv] });
@@ -45,6 +47,7 @@ export const ASYNC_COMMANDS = {
45
47
  ingest: runIngest,
46
48
  inject: runInject,
47
49
  review: runReview,
50
+ daily: runDaily,
48
51
  skill: runSkillCommand,
49
52
  'skill-distill': runSkillDistill,
50
53
  'skill-md-update': runSkillMdUpdate,
@@ -64,7 +67,9 @@ export const ASYNC_COMMANDS = {
64
67
  sync: runSyncCommand,
65
68
  recall: runRecallCommand,
66
69
  'reuse-report': runReuseReportCommand,
70
+ 'recall-verify-report': runRecallVerifyReportCommand,
67
71
  doctor: runDoctorCommand,
72
+ 'memory-graph': runMemoryGraphCommand,
68
73
  phub: runPhubCommand,
69
74
  lifecycle: runLifecycleCommand,
70
75
  cycle: runCycleCommand,
@@ -81,6 +86,7 @@ export const ASYNC_COMMANDS = {
81
86
  solidify: runV1SolidifyCompat,
82
87
  fetch: runV1FetchCompat,
83
88
  webui: runV1WebuiCompat,
89
+ exec: runV1ExecCompat,
84
90
  workflow: runWorkflowCommand,
85
91
  };
86
92
  /** Verbs handled by the synchronous runCli core (read-only views + local ops). Kept in sync with runCli's switch
@@ -0,0 +1,13 @@
1
+ import { type algo, type assetstore } from '@evomap/evolver-core';
2
+ import { type DraftAdmission, type DraftAdmissionOptions, type ExistingGeneSignals } from './distillPrimitives.js';
3
+ export interface StoreDraftAdmission {
4
+ admission: DraftAdmission;
5
+ existing: ExistingGeneSignals[];
6
+ }
7
+ /**
8
+ * Build the complete dedupe context without loading the entire pool. Any subset or positive-Jaccard duplicate must
9
+ * share at least one candidate signal, so a store-side signalsAny query is complete for admission while excluding
10
+ * unrelated Genes. MAX_SAFE_INTEGER deliberately removes the provider's default result window; silently accepting
11
+ * a duplicate after row 1000 is worse than evaluating all signal-related rows in a mature pool.
12
+ */
13
+ export declare function assessDraftAdmissionFromStore(store: Pick<assetstore.AssetStoreProvider, 'search'>, candidate: algo.GeneCandidate, additional?: readonly ExistingGeneSignals[], opts?: DraftAdmissionOptions): Promise<StoreDraftAdmission>;
@@ -0,0 +1,35 @@
1
+ import {} from '@evomap/evolver-core';
2
+ import { assessDraftAdmission, } from './distillPrimitives.js';
3
+ function normalizedCandidateSignals(candidate) {
4
+ return [...new Set((candidate.signals_match ?? [])
5
+ .map((signal) => String(signal).trim().toLowerCase())
6
+ .filter(Boolean))];
7
+ }
8
+ function geneSignalRef(record) {
9
+ if (record.type !== 'Gene')
10
+ return null;
11
+ return {
12
+ id: typeof record['id'] === 'string' ? String(record['id']) : undefined,
13
+ signals_match: Array.isArray(record['signals_match']) ? record['signals_match'] : [],
14
+ };
15
+ }
16
+ /**
17
+ * Build the complete dedupe context without loading the entire pool. Any subset or positive-Jaccard duplicate must
18
+ * share at least one candidate signal, so a store-side signalsAny query is complete for admission while excluding
19
+ * unrelated Genes. MAX_SAFE_INTEGER deliberately removes the provider's default result window; silently accepting
20
+ * a duplicate after row 1000 is worse than evaluating all signal-related rows in a mature pool.
21
+ */
22
+ export async function assessDraftAdmissionFromStore(store, candidate, additional = [], opts = {}) {
23
+ const intrinsic = assessDraftAdmission(candidate, [], opts);
24
+ if (!intrinsic.admit)
25
+ return { admission: intrinsic, existing: [...additional] };
26
+ const signalsAny = normalizedCandidateSignals(candidate);
27
+ const stored = signalsAny.length > 0
28
+ ? await store.search({ kind: 'Gene', signalsAny, limit: Number.MAX_SAFE_INTEGER })
29
+ : [];
30
+ const existing = [
31
+ ...stored.map(geneSignalRef).filter((ref) => ref !== null),
32
+ ...additional,
33
+ ];
34
+ return { admission: assessDraftAdmission(candidate, existing, opts), existing };
35
+ }
@@ -11,7 +11,8 @@
11
11
  // wired into autoexec — a tracked dependency, not dead code. See distillObserver.test.ts.
12
12
  import { assetstore, events, observers, signals, algo } from '@evomap/evolver-core';
13
13
  import { readFileSync } from 'node:fs';
14
- import { draftGeneCandidate, assessDraftAdmission } from './distillPrimitives.js';
14
+ import { draftGeneCandidate } from './distillPrimitives.js';
15
+ import { assessDraftAdmissionFromStore } from './distillAdmission.js';
15
16
  import { reviewLedgerForStore } from './reviewFilter.js';
16
17
  import { runtimeSessionSourcesForMaterial } from './materialSnapshot.js';
17
18
  /** Consumer group the distill drain claims under — independent cursor from any other material consumer. */
@@ -49,13 +50,10 @@ export function makeDistillDrain(c) {
49
50
  const candidate = draftGeneCandidate(source.turns, signals.extractSignals(source.turns), source.agent);
50
51
  if (!candidate)
51
52
  continue; // too thin to distill
52
- const existing = (await c.store.list('Gene', 1000)).map((g) => ({
53
- id: typeof g['id'] === 'string' ? String(g['id']) : undefined,
54
- signals_match: Array.isArray(g['signals_match']) ? g['signals_match'] : [],
55
- }));
56
53
  // Value/novelty gate (#117 improvement 3): drop thin / near-duplicate drafts BEFORE they reach the human
57
54
  // review queue. Ack the material (a deliberate skip, not a failure — nothing to retry).
58
- if (!assessDraftAdmission(candidate, existing).admit)
55
+ const { admission, existing } = await assessDraftAdmissionFromStore(c.store, candidate);
56
+ if (!admission.admit)
59
57
  continue;
60
58
  const r = algo.intakeGene(candidate, existing);
61
59
  if (!r.ok || !r.gene)