23f7624596
ADR-166 MCP Bridge Security Lock / Static-source security lock (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / Compose default binds loopback + Mongo has auth (push) Failing after 2s
CodeQL Advanced / Analyze (rust) (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / plugin-agent-federation bindHost default (push) Failing after 1s
ADR-166 MCP Bridge Security Lock / Runtime behavior — 401 + terminal gate + fail-closed (push) Failing after 4s
business-pods-smoke / smoke (push) Failing after 1s
all-plugins-smoke / smoke-all (push) Failing after 2s
CI/CD Pipeline / Security & Code Quality (push) Failing after 1s
CI/CD Pipeline / Test Suite (ubuntu-latest) (push) Failing after 1s
CI/CD Pipeline / Build & Package (macos-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (ubuntu-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (windows-latest) (push) Has been skipped
CI/CD Pipeline / Documentation & Examples (push) Failing after 1s
Clone Tracker (14-day rolling) / Snapshot clones for ruflo ecosystem (push) Failing after 1s
CodeQL Advanced / Analyze (actions) (push) Failing after 1s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1s
federation-peer-rust / stable-noop (push) Failing after 1s
metaharness-ci / score (push) Failing after 1s
metaharness-ci / router-compat (push) Failing after 0s
metaharness-ci / similarity-tests (push) Failing after 0s
no-agentbbs-smoke / smoke-without-agentbbs (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (windows-latest) (push) Has been skipped
codex-integration-audit / Codex integration audit (push) Failing after 1s
helpers-manifest-guard / guard (push) Failing after 1s
🔗 Cross-Agent Integration Tests / 🤝 Agent Coordination Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🧠 Memory Sharing Integration (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🛡️ Fault Tolerance Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / ⚡ Performance Integration Tests (push) Has been skipped
metaharness-ci / mcp-scan (push) Failing after 1s
metaharness-ci / eject-dryrun (push) Failing after 1s
metaharness-ci / metaharness-real-data (push) Failing after 0s
no-cli-optdep-bloat-2561 / guard (push) Failing after 1s
no-metaharness-smoke / smoke-without-metaharness (push) Failing after 1s
no-phantom-agentic-flow-subpath / guard (push) Failing after 1s
🔄 Automated Rollback Manager / 🚨 Failure Detection (push) Failing after 1s
V3 CI/CD Pipeline / Plugin hooks smoke / ubuntu-latest / Node 22 (push) Failing after 1s
V3 CI/CD Pipeline / ruflo-graph-intelligence build + test smoke (#2044, ADR-123) (push) Failing after 1s
CVE Audit Gate / Audit root (critical-blocking) (push) Failing after 2s
cost-tracker-smoke / smoke (push) Failing after 3s
oia-audit-weekly / audit (push) Failing after 2s
ruflo-agent-smoke / ruflo-agent structural smoke (push) Failing after 1s
📊 Status Badges Update / 📊 Update Status Badges (push) Failing after 1s
V3 CI/CD Pipeline / Static regression guards (#2267 YAML + (push) Failing after 1s
V3 CI/CD Pipeline / Test V3 Packages (push) Failing after 0s
V3 CI/CD Pipeline / agent_execute provider routing smoke (#2042) (push) Failing after 0s
CVE Audit Gate / Audit v3 (critical-blocking) (push) Failing after 1s
federation-peer-rust / stable-native (push) Failing after 2s
🔗 Cross-Agent Integration Tests / 🚀 Integration Test Setup (push) Failing after 2s
neural-trader-smoke / runtime-smoke (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (macos-latest) (push) Has been skipped
V3 CI/CD Pipeline / Build V3 (ubuntu-latest) (push) Has been skipped
V3 CI/CD Pipeline / Type Check V3 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 24 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 22 (push) Failing after 2s
V3 CI/CD Pipeline / browser rvf create flag smoke (#2015) (push) Failing after 0s
V3 CI/CD Pipeline / Dependency review (#2046) (push) Has been skipped
V3 CI/CD Pipeline / Supply-chain audit (#2046) (push) Failing after 0s
V3 CI/CD Pipeline / witness marker drift smoke (#2021) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader portfolio CG smoke (#2068, ADR-126 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader backtest signing smoke (#2068, ADR-126 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / kg-extract type-import classification smoke (#2049) (push) Failing after 0s
V3 CI/CD Pipeline / witness verify precondition smoke (#1880) (push) Failing after 2s
V3 CI/CD Pipeline / neural-trader pipeline risk-gate smoke (#2068, ADR-126 Phase 5) (push) Failing after 0s
V3 CI/CD Pipeline / neural-trader feature attribution smoke (#2068, ADR-126 Phase 6) (push) Failing after 0s
V3 CI/CD Pipeline / plugin-registry signature verification smoke (#1922, CWE-347) (push) Failing after 4s
V3 CI/CD Pipeline / memory stats legacy-DB smoke (#2120) (push) Failing after 4s
V3 CI/CD Pipeline / github deprecated actions smoke (#2089, ADR-127 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / graph query + pathfinder smoke (ADR-130 P2+P5) (push) Has been skipped
V3 CI/CD Pipeline / graph trajectory hooks smoke (ADR-130 P3) (push) Has been skipped
V3 CI/CD Pipeline / graph plugin adapter smoke (ADR-130 P4) (push) Has been skipped
V3 CI/CD Pipeline / graph benchmark (ADR-130 P6) (push) Has been skipped
V3 CI/CD Pipeline / statusline generator delegation smoke (#2195) (push) Failing after 1s
V3 CI/CD Pipeline / wizard init regression guard (#2206 (push) Failing after 1s
V3 CI/CD Pipeline / memory no-stray-db smoke (ADR-125 P7) (push) Failing after 1s
V3 CI/CD Pipeline / github-safe injection smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github actions pin smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github attribution opt-in smoke (#2089, ADR-127 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / pre-bash hook safety smoke (#2017) (push) Failing after 1s
V3 CI/CD Pipeline / Memory import smoke / ubuntu-latest (push) Failing after 0s
V3 CI/CD Pipeline / MCP protocol smoke / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / ruvllm WASM auto-init smoke (#2086) (push) Failing after 4s
V3 CI/CD Pipeline / MCP paired-tool round-trip smoke (#1889) (push) Failing after 1s
V3 CI/CD Pipeline / Plugin package install-safety (#1902/#1903/#1904) (push) Failing after 1s
V3 CI/CD Pipeline / Tool description discoverability (ADR-112) (push) Failing after 3s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (22) (push) Failing after 1s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (24) (push) Failing after 1s
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Vector-index dimension audit (#1947) (push) Failing after 0s
V3 CI/CD Pipeline / Hook-command install safety (#1921) (push) Failing after 1s
V3 CI/CD Pipeline / ToolOutputGuardrail smoke (ADR-131, (push) Failing after 1s
V3 CI/CD Pipeline / init-bundle invariants smoke (#2095, ADR-128 Phase 5) (push) Failing after 1s
V3 CI/CD Pipeline / wasm provider bridge smoke (ADR-129 P1) (push) Failing after 2s
V3 CI/CD Pipeline / wasm gallery CRUD smoke (ADR-129 P3) (push) Failing after 1s
V3 CI/CD Pipeline / wasm plugin bridge smoke (ADR-129 P4) (push) Failing after 0s
V3 CI/CD Pipeline / wasm compose smoke (ADR-129 P2) (push) Failing after 4s
V3 CI/CD Pipeline / graph schema smoke (ADR-130 P1) (push) Failing after 0s
Validate Marketplace / validate (push) Failing after 1s
🔍 Verification Pipeline / 🚀 Setup Verification (push) Failing after 1s
🔍 Verification Pipeline / 🛡️ Security Verification (push) Has been skipped
🔍 Verification Pipeline / 📝 Code Quality (push) Has been skipped
🔍 Verification Pipeline / 🧪 Test Verification (${{ matrix.os }}, Node ${{ matrix.node }}) (push) Has been skipped
🔍 Verification Pipeline / 🏗️ Build Verification (push) Has been skipped
🔍 Verification Pipeline / 📚 Documentation Verification (push) Has been skipped
CVE Audit Gate / High-severity report (warn only) (push) Has been cancelled
🔄 Automated Rollback Manager / 🔄 Execute Rollback (push) Has been cancelled
🔄 Automated Rollback Manager / ✅ Post-Rollback Verification (push) Has been cancelled
🔄 Automated Rollback Manager / 📊 Rollback Monitoring (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / windows-latest (push) Has been cancelled
🔄 Automated Rollback Manager / ⏳ Manual Rollback Approval (push) Has been cancelled
V3 CI/CD Pipeline / MCP protocol smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Memory import smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / ubuntu-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Publish to npm (alpha) (push) Has been cancelled
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / macos-latest / Node 22 (push) Has been cancelled
V3 CI/CD Pipeline / Plugin hooks smoke / macos-latest / Node 22 (push) Has been cancelled
CI/CD Pipeline / Deploy & Release (push) Has been cancelled
CI/CD Pipeline / CI Status (push) Has been cancelled
🔗 Cross-Agent Integration Tests / 📊 Integration Test Report (push) Has been cancelled
🔄 Automated Rollback Manager / 🔍 Pre-Rollback Validation (push) Has been cancelled
🔍 Verification Pipeline / ⚡ Performance Verification (push) Has been cancelled
🔍 Verification Pipeline / 📊 Verification Report (push) Has been cancelled
169 lines
11 KiB
JavaScript
169 lines
11 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* A-P3b — flywheel generation-over-generation on REAL data, compounding, with a
|
|
* promotion rule strong enough that a win is genuinely PROVEN:
|
|
*
|
|
* BENCHMARK (frozen held-out) : a LARGE self-supervised self-retrieval set
|
|
* harvested from the real store (N big enough that a mean gain can clear
|
|
* the accept/v1+sig bootstrap significance term). Split disjointly into
|
|
* TRAIN (selection only) / HELD (frozen gate) / CANARY (deployment slice).
|
|
* GUARD (redblue) : the 10 human-labeled ADR-081 queries — a
|
|
* candidate must NOT regress human relevance (no Goodhart drift).
|
|
* CANARY : a separate harvested slice — no catastrophic
|
|
* per-item regression (deployment safety, distinct from the held-out).
|
|
*
|
|
* Selection on TRAIN, promotion gated on the FROZEN HELD-OUT (no leakage),
|
|
* multi-axis grid Evolve, winner → next baseline (compounding). Emits a real
|
|
* evolve-proof receipt bundle per generation; proves the run with
|
|
* reconstructLineage + mutationEffectiveness + detectPlateau. $0.
|
|
*
|
|
* Usage: node scripts/flywheel-generations.mjs [--generations N] [--sample M] [--dir <root>]
|
|
*/
|
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { dirname, join, resolve } from 'node:path';
|
|
import { performance } from 'node:perf_hooks';
|
|
|
|
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
|
|
const CLI_ROOT = resolve(SCRIPT_DIR, '..');
|
|
const d = (p) => join(CLI_ROOT, 'dist/src', p);
|
|
const { runRealEvolveRound, reconstructLineage, mutationEffectiveness, detectPlateau, verifyReceiptBundle } = await import(`file://${d('services/evolve-proof.js')}`);
|
|
const { harvestSelfSupervisedTasks } = await import(`file://${d('services/harness-corpus-harvester.js')}`);
|
|
const neural = await import(`file://${d('mcp-tools/neural-tools.js')}`);
|
|
const tool = neural.neuralTools.find((t) => t.name === 'neural_patterns');
|
|
if (!tool) { console.error('neural_patterns unavailable'); process.exit(1); }
|
|
|
|
const arg = (f, dflt) => { const i = process.argv.indexOf(f); return i > -1 ? process.argv[i + 1] : dflt; };
|
|
const MAX_GEN = Number(arg('--generations', 5));
|
|
const SAMPLE = Number(arg('--sample', 120));
|
|
const projectRoot = resolve(arg('--dir', CLI_ROOT));
|
|
const NOW0 = 1_700_000_200_000;
|
|
const FROZEN = 'harvested-selfsup-frozen-v1';
|
|
|
|
// ── Human relevance guard (ADR-081) ───────────────────────────────────────────
|
|
const RAW = [
|
|
['how was the Opus model alias fixed', ['opus 4.8', 'opus alias', 'opus model alias', '#2232']],
|
|
['self-learning wiring task-completed pretrain', ['self-learning', 'adr-074', '#2245', 'task-completed']],
|
|
['deterministic codemod engine var-to-const', ['deterministic tier-1 codemod', 'adr-143', 'codemod', 'var-to-const']],
|
|
['MCP server orphan leak parent-death', ['mcp orphan', 'parent-death', '#2234', 'orphan on every claude']],
|
|
['unified learning stats aggregator', ['unified learning-stats', 'adr-075']],
|
|
['structured distillation 4-field schema', ['structured distillation', 'adr-076', '4-field schema']],
|
|
['SQL injection migrate.ts table identifier', ['sql injection', 'migrate.ts', 'agentdb', 'cve']],
|
|
['recall@k HNSW benchmark harness', ['hnsw', 'recall@k', 'benchmark intelligence']],
|
|
['Q-learning encoder keyword block', ['q-state encoder', 'keyword block', '#2239', 'q-encoder']],
|
|
['security hardening crypto random IDs', ['cwe-347', 'crypto.randomuuid', 'random id', 'crypto random']],
|
|
];
|
|
const ANCHOR = RAW.map(([q, labels], i) => ({ id: `anchor-${i}`, q, labels }));
|
|
const isRel = (name, labels) => !!name && labels.some((s) => String(name).toLowerCase().includes(s.toLowerCase()));
|
|
function ndcg3(names, labels) {
|
|
const rel = names.slice(0, 3).map((n) => isRel(n, labels));
|
|
const dcg = rel.reduce((a, r, i) => a + (r ? 1 / Math.log2(i + 2) : 0), 0);
|
|
const num = rel.filter(Boolean).length; if (!num) return 0;
|
|
let idcg = 0; for (let i = 0; i < num; i++) idcg += 1 / Math.log2(i + 2);
|
|
return dcg / idcg;
|
|
}
|
|
|
|
// ── Large frozen self-supervised benchmark, split disjointly ──────────────────
|
|
const patterns = neural.getStorePatterns();
|
|
const harvested = harvestSelfSupervisedTasks(patterns, { sample: SAMPLE });
|
|
const nTrain = Math.floor(harvested.length * 0.4), nHeld = Math.floor(harvested.length * 0.4);
|
|
const TRAIN = harvested.slice(0, nTrain);
|
|
const HELD = harvested.slice(nTrain, nTrain + nHeld); // FROZEN — never used for selection
|
|
const CANARY = harvested.slice(nTrain + nHeld); // separate deployment slice
|
|
console.log(`store=${patterns.length} harvested=${harvested.length} → train=${TRAIN.length} held=${HELD.length} canary=${CANARY.length} anchor=${ANCHOR.length}`);
|
|
if (HELD.length < 20) { console.error('held-out too small for significance — need a bigger store/sample'); process.exit(1); }
|
|
|
|
const key = (c) => `a${c.alpha}_sw${c.subjectWeight}_mmr${c.mmrLambda}_bw${c.bodyWeight}_tp${c.typePenaltyFactor}`;
|
|
const cache = new Map();
|
|
async function ranked(qid, q, cfg) {
|
|
const ck = `${qid}::${key(cfg)}`;
|
|
if (cache.has(ck)) return cache.get(ck);
|
|
const r = await tool.handler({ action: 'search', query: q, mode: 'hybrid', limit: 5, rerank: false, ...cfg });
|
|
const out = (r.results || []).slice(0, 5).map((m) => ({ id: m?.id ?? '', name: m?.name ?? '' }));
|
|
cache.set(ck, out); return out;
|
|
}
|
|
const rr = (items, targetId) => { const i = items.findIndex((x) => x.id === targetId); return i >= 0 ? 1 / (i + 1) : 0; };
|
|
// self-retrieval reciprocal rank for a harvested task
|
|
async function selfRR(task, cfg) { return rr(await ranked(task.id, task.input.q, cfg), task.expected); }
|
|
const meanSelfRR = async (tasks, cfg) => { let s = 0; for (const t of tasks) s += await selfRR(t, cfg); return s / tasks.length; };
|
|
async function anchorMean(cfg) { let s = 0; for (const a of ANCHOR) s += ndcg3((await ranked(a.id, a.q, cfg)).map((x) => x.name), a.labels); return s / ANCHOR.length; }
|
|
|
|
const DEFAULTS = { alpha: 0.5, subjectWeight: 2, mmrLambda: 0.7, bodyWeight: 1, typePenaltyFactor: 1 };
|
|
function coarseGrid() {
|
|
const g = [];
|
|
for (const alpha of [0.3, 0.5, 0.7]) for (const subjectWeight of [1, 2, 3])
|
|
for (const mmrLambda of [0.5, 0.7, 0.9]) for (const bodyWeight of [1, 1.5]) for (const typePenaltyFactor of [1, 0.5])
|
|
g.push({ alpha, subjectWeight, mmrLambda, bodyWeight, typePenaltyFactor });
|
|
return g;
|
|
}
|
|
function localGrid(c) {
|
|
const ax = { alpha: [c.alpha, +(c.alpha - 0.1).toFixed(2), +(c.alpha + 0.1).toFixed(2)].filter((v) => v > 0 && v < 1),
|
|
subjectWeight: [...new Set([c.subjectWeight, Math.max(0.5, c.subjectWeight - 0.5), c.subjectWeight + 0.5])],
|
|
mmrLambda: [c.mmrLambda, +(c.mmrLambda - 0.1).toFixed(2), +(c.mmrLambda + 0.1).toFixed(2)].filter((v) => v >= 0 && v <= 1),
|
|
bodyWeight: [...new Set([c.bodyWeight, Math.max(0.5, c.bodyWeight - 0.5), c.bodyWeight + 0.5])],
|
|
typePenaltyFactor: [...new Set([c.typePenaltyFactor, Math.max(0.25, c.typePenaltyFactor - 0.25), Math.min(1, c.typePenaltyFactor + 0.25)])] };
|
|
const g = [], u = new Set();
|
|
for (const alpha of ax.alpha) for (const subjectWeight of ax.subjectWeight) for (const mmrLambda of ax.mmrLambda)
|
|
for (const bodyWeight of ax.bodyWeight) for (const typePenaltyFactor of ax.typePenaltyFactor) {
|
|
const cfg = { alpha, subjectWeight, mmrLambda, bodyWeight, typePenaltyFactor };
|
|
if (u.has(key(cfg))) continue; u.add(key(cfg)); g.push(cfg);
|
|
}
|
|
return g;
|
|
}
|
|
|
|
const bundles = [];
|
|
let champion = DEFAULTS, parent = null, promotions = 0;
|
|
const anchorBaseline = await anchorMean(DEFAULTS);
|
|
const t0 = performance.now();
|
|
for (let gen = 0; gen < MAX_GEN && promotions < 2; gen++) {
|
|
const grid = gen === 0 ? coarseGrid() : localGrid(champion);
|
|
// CONSTRAINED (multi-objective Pareto) selection: maximize self-retrieval on
|
|
// TRAIN *subject to* not regressing the human anchor — so we never pick a
|
|
// config that games the cheap metric at relevance's expense. Honest, not gaming.
|
|
const champTrain = await meanSelfRR(TRAIN, champion);
|
|
let cand = champion, candTrain = champTrain, considered = 0;
|
|
for (const c of grid) {
|
|
if (key(c) === key(champion)) continue;
|
|
if ((await anchorMean(c)) < anchorBaseline - 0.02) continue; // constraint: no anchor regression
|
|
considered++;
|
|
const s = await meanSelfRR(TRAIN, c);
|
|
if (s > candTrain + 1e-9) { candTrain = s; cand = c; }
|
|
}
|
|
|
|
// frozen held-out measurement (self-retrieval RR per task)
|
|
const holdout = [];
|
|
for (const t of HELD) holdout.push({ taskId: t.id, baselineScore: await selfRR(t, champion), candidateScore: await selfRR(t, cand) });
|
|
// separate canary slice: catastrophic per-item regression (> 0.5 RR drop)
|
|
let cRoll = 0; for (const t of CANARY) { if ((await selfRR(t, cand)) < (await selfRR(t, champion)) - 0.5) cRoll++; }
|
|
const canaryRollbackRate = CANARY.length ? cRoll / CANARY.length : 0;
|
|
// human-relevance guard: no anchor regression
|
|
const candAnchor = await anchorMean(cand);
|
|
const redblue = candAnchor >= anchorBaseline - 0.02 ? 'PASS' : 'FAIL';
|
|
|
|
const bundle = runRealEvolveRound({ baseline: champion, candidate: cand, holdout, generation: gen, parent, branch: 'main', now: NOW0 + gen * 1000, redblue, canaryRollbackRate, corpus: FROZEN });
|
|
bundles.push(bundle);
|
|
const p = bundle.decisionReceipt.promoted;
|
|
console.log(`gen ${gen}: cand=${key(cand)} anchorSafeConsidered=${considered} heldΔ=${bundle.deltas.benchmark.toFixed(4)} CIlow=${bundle.decisionReceipt.deltaCILow.toFixed(4)} sig=${bundle.decisionReceipt.significant} canaryRoll=${canaryRollbackRate.toFixed(3)} anchor=${candAnchor.toFixed(3)}(base ${anchorBaseline.toFixed(3)}) redblue=${redblue} promoted=${p} ${p ? '' : bundle.decisionReceipt.reason}`);
|
|
if (p) { champion = cand; parent = bundle.candidateManifestHash; promotions++; }
|
|
}
|
|
const elapsed = ((performance.now() - t0) / 1000).toFixed(0);
|
|
|
|
const lineage = reconstructLineage(bundles);
|
|
const plateau = detectPlateau(bundles, { window: 3 });
|
|
console.log(`\n=== REAL LINEAGE (${elapsed}s, ${bundles.length} gens) ===`);
|
|
console.log(`promotions=${lineage.promotions} rejections=${lineage.rejections} lineageIntact=${lineage.lineageIntact} allReplayable=${lineage.allReplayable} rootHash=${(lineage.rootHash || '').slice(0, 22)}…`);
|
|
console.log('mutationEffectiveness:', JSON.stringify(mutationEffectiveness(bundles)));
|
|
console.log('plateau:', plateau.status, '-', plateau.rationale);
|
|
console.log('independent replay:', bundles.map((b, i) => `g${i}:${verifyReceiptBundle(b).valid}`).join(' '));
|
|
|
|
const outDir = join(projectRoot, '.claude', 'evolve-proof');
|
|
mkdirSync(outDir, { recursive: true });
|
|
bundles.forEach((b, i) => writeFileSync(join(outDir, `real-generation-${i}.json`), JSON.stringify(b, null, 2) + '\n'));
|
|
|
|
const milestone = lineage.promotions >= 2 && lineage.lineageIntact && lineage.allReplayable;
|
|
console.log('='.repeat(70));
|
|
console.log(milestone
|
|
? `MILESTONE MET: ${lineage.promotions} real, significant, independently-replayable promotions chained to the immutable root — the flywheel turns.`
|
|
: `MILESTONE NOT MET: ${lineage.promotions} promotion(s); plateau=${plateau.status}. Honest — no faked pass.`);
|
|
process.exit(milestone ? 0 : 3);
|