@evomap/evolver-cli 2.0.31 → 2.0.33

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.
@@ -84,6 +84,12 @@ export declare function resolveCandidateScopeFacets(candidate: algo.GeneCandidat
84
84
  };
85
85
  export declare function parseDistillOutput(stdout: string): unknown | null;
86
86
  export declare function asGeneCandidate(value: unknown): algo.GeneCandidate | null;
87
+ /**
88
+ * Stamp the model this distill spawn actually used onto the candidate when the LLM omitted it.
89
+ * EVOLVE_DISTILL_MODEL is the runner `--model` flag and is not in detectModelName's host-CLI list
90
+ * (that list is the node's execution model). 'unknown' is not a coordinate.
91
+ */
92
+ export declare function attachDistillModelName(candidate: algo.GeneCandidate, env: NodeJS.ProcessEnv): algo.GeneCandidate;
87
93
  export declare function jaccardDuplicate(candidate: algo.GeneCandidate, existing: readonly algo.ExistingGeneRef[], threshold?: number): string | null;
88
94
  export declare function normalizeValidation(candidate: algo.GeneCandidate, cwd?: string): {
89
95
  candidate: algo.GeneCandidate;
@@ -324,6 +324,8 @@ export function asGeneCandidate(value) {
324
324
  ...(Array.isArray(value['validation']) ? { validation: value['validation'].map(String) } : {}),
325
325
  // K_auto coordinates: pass through when the model supplies them. intakeGene normalizes + fills honest
326
326
  // defaults for any missing coordinate so forward genes can enter strict K_auto without inventing claims.
327
+ ...(typeof value['model_name'] === 'string' && value['model_name'].trim() && value['model_name'].trim() !== 'unknown'
328
+ ? { model_name: value['model_name'].trim().slice(0, 100) } : {}),
327
329
  ...(value['claims'] !== undefined ? { claims: value['claims'] } : {}),
328
330
  ...(value['scope'] !== undefined ? { scope: value['scope'] } : {}),
329
331
  ...(value['runtime_profile'] !== undefined ? { runtime_profile: value['runtime_profile'] } : {}),
@@ -333,6 +335,20 @@ export function asGeneCandidate(value) {
333
335
  generation_meta: { source: 'distilled' },
334
336
  };
335
337
  }
338
+ /**
339
+ * Stamp the model this distill spawn actually used onto the candidate when the LLM omitted it.
340
+ * EVOLVE_DISTILL_MODEL is the runner `--model` flag and is not in detectModelName's host-CLI list
341
+ * (that list is the node's execution model). 'unknown' is not a coordinate.
342
+ */
343
+ export function attachDistillModelName(candidate, env) {
344
+ const existing = typeof candidate.model_name === 'string' ? candidate.model_name.trim() : '';
345
+ if (existing && existing !== 'unknown')
346
+ return candidate;
347
+ const distill = (env['EVOLVE_DISTILL_MODEL'] ?? '').trim();
348
+ if (!distill || distill === 'unknown')
349
+ return candidate;
350
+ return { ...candidate, model_name: distill.slice(0, 100) };
351
+ }
336
352
  export function jaccardDuplicate(candidate, existing, threshold = DEFAULT_DUP_JACCARD) {
337
353
  const a = new Set((candidate.signals_match ?? []).map((s) => String(s).toLowerCase()).filter(Boolean));
338
354
  if (a.size === 0)
@@ -571,13 +587,13 @@ export async function autoDistillLlm(options) {
571
587
  if (scoped.rewrites.length > 0) {
572
588
  console.warn(`[AutoDistill] resolved scope facet(s) against store vocabulary: ${scoped.rewrites.map((r) => `${r.from} -> ${r.to}`).join(', ')}`);
573
589
  }
574
- const normalized = normalizeValidation(scoped.candidate, cwd).candidate;
590
+ const normalized = attachDistillModelName(normalizeValidation(scoped.candidate, cwd).candidate, env);
575
591
  const duplicate = jaccardDuplicate(normalized, existing, envFloat(env, 'EVOLVER_AUTO_DISTILL_LLM_DUP_JACCARD', DEFAULT_DUP_JACCARD));
576
592
  if (duplicate) {
577
593
  patchState(statePath, input.dataHash, { failed_attempts_inc: true }, hashCap);
578
594
  return { ok: false, mode, reason: 'near_duplicate', dataHash: input.dataHash };
579
595
  }
580
- const intake = algo.intakeGene(normalized, existing);
596
+ const intake = algo.intakeGene(normalized, existing, { env });
581
597
  if (!intake.ok || !intake.gene) {
582
598
  patchState(statePath, input.dataHash, { failed_attempts_inc: true }, hashCap);
583
599
  return { ok: false, mode, reason: 'validation_failed', dataHash: input.dataHash };
@@ -14,7 +14,7 @@ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from '
14
14
  import { basename, dirname, join } from 'node:path';
15
15
  import { algo, assetstore, events, hub, signals } from '@evomap/evolver-core';
16
16
  import { adapterForPath } from '@evomap/evolver-runtime-adapters';
17
- import { asGeneCandidate, parseDistillOutput, normalizeValidation, jaccardDuplicate, resolveDistillRunner, p3Decide, } from './autoDistillLlm.js';
17
+ import { asGeneCandidate, parseDistillOutput, normalizeValidation, jaccardDuplicate, resolveDistillRunner, attachDistillModelName, p3Decide, } from './autoDistillLlm.js';
18
18
  import { runRequiredSandboxedValidation } from './requiredSandboxValidation.js';
19
19
  const DEFAULT_MIN_TURNS = 2;
20
20
  const DEFAULT_MIN_CHARS = 200;
@@ -160,14 +160,14 @@ export async function autoDistillTranscript(options) {
160
160
  if (!candidate0)
161
161
  return { ok: false, mode, reason: 'no_gene_in_response' };
162
162
  const existing = existingGeneRefs(await options.store.list('Gene', 10_000));
163
- const normalized = normalizeValidation(candidate0, cwd).candidate;
163
+ const normalized = attachDistillModelName(normalizeValidation(candidate0, cwd).candidate, env);
164
164
  // Near-duplicate guard (mirrors autoDistillLlm): intakeGene only rejects when an existing gene's signals are a
165
165
  // SUPERSET of the candidate's, so a highly-similar but non-subset signal set would otherwise slip through and
166
166
  // emit a redundant gene.distilled. Jaccard catches those before intake.
167
167
  const duplicate = jaccardDuplicate(normalized, existing);
168
168
  if (duplicate)
169
169
  return { ok: false, mode, reason: 'near_duplicate', candidate: normalized };
170
- const intake = algo.intakeGene(normalized, existing);
170
+ const intake = algo.intakeGene(normalized, existing, { env });
171
171
  if (!intake.ok || !intake.gene)
172
172
  return { ok: false, mode, reason: 'validation_failed', candidate: normalized };
173
173
  const validation = await runRequiredSandboxedValidation(intake.gene.validation, cwd, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evomap/evolver-cli",
3
- "version": "2.0.31",
3
+ "version": "2.0.33",
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.31",
27
- "@evomap/evolver-adapter-public": "2.0.31",
28
- "@evomap/evolver-mcp": "2.0.31",
29
- "@evomap/evolver-proxy": "2.0.31",
30
- "@evomap/evolver-runtime-adapters": "2.0.31",
31
- "@evomap/evolver-webui": "2.0.31"
26
+ "@evomap/evolver-core": "2.0.33",
27
+ "@evomap/evolver-adapter-public": "2.0.33",
28
+ "@evomap/evolver-mcp": "2.0.33",
29
+ "@evomap/evolver-proxy": "2.0.33",
30
+ "@evomap/evolver-runtime-adapters": "2.0.33",
31
+ "@evomap/evolver-webui": "2.0.33"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",