In this section
- Iterations — 43 Registry Growth render · galaxies-wafers / iterations/43-registry-growth/app.mjs lines 441–555
- Growth render · galaxies-wafers / iterations/43-registry-growth/growth.css lines 1–65
- Iterations — 43 Registry Growth Page render · galaxies-wafers / iterations/43-registry-growth/index.html lines 1–81
- Iterations — 47 Federation Honesty render · galaxies-wafers / iterations/47-federation-honesty/app.mjs lines 1–301
- Green render · galaxies-wafers / iterations/47-federation-honesty/green.css lines 1–26
- Iterations — 47 Federation Honesty Page render · galaxies-wafers / iterations/47-federation-honesty/index.html lines 1–68
- UK Energy Tracking V6 — Generation History Page render · gb-electricity-ui / uk_energy_tracking_v6/generation_history/index.html lines 1–27
Iterations — 43 Registry Growth
A JavaScript module in Galaxies Wafers using data from GitHub API. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/. It fetches queue (`FetchQueue`), fetches once (`fetchOnce`) and paints machine (`paintMachine`).
rendergalaxies-wafers / iterations/43-registry-growth/app.mjs · lines 441–555 of 555 (continued from section 768) · Entry point · pattern fillQuestions (shared by 2 files)
- What it does
- It draws its content. Defines 41 functions or classes, including $, el, fmt, when, FetchQueue. Side effects: changes the web page (DOM); makes network requests.
- Why it exists in the grid workflow
- Domain stage upstream_foresight (topic 'markets-data'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. README: "The page (`index.html`, `app.mjs`, `lib.mjs`) is inherited unchanged from testcode/202609151339."
- Inputs & outputs
- In: data source: GitHub API; JSON file latest.json; JSON file graph_latest.json. Out: canvas drawing.
- Downstream impact
- Used directly by 1 file: Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/). Reached from 1 other entry point, including Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/.
- What it achieves
- How the Estate Grew: the page. It responds to click, pointerdown and pointermove events.
- Why it matters
- Loaded by the page of the same name at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/.
- Application
- galaxies-wafers · iterations/43-registry-growth · JavaScript module
- Uses
- ./registry.mjs
- Used by
- loaded by Iterations — 43 Registry Growth Page (script src)
- Produces
- $, el, fmt, when, FetchQueue, fetchOnce, label, paintMachine, hydrateListing, hydrateSnapshot, missingTop, openTimeline
- Defines here
- row, openCheck, show, fillSummary, fillQuestions
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/43-registry-growth/app.mjs:441-555 · blob 1dc7911810af8a6659b97d4c1a5d29a5635513c9 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, network · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
card.hidden = false;
const p = G.parseNodeId(n.id);
$('g-kind').textContent = p.kind === 'repo' ? 'REPOSITORY' : p.kind === 'file' ? 'FILE' : 'NODE';
$('g-label').textContent = n.label || n.id;
const kv = $('g-kv'); kv.textContent = '';
const row = (k, v) => { if (v == null || v === '') return; kv.append(el('dt', null, k), el('dd', null, String(v))); };
row('id', n.id); row('kind', n.kind); row('layer', n.layer); row('subtitle', n.subtitle); row('x, y', `${n.x}, ${n.y}`);
const edges = graph.value.edges || [];
row('edges out', edges.filter(e => e.from === n.id).length); row('edges in', edges.filter(e => e.to === n.id).length);
const L = listing.value; const newest = L && L.versions[L.versions.length - 1]; const s = newest != null && SNAP.get(newest) && SNAP.get(newest).sum;
if (s && p.repo) {
const e = s.repos.get(p.repo);
if (p.kind === 'repo') row(`v${G.pad4(newest)} entry`, e ? `${e.role} · ${fmt(e.counted)} files counted · branch ${e.default_branch}` : 'no entry with this name');
else row(`in v${G.pad4(newest)}`, e && e.paths.has(p.path) ? 'this path is listed' : 'this path is not listed');
} else row('snapshot entry', 'not yet known: open section 1 or 4 to read the newest snapshot');
const gh = `https://github.com/${OWNER}/`;
const isOurs = p.repo && typeof n.source === 'string' && n.source.startsWith(gh + p.repo);
const open = $('g-open');
if (isOurs) { open.hidden = false; open.href = gh + encodeURIComponent(p.repo); open.textContent = `Open ${p.repo} on GitHub`; } else open.hidden = true;
const src = $('g-source');
if (p.kind === 'file' && typeof n.source === 'string' && n.source.startsWith(gh)) { src.hidden = false; src.href = n.source; } else src.hidden = true;
}
$('g-files').addEventListener('change', e => { graph.showFiles = e.target.checked; if (!graph.showFiles && graph.sel && String(graph.sel.id).startsWith('file::')) { graph.sel = null; showCard(null); } requestDraw(); });
$('g-fit').addEventListener('click', fit);
window.addEventListener('resize', () => { if ($('sec-graph').open) requestDraw(); });
/* ── 4. consistency ──────────────────────────────────────────────────────── */
let checked = false;
async function openCheck() {
if (checked) return; checked = true;
const ul = $('rows-check');
label('check', 'LOAD', 'listing, latest.json, graph_latest.json, newest snapshot');
const [L, latest, g, head] = await Promise.all([
hydrateListing().catch(e => ({ err: e.message })),
fetchOnce(RAW + 'registry/latest.json').catch(e => ({ err: e.message })),
hydrateGraph().catch(e => ({ err: e.message })),
fetchOnce(`${API}commits/main`).catch(e => ({ err: e.message })),
]);
const listed = L && !L.err && L.fromListing ? L.versions[L.versions.length - 1] : null;
const newest = L && !L.err ? L.versions[L.versions.length - 1] : null;
let s = null, sErr = null;
if (newest != null) { try { s = await hydrateSnapshot(newest); if (TL.size) { fillRow(newest, s); countTimeline(); } } catch (e) { sErr = e.message; } }
const lt = latest && !latest.err ? latest : null; const gr = g && !g.err ? g : null;
const why = [L && L.err && `listing: ${L.err}`, L && !L.err && !L.fromListing && `listing: ${L.method}`, latest && latest.err && `latest.json: ${latest.err}`, g && g.err && `graph_latest.json: ${g.err}`, sErr && `snapshot: ${sErr}`, head && head.err && `main head: ${head.err}`].filter(Boolean);
const f = gr ? graph.facts : null;
const nv = newest != null ? `v${G.pad4(newest)}` : 'the newest snapshot';
let subtitleMatch = null, pathsFound = null, inside = null;
if (gr && s) {
subtitleMatch = f.repoNodes.filter(n => { const p = G.parseRepoSubtitle(n.subtitle); const e = s.repos.get(G.parseNodeId(n.id).repo); return p && e && p.files === e.counted && p.branch === e.default_branch; }).length;
pathsFound = f.fileNodes.filter(n => { const p = G.parseNodeId(n.id); const e = s.repos.get(p.repo); return e && e.paths.has(p.path); }).length;
}
if (gr && gr.canvas && Number.isFinite(gr.canvas.width) && Number.isFinite(gr.canvas.height)) inside = (gr.nodes || []).filter(n => n.x >= 0 && n.y >= 0 && n.x <= gr.canvas.width && n.y <= gr.canvas.height).length;
const rows = [
G.check('Newest numbered file in registry/ and latest.json authoritative_version', listed, lt ? lt.authoritative_version : null, 'largest NNNN among registry_vNNNN.json in the directory listing, against the pointer'),
G.check('latest.json json_path and the newest numbered file', lt ? lt.json_path : null, newest != null && listed != null ? 'registry/' + G.snapshotName(newest) : null, 'the pointer names a file; it is not a copy of it'),
G.check(`${nv} registry_version and its file number`, s ? s.registry_version : null, s ? newest : null, 'the number inside against the number in the name'),
G.check(`latest.json updated_at and ${nv} generated_at`, lt ? lt.updated_at : null, s ? s.generated_at : null, 'two timestamps as written'),
G.check(`${nv} totals.repo_count and repos[] counted`, s && s.declared ? s.declared.repo_count : null, s ? s.repoCount : null, 'written total against length of repos[]'),
G.check(`${nv} totals.file_count and files[] counted`, s && s.declared ? s.declared.file_count : null, s ? s.fileCount : null, 'written total against the sum of files[] lengths'),
G.check(`Field names described above, present in ${nv}`, s ? SCHEMA_TOP.length - missingTop(s).length : null, s ? SCHEMA_TOP.length : null, s && missingTop(s).length ? `absent: ${missingTop(s).join(', ')}` : `top-level fields: ${SCHEMA_TOP.join(', ')}`),
G.check('graph_latest.json dataSource.registryVersion and latest.json authoritative_version', gr && gr.dataSource ? gr.dataSource.registryVersion : null, lt ? lt.authoritative_version : null, 'which snapshot the graph says it was drawn from'),
G.check('graph_latest.json dataSource.jsonPath and latest.json json_path', gr && gr.dataSource ? gr.dataSource.jsonPath : null, lt ? lt.json_path : null, 'the same, by path'),
G.check(`graph_latest.json dataSource.generatedAt and ${nv} generated_at`, gr && gr.dataSource ? gr.dataSource.generatedAt : null, s ? s.generated_at : null, 'timestamps as written'),
G.check(`Repository nodes in the graph and repos[] in ${nv}`, f ? f.repoNodes.length : null, s ? s.repoCount : null, 'nodes whose id starts repo:: against repos counted'),
G.check(`Repository nodes whose "N files · branch" equals ${nv}`, subtitleMatch, f && s ? f.repoNodes.length : null, 'subtitle parsed, against files counted and default_branch'),
G.check(`File nodes whose path is listed in ${nv}`, pathsFound, f && s ? f.fileNodes.length : null, 'file::repo::path looked up in that repo\'s files[]'),
G.check('Graph edges with both ends present as nodes', f ? f.edges - f.dangling : null, f ? f.edges : null, 'every edge.from and edge.to looked up in nodes[]'),
G.check('Graph nodes inside the canvas the graph declares', inside, gr && inside != null ? (gr.nodes || []).length : null, gr && gr.canvas ? `canvas.width ${gr.canvas.width}, canvas.height ${gr.canvas.height}, nodes at 0 to that size` : 'no canvas field'),
G.check('Pinned commit and the head of main now', PIN, head && !head.err ? head.sha : null, 'if these differ, the registry has moved since this page was built and the counts here are of the pinned commit'),
];
const frag = document.createDocumentFragment();
let nm = 0, nd = 0, nu = 0;
for (const c of rows) {
const li = el('li', 'row ' + (c.status === 'MATCH' ? 'match' : c.status === 'DIFFERS' ? 'differs' : 'unknown'));
const h = el('p', 'rhead'); h.append(el('span', 'st', c.status), el('b', null, c.label));
const n = el('p', 'nums small');
const show = v => (v == null ? 'not yet known' : typeof v === 'string' && /^[0-9a-f]{40}$/.test(v) ? v.slice(0, 12) : typeof v === 'number' ? fmt(v) : String(v));
n.textContent = `${show(c.a)} · ${show(c.b)} · ${c.how}`;
li.append(h, n); frag.appendChild(li);
if (c.status === 'MATCH') nm++; else if (c.status === 'DIFFERS') nd++; else nu++;
}
if (why.length) { const li = el('li', 'row unknown'); li.append(el('p', 'small', 'Reasons for NOT YET KNOWN: ' + why.join('; ') + '. Close and reopen the page to try again.')); frag.appendChild(li); }
ul.appendChild(frag);
label('check', 'OK', `${nm} MATCH, ${nd} DIFFERS, ${nu} NOT YET KNOWN`);
fillSummary(); fillQuestions();
}
/* ── summary and questions: filled from what has been read ─────────────────── */
function fillSummary() {
const L = listing.value; if (!L) return;
const done = L.versions.map(v => SNAP.get(v)).filter(x => x && x.sum).map(x => x.sum);
if (!done.length) { $('summary').textContent = `LOAD: ${L.versions.length} numbered snapshots found; reading.`; return; }
const first = done[0], last = done[done.length - 1];
$('summary').textContent = `${done.length} of ${L.versions.length} snapshots read. v${G.pad4(first.fileVersion)}${first.generated_at ? ' (' + when(first.generated_at) + ')' : ''}: ${fmt(first.repoCount)} repos, ${fmt(first.fileCount)} files. v${G.pad4(last.fileVersion)}${last.generated_at ? ' (' + when(last.generated_at) + ')' : ''}: ${fmt(last.repoCount)} repos, ${fmt(last.fileCount)} files. Nu … [line shortened here: 434 characters; full line on GitHub]
}
function fillQuestions() {
if (graph.value) {
$('q-maptype').textContent = `"${graph.value.mapType ?? 'absent'}"`;
const f = graph.facts;
$('q-next').textContent = `graph_latest.json declares ${f.declaredTypes.length} edge types (${f.declaredTypes.join(', ')}) and holds edges of ${Object.keys(f.byType).length}: ${Object.entries(f.byType).map(([k, c]) => `${k} ${c}`).join(', ')}. Declared with no edge at all: ${f.unusedTypes.join(', ') || 'none'}. So every repository is a node, but no dependency, API, schema or data-flow edge bet … [line shortened here: 604 characters; full line on GitHub]
}
const L = listing.value; const newest = L && L.versions[L.versions.length - 1]; const s = newest != null && SNAP.get(newest) && SNAP.get(newest).sum;
if (s) {
$('q-geo').textContent = `In v${G.pad4(newest)}: ${fmt(s.types.geojson || 0)} files of type geojson, ${fmt(s.roles['geospatial layer'] || 0)} with role "geospatial layer", ${fmt(s.roles['data contract or schema'] || 0)} with role "data contract or schema", ${fmt(s.types.tabular || 0)} of type tabular. A path is where a layer is, not what it draws.`;
}
}
/* ── sections open on demand ───────────────────────────────────────────────── */
$('d-go').addEventListener('click', runDiff);
const OPEN = { timeline: openTimeline, diff: openDiff, graph: openGraph, check: openCheck };
for (const d of document.querySelectorAll('details.sec')) {
d.addEventListener('toggle', () => { if (d.open) OPEN[d.dataset.sec]().catch(e => label(d.dataset.sec, 'FAIL', e.message)); });
}
paintMachine();
window.__growth = { M, queue, SNAP, graph, listing, PIN };Growth
A style sheet in the iterations folder of Galaxies Wafers. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/.
rendergalaxies-wafers / iterations/43-registry-growth/growth.css · lines 1–65 of 65 · Entry point
- What it does
- Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage upstream_foresight (topic 'markets-data'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
- Downstream impact
- Used directly by 1 file: Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/). Reached from 1 other entry point, including Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/.
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Loaded by the 43 Registry Growth page at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/.
- Application
- galaxies-wafers · iterations/43-registry-growth · style sheet
- Uses
- none found
- Used by
- loaded by Iterations — 43 Registry Growth Page (stylesheet)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/43-registry-growth/growth.css:1-65 · blob f0bf9b8d7fe3a0ef85c7c30cd87b9c2c3f95579f · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
:root{--ink:#d8dee9;--dim:#8b93a7;--ground:#0b0d12;--edge:#1b2030;--beam:#5ec8f2;--grey:#8b93a7;--lit:#ffd54a}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ground);color:var(--ink);font:13px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
padding:calc(env(safe-area-inset-top,0px) + .8rem) 1rem calc(env(safe-area-inset-bottom,0px) + 2rem)}
main{max-width:56rem;margin:0 auto}
h1{font-size:14px;letter-spacing:.18em;font-weight:600;margin:0 0 .35rem;color:#fff}
p{margin:.35rem 0}
.dim{color:var(--dim)} .small{font-size:11.5px}
a{color:var(--beam);overflow-wrap:anywhere}
code{color:var(--beam);overflow-wrap:anywhere}
.schema{border:1px solid var(--edge);border-radius:.4rem;background:#0e1118;padding:.45rem .6rem;overflow-wrap:anywhere}
.schema b{color:#fff;font-weight:600}
.summary{border-left:3px solid #fff;padding:.35rem .6rem;background:#10131b;margin:.6rem 0;overflow-wrap:anywhere}
.sec{border:1px solid var(--edge);border-radius:.45rem;background:#0e1118;margin:.5rem 0}
.sec>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;padding:.3rem .65rem;overflow-wrap:anywhere;list-style:none}
.sec>summary::before{content:"+";color:var(--beam);margin-right:.5rem;flex:none}
.sec[open]>summary::before{content:"\2212"}
.sec>summary::-webkit-details-marker{display:none}
.sec[open]>summary{border-bottom:1px solid var(--edge)}
.sec .lead{margin:.45rem .65rem}
.rows{list-style:none;margin:0;padding:.4rem;display:grid;gap:.4rem}
.row{border:1px solid var(--edge);border-left-width:4px;border-left-color:var(--edge);border-radius:.4rem;background:#10131b;padding:.45rem .6rem;overflow-wrap:anywhere;min-width:0}
.row.wait{border-left-style:dotted;border-left-color:var(--grey)}
.row.load{border-left-style:dashed;border-left-color:var(--beam)}
.row.ok{border-left-style:solid;border-left-color:#eceff4}
.row.fail{border-left-style:dotted;border-left-color:var(--grey);cursor:pointer}
.row.match{border-left-color:#eceff4;border-left-style:solid}
.row.differs{border-left-color:#eceff4;border-left-style:double;border-left-width:6px}
.row.unknown{border-left-color:var(--grey);border-left-style:dotted}
.rhead{display:flex;flex-wrap:wrap;gap:.15rem .6rem;align-items:baseline;margin:0}
.st{font-weight:600;letter-spacing:.08em;color:#fff;font-size:12px}
.row.unknown .st,.row.wait .st,.row.fail .st{color:var(--grey)}
.row.differs .st{text-decoration:underline;text-underline-offset:3px}
.nums{margin:.15rem 0 0}
.nums b{color:#fff;font-size:13.5px}
.bar{height:5px;background:#05060a;border-radius:3px;margin-top:.35rem;overflow:hidden}
.bar i{display:block;height:100%;width:0;background:var(--beam);transition:width .2s}
.pick{display:flex;flex-wrap:wrap;gap:.4rem;margin:.45rem .65rem;align-items:center}
.pick select{flex:1 1 9rem;min-width:0;font:inherit;font-size:16px;color:#fff;background:#05060a;border:1px solid var(--edge);border-radius:.35rem;min-height:44px}
button,.btn{font:inherit;color:var(--ink);background:#07080c;border:1px solid var(--edge);border-radius:.35rem;min-height:44px;min-width:72px;padding:0 .7rem;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;cursor:pointer}
button:disabled{opacity:.4}
.tog{display:inline-flex;align-items:center;gap:.4rem;min-height:44px}
.tog input{width:20px;height:20px}
.list{border-top:1px solid var(--edge);margin:.4rem .65rem;padding-top:.35rem}
.list h3{font-size:12px;font-weight:600;color:#fff;margin:.2rem 0;letter-spacing:.04em}
.list ol{margin:.2rem 0;padding-left:0;list-style:none;display:grid;gap:.15rem}
.list li{overflow-wrap:anywhere;font-size:11.5px;padding:.1rem 0;border-bottom:1px solid #141824}
.list li b{color:#fff}
.pager{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.stage{margin:.4rem .65rem;border:1px solid var(--edge);border-radius:.4rem;overflow:hidden;background:#05060a}
#g-canvas{display:block;width:100%;height:62vh;max-height:34rem;min-height:18rem;touch-action:none;background:#05060a}
.card{margin:.4rem .65rem .65rem;border:1px solid var(--edge);border-left:3px solid var(--lit);border-radius:.4rem;background:#10131b;padding:.45rem .6rem;overflow-wrap:anywhere}
.kv{display:grid;grid-template-columns:max-content 1fr;gap:.1rem .6rem;margin:.3rem 0}
.kv dt{color:var(--dim)} .kv dd{margin:0;min-width:0;overflow-wrap:anywhere}
.btns{display:flex;flex-wrap:wrap;gap:.4rem}
.legend{display:flex;flex-wrap:wrap;gap:.2rem .8rem;margin:.2rem .65rem}
.legend span{display:inline-flex;align-items:center;gap:.3rem;font-size:11px}
.legend i{display:inline-block;width:22px;height:0;border-top:2px solid}
.questions{border:1px solid var(--edge);border-radius:.45rem;background:#10131b;padding:0 .65rem;margin:1.2rem 0 .5rem}
.questions summary{font-size:11px;letter-spacing:.14em;text-transform:uppercase;cursor:pointer;color:var(--beam);min-height:44px;display:flex;align-items:center}
.questions dt{color:#fff;margin-top:.5rem;font-size:12px}
.questions dd{margin:.2rem 0 .6rem;font-size:11.5px;overflow-wrap:anywhere}
.machine{border-left:3px solid var(--beam);padding:.35rem .6rem;background:#07080c;overflow-wrap:anywhere}
footer{margin-top:1.2rem;overflow-wrap:anywhere}Iterations — 43 Registry Growth Page
A web page in Galaxies Wafers that reads inputs for to and files (units: kV). Published at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/.
rendergalaxies-wafers / iterations/43-registry-growth/index.html · lines 1–81 of 81 · Entry point
- What it does
- It draws its content. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage upstream_foresight (topic 'markets-data'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. README: "The page (`index.html`, `app.mjs`, `lib.mjs`) is inherited unchanged from testcode/202609151339."
- Inputs & outputs
- In: form fields (user input). Out: web page.
- Downstream impact
- Used directly by 1 file: Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/.
- What it achieves
- How the Estate Grew.
- Why it matters
- Loaded by the 47 Federation Honesty page at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
- Application
- galaxies-wafers · iterations/43-registry-growth · page
- Uses
- Growth (stylesheet), Spider Printer Registry Smoke Workflow (link), GlobalGrid2050 Dashboard (link), Galaxies Wafers — Iterations Page (link), Iterations — 43 Registry Growth (script src)
- Used by
- linked from Iterations — 47 Federation Honesty Page (link)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/43-registry-growth/index.html:1-81 · blob 65c44793bf511717be01446090dbf077053d57dc · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="color-scheme" content="dark">
<title>How the Estate Grew</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="growth.css">
</head>
<body>
<main>
<header>
<h1>HOW THE ESTATE GREW</h1>
<p class="dim">The public registry <a href="https://github.com/Ventusltd/registry_of_all_content_in_repos_and_dependencies">Ventusltd/registry_of_all_content_in_repos_and_dependencies</a> writes a new numbered snapshot each time its builder runs and never overwrites an old one. This page reads those snapshots as published, counts what is in them, and shows what changed between any two. Open a … [line shortened here: 444 characters; full line on GitHub]
<p class="schema small"><b>What a snapshot holds.</b> Each <code>registry/registry_vNNNN.json</code> carries <code>schema_version</code>, <code>registry_version</code>, <code>generated_at</code>, <code>totals</code> (<code>repo_count</code>, <code>file_count</code>, <code>reachable_count</code>, <code>unreachable_count</code>), <code>boot_sequence[]</code> (<code>repo</code>, <code>path</code> … [line shortened here: 1,358 characters; full line on GitHub]
<p class="small dim" id="pin">Read at commit <code id="sha"></code> of that repository, which was the head of <code>origin/main</code> when this page was built (fetched with git). Files come from raw.githubusercontent.com at that commit, so the counts do not move when the registry does; the check below says whether main has moved since.</p>
<p id="summary" class="summary">WAIT: nothing is fetched until you open a section.</p>
</header>
<details class="sec" id="sec-timeline" data-sec="timeline">
<summary><span id="lbl-timeline" data-base-label="1 · Timeline of the numbered snapshots">1 · Timeline of the numbered snapshots [WAIT]</span></summary>
<p class="lead small dim">Lists the numbered files in <code>registry/</code> at the pinned commit, then fetches each snapshot through one queue of 4 (15 s timeout each), counts its <code>repos[]</code> and <code>files[]</code>, keeps only the counts and file paths, and drops the rest. The bar is files counted, against the largest snapshot read so far. Tap a failed row to try it again.</p>
<ol class="rows" id="rows-timeline"></ol>
</details>
<details class="sec" id="sec-diff" data-sec="diff">
<summary><span id="lbl-diff" data-base-label="2 · What changed between two snapshots">2 · What changed between two snapshots [WAIT]</span></summary>
<p class="lead small dim">Choose two snapshots. Only those two are fetched (shared with the timeline, never twice). Lists are sorted and paged; entries withheld for company or customer names are counted, not shown.</p>
<div class="pick">
<label class="small dim" for="d-from">from</label><select id="d-from" aria-label="from snapshot"><option>open the section first</option></select>
<label class="small dim" for="d-to">to</label><select id="d-to" aria-label="to snapshot"><option>open the section first</option></select>
<button type="button" id="d-go" disabled>compare</button>
</div>
<p class="lead small" id="d-status">WAIT: choose two snapshots.</p>
<div id="d-lists"></div>
</details>
<details class="sec" id="sec-graph" data-sec="graph">
<summary><span id="lbl-graph" data-base-label="3 · The graph as the registry draws it">3 · The graph as the registry draws it [WAIT]</span></summary>
<p class="lead small dim">graph_latest.json drawn on a dark canvas at its own <code>x</code>, <code>y</code>. Repositories are the large points, their chosen files the small ones. A line is drawn only when both of its ends are nodes in the file, cased so it reads on black, in the colour and dash its <code>edgeTypes</code> entry declares. Drag to pan, pinch or wheel to zoom, tap a point.</p>
<div class="pick">
<label class="tog small"><input type="checkbox" id="g-files" checked> file nodes</label>
<button type="button" id="g-fit">fit</button>
</div>
<div class="stage"><canvas id="g-canvas" aria-label="registry graph"></canvas></div>
<p class="lead small dim" id="g-stats">WAIT</p>
<div class="card" id="g-card" hidden>
<p class="rhead"><span class="st" id="g-kind"></span><b id="g-label"></b></p>
<dl class="kv small" id="g-kv"></dl>
<p class="btns"><a class="btn" id="g-open" target="_blank" rel="noopener" hidden>Open on GitHub</a> <a class="btn" id="g-source" target="_blank" rel="noopener" hidden>source file</a></p>
</div>
</details>
<details class="sec" id="sec-check" data-sec="check">
<summary><span id="lbl-check" data-base-label="4 · Do the pointer, the newest snapshot and the graph agree?">4 · Do the pointer, the newest snapshot and the graph agree? [WAIT]</span></summary>
<p class="lead small dim">Reads the directory listing, <code>latest.json</code>, <code>graph_latest.json</code> and the newest numbered snapshot, and compares the fields the builder's own validator names (<code>scripts/validate_kernel_outputs.py</code>) plus the counts. MATCH, DIFFERS or NOT YET KNOWN; no colour here is a verdict.</p>
<ul class="rows" id="rows-check"></ul>
</details>
<details id="questions" class="questions">
<summary>Questions</summary>
<dl>
<dt>1. How does this help draw a system or a single-line diagram?</dt>
<dd>It draws no busbar, feeder, transformer, cable route, protection or earthing: none yet. The registry's own graph declares <code>mapType</code> <span id="q-maptype">(not yet known: open section 3)</span>, a single-line picture of the software, not of the grid. What it does supply to a system drawing is the inventory that says where the drawing data lives: <code>repos[].files[]</code> entr … [line shortened here: 612 characters; full line on GitHub]
<dt>2. What is this code used for?</dt>
<dd>Written by <code>.github/workflows/registry.yml</code> in the registry repository (on push, on dispatch, and weekly by cron), which runs <code>scripts/build_registry_from_config.py</code> or <code>reconcile_registry_from_config.py</code>, then <code>build_graph_latest.py</code>, <code>build_kernel.py</code> and <code>validate_kernel_outputs.py</code>; scope is <code>config/registry_repos … [line shortened here: 1,818 characters; full line on GitHub]
<dt>3. Where does it lead next?</dt>
<dd>To the dependency graph the estate's principle asks for, every repo a node and every dependency an edge. <span id="q-next">Not yet known: open section 3, which counts the edge types <code>graph_latest.json</code> declares against the edges it holds.</span></dd>
</dl>
</details>
<p id="machine" class="machine small">Machine detail · not yet known: open a section.</p>
<footer class="dim small">
<p>Loading, as Grid Atlas does it: every section exists from the start and fetches nothing until opened; one queue of 4 carries every request, each with a 15 s timeout; one promise per URL, removed on failure so a retry is possible; only the changed row or label is rewritten; closing a section keeps what was read. The snapshots are a bounded, numbered set: each is reduced to counts and paths a … [line shortened here: 541 characters; full line on GitHub]
<p>MATCH has a solid rule, DIFFERS a double rule, NOT YET KNOWN a dotted grey rule. <a href="../">every version</a></p>
</footer>
</main>
<script type="module" src="app.mjs"></script>
</body>
</html>Iterations — 47 Federation Honesty
A JavaScript module in Galaxies Wafers that draws status rules and federation map, and uses data from the data-federation-map-for-GlobalGrid2050-all-repos repository. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
rendergalaxies-wafers / iterations/47-federation-honesty/app.mjs · lines 1–301 of 301 · Entry point · pattern statusOf (shared by 2 files)
- What it does
- It draws status rules and federation map. Defines 24 functions or classes, including $, esc, FetchQueue, get, parquetLib. Side effects: changes the web page (DOM); makes network requests; uses storage (browser storage, DuckDB or Parquet).
- Why it exists in the grid workflow
- Domain stage upstream_foresight (topic 'markets-data'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. README: "The page (`index.html`, `app.mjs`, `lib.mjs`) is inherited unchanged from testcode/202609151339."
- Inputs & outputs
- In: data source: data-federation-map-for-globalgrid2050-all-repos data; JSON file status_rules.json; JSON file nodes.json; JSON file edges.json; Parquet file nodes.parquet; Parquet file edges.parquet; JSON file FEDERATION_MAP_LATEST.json; DuckDB queries.
- Downstream impact
- Used directly by 1 file: Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
- What it achieves
- It fetches queue (`FetchQueue`), gets Parquet (`getParquet`) and counts statuses (`countStatuses`). Is Green Earned? Counts the federation map's statuses from its own files and checks every green against the evidence its rules ask for. It responds to toggle events.
- Why it matters
- Loaded by the page of the same name at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
- Application
- galaxies-wafers · iterations/47-federation-honesty · JavaScript module
- Uses
- Live Sandbox — Federation Control Ledger Page (estate URL)
- Used by
- loaded by Iterations — 47 Federation Honesty Page (script src)
- Produces
- fetchStats, countStatuses, greenWithoutEvidence, edgeEvidence, invariants
- Defines here
- $, esc, FetchQueue, get, parquetLib, getParquet, p, features, nodeProps, statusOf, isExternal, countStatuses, greenWithoutEvidence, edgeEvidence, blank, invariants, row, label, cell, settle, hydrate, nodeRows, ruleWords, summary
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/47-federation-honesty/app.mjs:1-301 · blob 7ee1dd0c629f33273f592e37d5deeb0e800fb5fa · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, network, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
// Is Green Earned? Counts the federation map's statuses from its own files and
// checks every green against the evidence its rules ask for. No randomness, no verdict colours.
const REPO = 'Ventusltd/data-federation-map-for-globalgrid2050-all-repos';
const OWNER = 'Ventusltd';
// origin/main of REPO when this page was built (git fetch; git rev-parse origin/main).
const SHA = 'b759a7d2b5ec0dcc233c27db813ceadc5469157d';
const RAW = `https://raw.githubusercontent.com/${REPO}/${SHA}/`;
const HYPARQUET = 'https://cdn.jsdelivr.net/npm/hyparquet@1.30.1/+esm';
// ZSTD only: the contract says zstd Parquet. fzstd is the decoder hyparquet-compressors 1.1.1 uses.
const FZSTD = 'https://cdn.jsdelivr.net/npm/fzstd@0.1.1/+esm';
const P = {
rules: 'config/status_rules.json',
rootNodes: 'live_sandbox/federation_control_ledger/data/nodes.json',
rootEdges: 'live_sandbox/federation_control_ledger/data/edges.json',
scopeNodes: 'live_sandbox/federation_control_ledger/data/scopes/data-federation/nodes.json',
scopeEdges: 'live_sandbox/federation_control_ledger/data/scopes/data-federation/edges.json',
contNodes: 'data/federation_map/contents/provenance=declared/repo=Ventusltd__globalgrid2050/nodes.json',
contEdges: 'data/federation_map/contents/provenance=declared/repo=Ventusltd__globalgrid2050/edges.json',
pqNodes: 'data/federation_map/current/nodes.parquet',
pqEdges: 'data/federation_map/current/edges.parquet',
report: 'reports/json/FEDERATION_MAP_LATEST.json',
reportMd: 'reports/FEDERATION_MAP_LATEST.md',
};
const $ = (id) => document.getElementById(id);
const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
// ---- one queue of 4, 15 s timeout, one promise per URL (Grid Atlas FetchQueue) ----
class FetchQueue {
constructor(n) { this.n = n; this.active = 0; this.waiting = []; }
run(task) {
return new Promise((resolve, reject) => {
this.waiting.push({ task, resolve, reject });
this.pump();
});
}
pump() {
while (this.active < this.n && this.waiting.length) {
const { task, resolve, reject } = this.waiting.shift();
this.active++;
task().then(resolve, reject).finally(() => { this.active--; this.pump(); });
}
}
}
const queue = new FetchQueue(4);
const urlCache = new Map();
export const fetchStats = { started: 0, maxActive: 0 };
function get(path, kind) {
const key = kind + ':' + path;
if (urlCache.has(key)) return urlCache.get(key);
const p = queue.run(async () => {
fetchStats.started++;
fetchStats.maxActive = Math.max(fetchStats.maxActive, queue.active);
const ctl = new AbortController();
const t = setTimeout(() => ctl.abort(), 15000);
try {
const r = await fetch(RAW + path, { signal: ctl.signal });
if (!r.ok) throw new Error(`${path}: HTTP ${r.status}`);
if (kind === 'json') return await r.json();
if (kind === 'bin') return await r.arrayBuffer();
return await r.text();
} catch (e) {
throw new Error(e.name === 'AbortError' ? `${path}: no answer in 15 s` : e.message);
} finally { clearTimeout(t); }
});
urlCache.set(key, p);
p.catch(() => urlCache.delete(key));
return p;
}
let pqLib = null;
function parquetLib() {
if (!pqLib) {
pqLib = Promise.all([import(HYPARQUET), import(FZSTD)]);
pqLib.catch(() => { pqLib = null; });
}
return pqLib;
}
const pqCache = new Map();
function getParquet(path) {
if (pqCache.has(path)) return pqCache.get(path);
const p = (async () => {
const [buf, [hp, fz]] = await Promise.all([get(path, 'bin'), parquetLib()]);
const compressors = { ZSTD: (input, outputLength) => fz.decompress(input, new Uint8Array(outputLength)) };
return hp.parquetReadObjects({ file: buf, compressors });
})();
pqCache.set(path, p);
p.catch(() => pqCache.delete(path));
return p;
}
// ---- pure checks ----
const features = (fc) => (fc && Array.isArray(fc.features) ? fc.features : Array.isArray(fc) ? fc : []);
const nodeProps = (n) => (n && n.properties ? { id: n.id, ...n.properties } : n);
const statusOf = (p) => (p.status ?? p.rag ?? null);
const isExternal = (p) => {
const id = String(p.id ?? p.nodeId ?? '');
const kind = String(p.repo_type ?? p.nodeKind ?? p.scope_type ?? '');
if (p.owner != null) return p.owner !== OWNER;
if (/external/i.test(kind)) return true;
if (id.includes('/')) return !id.startsWith(OWNER + '/');
return false;
};
export function countStatuses(rows) {
const m = new Map();
for (const r of rows) { const s = statusOf(r); const k = s == null || s === '' ? '(no status field)' : String(s); m.set(k, (m.get(k) || 0) + 1); }
return m;
}
const EVIDENCE_KEY = /^evidence/i;
export function greenWithoutEvidence(rows) {
const green = rows.filter((r) => String(statusOf(r)).toLowerCase() === 'green');
const without = green.filter((r) => {
const keys = Object.keys(r).filter((k) => EVIDENCE_KEY.test(k));
return keys.length === 0 || keys.every((k) => r[k] == null || String(r[k]).trim() === '');
});
return { green, without };
}
export function edgeEvidence(edges) {
let noPath = 0, noText = 0;
for (const e of edges) {
const o = Array.isArray(e) ? {} : e;
if (o.evidencePath == null || String(o.evidencePath).trim() === '') noPath++;
if (o.evidenceText == null || String(o.evidenceText).trim() === '') noText++;
}
return { n: edges.length, noPath, noText };
}
const NODE_REQ = ['scanId', 'nodeId', 'nodeKind', 'repoFullName', 'repoName', 'owner', 'repoType', 'status', 'visibility', 'defaultBranch', 'archived', 'htmlUrl', 'description', 'canonicalFilesPresent', 'generatedUTC'];
const EDGE_REQ = ['scanId', 'edgeId', 'fromNode', 'toNode', 'edgeType', 'cardinality', 'evidencePath', 'evidenceText', 'generatedUTC'];
const blank = (v) => v == null || String(v) === '';
export function invariants(nodes, edges, report) {
const v = report && report.verification ? report.verification : null;
const out = [];
const row = (name, measured, ok, claim, claimAgrees) => {
let result = ok == null ? 'NOT YET KNOWN' : ok && claimAgrees !== false ? 'MATCH' : 'DIFFERS';
out.push({ name, measured, claim: claim ?? 'not stated', result });
};
if (nodes) {
const d = new Set(nodes.map((n) => n.scanId + '\u0000' + n.nodeId)).size;
row('node rows equal distinct scanId + nodeId', `${nodes.length} rows, ${d} distinct`, nodes.length === d,
v ? `${v.nodeRows} rows, ${v.nodeDistinctKeys} distinct` : null, v ? v.nodeRows === nodes.length && v.nodeDistinctKeys === d : undefined);
const nk = nodes.filter((n) => blank(n.scanId) || blank(n.nodeId)).length;
row('node null keys equal zero', `${nk}`, nk === 0, v ? `${v.nodeNullKeys}` : null, v ? v.nodeNullKeys === nk : undefined);
const cols = new Set(nodes.flatMap((n) => Object.keys(n)));
const miss = NODE_REQ.filter((f) => !cols.has(f));
row('required node fields present', miss.length ? `missing: ${miss.join(', ')}` : `all ${NODE_REQ.length} present`, miss.length === 0, null);
} else ['node rows equal distinct scanId + nodeId', 'node null keys equal zero', 'required node fields present'].forEach((n) => row(n, 'not yet known', null, null));
if (edges) {
const d = new Set(edges.map((e) => e.scanId + '\u0000' + e.edgeId)).size;
row('edge rows equal distinct scanId + edgeId', `${edges.length} rows, ${d} distinct`, edges.length === d,
v ? `${v.edgeRows} rows, ${v.edgeDistinctKeys} distinct` : null, v ? v.edgeRows === edges.length && v.edgeDistinctKeys === d : undefined);
const ek = edges.filter((e) => blank(e.scanId) || blank(e.edgeId)).length;
row('edge null keys equal zero', `${ek}`, ek === 0, v ? `${v.edgeNullKeys}` : null, v ? v.edgeNullKeys === ek : undefined);
const dk = edges.length - new Set(edges.map((e) => [e.scanId, e.fromNode, e.toNode, e.edgeType, e.evidencePath].join('\u0000'))).size;
row('edge key scanId + fromNode + toNode + edgeType + evidencePath is unique', `${dk} repeated`, dk === 0, null);
const cols = new Set(edges.flatMap((e) => Object.keys(e)));
const miss = EDGE_REQ.filter((f) => !cols.has(f));
row('required edge fields present', miss.length ? `missing: ${miss.join(', ')}` : `all ${EDGE_REQ.length} present`, miss.length === 0, null);
if (nodes) {
const ids = new Set(nodes.map((n) => n.nodeId));
const dang = edges.filter((e) => !ids.has(e.fromNode) || !ids.has(e.toNode)).length;
row('edge endpoints exist as nodes (build report check)', `${dang} dangling`, dang === 0, v ? `${v.danglingEdgeEndpoints}` : null, v ? v.danglingEdgeEndpoints === dang : undefined);
}
} else ['edge rows equal distinct scanId + edgeId', 'edge null keys equal zero'].forEach((n) => row(n, 'not yet known', null, null));
out.push({ name: 'Parquet files can be read back by DuckDB', measured: nodes && edges ? 'both read back in this browser by hyparquet; DuckDB is not run here' : 'not yet known', claim: v ? `verificationPassed ${v.verificationPassed}` : 'not stated', result: 'NOT YET KNOWN' });
return out;
}
// ---- UI state, one label per section, never rebuild the page ----
const STATE = {};
function label(id, state, detail) {
const el = $('lbl-' + id);
el.textContent = `${el.dataset.base} [${state}${detail ? ' · ' + detail : ''}]`;
}
function cell(v) { return v == null ? '<span class="dim">not yet known</span>' : esc(v); }
function settle(results) {
const failed = results.filter((r) => r.status === 'rejected').map((r) => r.reason.message);
return failed;
}
const sectionFiles = {
rules: [['json', P.rules]],
counts: [['json', P.rules], ['json', P.rootNodes], ['json', P.scopeNodes], ['json', P.contNodes], ['pq', P.pqNodes]],
green: [['json', P.rules], ['json', P.rootNodes], ['json', P.scopeNodes], ['json', P.contNodes], ['pq', P.pqNodes]],
edges: [['json', P.rootEdges], ['json', P.scopeEdges], ['json', P.contEdges], ['pq', P.pqEdges]],
inv: [['pq', P.pqNodes], ['pq', P.pqEdges], ['json', P.report], ['text', P.reportMd]],
};
const DATA = {};
async function hydrate(id) {
const st = STATE[id] || (STATE[id] = {});
if (st.loaded || st.loading) return;
st.loading = true;
label(id, 'LOAD');
const files = sectionFiles[id];
const results = await Promise.allSettled(files.map(([k, p]) => (k === 'pq' ? getParquet(p) : get(p, k)).then((d) => { DATA[p] = d; return d; })));
const failed = settle(results);
st.loading = false;
try { render[id](); } catch (e) { failed.push('render: ' + e.message); }
if (failed.length) { label(id, 'FAIL', failed.join('; ')); st.loaded = false; }
else { label(id, 'OK'); st.loaded = true; }
summary();
}
const NODE_FILES = [['root board', P.rootNodes], ['child scope', P.scopeNodes], ['contents', P.contNodes], ['nodes.parquet', P.pqNodes]];
const nodeRows = (p) => (DATA[p] == null ? null : p === P.pqNodes ? DATA[p] : features(DATA[p]).map(nodeProps));
const ruleWords = () => (DATA[P.rules] ? DATA[P.rules].statusOrderWorstFirst || Object.keys(DATA[P.rules].colours || {}) : []);
const render = {
rules() {
const r = DATA[P.rules];
if (!r) return;
const words = ruleWords();
$('rules-body').innerHTML = words.map((w) => {
const c = (r.colours || {})[w] || {};
return `<tr><td class="word">${esc(w)}</td><td>${cell(c.label)}</td><td>${cell(c.meaning)}</td></tr>`;
}).join('');
const green = (r.colours || {}).green;
const named = JSON.stringify(r).match(/"evidence[A-Za-z]*"\s*:/g);
$('rules-evidence').textContent = green
? `Green is defined as "${green.meaning}". The rules file names no field that holds that evidence${named ? ' (keys found: ' + named.join(' ') + ')' : ''}; ${r.nodeRules ? r.nodeRules.length : 0} node rules set red, amber or blue, and none sets green. DATA_CONTRACT.md names evidence fields only for edges: evidencePath and evidenceText.`
: 'The rules file defines no green.';
},
counts() {
const words = ruleWords();
const maps = NODE_FILES.map(([, p]) => { const rows = nodeRows(p); return rows ? countStatuses(rows) : null; });
const all = [...words];
maps.forEach((m) => m && [...m.keys()].forEach((k) => { if (!all.includes(k)) all.push(k); }));
$('counts-body').innerHTML = all.map((w) => {
const tag = words.length && !words.includes(w) ? ' <span class="dim">(not in status_rules.json)</span>' : '';
return `<tr><td><span class="word">${esc(w)}</span>${tag}</td>${maps.map((m) => `<td>${m ? m.get(w) || 0 : cell(null)}</td>`).join('')}</tr>`;
}).join('') + `<tr><th>rows</th>${maps.map((m) => `<td>${m ? [...m.values()].reduce((a, b) => a + b, 0) : cell(null)}</td>`).join('')}</tr>`;
const ext = NODE_FILES.map(([name, p]) => { const rows = nodeRows(p); return rows ? `${name} ${rows.filter(isExternal).length}` : `${name} not yet known`; });
$('counts-note').textContent = `Nodes outside the owner's repositories (external sources and services), counted, names not displayed: ${ext.join(' · ')}.`;
const cont = nodeRows(P.contNodes);
if (cont) {
const hits = cont.filter((n) => /sld|cable|grid|atlas/i.test(String(n.id)));
$('q-draw').textContent = hits.length ? hits.map((n) => `${n.id} (status ${statusOf(n)})`).join(', ') + '.' : 'none found.';
}
},
green() {
this.rules();
const body = [], list = [];
let hidden = 0;
for (const [name, p] of NODE_FILES) {
const rows = nodeRows(p);
if (!rows) { body.push(`<tr><td>${esc(name)}</td><td colspan="3" class="dim">not yet known</td></tr>`); continue; }
const { green, without } = greenWithoutEvidence(rows);
const fields = [...new Set(rows.flatMap((r) => Object.keys(r)))].filter((k) => k !== 'id');
const ev = fields.filter((k) => EVIDENCE_KEY.test(k));
body.push(`<tr><td>${esc(name)}</td><td>${green.length}</td><td>${without.length}</td><td>${ev.length ? 'evidence fields: ' + esc(ev.join(', ')) : 'no evidence field; fields: ' + esc(fields.join(', '))}</td></tr>`);
for (const n of without) {
if (isExternal(n)) { hidden++; continue; }
const id = String(n.id ?? n.nodeId).replace(OWNER + '/', '');
const why = n.status_reason ?? n.reason ?? null;
list.push(`<li>green without evidence · ${esc(name)} · <code>${esc(id)}</code>${why ? ' · its stated reason: "' + esc(why) + '"' : ' · no reason given'}</li>`);
}
}
if (hidden) list.push(`<li>green without evidence · ${hidden} node(s) outside the owner's repositories · not displayed</li>`);
$('green-body').innerHTML = body.join('');
$('green-list').innerHTML = list.join('');
$('green-rule').textContent = 'Rule applied: status_rules.json says green means "evidence-complete". A green node earns it here only if it carries a field whose name begins with "evidence" and that field is not empty. A stated reason is not evidence. nodes.parquet uses its own status words, so it may have no green at all.';
},
edges() {
const files = [['root board', P.rootEdges], ['child scope', P.scopeEdges], ['contents', P.contEdges], ['edges.parquet', P.pqEdges]];
$('edges-body').innerHTML = files.map(([name, p]) => {
const d = DATA[p];
if (d == null) return `<tr><td>${esc(name)}</td><td colspan="4" class="dim">not yet known</td></tr>`;
const edges = Array.isArray(d) ? d : Array.isArray(d.edges) ? d.edges : [];
const shape = p === P.pqEdges ? 'table rows' : Array.isArray(edges[0]) ? `index array [from, to, type]${d.edge_format ? ' (' + d.edge_format + ')' : ''}` : 'object {' + Object.keys(edges[0] || {}).join(', ') + '}';
const r = edgeEvidence(edges);
return `<tr><td>${esc(name)}</td><td>${r.n}</td><td>${r.noPath}</td><td>${r.noText}</td><td>${esc(shape)}</td></tr>`;
}).join('');
},
inv() {
const rows = invariants(DATA[P.pqNodes] || null, DATA[P.pqEdges] || null, DATA[P.report] || null);
const rep = DATA[P.report], md = DATA[P.reportMd];
rows.push({ name: 'workflow writes JSON and Markdown reports', measured: `FEDERATION_MAP_LATEST.json ${rep ? 'present' : 'not yet known'}; FEDERATION_MAP_LATEST.md ${md != null ? 'present' : 'not yet known'} at the commit`, claim: rep ? `dataLawResult ${rep.dataLawResult}, scan ${rep.scanId}` : 'not stated', result: rep && md != null ? 'MATCH' : 'NOT YET KNOWN' });
$('inv-body').innerHTML = rows.map((r) => `<tr><td>${esc(r.name)}</td><td>${esc(r.measured)}</td><td>${esc(r.claim)}</td><td class="word">${r.result}</td></tr>`).join('');
window.__green = Object.assign(window.__green || {}, { invariants: rows });
},
};
function summary() {
const parts = [];
let g = 0, w = 0, known = false;
for (const [, p] of NODE_FILES) { const rows = nodeRows(p); if (rows) { known = true; const r = greenWithoutEvidence(rows); g += r.green.length; w += r.without.length; } }
if (known) parts.push(`${g} green node(s) in the node files read so far, ${w} of them green without evidence`);
let en = 0, ew = 0, ek = false;
for (const p of [P.rootEdges, P.scopeEdges, P.contEdges, P.pqEdges]) { const d = DATA[p]; if (d != null) { ek = true; const r = edgeEvidence(Array.isArray(d) ? d : d.edges || []); en += r.n; ew += Math.max(r.noPath, r.noText); } }
if (ek) parts.push(`${ew} of ${en} edges read without evidence`);
const inv = window.__green && window.__green.invariants;
if (inv) { const c = (s) => inv.filter((r) => r.result === s).length; parts.push(`invariants ${c('MATCH')} MATCH, ${c('DIFFERS')} DIFFERS, ${c('NOT YET KNOWN')} NOT YET KNOWN`); }
$('summary').textContent = parts.length ? parts.join(' · ') + '.' : 'WAIT — nothing is fetched until you open a section.';
window.__green = Object.assign(window.__green || {}, { green: g, greenWithout: w, edges: en, edgesWithout: ew, fetchStats: { ...fetchStats } });
}
$('pin').textContent = SHA;
$('pin2').textContent = SHA;
$('q-code').href = `https://github.com/${REPO}/blob/${SHA}/scripts/build_federation_map.py`;
$('q-app').href = 'https://ventusltd.github.io/data-federation-map-for-globalgrid2050-all-repos/live_sandbox/federation_control_ledger/';
for (const d of document.querySelectorAll('details[data-section]')) {
d.addEventListener('toggle', () => { if (d.open) hydrate(d.dataset.section); });
}Green
A style sheet in the iterations folder of Galaxies Wafers. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
rendergalaxies-wafers / iterations/47-federation-honesty/green.css · lines 1–26 of 26 · Entry point
- What it does
- Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage upstream_foresight (topic 'markets-data'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
- Downstream impact
- Used directly by 1 file: Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Loaded by the 47 Federation Honesty page at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
- Application
- galaxies-wafers · iterations/47-federation-honesty · style sheet
- Uses
- none found
- Used by
- loaded by Iterations — 47 Federation Honesty Page (stylesheet)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/47-federation-honesty/green.css:1-26 · blob 29b3561ae8deb6b9edd6f5645f770cc8b671455f · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
:root{--ink:#d8dee9;--dim:#8b93a7;--ground:#0b0d12;--edge:#1b2030;--beam:#5ec8f2}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ground);color:var(--ink);font:13px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
padding:calc(env(safe-area-inset-top,0px) + .8rem) 1rem calc(env(safe-area-inset-bottom,0px) + 2rem)}
main{max-width:60rem;margin:0 auto}
h1{font-size:14px;letter-spacing:.18em;font-weight:600;margin:0 0 .35rem;color:#fff}
p{margin:.35rem 0}
.dim{color:var(--dim)} .small{font-size:11.5px}
a{color:var(--beam)}
code{color:var(--beam);overflow-wrap:anywhere}
.pin{color:#fff;overflow-wrap:anywhere}
.summary{border-left:3px solid #fff;padding:.35rem .6rem;background:#10131b;margin:.6rem 0;overflow-wrap:anywhere}
.panel{border:1px solid var(--edge);border-radius:.45rem;background:#10131b;margin:.7rem 0;padding:0 .7rem}
.panel>summary{min-height:44px;padding:.5rem 0;cursor:pointer;color:#fff;font-weight:600;letter-spacing:.04em;overflow-wrap:anywhere}
.panel[open]{padding-bottom:.6rem}
.tablewrap{overflow-x:auto;margin:.4rem 0}
table{border-collapse:collapse;width:100%;min-width:32rem;font-size:12px}
.word{white-space:nowrap}
th,td{text-align:left;vertical-align:top;padding:.3rem .45rem;border-bottom:1px solid var(--edge);overflow-wrap:anywhere}
th{color:var(--dim);font-weight:500}
.word{font-weight:600;letter-spacing:.08em;color:#fff}
.plainlist{margin:.3rem 0;padding-left:1.1rem}
.plainlist li{margin:.15rem 0;overflow-wrap:anywhere}
dl dt{color:#fff;margin-top:.6rem} dl dd{margin:.2rem 0 0 0;overflow-wrap:anywhere}
.btn{display:inline-flex;align-items:center;min-height:40px;padding:0 .8rem;border:1px solid var(--edge);border-radius:.35rem;margin:.3rem .4rem 0 0;text-decoration:none}Iterations — 47 Federation Honesty Page
A web page in Galaxies Wafers that draws status rules and cables. Published at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
rendergalaxies-wafers / iterations/47-federation-honesty/index.html · lines 1–68 of 68 · Entry point
- What it does
- It draws status rules and cables. Side effects: changes the web page (DOM); uses storage (browser storage, DuckDB or Parquet).
- Why it exists in the grid workflow
- Domain stage upstream_foresight (topic 'markets-data'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: cables. README: "The page (`index.html`, `app.mjs`, `lib.mjs`) is inherited unchanged from testcode/202609151339."
- Inputs & outputs
- In: JSON file status_rules.json; DuckDB queries. Out: web page.
- Downstream impact
- It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/.
- What it achieves
- Is Green Earned?
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- galaxies-wafers · iterations/47-federation-honesty · page
- Uses
- Green (stylesheet), Iterations — 43 Registry Growth Page (link), Iterations — 32 Spider and Galaxy Page (link), Iterations — 47 Federation Honesty (script src)
- Used by
- none found
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/47-federation-honesty/index.html:1-68 · blob 27accfff594bc16f1bdc4503f882133cf095a124 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="color-scheme" content="dark">
<title>Is Green Earned?</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="green.css">
</head>
<body>
<main>
<header>
<h1>IS GREEN EARNED?</h1>
<p class="dim">The federation map in the public repository <code>Ventusltd/data-federation-map-for-globalgrid2050-all-repos</code> states its own law: unknown is a real state, grey is better than fake green, and every edge has evidence. This page counts the statuses the map publishes and checks each green against the evidence its own rules ask for. Every file is read from GitHub at commit <spa … [line shortened here: 601 characters; full line on GitHub]
<p id="summary" class="summary">WAIT — nothing is fetched until you open a section.</p>
</header>
<details class="panel" data-section="rules">
<summary><span id="lbl-rules" data-base="The status rules · config/status_rules.json">The status rules · config/status_rules.json [WAIT]</span></summary>
<p class="small dim">Each status word and meaning, exactly as the file states it, worst first.</p>
<div class="tablewrap"><table><thead><tr><th>status</th><th>label</th><th>meaning, in the file's words</th></tr></thead><tbody id="rules-body"><tr><td colspan="3" class="dim">not yet known</td></tr></tbody></table></div>
<p class="small dim" id="rules-evidence">not yet known</p>
</details>
<details class="panel" data-section="counts">
<summary><span id="lbl-counts" data-base="Nodes per status · every node file the dashboards read">Nodes per status · every node file the dashboards read [WAIT]</span></summary>
<p class="small dim">Counted now from each file. A status word the rules file does not define is counted under its own word and marked "not in status_rules.json". Columns: the root board <code>live_sandbox/federation_control_ledger/data/nodes.json</code> (read by <code>dashboard/federation_radial.html</code> and the live board), the data-federation child scope, the globalgrid2050 contents cart … [line shortened here: 542 characters; full line on GitHub]
<div class="tablewrap"><table><thead><tr><th>status</th><th>root board</th><th>child scope</th><th>contents</th><th>nodes.parquet</th></tr></thead><tbody id="counts-body"><tr><td colspan="5" class="dim">not yet known</td></tr></tbody></table></div>
<p class="small dim" id="counts-note"></p>
</details>
<details class="panel" data-section="green">
<summary><span id="lbl-green" data-base="Green without evidence">Green without evidence [WAIT]</span></summary>
<p class="small dim" id="green-rule">not yet known</p>
<div class="tablewrap"><table><thead><tr><th>file</th><th>green nodes</th><th>green without evidence</th><th>node fields in the file</th></tr></thead><tbody id="green-body"><tr><td colspan="4" class="dim">not yet known</td></tr></tbody></table></div>
<ul id="green-list" class="plainlist small"></ul>
</details>
<details class="panel" data-section="edges">
<summary><span id="lbl-edges" data-base="Edges without evidence">Edges without evidence [WAIT]</span></summary>
<p class="small dim">DATA_CONTRACT.md requires <code>evidencePath</code> and <code>evidenceText</code> on every edge. An edge is without evidence when its file has no such field, or the field is empty.</p>
<div class="tablewrap"><table><thead><tr><th>file</th><th>edges</th><th>without evidencePath</th><th>without evidenceText</th><th>edge shape</th></tr></thead><tbody id="edges-body"><tr><td colspan="5" class="dim">not yet known</td></tr></tbody></table></div>
</details>
<details class="panel" data-section="inv">
<summary><span id="lbl-inv" data-base="Contract invariants · DATA_CONTRACT.md">Contract invariants · DATA_CONTRACT.md [WAIT]</span></summary>
<p class="small dim">Each invariant the contract lists, checked where the data allows, against <code>current/nodes.parquet</code> and <code>current/edges.parquet</code> read in this browser. The build's own claim, from <code>reports/json/FEDERATION_MAP_LATEST.json</code>, stands beside it.</p>
<div class="tablewrap"><table><thead><tr><th>invariant</th><th>measured here</th><th>build report says</th><th>result</th></tr></thead><tbody id="inv-body"><tr><td colspan="4" class="dim">not yet known</td></tr></tbody></table></div>
</details>
<details class="panel" id="questions">
<summary>Questions</summary>
<dl>
<dt>1. How does this help draw a system or a single-line diagram?</dt>
<dd>None yet. The federation map is a map of repositories, not of the grid: it draws no busbar, feeder, transformer, cable route, protection or earthing. What it gives a drawing is a trust check on the repositories that draw one. Nodes in the contents cartridge whose id names a drawing (name-match inference on <code>sld</code>, <code>cable</code>, <code>grid</code>, <code>atlas</code>): <spa … [line shortened here: 463 characters; full line on GitHub]
<dt>2. What is the federation map used for?</dt>
<dd>To make every repository a node and every dependency an edge with evidence. <code>scripts/build_federation_map.py</code>, run by <code>.github/workflows/gridbot_federation_map_weekly.yml</code>, scans the owner's repositories through GitHub API metadata and writes <code>current/nodes.parquet</code>, <code>current/edges.parquet</code> and weekly snapshots, checked with DuckDB; <code>scrip … [line shortened here: 799 characters; full line on GitHub]
<span class="btns"><a class="btn" id="q-code" rel="noopener">CODE</a><a class="btn" id="q-app" rel="noopener">APP</a></span></dd>
<dt>3. Where does it lead next?</dt>
<dd>To the estate registry, which counts content and dependencies across every repository over time: <a href="../43-registry-growth/">43 · registry growth</a>. And to the spider that walks repositories into the galaxy of code: <a href="../32-spider-and-galaxy/">32 · spider and galaxy</a>.</dd>
</dl>
<p class="small"><b>Machine detail.</b> Inputs: <code>config/status_rules.json</code> (status words, meanings); <code>DATA_CONTRACT.md</code> (required fields, keys, invariants, read by hand into this page's checks); three node JSON files (<code>properties.status</code>, or <code>rag</code>); three edge JSON files; <code>current/nodes.parquet</code> and <code>current/edges.parquet</code> (zstd … [line shortened here: 1,047 characters; full line on GitHub]
</details>
</main>
<script type="module" src="app.mjs"></script>
</body>
</html>UK Energy Tracking V6 — Generation History Page
A web page in GB Electricity UI. Published at https://ventusltd.github.io/gb-electricity-ui/uk_energy_tracking_v6/generation_history/.
rendergb-electricity-ui / uk_energy_tracking_v6/generation_history/index.html · lines 1–27 of 27 · Entry point
- What it does
- It draws its content. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage upstream_foresight (path word 'generation'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
- Inputs & outputs
- Out: web page.
- Downstream impact
- Used directly by 2 files: Monolith Reference (gb-electricity-ui, https://ventusltd.github.io/gb-electricity-ui/uk_energy_tracking_v6/generation_history/monolith-reference.html); GB Electricity UI — UK Energy Tracking V6 Page (gb-electricity-ui, https://ventusltd.github.io/gb-electricity-ui/uk_energy_tracking_v6/). Reached from 1 other entry point, including Monolith Reference (gb-electricity-ui, https://ventusltd.github.io/gb-electricity-ui/uk_energy_tracking_v6/monolith-reference.html). It is itself an entry point, published at https://ventusltd.github.io/gb-electricity-ui/uk_energy_tracking_v6/generation_history/.
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- Loaded by the Monolith Reference page at https://ventusltd.github.io/gb-electricity-ui/uk_energy_tracking_v6/generation_history/monolith-reference.html and 1 other page.
- Application
- gb-electricity-ui · uk_energy_tracking_v6/generation_history · page
- Uses
- Monolith Reference (link), GB Electricity UI — UK Energy Tracking V6 Page (link), ../../assets/app.css
- Used by
- linked from Monolith Reference (link), linked from GB Electricity UI — UK Energy Tracking V6 Page (link)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- gb-electricity-ui@f29f8b8e9a6317e7041ff0469645237a273de8a3 uk_energy_tracking_v6/generation_history/index.html:1-27 · blob a03723971b014346b376066dd7d834bf7ab60521 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Generation History · Compare</title>
<link rel="stylesheet" href="../../assets/app.css">
<style>.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.compare-frame{width:100%;height:78vh;border:1px solid rgba(0,255,255,.3);border-radius:12px;background:#000}.compare-card{border:1px solid rgba(0,255,255,.25);border-radius:12px;padding:10px;background:rgba(7,11,18,.88)}.compare-card h2{color:#00ffff;margin:0 0 8px;font-size:16px}.audit-note{border:1px solid rgba(255,85,85,. … [line shortened here: 624 characters; full line on GitHub]
</head>
<body>
<main class="shell">
<header class="hero">
<div class="subtitle">GLOBALGRID2050 · GENERATION HISTORY · SIDE BY SIDE</div>
<h1 class="title">Old Monolith Reference vs New Federation Build</h1>
<div class="rule"></div>
<div class="source-box"><strong>Migration rule:</strong> the old working page stays untouched. The new build lives as a separate file. This comparison page exists so structure, behaviour and data wiring can be migrated smoothly and audited before any launch decision.</div>
<nav class="nav"><a href="monolith-reference.html">Tab 1 old monolith reference</a><a href="new-build.html">Tab 2 new build</a><a href="../">GB tracker comparison</a><a href="https://github.com/Ventusltd/globalgrid2050/tree/main/uk_energy_tracking_v6/generation_history">Monolith source folder</a></nav>
</header>
<div class="audit-note"><strong>Audit discipline:</strong> the old monolith contains the real audit history, workflow logs and GridBot records. This repo must not improvise a replacement. It must port in small steps, compare against the original, and only wire data after the declared data-law checks pass.</div>
<section class="compare-grid">
<div class="compare-card"><h2>Tab 1 · Old working monolith reference</h2><iframe class="compare-frame" src="monolith-reference.html" title="Old monolith reference"></iframe></div>
<div class="compare-card"><h2>Tab 2 · New federation build</h2><iframe class="compare-frame" src="new-build.html" title="New federation build"></iframe></div>
</section>
<footer class="footer">This page is below-red-line staging only. Do not promote above the homepage red line until human approval.</footer>
</main>
</body>
</html>