@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
package/dist/thesis.d.ts CHANGED
@@ -35,7 +35,7 @@ export interface ThesisCommandDeps {
35
35
  now?: () => number;
36
36
  }
37
37
  /**
38
- * `evolver thesis --suite <file> [--repo <allowlisted>] [--min-samples N] [--min-delta D] [--interleave] [--json]`.
38
+ * `evolver thesis --suite <file> [--repo <allowlisted>] [--runner gemini] [--min-samples N] [--min-delta D] [--interleave] [--json]`.
39
39
  * Runs the controlled A/B and prints baseline-vs-evolver pass rates + the verdict. A LIVE run needs `--repo` (the
40
40
  * single allowlisted root the agent may touch); tests inject `deps.execute` instead.
41
41
  */
package/dist/thesis.js CHANGED
@@ -10,6 +10,7 @@ import { tmpdir } from 'node:os';
10
10
  import { join, resolve } from 'node:path';
11
11
  import { spawn } from 'node:child_process';
12
12
  import { events, assetstore, algo, exec, benchmark } from '@evomap/evolver-core';
13
+ import { semanticIdfEnabled } from './semanticIdfConfig.js';
13
14
  const NOW_FALLBACK = () => Date.now();
14
15
  /** Build a minimal ProblemPattern from a task's signals (the cycle needs a problem to evolve against). */
15
16
  function buildProblem(id, signals, now) {
@@ -40,14 +41,14 @@ const parseFlags = (argv) => {
40
41
  };
41
42
  const pct = (r) => `${(r * 100).toFixed(0)}%`;
42
43
  /**
43
- * `evolver thesis --suite <file> [--repo <allowlisted>] [--min-samples N] [--min-delta D] [--interleave] [--json]`.
44
+ * `evolver thesis --suite <file> [--repo <allowlisted>] [--runner gemini] [--min-samples N] [--min-delta D] [--interleave] [--json]`.
44
45
  * Runs the controlled A/B and prints baseline-vs-evolver pass rates + the verdict. A LIVE run needs `--repo` (the
45
46
  * single allowlisted root the agent may touch); tests inject `deps.execute` instead.
46
47
  */
47
48
  export async function runThesisCommand(argv, deps = {}) {
48
49
  const flags = parseFlags(argv);
49
50
  if (!flags['suite']) {
50
- process.stderr.write('用法: evolver thesis --suite <file> [--repo <allowlisted>] [--min-samples N] [--min-delta D] [--alpha A] [--target-power P] [--interleave] [--json]\n');
51
+ process.stderr.write('用法: evolver thesis --suite <file> [--repo <allowlisted>] [--runner gemini] [--min-samples N] [--min-delta D] [--alpha A] [--target-power P] [--interleave] [--json]\n');
51
52
  return 1;
52
53
  }
53
54
  let suite;
@@ -76,6 +77,10 @@ export async function runThesisCommand(argv, deps = {}) {
76
77
  process.stderr.write('thesis: a controlled A/B needs an external verifier — add a non-empty "validation" array to the suite. Refusing (passed must not come from agent self-report).\n');
77
78
  return 1;
78
79
  }
80
+ if (!deps.execute && flags['runner'] !== 'gemini') {
81
+ process.stderr.write('thesis: execute capability is unsupported for built-in Claude/Codex; select --runner gemini\n');
82
+ return 1;
83
+ }
79
84
  // HERMETIC experiment (Bugbot #168): the evolver arm READS genes from the pool but its cycle WRITES (capsules,
80
85
  // evolution events) must NOT land in production — that would pollute real selection + bans. So seed a THROWAWAY
81
86
  // evolver store with a copy of the pool's genes; both arms write only into temp stores that are discarded after.
@@ -98,7 +103,18 @@ export async function runThesisCommand(argv, deps = {}) {
98
103
  }
99
104
  return { passed: true, score: 0.95 };
100
105
  };
101
- execute = exec.makeSafeExecute(repo, evolverStore, { allowedRoots: [repo] }, { validate });
106
+ try {
107
+ execute = exec.makeSafeExecute(repo, evolverStore, { allowedRoots: [repo], runner: 'gemini' }, { validate });
108
+ }
109
+ catch (error) {
110
+ rmSync(expDir, { recursive: true, force: true });
111
+ if (error instanceof exec.UnsupportedAutonomousClaudeRunnerError
112
+ || error instanceof exec.UnsupportedAutonomousCodexRunnerError) {
113
+ process.stderr.write('thesis: execute capability is unsupported: built-in autonomous runners require a verified host filesystem sandbox\n');
114
+ return 1;
115
+ }
116
+ throw error;
117
+ }
102
118
  }
103
119
  const agent = execute;
104
120
  const solver = benchmark.makeEvolutionThesisSolver({
@@ -111,6 +127,7 @@ export async function runThesisCommand(argv, deps = {}) {
111
127
  expectedEffect: t.input.expectedEffect ?? 'fix',
112
128
  summary: t.input.summary ?? `thesis ${t.id}`,
113
129
  confidence: t.input.confidence ?? 0.9,
130
+ ...(!semanticIdfEnabled() ? { disableSemanticIdf: true } : {}),
114
131
  }),
115
132
  });
116
133
  const tasks = suite.tasks.map((s) => ({
@@ -2,7 +2,7 @@ import { closeSync, existsSync, lstatSync, openSync, readSync, readdirSync, read
2
2
  import { basename, delimiter, dirname, extname, join, resolve, sep } from 'node:path';
3
3
  import { homedir } from 'node:os';
4
4
  import { events, ops, trace } from '@evomap/evolver-core';
5
- import { ADAPTERS, adapterForPath, genericChatAdapter, isCursorStateVscdbPath, parseCursorStateVscdb, parseJsonlLines, parseJsonlLinesWithStats, } from '@evomap/evolver-runtime-adapters';
5
+ import { ADAPTERS, isRemovedAdapter, adapterForPath, genericChatAdapter, isCursorStateVscdbPath, parseCursorStateVscdb, parseJsonlLines, parseJsonlLinesWithStats, } from '@evomap/evolver-runtime-adapters';
6
6
  const TRACE_FILE_RE = /(^|[/\\])llm-trace-[^/\\]*\.jsonl$/i;
7
7
  const RUNTIME_SESSION_ENABLE_ENV = 'EVOLVER_TRAJECTORY_RUNTIME_SESSIONS';
8
8
  const RUNTIME_SESSION_ENABLE_ENV_LEGACY = 'EVOLVER_TRAJECTORY_EXPORT_RUNTIME_SESSIONS';
@@ -165,7 +165,9 @@ function traceLikeContent(chunk) {
165
165
  return parseJsonlLines(chunk).some(isTraceLikeRow);
166
166
  }
167
167
  function adapterForContent(chunk) {
168
- for (const adapter of [genericChatAdapter, ...ADAPTERS.filter((candidate) => candidate !== genericChatAdapter)]) {
168
+ // Never probe REMOVED_ADAPTERS / isRemovedAdapter agents — their parse() always throws.
169
+ const candidates = [genericChatAdapter, ...ADAPTERS.filter((candidate) => candidate !== genericChatAdapter && !isRemovedAdapter(candidate.agent))];
170
+ for (const adapter of candidates) {
169
171
  if (adapter.parse(chunk).some((turn) => turn.isMeta !== true))
170
172
  return adapter;
171
173
  }
@@ -194,6 +196,7 @@ function cursorGlobalStorageDir(home) {
194
196
  function cursorGlobalStorageDirs(home) {
195
197
  const dirs = [
196
198
  cursorGlobalStorageDir(home),
199
+ join(home, 'AppData', 'Roaming', 'Cursor', 'User', 'globalStorage'),
197
200
  join(home, '.config', 'Cursor', 'User', 'globalStorage'),
198
201
  ];
199
202
  const appData = process.env['APPDATA'];
@@ -779,6 +782,7 @@ export async function runTrajectoryExport(argv) {
779
782
  let files = [];
780
783
  let sessionFileCount = 0;
781
784
  let sessionTurnCount = 0;
785
+ let cursorParseFailures = 0;
782
786
  let excludedUnmarked = 0;
783
787
  let excludedGatewayCaptured = 0;
784
788
  const discoveredRuntimeDirs = runtimeSessionDirs(flags);
@@ -807,7 +811,19 @@ export async function runTrajectoryExport(argv) {
807
811
  // Read Cursor chat out of the sqlite db (read-only) and convert each composer to a trajectory. The
808
812
  // marker/gateway gates run PER COMPOSER here (each composerId is its own session_id), so a state.vscdb
809
813
  // holding many composers contributes only the ones evolver marked (and not already gateway-captured).
810
- for (const parsedSession of parseCursorStateVscdb(file.path)) {
814
+ let parsedSessions;
815
+ try {
816
+ parsedSessions = parseCursorStateVscdb(file.path);
817
+ }
818
+ catch (error) {
819
+ // Default discovery spans several optional platform locations. One stale/corrupt profile must not block
820
+ // healthy profiles or other runtime sources; explicit inputs still fail with the detailed parser error.
821
+ if (!file.fromRuntimeDiscovery)
822
+ throw error;
823
+ cursorParseFailures += 1;
824
+ continue;
825
+ }
826
+ for (const parsedSession of parsedSessions) {
811
827
  const { turns, ...adapterMetadata } = parsedSession;
812
828
  if (file.fromRuntimeDiscovery) {
813
829
  const composerSessionId = typeof adapterMetadata.sessionId === 'string' ? adapterMetadata.sessionId : undefined;
@@ -898,6 +914,8 @@ export async function runTrajectoryExport(argv) {
898
914
  process.stdout.write(`[trajectory-export] Read ${allRows.length} trace row(s) and ${sessionTurnCount} session turn(s) from ${files.length} file(s).\n`);
899
915
  if (sessionFileCount > 0)
900
916
  process.stdout.write(`[trajectory-export] Converted ${sessionFileCount} runtime session file(s).\n`);
917
+ if (cursorParseFailures > 0)
918
+ process.stdout.write(`[trajectory-export] Skipped ${cursorParseFailures} unreadable Cursor state database(s).\n`);
901
919
  if (excludedUnmarked > 0 || excludedGatewayCaptured > 0) {
902
920
  process.stdout.write(`[trajectory-export] Runtime session gate: excluded ${excludedUnmarked} unmarked (no evolver value.inject) and ${excludedGatewayCaptured} already-gateway-captured session(s). Pass --include-unmarked / --include-gateway-captured to collect them.\n`);
903
921
  }
@@ -21,4 +21,5 @@ export declare function runV1RunCompat(argv: readonly string[], deps?: V1CompatD
21
21
  export declare function runV1SolidifyCompat(argv: readonly string[], deps?: V1CompatDeps): Promise<number>;
22
22
  export declare function runV1FetchCompat(argv: readonly string[], deps?: V1CompatDeps): Promise<number>;
23
23
  export declare function runV1WebuiCompat(argv: readonly string[], deps?: V1CompatDeps): Promise<number>;
24
+ export declare function runV1ExecCompat(argv: readonly string[], deps?: V1CompatDeps): Promise<number>;
24
25
  export {};
package/dist/v1Compat.js CHANGED
@@ -10,6 +10,7 @@ const RUN_USAGE = 'usage: evolver run [-v | --verbose] [--loop | --mad-dog] [--j
10
10
  const SOLIDIFY_USAGE = 'usage: evolver solidify [--dry-run] [--json]\n';
11
11
  const FETCH_USAGE = 'usage: evolver fetch (--skill <id> | -s <id> | <id>) [--out <dir>] [--force] [--json]\n';
12
12
  const WEBUI_USAGE = 'usage: evolver webui [--port N] [--no-open]\n';
13
+ const EXEC_USAGE = 'usage: evolver exec <command>\n';
13
14
  const V1_WEBUI_DEFAULT_PORT = 19_821;
14
15
  const V1_WEBUI_PORT_ATTEMPTS = 50;
15
16
  function io(deps) {
@@ -246,4 +247,12 @@ export async function runV1WebuiCompat(argv, deps = {}) {
246
247
  if (deps.dashboard)
247
248
  return deps.dashboard(mapped, dashboardOptions);
248
249
  return runDashboardCommand(mapped, {}, dashboardOptions);
250
+ }
251
+ export async function runV1ExecCompat(argv, deps = {}) {
252
+ if (argv.includes('--help') || argv.includes('-h')) {
253
+ io(deps).stdout(EXEC_USAGE);
254
+ return 0;
255
+ }
256
+ const json = argv.includes('--json');
257
+ return migrationRequired('exec', 'evolver autoexec', 'V1 exec cannot be mapped safely to V2; use `evolver autoexec` for resident execution', json, deps, { mode: 'no_action' });
249
258
  }
@@ -3,6 +3,7 @@ import { realpathSync, statSync } from 'node:fs';
3
3
  import { basename, dirname, isAbsolute, join, resolve, sep } from 'node:path';
4
4
  import { algo, assetstore, events, exec, verify, wire, workflow } from '@evomap/evolver-core';
5
5
  import { readAutoExecConfig } from './autoexecConfig.js';
6
+ import { runRequiredSandboxedValidation } from './requiredSandboxValidation.js';
6
7
  const DEFAULT_MAX_CONCURRENT_RUNS = 4;
7
8
  const MAX_MAX_CONCURRENT_RUNS = 64;
8
9
  const MAX_PROMPT_LENGTH = 4_000;
@@ -333,28 +334,29 @@ function createProductionWorkflowAgentBridgeFromSnapshot(config, options, policy
333
334
  }
334
335
  const validate = validationCommands
335
336
  ? async (_mutation, _decision, cwd) => {
336
- const result = await runValidation(validationCommands, cwd);
337
+ const result = await runRequiredSandboxedValidation(validationCommands, cwd, {}, runValidation);
337
338
  return { passed: result.passed, score: result.score };
338
339
  }
339
340
  : undefined;
340
- const execute = exec.makeSafeExecute(repo, store, {
341
- allowedRoots,
342
- runner: config.runner,
343
- timeoutMs: config.timeoutMs,
344
- scrubEnv: true,
345
- isolation: 'worktree',
346
- requireTrustedGene: true,
347
- ...(bridgeOptions?.signal ? { signal: bridgeOptions.signal } : {}),
348
- }, {
349
- provenance,
350
- review,
351
- ...(validate ? { validate } : {}),
352
- ...(validationCommands ? { validationCmds: validationCommands } : {}),
353
- ...(options.agent ? { agent: options.agent } : {}),
354
- ...(options.git ? { git: options.git } : {}),
355
- });
341
+ let execute;
356
342
  let result;
357
343
  try {
344
+ execute = exec.makeSafeExecute(repo, store, {
345
+ allowedRoots,
346
+ runner: config.runner,
347
+ timeoutMs: config.timeoutMs,
348
+ scrubEnv: true,
349
+ isolation: 'worktree',
350
+ requireTrustedGene: true,
351
+ ...(bridgeOptions?.signal ? { signal: bridgeOptions.signal } : {}),
352
+ }, {
353
+ provenance,
354
+ review,
355
+ ...(validate ? { validate } : {}),
356
+ ...(validationCommands ? { validationCmds: validationCommands } : {}),
357
+ ...(options.agent ? { agent: options.agent } : {}),
358
+ ...(options.git ? { git: options.git } : {}),
359
+ });
358
360
  result = await execute(workflowMutation(prompt.trim(), context), {
359
361
  selectedGeneId: logicalGeneId,
360
362
  selectedAssetId: context.reviewedGeneAssetId,
@@ -367,7 +369,11 @@ function createProductionWorkflowAgentBridgeFromSnapshot(config, options, policy
367
369
  if (error instanceof workflow.ClassifiedWorkflowError)
368
370
  throw error;
369
371
  const name = error instanceof Error ? error.name : '';
370
- if (name === 'ExecBridgeForbiddenError' || name === 'UnsandboxedFullAccessRequiresIsolationError') {
372
+ if (name === 'ExecBridgeForbiddenError'
373
+ || name === 'UnsandboxedFullAccessRequiresIsolationError'
374
+ || name === 'UnsupportedAutonomousClaudeRunnerError'
375
+ || name === 'UnsupportedAutonomousCodexRunnerError'
376
+ || name === 'UnsupportedCursorAutonomousIsolationError') {
371
377
  throw classified('safety', 'workflow agent execution was denied by safety policy');
372
378
  }
373
379
  throw classified('unknown', 'workflow agent execution failed');
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@evomap/evolver-cli",
3
- "version": "2.0.0-beta.8",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": "^22.13.0 || >=23.4.0"
8
+ },
6
9
  "description": "evolver CLI (status/watch/cycles/rebuild-views/...)",
7
10
  "bin": {
8
11
  "evolver": "./dist/cli.js"
@@ -20,12 +23,12 @@
20
23
  }
21
24
  },
22
25
  "dependencies": {
23
- "@evomap/evolver-core": "2.0.0-beta.8",
24
- "@evomap/evolver-adapter-public": "2.0.0-beta.8",
25
- "@evomap/evolver-mcp": "2.0.0-beta.8",
26
- "@evomap/evolver-proxy": "2.0.0-beta.8",
27
- "@evomap/evolver-runtime-adapters": "2.0.0-beta.8",
28
- "@evomap/evolver-webui": "2.0.0-beta.8"
26
+ "@evomap/evolver-core": "2.0.0",
27
+ "@evomap/evolver-adapter-public": "2.0.0",
28
+ "@evomap/evolver-mcp": "2.0.0",
29
+ "@evomap/evolver-proxy": "2.0.0",
30
+ "@evomap/evolver-runtime-adapters": "2.0.0",
31
+ "@evomap/evolver-webui": "2.0.0"
29
32
  },
30
33
  "repository": {
31
34
  "type": "git",
@@ -33,7 +36,7 @@
33
36
  },
34
37
  "publishConfig": {
35
38
  "access": "public",
36
- "tag": "v2-beta"
39
+ "tag": "latest"
37
40
  },
38
41
  "files": [
39
42
  "dist/",