docs: align published presentation and verify horizon source traceability
Build and publish Eldorado documentation / build (pull_request) Successful in 48s
Build and publish Eldorado documentation / build (pull_request) Successful in 48s
This commit is contained in:
1 parent
d8feeba025
commit
f23bf1c5f4
7 files changed
+60
-28
No files matched your search
@@ -63,7 +63,7 @@ const views = {
|
||||
if(await frame.locator('html').getAttribute('data-theme')!==theme) {
|
||||
await frame.locator('#btn-theme').focus(); await page.keyboard.press('Enter');
|
||||
}
|
||||
await page.waitForFunction(t=>document.documentElement.dataset.theme===t,theme);
|
||||
await page.waitForFunction(t=>document.documentElement?.dataset.theme===t,theme);
|
||||
const inline=await inspect(frame,name,width<1100);
|
||||
await frame.locator('#btn-preset').focus();await page.keyboard.press('Enter');
|
||||
await frame.locator('[data-preset-value="blueprint"]').focus();await page.keyboard.press('Enter');
|
||||
@@ -93,7 +93,7 @@ const views = {
|
||||
const close=panel.getByRole('button',{name:'Close full-screen diagram',exact:true});await close.waitFor({state:'visible'});
|
||||
const fullIframe=panel.locator('dialog iframe');
|
||||
const fullscreen=await (await fullIframe.elementHandle()).contentFrame();
|
||||
await fullscreen.waitForFunction(t=>document.documentElement.dataset.theme===t,theme);
|
||||
await fullscreen.waitForFunction(t=>document.documentElement?.dataset.theme===t,theme);
|
||||
const expanded=await inspect(fullscreen,name,width<1000);
|
||||
await page.screenshot({path:`${output}/${width}-${theme}-${name}-fullscreen.png`});
|
||||
await close.focus();await page.keyboard.press('Escape');
|
||||
|
||||
@@ -61,7 +61,7 @@ const fs = require('node:fs');
|
||||
assert.equal(response.status(), 200);
|
||||
assert.equal(await page.locator('h1').innerText(), 'Roadmap');
|
||||
const headings = page.locator('.strategy-content > h2');
|
||||
assert.deepEqual((await headings.allTextContents()).map(s => s.replace(/\u200b/g, '')), ['Six months, two investment decisions','Delivery first, replication only if earned','Keep one learning loop','Solo capacity and influence']);
|
||||
assert.deepEqual((await headings.allTextContents()).map(s => s.replace(/\u200b/g, '')), ['Two stages toward the long-term Target','Stage 1: Delivery first','Improve within each phase','Delivery in practice']);
|
||||
const text = await page.locator('.strategy-content').innerText();
|
||||
for (const marker of ['Humans direct, guide and review throughout', 'Delivery keeps improving', 'system-logic source', 'baseline', 'Target operating model']) assert(text.includes(marker), marker);
|
||||
assert(!text.includes('Supporting gate evidence and hold conditions\n\nThese are'));
|
||||
@@ -125,7 +125,7 @@ const fs = require('node:fs');
|
||||
const [download] = await Promise.all([page.waitForEvent('download'), frame.locator('[data-format="svg"]').click()]);
|
||||
assert.equal(await download.failure(), null);
|
||||
await download.saveAs(`${output}/${width}.svg`);
|
||||
assert(fs.readFileSync(`${output}/${width}.svg`, 'utf8').includes('Learn and test'));
|
||||
assert(fs.readFileSync(`${output}/${width}.svg`, 'utf8').includes('Adopt skills'));
|
||||
assert(fs.readFileSync(`${output}/${width}.svg`, 'utf8').includes('eldorado-roadmap-typography'));
|
||||
for (const id of ['skills','autonomy']) {
|
||||
await frame.locator(`svg[role="img"] [data-node-id="${id}"]`).screenshot({path:`${output}/${width}-${id}-card.png`});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {mkdir,copyFile,writeFile} from 'node:fs/promises';
|
||||
import {mkdir,copyFile,writeFile,readFile} from 'node:fs/promises';
|
||||
import {createHash} from 'node:crypto';
|
||||
import {slides} from '../presentations/less-prompting-more-shipping/slides.mjs';
|
||||
const root='presentations/less-prompting-more-shipping';
|
||||
const out=`static/${root}`;
|
||||
@@ -13,5 +14,9 @@ await writeFile(`${out}/index.html`,`<!doctype html><html lang="en"><head><meta
|
||||
<div class="reveal deck"><div class="slides">${slides.map((s,i)=>`<section id="${s.id}" class="${s.kind}" data-timing="${s.minutes*60}" ${s.kind==='dark'?'data-background-color="#1f1f29"':''}><p class="eyebrow">ELDORADO / ${i===17?'DISCUSSION':i===18?'REFERENCE':'AI STRATEGY'}</p><${i?'h2':'h1'}>${s.title}</${i?'h2':'h1'}>${s.body}<aside class="notes"><p><strong>${s.minutes} minutes.</strong> ${esc(s.notes)}</p><p>Sources: ${esc(s.sources.join('; '))}.</p></aside></section>`).join('\n')}</div></div>
|
||||
<script src="./assets/reveal.js"></script><script src="./assets/notes.js"></script><script src="./runtime.js"></script></body></html>`);
|
||||
await copyFile(`${root}/runtime.js`,`${out}/runtime.js`);
|
||||
await writeFile(`${out}/source-map.json`,JSON.stringify({version:'1.0.0',strategyRevision:'fcaa84f3bf9058f4ede0a097d16d0e3571590a6b',assignment:'AI_Architect_Test_Task.pdf',talkMinutes:slides.slice(0,17).reduce((a,s)=>a+s.minutes,0),discussionMinutes:15,slides:slides.map(({id,title,minutes,sources},i)=>({number:i+1,id,title,minutes,sources}))},null,2));
|
||||
const sourceDocuments = await Promise.all([...new Set(slides.flatMap(s=>s.sources).filter(s=>!s.startsWith('PDF:')))].sort().map(async id=>{
|
||||
const path=`docs/strategy/${id==='measurement'?'measurement/index':id}.mdx`;
|
||||
return {id,path,route:`/strategy/${id}/`,sha256:createHash('sha256').update(await readFile(path)).digest('hex')};
|
||||
}));
|
||||
await writeFile(`${out}/source-map.json`,JSON.stringify({version:'1.0.1',strategyRevision:'same-build; exact source hashes below; deployed revision in ../../revision.txt',strategyOrigins:{longTerm:'88a43757762114a506f57ed4b44484306cae1aaa',assignment:'fcaa84f3bf9058f4ede0a097d16d0e3571590a6b',horizonCorrection:'1557813737941901572'},sourceDocuments,assignment:'AI_Architect_Test_Task.pdf',talkMinutes:slides.slice(0,17).reduce((a,s)=>a+s.minutes,0),discussionMinutes:15,slides:slides.map(({id,title,minutes,sources},i)=>({number:i+1,id,title,minutes,sources:[...new Set(sources)]}))},null,2));
|
||||
console.log(`Built ${slides.length} local Reveal.js slides at ${out}`);
|
||||
@@ -1,6 +1,7 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {readFileSync} from 'node:fs';
|
||||
import {createHash} from 'node:crypto';
|
||||
import {execFileSync} from 'node:child_process';
|
||||
import {slides} from '../presentations/less-prompting-more-shipping/slides.mjs';
|
||||
const read=p=>readFileSync(p,'utf8');
|
||||
@@ -24,4 +25,11 @@ test('build emits local pinned Reveal assets, stable IDs and no production CDN',
|
||||
assert.match(read(`${dir}/runtime.js`),/hash:true/);
|
||||
assert.equal(JSON.parse(read('package.json')).dependencies['reveal.js'],'5.2.1');
|
||||
assert.match(read('src/pages/index.tsx'),/Open presentation/);
|
||||
const map=JSON.parse(read(`${dir}/source-map.json`));
|
||||
assert.equal(map.version,'1.0.1');
|
||||
assert.match(map.strategyRevision,/same-build/);
|
||||
for(const doc of map.sourceDocuments) assert.equal(doc.sha256,createHash('sha256').update(read(doc.path)).digest('hex'),doc.path);
|
||||
for(const id of ['target-operating-model','roadmap','six-months-target','six-months-roadmap','stage-02-autonomous-agent']) assert(map.sourceDocuments.some(d=>d.id===id),id);
|
||||
assert(slides.find(s=>s.id==='beyond').notes.includes('long-term destination remains human-directed'));
|
||||
for(const id of ['months-one-two','months-three-four','months-five-six','capacity','experiment','inconclusive','stop']) assert(slides.find(s=>s.id===id).sources.includes('six-months-roadmap'),id);
|
||||
});
|
||||
Reference in new issue
Block a user