@evomap/evolver-cli 2.0.0-beta.19 → 2.0.0-beta.22

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 (68) hide show
  1. package/dist/antiGeneBenchmark.js +2 -0
  2. package/dist/antiGeneRollout.js +2 -0
  3. package/dist/assetRepair.d.ts +24 -0
  4. package/dist/assetRepair.js +172 -0
  5. package/dist/autoDistillAntiGene.js +7 -5
  6. package/dist/autoDistillLlm.d.ts +20 -0
  7. package/dist/autoDistillLlm.js +77 -15
  8. package/dist/autoexec.d.ts +11 -0
  9. package/dist/autoexec.js +65 -10
  10. package/dist/autoexecConfig.js +2 -1
  11. package/dist/cliContracts.d.ts +10 -0
  12. package/dist/cliContracts.js +407 -81
  13. package/dist/commandCatalog.d.ts +72 -0
  14. package/dist/commandCatalog.js +120 -0
  15. package/dist/cycleConsumer.d.ts +9 -0
  16. package/dist/cycleConsumer.js +14 -3
  17. package/dist/dispatch.d.ts +0 -1
  18. package/dist/dispatch.js +10 -4
  19. package/dist/distillObserver.js +23 -6
  20. package/dist/doctor.d.ts +11 -0
  21. package/dist/doctor.js +81 -6
  22. package/dist/index.d.ts +5 -1
  23. package/dist/index.js +200 -68
  24. package/dist/lifecycle.d.ts +126 -3
  25. package/dist/lifecycle.js +4390 -188
  26. package/dist/lifecycleBootstrapTransaction.d.ts +235 -0
  27. package/dist/lifecycleBootstrapTransaction.js +2182 -0
  28. package/dist/localMemoryGraph.d.ts +90 -3
  29. package/dist/localMemoryGraph.js +2031 -231
  30. package/dist/materialSnapshot.d.ts +2 -0
  31. package/dist/materialSnapshot.js +8 -0
  32. package/dist/memoryGraphOps.d.ts +8 -0
  33. package/dist/memoryGraphOps.js +140 -0
  34. package/dist/migrate/assetFormatMap.d.ts +61 -0
  35. package/dist/migrate/assetFormatMap.js +53 -0
  36. package/dist/migrate/envTranslate.js +2 -0
  37. package/dist/migrate/fieldMap.d.ts +7 -5
  38. package/dist/migrate/fieldMap.js +20 -14
  39. package/dist/migrate/v1Import.d.ts +80 -1
  40. package/dist/migrate/v1Import.js +961 -120
  41. package/dist/modelCompatibility.d.ts +10 -0
  42. package/dist/modelCompatibility.js +296 -0
  43. package/dist/recipe.d.ts +7 -1
  44. package/dist/recipe.js +113 -11
  45. package/dist/repairedAssetStore.d.ts +2 -0
  46. package/dist/repairedAssetStore.js +12 -0
  47. package/dist/reuse.d.ts +4 -1
  48. package/dist/reuse.js +212 -107
  49. package/dist/reviewFilter.d.ts +3 -1
  50. package/dist/reviewFilter.js +3 -1
  51. package/dist/runtimeSessionSource.d.ts +5 -0
  52. package/dist/selectionPolicyConfig.d.ts +8 -0
  53. package/dist/selectionPolicyConfig.js +18 -0
  54. package/dist/semanticIdfConfig.d.ts +2 -0
  55. package/dist/semanticIdfConfig.js +4 -0
  56. package/dist/sessionIngest.d.ts +7 -1
  57. package/dist/sessionIngest.js +25 -1
  58. package/dist/setupHooks.js +12 -6
  59. package/dist/skill2gep.js +57 -6
  60. package/dist/skillDistill.js +1 -0
  61. package/dist/sync.d.ts +1 -1
  62. package/dist/sync.js +761 -174
  63. package/dist/thesis.js +2 -0
  64. package/dist/valueDigest.js +8 -1
  65. package/dist/windowsLegacyTaskCleanup.d.ts +228 -0
  66. package/dist/windowsLegacyTaskCleanup.js +1475 -0
  67. package/dist/workflowRuntime.js +7 -6
  68. package/package.json +7 -7
@@ -0,0 +1,72 @@
1
+ export declare const COMMAND_GROUP_ORDER: readonly ["Daemon", "Evolution", "Memory", "Assets", "Hub", "Operations", "Tools", "Advanced"];
2
+ export type CommandGroup = (typeof COMMAND_GROUP_ORDER)[number];
3
+ export declare const SYNC_COMMAND_NAMES: readonly ["status", "cycles", "trigger", "value", "narrative", "retention", "gene-value", "replay", "rebuild-views", "reset-local-secret"];
4
+ export type SyncCommandName = (typeof SYNC_COMMAND_NAMES)[number];
5
+ export declare function isSyncCommandName(value: string): value is SyncCommandName;
6
+ export declare const COMMAND_GROUPS: {
7
+ readonly proxy: "Daemon";
8
+ readonly lifecycle: "Daemon";
9
+ readonly 'proxy-token': "Daemon";
10
+ readonly doctor: "Daemon";
11
+ readonly 'setup-hooks': "Daemon";
12
+ readonly run: "Evolution";
13
+ readonly cycle: "Evolution";
14
+ readonly autoexec: "Evolution";
15
+ readonly solidify: "Evolution";
16
+ readonly distill: "Evolution";
17
+ readonly review: "Evolution";
18
+ readonly thesis: "Evolution";
19
+ readonly ingest: "Memory";
20
+ readonly inject: "Memory";
21
+ readonly recall: "Memory";
22
+ readonly reuse: "Memory";
23
+ readonly 'reuse-report': "Memory";
24
+ readonly 'recall-verify-report': "Memory";
25
+ readonly narrative: "Memory";
26
+ readonly 'gene-value': "Memory";
27
+ readonly 'memory-graph': "Memory";
28
+ readonly 'asset-log': "Assets";
29
+ readonly 'asset-trust': "Assets";
30
+ readonly 'asset-health': "Assets";
31
+ readonly 'asset-repair': "Assets";
32
+ readonly material: "Assets";
33
+ readonly recipe: "Assets";
34
+ readonly skill: "Assets";
35
+ readonly login: "Hub";
36
+ readonly logout: "Hub";
37
+ readonly phub: "Hub";
38
+ readonly sync: "Hub";
39
+ readonly publish: "Hub";
40
+ readonly fetch: "Hub";
41
+ readonly buy: "Hub";
42
+ readonly orders: "Hub";
43
+ readonly verify: "Hub";
44
+ readonly atp: "Hub";
45
+ readonly status: "Operations";
46
+ readonly daily: "Operations";
47
+ readonly workflow: "Operations";
48
+ readonly cycles: "Operations";
49
+ readonly trigger: "Operations";
50
+ readonly value: "Operations";
51
+ readonly retention: "Operations";
52
+ readonly replay: "Operations";
53
+ readonly 'rebuild-views': "Operations";
54
+ readonly 'issue-report': "Operations";
55
+ readonly dashboard: "Tools";
56
+ readonly webui: "Tools";
57
+ readonly 'trajectory-export': "Tools";
58
+ readonly migrate: "Tools";
59
+ readonly exec: "Tools";
60
+ readonly 'anti-gene-benchmark': "Advanced";
61
+ readonly 'anti-gene-rollout': "Advanced";
62
+ readonly 'model-compatibility-replay': "Advanced";
63
+ readonly 'reset-local-secret': "Advanced";
64
+ readonly 'skill-distill': "Advanced";
65
+ readonly 'skill-md-update': "Advanced";
66
+ };
67
+ export type CommandName = keyof typeof COMMAND_GROUPS;
68
+ export type AsyncCommandName = Exclude<CommandName, SyncCommandName>;
69
+ export declare const COMMAND_HELP_MAX_WIDTH = 100;
70
+ export declare function commandsInGroup(group: CommandGroup): readonly CommandName[];
71
+ export declare function commandHelpLabel(command: CommandName): string;
72
+ export declare function renderCommandGroups(): string[];
@@ -0,0 +1,120 @@
1
+ export const COMMAND_GROUP_ORDER = [
2
+ 'Daemon',
3
+ 'Evolution',
4
+ 'Memory',
5
+ 'Assets',
6
+ 'Hub',
7
+ 'Operations',
8
+ 'Tools',
9
+ 'Advanced',
10
+ ];
11
+ export const SYNC_COMMAND_NAMES = [
12
+ 'status', 'cycles', 'trigger', 'value', 'narrative', 'retention', 'gene-value', 'replay', 'rebuild-views',
13
+ 'reset-local-secret',
14
+ ];
15
+ const SYNC_COMMAND_NAME_SET = new Set(SYNC_COMMAND_NAMES);
16
+ export function isSyncCommandName(value) {
17
+ return SYNC_COMMAND_NAME_SET.has(value);
18
+ }
19
+ export const COMMAND_GROUPS = {
20
+ proxy: 'Daemon',
21
+ lifecycle: 'Daemon',
22
+ 'proxy-token': 'Daemon',
23
+ doctor: 'Daemon',
24
+ 'setup-hooks': 'Daemon',
25
+ run: 'Evolution',
26
+ cycle: 'Evolution',
27
+ autoexec: 'Evolution',
28
+ solidify: 'Evolution',
29
+ distill: 'Evolution',
30
+ review: 'Evolution',
31
+ thesis: 'Evolution',
32
+ ingest: 'Memory',
33
+ inject: 'Memory',
34
+ recall: 'Memory',
35
+ reuse: 'Memory',
36
+ 'reuse-report': 'Memory',
37
+ 'recall-verify-report': 'Memory',
38
+ narrative: 'Memory',
39
+ 'gene-value': 'Memory',
40
+ 'memory-graph': 'Memory',
41
+ 'asset-log': 'Assets',
42
+ 'asset-trust': 'Assets',
43
+ 'asset-health': 'Assets',
44
+ 'asset-repair': 'Assets',
45
+ material: 'Assets',
46
+ recipe: 'Assets',
47
+ skill: 'Assets',
48
+ login: 'Hub',
49
+ logout: 'Hub',
50
+ phub: 'Hub',
51
+ sync: 'Hub',
52
+ publish: 'Hub',
53
+ fetch: 'Hub',
54
+ buy: 'Hub',
55
+ orders: 'Hub',
56
+ verify: 'Hub',
57
+ atp: 'Hub',
58
+ status: 'Operations',
59
+ daily: 'Operations',
60
+ workflow: 'Operations',
61
+ cycles: 'Operations',
62
+ trigger: 'Operations',
63
+ value: 'Operations',
64
+ retention: 'Operations',
65
+ replay: 'Operations',
66
+ 'rebuild-views': 'Operations',
67
+ 'issue-report': 'Operations',
68
+ dashboard: 'Tools',
69
+ webui: 'Tools',
70
+ 'trajectory-export': 'Tools',
71
+ migrate: 'Tools',
72
+ exec: 'Tools',
73
+ 'anti-gene-benchmark': 'Advanced',
74
+ 'anti-gene-rollout': 'Advanced',
75
+ 'model-compatibility-replay': 'Advanced',
76
+ 'reset-local-secret': 'Advanced',
77
+ 'skill-distill': 'Advanced',
78
+ 'skill-md-update': 'Advanced',
79
+ };
80
+ const COMMAND_HELP_LABELS = {
81
+ workflow: 'workflow status',
82
+ 'skill-distill': 'skill-distill (legacy; prefer `evolver recipe build`)',
83
+ };
84
+ const COMMAND_HELP_LABEL_COLUMN = 15;
85
+ export const COMMAND_HELP_MAX_WIDTH = 100;
86
+ export function commandsInGroup(group) {
87
+ return Object.keys(COMMAND_GROUPS).filter((command) => COMMAND_GROUPS[command] === group);
88
+ }
89
+ export function commandHelpLabel(command) {
90
+ return COMMAND_HELP_LABELS[command] ?? command;
91
+ }
92
+ function wrapEntries(entries, firstPrefix, continuationPrefix) {
93
+ const lines = [];
94
+ let current = firstPrefix;
95
+ let hasEntry = false;
96
+ entries.forEach((entry, index) => {
97
+ const separator = index === entries.length - 1 ? '' : ',';
98
+ const candidate = hasEntry ? `${current} ${entry}${separator}` : `${current}${entry}${separator}`;
99
+ if (hasEntry && candidate.length > COMMAND_HELP_MAX_WIDTH) {
100
+ lines.push(current);
101
+ current = `${continuationPrefix}${entry}${separator}`;
102
+ return;
103
+ }
104
+ current = candidate;
105
+ hasEntry = true;
106
+ });
107
+ if (hasEntry)
108
+ lines.push(current);
109
+ return lines;
110
+ }
111
+ export function renderCommandGroups() {
112
+ const continuationPrefix = ' '.repeat(COMMAND_HELP_LABEL_COLUMN);
113
+ return COMMAND_GROUP_ORDER.flatMap((group) => {
114
+ const commands = commandsInGroup(group);
115
+ if (commands.length === 0)
116
+ return [];
117
+ const firstPrefix = ` ${group}:`.padEnd(COMMAND_HELP_LABEL_COLUMN, ' ');
118
+ return wrapEntries(commands.map(commandHelpLabel), firstPrefix, continuationPrefix);
119
+ });
120
+ }
@@ -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;
@@ -95,6 +96,14 @@ export interface MaterialCycleDeps {
95
96
  watchStateWriter?: (path: string, state: MaterialCycleWatchState) => void;
96
97
  /** User home whose native runtime directories may contribute resumable session identities. */
97
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;
98
107
  }
99
108
  export declare function cycleIdForMaterial(materialId: string): string;
100
109
  export declare function cycleLockPathForMaterial(materialStorePath: string, materialId: string): string;
@@ -10,6 +10,8 @@ import { RUNTIME_CAPABILITY_MATRIX, runtimeCapabilities } from './runtimeCapabil
10
10
  import { parseRuntimeSessionSources } from './runtimeSessionSource.js';
11
11
  import { LocalMemoryGraph, resolveLocalMemoryUserIdentity } from './localMemoryGraph.js';
12
12
  import { makeCurriculumCapabilityGapsProvider } from './curriculumCapabilityGaps.js';
13
+ import { semanticIdfEnabled } from './semanticIdfConfig.js';
14
+ import { selectionFloorFromEnv, selectionGuardFromEnv, selectionPolicyFromEnv, } from './selectionPolicyConfig.js';
13
15
  const CYCLE_GROUP = 'cycle';
14
16
  const DEFAULT_LIMIT = 5;
15
17
  const DEFAULT_WATCH_IDLE_MS = 1000;
@@ -84,11 +86,11 @@ function makeCycleValidationHook(validationCmds, fallback, runSandboxedValidatio
84
86
  return fallback;
85
87
  return (task) => {
86
88
  const fallbackHook = fallback?.(task);
87
- return async (mutation, decision, cwd) => {
88
- const fallbackResult = fallbackHook ? await fallbackHook(mutation, decision, cwd) : null;
89
+ return async (mutation, decision, cwd, signal) => {
90
+ const fallbackResult = fallbackHook ? await fallbackHook(mutation, decision, cwd, signal) : null;
89
91
  if (fallbackResult && !fallbackResult.passed)
90
92
  return fallbackResult;
91
- const result = await runRequiredSandboxedValidation(task.validationCmds ?? validationCmds, cwd, {}, runSandboxedValidation);
93
+ const result = await runRequiredSandboxedValidation(task.validationCmds ?? validationCmds, cwd, { signal }, runSandboxedValidation);
92
94
  return { passed: result.passed, score: result.score };
93
95
  };
94
96
  };
@@ -189,6 +191,7 @@ function resolveMaterialCycleDeps(deps = {}) {
189
191
  personality: personalityStore,
190
192
  capabilityGaps: makeCurriculumCapabilityGapsProvider(),
191
193
  });
194
+ const selectionFloor = deps.selectionFloor ?? selectionFloorFromEnv();
192
195
  return {
193
196
  materialStore,
194
197
  consumer,
@@ -200,6 +203,10 @@ function resolveMaterialCycleDeps(deps = {}) {
200
203
  personality: personalityStore,
201
204
  memoryGraph,
202
205
  nativeSessionHome: deps.nativeSessionHome ?? homedir(),
206
+ disableSemanticIdf: deps.disableSemanticIdf ?? !semanticIdfEnabled(),
207
+ selectionPolicy: deps.selectionPolicy ?? selectionPolicyFromEnv(),
208
+ selectionGuard: deps.selectionGuard ?? selectionGuardFromEnv(),
209
+ ...(selectionFloor !== undefined ? { selectionFloor } : {}),
203
210
  };
204
211
  }
205
212
  export function cycleIdForMaterial(materialId) {
@@ -543,6 +550,10 @@ async function processMaterial(material, opts, deps) {
543
550
  review: deps.review,
544
551
  personality: deps.personality,
545
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 } : {}),
546
557
  ...(opts.validate ? { validate: opts.validate } : {}),
547
558
  ...(opts.agent ? { agent: opts.agent } : {}),
548
559
  ...(opts.git ? { git: opts.git } : {}),
@@ -6,7 +6,6 @@ interface ProxyCliModule {
6
6
  type ProxyCliImporter = () => Promise<ProxyCliModule>;
7
7
  export declare function runProxyCommand(argv: string[], importer?: ProxyCliImporter): Promise<number>;
8
8
  export type CommandHandler = (argv: string[]) => Promise<number>;
9
- /** Verbs dispatched asynchronously ahead of the synchronous runCli core. cli.ts drives its dispatch from this. */
10
9
  export declare const ASYNC_COMMANDS: Readonly<Record<string, CommandHandler>>;
11
10
  /** Verbs handled by the synchronous runCli core (read-only views + local ops). Kept in sync with runCli's switch
12
11
  * — the source of truth for these stays runCli; this list completes the surface for the registry contract. */
package/dist/dispatch.js CHANGED
@@ -32,14 +32,18 @@ import { runDashboardCommand } from './dashboard.js';
32
32
  import { runIssueReportCommand } from './issueReport.js';
33
33
  import { runAssetTrustCommand } from './assetTrust.js';
34
34
  import { runAssetHealthCommand } from './assetHealth.js';
35
+ import { runAssetRepairCommand } from './assetRepair.js';
35
36
  import { runV1FetchCompat, runV1RunCompat, runV1SolidifyCompat, runV1WebuiCompat, runV1ExecCompat } from './v1Compat.js';
36
37
  import { runWorkflowCommand } from './workflow.js';
38
+ import { runMemoryGraphCommand } from './memoryGraphOps.js';
39
+ import { runModelCompatibilityReplay } from './modelCompatibility.js';
40
+ import { SYNC_COMMAND_NAMES } from './commandCatalog.js';
37
41
  export async function runProxyCommand(argv, importer = () => import('@evomap/evolver-proxy/bin/evolver-proxy')) {
38
42
  const { runProxyCli } = await importer();
39
43
  return runProxyCli({ argv: ['proxy', ...argv] });
40
44
  }
41
45
  /** Verbs dispatched asynchronously ahead of the synchronous runCli core. cli.ts drives its dispatch from this. */
42
- export const ASYNC_COMMANDS = {
46
+ const ASYNC_COMMAND_TABLE = {
43
47
  migrate: runMigrate,
44
48
  'asset-log': runAssetLog,
45
49
  distill: runDistill,
@@ -68,6 +72,7 @@ export const ASYNC_COMMANDS = {
68
72
  'reuse-report': runReuseReportCommand,
69
73
  'recall-verify-report': runRecallVerifyReportCommand,
70
74
  doctor: runDoctorCommand,
75
+ 'memory-graph': runMemoryGraphCommand,
71
76
  phub: runPhubCommand,
72
77
  lifecycle: runLifecycleCommand,
73
78
  cycle: runCycleCommand,
@@ -79,6 +84,7 @@ export const ASYNC_COMMANDS = {
79
84
  'issue-report': runIssueReportCommand,
80
85
  'asset-trust': runAssetTrustCommand,
81
86
  'asset-health': runAssetHealthCommand,
87
+ 'asset-repair': runAssetRepairCommand,
82
88
  proxy: runProxyCommand,
83
89
  run: runV1RunCompat,
84
90
  solidify: runV1SolidifyCompat,
@@ -86,12 +92,12 @@ export const ASYNC_COMMANDS = {
86
92
  webui: runV1WebuiCompat,
87
93
  exec: runV1ExecCompat,
88
94
  workflow: runWorkflowCommand,
95
+ 'model-compatibility-replay': runModelCompatibilityReplay,
89
96
  };
97
+ export const ASYNC_COMMANDS = ASYNC_COMMAND_TABLE;
90
98
  /** Verbs handled by the synchronous runCli core (read-only views + local ops). Kept in sync with runCli's switch
91
99
  * — the source of truth for these stays runCli; this list completes the surface for the registry contract. */
92
- export const SYNC_COMMANDS = [
93
- 'status', 'cycles', 'trigger', 'value', 'narrative', 'retention', 'gene-value', 'replay', 'rebuild-views', 'reset-local-secret',
94
- ];
100
+ export const SYNC_COMMANDS = SYNC_COMMAND_NAMES;
95
101
  /** Every top-level verb `evolver` resolves to (async-dispatched ∪ runCli core). */
96
102
  export const ALL_COMMANDS = new Set([
97
103
  ...Object.keys(ASYNC_COMMANDS),
@@ -5,10 +5,12 @@
5
5
  // gene.distilled. It reuses the exact same `draftGeneCandidate` as `evolver ingest --distill`, so the one-shot and
6
6
  // the auto path never drift.
7
7
  //
8
- // WIRING (#117 / #106): this composition is ready to register on the resident daemon's ObserverBus, but the
9
- // PRODUCER of material.batch_ready (a daemon ingesting session dirs onto the same bus Ingestor) is a #106 item.
10
- // Until that lands, the composition is verified by its integration test (real bus + Ingestor dispatch) but not yet
11
- // wired into autoexec — a tracked dependency, not dead code. See distillObserver.test.ts.
8
+ // WIRING (#117 / #106): LIVE. `autoexec.ts` imports `resolveDistillObserver`, builds it inside
9
+ // `resolveDistillProducer`, registers it on the daemon's ObserverBus, drives `distill.tick()` every beat, and
10
+ // `kick()`s it on boot to drain any backlog left un-acked by a prior run. The `material.batch_ready` producer is
11
+ // the session-ingest tick on the same Ingestor. See distillObserver.test.ts for the isolated proof.
12
+ // (This said "not yet wired into autoexec" long after it was wired. A stale WIRING note is worse than none: it
13
+ // reads as a real gap, and a 2026-08 audit did misreport this composition as unwired on the strength of it.)
12
14
  import { assetstore, events, observers, signals, algo } from '@evomap/evolver-core';
13
15
  import { readFileSync } from 'node:fs';
14
16
  import { draftGeneCandidate } from './distillPrimitives.js';
@@ -47,9 +49,24 @@ export function makeDistillDrain(c) {
47
49
  for (const source of sources) {
48
50
  if (drafted >= draftLimit)
49
51
  return { ack: false, drafted };
50
- const candidate = draftGeneCandidate(source.turns, signals.extractSignals(source.turns), source.agent);
51
- if (!candidate)
52
+ const draftedCandidate = draftGeneCandidate(source.turns, signals.extractSignals(source.turns), source.agent);
53
+ if (!draftedCandidate)
52
54
  continue; // too thin to distill
55
+ // Carry producer-resolved task domain into draft signals_match so selection can score domain evidence.
56
+ // Only attach when the source already carries a resolved slug (fail-closed stamp at ingest).
57
+ let candidate = draftedCandidate;
58
+ if (source.taskDomain) {
59
+ try {
60
+ const domainToken = signals.taskDomainSignal(source.taskDomain);
61
+ const existingSignals = candidate.signals_match ?? [];
62
+ if (!existingSignals.includes(domainToken)) {
63
+ candidate = { ...candidate, signals_match: [...existingSignals, domainToken] };
64
+ }
65
+ }
66
+ catch {
67
+ // Invalid slug on the source — leave signals_match untouched (never invent).
68
+ }
69
+ }
53
70
  // Value/novelty gate (#117 improvement 3): drop thin / near-duplicate drafts BEFORE they reach the human
54
71
  // review queue. Ack the material (a deliberate skip, not a failure — nothing to retry).
55
72
  const { admission, existing } = await assessDraftAdmissionFromStore(c.store, candidate);
package/dist/doctor.d.ts CHANGED
@@ -38,6 +38,17 @@ export interface DoctorDeps {
38
38
  profile?: DoctorProfile;
39
39
  label?: string;
40
40
  memoryGraphStatus?: (env: Record<string, string | undefined>) => MemoryGraphOperatorStatus;
41
+ /** Runtime platform override (tests). Defaults to process.platform. */
42
+ platform?: NodeJS.Platform;
43
+ /** Test seam for the read-only legacy v1 Windows scheduled-task probe (#956). */
44
+ legacyWindowsTasks?: (options: {
45
+ env: NodeJS.ProcessEnv;
46
+ platform?: NodeJS.Platform;
47
+ }) => {
48
+ conclusive: boolean;
49
+ legacy: string[];
50
+ detail: string;
51
+ };
41
52
  }
42
53
  export interface EnvCatalogResult {
43
54
  profile: DoctorProfile;
package/dist/doctor.js CHANGED
@@ -7,6 +7,7 @@ import { isAbsolute, join } from 'node:path';
7
7
  import { bootstrap, events, issueReporter } from '@evomap/evolver-core';
8
8
  import { expandHomePath, parseEnvFile } from '@evomap/evolver-mcp';
9
9
  import { formatMemoryGraphOperatorStatus, loadMemoryGraphOperatorStatus } from './localMemoryGraph.js';
10
+ import { LEGACY_TASK_SKIP_ENV, probeLegacyWindowsDaemonTasks } from './windowsLegacyTaskCleanup.js';
10
11
  // Secrets that must live ONLY behind the EVOLVER_ENV_FILE pointer — never inlined into a runtime config (#217).
11
12
  const SECRET_KEYS = [
12
13
  'A2A_NODE_SECRET',
@@ -170,6 +171,20 @@ const ENV_CATALOG_DEFINITIONS = [
170
171
  requiredFor: 'reuse ranking tuning',
171
172
  defaultValue: 'enabled unless set to 0',
172
173
  },
174
+ {
175
+ name: 'EVOLVER_SEMANTIC_IDF',
176
+ group: 'autoexec-selection',
177
+ purpose: 'Emergency rollback for trusted-corpus IDF semantic weighting.',
178
+ requiredFor: 'selection ranking rollout',
179
+ defaultValue: 'enabled unless set to 0',
180
+ },
181
+ {
182
+ name: 'EVOLVER_SELECTION_POLICY',
183
+ group: 'autoexec-selection',
184
+ purpose: 'Controls plateau exploration: engine-health, UCB1 shadow, or explicit UCB1 canary.',
185
+ requiredFor: 'selection exploration rollout',
186
+ defaultValue: 'engine-health',
187
+ },
173
188
  {
174
189
  name: 'EVOLVER_REUSE_MODE',
175
190
  group: 'autoexec-reuse',
@@ -300,8 +315,9 @@ const ENV_CATALOG_DEFINITIONS = [
300
315
  {
301
316
  name: 'EVOLVER_SESSION_SOURCE',
302
317
  group: 'trajectory-export',
303
- purpose: 'Runtime session source selector.',
304
- requiredFor: 'runtime adapter filtering',
318
+ purpose: 'Legacy V1 session collector selector; ignored by V2 runtime behavior, detected only for migration, and has no one-to-one replacement.',
319
+ requiredFor: 'none; review explicit runtime discovery or transcript directories before removing',
320
+ defaultValue: 'ignored',
305
321
  },
306
322
  {
307
323
  name: 'EVOLVER_TRAJECTORY_INCLUDE_UNMARKED',
@@ -393,9 +409,9 @@ const ENV_CATALOG_DEFINITIONS = [
393
409
  {
394
410
  name: 'EVOLVER_ATP',
395
411
  group: 'marketplace-atp',
396
- purpose: 'Controls ATP marketplace/payment feature surface.',
397
- requiredFor: 'ATP flows',
398
- defaultValue: 'off unless explicitly enabled',
412
+ purpose: 'Legacy V1 merchant-agent mode; ignored by V2 runtime behavior, detected only for migration, and must not be mapped to buyer auto-spend consent.',
413
+ requiredFor: 'none; review the missing merchant workflow before removing',
414
+ defaultValue: 'ignored',
399
415
  },
400
416
  {
401
417
  name: 'EVOLVER_ATP_AUTOBUY',
@@ -454,13 +470,35 @@ const ENV_CATALOG_DEFINITIONS = [
454
470
  group: 'self-update',
455
471
  purpose: 'Controls self-update behavior.',
456
472
  requiredFor: 'operator-controlled proxy update rollout',
457
- defaultValue: 'off unless explicitly enabled',
473
+ defaultValue: 'auto unless explicitly disabled (gated by supervisor attestation; default auto degrades to off without it, after a one-shot first-run bootstrap attempt)',
474
+ },
475
+ {
476
+ name: 'EVOLVER_SELF_BOOTSTRAP',
477
+ group: 'self-update',
478
+ purpose: 'Kill switch for the first-run supervision bootstrap of unsupervised startups.',
479
+ requiredFor: 'opting out of automatic service registration',
480
+ defaultValue: 'on (exact 0 or off disables)',
481
+ },
482
+ {
483
+ name: 'EVOLVER_BOOTSTRAP_MIGRATION',
484
+ group: 'self-update',
485
+ purpose: 'Kill switch for the one-time npm/JS → standalone binary migration attempted by unsupervised startups.',
486
+ requiredFor: 'opting out of automatic standalone binary migration',
487
+ defaultValue: 'on (exact 0 or off disables)',
488
+ },
489
+ {
490
+ name: 'EVOLVER_BOOTSTRAP_MIGRATION_VERSION',
491
+ group: 'self-update',
492
+ purpose: 'Target version override for the one-time standalone binary migration.',
493
+ requiredFor: 'pinning the migrated standalone binary version',
494
+ defaultValue: 'current package version',
458
495
  },
459
496
  {
460
497
  name: 'EVOLVER_SELF_UPDATE_PUBLIC_KEY',
461
498
  group: 'self-update',
462
499
  purpose: 'Public key used to verify self-update artifacts.',
463
500
  requiredFor: 'self-update verification',
501
+ defaultValue: 'built-in official v2-beta release key',
464
502
  },
465
503
  {
466
504
  name: 'EVOLVER_SELF_UPDATE_SUPERVISOR',
@@ -486,6 +524,9 @@ const POINTER_RE = /EVOLVER_ENV_FILE"?\s*[:=]\s*"([^"]+)"/;
486
524
  /** Loopback hosts a NO_PROXY entry must EXACTLY be to cover local IPC/proxy ('*' = bypass all). Exact-entry match,
487
525
  * not substring, so `127.0.0.10` / `notlocalhost.com` do not count (#279 Bugbot). */
488
526
  const LOOPBACK_ENTRIES = new Set(['127.0.0.1', 'localhost', '::1', '[::1]', '*']);
527
+ // Release asset names installed by the one-time npm/JS → standalone migration (mirrors evolver-proxy
528
+ // releaseAssetName; kept dependency-free so doctor stays read-only and self-contained).
529
+ const MIGRATION_BINARY_ASSET_NAMES = ['evolver-darwin-arm64', 'evolver-darwin-x64', 'evolver-linux-arm64', 'evolver-linux-x64', 'evolver-windows-x64.exe'];
489
530
  /**
490
531
  * Run the read-only doctor checks. Pure given its (injectable) deps — no config mutation, no env-file load into the
491
532
  * process. Returns the check list; the CLI formats + sets the exit code.
@@ -631,6 +672,17 @@ export function runDoctorChecks(deps = {}) {
631
672
  else {
632
673
  checks.push({ name: 'no-proxy-loopback', status: 'warn', detail: 'a system proxy is set but NO_PROXY lacks 127.0.0.1/localhost — local IPC/LLM-proxy traffic may be intercepted; add them to NO_PROXY' });
633
674
  }
675
+ // 4. self-update-migration: read-only view of the one-time npm/JS → standalone migration — the
676
+ // EVOLVER_BOOTSTRAP_MIGRATION switch state and any migrated binary already under <home>/bin.
677
+ {
678
+ const migrationSwitch = effectiveEnv['EVOLVER_BOOTSTRAP_MIGRATION']?.trim();
679
+ const switchState = migrationSwitch === '0' || migrationSwitch === 'off' ? 'disabled (exact 0/off)' : 'on';
680
+ const binDir = join(events.evomapHome(effectiveEnv), 'bin');
681
+ const installed = MIGRATION_BINARY_ASSET_NAMES.filter((name) => exists(join(binDir, name)));
682
+ checks.push(installed.length > 0
683
+ ? { name: 'self-update-migration', status: 'pass', detail: `EVOLVER_BOOTSTRAP_MIGRATION ${switchState}; migrated standalone binary present: ${installed.map((name) => redact(join(binDir, name))).join(', ')}` }
684
+ : { name: 'self-update-migration', status: 'pass', detail: `EVOLVER_BOOTSTRAP_MIGRATION ${switchState}; no migrated standalone binary under ${redact(binDir)} (the npm/JS first-run migration installs it there)` });
685
+ }
634
686
  if (deps.profile === 'private-runtime') {
635
687
  checks.push(...privateRuntimeChecks(env, envFileValues, envFileReadiness));
636
688
  }
@@ -645,6 +697,29 @@ export function runDoctorChecks(deps = {}) {
645
697
  catch {
646
698
  checks.push({ name: 'memory-graph', status: 'warn', detail: 'state=degraded corrupt=1 oversized_lines=0 oversized_files=0 archives=0' });
647
699
  }
700
+ // 5. windows-legacy-tasks (#956): read-only probe for legacy V1 scheduled-task residue
701
+ // (win32 only). A detected residue warns with the manual fix; an INCONCLUSIVE probe
702
+ // also warns — it must never be reported as a confirmed-negative pass.
703
+ if ((deps.platform ?? process.platform) === 'win32') {
704
+ try {
705
+ const probe = (deps.legacyWindowsTasks ?? probeLegacyWindowsDaemonTasks)({
706
+ env: effectiveEnv,
707
+ platform: 'win32',
708
+ });
709
+ if (!probe.conclusive) {
710
+ checks.push({ name: 'windows-legacy-tasks', status: 'warn', detail: `probe inconclusive (${probe.detail}); legacy v1 residue cannot be ruled out — run evolver lifecycle cleanup-legacy-tasks --dry-run, or set ${LEGACY_TASK_SKIP_ENV}=1 to silence the automatic probes on restricted hosts` });
711
+ }
712
+ else if (probe.legacy.length > 0) {
713
+ checks.push({ name: 'windows-legacy-tasks', status: 'warn', detail: `detected legacy v1 scheduled task(s): ${probe.legacy.join(', ')} — run evolver lifecycle cleanup-legacy-tasks` });
714
+ }
715
+ else {
716
+ checks.push({ name: 'windows-legacy-tasks', status: 'pass', detail: 'no legacy v1-style scheduled tasks registered' });
717
+ }
718
+ }
719
+ catch {
720
+ checks.push({ name: 'windows-legacy-tasks', status: 'warn', detail: `probe inconclusive (internal error); legacy v1 residue cannot be ruled out — run evolver lifecycle cleanup-legacy-tasks --dry-run, or set ${LEGACY_TASK_SKIP_ENV}=1 to silence the automatic probes on restricted hosts` });
721
+ }
722
+ }
648
723
  return checks;
649
724
  }
650
725
  export function buildEnvCatalog(deps = {}) {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { events, ops, hub as hubNs } from '@evomap/evolver-core';
2
2
  import { assetstore } from '@evomap/evolver-core';
3
+ import { type ImportV1Options } from './migrate/v1Import.js';
3
4
  import { type LifecyclePaths } from './lifecycle.js';
4
5
  import { type NonGitWorkspaceNoticeOptions } from './nonGitWorkspaceNotice.js';
5
6
  import { type IngestDeps } from './sessionIngest.js';
@@ -35,8 +36,9 @@ export declare function runResetLocalSecret(argv: readonly string[], opts?: Rese
35
36
  export declare function rebuildViews(opts?: RebuildOptions): {
36
37
  rebuilt: string[];
37
38
  };
39
+ export type MigrateDeps = Pick<ImportV1Options, 'disposeTestHook' | 'outputRootTestHook'>;
38
40
  /** migrate import-v1 | migrate env | migrate oauth — V1→V2 migration tools. */
39
- export declare function runMigrate(argv: readonly string[]): Promise<number>;
41
+ export declare function runMigrate(argv: readonly string[], deps?: MigrateDeps): Promise<number>;
40
42
  /** One-line summary of an asset for `asset-log` (pure, testable). */
41
43
  export declare function formatAssetLine(a: assetstore.AssetRecord): string;
42
44
  export interface AssetLogDeps {
@@ -158,6 +160,8 @@ export interface InjectDeps {
158
160
  readHookInput?: () => string | undefined;
159
161
  /** Test seam for the hook-time proxy daemon recovery path. Default is maybeAutoRestartProxyForSessionStart. */
160
162
  ensureProxyAutostart?: () => Promise<void>;
163
+ /** Test seam for the hook-time legacy v1 Windows scheduled-task sweep (#956). */
164
+ legacyTaskSweep?: () => void;
161
165
  /** Test seam for the non-git workspace notice. Production uses cwd + ~/.evomap throttle state. */
162
166
  nonGitNotice?: NonGitWorkspaceNoticeOptions;
163
167
  }