@evomap/evolver-cli 2.0.0-beta.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.
- package/dist/antiGeneBenchmark.d.ts +9 -0
- package/dist/antiGeneBenchmark.js +173 -0
- package/dist/antiGeneRollout.d.ts +14 -0
- package/dist/antiGeneRollout.js +276 -0
- package/dist/atp.d.ts +122 -0
- package/dist/atp.js +413 -0
- package/dist/atpAutoDeliver.d.ts +53 -0
- package/dist/atpAutoDeliver.js +197 -0
- package/dist/atpAutobuyPrompt.d.ts +48 -0
- package/dist/atpAutobuyPrompt.js +109 -0
- package/dist/autoDistillAntiGene.d.ts +63 -0
- package/dist/autoDistillAntiGene.js +396 -0
- package/dist/autoDistillLlm.d.ts +94 -0
- package/dist/autoDistillLlm.js +510 -0
- package/dist/autoDistillTranscript.d.ts +87 -0
- package/dist/autoDistillTranscript.js +364 -0
- package/dist/autoRecall.d.ts +25 -0
- package/dist/autoRecall.js +80 -0
- package/dist/autoexec.d.ts +237 -0
- package/dist/autoexec.js +1041 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +7 -0
- package/dist/cliContracts.d.ts +72 -0
- package/dist/cliContracts.js +815 -0
- package/dist/commands.d.ts +9 -0
- package/dist/commands.js +10 -0
- package/dist/cursorRewrite.d.ts +42 -0
- package/dist/cursorRewrite.js +65 -0
- package/dist/cycleConsumer.d.ts +42 -0
- package/dist/cycleConsumer.js +519 -0
- package/dist/daemonLoop.d.ts +33 -0
- package/dist/daemonLoop.js +72 -0
- package/dist/dispatch.d.ts +10 -0
- package/dist/dispatch.js +75 -0
- package/dist/distillObserver.d.ts +33 -0
- package/dist/distillObserver.js +146 -0
- package/dist/distillPrimitives.d.ts +48 -0
- package/dist/distillPrimitives.js +142 -0
- package/dist/doctor.d.ts +54 -0
- package/dist/doctor.js +931 -0
- package/dist/geneValue.d.ts +37 -0
- package/dist/geneValue.js +97 -0
- package/dist/index.d.ts +193 -0
- package/dist/index.js +1135 -0
- package/dist/lifecycle.d.ts +75 -0
- package/dist/lifecycle.js +859 -0
- package/dist/login.d.ts +10 -0
- package/dist/login.js +38 -0
- package/dist/migrate/divergenceAudit.d.ts +29 -0
- package/dist/migrate/divergenceAudit.js +37 -0
- package/dist/migrate/fieldMap.d.ts +18 -0
- package/dist/migrate/fieldMap.js +68 -0
- package/dist/migrate/v1Import.d.ts +16 -0
- package/dist/migrate/v1Import.js +118 -0
- package/dist/phub.d.ts +18 -0
- package/dist/phub.js +284 -0
- package/dist/recall.d.ts +26 -0
- package/dist/recall.js +162 -0
- package/dist/recipe.d.ts +61 -0
- package/dist/recipe.js +564 -0
- package/dist/reflectionObserver.d.ts +8 -0
- package/dist/reflectionObserver.js +6 -0
- package/dist/reuse.d.ts +48 -0
- package/dist/reuse.js +300 -0
- package/dist/reuseReport.d.ts +20 -0
- package/dist/reuseReport.js +255 -0
- package/dist/reviewFilter.d.ts +4 -0
- package/dist/reviewFilter.js +6 -0
- package/dist/runtimeSessionSource.d.ts +9 -0
- package/dist/runtimeSessionSource.js +29 -0
- package/dist/setupHooks.d.ts +2 -0
- package/dist/setupHooks.js +410 -0
- package/dist/skill2gep.d.ts +144 -0
- package/dist/skill2gep.js +321 -0
- package/dist/skillDistill.d.ts +75 -0
- package/dist/skillDistill.js +342 -0
- package/dist/solo/breaker.d.ts +14 -0
- package/dist/solo/breaker.js +21 -0
- package/dist/solo/gitGuard.d.ts +17 -0
- package/dist/solo/gitGuard.js +62 -0
- package/dist/solo/mode.d.ts +12 -0
- package/dist/solo/mode.js +55 -0
- package/dist/thesis.d.ts +43 -0
- package/dist/thesis.js +179 -0
- package/dist/trajectoryExport.d.ts +1 -0
- package/dist/trajectoryExport.js +895 -0
- package/dist/valueDigest.d.ts +33 -0
- package/dist/valueDigest.js +94 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +14 -0
- package/package.json +38 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface GeneValueStat {
|
|
2
|
+
geneId: string;
|
|
3
|
+
cycles: number;
|
|
4
|
+
passed: number;
|
|
5
|
+
failed: number;
|
|
6
|
+
/** passed / cycles, 0 when no cycles. */
|
|
7
|
+
passRate: number;
|
|
8
|
+
}
|
|
9
|
+
export interface GeneValueReport {
|
|
10
|
+
/** Per-gene stats (excludes the ad-hoc baseline), sorted by cycles desc then passRate desc. */
|
|
11
|
+
stats: GeneValueStat[];
|
|
12
|
+
/** The ad-hoc (innovate / no-gene) cycles as a baseline row, or null if none observed. */
|
|
13
|
+
baseline: GeneValueStat | null;
|
|
14
|
+
/** Total terminal cycles counted (genes + baseline). */
|
|
15
|
+
totalCycles: number;
|
|
16
|
+
}
|
|
17
|
+
type TerminalEvent = {
|
|
18
|
+
type: string;
|
|
19
|
+
payload?: unknown;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Aggregate observed per-gene cycle outcomes from a terminal-cycle event stream (pure). A cycle.solidified is a
|
|
23
|
+
* pass, a cycle.failed is a fail; both carry `payload.gene`. Events without a string gene tag (pre-epigenetic) are
|
|
24
|
+
* skipped. The 'ad-hoc' gene is split out as the no-gene baseline.
|
|
25
|
+
*/
|
|
26
|
+
export declare function summarizeGeneValue(evts: readonly TerminalEvent[]): GeneValueReport;
|
|
27
|
+
export interface GeneValueDeps {
|
|
28
|
+
eventsPath?: string;
|
|
29
|
+
/** Injected event reader for tests; defaults to the real ledger. */
|
|
30
|
+
read?: (path: string) => TerminalEvent[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* `evolver gene-value [--gene <id>] [--json]` — print the observational per-gene pass rate from the cycle ledger.
|
|
34
|
+
* Reports, never measures a controlled A/B; the verdict-bearing with-vs-without harness is a separate slice.
|
|
35
|
+
*/
|
|
36
|
+
export declare function runGeneValue(argv: readonly string[], deps?: GeneValueDeps): number;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// `evolver gene-value` (thesis slice 1) — OBSERVATIONAL per-gene pass rate, read from the real cycle ledger.
|
|
2
|
+
// Each terminal cycle (cycle.solidified / cycle.failed) carries the gene that ran; we aggregate pass/fail per
|
|
3
|
+
// gene. This is NOT a controlled A/B (that needs a live execute + external verifier — a later slice): it reports
|
|
4
|
+
// what actually happened in production, with the innovate ('ad-hoc') cycles surfaced separately as the no-gene
|
|
5
|
+
// baseline so a gene's pass rate can be read against "no gene at all".
|
|
6
|
+
import { events } from '@evomap/evolver-core';
|
|
7
|
+
import { readEvents } from './commands.js';
|
|
8
|
+
/** The innovate / no-gene cycles: a cycle that selected no existing gene records gene='ad-hoc'. */
|
|
9
|
+
const AD_HOC = 'ad-hoc';
|
|
10
|
+
const toStat = (geneId, a) => {
|
|
11
|
+
const cycles = a.passed + a.failed;
|
|
12
|
+
return { geneId, cycles, passed: a.passed, failed: a.failed, passRate: cycles ? a.passed / cycles : 0 };
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Aggregate observed per-gene cycle outcomes from a terminal-cycle event stream (pure). A cycle.solidified is a
|
|
16
|
+
* pass, a cycle.failed is a fail; both carry `payload.gene`. Events without a string gene tag (pre-epigenetic) are
|
|
17
|
+
* skipped. The 'ad-hoc' gene is split out as the no-gene baseline.
|
|
18
|
+
*/
|
|
19
|
+
export function summarizeGeneValue(evts) {
|
|
20
|
+
const agg = new Map();
|
|
21
|
+
for (const e of evts) {
|
|
22
|
+
if (e.type !== 'cycle.solidified' && e.type !== 'cycle.failed')
|
|
23
|
+
continue;
|
|
24
|
+
const gene = e.payload?.gene;
|
|
25
|
+
if (typeof gene !== 'string' || !gene)
|
|
26
|
+
continue; // untagged terminal event → cannot credit a gene
|
|
27
|
+
const a = agg.get(gene) ?? { passed: 0, failed: 0 };
|
|
28
|
+
if (e.type === 'cycle.solidified')
|
|
29
|
+
a.passed += 1;
|
|
30
|
+
else
|
|
31
|
+
a.failed += 1;
|
|
32
|
+
agg.set(gene, a);
|
|
33
|
+
}
|
|
34
|
+
const baselineAgg = agg.get(AD_HOC);
|
|
35
|
+
const stats = [...agg.entries()]
|
|
36
|
+
.filter(([g]) => g !== AD_HOC)
|
|
37
|
+
.map(([g, a]) => toStat(g, a))
|
|
38
|
+
.sort((x, y) => y.cycles - x.cycles || y.passRate - x.passRate);
|
|
39
|
+
const totalCycles = [...agg.values()].reduce((n, a) => n + a.passed + a.failed, 0);
|
|
40
|
+
return { stats, baseline: baselineAgg ? toStat(AD_HOC, baselineAgg) : null, totalCycles };
|
|
41
|
+
}
|
|
42
|
+
const pct = (r) => `${(r * 100).toFixed(0)}%`;
|
|
43
|
+
/**
|
|
44
|
+
* `evolver gene-value [--gene <id>] [--json]` — print the observational per-gene pass rate from the cycle ledger.
|
|
45
|
+
* Reports, never measures a controlled A/B; the verdict-bearing with-vs-without harness is a separate slice.
|
|
46
|
+
*/
|
|
47
|
+
export function runGeneValue(argv, deps = {}) {
|
|
48
|
+
let geneFilter;
|
|
49
|
+
let asJson = false;
|
|
50
|
+
for (let i = 0; i < argv.length; i++) {
|
|
51
|
+
const a = argv[i];
|
|
52
|
+
if (a === '--json')
|
|
53
|
+
asJson = true;
|
|
54
|
+
else if (a === '--gene') {
|
|
55
|
+
const next = argv[i + 1];
|
|
56
|
+
if (next && !next.startsWith('--')) {
|
|
57
|
+
geneFilter = next;
|
|
58
|
+
i += 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const path = deps.eventsPath ?? events.rootEventsPath();
|
|
63
|
+
const evts = deps.read ? deps.read(path) : readEvents(path);
|
|
64
|
+
const report = summarizeGeneValue(evts);
|
|
65
|
+
// `ad-hoc` lives in report.baseline, not report.stats — so `--gene ad-hoc` must target the baseline, else the
|
|
66
|
+
// filter can never reach the innovate row (Bugbot #147).
|
|
67
|
+
const rows = !geneFilter
|
|
68
|
+
? report.stats
|
|
69
|
+
: geneFilter === AD_HOC
|
|
70
|
+
? (report.baseline ? [report.baseline] : [])
|
|
71
|
+
: report.stats.filter((s) => s.geneId === geneFilter);
|
|
72
|
+
if (asJson) {
|
|
73
|
+
process.stdout.write(JSON.stringify(geneFilter ? { stats: rows } : report) + '\n');
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
if (rows.length === 0) {
|
|
77
|
+
if (geneFilter)
|
|
78
|
+
process.stdout.write(`gene-value: no observed cycles for gene ${geneFilter}\n`);
|
|
79
|
+
// No gene rows but a baseline exists means only innovate (no-gene) cycles ran — say that, don't claim there are
|
|
80
|
+
// no cycles to run yet (Bugbot #147).
|
|
81
|
+
else if (report.baseline)
|
|
82
|
+
process.stdout.write(`gene-value: only innovate (ad-hoc / no-gene) cycles observed so far — no gene has run yet\n baseline (ad-hoc / no gene) cycles=${report.baseline.cycles} pass=${report.baseline.passed} fail=${report.baseline.failed} passRate=${pct(report.baseline.passRate)}\n`);
|
|
83
|
+
else
|
|
84
|
+
process.stdout.write('gene-value: no terminal cycles in the ledger yet (run some cycles first)\n');
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
process.stdout.write('gene-value (observational, from the cycle ledger — NOT a controlled A/B):\n');
|
|
88
|
+
for (const s of rows) {
|
|
89
|
+
process.stdout.write(` ${s.geneId} cycles=${s.cycles} pass=${s.passed} fail=${s.failed} passRate=${pct(s.passRate)}\n`);
|
|
90
|
+
}
|
|
91
|
+
// Trailing baseline block only in the unfiltered view (when filtering, the chosen rows already are the answer;
|
|
92
|
+
// a `--gene ad-hoc` filter already shows the baseline as its row).
|
|
93
|
+
if (!geneFilter && report.baseline) {
|
|
94
|
+
process.stdout.write(` --\n baseline (ad-hoc / no gene) cycles=${report.baseline.cycles} pass=${report.baseline.passed} fail=${report.baseline.failed} passRate=${pct(report.baseline.passRate)}\n`);
|
|
95
|
+
}
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { events, ops } from '@evomap/evolver-core';
|
|
2
|
+
import { assetstore, material as materialNs } from '@evomap/evolver-core';
|
|
3
|
+
/**
|
|
4
|
+
* Composition seam for ingest's substrate dependencies. The CLI is the composition layer that wires the
|
|
5
|
+
* MaterialStore (M1 raw-material substrate) + the watermark cursor (file-level re-ingest dedup) + the AE
|
|
6
|
+
* Ingestor (root_events) together — evolver-core stays adapter/CLI-agnostic. Defaults point at the live
|
|
7
|
+
* ~/.evomap home; tests inject temp paths so no global state leaks.
|
|
8
|
+
*/
|
|
9
|
+
export interface IngestDeps {
|
|
10
|
+
materialStore?: materialNs.MaterialStore;
|
|
11
|
+
watermarkStore?: materialNs.WatermarkStore;
|
|
12
|
+
ingestor?: events.Ingestor;
|
|
13
|
+
}
|
|
14
|
+
export interface SessionIngestTickResult {
|
|
15
|
+
recorded: number;
|
|
16
|
+
sourceAgents: string[];
|
|
17
|
+
signalKinds: string[];
|
|
18
|
+
signalStrengths: string[];
|
|
19
|
+
}
|
|
20
|
+
export declare const PACKAGE = "@evomap/evolver-cli";
|
|
21
|
+
export interface RebuildOptions {
|
|
22
|
+
eventsPath?: string;
|
|
23
|
+
mvDir?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ResetLocalSecretOptions {
|
|
26
|
+
env?: NodeJS.ProcessEnv;
|
|
27
|
+
homeDir?: string;
|
|
28
|
+
storePath?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ResetLocalSecretResult {
|
|
31
|
+
storePath: string;
|
|
32
|
+
clearedStateKeys: readonly string[];
|
|
33
|
+
storeFound: boolean;
|
|
34
|
+
removedLegacyFiles: readonly string[];
|
|
35
|
+
envVarsSet: readonly string[];
|
|
36
|
+
}
|
|
37
|
+
export declare function resetLocalSecret(opts?: ResetLocalSecretOptions): ResetLocalSecretResult;
|
|
38
|
+
export declare function formatResetLocalSecretResult(result: ResetLocalSecretResult): string;
|
|
39
|
+
export declare function runResetLocalSecret(argv: readonly string[], opts?: ResetLocalSecretOptions): number;
|
|
40
|
+
/** rebuild-views: 删 MV → 从 root_events 全量重放重建 (军杰 §3.6). */
|
|
41
|
+
export declare function rebuildViews(opts?: RebuildOptions): {
|
|
42
|
+
rebuilt: string[];
|
|
43
|
+
};
|
|
44
|
+
/** migrate import-v1 <v1dir> [outDir]: v1→v2 只读迁移(异步, 由 cli.ts 调). */
|
|
45
|
+
export declare function runMigrate(argv: readonly string[]): Promise<number>;
|
|
46
|
+
/** One-line summary of an asset for `asset-log` (pure, testable). */
|
|
47
|
+
export declare function formatAssetLine(a: assetstore.AssetRecord): string;
|
|
48
|
+
/** asset-log [Gene|Capsule|EvolutionEvent|AntiGene] [limit]: list recent local assets (observability; ported v1 CLI verb). */
|
|
49
|
+
export declare function runAssetLog(argv: readonly string[], store?: assetstore.AssetStoreProvider): Promise<number>;
|
|
50
|
+
/**
|
|
51
|
+
* distill: gate a learned approach into the gene pool (ported v1 CLI verb). Runs the structural intake
|
|
52
|
+
* (schema + dedup + asset_id) and, only if it passes, writes the gene to the store. The agent/runtime is
|
|
53
|
+
* what discovers the strategy; this is the manual entry point that turns it into a pooled, selectable gene.
|
|
54
|
+
* Usage: evolver distill --category <c> --signals <s1,s2> --strategy "<step1; step2>" [--summary <text>] [--id <id>]
|
|
55
|
+
*/
|
|
56
|
+
export declare function runDistill(argv: readonly string[], store?: assetstore.AssetStoreProvider, deps?: IngestDeps): Promise<number>;
|
|
57
|
+
/**
|
|
58
|
+
* Recursively enumerate recognized runtime-session sources under the given dirs — the daemon's auto-distill
|
|
59
|
+
* producer source (#106). This includes text session files handled by runtime adapters (`*.jsonl` and Gemini
|
|
60
|
+
* `*.json`) plus Cursor's sqlite `state.vscdb`. A missing/permission-denied dir is silently skipped (a daemon
|
|
61
|
+
* must not crash on an absent home dir).
|
|
62
|
+
*/
|
|
63
|
+
export declare function scanSessionDirs(dirs: readonly string[]): string[];
|
|
64
|
+
/**
|
|
65
|
+
* One producer tick for the auto-distill loop (#106 slice 1): scan `dirs` for session logs and record any
|
|
66
|
+
* NEW/CHANGED file as `runtime_session` Material via the injected (bus) Ingestor — which emits
|
|
67
|
+
* `material.batch_ready`, the event the distillObserver claims off. Idempotent per file (watermark cursor), so
|
|
68
|
+
* re-scanning an unchanged tree records nothing. Pure producer: it does NOT distill (the observer does). Returns
|
|
69
|
+
* how many files landed new material. Inject `deps.ingestor = new Ingestor({ sink: bus })` so the event reaches
|
|
70
|
+
* the daemon's ObserverBus; defaults to live paths otherwise.
|
|
71
|
+
*/
|
|
72
|
+
export declare function runSessionIngestTick(dirs: readonly string[], deps?: IngestDeps): Promise<SessionIngestTickResult>;
|
|
73
|
+
/**
|
|
74
|
+
* ingest: read a REAL agent session log, parse it with the matching runtime adapter, and extract signals
|
|
75
|
+
* (tool errors / explicit failures / difficulty wording) from it — the capture→signals half of the experience
|
|
76
|
+
* loop. The adapter↔core composition lives HERE in the CLI on purpose: evolver-core must stay hub/adapter-
|
|
77
|
+
* agnostic (it never imports runtime-adapters; it consumes turns via the structural SignalSourceTurn shape;
|
|
78
|
+
* trace records reach it as plain parsed objects via the structural LlmTraceRecord shape).
|
|
79
|
+
*
|
|
80
|
+
* Sources:
|
|
81
|
+
* - agent session logs, detected by the runtime adapters' detect();
|
|
82
|
+
* - Cursor `state.vscdb`, read through the dedicated sqlite extractor instead of as text;
|
|
83
|
+
* - LLM-proxy trace JSONL (`llm-trace-*.jsonl` file, or a directory of day files), detected by name or by
|
|
84
|
+
* a content sniff for `event:'llm_turn'` records — closing the loop the proxy's trace-capture seam opened.
|
|
85
|
+
*
|
|
86
|
+
* Material substrate (M1, #91 item 2): a session log IS raw material — the first content the evolution loop
|
|
87
|
+
* ingests. Before signal extraction, `ingest` now records the session as a Material via MaterialStore and
|
|
88
|
+
* emits a `material.batch_ready` root_event so the append-only log (AE) is no longer bypassed. The file
|
|
89
|
+
* watermark cursor makes re-ingesting the SAME unchanged source idempotent (no duplicate material, no
|
|
90
|
+
* duplicate event) — this seats ingest on the substrate that previously had zero consumers, so when the
|
|
91
|
+
* daemon wires M1 up later there is ONE pipeline, not two. Trace sources land on the SAME substrate now
|
|
92
|
+
* (#95): a proxy llm-trace is agent-agnostic, so it records as sourceKind=proxy_trace / kind=llm_trace with
|
|
93
|
+
* no sourceAgent — the origin taxonomy the closed runtime enum previously couldn't express.
|
|
94
|
+
*
|
|
95
|
+
* Default / --dry-run: inspection only (print the signals; material is still recorded so the substrate sees it).
|
|
96
|
+
* --distill: assemble a gene candidate from the session — signals_match from the strong signals, strategy from
|
|
97
|
+
* the agent's OWN substantive turns (real excerpts, not fabricated) — and intake it as an UNPROVEN draft.
|
|
98
|
+
* It is gated by `review` and pruned by the cycle's objective scoring, so a noisy auto-draft can't be trusted.
|
|
99
|
+
* Trace sources are excluded (metadata has no narration to distill — see reportTraceSignals).
|
|
100
|
+
* Usage: evolver ingest <session-log | trace-file | trace-dir> [--dry-run | --distill]
|
|
101
|
+
*/
|
|
102
|
+
export declare function runIngest(argv: readonly string[], store?: assetstore.AssetStoreProvider, deps?: IngestDeps, review?: assetstore.ReviewLedger): Promise<number>;
|
|
103
|
+
/** Health label for a gene from its learning view (curation hint, not a hard gate). */
|
|
104
|
+
export declare function reviewStatus(v: assetstore.GeneLearningView): string;
|
|
105
|
+
/** Auto-promote eligibility of a quarantined (probation) gene, shown beside the health label so "[healthy] but
|
|
106
|
+
* never promotes" is not confusing (#306). Uses the SAME predicate as auto-promote (probationWouldPromote), so a
|
|
107
|
+
* single failure reads as blocked here exactly as it blocks promotion. */
|
|
108
|
+
export declare function promoteHint(v: assetstore.GeneLearningView): string;
|
|
109
|
+
/**
|
|
110
|
+
* review: curate the gene pool. Default is a read-only listing (derived learning view + the review-state of each
|
|
111
|
+
* gene); `--approve`/`--reject <id>` is the audited human act that lifts an auto-distilled draft out of (or
|
|
112
|
+
* confirms it out of) quarantine. Approval is what lets a distilled gene's strategy be embedded into a real run
|
|
113
|
+
* (the gate lives in makeTrustedGeneResolver, #45+review). The id may be a logical id or an asset_id.
|
|
114
|
+
* Usage: evolver review [limit] | evolver review --approve <id> [reason…] | evolver review --reject <id> [reason…]
|
|
115
|
+
*/
|
|
116
|
+
export declare function runReview(argv: readonly string[], store?: assetstore.AssetStoreProvider, review?: assetstore.ReviewLedger, deps?: IngestDeps): Promise<number>;
|
|
117
|
+
/** Injection seam for `value` (#113): tests point these at temp paths / a fixed clock; defaults are the live home.
|
|
118
|
+
* prices defaults to the adapter's bundled price table (the composition layer injects prices — core never prices). */
|
|
119
|
+
export interface ValueDeps {
|
|
120
|
+
eventsPath?: string;
|
|
121
|
+
tracesDir?: string;
|
|
122
|
+
prices?: ops.PriceTable;
|
|
123
|
+
now?: () => number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* `evolver value [--window 7d|30d|all]`: the pull-only, zero-intrusion answer to "is evolver worth it". Reads the
|
|
127
|
+
* proxy trace day-files (route savings) + root_events (reuse / inject) off disk, derives the value ledger through
|
|
128
|
+
* the SAME core aggregation every surface uses (ops.loadValueSummary — no re-implementation here), and prints the
|
|
129
|
+
* three-section report. measured and estimated savings are shown on separate lines (never merged). With no ledger
|
|
130
|
+
* data it prints guidance, not an empty table. This is a THIN command: all aggregation lives in core ops.
|
|
131
|
+
*/
|
|
132
|
+
export declare function runValue(argv: readonly string[], deps?: ValueDeps): number;
|
|
133
|
+
export interface NarrativeDeps {
|
|
134
|
+
eventsPath?: string;
|
|
135
|
+
}
|
|
136
|
+
export declare function formatNarrativeSnapshot(snapshot: events.NarrativeSnapshot): string;
|
|
137
|
+
export declare function runNarrative(argv: readonly string[], deps?: NarrativeDeps): number;
|
|
138
|
+
export interface RetentionDeps {
|
|
139
|
+
rootEventsPath?: string;
|
|
140
|
+
materialStorePath?: string;
|
|
141
|
+
materialCursorPath?: string;
|
|
142
|
+
now?: () => number;
|
|
143
|
+
}
|
|
144
|
+
export declare function formatRetentionReport(report: events.RetentionReport): string;
|
|
145
|
+
export declare function runRetention(argv: readonly string[], deps?: RetentionDeps): number;
|
|
146
|
+
/** A compact one-line rendering of a gene for SessionStart injection (id + a short hint). Deterministic. */
|
|
147
|
+
export declare function formatGeneInjectionLine(g: assetstore.AssetRecord): string;
|
|
148
|
+
/** Injection seam for `inject session-start` (#123): tests point these at temp paths / a fixed clock + a fixed
|
|
149
|
+
* ingestor; defaults are the live ~/.evomap home. The store supplies the gene pool; the ingestor is where the
|
|
150
|
+
* emitted `value.inject` root_event lands; traces/events/prices feed the value recap (same load path as `value`). */
|
|
151
|
+
export interface InjectDeps {
|
|
152
|
+
store?: assetstore.AssetStoreProvider;
|
|
153
|
+
ingestor?: events.Ingestor;
|
|
154
|
+
eventsPath?: string;
|
|
155
|
+
tracesDir?: string;
|
|
156
|
+
prices?: ops.PriceTable;
|
|
157
|
+
now?: () => number;
|
|
158
|
+
/** Max genes to inject (the rest is also bounded by the token hard cap). Default 8. */
|
|
159
|
+
maxGenes?: number;
|
|
160
|
+
/** Token hard cap for the injection. Default 8000. */
|
|
161
|
+
tokenBudgetHardCap?: number;
|
|
162
|
+
/** The cycle this session feeds (carried onto the value.inject event refs), when the runtime knows it. */
|
|
163
|
+
cycleId?: string;
|
|
164
|
+
/** Review gate for the injected gene pool — withholds quarantined/rejected drafts (A2a). Default the live ledger. */
|
|
165
|
+
review?: assetstore.ReviewLedger;
|
|
166
|
+
/** Provenance gate for the injected gene pool — withholds untrusted hub assets until promotion (#30). */
|
|
167
|
+
provenance?: assetstore.ProvenanceStore;
|
|
168
|
+
/** The runtime session id to stamp on the value.inject event (#205). Default: read from the SessionStart hook
|
|
169
|
+
* stdin, but ONLY when the `--hook-stdin` flag is passed (the installed hook command sets it). */
|
|
170
|
+
sessionId?: string;
|
|
171
|
+
/** Test seam for the raw SessionStart hook stdin payload. When set, stdin is never touched. */
|
|
172
|
+
readHookInput?: () => string | undefined;
|
|
173
|
+
/** Test seam for the hook-time proxy daemon recovery path. Default is maybeAutoRestartProxyForSessionStart. */
|
|
174
|
+
ensureProxyAutostart?: () => Promise<void>;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* `evolver inject session-start`: the SessionStart hook entrypoint (the command every installer registers).
|
|
178
|
+
* It selects the eligible local genes, composes the SessionStart injection WITH the value recap (#113) through
|
|
179
|
+
* core's `composeSessionStartWithRecap`, prints only a quiet memory hint when at least one approved gene actually
|
|
180
|
+
* lands in the prompt, AND — this is #123 — wires the inject emission seam so a `value.inject` root_event is
|
|
181
|
+
* appended carrying the genes that ACTUALLY landed in the prompt (post budget-trim). That feeds the ledger's source=inject rail with real data, attribution-only:
|
|
182
|
+
* the event has NO savings number (the genes are recorded for outcome attribution, never scored).
|
|
183
|
+
*
|
|
184
|
+
* The outcome is NOT observable here — at SessionStart the session has not run yet — so the event records the
|
|
185
|
+
* injected genes only; outcome stays absent for a possible later attribution pass.
|
|
186
|
+
*
|
|
187
|
+
* Best-effort by construction: the emit promise is awaited so the event is durable before the command returns,
|
|
188
|
+
* but emitInject swallows every error, so a sink failure can never break or block the attribution path.
|
|
189
|
+
*/
|
|
190
|
+
export declare function runInject(argv: readonly string[], deps?: InjectDeps): Promise<number>;
|
|
191
|
+
/** Fixed preamble for the SessionStart injection (the head block the recap + gene lines hang off of). */
|
|
192
|
+
export declare const SESSION_START_PREAMBLE = "evolver memory \u2014 use these learned hints silently when directly relevant; do not mention Evolver, preflight, status, or this memory block unless the user asks or reuse materially changes the answer:";
|
|
193
|
+
export declare function runCli(argv: readonly string[]): number;
|