Build and publish Eldorado documentation / build (pull_request) Successful in 1m30s
35 lines
2.8 KiB
JavaScript
35 lines
2.8 KiB
JavaScript
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('<details>')[0];
|
|
assert.deepEqual([...visible.matchAll(/<ArchifyDiagram name="([^"]+)"/g)].map(m => m[1]), Object.keys(views));
|
|
assert.deepEqual([...visible.matchAll(/^## (.+)$/gm)].map(m => m[1]), ['Six months, two investment decisions', 'Delivery first, replication only if earned', 'Keep one learning loop', 'Solo capacity and influence']);
|
|
for (const marker of ['Humans direct, guide and review throughout', 'current', 'AI-assisted practice', 'One active live pilot at a time', 'Month 1', 'Month 2', 'Month 3', 'Month 4', 'Month 5', 'Month 6', 'Delivery keeps improving', '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', 'retain/change/hold/stop', './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]));
|
|
});
|