@evomap/evolver-cli 2.0.0-beta.18 → 2.0.0-beta.19
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/antiGeneRollout.js +7 -3
- package/dist/assetTrust.js +14 -1
- package/dist/atp.d.ts +8 -3
- package/dist/atp.js +82 -11
- package/dist/atpAutoBuyer.d.ts +120 -0
- package/dist/atpAutoBuyer.js +814 -0
- package/dist/atpAutoDeliver.js +2 -2
- package/dist/autoDistillLlm.js +2 -1
- package/dist/autoDistillTranscript.js +3 -2
- package/dist/autoexec.d.ts +90 -13
- package/dist/autoexec.js +731 -84
- package/dist/cli.js +13 -0
- package/dist/cliContracts.d.ts +5 -2
- package/dist/cliContracts.js +135 -8
- package/dist/commands.d.ts +1 -0
- package/dist/commands.js +1 -0
- package/dist/curriculumCapabilityGaps.d.ts +6 -0
- package/dist/curriculumCapabilityGaps.js +24 -0
- package/dist/cycleConsumer.d.ts +4 -0
- package/dist/cycleConsumer.js +175 -20
- package/dist/dashboard.js +47 -9
- package/dist/dispatch.js +6 -2
- package/dist/distillPrimitives.js +18 -6
- package/dist/doctor.js +63 -5
- package/dist/identityHome.js +2 -1
- package/dist/index.d.ts +67 -39
- package/dist/index.js +504 -185
- package/dist/learningTrace.js +8 -2
- package/dist/lifecycle.d.ts +54 -1
- package/dist/lifecycle.js +489 -37
- package/dist/materialSnapshot.d.ts +9 -1
- package/dist/materialSnapshot.js +23 -6
- package/dist/migrate/envTranslate.d.ts +26 -0
- package/dist/migrate/envTranslate.js +145 -0
- package/dist/migrate/oauthImport.d.ts +66 -0
- package/dist/migrate/oauthImport.js +667 -0
- package/dist/migrate/v1Import.d.ts +13 -1
- package/dist/migrate/v1Import.js +621 -122
- package/dist/promptRecallHook.d.ts +24 -0
- package/dist/promptRecallHook.js +425 -0
- package/dist/recallVerifyReport.d.ts +37 -0
- package/dist/recallVerifyReport.js +244 -0
- package/dist/requiredSandboxValidation.d.ts +5 -0
- package/dist/requiredSandboxValidation.js +4 -0
- package/dist/reuse.d.ts +1 -0
- package/dist/reuse.js +45 -37
- package/dist/runtimeCapabilities.js +13 -13
- package/dist/runtimeSessionSource.d.ts +3 -2
- package/dist/runtimeSessionSource.js +63 -11
- package/dist/sessionIngest.d.ts +37 -0
- package/dist/sessionIngest.js +156 -0
- package/dist/setupHooks.js +95 -1
- package/dist/skill2gep.d.ts +4 -7
- package/dist/skill2gep.js +4 -21
- package/dist/solo/mode.js +1 -0
- package/dist/sync.js +125 -23
- package/dist/thesis.d.ts +1 -1
- package/dist/thesis.js +18 -3
- package/dist/trajectoryExport.js +21 -3
- package/dist/v1Compat.d.ts +1 -0
- package/dist/v1Compat.js +9 -0
- package/dist/workflowRuntime.js +24 -18
- package/package.json +10 -7
package/dist/atpAutoDeliver.js
CHANGED
|
@@ -172,8 +172,8 @@ export function buildAtpAutoDeliverProofPayload(task, nowDate = () => new Date()
|
|
|
172
172
|
return {
|
|
173
173
|
result: 'completed',
|
|
174
174
|
asset_id: assetId,
|
|
175
|
-
completed_at: taskString(task, '
|
|
176
|
-
pass_rate:
|
|
175
|
+
completed_at: taskString(task, 'completed_at') ?? taskString(task, 'completedAt') ?? nowDate().toISOString(),
|
|
176
|
+
// pass_rate is deliberately absent: auto-delivery has an asset reference, not measured validation evidence.
|
|
177
177
|
signals: Array.isArray(task['signals']) ? task['signals'].filter((s) => typeof s === 'string').slice(0, 10) : [],
|
|
178
178
|
submitter: 'evolver_auto_deliver',
|
|
179
179
|
};
|
package/dist/autoDistillLlm.js
CHANGED
|
@@ -3,6 +3,7 @@ import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readSync, rea
|
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
5
5
|
import { algo, assetstore, events, exec, hub, verify } from '@evomap/evolver-core';
|
|
6
|
+
import { runRequiredSandboxedValidation } from './requiredSandboxValidation.js';
|
|
6
7
|
const DEFAULT_MIN_CAPSULES = 10;
|
|
7
8
|
const DEFAULT_MAX_CAPSULES = 24;
|
|
8
9
|
const DEFAULT_MIN_SUCCESS_SCORE = 0.7;
|
|
@@ -519,7 +520,7 @@ export async function autoDistillLlm(options) {
|
|
|
519
520
|
patchState(statePath, input.dataHash, { failed_attempts_inc: true }, hashCap);
|
|
520
521
|
return { ok: false, mode, reason: 'validation_failed', dataHash: input.dataHash };
|
|
521
522
|
}
|
|
522
|
-
const validation = await
|
|
523
|
+
const validation = await runRequiredSandboxedValidation(intake.gene.validation, cwd, {
|
|
523
524
|
timeoutMs: options.validationTimeoutMs ?? envInt(env, 'EVOLVE_DISTILL_VALIDATION_TIMEOUT_MS', DEFAULT_VALIDATION_TIMEOUT_MS),
|
|
524
525
|
});
|
|
525
526
|
if (!validation.passed) {
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
import { createHash } from 'node:crypto';
|
|
13
13
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
14
14
|
import { basename, dirname, join } from 'node:path';
|
|
15
|
-
import { algo, assetstore, events, hub,
|
|
15
|
+
import { algo, assetstore, events, hub, signals } from '@evomap/evolver-core';
|
|
16
16
|
import { adapterForPath } from '@evomap/evolver-runtime-adapters';
|
|
17
17
|
import { asGeneCandidate, parseDistillOutput, normalizeValidation, jaccardDuplicate, resolveDistillRunner, p3Decide, } from './autoDistillLlm.js';
|
|
18
|
+
import { runRequiredSandboxedValidation } from './requiredSandboxValidation.js';
|
|
18
19
|
const DEFAULT_MIN_TURNS = 2;
|
|
19
20
|
const DEFAULT_MIN_CHARS = 200;
|
|
20
21
|
const DEFAULT_TIMEOUT_MS = 180_000;
|
|
@@ -169,7 +170,7 @@ export async function autoDistillTranscript(options) {
|
|
|
169
170
|
const intake = algo.intakeGene(normalized, existing);
|
|
170
171
|
if (!intake.ok || !intake.gene)
|
|
171
172
|
return { ok: false, mode, reason: 'validation_failed', candidate: normalized };
|
|
172
|
-
const validation = await
|
|
173
|
+
const validation = await runRequiredSandboxedValidation(intake.gene.validation, cwd, {
|
|
173
174
|
timeoutMs: options.validationTimeoutMs ?? envInt(env, 'EVOLVE_DISTILL_VALIDATION_TIMEOUT_MS', DEFAULT_VALIDATION_TIMEOUT_MS),
|
|
174
175
|
});
|
|
175
176
|
if (!validation.passed)
|
package/dist/autoexec.d.ts
CHANGED
|
@@ -8,22 +8,30 @@ import { resolveDistillObserver } from './distillObserver.js';
|
|
|
8
8
|
import { type AutoDistillLlmResult, type LlmDistillRunner } from './autoDistillLlm.js';
|
|
9
9
|
import { type AutoDistillAntiGeneMode, type AutoDistillAntiGeneResult } from './autoDistillAntiGene.js';
|
|
10
10
|
import { type AutoDistillTranscriptMode, type TranscriptDistillTickResult } from './autoDistillTranscript.js';
|
|
11
|
-
import { type SessionIngestTickResult } from './
|
|
11
|
+
import { type SessionIngestTickResult } from './sessionIngest.js';
|
|
12
|
+
import { AtpAutoBuyer, type AtpAutoBuyerClient, type AtpAutoBuyerRequest } from './atpAutoBuyer.js';
|
|
12
13
|
export { readAutoExecConfig, type AutoExecConfig } from './autoexecConfig.js';
|
|
13
14
|
export interface AutoExecDirs {
|
|
14
15
|
base: string;
|
|
15
16
|
tasks: string;
|
|
17
|
+
inflight: string;
|
|
16
18
|
done: string;
|
|
17
19
|
refused: string;
|
|
18
20
|
}
|
|
19
|
-
/** Create the queue layout under <home>/autoexec/{tasks,done,refused}. */
|
|
21
|
+
/** Create the queue layout under <home>/autoexec/{tasks,inflight,done,refused}. */
|
|
20
22
|
export declare function ensureAutoExecDirs(base: string): AutoExecDirs;
|
|
21
23
|
export declare function summarizeSandboxedValidation(result: verify.SandboxedValidationResult): string | null;
|
|
22
24
|
/**
|
|
23
|
-
* One queue pass:
|
|
24
|
-
* or refused/ (deny-by-default)
|
|
25
|
+
* One queue pass: atomically claim regular tasks/*.json into inflight/, then route each verdict to done/
|
|
26
|
+
* (success or failure) or refused/ (deny-by-default). A claim is atomically marked started before runOne;
|
|
27
|
+
* after a crash, started and legacy claims are ambiguous and fail closed instead of repeating side effects.
|
|
28
|
+
* Unreadable or incomplete claimed tasks stay pending because the drop-directory has no atomic publish marker.
|
|
25
29
|
*/
|
|
26
|
-
export declare function autoExecPass(dirs: AutoExecDirs, runOne: (task: exec.AutoExecTask) => Promise<exec.AutoExecVerdict
|
|
30
|
+
export declare function autoExecPass(dirs: AutoExecDirs, runOne: (task: exec.AutoExecTask) => Promise<exec.AutoExecVerdict>, options?: {
|
|
31
|
+
executePendingTasks?: boolean;
|
|
32
|
+
}): Promise<exec.AutoExecVerdict[]>;
|
|
33
|
+
/** Keep unsupported built-in runners away from the execution queue without stopping the resident daemon. */
|
|
34
|
+
export declare function runnerBoundAutoExecPass(runner: exec.RunnerName, dirs: AutoExecDirs, runOne: (task: exec.AutoExecTask) => Promise<exec.AutoExecVerdict>): () => Promise<exec.AutoExecVerdict[]>;
|
|
27
35
|
/**
|
|
28
36
|
* Build the reuse-before-solve seam (#110) — THE real injection point. This is the public-repo composition
|
|
29
37
|
* layer that owns BOTH core's autoexec kernel and the adapter's hub capability, so it is where the adapter's
|
|
@@ -33,7 +41,48 @@ export declare function autoExecPass(dirs: AutoExecDirs, runOne: (task: exec.Aut
|
|
|
33
41
|
* (a repeat signal set → zero hub calls). Off by default: only wired when EVOLVER_REUSE_BEFORE_SOLVE === '1'
|
|
34
42
|
* AND a hub credential exists (no token → no seam → zero hub calls, exactly today's behavior).
|
|
35
43
|
*/
|
|
36
|
-
export
|
|
44
|
+
export type VerifiedHubSearchMissReason = 'no_results' | 'below_threshold';
|
|
45
|
+
export interface VerifiedHubSearchMiss {
|
|
46
|
+
reason: VerifiedHubSearchMissReason;
|
|
47
|
+
signals: readonly string[];
|
|
48
|
+
cycleId?: string;
|
|
49
|
+
}
|
|
50
|
+
export type VerifiedHubSearchMissHandler = (miss: VerifiedHubSearchMiss) => void;
|
|
51
|
+
/** Minimal audit seam so autoexec tests never have to touch the operator's real asset-call log. */
|
|
52
|
+
export interface AssetCallLogger {
|
|
53
|
+
append(entry: hubNs.AssetCallEntry): void;
|
|
54
|
+
assetCostIndex?(): Record<string, number>;
|
|
55
|
+
}
|
|
56
|
+
interface HubSearchHitAudit {
|
|
57
|
+
runId: string | null;
|
|
58
|
+
assetId?: string;
|
|
59
|
+
assetType?: string;
|
|
60
|
+
sourceNodeId?: string;
|
|
61
|
+
chainId?: string;
|
|
62
|
+
score?: number;
|
|
63
|
+
mode: 'direct' | 'reference';
|
|
64
|
+
signals: readonly string[];
|
|
65
|
+
tokensSaved: number;
|
|
66
|
+
tokensSavedBasis: hubNs.TokensSavedBasis;
|
|
67
|
+
}
|
|
68
|
+
interface HubReuseAuditOptions {
|
|
69
|
+
assetLog?: AssetCallLogger;
|
|
70
|
+
onSearchHit?: (hit: HubSearchHitAudit) => void;
|
|
71
|
+
env?: NodeJS.ProcessEnv;
|
|
72
|
+
}
|
|
73
|
+
/** Build the deliberately small, public-safe ATP request allowed to leave autoexec after a verified Hub miss. */
|
|
74
|
+
export declare function atpCapabilityGapRequest(signals: readonly string[]): AtpAutoBuyerRequest;
|
|
75
|
+
/** Schedule economic work outside the reuse/task critical path and contain all asynchronous failures. */
|
|
76
|
+
export declare function scheduleAtpAutoBuyForVerifiedMiss(miss: VerifiedHubSearchMiss, buyer: Pick<AtpAutoBuyer, 'consider'>): void;
|
|
77
|
+
/** Resolve an autonomous buyer only after an explicit env/ack consent check; the buyer checks consent again. */
|
|
78
|
+
export declare function resolveAtpAutoBuyer(env?: NodeJS.ProcessEnv, createClient?: (resolvedEnv: NodeJS.ProcessEnv) => AtpAutoBuyerClient): AtpAutoBuyer | undefined;
|
|
79
|
+
export declare function makeHubReuseSeam(cap: hubNs.HubCapability, cache: ReuseCache, ingestor?: events.Ingestor, onAssetReused?: (assetId: string) => void, onVerifiedSearchMiss?: VerifiedHubSearchMissHandler, audit?: HubReuseAuditOptions): exec.HubReuseSeam;
|
|
80
|
+
/**
|
|
81
|
+
* Free search-only seam used by ATP auto-buy when reuse injection is disabled. It proves a capability miss with
|
|
82
|
+
* the same dual-leg search and score threshold as reuse, but never performs the paid fetch or contributes a Hub
|
|
83
|
+
* candidate.
|
|
84
|
+
*/
|
|
85
|
+
export declare function makeHubSearchMissProbe(cap: hubNs.HubCapability, cache: ReuseCache, onVerifiedSearchMiss: VerifiedHubSearchMissHandler, enabled: () => boolean, env?: NodeJS.ProcessEnv, assetLog?: AssetCallLogger): exec.HubReuseSeam;
|
|
37
86
|
/**
|
|
38
87
|
* Append a `value.inject` root_event for a SessionStart gene injection (#123). Attribution-only — the payload
|
|
39
88
|
* carries the injected gene ids (+ cycle/outcome when known) and NO savings number, exactly per the ledger's
|
|
@@ -113,6 +162,36 @@ export interface AutoexecLockReleaseDeps {
|
|
|
113
162
|
stderr?: (text: string) => void;
|
|
114
163
|
}
|
|
115
164
|
export declare function releaseAutoexecLock(lockPath: string, deps?: AutoexecLockReleaseDeps): boolean;
|
|
165
|
+
type AutoexecStreamErrorListener = (error: NodeJS.ErrnoException) => void;
|
|
166
|
+
export interface AutoexecErrorStream {
|
|
167
|
+
on(event: 'error', listener: AutoexecStreamErrorListener): unknown;
|
|
168
|
+
off?(event: 'error', listener: AutoexecStreamErrorListener): unknown;
|
|
169
|
+
removeListener?(event: 'error', listener: AutoexecStreamErrorListener): unknown;
|
|
170
|
+
}
|
|
171
|
+
export interface AutoexecBrokenPipeGuardDeps {
|
|
172
|
+
stdout?: AutoexecErrorStream;
|
|
173
|
+
stderr?: AutoexecErrorStream;
|
|
174
|
+
}
|
|
175
|
+
/** Keep a detached daemon alive when its output consumer closes, without hiding other stream failures. */
|
|
176
|
+
export declare function installAutoexecBrokenPipeGuards(deps?: AutoexecBrokenPipeGuardDeps): () => void;
|
|
177
|
+
export type AutoexecProcessSignal = 'SIGINT' | 'SIGTERM' | 'SIGHUP';
|
|
178
|
+
type AutoexecSignalListener = () => void;
|
|
179
|
+
export interface AutoexecSignalSource {
|
|
180
|
+
on(event: AutoexecProcessSignal, listener: AutoexecSignalListener): unknown;
|
|
181
|
+
off?(event: AutoexecProcessSignal, listener: AutoexecSignalListener): unknown;
|
|
182
|
+
removeListener?(event: AutoexecProcessSignal, listener: AutoexecSignalListener): unknown;
|
|
183
|
+
}
|
|
184
|
+
export interface AutoexecShutdownDeps {
|
|
185
|
+
stop: () => Promise<void>;
|
|
186
|
+
cleanup: () => void;
|
|
187
|
+
signals?: AutoexecSignalSource;
|
|
188
|
+
write?: (message: string) => void;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Own autoexec's process-signal lifetime. V2 intentionally has no hot-reload seam: SIGHUP is informational and
|
|
192
|
+
* keeps the current generation alive; SIGINT/SIGTERM drain the resident loop before cleanup and exit.
|
|
193
|
+
*/
|
|
194
|
+
export declare function waitForAutoexecShutdown(deps: AutoexecShutdownDeps): Promise<number>;
|
|
116
195
|
export declare function urgentQuestionRuntimeWiringStatus(): typeof hubNs.URGENT_QUESTION_RUNTIME_WIRING_STATUS;
|
|
117
196
|
export declare function submitDistillTickExplorationQuestion(questions: HubQuestionLink | undefined, source: DistillTickQuestionSource | undefined): Promise<HubQuestionSubmitResult>;
|
|
118
197
|
export declare function scheduleAutoExecHubSideEffects(task: exec.AutoExecTask, verdict: exec.AutoExecVerdict, links: {
|
|
@@ -125,15 +204,13 @@ export declare function scheduleAutoExecHubSideEffects(task: exec.AutoExecTask,
|
|
|
125
204
|
* candidate can be withheld by trust/review gates or lose selection, so fetch-time attribution would overclaim.
|
|
126
205
|
* Reporting never throws and never blocks the verdict.
|
|
127
206
|
*/
|
|
128
|
-
export declare function makeHubLink(cap: OutcomeReportingHub, ingestor?: events.Ingestor, reportEnabled?: boolean): HubLink;
|
|
207
|
+
export declare function makeHubLink(cap: OutcomeReportingHub, ingestor?: events.Ingestor, reportEnabled?: boolean, onVerifiedSearchMiss?: VerifiedHubSearchMissHandler, assetLog?: AssetCallLogger, env?: NodeJS.ProcessEnv): HubLink;
|
|
129
208
|
/**
|
|
130
|
-
* Resolve
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* hub config — reuse is an optimization. Outcome reporting rides the same gate (it is the read-back half
|
|
134
|
-
* of the same paid hub relationship); EVOLVER_OUTCOME_REPORT=0 turns just the reporting off.
|
|
209
|
+
* Resolve public/private reuse wiring. Reuse remains default-off. When a public ATP miss handler is supplied,
|
|
210
|
+
* a consent-gated free search-only seam may still be composed so auto-buy can prove a miss independently of
|
|
211
|
+
* reuse injection; that seam never fetches or injects Hub assets.
|
|
135
212
|
*/
|
|
136
|
-
export declare function resolveHubLink(env?: NodeJS.ProcessEnv, ingestor?: events.Ingestor, connectHub?: PublicHubConnector): HubLink | undefined;
|
|
213
|
+
export declare function resolveHubLink(env?: NodeJS.ProcessEnv, ingestor?: events.Ingestor, connectHub?: PublicHubConnector, onVerifiedSearchMiss?: VerifiedHubSearchMissHandler, assetLog?: AssetCallLogger): HubLink | undefined;
|
|
137
214
|
export declare function resolveHubQuestionLink(env?: NodeJS.ProcessEnv, connectHub?: PublicHubConnector): HubQuestionLink | undefined;
|
|
138
215
|
export declare function resolveMemoryEventMirror(env?: NodeJS.ProcessEnv, connectHub?: PublicHubConnector): MemoryEventMirrorWiring;
|
|
139
216
|
export declare function offlinePermitDir(env?: NodeJS.ProcessEnv): string;
|