import {test} from 'node:test'; import assert from 'node:assert/strict'; import {readFileSync} from 'node:fs'; const read = path => readFileSync(path, 'utf8'); export const views = { 'strategy-roadmap': ['skills', 'autonomy'], 'strategy-roadmap-adoption': ['delivery', 'remaining'], 'strategy-roadmap-loop': ['understand', 'baseline', 'topology', 'use', 'collect', 'reassess'], }; test('Roadmap has three visual levels and preserves human direction and Delivery discovery', () => { const page = read('docs/strategy/roadmap.mdx'); const visible = page.split('
')[0]; assert.deepEqual([...visible.matchAll(/ m[1]), Object.keys(views)); assert.deepEqual([...visible.matchAll(/^## (.+)$/gm)].map(m => m[1]), ['Two stages toward Target', 'Stage 1: Delivery first', 'Improve within each phase', 'Delivery in practice']); for (const marker of ['Humans direct, guide and review throughout', 'standardizes skills', 'foundation for Stage 2', 'future Autonomous Agent', 'not deployed autonomy', 'order is not yet decided', 'Delivery keeps improving', 'not as six global roadmap stages', 'what skills exist, how they relate, when they are used and how they work together', 'codebase structure', 'existing principles', 'system-logic source', 'tests', 'builds and packaging', 'deployments', 'practices, tooling, controls and problems', 'metrics/KPIs and a baseline', 'friction and feedback', './measurement/index.mdx', './target-operating-model.mdx']) assert(visible.includes(marker), marker); for (const marker of ['revocation','exact-artifact approvals','idempotency','human takeover','sensitive decisions','security findings','reproducible baseline']) assert(page.includes(marker), marker); assert(!/## [1-5]\.|Prepare foundations|Sustain and improve/.test(page)); }); for (const [name, ids] of Object.entries(views)) test(`${name}: native graph, mobile parity and loop semantics`, () => { const variants = ['', '-mobile'].map(suffix => JSON.parse(read(`diagrams/${name}${suffix}.workflow.json`))); for (const [index, d] of variants.entries()) { assert.equal(d.schema_version, 2); assert.equal(d.diagram_type, 'workflow'); assert.deepEqual(d.mainPath, ids.length === 6 ? ids.slice(0,3) : ids); assert.deepEqual(d.nodes.map(n => n.id), ids); assert.deepEqual(d.edges.filter(e => e.role === 'main').map(e => [e.from,e.to]), ids.slice(1).map((id,i) => [ids[i],id])); assert.deepEqual(d.edges.filter(e => e.role === 'return').map(e => [e.from,e.to]), ids.length === 6 ? [['reassess','understand']] : []); if (index) assert(d.nodes.every(n => n.col === 0)); assert(d.nodes.every(n => n.sublabel && !n.tag && n.height === 240)); } const semantics = d => ({nodes:d.nodes.map(({col,yOffset,...n}) => n), edges:d.edges.map(({fromSide,toSide,route,...e}) => e)}); assert.deepEqual(semantics(variants[0]),semantics(variants[1])); });