flow-muse-commit-pilot-performance.test.mjs
33 lines 1.3 KB
Raw
sha256:8915fe406161f95c1681f9469375e7bae5b28c884f00bedbdef65e4b0cd0738d docs(flow): commit FLOW-V0-SPEC.md hygiene for 7A-INT merge Human 11 hours ago
1 /**
2 * Performance — evidence validators stay fast on pilot artifact sizes (7A-14).
3 */
4
5 import { describe, it } from 'node:test';
6 import assert from 'node:assert/strict';
7 import { readFileSync } from 'node:fs';
8 import { join } from 'node:path';
9 import { fileURLToPath } from 'node:url';
10
11 import {
12 assertNoSecretLeakageInProjection,
13 assertCleanAntiDriftDiff,
14 MUSE_COMMIT_PILOT_EVIDENCE_REL,
15 } from '../lib/flow/muse-commit-pilot-evidence.mjs';
16
17 const REPO_ROOT = join(fileURLToPath(new URL('.', import.meta.url)), '..');
18 const ART = join(REPO_ROOT, MUSE_COMMIT_PILOT_EVIDENCE_REL, 'artifacts');
19 const WS = join(REPO_ROOT, MUSE_COMMIT_PILOT_EVIDENCE_REL, 'pilot-workspace');
20
21 describe('flow-muse-commit-pilot (performance, 7A-14)', () => {
22 it('100 secret scans + diff checks complete under 500ms p95 budget', () => {
23 const runbook = readFileSync(join(WS, 'overseer.AGENTS.md'), 'utf8');
24 const diff = readFileSync(join(ART, 'overseer.runbook.v1-to-v2.diff'), 'utf8');
25 const start = performance.now();
26 for (let i = 0; i < 100; i += 1) {
27 assertNoSecretLeakageInProjection(runbook);
28 assertCleanAntiDriftDiff(diff);
29 }
30 const elapsed = performance.now() - start;
31 assert.ok(elapsed < 500, `elapsed ${elapsed}ms exceeds 500ms budget`);
32 });
33 });
File History 1 commit
sha256:8915fe406161f95c1681f9469375e7bae5b28c884f00bedbdef65e4b0cd0738d docs(flow): commit FLOW-V0-SPEC.md hygiene for 7A-INT merge Human 11 hours ago