flow-muse-commit-pilot-integration.test.mjs
57 lines 2.1 KB
Raw
sha256:8915fe406161f95c1681f9469375e7bae5b28c884f00bedbdef65e4b0cd0738d docs(flow): commit FLOW-V0-SPEC.md hygiene for 7A-INT merge Human 1 day ago
1 /**
2 * Integration tests — pilot evidence on disk + generator parity (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 assertPilotEvidencePathsExist,
13 loadAndValidatePilotProjection,
14 assertCleanAntiDriftDiff,
15 MUSE_COMMIT_PILOT_EVIDENCE_REL,
16 } from '../lib/flow/muse-commit-pilot-evidence.mjs';
17
18 const REPO_ROOT = join(fileURLToPath(new URL('.', import.meta.url)), '..');
19
20 describe('flow-muse-commit-pilot (integration, 7A-14)', () => {
21 it('evidence directory contains pilot workspace, artifacts, and driver', () => {
22 const result = assertPilotEvidencePathsExist(REPO_ROOT);
23 assert.equal(result.ok, true, result.ok ? '' : `missing: ${result.missing?.join(', ')}`);
24 });
25
26 it('pilot-workspace projections carry v0.2.0 marker after pilot run', () => {
27 loadAndValidatePilotProjection(REPO_ROOT, 'overseer.AGENTS.md', '0.2.0');
28 loadAndValidatePilotProjection(REPO_ROOT, 'overseer.cursor.mdc', '0.2.0');
29 });
30
31 it('anti-drift diffs in artifacts/ are clean (marker + one content line)', () => {
32 const runbookDiff = readFileSync(
33 join(REPO_ROOT, MUSE_COMMIT_PILOT_EVIDENCE_REL, 'artifacts', 'overseer.runbook.v1-to-v2.diff'),
34 'utf8',
35 );
36 const cursorDiff = readFileSync(
37 join(REPO_ROOT, MUSE_COMMIT_PILOT_EVIDENCE_REL, 'artifacts', 'overseer.cursor.v1-to-v2.diff'),
38 'utf8',
39 );
40 assert.deepEqual(assertCleanAntiDriftDiff(runbookDiff), { ok: true });
41 assert.deepEqual(assertCleanAntiDriftDiff(cursorDiff), { ok: true });
42 });
43
44 it('transcript records muse commit SHAs before and after pilot commits', () => {
45 const before = readFileSync(
46 join(REPO_ROOT, MUSE_COMMIT_PILOT_EVIDENCE_REL, 'artifacts', 'muse-sha-before.txt'),
47 'utf8',
48 );
49 const after = readFileSync(
50 join(REPO_ROOT, MUSE_COMMIT_PILOT_EVIDENCE_REL, 'artifacts', 'muse-sha-after.txt'),
51 'utf8',
52 );
53 assert.match(before, /sha256:[a-f0-9]{64}/);
54 assert.match(after, /sha256:[a-f0-9]{64}/);
55 assert.notEqual(before, after);
56 });
57 });
File History 1 commit
sha256:8915fe406161f95c1681f9469375e7bae5b28c884f00bedbdef65e4b0cd0738d docs(flow): commit FLOW-V0-SPEC.md hygiene for 7A-INT merge Human 1 day ago