mirror of
https://github.com/ruvnet/RuView
synced 2026-08-09 20:21:43 +00:00
1b220c8d53
Mints a real MetaHarness (via vendor/metaharness's published `npx metaharness analyze --scaffold`, template vertical:coding, host claude-code) for the wifi-densepose-sar crate: architect/implementer/ reviewer/test-writer agents, doctor/review-diff commands, MCP server, Claude Code plugin -- following the same pattern as harness/ruview/ (ADR-182) and harness/homecore/ (ADR-285). Adds real wiring for the three pieces this was scoped around: - Darwin Mode (@metaharness/darwin) -- wired by the scaffold itself (npm run evolve / evolve:dry). - Router (@metaharness/router) -- src/router.ts, a real k-NN cost-optimal Router over two example model tiers. Its labelled examples are illustrative seed data (see the file's honesty note), not measured eval-log observations; the routing mechanism itself is real and tested. - Flywheel (@metaharness/flywheel) -- src/flywheel.ts, the real propose/evaluate/gate/promote loop wired with a SYNTHETIC proposer and evaluator (dataSource: 'SYNTHETIC', no model call). Proves the wiring end-to-end: a real signed, independently-replayable lineage, promoting each generation once the evaluator's noopRate actually moves (the default gate requires it to strictly improve -- a constant noopRate, even a "good" one, blocks every promotion forever, which the first version of this evaluator hit and the final version fixes). 14/14 tests pass (5 router + 5 flywheel + 4 install-smoke), `npm run build` clean under strict TypeScript, CLI commands (route, flywheel) verified manually. `.harness/manifest.json` is stale relative to the router/flywheel additions -- this scaffold has no manifest:update script (unlike harness/homecore/); documented as a known gap in the harness's own README.
38 lines
1.5 KiB
TypeScript
38 lines
1.5 KiB
TypeScript
// SPDX-License-Identifier: MIT
|
|
import { describe, it, expect } from 'vitest';
|
|
import { runSarFlywheelDemo, verifySarFlywheelDemo, SAR_ROOT_POLICY } from '../src/flywheel.js';
|
|
|
|
describe('runSarFlywheelDemo — @metaharness/flywheel wiring (SYNTHETIC data)', () => {
|
|
it('runs the configured number of generations and stamps SYNTHETIC provenance', async () => {
|
|
const result = await runSarFlywheelDemo(3);
|
|
expect(result.generationsRun).toBeGreaterThan(0);
|
|
expect(result.generationsRun).toBeLessThanOrEqual(3);
|
|
expect(result.replayBundle.data_source).toBe('SYNTHETIC');
|
|
});
|
|
|
|
it('produces a non-empty lift curve rooted at the initial policy', async () => {
|
|
const result = await runSarFlywheelDemo(3);
|
|
expect(result.liftCurve.length).toBeGreaterThan(0);
|
|
expect(result.liftCurve[0].generation).toBe(0);
|
|
});
|
|
|
|
it('the final policy still carries every root lever', async () => {
|
|
const result = await runSarFlywheelDemo(2);
|
|
for (const key of Object.keys(SAR_ROOT_POLICY)) {
|
|
expect(result.finalPolicy).toHaveProperty(key);
|
|
}
|
|
});
|
|
|
|
it('the replay bundle independently verifies (no trust in the producer)', async () => {
|
|
const result = await runSarFlywheelDemo(3);
|
|
const verdict = verifySarFlywheelDemo(result);
|
|
expect(verdict.pass).toBe(true);
|
|
});
|
|
|
|
it('is deterministic in structure across repeated runs (same generations requested)', async () => {
|
|
const a = await runSarFlywheelDemo(2);
|
|
const b = await runSarFlywheelDemo(2);
|
|
expect(a.generationsRun).toBe(b.generationsRun);
|
|
});
|
|
});
|