@evomap/evolver-cli 2.0.0-beta.0 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/antiGeneBenchmark.js +12 -0
- package/dist/antiGeneEvidence.d.ts +15 -0
- package/dist/antiGeneEvidence.js +49 -0
- package/dist/antiGeneRollout.d.ts +3 -1
- package/dist/antiGeneRollout.js +16 -2
- package/dist/atp.js +4 -2
- package/dist/autoDistillLlm.js +4 -1
- package/dist/autoexec.d.ts +4 -1
- package/dist/autoexec.js +23 -5
- package/dist/cli.js +12 -5
- package/dist/cliContracts.js +8 -2
- package/dist/cliLifecycle.d.ts +7 -0
- package/dist/cliLifecycle.js +9 -0
- package/dist/cycleConsumer.d.ts +59 -1
- package/dist/cycleConsumer.js +382 -5
- package/dist/dashboard.d.ts +21 -0
- package/dist/dashboard.js +173 -0
- package/dist/dispatch.d.ts +1 -0
- package/dist/dispatch.js +27 -2
- package/dist/distillObserver.js +2 -2
- package/dist/distillPrimitives.d.ts +1 -1
- package/dist/distillPrimitives.js +29 -2
- package/dist/doctor.js +15 -3
- package/dist/index.d.ts +6 -1
- package/dist/index.js +251 -30
- package/dist/lifecycle.js +6 -2
- package/dist/login.d.ts +20 -4
- package/dist/login.js +58 -8
- package/dist/materialPackage.d.ts +52 -0
- package/dist/materialPackage.js +404 -0
- package/dist/materialSnapshot.d.ts +30 -0
- package/dist/materialSnapshot.js +148 -0
- package/dist/memoryEventMirror.d.ts +23 -0
- package/dist/memoryEventMirror.js +140 -0
- package/dist/migrate/fieldMap.js +25 -0
- package/dist/nonGitWorkspaceNotice.d.ts +24 -0
- package/dist/nonGitWorkspaceNotice.js +122 -0
- package/dist/proxyToken.d.ts +10 -0
- package/dist/proxyToken.js +80 -0
- package/dist/recipe.d.ts +10 -2
- package/dist/recipe.js +349 -7
- package/dist/reuseReport.js +16 -16
- package/dist/runtimeSessionSource.d.ts +10 -0
- package/dist/runtimeSessionSource.js +32 -5
- package/dist/setupHooks.d.ts +6 -1
- package/dist/setupHooks.js +5 -2
- package/dist/skill2gep.d.ts +38 -9
- package/dist/skill2gep.js +147 -14
- package/dist/skillDistill.d.ts +1 -0
- package/dist/skillDistill.js +4 -4
- package/dist/skillFetch.d.ts +18 -0
- package/dist/skillFetch.js +391 -0
- package/dist/solo/mode.js +5 -0
- package/dist/sync.d.ts +26 -0
- package/dist/sync.js +988 -0
- package/dist/trajectoryExport.js +23 -12
- package/dist/v1Compat.d.ts +24 -0
- package/dist/v1Compat.js +249 -0
- package/dist/version.js +2 -0
- package/package.json +8 -6
|
@@ -101,11 +101,23 @@ function readSuite(path) {
|
|
|
101
101
|
function pct(value) {
|
|
102
102
|
return `${(value * 100).toFixed(0)}%`;
|
|
103
103
|
}
|
|
104
|
+
function overblockSuspects(report) {
|
|
105
|
+
return report.overblockedAntiGenes
|
|
106
|
+
.map((row) => `${row.antiGeneId} count=${row.count} tasks=${row.taskIds.join(',')}`)
|
|
107
|
+
.join('; ');
|
|
108
|
+
}
|
|
104
109
|
function printReport(report, log) {
|
|
105
110
|
log(`anti-gene-benchmark [${report.suite}]: ${report.tasks} task(s) -> ${report.verdict}`);
|
|
106
111
|
log(` baseline failures=${report.baseline.failures}/${report.baseline.n} (${pct(report.baseline.failureRate)}) repeated=${report.baseline.repeatedFailures}`);
|
|
107
112
|
log(` antiGene failures=${report.antiGene.failures}/${report.antiGene.n} (${pct(report.antiGene.failureRate)}) repeated=${report.antiGene.repeatedFailures} warnings=${report.antiGene.observedWarnings}`);
|
|
108
113
|
log(` delta failure=${(report.failureDelta * 100).toFixed(1)}pt missingWarnings=${report.missingExpectedWarnings} overblocked=${report.overblocked}`);
|
|
114
|
+
if (report.overblockedAntiGenes.length > 0) {
|
|
115
|
+
log(` overblock suspects: ${overblockSuspects(report)}`);
|
|
116
|
+
log(' note: review these AntiGenes before broader rollout; downgrade or reject manually if overblock repeats.');
|
|
117
|
+
}
|
|
118
|
+
if (report.missingExpectedWarnings > 0) {
|
|
119
|
+
log(' note: expected AntiGene warnings are missing; check approved AntiGene review state, --assets/--review-dir, expectedAntiWarnings, and signal triggers.');
|
|
120
|
+
}
|
|
109
121
|
}
|
|
110
122
|
function jsonReplacer(_key, value) {
|
|
111
123
|
return typeof value === 'number' && !Number.isFinite(value) ? String(value) : value;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { assetstore } from '@evomap/evolver-core';
|
|
2
|
+
type AntiGeneEvidenceStrength = 'strong' | 'weak';
|
|
3
|
+
type AntiGeneReviewState = 'approved' | 'quarantined' | 'rejected' | 'unreviewed';
|
|
4
|
+
export interface AntiGeneEvidenceSummary {
|
|
5
|
+
failureCount: number | null;
|
|
6
|
+
sourceClusterCount: number;
|
|
7
|
+
evidenceCapsuleCount: number;
|
|
8
|
+
observedDecisionCount: number;
|
|
9
|
+
strength: AntiGeneEvidenceStrength;
|
|
10
|
+
weakReasons: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function summarizeAntiGeneEvidence(asset: assetstore.AssetRecord, observedDecisionCount?: number): AntiGeneEvidenceSummary;
|
|
13
|
+
export declare function formatAntiGeneEvidenceSummary(summary: AntiGeneEvidenceSummary): string;
|
|
14
|
+
export declare function formatAntiGeneEvidenceAction(summary: AntiGeneEvidenceSummary, state: AntiGeneReviewState): string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function finiteNumber(value) {
|
|
2
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
3
|
+
return value;
|
|
4
|
+
if (typeof value === 'string' && value.trim().length > 0) {
|
|
5
|
+
const n = Number(value);
|
|
6
|
+
if (Number.isFinite(n))
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
function arrayCount(value) {
|
|
12
|
+
return Array.isArray(value) ? value.length : 0;
|
|
13
|
+
}
|
|
14
|
+
export function summarizeAntiGeneEvidence(asset, observedDecisionCount = 0) {
|
|
15
|
+
const failureCount = finiteNumber(asset['failure_count']);
|
|
16
|
+
const sourceClusterCount = arrayCount(asset['source_clusters']);
|
|
17
|
+
const evidenceCapsuleCount = arrayCount(asset['evidence_capsules']);
|
|
18
|
+
const weakReasons = [];
|
|
19
|
+
if (failureCount === null || failureCount < 2)
|
|
20
|
+
weakReasons.push('failure_count<2');
|
|
21
|
+
if (sourceClusterCount < 1)
|
|
22
|
+
weakReasons.push('source_clusters=0');
|
|
23
|
+
if (evidenceCapsuleCount < 1)
|
|
24
|
+
weakReasons.push('evidence_capsules=0');
|
|
25
|
+
return {
|
|
26
|
+
failureCount,
|
|
27
|
+
sourceClusterCount,
|
|
28
|
+
evidenceCapsuleCount,
|
|
29
|
+
observedDecisionCount: Math.max(0, Math.floor(observedDecisionCount)),
|
|
30
|
+
strength: weakReasons.length === 0 ? 'strong' : 'weak',
|
|
31
|
+
weakReasons,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function formatAntiGeneEvidenceSummary(summary) {
|
|
35
|
+
const failureCount = summary.failureCount === null ? '-' : String(summary.failureCount);
|
|
36
|
+
const base = `failures=${failureCount} clusters=${summary.sourceClusterCount} evidence=${summary.evidenceCapsuleCount} evidence_quality=${summary.strength}`;
|
|
37
|
+
if (summary.strength === 'strong')
|
|
38
|
+
return base;
|
|
39
|
+
return `${base} warning=weak evidence weak_reason=${summary.weakReasons.join('+')}`;
|
|
40
|
+
}
|
|
41
|
+
export function formatAntiGeneEvidenceAction(summary, state) {
|
|
42
|
+
if (state === 'approved')
|
|
43
|
+
return 'suggested_action=monitor_impact';
|
|
44
|
+
if (state === 'rejected')
|
|
45
|
+
return 'suggested_action=keep_rejected_unless_new_evidence';
|
|
46
|
+
if (summary.strength === 'weak')
|
|
47
|
+
return 'suggested_action=reject_or_defer approve_override=--allow-weak-evidence';
|
|
48
|
+
return 'suggested_action=approve_after_manual_review';
|
|
49
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { assetstore, benchmark, events } from '@evomap/evolver-core';
|
|
1
|
+
import { assetstore, benchmark, events, exec } from '@evomap/evolver-core';
|
|
2
2
|
export interface AntiGeneRolloutCommandDeps {
|
|
3
3
|
store?: assetstore.AssetStoreProvider;
|
|
4
4
|
review?: assetstore.ReviewLedger;
|
|
5
5
|
readEvents?: (eventsPath?: string) => events.ReportEvent[];
|
|
6
6
|
makeExecute?: benchmark.AntiGeneRolloutExecuteFactory;
|
|
7
|
+
agent?: exec.AgentRunner;
|
|
8
|
+
git?: exec.GitRunner;
|
|
7
9
|
now?: () => number;
|
|
8
10
|
log?: (line: string) => void;
|
|
9
11
|
}
|
package/dist/antiGeneRollout.js
CHANGED
|
@@ -84,11 +84,23 @@ function readSuite(path) {
|
|
|
84
84
|
function pct(value) {
|
|
85
85
|
return `${(value * 100).toFixed(0)}%`;
|
|
86
86
|
}
|
|
87
|
+
function overblockSuspects(report) {
|
|
88
|
+
return report.overblockedAntiGenes
|
|
89
|
+
.map((row) => `${row.antiGeneId} count=${row.count} tasks=${row.taskIds.join(',')}`)
|
|
90
|
+
.join('; ');
|
|
91
|
+
}
|
|
87
92
|
function printReport(report, log) {
|
|
88
93
|
log(`anti-gene-rollout [${report.suite}]: ${report.tasks} task(s) -> ${report.verdict}`);
|
|
89
94
|
log(` baseline failures=${report.baseline.failures}/${report.baseline.n} (${pct(report.baseline.failureRate)}) repeated=${report.baseline.repeatedFailures}`);
|
|
90
95
|
log(` antiGene failures=${report.antiGene.failures}/${report.antiGene.n} (${pct(report.antiGene.failureRate)}) repeated=${report.antiGene.repeatedFailures} warnings=${report.antiGene.observedWarnings}`);
|
|
91
96
|
log(` delta failure=${(report.failureDelta * 100).toFixed(1)}pt missingWarnings=${report.missingExpectedWarnings} overblocked=${report.overblocked}`);
|
|
97
|
+
if (report.overblockedAntiGenes.length > 0) {
|
|
98
|
+
log(` overblock suspects: ${overblockSuspects(report)}`);
|
|
99
|
+
log(' note: review these AntiGenes before broader rollout; downgrade or reject manually if overblock repeats.');
|
|
100
|
+
}
|
|
101
|
+
if (report.missingExpectedWarnings > 0) {
|
|
102
|
+
log(' note: expected AntiGene warnings are missing; check approved AntiGene review state, --assets/--review-dir, expectedAntiWarnings, and signal triggers.');
|
|
103
|
+
}
|
|
92
104
|
}
|
|
93
105
|
function jsonReplacer(_key, value) {
|
|
94
106
|
return typeof value === 'number' && !Number.isFinite(value) ? String(value) : value;
|
|
@@ -180,7 +192,7 @@ function validationCommand(commandLine, cwd) {
|
|
|
180
192
|
child.on('error', () => resolveCode(-1));
|
|
181
193
|
});
|
|
182
194
|
}
|
|
183
|
-
function liveMakeExecute(repo, runner, validation) {
|
|
195
|
+
function liveMakeExecute(repo, runner, validation, deps = {}) {
|
|
184
196
|
return ({ store, review }) => {
|
|
185
197
|
const validate = async (_mutation, _decision, cwd) => {
|
|
186
198
|
for (const command of validation) {
|
|
@@ -196,6 +208,8 @@ function liveMakeExecute(repo, runner, validation) {
|
|
|
196
208
|
review,
|
|
197
209
|
validate,
|
|
198
210
|
validationCmds: validation,
|
|
211
|
+
...(deps.agent ? { agent: deps.agent } : {}),
|
|
212
|
+
...(deps.git ? { git: deps.git } : {}),
|
|
199
213
|
});
|
|
200
214
|
};
|
|
201
215
|
}
|
|
@@ -259,7 +273,7 @@ export async function runAntiGeneRolloutCommand(argv, deps = {}) {
|
|
|
259
273
|
const store = deps.store ?? new assetstore.LocalJsonlProvider(assetsDir);
|
|
260
274
|
const review = deps.review ?? new assetstore.ReviewLedger(reviewDir, deps.now);
|
|
261
275
|
const eventsPath = flags.events ? resolve(flags.events) : join(mkdtempSync(join(tmpdir(), 'anti-gene-rollout-events-')), 'root_events.jsonl');
|
|
262
|
-
const makeExecute = deps.makeExecute ?? liveMakeExecute(resolve(flags.repo), flags.runner, suite.validation);
|
|
276
|
+
const makeExecute = deps.makeExecute ?? liveMakeExecute(resolve(flags.repo), flags.runner, suite.validation, deps);
|
|
263
277
|
const report = await benchmark.runAntiGeneRollout(suite, { store, review, makeExecute }, {
|
|
264
278
|
eventsPath,
|
|
265
279
|
now: deps.now,
|
package/dist/atp.js
CHANGED
|
@@ -2,7 +2,8 @@ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from '
|
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { dirname, join } from 'node:path';
|
|
4
4
|
import { events, mailbox } from '@evomap/evolver-core';
|
|
5
|
-
import {
|
|
5
|
+
import { loadEnvFileFromEnv } from '@evomap/evolver-mcp';
|
|
6
|
+
import { AtpHubClient, ATP_PROOF_STATUSES, ATP_ROLES, ATP_ROUTING_MODES, ATP_VERIFY_ACTIONS, ATP_VERIFY_MODES, connectPublicHub, globalFetchLike, resolveHubUrl, } from '@evomap/evolver-adapter-public';
|
|
6
7
|
export function parseBuyArgs(args) {
|
|
7
8
|
if (args.length === 0)
|
|
8
9
|
return { ok: false, error: 'buy requires <capabilities>: comma-separated list (e.g. code_review,bug_fix)' };
|
|
@@ -226,7 +227,8 @@ export async function runAtpCommand(argv) {
|
|
|
226
227
|
return (await runAtp(parsed.opts)).exitCode;
|
|
227
228
|
}
|
|
228
229
|
export function createAtpClientFromEnv(env = process.env) {
|
|
229
|
-
|
|
230
|
+
loadEnvFileFromEnv(env);
|
|
231
|
+
const hubUrl = resolveHubUrl(env);
|
|
230
232
|
const evomapDir = resolveAtpHome(env);
|
|
231
233
|
const resolvedSenderId = resolveAtpSenderId(env);
|
|
232
234
|
const senderId = () => resolvedSenderId;
|
package/dist/autoDistillLlm.js
CHANGED
|
@@ -259,7 +259,7 @@ export function asGeneCandidate(value) {
|
|
|
259
259
|
...(isRecord(value['constraints']) ? {
|
|
260
260
|
constraints: {
|
|
261
261
|
...(typeof value['constraints']['max_files'] === 'number' ? { max_files: value['constraints']['max_files'] } : {}),
|
|
262
|
-
// Only carry a NON-EMPTY
|
|
262
|
+
// Only carry a NON-EMPTY forbiddenPaths through. intakeGene defaults the field with `?? DEFAULT`,
|
|
263
263
|
// and nullish-coalescing does NOT replace an empty array — so an LLM-supplied `[]` would drop the
|
|
264
264
|
// default `.git`/`node_modules` guard on an autonomously-stored gene. Omit it so the default kicks in. (V1 parity.)
|
|
265
265
|
...(Array.isArray(value['constraints']['forbidden_paths']) && value['constraints']['forbidden_paths'].length > 0
|
|
@@ -267,6 +267,9 @@ export function asGeneCandidate(value) {
|
|
|
267
267
|
},
|
|
268
268
|
} : {}),
|
|
269
269
|
...(Array.isArray(value['validation']) ? { validation: value['validation'].map(String) } : {}),
|
|
270
|
+
// An LLM-distilled gene is distilled from prior capsule/session evidence (not a verified fail→pass trajectory,
|
|
271
|
+
// not a human-taught gene) → `distilled` per V1 #302 classifyProvenance. intakeGene normalizes + validates it.
|
|
272
|
+
generation_meta: { source: 'distilled' },
|
|
270
273
|
};
|
|
271
274
|
}
|
|
272
275
|
export function jaccardDuplicate(candidate, existing, threshold = DEFAULT_DUP_JACCARD) {
|
package/dist/autoexec.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { events, assetstore, algo, exec, hooks, material as materialNs, verify, hub as hubNs } from '@evomap/evolver-core';
|
|
2
2
|
import { type Beat } from './daemonLoop.js';
|
|
3
3
|
import { connectPublicHub, ReuseCache } from '@evomap/evolver-adapter-public';
|
|
4
|
-
import type { FetchLike, OfflinePermitStore, OutcomeReport, OutcomeReceipt } from '@evomap/evolver-adapter-public';
|
|
4
|
+
import type { FetchLike, MemoryGraphEventReceipt, MemoryGraphEventReport, OfflinePermitStore, OutcomeReport, OutcomeReceipt } from '@evomap/evolver-adapter-public';
|
|
5
5
|
import { type EvolverProxyClient } from '@evomap/evolver-mcp';
|
|
6
|
+
import { type MemoryEventMirrorWiring } from './memoryEventMirror.js';
|
|
6
7
|
import { resolveDistillObserver } from './distillObserver.js';
|
|
7
8
|
import { type AutoDistillLlmResult, type LlmDistillRunner } from './autoDistillLlm.js';
|
|
8
9
|
import { type AutoDistillAntiGeneMode, type AutoDistillAntiGeneResult } from './autoDistillAntiGene.js';
|
|
@@ -62,6 +63,7 @@ export declare function makeInjectEmitter(ingestor?: events.Ingestor): {
|
|
|
62
63
|
/** A hub the link can report outcomes to. Structural (not the concrete class) so tests can fake it. */
|
|
63
64
|
export type OutcomeReportingHub = hubNs.HubCapability & {
|
|
64
65
|
recordOutcome(report: OutcomeReport): Promise<OutcomeReceipt>;
|
|
66
|
+
recordMemoryEvent?(report: MemoryGraphEventReport): Promise<MemoryGraphEventReceipt>;
|
|
65
67
|
recordReuseResult?(report: hubNs.ReuseResultReport): Promise<hubNs.ReuseResultReceipt>;
|
|
66
68
|
};
|
|
67
69
|
/** The composed hub wiring: the reuse seam plus the matching outcome reporter that closes the loop. */
|
|
@@ -133,6 +135,7 @@ export declare function makeHubLink(cap: OutcomeReportingHub, ingestor?: events.
|
|
|
133
135
|
*/
|
|
134
136
|
export declare function resolveHubLink(env?: NodeJS.ProcessEnv, ingestor?: events.Ingestor, connectHub?: PublicHubConnector): HubLink | undefined;
|
|
135
137
|
export declare function resolveHubQuestionLink(env?: NodeJS.ProcessEnv, connectHub?: PublicHubConnector): HubQuestionLink | undefined;
|
|
138
|
+
export declare function resolveMemoryEventMirror(env?: NodeJS.ProcessEnv, connectHub?: PublicHubConnector): MemoryEventMirrorWiring;
|
|
136
139
|
export declare function offlinePermitDir(env?: NodeJS.ProcessEnv): string;
|
|
137
140
|
export declare function makeOfflineSolidifyPermitGate(permits: Pick<OfflinePermitStore, 'consumeOfflinePermit'>): algo.SolidifyPermitGate;
|
|
138
141
|
export declare function resolveSolidifyPermitGate(env?: NodeJS.ProcessEnv, connectHub?: PublicHubPermitConnector, opts?: SolidifyPermitResolverOptions): algo.SolidifyPermitGate | undefined;
|
package/dist/autoexec.js
CHANGED
|
@@ -7,11 +7,12 @@ import { readdirSync, readFileSync, writeFileSync, renameSync, mkdirSync, exists
|
|
|
7
7
|
import { join, dirname } from 'node:path';
|
|
8
8
|
import { events, assetstore, algo, exec, ops, observers, hooks, material as materialNs, util, verify, hub as hubNs, daemon as daemonNs, personality } from '@evomap/evolver-core';
|
|
9
9
|
import { startResidentLoop } from './daemonLoop.js';
|
|
10
|
-
import { connectPublicHub, createSolidifyPermitCheck, ReuseCache, reuseBeforeSolve } from '@evomap/evolver-adapter-public';
|
|
10
|
+
import { connectPublicHub, createSolidifyPermitCheck, ReuseCache, reuseBeforeSolve, resolveConfiguredHubUrl, resolveHubUrl } from '@evomap/evolver-adapter-public';
|
|
11
11
|
import { loadEnvFileFromEnv, proxyClientFromEnv } from '@evomap/evolver-mcp';
|
|
12
12
|
import { resolveValueDigestObserver } from './valueDigest.js';
|
|
13
13
|
import { resolveReflectionObserver } from './reflectionObserver.js';
|
|
14
14
|
import { resolveCursorRewriteObserver } from './cursorRewrite.js';
|
|
15
|
+
import { resolveMemoryEventMirrorObserver } from './memoryEventMirror.js';
|
|
15
16
|
import { resolveDistillObserver } from './distillObserver.js';
|
|
16
17
|
import { resolveAutoDistillLlm } from './autoDistillLlm.js';
|
|
17
18
|
import { resolveAutoDistillAntiGene as resolveAntiGeneDistill } from './autoDistillAntiGene.js';
|
|
@@ -433,7 +434,7 @@ function resolvePublicHub(env = process.env, connectHub = connectPublicHub) {
|
|
|
433
434
|
if (!existsSync(join(dir, 'token.json')))
|
|
434
435
|
return undefined;
|
|
435
436
|
try {
|
|
436
|
-
const hubUrl = env
|
|
437
|
+
const hubUrl = resolveHubUrl(env);
|
|
437
438
|
const resolvedSenderId = resolveAtpSenderId(env);
|
|
438
439
|
if (!resolvedSenderId)
|
|
439
440
|
return undefined;
|
|
@@ -444,6 +445,9 @@ function resolvePublicHub(env = process.env, connectHub = connectPublicHub) {
|
|
|
444
445
|
return undefined;
|
|
445
446
|
}
|
|
446
447
|
}
|
|
448
|
+
function hubMode(env) {
|
|
449
|
+
return String(env['EVOMAP_HUB_MODE'] ?? 'public').trim().toLowerCase();
|
|
450
|
+
}
|
|
447
451
|
/**
|
|
448
452
|
* Resolve the hub link (reuse seam + outcome reporter) from the environment, or undefined when reuse is
|
|
449
453
|
* not enabled/credentialed. Default OFF: requires EVOLVER_REUSE_BEFORE_SOLVE === '1' and an OAuth token at
|
|
@@ -457,7 +461,7 @@ export function resolveHubLink(env = process.env, ingestor, connectHub = connect
|
|
|
457
461
|
process.stderr.write(`[evolver-autoexec] failed to load EVOLVER_ENV_FILE: ${envFile.error}\n`);
|
|
458
462
|
if (env['EVOLVER_REUSE_BEFORE_SOLVE'] !== '1')
|
|
459
463
|
return undefined;
|
|
460
|
-
if (
|
|
464
|
+
if (hubMode(env) === 'private') {
|
|
461
465
|
const proxy = proxyClientFromEnv(env);
|
|
462
466
|
return proxy ? makeHubLink(makeProxyHubCapability(proxy), ingestor, env['EVOLVER_OUTCOME_REPORT'] !== '0') : undefined;
|
|
463
467
|
}
|
|
@@ -478,6 +482,15 @@ export function resolveHubQuestionLink(env = process.env, connectHub = connectPu
|
|
|
478
482
|
return undefined;
|
|
479
483
|
return makeHubQuestionLink(hub, { env });
|
|
480
484
|
}
|
|
485
|
+
export function resolveMemoryEventMirror(env = process.env, connectHub = connectPublicHub) {
|
|
486
|
+
if (hubMode(env) === 'private') {
|
|
487
|
+
return { enabled: false, reason: 'no_hub', observer: null };
|
|
488
|
+
}
|
|
489
|
+
const disabled = resolveMemoryEventMirrorObserver(env, null);
|
|
490
|
+
if (disabled.reason === 'disabled')
|
|
491
|
+
return disabled;
|
|
492
|
+
return resolveMemoryEventMirrorObserver(env, resolvePublicHub(env, connectHub));
|
|
493
|
+
}
|
|
481
494
|
function solidifyVerifyFlag(env) {
|
|
482
495
|
const raw = env[SOLIDIFY_VERIFY_ENV]?.trim().toLowerCase();
|
|
483
496
|
if (raw === '0' || raw === 'false' || raw === 'off')
|
|
@@ -505,7 +518,7 @@ export function resolveSolidifyPermitGate(env = process.env, connectHub = connec
|
|
|
505
518
|
const flag = solidifyVerifyFlag(env);
|
|
506
519
|
if (flag === 'off')
|
|
507
520
|
return undefined;
|
|
508
|
-
const hubUrl = (env
|
|
521
|
+
const hubUrl = resolveConfiguredHubUrl(env) ?? (flag === 'on' ? resolveHubUrl(env) : undefined);
|
|
509
522
|
if (!hubUrl) {
|
|
510
523
|
if (flag === 'on')
|
|
511
524
|
return () => ({ ok: false, reason: 'hub_solidify_verify_unavailable:no_hub_url' });
|
|
@@ -640,6 +653,8 @@ export function defaultSessionDirs(env = process.env) {
|
|
|
640
653
|
join(h, '.cursor'),
|
|
641
654
|
join(h, '.codex'),
|
|
642
655
|
join(h, '.gemini', 'tmp'),
|
|
656
|
+
join(h, '.gemini', 'antigravity'),
|
|
657
|
+
join(h, '.gemini', 'antigravity-ide'),
|
|
643
658
|
join(h, '.kimi'),
|
|
644
659
|
join(h, 'Library', 'Application Support', 'Cursor', 'User', 'globalStorage'),
|
|
645
660
|
join(h, 'AppData', 'Roaming', 'Cursor', 'User', 'globalStorage'),
|
|
@@ -813,6 +828,9 @@ export async function runAutoExec(argv) {
|
|
|
813
828
|
const reflection = resolveReflectionObserver(process.env, { ingestor });
|
|
814
829
|
if (reflection.observer)
|
|
815
830
|
bus.register(reflection.observer);
|
|
831
|
+
const memoryEventMirror = resolveMemoryEventMirror(process.env);
|
|
832
|
+
if (memoryEventMirror.observer)
|
|
833
|
+
bus.register(memoryEventMirror.observer);
|
|
816
834
|
const personalityStore = createAutoExecPersonalityStore();
|
|
817
835
|
const engine = new algo.CycleEngine({ ingestor, selection: algo.makeGeneSelectionPoint(), store, now: () => Date.now(), personality: personalityStore });
|
|
818
836
|
// Reuse-before-solve (#110) + outcome report-back: wire the adapter's reuseBeforeSolve as the hub-reuse
|
|
@@ -884,7 +902,7 @@ export async function runAutoExec(argv) {
|
|
|
884
902
|
const antiGeneDistill = resolveAutoDistillAntiGene(process.env, { store, review, ingestor });
|
|
885
903
|
const transcriptDistill = resolveAutoDistillTranscript(process.env, { store, review, ingestor });
|
|
886
904
|
const atpAutoDeliver = resolveAtpAutoDeliver(process.env);
|
|
887
|
-
process.stdout.write(`evolver autoexec: runner=${cfg.runner} queue=${dirs.tasks} allowlist=${JSON.stringify(cfg.allowedRoots)} poll=${cfg.pollMs}ms reuse=${hubLink ? 'on' : 'off'} reuse-signal=${reuseSignalOn ? 'on' : 'off'} probation=${probationOn ? 'on' : 'off'} questions=${hubQuestionLink ? 'on' : 'off'} permit=${solidifyPermit ? 'on' : 'off'} value-digest=${digest.enabled ? 'on' : 'off'} reflection=${reflection.enabled ? 'on' : 'off'} cursor-rewrite=${cursorRewrite.enabled ? 'on' : `off(${cursorRewrite.reason})`} auto-distill=${distill.enabled ? 'on' : 'off'} auto-distill-llm=${llmDistill.enabled ? llmDistill.mode : 'off'} auto-distill-anti-gene=${antiGeneDistill.enabled ? antiGeneDistill.mode : 'off'} auto-distill-transcript=${transcriptDistill.enabled ? transcriptDistill.mode : 'off'} atp-autodeliver=${atpAutoDeliver.enabled ? 'on' : `off(${atpAutoDeliver.reason})`}\n`);
|
|
905
|
+
process.stdout.write(`evolver autoexec: runner=${cfg.runner} queue=${dirs.tasks} allowlist=${JSON.stringify(cfg.allowedRoots)} poll=${cfg.pollMs}ms reuse=${hubLink ? 'on' : 'off'} reuse-signal=${reuseSignalOn ? 'on' : 'off'} probation=${probationOn ? 'on' : 'off'} questions=${hubQuestionLink ? 'on' : 'off'} permit=${solidifyPermit ? 'on' : 'off'} value-digest=${digest.enabled ? 'on' : 'off'} reflection=${reflection.enabled ? 'on' : 'off'} memory-event-mirror=${memoryEventMirror.enabled ? 'on' : `off(${memoryEventMirror.reason ?? 'no_hub'})`} cursor-rewrite=${cursorRewrite.enabled ? 'on' : `off(${cursorRewrite.reason})`} auto-distill=${distill.enabled ? 'on' : 'off'} auto-distill-llm=${llmDistill.enabled ? llmDistill.mode : 'off'} auto-distill-anti-gene=${antiGeneDistill.enabled ? antiGeneDistill.mode : 'off'} auto-distill-transcript=${transcriptDistill.enabled ? transcriptDistill.mode : 'off'} atp-autodeliver=${atpAutoDeliver.enabled ? 'on' : `off(${atpAutoDeliver.reason})`}\n`);
|
|
888
906
|
if (cfg.allowedRoots.length === 0)
|
|
889
907
|
process.stdout.write(' (allowlist empty → deny-by-default: nothing runs until you add a repo to config.json)\n');
|
|
890
908
|
// Single-instance lock (#106): a second daemon on the same home would double-process the queue. That is harmless
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { settleCliProcess } from './cliLifecycle.js';
|
|
3
3
|
const argv = process.argv.slice(2);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
async function main() {
|
|
5
|
+
if (argv[0] === 'proxy-token') {
|
|
6
|
+
const { runProxyToken } = await import('./proxyToken.js');
|
|
7
|
+
return runProxyToken(argv.slice(1));
|
|
8
|
+
}
|
|
9
|
+
const { dispatch } = await import('./dispatch.js');
|
|
10
|
+
// Single dispatch path (registry in dispatch.ts): async handler if the verb is registered, else the runCli core.
|
|
11
|
+
// Promise.resolve normalizes the sync (runCli → number) and async (handler → Promise<number>) branches to one exit.
|
|
12
|
+
return await Promise.resolve(dispatch(argv));
|
|
13
|
+
}
|
|
14
|
+
void settleCliProcess(main);
|
package/dist/cliContracts.js
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { inspect, format } from 'node:util';
|
|
4
4
|
import { assetstore, events, hub, wire } from '@evomap/evolver-core';
|
|
5
|
-
import { AuthError, HubClientError, HubFetch, HubUnreachableError, connectPublicHub, gepEnvelope, globalFetchLike, } from '@evomap/evolver-adapter-public';
|
|
5
|
+
import { AuthError, HubClientError, HubFetch, HubUnreachableError, connectPublicHub, gepEnvelope, globalFetchLike, resolveHubUrl, } from '@evomap/evolver-adapter-public';
|
|
6
6
|
import { loadEnvFileFromEnv } from '@evomap/evolver-mcp';
|
|
7
7
|
import { resolveAtpHome, resolveAtpSenderId } from './atp.js';
|
|
8
8
|
const REUSE_CONTRACT = 'reuse.v1';
|
|
@@ -570,7 +570,7 @@ async function withMachineJsonConsole(enabled, deps, fn) {
|
|
|
570
570
|
function createDefaultTransport(deps) {
|
|
571
571
|
const env = deps.env ?? process.env;
|
|
572
572
|
loadEnvFileFromEnv(env);
|
|
573
|
-
const hubUrl = env
|
|
573
|
+
const hubUrl = resolveHubUrl(env);
|
|
574
574
|
const evomapDir = resolveAtpHome(env);
|
|
575
575
|
const sender = resolveAtpSenderId(env);
|
|
576
576
|
const senderId = () => sender ?? env['A2A_NODE_ID']?.trim();
|
|
@@ -591,6 +591,8 @@ function createDefaultTransport(deps) {
|
|
|
591
591
|
catch (err) {
|
|
592
592
|
if (err instanceof AuthError)
|
|
593
593
|
return { ok: false, status: err.status };
|
|
594
|
+
if (isAuthLikeError(err))
|
|
595
|
+
return { ok: false, status: 401 };
|
|
594
596
|
if (err instanceof HubClientError)
|
|
595
597
|
return { ok: false, status: err.status, body: err.body };
|
|
596
598
|
return { ok: false, status: 0 };
|
|
@@ -602,6 +604,10 @@ function createDefaultTransport(deps) {
|
|
|
602
604
|
publish: (bundle) => call('/a2a/publish', 'publish', bundle),
|
|
603
605
|
};
|
|
604
606
|
}
|
|
607
|
+
function isAuthLikeError(err) {
|
|
608
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
609
|
+
return /oauth|login|credential|auth|401|403|node_secret/i.test(message);
|
|
610
|
+
}
|
|
605
611
|
function classifyError(err, command) {
|
|
606
612
|
if (err instanceof ContractError)
|
|
607
613
|
return { reason: err.reason, message: err.safeMessage, retryable: err.reason === 'network_error' };
|
package/dist/cycleConsumer.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { assetstore, algo, events, exec, material as materialNs, personality } from '@evomap/evolver-core';
|
|
1
|
+
import { assetstore, algo, events, exec, material as materialNs, personality, verify } from '@evomap/evolver-core';
|
|
2
2
|
type RunnerName = NonNullable<exec.AutonomousSafety['runner']>;
|
|
3
|
+
type SleepFn = (ms: number) => Promise<void>;
|
|
4
|
+
type SandboxedValidationRunner = typeof verify.runSandboxedValidation;
|
|
3
5
|
type MaterialCycleAction = 'cycle' | 'observe' | 'skip' | 'fail';
|
|
4
6
|
type MaterialCycleStatus = exec.AutoExecVerdict['status'] | 'observed' | 'already_consumed' | 'already_terminal' | 'already_running' | 'no_signals' | 'parse_failed' | 'pending';
|
|
5
7
|
interface MaterialCycleItem {
|
|
@@ -14,17 +16,62 @@ export interface MaterialCycleResult {
|
|
|
14
16
|
processed: number;
|
|
15
17
|
items: MaterialCycleItem[];
|
|
16
18
|
}
|
|
19
|
+
export interface MaterialCycleWatchIteration {
|
|
20
|
+
ok: true;
|
|
21
|
+
group: 'cycle.watch';
|
|
22
|
+
iteration: number;
|
|
23
|
+
claimed: number;
|
|
24
|
+
processed: number;
|
|
25
|
+
cursor: number;
|
|
26
|
+
idle: boolean;
|
|
27
|
+
nextDelayMs: number;
|
|
28
|
+
items: MaterialCycleItem[];
|
|
29
|
+
}
|
|
30
|
+
export interface MaterialCycleWatchResult {
|
|
31
|
+
ok: true;
|
|
32
|
+
group: 'cycle.watch';
|
|
33
|
+
iterations: number;
|
|
34
|
+
claimed: number;
|
|
35
|
+
processed: number;
|
|
36
|
+
idleIterations: number;
|
|
37
|
+
failedItems: number;
|
|
38
|
+
cursor: number;
|
|
39
|
+
stopped: 'max_iterations' | 'max_idle';
|
|
40
|
+
}
|
|
41
|
+
export interface MaterialCycleWatchState {
|
|
42
|
+
ok: true;
|
|
43
|
+
group: 'cycle.watch.state';
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
running: boolean;
|
|
46
|
+
iteration: number;
|
|
47
|
+
cursor: number;
|
|
48
|
+
claimed: number;
|
|
49
|
+
processed: number;
|
|
50
|
+
idleIterations: number;
|
|
51
|
+
failedItems: number;
|
|
52
|
+
lastIteration?: MaterialCycleWatchIteration;
|
|
53
|
+
stopped?: MaterialCycleWatchResult['stopped'] | 'state_write_failed';
|
|
54
|
+
}
|
|
17
55
|
export interface MaterialCycleOptions {
|
|
18
56
|
repo: string;
|
|
19
57
|
limit?: number;
|
|
20
58
|
target?: string;
|
|
21
59
|
expectedEffect?: string;
|
|
60
|
+
validationCmds?: readonly string[];
|
|
61
|
+
validate?: exec.AutoExecDeps['validate'];
|
|
22
62
|
runner?: RunnerName;
|
|
23
63
|
timeoutMs?: number;
|
|
24
64
|
safety?: Partial<exec.AutonomousSafety>;
|
|
25
65
|
agent?: exec.AgentRunner;
|
|
26
66
|
git?: exec.GitRunner;
|
|
27
67
|
}
|
|
68
|
+
export interface MaterialCycleWatchOptions extends MaterialCycleOptions {
|
|
69
|
+
idleMs?: number;
|
|
70
|
+
maxIdleMs?: number;
|
|
71
|
+
backoffMultiplier?: number;
|
|
72
|
+
maxIdle?: number;
|
|
73
|
+
maxIterations?: number;
|
|
74
|
+
}
|
|
28
75
|
export interface MaterialCycleDeps {
|
|
29
76
|
materialStore?: materialNs.MaterialStore;
|
|
30
77
|
consumer?: materialNs.ConsumerGroups;
|
|
@@ -34,9 +81,20 @@ export interface MaterialCycleDeps {
|
|
|
34
81
|
ingestor?: events.Ingestor;
|
|
35
82
|
engine?: algo.CycleEngine;
|
|
36
83
|
personality?: personality.PersonalityStore;
|
|
84
|
+
validate?: exec.AutoExecDeps['validate'];
|
|
85
|
+
/** Test/composition seam for the external validator; production defaults to the hardened core runner. */
|
|
86
|
+
runSandboxedValidation?: SandboxedValidationRunner;
|
|
87
|
+
agent?: exec.AgentRunner;
|
|
88
|
+
git?: exec.GitRunner;
|
|
89
|
+
safety?: Partial<exec.AutonomousSafety>;
|
|
90
|
+
sleep?: SleepFn;
|
|
91
|
+
watchStateWriter?: (path: string, state: MaterialCycleWatchState) => void;
|
|
37
92
|
}
|
|
38
93
|
export declare function cycleIdForMaterial(materialId: string): string;
|
|
39
94
|
export declare function cycleLockPathForMaterial(materialStorePath: string, materialId: string): string;
|
|
40
95
|
export declare function runMaterialCycleConsumer(opts: MaterialCycleOptions, injectedDeps?: MaterialCycleDeps): Promise<MaterialCycleResult>;
|
|
96
|
+
export declare function runMaterialCycleWatch(opts: MaterialCycleWatchOptions, injectedDeps?: MaterialCycleDeps, hooks?: {
|
|
97
|
+
onIteration?: (iteration: MaterialCycleWatchIteration) => void;
|
|
98
|
+
}): Promise<MaterialCycleWatchResult>;
|
|
41
99
|
export declare function runCycleCommand(argv: readonly string[], injectedDeps?: MaterialCycleDeps): Promise<number>;
|
|
42
100
|
export {};
|