From 4cb5a9c9067887ccc8ad44859960c849a9c16a99 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:23:50 +0000 Subject: [PATCH 01/41] ultraplan: a generator for a data-first tech tree scripts/ultraplan/ultraplan.mjs reads three JCS JSON Lines files in docs/ultraplan (advisors, tree nodes, return tickets) and writes generated/ultraplan.adoc and generated/tree.svg. It has two commands: `build` writes the views; `check` refuses stale views or bad data. Derived, never typed: - each node's era (the longest chain of needs below it); - the frontier (open nodes whose needs are all done); - how much a node unlocks; - forks (nodes enabling two or more tracks) and confluences (nodes needing two or more); - one pick per advisor. Typed status is held to account: - done needs evidence that holds: a file in the repository, a claim whose grade the registry view derives at or above a stated grade, or an ADR whose Status opens "Accepted"; - a done node's needs must be done; - the needs must form a DAG; - at most three nodes may be active; - blocked must say what blocks it. The schema is closed. Each line must already be in JCS form. Counsel from the private "me" advisor is refused, so personal notes cannot enter the public tree. The site copies a view's assets (its pictures) to the same path, so the tree's image stays relative there and is link-checked. `just ultraplan` and `just ultraplan-check` run the generator, and check-views includes the check. Tests: 13 hermetic tests on a fixture repository. They cover: - derivation; - determinism; - each refusal; - the evidence parsers against the real registry view and ADRs. Mutation controls: removing the evidence rule, the me refusal, the active limit, the done-needs-done rule or the JCS rule each makes a test fail. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- Justfile | 13 +- scripts/site/site.mjs | 9 + scripts/ultraplan/ultraplan.mjs | 560 +++++++++++++++++++++++++++++ tests/ultraplan/ultraplan.test.mjs | 148 ++++++++ 4 files changed, 729 insertions(+), 1 deletion(-) create mode 100644 scripts/ultraplan/ultraplan.mjs create mode 100644 tests/ultraplan/ultraplan.test.mjs diff --git a/Justfile b/Justfile index b9034c19..3128e8f2 100644 --- a/Justfile +++ b/Justfile @@ -712,7 +712,7 @@ check: check-views site-check check-proofs receipt-check # Needs bun, network for the receipts, and MATHESIS_STANDARDS (see `registry`). # Views current: catalogue, census tests, atlas, claims registry, bridges and # the worked cohort examples -check-views: catalogue-check census-test atlas-check registry-check applied-check +check-views: catalogue-check census-test atlas-check registry-check applied-check ultraplan-check # Needs agda, coqc and lean, e.g. in the pinned Guix: # guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- just check-proofs @@ -797,6 +797,17 @@ applied-check: bun scripts/applied/cohort.mjs check bun test tests/applied/ +# Regenerate the ultraplan (the tech tree of Mathesis) from docs/ultraplan/*.jsonl: +# the page docs/ultraplan/generated/ultraplan.adoc and its picture tree.svg +ultraplan: + bun scripts/ultraplan/ultraplan.mjs build + +# Fail if the ultraplan views are stale, or the tree's data is not sound: an unknown +# or cyclic need, a done node without evidence that holds, too many active nodes +ultraplan-check: + bun scripts/ultraplan/ultraplan.mjs check + bun test tests/ultraplan/ + # โ”€โ”€ mathesis: static site of the generated views (re-anchoring plan WO 4.3) โ”€โ”€ # Build the site into OUT (default: a fresh temp dir; never a tracked path). diff --git a/scripts/site/site.mjs b/scripts/site/site.mjs index da4bc81c..9750479a 100644 --- a/scripts/site/site.mjs +++ b/scripts/site/site.mjs @@ -37,6 +37,9 @@ export const VIEWS = [ how: 'Built by `scripts/registry/claims-registry.mjs` from `docs/theory/admissions.jsonl`, the claims and the receipt they pin.'}, {file: 'applied-systems/finance/cohort-economics/generated/examples.adoc', needs: 'scripts/applied/cohort.mjs', how: 'Built by `scripts/applied/cohort.mjs` from the files in `applied-systems/finance/cohort-economics/examples/`.'}, + {file: 'docs/ultraplan/generated/ultraplan.adoc', needs: 'scripts/ultraplan/ultraplan.mjs', + how: 'Built by `scripts/ultraplan/ultraplan.mjs` from `docs/ultraplan/tree.jsonl`, its advisors and its return tickets. Eras, frontier and picks are derived.', + assets: ['docs/ultraplan/generated/tree.svg']}, ]; export const htmlPath = adoc => adoc.replace(/\.adoc$/, '.html'); @@ -142,6 +145,12 @@ export function build(root, out) { writeFileSync(path.join(stage, 'index.adoc'), frontPage(read)); asciidoctor(['-D', out, path.join(stage, 'index.adoc')]); asciidoctor(['-R', root, '-D', out, ...VIEWS.map(v => path.join(root, v.file))]); + // A view's assets (its pictures) are copied to the same path in the site, so + // a relative image stays relative there and is checked like any link. + for (const a of VIEWS.flatMap(v => v.assets ?? [])) { + mkdirSync(path.dirname(path.join(out, a)), {recursive: true}); + writeFileSync(path.join(out, a), readFileSync(path.join(root, a))); + } const pages = walk(out).filter(f => f.endsWith('.html')); const files = new Set(walk(out)); diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs new file mode 100644 index 00000000..4bc7043c --- /dev/null +++ b/scripts/ultraplan/ultraplan.mjs @@ -0,0 +1,560 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// The ultraplan of Mathesis: a tech tree whose source of truth is data. +// +// bun scripts/ultraplan/ultraplan.mjs build write the generated views +// bun scripts/ultraplan/ultraplan.mjs check refuse stale views or bad data +// +// Sources (I-JSON, one JCS record a line): +// docs/ultraplan/advisors.jsonl the council: who reads the tree, and how +// docs/ultraplan/tree.jsonl the nodes; `needs` are the edges +// docs/ultraplan/expeditions.jsonl return tickets: off-tree trips, each one +// grafted onto the tree or archived +// Views: +// docs/ultraplan/generated/ultraplan.adoc +// docs/ultraplan/generated/tree.svg +// +// What is typed and what is derived. A node's era, what it enables, the +// frontier (what can be started now), the forks and confluences and each +// advisor's pick are derived from the data and never typed. A node's status +// is typed, but `done` must carry evidence that this script checks against the +// repository: a file that exists, a claim whose grade the registry view +// derives, or an ADR whose status is Accepted. A done node's needs must be +// done too, and no more than ACTIVE_LIMIT nodes may be active at once. The +// value marks are judgements, and the view says so. +// +// The "me" advisor is private (owner ruling 2026-11-24): its notes are kept +// outside this public repository, and a node carries at most the neutral tag +// `owner_value: "high"`. Counsel under the key `me` is refused. +import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync} from 'node:fs'; +import path from 'node:path'; +import {parseJsonl} from '../atlas/census-atlas.mjs'; +import {jcs} from '../registry/theory-ledger.mjs'; + +export const ROOT = path.resolve(import.meta.dir, '../..'); +export const DIR = 'docs/ultraplan'; +export const VIEW = `${DIR}/generated/ultraplan.adoc`; +export const SVG = `${DIR}/generated/tree.svg`; + +export const TRACKS = ['maths', 'engineering', 'science', 'economics', 'publications', 'ecosystem']; +export const STATUSES = ['done', 'active', 'open', 'blocked', 'dropped']; +export const SIZES = {S: 1, M: 2, L: 4, XL: 8}; +export const VALUE_KEYS = ['maths', 'engineering', 'science', 'economics', 'publications', 'teaching', 'soundness', 'ecosystem']; +export const KINDS = ['theorem', 'tool', 'data', 'view', 'paper', 'decision', 'infrastructure', 'method']; +export const ACTIVE_LIMIT = 3; +export const PWG_ORDER = ['ungraded', 'PWG-3', 'PWG-2i', 'PWG-2ii', 'PWG-1']; + +// The eras of the tree, by depth (the longest chain of needs below a node). +export const ERAS = [ + ['๐Ÿชจ', 'Tally sticks'], ['๐Ÿงฎ', 'Abacus'], ['๐Ÿ“', 'Euclid'], ['๐ŸŒŒ', 'Kepler'], + ['โ™พ๏ธ', 'Cantor'], ['๐Ÿงฉ', 'Gรถdel'], ['๐ŸŒ€', 'Grothendieck'], ['๐Ÿš€', 'Frontier beyond'], +]; +export const era = d => d < ERAS.length ? ERAS[d] : ['๐Ÿš€', `Frontier beyond +${d - ERAS.length + 1}`]; + +export const STATUS_GLYPH = {done: 'โœ…', active: '๐Ÿ”จ', open: '๐ŸŒฑ', blocked: 'โ›”', dropped: '๐Ÿ‚'}; +export const TRACK_GLYPH = {maths: 'โˆ‘', engineering: 'โš™', science: '๐Ÿ”ฌ', economics: '๐Ÿช™', publications: '๐Ÿ“œ', ecosystem: '๐Ÿ—บ'}; +export const TRACK_FILL = { + maths: '#fff1b8', engineering: '#d6e8ff', science: '#d9f7df', + economics: '#ffe0d6', publications: '#eee0ff', ecosystem: '#ffe9c7', +}; + +const SLUG = /^[a-z0-9]+(-[a-z0-9]+)*$/; +const isStr = (v, max = 400) => typeof v === 'string' && v.length > 0 && v.length <= max && v === v.trim() && !/[\u0000-\u001f]/.test(v); + +// โ”€โ”€ Reading โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// Each source line must already be its own JCS form, so the data has one +// spelling and a diff shows only real change. +export function readSource(text, name) { + const rows = parseJsonl(text, name); + const lines = text === '' ? [] : text.slice(0, -1).split('\n'); + rows.forEach((r, i) => { + if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); write it as ${jcs(r)}`); + }); + return rows; +} + +function closed(obj, allowed, where) { + if (obj === null || typeof obj !== 'object' || Array.isArray(obj)) throw new Error(`${where}: must be an object`); + for (const k of Object.keys(obj)) if (!allowed.includes(k)) throw new Error(`${where}: unknown field "${k}"`); +} + +// โ”€โ”€ Evidence โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// The grade the registry view derives for a claim id, or null when the view +// does not list it. The view is generated and checked by registry-check. +export function registryGrade(registryText, id) { + const line = registryText.split('\n').find(l => l.includes(`[${id}]`)); + if (!line) return null; + const m = /\|`(PWG-1|PWG-2ii|PWG-2i|PWG-3|ungraded)`/.exec(line) || /\|`?(ungraded)`?\s*\|/.exec(line); + return m ? m[1] : null; +} + +// Whether an ADR's Status section opens with "Accepted". +export function adrAccepted(text) { + const lines = text.split('\n'); + const i = lines.findIndex(l => /^=+ Status\s*$/.test(l)); + if (i < 0) return false; + const first = lines.slice(i + 1).find(l => l.trim() !== ''); + return !!first && /^\**Accepted\b/.test(first.trim()); +} + +// Check one evidence item against the repository; return an error or null. +export function checkEvidence(ev, ctx) { + closed(ev, ['path', 'claim', 'min_pwg', 'adr'], 'evidence'); + const kinds = ['path', 'claim', 'adr'].filter(k => k in ev); + if (kinds.length !== 1) return 'an evidence item names exactly one of path, claim or adr'; + if (ev.path !== undefined) { + if (!isStr(ev.path, 300) || ev.path.startsWith('/') || ev.path.split('/').includes('..')) return `evidence path ${JSON.stringify(ev.path)} is not a repository path`; + return ctx.exists(ev.path) ? null : `evidence path ${ev.path} does not exist`; + } + if (ev.claim !== undefined) { + if (!isStr(ev.claim) || !/^[\w.-]+\/[\w.-]+#[A-Z]+-[0-9A-Za-z]+$/.test(ev.claim)) return `evidence claim ${JSON.stringify(ev.claim)} is not OWNER/REPO#ID`; + const min = ev.min_pwg ?? 'PWG-3'; + if (!PWG_ORDER.includes(min) || min === 'ungraded') return `evidence min_pwg ${JSON.stringify(min)} is not a grade`; + const got = registryGrade(ctx.registry, ev.claim); + if (got === null) return `the registry view does not list ${ev.claim}`; + return PWG_ORDER.indexOf(got) >= PWG_ORDER.indexOf(min) ? null : `${ev.claim} derives ${got}, below ${min}`; + } + if (!isStr(ev.adr) || !/^\d{4}$/.test(ev.adr)) return `evidence adr ${JSON.stringify(ev.adr)} is not a four-digit ADR number`; + const file = ctx.adrFile(ev.adr); + if (!file) return `no ADR ${ev.adr} in docs/decisions`; + return adrAccepted(ctx.read(file)) ? null : `ADR ${ev.adr} is not Accepted`; +} + +// โ”€โ”€ Validation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +export function validate({advisors, nodes, expeditions}, ctx) { + const errors = []; + const fail = m => errors.push(m); + + const advisorIds = new Set(); + for (const a of advisors) { + try { closed(a, ['id', 'name', 'glyph', 'asks', 'reads', 'private'], `advisor ${a?.id}`); } catch (e) { fail(e.message); continue; } + if (!isStr(a.id, 40) || !SLUG.test(a.id) || advisorIds.has(a.id)) fail(`advisor id ${JSON.stringify(a.id)} is missing, not a slug, or repeated`); + advisorIds.add(a.id); + for (const k of ['name', 'glyph', 'asks']) if (!isStr(a[k])) fail(`advisor ${a.id}: ${k} is required`); + if (a.reads !== undefined && !VALUE_KEYS.includes(a.reads)) fail(`advisor ${a.id}: reads must be one of ${VALUE_KEYS.join(', ')}`); + if (a.private !== undefined && a.private !== true) fail(`advisor ${a.id}: private is true or absent`); + } + + const byId = new Map(); + for (const n of nodes) { + const where = `node ${n?.id}`; + try { + closed(n, ['id', 'name', 'glyph', 'track', 'kind', 'status', 'size', 'summary', 'needs', 'rivals', 'value', + 'counsel', 'evidence', 'blocked_by', 'where', 'owner_value', 'refs'], where); + } catch (e) { fail(e.message); continue; } + if (!isStr(n.id, 60) || !SLUG.test(n.id)) { fail(`${where}: id must be a lowercase slug`); continue; } + if (byId.has(n.id)) { fail(`${where}: repeated id`); continue; } + byId.set(n.id, n); + if (!isStr(n.name, 80)) fail(`${where}: name is required (at most 80 characters)`); + if (!isStr(n.glyph, 16)) fail(`${where}: glyph is required`); + if (!TRACKS.includes(n.track)) fail(`${where}: track must be one of ${TRACKS.join(', ')}`); + if (!KINDS.includes(n.kind)) fail(`${where}: kind must be one of ${KINDS.join(', ')}`); + if (!STATUSES.includes(n.status)) fail(`${where}: status must be one of ${STATUSES.join(', ')}`); + if (!(n.size in SIZES)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); + if (!isStr(n.summary, 600)) fail(`${where}: summary is required (at most 600 characters)`); + for (const k of ['needs', 'rivals', 'evidence', 'refs']) if (n[k] !== undefined && !Array.isArray(n[k])) fail(`${where}: ${k} must be a list`); + if (n.value !== undefined) { + try { closed(n.value, VALUE_KEYS, `${where} value`); } catch (e) { fail(e.message); } + for (const [k, v] of Object.entries(n.value ?? {})) if (!Number.isInteger(v) || v < 0 || v > 3) fail(`${where}: value.${k} must be 0, 1, 2 or 3`); + } + if (n.counsel !== undefined) { + if (n.counsel === null || typeof n.counsel !== 'object' || Array.isArray(n.counsel)) fail(`${where}: counsel must be an object`); + else for (const [k, v] of Object.entries(n.counsel)) { + if (k === 'me') fail(`${where}: counsel.me is refused; the me advisor's notes stay outside the public repository`); + else if (!advisorIds.has(k)) fail(`${where}: counsel from unknown advisor ${k}`); + if (!isStr(v, 300)) fail(`${where}: counsel.${k} must be a short text`); + } + } + if (n.where !== undefined && !/^(estate|upstream):[\w.-]+\/[\w.-]+$/.test(n.where)) fail(`${where}: where is estate:OWNER/REPO or upstream:OWNER/REPO, or absent for this repository`); + if (n.owner_value !== undefined && n.owner_value !== 'high') fail(`${where}: owner_value is "high" or absent`); + if (n.status === 'blocked' && !isStr(n.blocked_by)) fail(`${where}: a blocked node says what blocks it (blocked_by)`); + if (n.status !== 'blocked' && n.blocked_by !== undefined) fail(`${where}: blocked_by belongs to a blocked node only`); + for (const r of n.refs ?? []) if (!isStr(r, 300)) fail(`${where}: each ref is a short text`); + } + + for (const n of byId.values()) { + const where = `node ${n.id}`; + for (const k of ['needs', 'rivals']) { + const seen = new Set(); + for (const t of n[k] ?? []) { + if (!byId.has(t)) fail(`${where}: ${k} names unknown node ${t}`); + if (t === n.id) fail(`${where}: ${k} names itself`); + if (seen.has(t)) fail(`${where}: ${k} names ${t} twice`); + seen.add(t); + } + } + for (const r of n.rivals ?? []) if (byId.has(r) && !(byId.get(r).rivals ?? []).includes(n.id)) fail(`${where}: rival ${r} does not name ${n.id} back`); + if (n.status === 'done') { + if (!(n.evidence ?? []).length) fail(`${where}: done needs evidence (a path, a claim grade or an accepted ADR)`); + for (const ev of n.evidence ?? []) { + let e; + try { e = checkEvidence(ev, ctx); } catch (x) { e = x.message; } + if (e) fail(`${where}: ${e}`); + } + for (const t of n.needs ?? []) if (byId.get(t)?.status !== 'done') fail(`${where}: done, but its need ${t} is not done`); + } else if (n.evidence !== undefined && n.status !== 'active') { + fail(`${where}: evidence belongs to a done or active node`); + } + } + + // The needs form a DAG. + const state = new Map(); + const visit = (id, trail) => { + if (state.get(id) === 2) return; + if (state.get(id) === 1) { fail(`the needs form a cycle: ${[...trail, id].join(' -> ')}`); return; } + state.set(id, 1); + for (const t of byId.get(id)?.needs ?? []) if (byId.has(t)) visit(t, [...trail, id]); + state.set(id, 2); + }; + for (const id of byId.keys()) visit(id, []); + + const active = [...byId.values()].filter(n => n.status === 'active'); + if (active.length > ACTIVE_LIMIT) fail(`${active.length} nodes are active (${active.map(n => n.id).join(', ')}); at most ${ACTIVE_LIMIT} may be, so finish or park one first`); + + const exIds = new Set(); + for (const x of expeditions) { + const where = `expedition ${x?.id}`; + try { closed(x, ['id', 'what', 'why', 'size', 'date', 'status', 'graft', 'lesson'], where); } catch (e) { fail(e.message); continue; } + if (!isStr(x.id, 20) || !/^X-\d{3}$/.test(x.id) || exIds.has(x.id)) fail(`${where}: id is X-NNN and unique`); + exIds.add(x.id); + for (const k of ['what', 'why']) if (!isStr(x[k])) fail(`${where}: ${k} is required`); + if (!(x.size in SIZES)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); + if (!/^\d{4}-\d{2}-\d{2}$/.test(x.date ?? '')) fail(`${where}: date is YYYY-MM-DD`); + if (!['out', 'grafted', 'archived'].includes(x.status)) fail(`${where}: status is out, grafted or archived`); + if (x.status === 'grafted' && !byId.has(x.graft)) fail(`${where}: a grafted expedition names the node it became (graft)`); + if (x.status !== 'grafted' && x.graft !== undefined) fail(`${where}: graft belongs to a grafted expedition`); + if (x.status === 'archived' && !isStr(x.lesson)) fail(`${where}: an archived expedition records what it taught (lesson)`); + if (x.status !== 'archived' && x.lesson !== undefined) fail(`${where}: lesson belongs to an archived expedition`); + } + + if (errors.length) throw new Error(errors.join('\n')); + return byId; +} + +// โ”€โ”€ Derivation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +export function derive(byId, advisors) { + const children = new Map([...byId.keys()].map(id => [id, []])); + for (const n of byId.values()) for (const t of n.needs ?? []) children.get(t).push(n.id); + for (const c of children.values()) c.sort(); + + const depth = new Map(); + const depthOf = id => { + if (depth.has(id)) return depth.get(id); + const ns = byId.get(id).needs ?? []; + const d = ns.length ? 1 + Math.max(...ns.map(depthOf)) : 0; + depth.set(id, d); + return d; + }; + const below = new Map(); + const belowOf = id => { + if (below.has(id)) return below.get(id); + const s = new Set(); + for (const c of children.get(id)) { s.add(c); for (const x of belowOf(c)) s.add(x); } + below.set(id, s); + return s; + }; + for (const id of byId.keys()) { depthOf(id); belowOf(id); } + + const live = n => n.status !== 'dropped'; + const frontier = [...byId.values()].filter(n => n.status === 'open' && (n.needs ?? []).every(t => byId.get(t).status === 'done')); + const total = n => Object.values(n.value ?? {}).reduce((a, b) => a + b, 0); + const leverage = id => [...below.get(id)].filter(x => live(byId.get(x))).length; + + const forks = [...byId.values()].filter(n => live(n) && new Set(children.get(n.id).map(c => byId.get(c)).filter(live).map(c => c.track)).size >= 2); + const confluences = [...byId.values()].filter(n => live(n) && new Set((n.needs ?? []).map(t => byId.get(t).track)).size >= 2); + const rivalries = []; + for (const n of byId.values()) for (const r of n.rivals ?? []) if (n.id < r) rivalries.push([n.id, r]); + + // Each advisor's pick from the frontier. An advisor that reads a value key + // ranks by it, then by leverage, then by value for effort; the contrarian + // takes the frontier node the council rates lowest that still unlocks the + // most; the me advisor names only nodes tagged owner_value, with no notes. + const byKey = (k) => (a, b) => (b.value?.[k] ?? 0) - (a.value?.[k] ?? 0) || leverage(b.id) - leverage(a.id) + || total(b) / SIZES[b.size] - total(a) / SIZES[a.size] || (a.id < b.id ? -1 : 1); + const picks = new Map(); + for (const a of advisors) { + let pick = null; + if (a.id === 'contrarian') { + pick = [...frontier].sort((x, y) => total(x) - total(y) || leverage(y.id) - leverage(x.id) || (x.id < y.id ? -1 : 1))[0] ?? null; + } else if (a.private) { + pick = [...frontier].filter(n => n.owner_value === 'high').sort(byKey('maths'))[0] ?? null; + } else if (a.reads) { + pick = [...frontier].filter(n => (n.value?.[a.reads] ?? 0) > 0).sort(byKey(a.reads))[0] ?? null; + } + picks.set(a.id, pick); + } + return {children, depth, below, frontier, forks, confluences, rivalries, picks, leverage, total}; +} + +// โ”€โ”€ Rendering: AsciiDoc โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +const cell = s => String(s).replace(/\|/g, '\\|'); +const nameOf = (byId, id) => `${byId.get(id).glyph} ${byId.get(id).name}`; +const xref = (byId, id) => `<<${id},${cell(nameOf(byId, id))}>>`; + +export function renderAdoc(byId, advisors, expeditions, d) { + const L = []; + const nodes = [...byId.values()]; + const count = s => nodes.filter(n => n.status === s).length; + L.push('// SPDX-License-Identifier: CC-BY-SA-4.0'); + L.push('// GENERATED by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl,'); + L.push('// docs/ultraplan/advisors.jsonl and docs/ultraplan/expeditions.jsonl; do not hand-edit.'); + L.push('= Mathesis ultraplan: the tech tree'); + L.push(':toc: macro'); + L.push(':toclevels: 1'); + L.push(''); + L.push('Each node is a capability. Its needs are the nodes it is built on, so the tree reads'); + L.push('like a civilisation game: one discovery enables the next. The data in'); + L.push('`docs/ultraplan/` is the source; this page and its picture are generated from it.'); + L.push('The era, the frontier, the forks, the confluences and each advisor\'s pick are derived,'); + L.push('never typed. A node marked done carries evidence the generator checks: a file, a'); + L.push('claim grade that the registry derives, or an accepted decision record. The value marks'); + L.push('are judgements, written down so they can be argued with.'); + L.push(''); + L.push(`Census of the tree: ${count('done')} done, ${count('active')} active (at most ${ACTIVE_LIMIT}), ${count('open')} open, ${count('blocked')} blocked, ${count('dropped')} dropped, of ${nodes.length} nodes. ${d.frontier.length} can be started now.`); + L.push(''); + L.push('toc::[]'); + L.push(''); + L.push('image::tree.svg[The tech tree of Mathesis, from the first era on the left to the frontier on the right]'); + L.push(''); + L.push('Key: โœ… done ยท ๐Ÿ”จ active ยท ๐ŸŒฑ open ยท โ›” blocked ยท ๐Ÿ‚ dropped. A gold border marks a node'); + L.push('that can be started now. Colours are tracks: ' + TRACKS.map(t => `${TRACK_GLYPH[t]} ${t}`).join(' ยท ') + '.'); + L.push(''); + + L.push('== Research now: the frontier'); + L.push(''); + L.push('These open nodes have every need done, so any of them can start today. "Unlocks"'); + L.push('counts the live nodes that depend on it, directly or through others.'); + L.push(''); + if (!d.frontier.length) L.push('Nothing is on the frontier.'); + else { + L.push('[cols="3,1,1,1,5",options="header"]'); + L.push('|==='); + L.push('|Node |Track |Size |Unlocks |Summary'); + for (const n of [...d.frontier].sort((a, b) => d.leverage(b.id) - d.leverage(a.id) || (a.id < b.id ? -1 : 1))) { + L.push(`|${xref(byId, n.id)} |${n.track} |${n.size} |${d.leverage(n.id)} |${cell(n.summary)}${n.where ? ` _(${cell(n.where)})_` : ''}`); + } + L.push('|==='); + } + L.push(''); + + L.push('== The council'); + L.push(''); + L.push('Each advisor asks one question of every node and names one pick from the frontier.'); + L.push('The me advisor is private: its notes stay outside this repository, and it names only'); + L.push('nodes the owner has tagged.'); + L.push(''); + for (const a of advisors) { + const p = d.picks.get(a.id); + L.push(`=== ${a.glyph} ${a.name}`); + L.push(''); + L.push(`_Asks:_ ${a.asks}`); + L.push(''); + if (!p) L.push('_Pick:_ nothing on the frontier answers this advisor yet.'); + else { + const note = p.counsel?.[a.id]; + L.push(`_Pick:_ ${xref(byId, p.id)}${note ? `. ${note}` : '.'}`); + } + L.push(''); + } + + L.push('== Forks and confluences'); + L.push(''); + L.push('A fork enables nodes on two or more tracks: work there spreads. A confluence needs'); + L.push('nodes from two or more tracks: work there joins. Rivals are different routes to the'); + L.push('same place; the contrarian keeps the road not taken in view.'); + L.push(''); + L.push('.Forks'); + for (const n of d.forks.sort((a, b) => (a.id < b.id ? -1 : 1))) { + L.push(`* ${xref(byId, n.id)} -> ${d.children.get(n.id).map(c => xref(byId, c)).join(', ')}`); + } + if (!d.forks.length) L.push('* None yet.'); + L.push(''); + L.push('.Confluences'); + for (const n of d.confluences.sort((a, b) => (a.id < b.id ? -1 : 1))) { + L.push(`* ${(n.needs ?? []).map(t => xref(byId, t)).join(' + ')} -> ${xref(byId, n.id)}`); + } + if (!d.confluences.length) L.push('* None yet.'); + L.push(''); + L.push('.Rivals'); + for (const [a, b] of d.rivalries) L.push(`* ${xref(byId, a)} or ${xref(byId, b)}`); + if (!d.rivalries.length) L.push('* None yet.'); + L.push(''); + + L.push('== The eras'); + L.push(''); + const maxDepth = Math.max(0, ...[...d.depth.values()]); + for (let k = 0; k <= maxDepth; k++) { + const [g, name] = era(k); + const inEra = nodes.filter(n => d.depth.get(n.id) === k).sort((a, b) => TRACKS.indexOf(a.track) - TRACKS.indexOf(b.track) || (a.id < b.id ? -1 : 1)); + if (!inEra.length) continue; + L.push(`=== ${g} Era ${k}: ${name}`); + L.push(''); + for (const n of inEra) { + L.push(`[[${n.id}]]`); + L.push(`==== ${STATUS_GLYPH[n.status]} ${n.glyph} ${n.name}`); + L.push(''); + L.push(n.summary); + L.push(''); + const facts = [`*Track:* ${TRACK_GLYPH[n.track]} ${n.track}`, `*Kind:* ${n.kind}`, `*Size:* ${n.size}`, `*Status:* ${n.status}`]; + if (n.where) facts.push(`*Beyond this repository:* ${n.where}`); + L.push(facts.join(' ยท ')); + L.push(''); + if ((n.needs ?? []).length) L.push(`*Needs:* ${n.needs.map(t => xref(byId, t)).join(', ')}` + ' +'); + if (d.children.get(n.id).length) L.push(`*Enables:* ${d.children.get(n.id).map(c => xref(byId, c)).join(', ')}` + ' +'); + if ((n.rivals ?? []).length) L.push(`*Rivals:* ${n.rivals.map(t => xref(byId, t)).join(', ')}` + ' +'); + if (n.status === 'blocked') L.push(`*Blocked by:* ${n.blocked_by}` + ' +'); + if ((n.evidence ?? []).length) L.push(`*Evidence:* ${n.evidence.map(ev => ev.path ? `\`${ev.path}\`` : ev.claim ? `${ev.claim} at ${ev.min_pwg ?? 'PWG-3'} or above` : `ADR ${ev.adr} accepted`).join('; ')}` + ' +'); + if (n.value && Object.keys(n.value).length) L.push(`*Value (judgement):* ${VALUE_KEYS.filter(k => n.value[k]).map(k => `${k} ${'โ—'.repeat(n.value[k])}`).join(', ')}` + ' +'); + if ((n.refs ?? []).length) L.push(`*See:* ${n.refs.join('; ')}` + ' +'); + if (L[L.length - 1].endsWith(' +')) L[L.length - 1] = L[L.length - 1].slice(0, -2); + L.push(''); + const counsel = Object.entries(n.counsel ?? {}); + if (counsel.length) { + for (const [a, text] of counsel) { + const adv = advisors.find(x => x.id === a); + L.push(`* ${adv.glyph} _${adv.name}:_ ${text}`); + } + L.push(''); + } + } + } + + L.push('== Return tickets'); + L.push(''); + L.push('Wandering off the tree is allowed. Each trip gets a card: what, why, and how big.'); + L.push('On return it is grafted onto the tree as a node, or archived with what it taught.'); + L.push(''); + if (!expeditions.length) L.push('No trip is out.'); + else { + L.push('[cols="1,1,3,3,3",options="header"]'); + L.push('|==='); + L.push('|Card |Date |What |Why |Outcome'); + for (const x of expeditions) { + const out = x.status === 'out' ? '๐ŸŽ’ out' : x.status === 'grafted' ? `๐ŸŒฟ grafted as ${xref(byId, x.graft)}` : `๐Ÿ“ฆ archived: ${cell(x.lesson)}`; + L.push(`|${x.id} |${x.date} |${cell(x.what)} |${cell(x.why)} |${out}`); + } + L.push('|==='); + } + L.push(''); + + L.push('== Beyond this repository'); + L.push(''); + L.push('Nodes whose work lands in another repository. They are listed here so they can be'); + L.push('carried to that repository, not done here.'); + L.push(''); + const beyond = nodes.filter(n => n.where).sort((a, b) => (a.where < b.where ? -1 : a.where > b.where ? 1 : a.id < b.id ? -1 : 1)); + if (!beyond.length) L.push('None.'); + for (const n of beyond) L.push(`* ${n.where}: ${xref(byId, n.id)} (${n.status})`); + L.push(''); + return L.join('\n'); +} + +// โ”€โ”€ Rendering: SVG โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +const esc = s => String(s).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); +const clip = (s, n) => [...s].length <= n ? s : [...s].slice(0, n - 1).join('') + 'โ€ฆ'; + +export function renderSvg(byId, d) { + const COL = 250, BOX_W = 214, BOX_H = 50, GAP = 14, TOP = 96, LEFT = 24; + const maxDepth = Math.max(0, ...[...d.depth.values()]); + const cols = Array.from({length: maxDepth + 1}, () => []); + for (const n of byId.values()) cols[d.depth.get(n.id)].push(n); + // Order each column by track, then by where its needs sit, so edges cross less. + const yOf = new Map(); + for (let k = 0; k <= maxDepth; k++) { + const bary = n => { + const ys = (n.needs ?? []).map(t => yOf.get(t)).filter(v => v !== undefined); + return ys.length ? ys.reduce((a, b) => a + b, 0) / ys.length : -1; + }; + cols[k].sort((a, b) => TRACKS.indexOf(a.track) - TRACKS.indexOf(b.track) || bary(a) - bary(b) || (a.id < b.id ? -1 : 1)); + cols[k].forEach((n, i) => yOf.set(n.id, TOP + i * (BOX_H + GAP))); + } + const tallest = Math.max(1, ...cols.map(c => c.length)); + const W = LEFT * 2 + (maxDepth + 1) * COL - (COL - BOX_W); + const H = TOP + tallest * (BOX_H + GAP) + 70; + const frontier = new Set(d.frontier.map(n => n.id)); + const xOf = id => LEFT + d.depth.get(id) * COL; + const o = []; + o.push(``); + o.push(`The Mathesis tech tree`); + o.push(`Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. ${byId.size} nodes in ${maxDepth + 1} eras; each arrow runs from a node to a node it enables.`); + o.push(``); + o.push(`๐Ÿฆ‰ Mathesis tech tree`); + o.push(`each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped`); + for (let k = 0; k <= maxDepth; k++) { + const [g, name] = era(k); + const x = LEFT + k * COL; + o.push(``); + o.push(`${esc(`${g} ${name}`)}`); + } + for (const n of byId.values()) { + for (const t of n.needs ?? []) { + const x1 = xOf(t) + BOX_W, y1 = yOf.get(t) + BOX_H / 2, x2 = xOf(n.id), y2 = yOf.get(n.id) + BOX_H / 2; + const dx = Math.max(30, (x2 - x1) / 2); + const hot = frontier.has(n.id); + o.push(``); + } + } + for (const n of byId.values()) { + const x = xOf(n.id), y = yOf.get(n.id); + const hot = frontier.has(n.id); + const faded = n.status === 'dropped' ? ' opacity="0.45"' : ''; + o.push(``); + o.push(`${esc(`${n.name}: ${n.summary}`)}`); + o.push(``); + o.push(`${esc(n.glyph)}`); + o.push(`${esc(clip(n.name, 22))}`); + o.push(`${esc(`${TRACK_GLYPH[n.track]} ${n.track} ยท ${n.size}${n.where ? ' ยท ๐ŸŒ' : ''}`)}`); + o.push(`${STATUS_GLYPH[n.status]}`); + o.push(''); + } + let lx = LEFT; + const ly = H - 22; + for (const t of TRACKS) { + o.push(``); + o.push(`${esc(`${TRACK_GLYPH[t]} ${t}`)}`); + lx += 128; + } + o.push(`๐ŸŒ lands in another repository`); + o.push(''); + return o.join('\n') + '\n'; +} + +// โ”€โ”€ Driver โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +export function context(root = ROOT) { + const decisions = path.join(root, 'docs/decisions'); + return { + exists: p => existsSync(path.join(root, p)), + read: p => readFileSync(path.join(root, p), 'utf8'), + registry: existsSync(path.join(root, 'docs/atlas/generated/registry.adoc')) ? readFileSync(path.join(root, 'docs/atlas/generated/registry.adoc'), 'utf8') : '', + adrFile: n => { + const f = existsSync(decisions) && readdirSync(decisions).find(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && !x.includes('template')); + return f ? `docs/decisions/${f}` : null; + }, + }; +} + +export function generate(root = ROOT) { + const read = f => readSource(readFileSync(path.join(root, DIR, f), 'utf8'), `${DIR}/${f}`); + const data = {advisors: read('advisors.jsonl'), nodes: read('tree.jsonl'), expeditions: read('expeditions.jsonl')}; + const byId = validate(data, context(root)); + const d = derive(byId, data.advisors); + return {[VIEW]: renderAdoc(byId, data.advisors, data.expeditions, d), [SVG]: renderSvg(byId, d), derived: d, byId}; +} + +if (import.meta.main) { + const cmd = process.argv[2]; + if (!['build', 'check'].includes(cmd)) { console.error('usage: ultraplan.mjs build|check'); process.exit(2); } + let out; + try { out = generate(); } catch (e) { console.error(`ultraplan: FAIL\n${e.message}`); process.exit(1); } + const files = [VIEW, SVG]; + if (cmd === 'build') { + mkdirSync(path.join(ROOT, DIR, 'generated'), {recursive: true}); + for (const f of files) writeFileSync(path.join(ROOT, f), out[f]); + console.log(`WROTE ${files.join(' and ')} (${out.byId.size} nodes, ${out.derived.frontier.length} on the frontier)`); + } else { + const stale = files.filter(f => !existsSync(path.join(ROOT, f)) || readFileSync(path.join(ROOT, f), 'utf8') !== out[f]); + if (stale.length) { console.error(`ultraplan: FAIL\nstale: ${stale.join(', ')}; run: bun scripts/ultraplan/ultraplan.mjs build`); process.exit(1); } + console.log(`PASS: the ultraplan views match the data (${out.byId.size} nodes, ${out.derived.frontier.length} on the frontier)`); + } +} diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs new file mode 100644 index 00000000..fdf3318d --- /dev/null +++ b/tests/ultraplan/ultraplan.test.mjs @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// The ultraplan generator: what it derives, and each thing it refuses. +import {test, expect, afterAll} from 'bun:test'; +import {mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import path from 'node:path'; +import {generate, validate, derive, readSource, registryGrade, adrAccepted, context, ACTIVE_LIMIT, ROOT, VIEW, SVG} + from '../../scripts/ultraplan/ultraplan.mjs'; +import {jcs} from '../../scripts/registry/theory-ledger.mjs'; + +const roots = []; +afterAll(() => { for (const r of roots) rmSync(r, {recursive: true, force: true}); }); + +const ADVISORS = [ + {id: 'maths', name: 'Mathematician', glyph: 'โˆ‘', asks: 'Is it true, and is it deep?', reads: 'maths'}, + {id: 'engineering', name: 'Engineer', glyph: 'โš™', asks: 'Does it run, and can it be kept?', reads: 'engineering'}, + {id: 'contrarian', name: 'Contrarian', glyph: '๐Ÿฆ‰', asks: 'What if the opposite?'}, + {id: 'me', name: 'Me', glyph: '๐Ÿซถ', asks: 'Does it help the owner?', private: true}, +]; +const node = (id, extra = {}) => ({id, name: id, glyph: '๐Ÿ”ท', track: 'maths', kind: 'theorem', status: 'open', size: 'M', summary: `The ${id} node.`, ...extra}); +const BASE = [ + node('root', {status: 'done', evidence: [{path: 'README.adoc'}]}), + node('tool', {track: 'engineering', kind: 'tool', status: 'done', needs: ['root'], evidence: [{adr: '0004'}]}), + node('theorem', {needs: ['root'], value: {maths: 3}, counsel: {maths: 'The deep one.'}, owner_value: 'high'}), + node('panel', {track: 'engineering', kind: 'view', needs: ['tool', 'theorem'], value: {engineering: 2}}), + node('paper', {track: 'publications', kind: 'paper', needs: ['theorem'], value: {publications: 3}}), + node('cheap', {needs: ['tool'], value: {engineering: 1}, size: 'S'}), +]; + +// A throwaway repository root with the files the evidence checks read. +function fixture({advisors = ADVISORS, nodes = BASE, expeditions = [], registry = '', raw = {}} = {}) { + const root = mkdtempSync(path.join(tmpdir(), 'ultraplan-')); + roots.push(root); + mkdirSync(path.join(root, 'docs/ultraplan'), {recursive: true}); + mkdirSync(path.join(root, 'docs/decisions'), {recursive: true}); + mkdirSync(path.join(root, 'docs/atlas/generated'), {recursive: true}); + writeFileSync(path.join(root, 'README.adoc'), '= Fixture\n'); + writeFileSync(path.join(root, 'docs/decisions/0004-claims-registry.adoc'), '= ADR\n\n=== Status\n\n*Accepted (ratified).*\n'); + writeFileSync(path.join(root, 'docs/decisions/0005-jcs.adoc'), '= ADR\n\n=== Status\n\n*Proposed. Not accepted.*\n'); + writeFileSync(path.join(root, 'docs/atlas/generated/registry.adoc'), registry); + const jl = rows => rows.map(r => jcs(r) + '\n').join(''); + writeFileSync(path.join(root, 'docs/ultraplan/advisors.jsonl'), raw.advisors ?? jl(advisors)); + writeFileSync(path.join(root, 'docs/ultraplan/tree.jsonl'), raw.nodes ?? jl(nodes)); + writeFileSync(path.join(root, 'docs/ultraplan/expeditions.jsonl'), raw.expeditions ?? jl(expeditions)); + return root; +} +const refuses = (opts, re) => expect(() => generate(fixture(opts))).toThrow(re); +// Replace fields of one node; a field set to undefined is removed. +const strip = o => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined)); +const swap = (id, extra, nodes = BASE) => nodes.map(n => n.id === id ? strip({...n, ...extra}) : n); + +test('derives eras, the frontier, forks, confluences and each advisor\'s pick', () => { + const out = generate(fixture()); + const d = out.derived; + expect([...d.depth.entries()].sort()).toEqual([['cheap', 2], ['panel', 2], ['paper', 2], ['root', 0], ['theorem', 1], ['tool', 1]]); + expect(d.frontier.map(n => n.id).sort()).toEqual(['cheap', 'theorem']); + expect(d.forks.map(n => n.id).sort()).toEqual(['root', 'theorem', 'tool']); // each enables nodes on two tracks + expect(d.confluences.map(n => n.id)).toEqual(['panel']); // engineering + maths + expect(d.leverage('root')).toBe(5); + expect(d.picks.get('maths').id).toBe('theorem'); + expect(d.picks.get('engineering').id).toBe('cheap'); + expect(d.picks.get('contrarian').id).toBe('cheap'); // rated lowest by the council + expect(d.picks.get('me').id).toBe('theorem'); // tagged owner_value, no notes + expect(out[VIEW]).toContain('== Research now: the frontier'); + expect(out[VIEW]).toContain('_Pick:_ <>. The deep one.'); + expect(out[SVG].startsWith(' { + const a = generate(fixture()), b = generate(fixture()); + expect(a[VIEW]).toBe(b[VIEW]); + expect(a[SVG]).toBe(b[SVG]); +}); + +test('done needs evidence that holds', () => { + refuses({nodes: swap('root', {evidence: []})}, /node root: done needs evidence/); + refuses({nodes: swap('root', {evidence: [{path: 'NOPE.adoc'}]})}, /evidence path NOPE.adoc does not exist/); + refuses({nodes: swap('root', {evidence: [{path: '../etc/passwd'}]})}, /is not a repository path/); + refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); + refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); + refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); +}); + +test('a claim is evidence only at the grade the registry derives', () => { + const registry = '|https://x/blob/c/P.adoc[o/r#T-1] at `c` |theorem |`PWG-2i` |text |why\n'; + const ok = swap('root', {evidence: [{claim: 'o/r#T-1', min_pwg: 'PWG-2i'}]}); + expect(() => generate(fixture({nodes: ok, registry}))).not.toThrow(); + refuses({nodes: swap('root', {evidence: [{claim: 'o/r#T-1', min_pwg: 'PWG-2ii'}]}), registry}, /o\/r#T-1 derives PWG-2i, below PWG-2ii/); + refuses({nodes: swap('root', {evidence: [{claim: 'o/r#T-9'}]}), registry}, /does not list o\/r#T-9/); +}); + +test('a done node cannot rest on an unfinished need', () => { + refuses({nodes: swap('cheap', {status: 'done', evidence: [{path: 'README.adoc'}], needs: ['theorem']})}, /node cheap: done, but its need theorem is not done/); +}); + +test('the needs form a DAG over known nodes', () => { + refuses({nodes: swap('tool', {status: 'open', evidence: undefined}, swap('root', {status: 'open', evidence: undefined, needs: ['paper']}))}, /cycle/); + refuses({nodes: swap('theorem', {needs: ['root', 'ghost']})}, /needs names unknown node ghost/); + refuses({nodes: swap('theorem', {needs: ['root', 'root']})}, /needs names root twice/); +}); + +test('rivals name each other back', () => { + refuses({nodes: swap('paper', {rivals: ['cheap']})}, /rival cheap does not name paper back/); + const both = BASE.map(n => n.id === 'paper' ? {...n, rivals: ['cheap']} : n.id === 'cheap' ? {...n, rivals: ['paper']} : n); + expect(generate(fixture({nodes: both})).derived.rivalries).toEqual([['cheap', 'paper']]); +}); + +test('the me advisor writes nothing into the public tree', () => { + refuses({nodes: swap('theorem', {counsel: {me: 'personal note'}})}, /counsel\.me is refused/); + refuses({nodes: swap('theorem', {owner_value: 'medium'})}, /owner_value is "high" or absent/); +}); + +test(`at most ${ACTIVE_LIMIT} nodes are active`, () => { + const busy = BASE.map(n => ['theorem', 'paper', 'cheap', 'panel'].includes(n.id) ? {...n, status: 'active'} : n); + refuses({nodes: busy}, new RegExp(`4 nodes are active .* at most ${ACTIVE_LIMIT}`)); +}); + +test('closed schema, blocked reasons and canonical lines', () => { + refuses({nodes: swap('paper', {colour: 'red'})}, /node paper: unknown field "colour"/); + refuses({nodes: swap('paper', {status: 'blocked'})}, /says what blocks it/); + refuses({nodes: swap('paper', {track: 'poetry'})}, /track must be one of/); + refuses({nodes: swap('paper', {value: {maths: 4}})}, /value\.maths must be 0, 1, 2 or 3/); + refuses({nodes: swap('paper', {where: 'elsewhere'})}, /where is estate:OWNER\/REPO/); + refuses({raw: {nodes: BASE.map(n => JSON.stringify(n, null, 0)).join('\n') + '\n'}}, /not in JCS form/); +}); + +test('return tickets are grafted or archived honestly', () => { + const x = {id: 'X-001', what: 'A trip', why: 'Because', size: 'S', date: '2026-11-24', status: 'out'}; + expect(() => generate(fixture({expeditions: [x]}))).not.toThrow(); + refuses({expeditions: [{...x, status: 'grafted', graft: 'ghost'}]}, /names the node it became/); + refuses({expeditions: [{...x, status: 'archived'}]}, /records what it taught/); + refuses({expeditions: [x, {...x}]}, /id is X-NNN and unique/); +}); + +test('the evidence parsers read the real registry view and ADRs', () => { + const ctx = context(ROOT); + expect(registryGrade(ctx.registry, 'hyperpolymath/mathesis#THY-1')).toMatch(/^PWG-/); + expect(adrAccepted(ctx.read(ctx.adrFile('0004')))).toBe(true); + expect(adrAccepted(ctx.read(ctx.adrFile('0005')))).toBe(false); +}); + +test('the committed views match the committed data', () => { + const out = generate(ROOT); + expect(readFileSync(path.join(ROOT, VIEW), 'utf8')).toBe(out[VIEW]); + expect(readFileSync(path.join(ROOT, SVG), 'utf8')).toBe(out[SVG]); +}); From 2e7b20254e17b371a6fbd917a7610bb327032c37 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:23:51 +0000 Subject: [PATCH 02/41] ultraplan: the tech tree of Mathesis, with ten advisors docs/ultraplan/tree.jsonl holds 51 nodes. They are drawn from the repository itself: ROADMAP, the research programme, the re-anchoring plan, PROOF-STATUS and the registry. - 12 done nodes, each with evidence that the generator checks: the census, the proof gate, the atlas views, the claims registry (ADR 0004), THY-1 and APP-1 to APP-4 at PWG-2ii, the receipts, the theory shelf, the site build, the bridge candidates, and the tree itself. - 1 active node: the shared receipt generator (PR 122). - 2 blocked nodes: Dedukti transport, on the upstream bugs; and the GELS maths panel, until the estate coordinator answers. - 36 open nodes, 13 of them on the frontier. The forks it records: - Dedukti transport, rival to building bridges by construction; - proving the token algebra here, rival to reusing resource-algebra E-1 to E-3 through a locked bridge. Two early soundness nodes: - the status documents that contradict the receipts; - the argued vs tested-only order conflict between R-1 and resource-algebra E-1. advisors.jsonl holds the council. The owner named six (mathematician, scientist, engineer, economist, publisher, me); the owner added four (soundness auditor, estate cartographer, teacher, contrarian). The me advisor is private (owner ruling 2026-11-24). expeditions.jsonl starts empty. README.adoc says how to read the tree, how to add a node, and how return tickets work. ROADMAP points to the tree and records the ruling. CHANGELOG has an Added entry. The value marks are judgements, and the page says so. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 21 + docs/status/ROADMAP.adoc | 18 + docs/ultraplan/README.adoc | 123 ++++ docs/ultraplan/advisors.jsonl | 10 + docs/ultraplan/expeditions.jsonl | 0 docs/ultraplan/generated/tree.svg | 515 +++++++++++++++ docs/ultraplan/generated/ultraplan.adoc | 826 ++++++++++++++++++++++++ docs/ultraplan/tree.jsonl | 51 ++ 8 files changed, 1564 insertions(+) create mode 100644 docs/ultraplan/README.adoc create mode 100644 docs/ultraplan/advisors.jsonl create mode 100644 docs/ultraplan/expeditions.jsonl create mode 100644 docs/ultraplan/generated/tree.svg create mode 100644 docs/ultraplan/generated/ultraplan.adoc create mode 100644 docs/ultraplan/tree.jsonl diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 29f28899..7dad8d8c 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -72,6 +72,27 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ==== Added +* **The ultraplan: a tech tree of Mathesis, data first.** `docs/ultraplan/` + holds three JCS JSON Lines files: + ** `tree.jsonl`, 51 nodes whose needs are the edges; + ** `advisors.jsonl`, the ten advisors; + ** `expeditions.jsonl`, the return tickets. ++ + `scripts/ultraplan/ultraplan.mjs` generates `generated/ultraplan.adoc` and a + picture, `generated/tree.svg`. They show the eras, the frontier, the forks, + the confluences and each advisor's pick, all derived and none typed. ++ + The generator refuses: + ** a done node without evidence that holds: a file, a claim grade the + registry derives, or an accepted ADR; + ** a done node whose needs are not done; + ** a cycle; + ** more than three active nodes; + ** any note from the private me advisor. ++ + `just ultraplan` and `just ultraplan-check` run it, and `check-views` includes + the check. The site copies a view's pictures, so the tree's image works there. + * The 27 `hyperpolymath/resource-algebra` claims move their pin to `a17ffb6` (2026-11-17), whose receipt describes `47de4a8`, the merge of hyperpolymath/resource-algebra#36. F-5 now names `maps-disagree-at-positive`, diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index a9f458ce..06dbf802 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -10,6 +10,12 @@ Phase `incubating`, maturity `experimental` (the deed's `(status)` and truth". The stages are under <>; the rulings that steer them are under <>. +What comes next is drawn as a tech tree, the ultraplan +(link:../ultraplan/generated/ultraplan.adoc[`docs/ultraplan/generated/ultraplan.adoc`], +from the data in `docs/ultraplan/`). Its frontier is the list of work that can +start now, and ten advisors each name a pick from it. This roadmap keeps the +record of what happened; the tree says what each piece enables. + === Applied Systems (2026-11-07) * Added the owner-requested `applied-systems/` area for reusable applications, @@ -406,3 +412,15 @@ scheduled census, a view of what each repository owes the source of generated Agda; proofs in Agda, Rocq and Lean; three pull requests; the laws of the integer instance proved in the second pull request. +* Ultraplan (2026-11-24), through the selector: +** The plan is a data-first tech tree. Views are generated from the data, and + `just check` checks them. +** The advisors are the owner's six (mathematician, scientist, engineer, + economist, publisher, me) and four more (soundness auditor, estate + cartographer, teacher, contrarian). +** The me advisor is private. Its notes stay outside this repository, and a + node carries at most the tag `owner_value`. +** Off-tree trips are return tickets: each is grafted onto the tree or + archived with what it taught. +** The GELS maths panel waits on the estate coordinator's answer about panel + data. diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc new file mode 100644 index 00000000..f07ea129 --- /dev/null +++ b/docs/ultraplan/README.adoc @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) += The ultraplan: how to read and grow the tech tree +:toc: preamble + +The ultraplan is the plan of Mathesis drawn as a tech tree, like a civilisation +game. Each node is a capability: a theorem, a tool, a view, a paper or a decision. +A node's *needs* are the nodes it builds on. Read the other way, each node +*enables* the nodes that need it. The generated page, +link:generated/ultraplan.adoc[`generated/ultraplan.adoc`], and its picture, +`generated/tree.svg`, show the whole tree. They are rebuilt from the data here by +`just ultraplan`, and `just check` refuses them when they are stale. + +The plan is data first (owner ruling 2026-11-24). The three files in this +directory are its whole source. Each holds I-JSON, one record a line in JCS form, +so a diff shows only real change. + +[cols="1,3",options="header"] +|=== +|File |What it holds + +|`tree.jsonl` +|The nodes. Each names its needs, so the edges live in the data. + +|`advisors.jsonl` +|The council: who reads the tree, the one question each asks, and which value +mark each reads. + +|`expeditions.jsonl` +|Return tickets: trips off the tree, each grafted on as a node or archived with +what it taught. +|=== + +== What is typed and what is derived + +Typed by hand: + +* each node's name, track, kind, size, summary and needs; +* its status; +* its value marks; +* the counsel advisors give on it. + +Derived by `scripts/ultraplan/ultraplan.mjs`, and never typed: + +* *Era*: the length of the longest chain of needs below a node. +* *Frontier*: the open nodes whose needs are all done, which can be started today. +* *Unlocks*: how many live nodes depend on a node, directly or through others. +* *Forks*: nodes that enable two or more tracks, where work spreads. +* *Confluences*: nodes that need two or more tracks, where work joins. +* *Each advisor's pick*: one node from the frontier. + +A typed status is held to account: + +* *Done* needs evidence that the generator checks against the repository. It +accepts a file that exists, a claim whose grade the registry view derives at or +above a stated grade, or a decision record whose status is Accepted. A done +node's needs must be done too. +* *Active* is limited: at most three nodes may be active at once. To start a +fourth, finish or park one first. This is the guard against starting everything. +* *Blocked* must say what blocks it. + +The value marks (0 to 3 on maths, science, engineering, economics, publications, +teaching, soundness and ecosystem) are judgements, not measurements. They are +written down so they can be argued with. The page labels them as judgements. + +== The council + +Ten advisors read the tree: + +* the six the owner named (mathematician, scientist, engineer, economist, +publisher, and "me"); +* the four added on 2026-11-24 (soundness auditor, estate cartographer, teacher +and contrarian). + +Each asks one question of every node. Each names one pick from the frontier: + +* An advisor that reads a value mark ranks by it, then by how much the node +unlocks. +* The contrarian names the frontier node the council rates lowest that still +unlocks the most. That keeps the road not taken in view. +* The *me* advisor looks out for what could help the owner's own life. Its notes +are kept privately, outside this public repository. A node carries at most the +neutral tag `"owner_value":"high"`, and the generator refuses any counsel under +the key `me`. + +== Wandering: return tickets + +Going off the tree is allowed, and expected. Before a trip, add a card to +`expeditions.jsonl`: + +[source,json] +---- +{"date":"2026-11-24","id":"X-001","size":"S","status":"out","what":"Try a tropical semiring model of proof cost","why":"It might give the economist a real cost measure"} +---- + +On return, change the card: + +* *grafted*: the trip found something the tree should hold. Add the node, and set +`"graft":""`. +* *archived*: it did not belong. Set `"lesson"` to what it taught, so the trip +still counts. + +== Adding or changing a node + +. Add or edit the line in `tree.jsonl`, keeping its JCS form. Keys are sorted +and there are no spaces; `bun scripts/ijson-jcs-cli.js` or the generator's error +message gives the exact form. +. Give it needs, so it sits in the right era. A node with no needs starts a new +root. +. If it is another route to a node that already exists, name each in the other's +`rivals`. +. If the work lands in another repository, set `"where":"estate:OWNER/REPO"` or +`"upstream:OWNER/REPO"`. The page lists those nodes so they can be carried +there. +. Run `just ultraplan`, then `just check`. + +== GELS + +The owner asked for a maths panel in GELS, the estate display. The estate +coordinator was asked on 2026-11-24 how GELS panels take their data. Until it +answers, nothing here writes a feed for GELS. A feed with no agreed reader would +be unwired. The panel is a node in the tree (`gels-maths-panel`), blocked on that +answer. diff --git a/docs/ultraplan/advisors.jsonl b/docs/ultraplan/advisors.jsonl new file mode 100644 index 00000000..2f34eafd --- /dev/null +++ b/docs/ultraplan/advisors.jsonl @@ -0,0 +1,10 @@ +{"asks":"Is it true, is it new, and does it join two things that were apart?","glyph":"โˆ‘","id":"maths","name":"Mathematician","reads":"maths"} +{"asks":"What would we measure, and what result would change our mind?","glyph":"๐Ÿ”ฌ","id":"science","name":"Scientist","reads":"science"} +{"asks":"Does it run in the gate, fail loudly, and stay cheap to keep?","glyph":"โš™๏ธ","id":"engineering","name":"Engineer","reads":"engineering"} +{"asks":"What does it cost, what does it return, and who would fund or use it?","glyph":"๐Ÿช™","id":"economics","name":"Economist","reads":"economics"} +{"asks":"Is there a paper, a talk or a citable artefact here?","glyph":"๐Ÿ“œ","id":"publications","name":"Publisher","reads":"publications"} +{"asks":"Is every done backed by a receipt, and where is the hole?","glyph":"๐Ÿ”","id":"soundness","name":"Soundness auditor","reads":"soundness"} +{"asks":"Does another repository already have this, or need it? Converge rather than rebuild.","glyph":"๐Ÿ—บ๏ธ","id":"cartographer","name":"Estate cartographer","reads":"ecosystem"} +{"asks":"Could a newcomer learn something true and useful from it?","glyph":"๐ŸŽ","id":"teacher","name":"Teacher","reads":"teaching"} +{"asks":"What if we took the other road? Which cheap node is everyone overlooking?","glyph":"๐Ÿƒ","id":"contrarian","name":"Contrarian"} +{"asks":"Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository.","glyph":"๐Ÿซถ","id":"me","name":"Me","private":true} diff --git a/docs/ultraplan/expeditions.jsonl b/docs/ultraplan/expeditions.jsonl new file mode 100644 index 00000000..e69de29b diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg new file mode 100644 index 00000000..b30e1791 --- /dev/null +++ b/docs/ultraplan/generated/tree.svg @@ -0,0 +1,515 @@ + +The Mathesis tech tree +Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. 51 nodes in 8 eras; each arrow runs from a node to a node it enables. + +๐Ÿฆ‰ Mathesis tech tree +each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped + +๐Ÿชจ Tally sticks + +๐Ÿงฎ Abacus + +๐Ÿ“ Euclid + +๐ŸŒŒ Kepler + +โ™พ๏ธ Cantor + +๐Ÿงฉ Gรถdel + +๐ŸŒ€ Grothendieck + +๐Ÿš€ Frontier beyond + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +APP-1 to APP-4: missing stays missing: Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean. + +๐Ÿ’ง +APP-1 to APP-4: missiโ€ฆ +โˆ‘ maths ยท M +โœ… + + +Atlas views: The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`. + +๐Ÿ—บ๏ธ +Atlas views +โš™ engineering ยท M +โœ… + + +Bridges by construction: Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match. + +๐Ÿ— +Bridges by constructiโ€ฆ +โš™ engineering ยท L +๐ŸŒฑ + + +Bridge candidates: Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence. + +๐ŸŒ‰ +Bridge candidates +๐Ÿ—บ ecosystem ยท S +โœ… + + +Bridge lock pilot: The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. + +๐Ÿ”— +Bridge lock pilot +๐Ÿ—บ ecosystem ยท M +๐ŸŒฑ + + +Census of the estate: The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time. + +๐Ÿงพ +Census of the estate +โš™ engineering ยท L +โœ… + + +Census on a schedule: A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. + +โฐ +Census on a schedule +โš™ engineering ยท M +๐ŸŒฑ + + +Centre computations: Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801). + +๐ŸŽฏ +Centre computations +โˆ‘ maths ยท L +๐ŸŒฑ + + +Is a chain enough? (X-PF1): Decide whether proof status is a chain or needs a lattice: outcomes A, B or C, with a seven-value free distributive lattice as the candidate. Outcome C changes the standards canon. + +๐Ÿงฉ +Is a chain enough? (Xโ€ฆ +โˆ‘ maths ยท M +๐ŸŒฑ + + +CI records its own runs: A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open. + +๐Ÿค– +CI records its own ruโ€ฆ +โš™ engineering ยท M ยท ๐ŸŒ +๐ŸŒฑ + + +Claims registry: Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed. + +๐Ÿ“’ +Claims registry +โš™ engineering ยท L +โœ… + + +Cohort model in Agda: The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines. + +๐Ÿ‘ฅ +Cohort model in Agda +โˆ‘ maths ยท M +โœ… + + +Concept commons: The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance. + +๐Ÿ›๏ธ +Concept commons +โˆ‘ maths ยท XL +๐ŸŒฑ + + +Propose and dispose corpus: A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2). + +๐Ÿงช +Propose and dispose cโ€ฆ +๐Ÿ”ฌ science ยท XL +๐ŸŒฑ + + +Transport through Dedukti: Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first. + +๐Ÿš‚ +Transport through Dedโ€ฆ +โš™ engineering ยท L ยท ๐ŸŒ +โ›” + + +Mend the status documents: ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. + +๐Ÿงน +Mend the status documโ€ฆ +โš™ engineering ยท S +๐ŸŒฑ + + +Theorem dossier: The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. + +๐Ÿ—‚๏ธ +Theorem dossier +โˆ‘ maths ยท S +๐ŸŒฑ + + +Echo mirror records: Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. + +๐Ÿชž +Echo mirror records +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +๐ŸŒฑ + + +Closed list of encoding differences: A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). + +๐Ÿ”ค +Closed list of encodiโ€ฆ +๐Ÿ”ฌ science ยท M +๐ŸŒฑ + + +PWG-2ii across the estate: The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. + +๐Ÿ”๏ธ +PWG-2ii across the esโ€ฆ +๐Ÿ—บ ecosystem ยท XL +๐ŸŒฑ + + +File the transport reproducers: File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. + +๐Ÿ› +File the transport reโ€ฆ +๐Ÿ—บ ecosystem ยท S ยท ๐ŸŒ +๐ŸŒฑ + + +Thirteen-week forecast: A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. + +๐Ÿ“… +Thirteen-week forecast +๐Ÿช™ economics ยท M +๐ŸŒฑ + + +Maths panel in GELS: A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions. + +๐ŸชŸ +Maths panel in GELS +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +โ›” + + +Generated Idris2 token laws: Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. + +๐Ÿงฌ +Generated Idris2 tokeโ€ฆ +โš™ engineering ยท M ยท ๐ŸŒ +๐ŸŒฑ + + +Theorem to code: januskey: Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1). + +๐Ÿ—๏ธ +Theorem to code: januโ€ฆ +โš™ engineering ยท L ยท ๐ŸŒ +๐ŸŒฑ + + +Liquidity shelf: The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. + +๐Ÿ’ถ +Liquidity shelf +๐Ÿช™ economics ยท M +๐ŸŒฑ + + +Paper: receipts, not claims: A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. + +๐Ÿ“ฐ +Paper: receipts, not โ€ฆ +๐Ÿ“œ publications ยท L +๐ŸŒฑ + + +Paper: an algebra of proof status: S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt. + +๐Ÿ“˜ +Paper: an algebra of โ€ฆ +๐Ÿ“œ publications ยท L +๐ŸŒฑ + + +Note: feature reachability: A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. + +๐Ÿ“„ +Note: feature reachabโ€ฆ +๐Ÿ“œ publications ยท M +๐ŸŒฑ + + +Proof lanes in a pinned image: Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. + +๐Ÿ“ฆ +Proof lanes in a pinnโ€ฆ +โš™ engineering ยท M +๐ŸŒฑ + + +Proof gate in pinned Guix: Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail. + +๐Ÿ›ก๏ธ +Proof gate in pinned โ€ฆ +โš™ engineering ยท L +โœ… + + +Publish the atlas: Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. + +๐ŸŒ +Publish the atlas +๐Ÿ“œ publications ยท S +๐ŸŒฑ + + +Back to PWG-1: THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. + +๐Ÿฅ‡ +Back to PWG-1 +โš™ engineering ยท S +๐ŸŒฑ + + +Shared receipt generator: Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. + +๐Ÿญ +Shared receipt generaโ€ฆ +โš™ engineering ยท M +๐Ÿ”จ + + +Proof receipts: The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader. + +๐Ÿ” +Proof receipts +โš™ engineering ยท M +โœ… + + +Receipts campaign: Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. + +๐Ÿ“ฃ +Receipts campaign +๐Ÿ—บ ecosystem ยท L ยท ๐ŸŒ +๐ŸŒฑ + + +S-1 by reuse of resource-algebra: Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. + +โ™ป๏ธ +S-1 by reuse of resouโ€ฆ +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +๐ŸŒฑ + + +S-1: tokens form a dioid: The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). + +๐Ÿ”ข +S-1: tokens form a diโ€ฆ +โˆ‘ maths ยท L +๐ŸŒฑ + + +S-2: evaluation is monotone: Positive evaluation of status is monotone; proved once, with its home in Mathesis (R-3). + +๐Ÿ“ˆ +S-2: evaluation is moโ€ฆ +โˆ‘ maths ยท S +๐ŸŒฑ + + +S-3: the grade is a function: The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3). + +๐ŸŽš๏ธ +S-3: the grade is a fโ€ฆ +โˆ‘ maths ยท M +๐ŸŒฑ + + +S-4 and S-5: honest cash verdicts: A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). + +๐ŸŒฆ๏ธ +S-4 and S-5: honest cโ€ฆ +โˆ‘ maths ยท M +๐ŸŒฑ + + +Atlas site (build): Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy. + +๐Ÿ—๏ธ +Atlas site (build) +โš™ engineering ยท S +โœ… + + +From oracle to theorem: S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). + +๐ŸŽฒ +From oracle to theorem +๐Ÿ”ฌ science ยท L +๐ŸŒฑ + + +Talk: an atlas of an estate: A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. + +๐ŸŽค +Talk: an atlas of an โ€ฆ +๐Ÿ“œ publications ยท S +๐ŸŒฑ + + +Cohort economics, taught: A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. + +๐Ÿ““ +Cohort economics, tauโ€ฆ +๐Ÿ“œ publications ยท M +๐ŸŒฑ + + +Theory shelf and ledger: The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far. + +๐Ÿ“š +Theory shelf and ledgโ€ฆ +โˆ‘ maths ยท S +โœ… + + +THY-1: reachability is monotone: In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean. + +๐Ÿงญ +THY-1: reachability iโ€ฆ +โˆ‘ maths ยท M +โœ… + + +Settle the order of status tokens: The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. + +โš–๏ธ +Settle the order of sโ€ฆ +โˆ‘ maths ยท S +๐ŸŒฑ + + +The ultraplan: This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. + +๐ŸŒณ +The ultraplan +โš™ engineering ยท S +โœ… + + +Value of information: Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README). + +๐Ÿ”ญ +Value of information +๐Ÿช™ economics ยท L +๐ŸŒฑ + + +What is owed: A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has. + +๐Ÿ“‹ +What is owed +๐Ÿ—บ ecosystem ยท M +๐ŸŒฑ + + +โˆ‘ maths + +โš™ engineering + +๐Ÿ”ฌ science + +๐Ÿช™ economics + +๐Ÿ“œ publications + +๐Ÿ—บ ecosystem +๐ŸŒ lands in another repository + diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc new file mode 100644 index 00000000..c86f114d --- /dev/null +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -0,0 +1,826 @@ +// SPDX-License-Identifier: CC-BY-SA-4.0 +// GENERATED by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl, +// docs/ultraplan/advisors.jsonl and docs/ultraplan/expeditions.jsonl; do not hand-edit. += Mathesis ultraplan: the tech tree +:toc: macro +:toclevels: 1 + +Each node is a capability. Its needs are the nodes it is built on, so the tree reads +like a civilisation game: one discovery enables the next. The data in +`docs/ultraplan/` is the source; this page and its picture are generated from it. +The era, the frontier, the forks, the confluences and each advisor's pick are derived, +never typed. A node marked done carries evidence the generator checks: a file, a +claim grade that the registry derives, or an accepted decision record. The value marks +are judgements, written down so they can be argued with. + +Census of the tree: 12 done, 1 active (at most 3), 36 open, 2 blocked, 0 dropped, of 51 nodes. 13 can be started now. + +toc::[] + +image::tree.svg[The tech tree of Mathesis, from the first era on the left to the frontier on the right] + +Key: โœ… done ยท ๐Ÿ”จ active ยท ๐ŸŒฑ open ยท โ›” blocked ยท ๐Ÿ‚ dropped. A gold border marks a node +that can be started now. Colours are tracks: โˆ‘ maths ยท โš™ engineering ยท ๐Ÿ”ฌ science ยท ๐Ÿช™ economics ยท ๐Ÿ“œ publications ยท ๐Ÿ—บ ecosystem. + +== Research now: the frontier + +These open nodes have every need done, so any of them can start today. "Unlocks" +counts the live nodes that depend on it, directly or through others. + +[cols="3,1,1,1,5",options="header"] +|=== +|Node |Track |Size |Unlocks |Summary +|<> |maths |S |13 |The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. +|<> |ecosystem |M |8 |The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. +|<> |engineering |M |2 |A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. +|<> |economics |M |2 |A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. +|<> |maths |M |2 |A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). +|<> |maths |S |1 |The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. +|<> |ecosystem |S |1 |File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. _(upstream:Deducteam/agda2dedukti)_ +|<> |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. +|<> |publications |S |1 |Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. +|<> |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. +|<> |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. +|<> |science |L |0 |S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). +|<> |publications |M |0 |A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. +|=== + +== The council + +Each advisor asks one question of every node and names one pick from the frontier. +The me advisor is private: its notes stay outside this repository, and it names only +nodes the owner has tagged. + +=== โˆ‘ Mathematician + +_Asks:_ Is it true, is it new, and does it join two things that were apart? + +_Pick:_ <>. A theorem about an order is only as good as the order; settle it first. + +=== ๐Ÿ”ฌ Scientist + +_Asks:_ What would we measure, and what result would change our mind? + +_Pick:_ <>. Takes a statistical result that is only tested and makes it a theorem. + +=== โš™๏ธ Engineer + +_Asks:_ Does it run in the gate, fail loudly, and stay cheap to keep? + +_Pick:_ <>. + +=== ๐Ÿช™ Economist + +_Asks:_ What does it cost, what does it return, and who would fund or use it? + +_Pick:_ <>. A forecast that can say undecided is worth more than one that guesses. + +=== ๐Ÿ“œ Publisher + +_Asks:_ Is there a paper, a talk or a citable artefact here? + +_Pick:_ <>. Everything else here is invisible until this happens. + +=== ๐Ÿ” Soundness auditor + +_Asks:_ Is every done backed by a receipt, and where is the hole? + +_Pick:_ <>. + +=== ๐Ÿ—บ๏ธ Estate cartographer + +_Asks:_ Does another repository already have this, or need it? Converge rather than rebuild. + +_Pick:_ <>. The first real convergence between repositories; everything cross-repo waits on it. + +=== ๐ŸŽ Teacher + +_Asks:_ Could a newcomer learn something true and useful from it? + +_Pick:_ <>. Shows why a proof matters to someone who reads spreadsheets, not theorems. + +=== ๐Ÿƒ Contrarian + +_Asks:_ What if we took the other road? Which cheap node is everyone overlooking? + +_Pick:_ <>. + +=== ๐Ÿซถ Me + +_Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. + +_Pick:_ nothing on the frontier answers this advisor yet. + +== Forks and confluences + +A fork enables nodes on two or more tracks: work there spreads. A confluence needs +nodes from two or more tracks: work there joins. Rivals are different routes to the +same place; the contrarian keeps the road not taken in view. + +.Forks +* <> -> <>, <>, <> +* <> -> <>, <>, <>, <> +* <> -> <>, <> +* <> -> <>, <>, <>, <> +* <> -> <>, <>, <>, <>, <>, <>, <>, <> +* <> -> <>, <>, <>, <> +* <> -> <>, <>, <>, <> +* <> -> <>, <>, <> +* <> -> <>, <>, <> +* <> -> <>, <>, <> +* <> -> <>, <>, <> +* <> -> <>, <>, <>, <> + +.Confluences +* <> + <> -> <> +* <> + <> -> <> +* <> + <> -> <> +* <> + <> + <> -> <> +* <> + <> -> <> +* <> + <> + <> -> <> +* <> + <> -> <> +* <> + <> + <> -> <> +* <> + <> -> <> +* <> + <> -> <> +* <> + <> -> <> +* <> + <> -> <> + +.Rivals +* <> or <> +* <> or <> + +== The eras + +=== ๐Ÿชจ Era 0: Tally sticks + +[[census]] +==== โœ… ๐Ÿงพ Census of the estate + +The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time. + +*Track:* โš™ engineering ยท *Kind:* data ยท *Size:* L ยท *Status:* done + +*Enables:* <>, <>, <> + +*Evidence:* `docs/atlas/census/rows.jsonl`; `scripts/census/run-census.sh` + +*Value (judgement):* engineering โ—โ—, science โ—โ—, ecosystem โ—โ—โ— + +[[proof-gate]] +==== โœ… ๐Ÿ›ก๏ธ Proof gate in pinned Guix + +Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail. + +*Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* L ยท *Status:* done + +*Enables:* <>, <>, <>, <> + +*Evidence:* `scripts/check-proofs.sh`; `tests/proofs/gate_controls_test.sh` + +*Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ— + +=== ๐Ÿงฎ Era 1: Abacus + +[[cohort-model]] +==== โœ… ๐Ÿ‘ฅ Cohort model in Agda + +The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines. + +*Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* M ยท *Status:* done + +*Needs:* <> + +*Enables:* <> + +*Evidence:* `verification/proofs/agda/Applied/Cohort.agda`; `applied-systems/methods/input-schema.adoc` + +*Value (judgement):* maths โ—โ—, economics โ—โ—, teaching โ—โ— + +[[thy1]] +==== โœ… ๐Ÿงญ THY-1: reachability is monotone + +In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean. + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done + +*Needs:* <> + +*Enables:* <>, <>, <>, <> + +*Evidence:* hyperpolymath/mathesis#THY-1 at PWG-2ii or above + +*Value (judgement):* maths โ—โ—, engineering โ—โ—, publications โ—โ— + +[[atlas-views]] +==== โœ… ๐Ÿ—บ๏ธ Atlas views + +The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`. + +*Track:* โš™ engineering ยท *Kind:* view ยท *Size:* M ยท *Status:* done + +*Needs:* <> + +*Enables:* <>, <> + +*Evidence:* `docs/atlas/generated/catalogue.adoc`; `docs/atlas/generated/az.adoc` + +*Value (judgement):* engineering โ—โ—, teaching โ—โ—, ecosystem โ—โ— + +[[census-workflow]] +==== ๐ŸŒฑ โฐ Census on a schedule + +A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. + +*Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* engineering โ—โ—, ecosystem โ—โ— + +*See:* docs/proposals/mathesis-re-anchoring.adoc:1075 + +[[claims-registry]] +==== โœ… ๐Ÿ“’ Claims registry + +Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed. + +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done + +*Needs:* <> + +*Enables:* <>, <>, <>, <>, <>, <>, <>, <> + +*Evidence:* ADR 0004 accepted; `docs/atlas/generated/registry.adoc` + +*Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— + +[[pinned-image]] +==== ๐ŸŒฑ ๐Ÿ“ฆ Proof lanes in a pinned image + +Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. + +*Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* engineering โ—โ—, soundness โ—โ—โ— + +*See:* docs/status/PROOF-STATUS.adoc:33 + +* ๐Ÿ” _Soundness auditor:_ The only road back to PWG-1 for THY-1 and APP-1 to APP-4. + +=== ๐Ÿ“ Era 2: Euclid + +[[app-proofs]] +==== โœ… ๐Ÿ’ง APP-1 to APP-4: missing stays missing + +Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean. + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done + +*Needs:* <> + +*Enables:* <>, <>, <> + +*Evidence:* hyperpolymath/mathesis#APP-1 at PWG-2ii or above; hyperpolymath/mathesis#APP-2 at PWG-2ii or above; hyperpolymath/mathesis#APP-3 at PWG-2ii or above; hyperpolymath/mathesis#APP-4 at PWG-2ii or above + +*Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— + +[[theory-shelf]] +==== โœ… ๐Ÿ“š Theory shelf and ledger + +The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far. + +*Track:* โˆ‘ maths ยท *Kind:* data ยท *Size:* S ยท *Status:* done + +*Needs:* <>, <> + +*Enables:* <>, <>, <> + +*Evidence:* `docs/theory/admissions.jsonl`; `docs/theory/ledger.jsonl` + +*Value (judgement):* maths โ—โ—, soundness โ—โ— + +[[token-order]] +==== ๐ŸŒฑ โš–๏ธ Settle the order of status tokens + +The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. + +*Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Enables:* <>, <> + +*Value (judgement):* maths โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:337; docs/atlas/generated/registry.adoc:39 + +* ๐Ÿ—บ๏ธ _Estate cartographer:_ The ruling lands in standards PROOF-POLICY, not here; carry it there. +* โˆ‘ _Mathematician:_ A theorem about an order is only as good as the order; settle it first. + +[[doc-drift-fix]] +==== ๐ŸŒฑ ๐Ÿงน Mend the status documents + +ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. + +*Track:* โš™ engineering ยท *Kind:* decision ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Value (judgement):* teaching โ—, soundness โ—โ—โ— + +*See:* docs/status/ROADMAP.adoc:30; docs/status/PROOF-NEEDS.adoc:27; README.adoc:46; .machine_readable/contractiles/intend + +* ๐Ÿƒ _Contrarian:_ Cheapest node on the board, and the auditor's favourite. +* ๐Ÿ” _Soundness auditor:_ Every one of these is a claim with no receipt behind it; mend before adding. + +[[receipts]] +==== โœ… ๐Ÿ” Proof receipts + +The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader. + +*Track:* โš™ engineering ยท *Kind:* data ยท *Size:* M ยท *Status:* done + +*Needs:* <>, <> + +*Enables:* <>, <>, <> + +*Evidence:* `verification/receipts/theory_praxis.deed` + +*Value (judgement):* engineering โ—โ—, soundness โ—โ—โ— + +[[site-build]] +==== โœ… ๐Ÿ—๏ธ Atlas site (build) + +Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy. + +*Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done + +*Needs:* <> + +*Enables:* <> + +*Evidence:* `scripts/site/site.mjs` + +*Value (judgement):* engineering โ—, teaching โ—โ— + +[[ultraplan]] +==== โœ… ๐ŸŒณ The ultraplan + +This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. + +*Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done + +*Needs:* <> + +*Enables:* <> + +*Evidence:* `docs/ultraplan/tree.jsonl`; `scripts/ultraplan/ultraplan.mjs` + +*Value (judgement):* engineering โ—, teaching โ— + +[[bridge-candidates]] +==== โœ… ๐ŸŒ‰ Bridge candidates + +Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* S ยท *Status:* done + +*Needs:* <> + +*Enables:* <> + +*Evidence:* `docs/atlas/claims/bridges.jsonl` + +*Value (judgement):* maths โ—โ—, ecosystem โ—โ—โ— + +[[file-transport-bugs]] +==== ๐ŸŒฑ ๐Ÿ› File the transport reproducers + +File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* decision ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* upstream:Deducteam/agda2dedukti + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* engineering โ—, ecosystem โ—โ— + +*See:* docs/status/ROADMAP.adoc:92; docs/proposals/mathesis-research-programme.adoc:693 + +* ๐Ÿช™ _Economist:_ A few hours of filing could unblock a whole route for everyone. + +[[whats-owed]] +==== ๐ŸŒฑ ๐Ÿ“‹ What is owed + +A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* open + +*Needs:* <>, <> + +*Enables:* <> + +*Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ—โ—โ— + +*See:* docs/proposals/mathesis-re-anchoring.adoc:1079 + +=== ๐ŸŒŒ Era 3: Kepler + +[[chain-question]] +==== ๐ŸŒฑ ๐Ÿงฉ Is a chain enough? (X-PF1) + +Decide whether proof status is a chain or needs a lattice: outcomes A, B or C, with a seven-value free distributive lattice as the candidate. Outcome C changes the standards canon. + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Enables:* <>, <>, <>, <> + +*Value (judgement):* maths โ—โ—โ—, science โ—โ—, soundness โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:390 + +* โˆ‘ _Mathematician:_ The deepest open question on the board; it decides what S-1 even says. +* ๐Ÿ”ฌ _Scientist:_ Pre-register what result means A, B or C before computing. + +[[dossier]] +==== ๐ŸŒฑ ๐Ÿ—‚๏ธ Theorem dossier + +The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. + +*Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* maths โ—, teaching โ—โ—, soundness โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:291; docs/proposals/mathesis-research-programme.adoc:1017 + +[[s4-s5-verdict]] +==== ๐ŸŒฑ ๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts + +A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:792; docs/proposals/mathesis-research-programme.adoc:824 + +* ๐Ÿช™ _Economist:_ A forecast that can say undecided is worth more than one that guesses. +* ๐ŸŽ _Teacher:_ Three-valued logic with money attached: an easy story to teach. + +[[dedukti-transport]] +==== โ›” ๐Ÿš‚ Transport through Dedukti + +Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first. + +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* blocked ยท *Beyond this repository:* upstream:Deducteam/lambdapi + +*Needs:* <>, <> + +*Rivals:* <> + +*Blocked by:* Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip. + +*Value (judgement):* maths โ—, engineering โ—โ—, soundness โ—โ— + +*See:* docs/status/ROADMAP.adoc:92 + +* ๐Ÿƒ _Contrarian:_ Policy puts this route first, yet every re-proof so far went the other way. + +[[receipt-generator]] +==== ๐Ÿ”จ ๐Ÿญ Shared receipt generator + +Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. + +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* active + +*Needs:* <> + +*Enables:* <>, <>, <>, <> + +*Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ— + +* โš™๏ธ _Engineer:_ One generator for the estate instead of one per repository. + +[[statistical-bridge]] +==== ๐ŸŒฑ ๐ŸŽฒ From oracle to theorem + +S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). + +*Track:* ๐Ÿ”ฌ science ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open + +*Needs:* <> + +*Value (judgement):* maths โ—โ—, science โ—โ—โ—, publications โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:641 + +* ๐Ÿ”ฌ _Scientist:_ Takes a statistical result that is only tested and makes it a theorem. + +[[forecast-13wk]] +==== ๐ŸŒฑ ๐Ÿ“… Thirteen-week forecast + +A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. + +*Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* engineering โ—, economics โ—โ—โ—, teaching โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:824; applied-systems/finance/liquidity/README.adoc + +* ๐Ÿช™ _Economist:_ The first output a business reader would recognise. + +[[paper-thy1]] +==== ๐ŸŒฑ ๐Ÿ“„ Note: feature reachability + +A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. + +*Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open + +*Needs:* <>, <> + +*Value (judgement):* maths โ—, publications โ—โ—โ—, teaching โ— + +* ๐Ÿ“œ _Publisher:_ A complete, small, checked result: the easiest first paper. + +[[publish-atlas]] +==== ๐ŸŒฑ ๐ŸŒ Publish the atlas + +Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. + +*Track:* ๐Ÿ“œ publications ยท *Kind:* view ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* publications โ—โ—โ—, teaching โ—โ—, ecosystem โ—โ— + +*See:* docs/status/ROADMAP.adoc:262; docs/proposals/mathesis-re-anchoring.adoc:1058 + +* ๐Ÿ“œ _Publisher:_ Everything else here is invisible until this happens. +* ๐Ÿ” _Soundness auditor:_ Publish only views whose checks are green, or the site states what the receipts do not. + +[[teaching-cohort]] +==== ๐ŸŒฑ ๐Ÿ““ Cohort economics, taught + +A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. + +*Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Value (judgement):* economics โ—, publications โ—โ—, teaching โ—โ—โ— + +* ๐ŸŽ _Teacher:_ Shows why a proof matters to someone who reads spreadsheets, not theorems. + +[[bridge-lock-pilot]] +==== ๐ŸŒฑ ๐Ÿ”— Bridge lock pilot + +The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Enables:* <>, <>, <>, <> + +*Value (judgement):* maths โ—โ—, science โ—, ecosystem โ—โ—โ— + +*See:* docs/proposals/mathesis-re-anchoring.adoc:803; docs/proposals/mathesis-re-anchoring.adoc:1071 + +* ๐Ÿ—บ๏ธ _Estate cartographer:_ The first real convergence between repositories; everything cross-repo waits on it. +* โˆ‘ _Mathematician:_ Equivalence as identity, made checkable. + +[[gels-maths-panel]] +==== โ›” ๐ŸชŸ Maths panel in GELS + +A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked ยท *Beyond this repository:* estate:metadatastician/gels + +*Needs:* <>, <> + +*Blocked by:* the estate coordinator's answer on how GELS panels take their data (asked 2026-11-24); no feed is written until a reader is agreed + +*Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— + +=== โ™พ๏ธ Era 4: Cantor + +[[centre-computations]] +==== ๐ŸŒฑ ๐ŸŽฏ Centre computations + +Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801). + +*Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* L ยท *Status:* open + +*Needs:* <>, <> + +*Enables:* <>, <> + +*Value (judgement):* maths โ—โ—โ—, science โ—โ— + +*See:* docs/proposals/mathesis-re-anchoring.adoc:786 + +[[s1-token-algebra]] +==== ๐ŸŒฑ ๐Ÿ”ข S-1: tokens form a dioid + +The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open + +*Needs:* <>, <> + +*Enables:* <>, <>, <> + +*Rivals:* <> + +*Value (judgement):* maths โ—โ—โ—, publications โ—โ—, soundness โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:346; docs/proposals/mathesis-research-programme.adoc:544 + +* ๐Ÿƒ _Contrarian:_ resource-algebra already pins E-1 to E-3; proving it again here may be duplication. +* โˆ‘ _Mathematician:_ A real algebra of evidence; the centre of the research programme. + +[[s2-monotone]] +==== ๐ŸŒฑ ๐Ÿ“ˆ S-2: evaluation is monotone + +Positive evaluation of status is monotone; proved once, with its home in Mathesis (R-3). + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* maths โ—โ—, soundness โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:368 + +[[s3-grade-function]] +==== ๐ŸŒฑ ๐ŸŽš๏ธ S-3: the grade is a function + +The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3). + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open + +*Needs:* <>, <> + +*Enables:* <>, <>, <> + +*Value (judgement):* maths โ—โ—, engineering โ—โ—, soundness โ—โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:378; docs/proposals/mathesis-research-programme.adoc:550 + +* ๐Ÿ” _Soundness auditor:_ Turns the reader from trusted code into a checked one. + +[[ci-recorder]] +==== ๐ŸŒฑ ๐Ÿค– CI records its own runs + +A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open. + +*Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—, ecosystem โ—โ— + +[[januskey-slice]] +==== ๐ŸŒฑ ๐Ÿ—๏ธ Theorem to code: januskey + +Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1). + +*Track:* โš™ engineering ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/januskey + +*Needs:* <> + +*Value (judgement):* maths โ—, engineering โ—โ—โ—, soundness โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:743; docs/proposals/mathesis-research-programme.adoc:755 + +[[pwg1-regained]] +==== ๐ŸŒฑ ๐Ÿฅ‡ Back to PWG-1 + +THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. + +*Track:* โš™ engineering ยท *Kind:* data ยท *Size:* S ยท *Status:* open + +*Needs:* <>, <> + +*Value (judgement):* publications โ—, soundness โ—โ— + +[[encoding-differences]] +==== ๐ŸŒฑ ๐Ÿ”ค Closed list of encoding differences + +A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). + +*Track:* ๐Ÿ”ฌ science ยท *Kind:* data ยท *Size:* M ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* maths โ—, science โ—โ—โ—, publications โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:609; docs/proposals/mathesis-research-programme.adoc:679 + +* ๐Ÿ“œ _Publisher:_ Nobody has this list; it is citable on its own. +* ๐Ÿ”ฌ _Scientist:_ Each entry should come with a counterexample that shows it. + +[[liquidity-shelf]] +==== ๐ŸŒฑ ๐Ÿ’ถ Liquidity shelf + +The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. + +*Track:* ๐Ÿช™ economics ยท *Kind:* view ยท *Size:* M ยท *Status:* open + +*Needs:* <>, <> + +*Enables:* <> + +*Value (judgement):* economics โ—โ—โ—, publications โ—, teaching โ—โ— + +[[talk-atlas]] +==== ๐ŸŒฑ ๐ŸŽค Talk: an atlas of an estate + +A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. + +*Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Value (judgement):* publications โ—โ—, teaching โ—โ—, ecosystem โ— + +[[echo-mirrors]] +==== ๐ŸŒฑ ๐Ÿชž Echo mirror records + +Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/echo-types + +*Needs:* <> + +*Value (judgement):* maths โ—โ—, ecosystem โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:695 + +[[receipts-campaign]] +==== ๐ŸŒฑ ๐Ÿ“ฃ Receipts campaign + +Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/secret-types + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* soundness โ—โ—, ecosystem โ—โ—โ— + +*See:* docs/status/ROADMAP.adoc:330; docs/proposals/mathesis-re-anchoring.adoc:1065 + +* ๐Ÿ—บ๏ธ _Estate cartographer:_ The registry is only as current as the home receipts. + +[[s1-reuse]] +==== ๐ŸŒฑ โ™ป๏ธ S-1 by reuse of resource-algebra + +Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/resource-algebra + +*Needs:* <>, <> + +*Rivals:* <> + +*Value (judgement):* maths โ—โ—, engineering โ—, ecosystem โ—โ—โ— + +* ๐Ÿ—บ๏ธ _Estate cartographer:_ Converge: the laws exist, at a grade, in their home repository. + +=== ๐Ÿงฉ Era 5: Gรถdel + +[[concept-commons]] +==== ๐ŸŒฑ ๐Ÿ›๏ธ Concept commons + +The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance. + +*Track:* โˆ‘ maths ยท *Kind:* view ยท *Size:* XL ยท *Status:* open + +*Needs:* <>, <> + +*Value (judgement):* maths โ—โ—, teaching โ—โ—โ—, ecosystem โ—โ— + +*See:* docs/proposals/mathesis-re-anchoring.adoc:441; docs/proposals/estate-mathematical-architecture.adoc:158 + +[[bridge-by-construction]] +==== ๐ŸŒฑ ๐Ÿ— Bridges by construction + +Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match. + +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* open + +*Needs:* <>, <> + +*Enables:* <> + +*Rivals:* <> + +*Value (judgement):* maths โ—โ—, engineering โ—โ—โ—, publications โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:620; docs/proposals/mathesis-research-programme.adoc:690 + +* โš™๏ธ _Engineer:_ Removes the hand-copying of statements that every re-proof does today. + +[[idris-token-laws]] +==== ๐ŸŒฑ ๐Ÿงฌ Generated Idris2 token laws + +Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. + +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards + +*Needs:* <> + +*Value (judgement):* maths โ—, engineering โ—โ—, ecosystem โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:760 + +[[value-of-information]] +==== ๐ŸŒฑ ๐Ÿ”ญ Value of information + +Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README). + +*Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* L ยท *Status:* open + +*Needs:* <> + +*Value (judgement):* maths โ—โ—, science โ—โ—, economics โ—โ—โ— + +*See:* applied-systems/decision-science/README.adoc + +[[paper-receipts]] +==== ๐ŸŒฑ ๐Ÿ“ฐ Paper: receipts, not claims + +A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. + +*Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open + +*Needs:* <>, <>, <> + +*Value (judgement):* engineering โ—, publications โ—โ—โ—, soundness โ—โ— + +[[paper-status-algebra]] +==== ๐ŸŒฑ ๐Ÿ“˜ Paper: an algebra of proof status + +S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt. + +*Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open + +*Needs:* <>, <>, <> + +*Value (judgement):* maths โ—โ—โ—, publications โ—โ—โ— + +=== ๐ŸŒ€ Era 6: Grothendieck + +[[corpus]] +==== ๐ŸŒฑ ๐Ÿงช Propose and dispose corpus + +A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2). + +*Track:* ๐Ÿ”ฌ science ยท *Kind:* method ยท *Size:* XL ยท *Status:* open + +*Needs:* <>, <>, <> + +*Enables:* <> + +*Value (judgement):* maths โ—โ—, engineering โ—โ—, science โ—โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:891 + +=== ๐Ÿš€ Era 7: Frontier beyond + +[[estate-pwg2ii]] +==== ๐ŸŒฑ ๐Ÿ”๏ธ PWG-2ii across the estate + +The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. + +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* XL ยท *Status:* open + +*Needs:* <>, <>, <> + +*Value (judgement):* maths โ—โ—, science โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:883; docs/proposals/mathesis-research-programme.adoc:903 + +== Return tickets + +Wandering off the tree is allowed. Each trip gets a card: what, why, and how big. +On return it is grafted onto the tree as a node, or archived with what it taught. + +No trip is out. + +== Beyond this repository + +Nodes whose work lands in another repository. They are listed here so they can be +carried to that repository, not done here. + +* estate:hyperpolymath/echo-types: <> (open) +* estate:hyperpolymath/januskey: <> (open) +* estate:hyperpolymath/resource-algebra: <> (open) +* estate:hyperpolymath/secret-types: <> (open) +* estate:metadatastician/gels: <> (blocked) +* estate:metadatastician/standards: <> (open) +* estate:metadatastician/standards: <> (open) +* upstream:Deducteam/agda2dedukti: <> (open) +* upstream:Deducteam/lambdapi: <> (blocked) diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl new file mode 100644 index 00000000..3edae68f --- /dev/null +++ b/docs/ultraplan/tree.jsonl @@ -0,0 +1,51 @@ +{"evidence":[{"claim":"hyperpolymath/mathesis#APP-1","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-2","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-3","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-4","min_pwg":"PWG-2ii"}],"glyph":"๐Ÿ’ง","id":"app-proofs","kind":"theorem","name":"APP-1 to APP-4: missing stays missing","needs":["cohort-model"],"size":"M","status":"done","summary":"Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean.","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} +{"evidence":[{"path":"docs/atlas/generated/catalogue.adoc"},{"path":"docs/atlas/generated/az.adoc"}],"glyph":"๐Ÿ—บ๏ธ","id":"atlas-views","kind":"view","name":"Atlas views","needs":["census"],"size":"M","status":"done","summary":"The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`.","track":"engineering","value":{"ecosystem":2,"engineering":2,"teaching":2}} +{"counsel":{"engineering":"Removes the hand-copying of statements that every re-proof does today."},"glyph":"๐Ÿ—","id":"bridge-by-construction","kind":"tool","name":"Bridges by construction","needs":["encoding-differences","s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:620","docs/proposals/mathesis-research-programme.adoc:690"],"rivals":["dedukti-transport"],"size":"L","status":"open","summary":"Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match.","track":"engineering","value":{"engineering":3,"maths":2,"publications":1}} +{"evidence":[{"path":"docs/atlas/claims/bridges.jsonl"}],"glyph":"๐ŸŒ‰","id":"bridge-candidates","kind":"data","name":"Bridge candidates","needs":["claims-registry"],"size":"S","status":"done","summary":"Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence.","track":"ecosystem","value":{"ecosystem":3,"maths":2}} +{"counsel":{"cartographer":"The first real convergence between repositories; everything cross-repo waits on it.","maths":"Equivalence as identity, made checkable."},"glyph":"๐Ÿ”—","id":"bridge-lock-pilot","kind":"method","name":"Bridge lock pilot","needs":["bridge-candidates"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:803","docs/proposals/mathesis-re-anchoring.adoc:1071"],"size":"M","status":"open","summary":"The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1}} +{"evidence":[{"path":"docs/atlas/census/rows.jsonl"},{"path":"scripts/census/run-census.sh"}],"glyph":"๐Ÿงพ","id":"census","kind":"data","name":"Census of the estate","size":"L","status":"done","summary":"The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time.","track":"engineering","value":{"ecosystem":3,"engineering":2,"science":2}} +{"glyph":"โฐ","id":"census-workflow","kind":"infrastructure","name":"Census on a schedule","needs":["census"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1075"],"size":"M","status":"open","summary":"A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded.","track":"engineering","value":{"ecosystem":2,"engineering":2}} +{"glyph":"๐ŸŽฏ","id":"centre-computations","kind":"method","name":"Centre computations","needs":["bridge-lock-pilot","token-order"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:786"],"size":"L","status":"open","summary":"Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801).","track":"maths","value":{"maths":3,"science":2}} +{"counsel":{"maths":"The deepest open question on the board; it decides what S-1 even says.","science":"Pre-register what result means A, B or C before computing."},"glyph":"๐Ÿงฉ","id":"chain-question","kind":"theorem","name":"Is a chain enough? (X-PF1)","needs":["token-order"],"refs":["docs/proposals/mathesis-research-programme.adoc:390"],"size":"M","status":"open","summary":"Decide whether proof status is a chain or needs a lattice: outcomes A, B or C, with a seven-value free distributive lattice as the candidate. Outcome C changes the standards canon.","track":"maths","value":{"maths":3,"science":2,"soundness":2}} +{"glyph":"๐Ÿค–","id":"ci-recorder","kind":"infrastructure","name":"CI records its own runs","needs":["receipt-generator"],"size":"M","status":"open","summary":"A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open.","track":"engineering","value":{"ecosystem":2,"engineering":3,"soundness":2},"where":"estate:metadatastician/standards"} +{"evidence":[{"adr":"0004"},{"path":"docs/atlas/generated/registry.adoc"}],"glyph":"๐Ÿ“’","id":"claims-registry","kind":"tool","name":"Claims registry","needs":["census"],"size":"L","status":"done","summary":"Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed.","track":"engineering","value":{"ecosystem":3,"engineering":3,"soundness":3}} +{"evidence":[{"path":"verification/proofs/agda/Applied/Cohort.agda"},{"path":"applied-systems/methods/input-schema.adoc"}],"glyph":"๐Ÿ‘ฅ","id":"cohort-model","kind":"method","name":"Cohort model in Agda","needs":["proof-gate"],"size":"M","status":"done","summary":"The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines.","track":"maths","value":{"economics":2,"maths":2,"teaching":2}} +{"glyph":"๐Ÿ›๏ธ","id":"concept-commons","kind":"view","name":"Concept commons","needs":["centre-computations","whats-owed"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:441","docs/proposals/estate-mathematical-architecture.adoc:158"],"size":"XL","status":"open","summary":"The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance.","track":"maths","value":{"ecosystem":2,"maths":2,"teaching":3}} +{"glyph":"๐Ÿงช","id":"corpus","kind":"method","name":"Propose and dispose corpus","needs":["bridge-by-construction","centre-computations","s3-grade-function"],"refs":["docs/proposals/mathesis-research-programme.adoc:891"],"size":"XL","status":"open","summary":"A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2).","track":"science","value":{"engineering":2,"maths":2,"science":3}} +{"blocked_by":"Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip.","counsel":{"contrarian":"Policy puts this route first, yet every re-proof so far went the other way."},"glyph":"๐Ÿš‚","id":"dedukti-transport","kind":"tool","name":"Transport through Dedukti","needs":["thy1","file-transport-bugs"],"refs":["docs/status/ROADMAP.adoc:92"],"rivals":["bridge-by-construction"],"size":"L","status":"blocked","summary":"Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first.","track":"engineering","value":{"engineering":2,"maths":1,"soundness":2},"where":"upstream:Deducteam/lambdapi"} +{"counsel":{"contrarian":"Cheapest node on the board, and the auditor's favourite.","soundness":"Every one of these is a claim with no receipt behind it; mend before adding."},"glyph":"๐Ÿงน","id":"doc-drift-fix","kind":"decision","name":"Mend the status documents","needs":["claims-registry"],"refs":["docs/status/ROADMAP.adoc:30","docs/status/PROOF-NEEDS.adoc:27","README.adoc:46",".machine_readable/contractiles/intend"],"size":"S","status":"open","summary":"ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts.","track":"engineering","value":{"soundness":3,"teaching":1}} +{"glyph":"๐Ÿ—‚๏ธ","id":"dossier","kind":"method","name":"Theorem dossier","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:291","docs/proposals/mathesis-research-programme.adoc:1017"],"size":"S","status":"open","summary":"The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open.","track":"maths","value":{"maths":1,"soundness":2,"teaching":2}} +{"glyph":"๐Ÿชž","id":"echo-mirrors","kind":"data","name":"Echo mirror records","needs":["bridge-lock-pilot"],"refs":["docs/proposals/mathesis-research-programme.adoc:695"],"size":"M","status":"open","summary":"Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question.","track":"ecosystem","value":{"ecosystem":2,"maths":2},"where":"estate:hyperpolymath/echo-types"} +{"counsel":{"publications":"Nobody has this list; it is citable on its own.","science":"Each entry should come with a counterexample that shows it."},"glyph":"๐Ÿ”ค","id":"encoding-differences","kind":"data","name":"Closed list of encoding differences","needs":["bridge-lock-pilot"],"refs":["docs/proposals/mathesis-research-programme.adoc:609","docs/proposals/mathesis-research-programme.adoc:679"],"size":"M","status":"open","summary":"A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1).","track":"science","value":{"maths":1,"publications":2,"science":3}} +{"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":["docs/proposals/mathesis-research-programme.adoc:883","docs/proposals/mathesis-research-programme.adoc:903"],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} +{"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":["docs/status/ROADMAP.adoc:92","docs/proposals/mathesis-research-programme.adoc:693"],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} +{"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:824","applied-systems/finance/liquidity/README.adoc"],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} +{"blocked_by":"the estate coordinator's answer on how GELS panels take their data (asked 2026-11-24); no feed is written until a reader is agreed","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} +{"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:760"],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} +{"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":["docs/proposals/mathesis-research-programme.adoc:743","docs/proposals/mathesis-research-programme.adoc:755"],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} +{"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} +{"glyph":"๐Ÿ“ฐ","id":"paper-receipts","kind":"paper","name":"Paper: receipts, not claims","needs":["receipt-generator","claims-registry","s3-grade-function"],"size":"L","status":"open","summary":"A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate.","track":"publications","value":{"engineering":1,"publications":3,"soundness":2}} +{"glyph":"๐Ÿ“˜","id":"paper-status-algebra","kind":"paper","name":"Paper: an algebra of proof status","needs":["s1-token-algebra","s2-monotone","s3-grade-function"],"size":"L","status":"open","summary":"S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt.","track":"publications","value":{"maths":3,"publications":3}} +{"counsel":{"publications":"A complete, small, checked result: the easiest first paper."},"glyph":"๐Ÿ“„","id":"paper-thy1","kind":"paper","name":"Note: feature reachability","needs":["thy1","receipts"],"size":"M","status":"open","summary":"A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule.","track":"publications","value":{"maths":1,"publications":3,"teaching":1}} +{"counsel":{"soundness":"The only road back to PWG-1 for THY-1 and APP-1 to APP-4."},"glyph":"๐Ÿ“ฆ","id":"pinned-image","kind":"infrastructure","name":"Proof lanes in a pinned image","needs":["proof-gate"],"refs":["docs/status/PROOF-STATUS.adoc:33"],"size":"M","status":"open","summary":"Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify.","track":"engineering","value":{"engineering":2,"soundness":3}} +{"evidence":[{"path":"scripts/check-proofs.sh"},{"path":"tests/proofs/gate_controls_test.sh"}],"glyph":"๐Ÿ›ก๏ธ","id":"proof-gate","kind":"infrastructure","name":"Proof gate in pinned Guix","size":"L","status":"done","summary":"Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail.","track":"engineering","value":{"engineering":3,"soundness":3}} +{"counsel":{"publications":"Everything else here is invisible until this happens.","soundness":"Publish only views whose checks are green, or the site states what the receipts do not."},"glyph":"๐ŸŒ","id":"publish-atlas","kind":"view","name":"Publish the atlas","needs":["site-build"],"refs":["docs/status/ROADMAP.adoc:262","docs/proposals/mathesis-re-anchoring.adoc:1058"],"size":"S","status":"open","summary":"Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first.","track":"publications","value":{"ecosystem":2,"publications":3,"teaching":2}} +{"glyph":"๐Ÿฅ‡","id":"pwg1-regained","kind":"data","name":"Back to PWG-1","needs":["pinned-image","receipt-generator"],"size":"S","status":"open","summary":"THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image.","track":"engineering","value":{"publications":1,"soundness":2}} +{"counsel":{"engineering":"One generator for the estate instead of one per repository."},"glyph":"๐Ÿญ","id":"receipt-generator","kind":"tool","name":"Shared receipt generator","needs":["receipts"],"size":"M","status":"active","summary":"Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122.","track":"engineering","value":{"engineering":3,"soundness":3}} +{"evidence":[{"path":"verification/receipts/theory_praxis.deed"}],"glyph":"๐Ÿ”","id":"receipts","kind":"data","name":"Proof receipts","needs":["proof-gate","claims-registry"],"size":"M","status":"done","summary":"The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader.","track":"engineering","value":{"engineering":2,"soundness":3}} +{"counsel":{"cartographer":"The registry is only as current as the home receipts."},"glyph":"๐Ÿ“ฃ","id":"receipts-campaign","kind":"method","name":"Receipts campaign","needs":["receipt-generator"],"refs":["docs/status/ROADMAP.adoc:330","docs/proposals/mathesis-re-anchoring.adoc:1065"],"size":"L","status":"open","summary":"Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade.","track":"ecosystem","value":{"ecosystem":3,"soundness":2},"where":"estate:hyperpolymath/secret-types"} +{"counsel":{"cartographer":"Converge: the laws exist, at a grade, in their home repository."},"glyph":"โ™ป๏ธ","id":"s1-reuse","kind":"theorem","name":"S-1 by reuse of resource-algebra","needs":["chain-question","bridge-lock-pilot"],"rivals":["s1-token-algebra"],"size":"M","status":"open","summary":"Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"maths":2},"where":"estate:hyperpolymath/resource-algebra"} +{"counsel":{"contrarian":"resource-algebra already pins E-1 to E-3; proving it again here may be duplication.","maths":"A real algebra of evidence; the centre of the research programme."},"glyph":"๐Ÿ”ข","id":"s1-token-algebra","kind":"theorem","name":"S-1: tokens form a dioid","needs":["chain-question","theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:346","docs/proposals/mathesis-research-programme.adoc:544"],"rivals":["s1-reuse"],"size":"L","status":"open","summary":"The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1).","track":"maths","value":{"maths":3,"publications":2,"soundness":2}} +{"glyph":"๐Ÿ“ˆ","id":"s2-monotone","kind":"theorem","name":"S-2: evaluation is monotone","needs":["chain-question"],"refs":["docs/proposals/mathesis-research-programme.adoc:368"],"size":"S","status":"open","summary":"Positive evaluation of status is monotone; proved once, with its home in Mathesis (R-3).","track":"maths","value":{"maths":2,"soundness":1}} +{"counsel":{"soundness":"Turns the reader from trusted code into a checked one."},"glyph":"๐ŸŽš๏ธ","id":"s3-grade-function","kind":"theorem","name":"S-3: the grade is a function","needs":["chain-question","receipts"],"refs":["docs/proposals/mathesis-research-programme.adoc:378","docs/proposals/mathesis-research-programme.adoc:550"],"size":"M","status":"open","summary":"The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3).","track":"maths","value":{"engineering":2,"maths":2,"soundness":3}} +{"counsel":{"economics":"A forecast that can say undecided is worth more than one that guesses.","teacher":"Three-valued logic with money attached: an easy story to teach."},"glyph":"๐ŸŒฆ๏ธ","id":"s4-s5-verdict","kind":"theorem","name":"S-4 and S-5: honest cash verdicts","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:792","docs/proposals/mathesis-research-programme.adoc:824"],"size":"M","status":"open","summary":"A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2).","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} +{"evidence":[{"path":"scripts/site/site.mjs"}],"glyph":"๐Ÿ—๏ธ","id":"site-build","kind":"view","name":"Atlas site (build)","needs":["atlas-views"],"size":"S","status":"done","summary":"Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy.","track":"engineering","value":{"engineering":1,"teaching":2}} +{"counsel":{"science":"Takes a statistical result that is only tested and makes it a theorem."},"glyph":"๐ŸŽฒ","id":"statistical-bridge","kind":"theorem","name":"From oracle to theorem","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:641"],"size":"L","status":"open","summary":"S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6).","track":"science","value":{"maths":2,"publications":2,"science":3}} +{"glyph":"๐ŸŽค","id":"talk-atlas","kind":"paper","name":"Talk: an atlas of an estate","needs":["publish-atlas"],"size":"S","status":"open","summary":"A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt.","track":"publications","value":{"ecosystem":1,"publications":2,"teaching":2}} +{"counsel":{"teacher":"Shows why a proof matters to someone who reads spreadsheets, not theorems."},"glyph":"๐Ÿ““","id":"teaching-cohort","kind":"paper","name":"Cohort economics, taught","needs":["app-proofs"],"size":"M","status":"open","summary":"A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only.","track":"publications","value":{"economics":1,"publications":2,"teaching":3}} +{"evidence":[{"path":"docs/theory/admissions.jsonl"},{"path":"docs/theory/ledger.jsonl"}],"glyph":"๐Ÿ“š","id":"theory-shelf","kind":"data","name":"Theory shelf and ledger","needs":["claims-registry","thy1"],"size":"S","status":"done","summary":"The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far.","track":"maths","value":{"maths":2,"soundness":2}} +{"evidence":[{"claim":"hyperpolymath/mathesis#THY-1","min_pwg":"PWG-2ii"}],"glyph":"๐Ÿงญ","id":"thy1","kind":"theorem","name":"THY-1: reachability is monotone","needs":["proof-gate"],"size":"M","status":"done","summary":"In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean.","track":"maths","value":{"engineering":2,"maths":2,"publications":2}} +{"counsel":{"cartographer":"The ruling lands in standards PROOF-POLICY, not here; carry it there.","maths":"A theorem about an order is only as good as the order; settle it first."},"glyph":"โš–๏ธ","id":"token-order","kind":"decision","name":"Settle the order of status tokens","needs":["claims-registry"],"refs":["docs/proposals/mathesis-research-programme.adoc:337","docs/atlas/generated/registry.adoc:39"],"size":"S","status":"open","summary":"The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved.","track":"maths","value":{"ecosystem":2,"maths":2,"soundness":3}} +{"evidence":[{"path":"docs/ultraplan/tree.jsonl"},{"path":"scripts/ultraplan/ultraplan.mjs"}],"glyph":"๐ŸŒณ","id":"ultraplan","kind":"view","name":"The ultraplan","needs":["atlas-views"],"size":"S","status":"done","summary":"This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence.","track":"engineering","value":{"engineering":1,"teaching":1}} +{"glyph":"๐Ÿ”ญ","id":"value-of-information","kind":"method","name":"Value of information","needs":["liquidity-shelf"],"refs":["applied-systems/decision-science/README.adoc"],"size":"L","status":"open","summary":"Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README).","track":"economics","value":{"economics":3,"maths":2,"science":2}} +{"glyph":"๐Ÿ“‹","id":"whats-owed","kind":"view","name":"What is owed","needs":["census-workflow","claims-registry"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1079"],"size":"M","status":"open","summary":"A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"soundness":2}} From ebc392188fdd00368adbb824ec6042a64960aab5 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:48:13 +0000 Subject: [PATCH 03/41] ultraplan: apply the owner's answers of 2026-11-24 Owner answers, through the selector: - Four nodes carry the private me advisor's neutral tag owner_value: the THY-1 note, the cohort-economics tutorial, the atlas talk and the thirteen-week forecast. The me advisor now names a pick; its notes stay outside the repository. - "Settle the order of status tokens" is active. It is the mathematician's and the auditor's pick. Two of three active slots are now used: this node and the receipt generator. - A new node records the ruling on PR 122: ask standards for a generator option that keeps manifests on superseded receipts. PR 122 merges with the generator's shape now. The node lands in metadatastician/standards and needs the receipt generator. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/generated/tree.svg | 159 +++++++++++++----------- docs/ultraplan/generated/ultraplan.adoc | 31 +++-- docs/ultraplan/tree.jsonl | 11 +- 3 files changed, 112 insertions(+), 89 deletions(-) diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index b30e1791..9cf69629 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -1,28 +1,28 @@ - + The Mathesis tech tree -Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. 51 nodes in 8 eras; each arrow runs from a node to a node it enables. - +Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. 52 nodes in 8 eras; each arrow runs from a node to a node it enables. + ๐Ÿฆ‰ Mathesis tech tree each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped - + ๐Ÿชจ Tally sticks - + ๐Ÿงฎ Abacus - + ๐Ÿ“ Euclid - + ๐ŸŒŒ Kepler - + โ™พ๏ธ Cantor - + ๐Ÿงฉ Gรถdel - + ๐ŸŒ€ Grothendieck - + ๐Ÿš€ Frontier beyond - + @@ -42,10 +42,10 @@ - - + + - + @@ -53,8 +53,8 @@ - - + + @@ -65,14 +65,14 @@ - - + + - - - + + + @@ -81,14 +81,15 @@ - + + - + - + @@ -229,19 +230,19 @@ Echo mirror records: Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. - -๐Ÿชž -Echo mirror records -๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ -๐ŸŒฑ + +๐Ÿชž +Echo mirror records +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +๐ŸŒฑ Closed list of encoding differences: A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). - -๐Ÿ”ค -Closed list of encodiโ€ฆ -๐Ÿ”ฌ science ยท M -๐ŸŒฑ + +๐Ÿ”ค +Closed list of encodiโ€ฆ +๐Ÿ”ฌ science ยท M +๐ŸŒฑ PWG-2ii across the estate: The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. @@ -293,11 +294,11 @@ Liquidity shelf: The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. - -๐Ÿ’ถ -Liquidity shelf -๐Ÿช™ economics ยท M -๐ŸŒฑ + +๐Ÿ’ถ +Liquidity shelf +๐Ÿช™ economics ยท M +๐ŸŒฑ Paper: receipts, not claims: A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. @@ -349,11 +350,11 @@ Back to PWG-1: THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. - -๐Ÿฅ‡ -Back to PWG-1 -โš™ engineering ยท S -๐ŸŒฑ + +๐Ÿฅ‡ +Back to PWG-1 +โš™ engineering ยท S +๐ŸŒฑ Shared receipt generator: Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. @@ -373,19 +374,19 @@ Receipts campaign: Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. - -๐Ÿ“ฃ -Receipts campaign -๐Ÿ—บ ecosystem ยท L ยท ๐ŸŒ -๐ŸŒฑ + +๐Ÿ“ฃ +Receipts campaign +๐Ÿ—บ ecosystem ยท L ยท ๐ŸŒ +๐ŸŒฑ S-1 by reuse of resource-algebra: Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. - -โ™ป๏ธ -S-1 by reuse of resouโ€ฆ -๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ -๐ŸŒฑ + +โ™ป๏ธ +S-1 by reuse of resouโ€ฆ +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +๐ŸŒฑ S-1: tokens form a dioid: The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). @@ -436,12 +437,20 @@ ๐ŸŒฑ +Keep superseded manifests (option): A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest. + +๐Ÿ—„๏ธ +Keep superseded manifโ€ฆ +โš™ engineering ยท S ยท ๐ŸŒ +๐ŸŒฑ + + Talk: an atlas of an estate: A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. - -๐ŸŽค -Talk: an atlas of an โ€ฆ -๐Ÿ“œ publications ยท S -๐ŸŒฑ + +๐ŸŽค +Talk: an atlas of an โ€ฆ +๐Ÿ“œ publications ยท S +๐ŸŒฑ Cohort economics, taught: A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. @@ -469,11 +478,11 @@ Settle the order of status tokens: The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. - + โš–๏ธ Settle the order of sโ€ฆ โˆ‘ maths ยท S -๐ŸŒฑ +๐Ÿ”จ The ultraplan: This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. @@ -499,17 +508,17 @@ ๐Ÿ—บ ecosystem ยท M ๐ŸŒฑ - -โˆ‘ maths - -โš™ engineering - -๐Ÿ”ฌ science - -๐Ÿช™ economics - -๐Ÿ“œ publications - -๐Ÿ—บ ecosystem -๐ŸŒ lands in another repository + +โˆ‘ maths + +โš™ engineering + +๐Ÿ”ฌ science + +๐Ÿช™ economics + +๐Ÿ“œ publications + +๐Ÿ—บ ecosystem +๐ŸŒ lands in another repository diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index c86f114d..62fc3763 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -13,7 +13,7 @@ never typed. A node marked done carries evidence the generator checks: a file, a claim grade that the registry derives, or an accepted decision record. The value marks are judgements, written down so they can be argued with. -Census of the tree: 12 done, 1 active (at most 3), 36 open, 2 blocked, 0 dropped, of 51 nodes. 13 can be started now. +Census of the tree: 12 done, 2 active (at most 3), 36 open, 2 blocked, 0 dropped, of 52 nodes. 12 can be started now. toc::[] @@ -30,7 +30,6 @@ counts the live nodes that depend on it, directly or through others. [cols="3,1,1,1,5",options="header"] |=== |Node |Track |Size |Unlocks |Summary -|<> |maths |S |13 |The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. |<> |ecosystem |M |8 |The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. |<> |engineering |M |2 |A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. |<> |economics |M |2 |A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. @@ -55,7 +54,7 @@ nodes the owner has tagged. _Asks:_ Is it true, is it new, and does it join two things that were apart? -_Pick:_ <>. A theorem about an order is only as good as the order; settle it first. +_Pick:_ <>. Equivalence as identity, made checkable. === ๐Ÿ”ฌ Scientist @@ -85,7 +84,7 @@ _Pick:_ <>. Everything else here is invisi _Asks:_ Is every done backed by a receipt, and where is the hole? -_Pick:_ <>. +_Pick:_ <>. The only road back to PWG-1 for THY-1 and APP-1 to APP-4. === ๐Ÿ—บ๏ธ Estate cartographer @@ -109,7 +108,7 @@ _Pick:_ <>. _Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. -_Pick:_ nothing on the frontier answers this advisor yet. +_Pick:_ <>. == Forks and confluences @@ -124,7 +123,7 @@ same place; the contrarian keeps the road not taken in view. * <> -> <>, <>, <>, <> * <> -> <>, <>, <>, <>, <>, <>, <>, <> * <> -> <>, <>, <>, <> -* <> -> <>, <>, <>, <> +* <> -> <>, <>, <>, <>, <> * <> -> <>, <>, <> * <> -> <>, <>, <> * <> -> <>, <>, <> @@ -278,11 +277,11 @@ The admission rule for theory no single system owns, with an append-only ledger *Value (judgement):* maths โ—โ—, soundness โ—โ— [[token-order]] -==== ๐ŸŒฑ โš–๏ธ Settle the order of status tokens +==== ๐Ÿ”จ โš–๏ธ Settle the order of status tokens The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. -*Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* open +*Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* active *Needs:* <> + *Enables:* <>, <> + @@ -447,7 +446,7 @@ Adopt the standards generator: the receipt is generated from a run ledger, and t *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* active *Needs:* <> + -*Enables:* <>, <>, <>, <> + +*Enables:* <>, <>, <>, <>, <> + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ— * โš™๏ธ _Engineer:_ One generator for the estate instead of one per repository. @@ -632,6 +631,19 @@ THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the p *Needs:* <>, <> + *Value (judgement):* publications โ—, soundness โ—โ— +[[superseded-manifests-option]] +==== ๐ŸŒฑ ๐Ÿ—„๏ธ Keep superseded manifests (option) + +A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest. + +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards + +*Needs:* <> + +*Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ— + +* ๐Ÿƒ _Contrarian:_ The ledger already holds every digest; check the option earns its keep. +* ๐Ÿ” _Soundness auditor:_ Lineage you can re-check without git archaeology. + [[encoding-differences]] ==== ๐ŸŒฑ ๐Ÿ”ค Closed list of encoding differences @@ -822,5 +834,6 @@ carried to that repository, not done here. * estate:metadatastician/gels: <> (blocked) * estate:metadatastician/standards: <> (open) * estate:metadatastician/standards: <> (open) +* estate:metadatastician/standards: <> (open) * upstream:Deducteam/agda2dedukti: <> (open) * upstream:Deducteam/lambdapi: <> (blocked) diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index 3edae68f..a9f03b81 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -19,14 +19,14 @@ {"counsel":{"publications":"Nobody has this list; it is citable on its own.","science":"Each entry should come with a counterexample that shows it."},"glyph":"๐Ÿ”ค","id":"encoding-differences","kind":"data","name":"Closed list of encoding differences","needs":["bridge-lock-pilot"],"refs":["docs/proposals/mathesis-research-programme.adoc:609","docs/proposals/mathesis-research-programme.adoc:679"],"size":"M","status":"open","summary":"A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1).","track":"science","value":{"maths":1,"publications":2,"science":3}} {"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":["docs/proposals/mathesis-research-programme.adoc:883","docs/proposals/mathesis-research-programme.adoc:903"],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} {"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":["docs/status/ROADMAP.adoc:92","docs/proposals/mathesis-research-programme.adoc:693"],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} -{"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:824","applied-systems/finance/liquidity/README.adoc"],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} +{"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":["docs/proposals/mathesis-research-programme.adoc:824","applied-systems/finance/liquidity/README.adoc"],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} {"blocked_by":"the estate coordinator's answer on how GELS panels take their data (asked 2026-11-24); no feed is written until a reader is agreed","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} {"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:760"],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} {"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":["docs/proposals/mathesis-research-programme.adoc:743","docs/proposals/mathesis-research-programme.adoc:755"],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} {"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} {"glyph":"๐Ÿ“ฐ","id":"paper-receipts","kind":"paper","name":"Paper: receipts, not claims","needs":["receipt-generator","claims-registry","s3-grade-function"],"size":"L","status":"open","summary":"A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate.","track":"publications","value":{"engineering":1,"publications":3,"soundness":2}} {"glyph":"๐Ÿ“˜","id":"paper-status-algebra","kind":"paper","name":"Paper: an algebra of proof status","needs":["s1-token-algebra","s2-monotone","s3-grade-function"],"size":"L","status":"open","summary":"S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt.","track":"publications","value":{"maths":3,"publications":3}} -{"counsel":{"publications":"A complete, small, checked result: the easiest first paper."},"glyph":"๐Ÿ“„","id":"paper-thy1","kind":"paper","name":"Note: feature reachability","needs":["thy1","receipts"],"size":"M","status":"open","summary":"A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule.","track":"publications","value":{"maths":1,"publications":3,"teaching":1}} +{"counsel":{"publications":"A complete, small, checked result: the easiest first paper."},"glyph":"๐Ÿ“„","id":"paper-thy1","kind":"paper","name":"Note: feature reachability","needs":["thy1","receipts"],"owner_value":"high","size":"M","status":"open","summary":"A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule.","track":"publications","value":{"maths":1,"publications":3,"teaching":1}} {"counsel":{"soundness":"The only road back to PWG-1 for THY-1 and APP-1 to APP-4."},"glyph":"๐Ÿ“ฆ","id":"pinned-image","kind":"infrastructure","name":"Proof lanes in a pinned image","needs":["proof-gate"],"refs":["docs/status/PROOF-STATUS.adoc:33"],"size":"M","status":"open","summary":"Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify.","track":"engineering","value":{"engineering":2,"soundness":3}} {"evidence":[{"path":"scripts/check-proofs.sh"},{"path":"tests/proofs/gate_controls_test.sh"}],"glyph":"๐Ÿ›ก๏ธ","id":"proof-gate","kind":"infrastructure","name":"Proof gate in pinned Guix","size":"L","status":"done","summary":"Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail.","track":"engineering","value":{"engineering":3,"soundness":3}} {"counsel":{"publications":"Everything else here is invisible until this happens.","soundness":"Publish only views whose checks are green, or the site states what the receipts do not."},"glyph":"๐ŸŒ","id":"publish-atlas","kind":"view","name":"Publish the atlas","needs":["site-build"],"refs":["docs/status/ROADMAP.adoc:262","docs/proposals/mathesis-re-anchoring.adoc:1058"],"size":"S","status":"open","summary":"Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first.","track":"publications","value":{"ecosystem":2,"publications":3,"teaching":2}} @@ -41,11 +41,12 @@ {"counsel":{"economics":"A forecast that can say undecided is worth more than one that guesses.","teacher":"Three-valued logic with money attached: an easy story to teach."},"glyph":"๐ŸŒฆ๏ธ","id":"s4-s5-verdict","kind":"theorem","name":"S-4 and S-5: honest cash verdicts","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:792","docs/proposals/mathesis-research-programme.adoc:824"],"size":"M","status":"open","summary":"A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2).","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} {"evidence":[{"path":"scripts/site/site.mjs"}],"glyph":"๐Ÿ—๏ธ","id":"site-build","kind":"view","name":"Atlas site (build)","needs":["atlas-views"],"size":"S","status":"done","summary":"Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy.","track":"engineering","value":{"engineering":1,"teaching":2}} {"counsel":{"science":"Takes a statistical result that is only tested and makes it a theorem."},"glyph":"๐ŸŽฒ","id":"statistical-bridge","kind":"theorem","name":"From oracle to theorem","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:641"],"size":"L","status":"open","summary":"S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6).","track":"science","value":{"maths":2,"publications":2,"science":3}} -{"glyph":"๐ŸŽค","id":"talk-atlas","kind":"paper","name":"Talk: an atlas of an estate","needs":["publish-atlas"],"size":"S","status":"open","summary":"A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt.","track":"publications","value":{"ecosystem":1,"publications":2,"teaching":2}} -{"counsel":{"teacher":"Shows why a proof matters to someone who reads spreadsheets, not theorems."},"glyph":"๐Ÿ““","id":"teaching-cohort","kind":"paper","name":"Cohort economics, taught","needs":["app-proofs"],"size":"M","status":"open","summary":"A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only.","track":"publications","value":{"economics":1,"publications":2,"teaching":3}} +{"counsel":{"contrarian":"The ledger already holds every digest; check the option earns its keep.","soundness":"Lineage you can re-check without git archaeology."},"glyph":"๐Ÿ—„๏ธ","id":"superseded-manifests-option","kind":"tool","name":"Keep superseded manifests (option)","needs":["receipt-generator"],"size":"S","status":"open","summary":"A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest.","track":"engineering","value":{"ecosystem":1,"engineering":1,"soundness":2},"where":"estate:metadatastician/standards"} +{"glyph":"๐ŸŽค","id":"talk-atlas","kind":"paper","name":"Talk: an atlas of an estate","needs":["publish-atlas"],"owner_value":"high","size":"S","status":"open","summary":"A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt.","track":"publications","value":{"ecosystem":1,"publications":2,"teaching":2}} +{"counsel":{"teacher":"Shows why a proof matters to someone who reads spreadsheets, not theorems."},"glyph":"๐Ÿ““","id":"teaching-cohort","kind":"paper","name":"Cohort economics, taught","needs":["app-proofs"],"owner_value":"high","size":"M","status":"open","summary":"A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only.","track":"publications","value":{"economics":1,"publications":2,"teaching":3}} {"evidence":[{"path":"docs/theory/admissions.jsonl"},{"path":"docs/theory/ledger.jsonl"}],"glyph":"๐Ÿ“š","id":"theory-shelf","kind":"data","name":"Theory shelf and ledger","needs":["claims-registry","thy1"],"size":"S","status":"done","summary":"The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far.","track":"maths","value":{"maths":2,"soundness":2}} {"evidence":[{"claim":"hyperpolymath/mathesis#THY-1","min_pwg":"PWG-2ii"}],"glyph":"๐Ÿงญ","id":"thy1","kind":"theorem","name":"THY-1: reachability is monotone","needs":["proof-gate"],"size":"M","status":"done","summary":"In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean.","track":"maths","value":{"engineering":2,"maths":2,"publications":2}} -{"counsel":{"cartographer":"The ruling lands in standards PROOF-POLICY, not here; carry it there.","maths":"A theorem about an order is only as good as the order; settle it first."},"glyph":"โš–๏ธ","id":"token-order","kind":"decision","name":"Settle the order of status tokens","needs":["claims-registry"],"refs":["docs/proposals/mathesis-research-programme.adoc:337","docs/atlas/generated/registry.adoc:39"],"size":"S","status":"open","summary":"The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved.","track":"maths","value":{"ecosystem":2,"maths":2,"soundness":3}} +{"counsel":{"cartographer":"The ruling lands in standards PROOF-POLICY, not here; carry it there.","maths":"A theorem about an order is only as good as the order; settle it first."},"glyph":"โš–๏ธ","id":"token-order","kind":"decision","name":"Settle the order of status tokens","needs":["claims-registry"],"refs":["docs/proposals/mathesis-research-programme.adoc:337","docs/atlas/generated/registry.adoc:39"],"size":"S","status":"active","summary":"The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved.","track":"maths","value":{"ecosystem":2,"maths":2,"soundness":3}} {"evidence":[{"path":"docs/ultraplan/tree.jsonl"},{"path":"scripts/ultraplan/ultraplan.mjs"}],"glyph":"๐ŸŒณ","id":"ultraplan","kind":"view","name":"The ultraplan","needs":["atlas-views"],"size":"S","status":"done","summary":"This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence.","track":"engineering","value":{"engineering":1,"teaching":1}} {"glyph":"๐Ÿ”ญ","id":"value-of-information","kind":"method","name":"Value of information","needs":["liquidity-shelf"],"refs":["applied-systems/decision-science/README.adoc"],"size":"L","status":"open","summary":"Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README).","track":"economics","value":{"economics":3,"maths":2,"science":2}} {"glyph":"๐Ÿ“‹","id":"whats-owed","kind":"view","name":"What is owed","needs":["census-workflow","claims-registry"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1079"],"size":"M","status":"open","summary":"A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"soundness":2}} From 20ba5c48de51b08dbc859f4d5c5bf70f62053134 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:49:21 +0000 Subject: [PATCH 04/41] ultraplan: X-PF1 decides the token order, not the other way round The research programme pre-registers the token order (R-1) as provisional until experiment X-PF1 ("is a chain enough?") decides it (research programme lines 335-346 and 390-511). The tree had the edge inverted. Edges now: - chain-question (X-PF1) needs only the registry. - token-order needs chain-question. - S-1, its reuse rival and S-3 need token-order. - S-2 needs only the theory shelf, because it holds for every ordered resource algebra and so does not wait for the order. Statuses: - The owner chose to start settling the token order. Its first step is X-PF1, so chain-question is the active node. token-order is open, waiting on X-PF1. - This is a correction of my model of the tree, reported here rather than absorbed. The token-order node now states the evidence X-PF1 must answer: - R-1 reads PROOF-POLICY section 5 as open < argued < tested-only. - resource-algebra E-1 (PWG-2i) proves open < tested-only < argued. - Section 5 at standards 745fc74 lists the tokens but states no order. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/generated/tree.svg | 366 ++++++++++++------------ docs/ultraplan/generated/ultraplan.adoc | 109 +++---- docs/ultraplan/tree.jsonl | 12 +- 3 files changed, 245 insertions(+), 242 deletions(-) diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index 9cf69629..d620eece 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -1,95 +1,95 @@ - + The Mathesis tech tree Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. 52 nodes in 8 eras; each arrow runs from a node to a node it enables. - + ๐Ÿฆ‰ Mathesis tech tree each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped - + ๐Ÿชจ Tally sticks - + ๐Ÿงฎ Abacus - + ๐Ÿ“ Euclid - + ๐ŸŒŒ Kepler - + โ™พ๏ธ Cantor - + ๐Ÿงฉ Gรถdel - + ๐ŸŒ€ Grothendieck - + ๐Ÿš€ Frontier beyond - + - + - - - - + + + + - + - - - + + + - - + + - - + + - - - + + + - - - - + + + + - + + - - - + + - - - - + + + + - - - - + + + - - - + + + + - - - - + + + + - + - + @@ -126,11 +126,11 @@ Bridge lock pilot: The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. - -๐Ÿ”— -Bridge lock pilot -๐Ÿ—บ ecosystem ยท M -๐ŸŒฑ + +๐Ÿ”— +Bridge lock pilot +๐Ÿ—บ ecosystem ยท M +๐ŸŒฑ Census of the estate: The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time. @@ -150,27 +150,27 @@ Centre computations: Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801). - -๐ŸŽฏ -Centre computations -โˆ‘ maths ยท L -๐ŸŒฑ + +๐ŸŽฏ +Centre computations +โˆ‘ maths ยท L +๐ŸŒฑ -Is a chain enough? (X-PF1): Decide whether proof status is a chain or needs a lattice: outcomes A, B or C, with a seven-value free distributive lattice as the candidate. Outcome C changes the standards canon. - -๐Ÿงฉ -Is a chain enough? (Xโ€ฆ -โˆ‘ maths ยท M -๐ŸŒฑ +Is a chain enough? (X-PF1): Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order. + +๐Ÿงฉ +Is a chain enough? (Xโ€ฆ +โˆ‘ maths ยท M +๐Ÿ”จ CI records its own runs: A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open. - -๐Ÿค– -CI records its own ruโ€ฆ -โš™ engineering ยท M ยท ๐ŸŒ -๐ŸŒฑ + +๐Ÿค– +CI records its own ruโ€ฆ +โš™ engineering ยท M ยท ๐ŸŒ +๐ŸŒฑ Claims registry: Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed. @@ -206,11 +206,11 @@ Transport through Dedukti: Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first. - -๐Ÿš‚ -Transport through Dedโ€ฆ -โš™ engineering ยท L ยท ๐ŸŒ -โ›” + +๐Ÿš‚ +Transport through Dedโ€ฆ +โš™ engineering ยท L ยท ๐ŸŒ +โ›” Mend the status documents: ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. @@ -230,19 +230,19 @@ Echo mirror records: Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. - -๐Ÿชž -Echo mirror records -๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ -๐ŸŒฑ + +๐Ÿชž +Echo mirror records +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +๐ŸŒฑ Closed list of encoding differences: A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). - -๐Ÿ”ค -Closed list of encodiโ€ฆ -๐Ÿ”ฌ science ยท M -๐ŸŒฑ + +๐Ÿ”ค +Closed list of encodiโ€ฆ +๐Ÿ”ฌ science ยท M +๐ŸŒฑ PWG-2ii across the estate: The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. @@ -262,19 +262,19 @@ Thirteen-week forecast: A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. - -๐Ÿ“… -Thirteen-week forecast -๐Ÿช™ economics ยท M -๐ŸŒฑ + +๐Ÿ“… +Thirteen-week forecast +๐Ÿช™ economics ยท M +๐ŸŒฑ Maths panel in GELS: A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions. - -๐ŸชŸ -Maths panel in GELS -๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ -โ›” + +๐ŸชŸ +Maths panel in GELS +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +โ›” Generated Idris2 token laws: Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. @@ -286,19 +286,19 @@ Theorem to code: januskey: Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1). - -๐Ÿ—๏ธ -Theorem to code: januโ€ฆ -โš™ engineering ยท L ยท ๐ŸŒ -๐ŸŒฑ + +๐Ÿ—๏ธ +Theorem to code: januโ€ฆ +โš™ engineering ยท L ยท ๐ŸŒ +๐ŸŒฑ Liquidity shelf: The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. - -๐Ÿ’ถ -Liquidity shelf -๐Ÿช™ economics ยท M -๐ŸŒฑ + +๐Ÿ’ถ +Liquidity shelf +๐Ÿช™ economics ยท M +๐ŸŒฑ Paper: receipts, not claims: A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. @@ -318,11 +318,11 @@ Note: feature reachability: A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. - -๐Ÿ“„ -Note: feature reachabโ€ฆ -๐Ÿ“œ publications ยท M -๐ŸŒฑ + +๐Ÿ“„ +Note: feature reachabโ€ฆ +๐Ÿ“œ publications ยท M +๐ŸŒฑ Proof lanes in a pinned image: Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. @@ -342,27 +342,27 @@ Publish the atlas: Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. - -๐ŸŒ -Publish the atlas -๐Ÿ“œ publications ยท S -๐ŸŒฑ + +๐ŸŒ +Publish the atlas +๐Ÿ“œ publications ยท S +๐ŸŒฑ Back to PWG-1: THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. - -๐Ÿฅ‡ -Back to PWG-1 -โš™ engineering ยท S -๐ŸŒฑ + +๐Ÿฅ‡ +Back to PWG-1 +โš™ engineering ยท S +๐ŸŒฑ Shared receipt generator: Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. - -๐Ÿญ -Shared receipt generaโ€ฆ -โš™ engineering ยท M -๐Ÿ”จ + +๐Ÿญ +Shared receipt generaโ€ฆ +โš™ engineering ยท M +๐Ÿ”จ Proof receipts: The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader. @@ -374,19 +374,19 @@ Receipts campaign: Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. - -๐Ÿ“ฃ -Receipts campaign -๐Ÿ—บ ecosystem ยท L ยท ๐ŸŒ -๐ŸŒฑ + +๐Ÿ“ฃ +Receipts campaign +๐Ÿ—บ ecosystem ยท L ยท ๐ŸŒ +๐ŸŒฑ S-1 by reuse of resource-algebra: Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. - -โ™ป๏ธ -S-1 by reuse of resouโ€ฆ -๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ -๐ŸŒฑ + +โ™ป๏ธ +S-1 by reuse of resouโ€ฆ +๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +๐ŸŒฑ S-1: tokens form a dioid: The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). @@ -397,20 +397,20 @@ ๐ŸŒฑ -S-2: evaluation is monotone: Positive evaluation of status is monotone; proved once, with its home in Mathesis (R-3). - -๐Ÿ“ˆ -S-2: evaluation is moโ€ฆ -โˆ‘ maths ยท S -๐ŸŒฑ +S-2: evaluation is monotone: Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). + +๐Ÿ“ˆ +S-2: evaluation is moโ€ฆ +โˆ‘ maths ยท S +๐ŸŒฑ S-3: the grade is a function: The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3). - -๐ŸŽš๏ธ -S-3: the grade is a fโ€ฆ -โˆ‘ maths ยท M -๐ŸŒฑ + +๐ŸŽš๏ธ +S-3: the grade is a fโ€ฆ +โˆ‘ maths ยท M +๐ŸŒฑ S-4 and S-5: honest cash verdicts: A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). @@ -430,11 +430,11 @@ From oracle to theorem: S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). - -๐ŸŽฒ -From oracle to theorem -๐Ÿ”ฌ science ยท L -๐ŸŒฑ + +๐ŸŽฒ +From oracle to theorem +๐Ÿ”ฌ science ยท L +๐ŸŒฑ Keep superseded manifests (option): A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest. @@ -446,19 +446,19 @@ Talk: an atlas of an estate: A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. - -๐ŸŽค -Talk: an atlas of an โ€ฆ -๐Ÿ“œ publications ยท S -๐ŸŒฑ + +๐ŸŽค +Talk: an atlas of an โ€ฆ +๐Ÿ“œ publications ยท S +๐ŸŒฑ Cohort economics, taught: A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. - -๐Ÿ““ -Cohort economics, tauโ€ฆ -๐Ÿ“œ publications ยท M -๐ŸŒฑ + +๐Ÿ““ +Cohort economics, tauโ€ฆ +๐Ÿ“œ publications ยท M +๐ŸŒฑ Theory shelf and ledger: The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far. @@ -477,12 +477,12 @@ โœ… -Settle the order of status tokens: The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. - -โš–๏ธ -Settle the order of sโ€ฆ -โˆ‘ maths ยท S -๐Ÿ”จ +Settle the order of status tokens: Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order. + +โš–๏ธ +Settle the order of sโ€ฆ +โˆ‘ maths ยท S +๐ŸŒฑ The ultraplan: This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. @@ -508,17 +508,17 @@ ๐Ÿ—บ ecosystem ยท M ๐ŸŒฑ - -โˆ‘ maths - -โš™ engineering - -๐Ÿ”ฌ science - -๐Ÿช™ economics - -๐Ÿ“œ publications - -๐Ÿ—บ ecosystem -๐ŸŒ lands in another repository + +โˆ‘ maths + +โš™ engineering + +๐Ÿ”ฌ science + +๐Ÿช™ economics + +๐Ÿ“œ publications + +๐Ÿ—บ ecosystem +๐ŸŒ lands in another repository diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 62fc3763..2284768e 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -13,7 +13,7 @@ never typed. A node marked done carries evidence the generator checks: a file, a claim grade that the registry derives, or an accepted decision record. The value marks are judgements, written down so they can be argued with. -Census of the tree: 12 done, 2 active (at most 3), 36 open, 2 blocked, 0 dropped, of 52 nodes. 12 can be started now. +Census of the tree: 12 done, 2 active (at most 3), 36 open, 2 blocked, 0 dropped, of 52 nodes. 13 can be started now. toc::[] @@ -38,6 +38,7 @@ counts the live nodes that depend on it, directly or through others. |<> |ecosystem |S |1 |File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. _(upstream:Deducteam/agda2dedukti)_ |<> |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. |<> |publications |S |1 |Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. +|<> |maths |S |1 |Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). |<> |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. |<> |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. |<> |science |L |0 |S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). @@ -120,15 +121,15 @@ same place; the contrarian keeps the road not taken in view. * <> -> <>, <>, <> * <> -> <>, <>, <>, <> * <> -> <>, <> -* <> -> <>, <>, <>, <> -* <> -> <>, <>, <>, <>, <>, <>, <>, <> +* <> -> <>, <>, <>, <>, <>, <>, <>, <> * <> -> <>, <>, <>, <> * <> -> <>, <>, <>, <>, <> * <> -> <>, <>, <> * <> -> <>, <>, <> * <> -> <>, <>, <> -* <> -> <>, <>, <> +* <> -> <>, <>, <>, <> * <> -> <>, <>, <>, <> +* <> -> <>, <>, <>, <> .Confluences * <> + <> -> <> @@ -140,8 +141,8 @@ same place; the contrarian keeps the road not taken in view. * <> + <> -> <> * <> + <> + <> -> <> * <> + <> -> <> -* <> + <> -> <> -* <> + <> -> <> +* <> + <> -> <> +* <> + <> -> <> * <> + <> -> <> .Rivals @@ -232,7 +233,7 @@ Pins 53 claims in their home repositories and derives each grade from the home r *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done *Needs:* <> + -*Enables:* <>, <>, <>, <>, <>, <>, <>, <> + +*Enables:* <>, <>, <>, <>, <>, <>, <>, <> + *Evidence:* ADR 0004 accepted; `docs/atlas/generated/registry.adoc` + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— @@ -264,6 +265,21 @@ Missing inputs propagate and never read as zero; the cash identity; the least fu *Evidence:* hyperpolymath/mathesis#APP-1 at PWG-2ii or above; hyperpolymath/mathesis#APP-2 at PWG-2ii or above; hyperpolymath/mathesis#APP-3 at PWG-2ii or above; hyperpolymath/mathesis#APP-4 at PWG-2ii or above + *Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— +[[chain-question]] +==== ๐Ÿ”จ ๐Ÿงฉ Is a chain enough? (X-PF1) + +Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order. + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* active + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* maths โ—โ—โ—, science โ—โ—, soundness โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:390; docs/proposals/mathesis-research-programme.adoc:458 + +* โˆ‘ _Mathematician:_ The deepest open question on the board; it decides what S-1 even says. +* ๐Ÿ”ฌ _Scientist:_ Pre-register what result means A, B or C before computing. + [[theory-shelf]] ==== โœ… ๐Ÿ“š Theory shelf and ledger @@ -272,25 +288,10 @@ The admission rule for theory no single system owns, with an append-only ledger *Track:* โˆ‘ maths ยท *Kind:* data ยท *Size:* S ยท *Status:* done *Needs:* <>, <> + -*Enables:* <>, <>, <> + +*Enables:* <>, <>, <>, <> + *Evidence:* `docs/theory/admissions.jsonl`; `docs/theory/ledger.jsonl` + *Value (judgement):* maths โ—โ—, soundness โ—โ— -[[token-order]] -==== ๐Ÿ”จ โš–๏ธ Settle the order of status tokens - -The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved. - -*Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* active - -*Needs:* <> + -*Enables:* <>, <> + -*Value (judgement):* maths โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:337; docs/atlas/generated/registry.adoc:39 - -* ๐Ÿ—บ๏ธ _Estate cartographer:_ The ruling lands in standards PROOF-POLICY, not here; carry it there. -* โˆ‘ _Mathematician:_ A theorem about an order is only as good as the order; settle it first. - [[doc-drift-fix]] ==== ๐ŸŒฑ ๐Ÿงน Mend the status documents @@ -381,21 +382,6 @@ A view of the standards requirements master list beside the census and the regis === ๐ŸŒŒ Era 3: Kepler -[[chain-question]] -==== ๐ŸŒฑ ๐Ÿงฉ Is a chain enough? (X-PF1) - -Decide whether proof status is a chain or needs a lattice: outcomes A, B or C, with a seven-value free distributive lattice as the candidate. Outcome C changes the standards canon. - -*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open - -*Needs:* <> + -*Enables:* <>, <>, <>, <> + -*Value (judgement):* maths โ—โ—โ—, science โ—โ—, soundness โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:390 - -* โˆ‘ _Mathematician:_ The deepest open question on the board; it decides what S-1 even says. -* ๐Ÿ”ฌ _Scientist:_ Pre-register what result means A, B or C before computing. - [[dossier]] ==== ๐ŸŒฑ ๐Ÿ—‚๏ธ Theorem dossier @@ -408,6 +394,20 @@ The eight-item dossier for each theorem (Line 0), scored first on THY-1, five ja *Value (judgement):* maths โ—, teaching โ—โ—, soundness โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:291; docs/proposals/mathesis-research-programme.adoc:1017 +[[s2-monotone]] +==== ๐ŸŒฑ ๐Ÿ“ˆ S-2: evaluation is monotone + +Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). + +*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Enables:* <> + +*Value (judgement):* maths โ—โ—, soundness โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:368 + +* ๐Ÿƒ _Contrarian:_ The one theorem of the line that does not wait for the order: start it early. + [[s4-s5-verdict]] ==== ๐ŸŒฑ ๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts @@ -423,6 +423,21 @@ A sound three-valued cash verdict over intervals, where missing means unbounded * ๐Ÿช™ _Economist:_ A forecast that can say undecided is worth more than one that guesses. * ๐ŸŽ _Teacher:_ Three-valued logic with money attached: an easy story to teach. +[[token-order]] +==== ๐ŸŒฑ โš–๏ธ Settle the order of status tokens + +Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order. + +*Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* open + +*Needs:* <> + +*Enables:* <>, <>, <>, <> + +*Value (judgement):* maths โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ— + +*See:* docs/proposals/mathesis-research-programme.adoc:335; docs/atlas/generated/registry.adoc:39; metadatastician/standards 3-practice/PROOF-POLICY.adoc:348 (at 745fc74) + +* ๐Ÿ—บ๏ธ _Estate cartographer:_ The canon order is the ownerโ€™s ruling in standards, and resource-algebra E-1 may need re-proving; carry both. +* โˆ‘ _Mathematician:_ Two careful readings disagree; that is a sign the two tokens are incomparable, which is outcome C. + [[dedukti-transport]] ==== โ›” ๐Ÿš‚ Transport through Dedukti @@ -564,7 +579,7 @@ The status tokens form a ResourceAlgebra and dioid with an annihilating zero, wi *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open -*Needs:* <>, <> + +*Needs:* <>, <> + *Enables:* <>, <>, <> + *Rivals:* <> + *Value (judgement):* maths โ—โ—โ—, publications โ—โ—, soundness โ—โ— + @@ -573,18 +588,6 @@ The status tokens form a ResourceAlgebra and dioid with an annihilating zero, wi * ๐Ÿƒ _Contrarian:_ resource-algebra already pins E-1 to E-3; proving it again here may be duplication. * โˆ‘ _Mathematician:_ A real algebra of evidence; the centre of the research programme. -[[s2-monotone]] -==== ๐ŸŒฑ ๐Ÿ“ˆ S-2: evaluation is monotone - -Positive evaluation of status is monotone; proved once, with its home in Mathesis (R-3). - -*Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* S ยท *Status:* open - -*Needs:* <> + -*Enables:* <> + -*Value (judgement):* maths โ—โ—, soundness โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:368 - [[s3-grade-function]] ==== ๐ŸŒฑ ๐ŸŽš๏ธ S-3: the grade is a function @@ -592,7 +595,7 @@ The Proof Witness Grade is a total monotone function of the receipt, and the can *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open -*Needs:* <>, <> + +*Needs:* <>, <> + *Enables:* <>, <>, <> + *Value (judgement):* maths โ—โ—, engineering โ—โ—, soundness โ—โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:378; docs/proposals/mathesis-research-programme.adoc:550 @@ -712,7 +715,7 @@ Prove only the morphism here, and take the dioid laws from resource-algebra's E- *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/resource-algebra -*Needs:* <>, <> + +*Needs:* <>, <> + *Rivals:* <> + *Value (judgement):* maths โ—โ—, engineering โ—, ecosystem โ—โ—โ— diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index a9f03b81..0ef6fe5e 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -6,7 +6,7 @@ {"evidence":[{"path":"docs/atlas/census/rows.jsonl"},{"path":"scripts/census/run-census.sh"}],"glyph":"๐Ÿงพ","id":"census","kind":"data","name":"Census of the estate","size":"L","status":"done","summary":"The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time.","track":"engineering","value":{"ecosystem":3,"engineering":2,"science":2}} {"glyph":"โฐ","id":"census-workflow","kind":"infrastructure","name":"Census on a schedule","needs":["census"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1075"],"size":"M","status":"open","summary":"A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded.","track":"engineering","value":{"ecosystem":2,"engineering":2}} {"glyph":"๐ŸŽฏ","id":"centre-computations","kind":"method","name":"Centre computations","needs":["bridge-lock-pilot","token-order"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:786"],"size":"L","status":"open","summary":"Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801).","track":"maths","value":{"maths":3,"science":2}} -{"counsel":{"maths":"The deepest open question on the board; it decides what S-1 even says.","science":"Pre-register what result means A, B or C before computing."},"glyph":"๐Ÿงฉ","id":"chain-question","kind":"theorem","name":"Is a chain enough? (X-PF1)","needs":["token-order"],"refs":["docs/proposals/mathesis-research-programme.adoc:390"],"size":"M","status":"open","summary":"Decide whether proof status is a chain or needs a lattice: outcomes A, B or C, with a seven-value free distributive lattice as the candidate. Outcome C changes the standards canon.","track":"maths","value":{"maths":3,"science":2,"soundness":2}} +{"counsel":{"maths":"The deepest open question on the board; it decides what S-1 even says.","science":"Pre-register what result means A, B or C before computing."},"glyph":"๐Ÿงฉ","id":"chain-question","kind":"theorem","name":"Is a chain enough? (X-PF1)","needs":["claims-registry"],"refs":["docs/proposals/mathesis-research-programme.adoc:390","docs/proposals/mathesis-research-programme.adoc:458"],"size":"M","status":"active","summary":"Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order.","track":"maths","value":{"maths":3,"science":2,"soundness":2}} {"glyph":"๐Ÿค–","id":"ci-recorder","kind":"infrastructure","name":"CI records its own runs","needs":["receipt-generator"],"size":"M","status":"open","summary":"A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open.","track":"engineering","value":{"ecosystem":2,"engineering":3,"soundness":2},"where":"estate:metadatastician/standards"} {"evidence":[{"adr":"0004"},{"path":"docs/atlas/generated/registry.adoc"}],"glyph":"๐Ÿ“’","id":"claims-registry","kind":"tool","name":"Claims registry","needs":["census"],"size":"L","status":"done","summary":"Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed.","track":"engineering","value":{"ecosystem":3,"engineering":3,"soundness":3}} {"evidence":[{"path":"verification/proofs/agda/Applied/Cohort.agda"},{"path":"applied-systems/methods/input-schema.adoc"}],"glyph":"๐Ÿ‘ฅ","id":"cohort-model","kind":"method","name":"Cohort model in Agda","needs":["proof-gate"],"size":"M","status":"done","summary":"The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines.","track":"maths","value":{"economics":2,"maths":2,"teaching":2}} @@ -34,10 +34,10 @@ {"counsel":{"engineering":"One generator for the estate instead of one per repository."},"glyph":"๐Ÿญ","id":"receipt-generator","kind":"tool","name":"Shared receipt generator","needs":["receipts"],"size":"M","status":"active","summary":"Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122.","track":"engineering","value":{"engineering":3,"soundness":3}} {"evidence":[{"path":"verification/receipts/theory_praxis.deed"}],"glyph":"๐Ÿ”","id":"receipts","kind":"data","name":"Proof receipts","needs":["proof-gate","claims-registry"],"size":"M","status":"done","summary":"The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader.","track":"engineering","value":{"engineering":2,"soundness":3}} {"counsel":{"cartographer":"The registry is only as current as the home receipts."},"glyph":"๐Ÿ“ฃ","id":"receipts-campaign","kind":"method","name":"Receipts campaign","needs":["receipt-generator"],"refs":["docs/status/ROADMAP.adoc:330","docs/proposals/mathesis-re-anchoring.adoc:1065"],"size":"L","status":"open","summary":"Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade.","track":"ecosystem","value":{"ecosystem":3,"soundness":2},"where":"estate:hyperpolymath/secret-types"} -{"counsel":{"cartographer":"Converge: the laws exist, at a grade, in their home repository."},"glyph":"โ™ป๏ธ","id":"s1-reuse","kind":"theorem","name":"S-1 by reuse of resource-algebra","needs":["chain-question","bridge-lock-pilot"],"rivals":["s1-token-algebra"],"size":"M","status":"open","summary":"Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"maths":2},"where":"estate:hyperpolymath/resource-algebra"} -{"counsel":{"contrarian":"resource-algebra already pins E-1 to E-3; proving it again here may be duplication.","maths":"A real algebra of evidence; the centre of the research programme."},"glyph":"๐Ÿ”ข","id":"s1-token-algebra","kind":"theorem","name":"S-1: tokens form a dioid","needs":["chain-question","theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:346","docs/proposals/mathesis-research-programme.adoc:544"],"rivals":["s1-reuse"],"size":"L","status":"open","summary":"The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1).","track":"maths","value":{"maths":3,"publications":2,"soundness":2}} -{"glyph":"๐Ÿ“ˆ","id":"s2-monotone","kind":"theorem","name":"S-2: evaluation is monotone","needs":["chain-question"],"refs":["docs/proposals/mathesis-research-programme.adoc:368"],"size":"S","status":"open","summary":"Positive evaluation of status is monotone; proved once, with its home in Mathesis (R-3).","track":"maths","value":{"maths":2,"soundness":1}} -{"counsel":{"soundness":"Turns the reader from trusted code into a checked one."},"glyph":"๐ŸŽš๏ธ","id":"s3-grade-function","kind":"theorem","name":"S-3: the grade is a function","needs":["chain-question","receipts"],"refs":["docs/proposals/mathesis-research-programme.adoc:378","docs/proposals/mathesis-research-programme.adoc:550"],"size":"M","status":"open","summary":"The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3).","track":"maths","value":{"engineering":2,"maths":2,"soundness":3}} +{"counsel":{"cartographer":"Converge: the laws exist, at a grade, in their home repository."},"glyph":"โ™ป๏ธ","id":"s1-reuse","kind":"theorem","name":"S-1 by reuse of resource-algebra","needs":["bridge-lock-pilot","token-order"],"rivals":["s1-token-algebra"],"size":"M","status":"open","summary":"Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"maths":2},"where":"estate:hyperpolymath/resource-algebra"} +{"counsel":{"contrarian":"resource-algebra already pins E-1 to E-3; proving it again here may be duplication.","maths":"A real algebra of evidence; the centre of the research programme."},"glyph":"๐Ÿ”ข","id":"s1-token-algebra","kind":"theorem","name":"S-1: tokens form a dioid","needs":["theory-shelf","token-order"],"refs":["docs/proposals/mathesis-research-programme.adoc:346","docs/proposals/mathesis-research-programme.adoc:544"],"rivals":["s1-reuse"],"size":"L","status":"open","summary":"The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1).","track":"maths","value":{"maths":3,"publications":2,"soundness":2}} +{"counsel":{"contrarian":"The one theorem of the line that does not wait for the order: start it early."},"glyph":"๐Ÿ“ˆ","id":"s2-monotone","kind":"theorem","name":"S-2: evaluation is monotone","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:368"],"size":"S","status":"open","summary":"Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3).","track":"maths","value":{"maths":2,"soundness":1}} +{"counsel":{"soundness":"Turns the reader from trusted code into a checked one."},"glyph":"๐ŸŽš๏ธ","id":"s3-grade-function","kind":"theorem","name":"S-3: the grade is a function","needs":["receipts","token-order"],"refs":["docs/proposals/mathesis-research-programme.adoc:378","docs/proposals/mathesis-research-programme.adoc:550"],"size":"M","status":"open","summary":"The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3).","track":"maths","value":{"engineering":2,"maths":2,"soundness":3}} {"counsel":{"economics":"A forecast that can say undecided is worth more than one that guesses.","teacher":"Three-valued logic with money attached: an easy story to teach."},"glyph":"๐ŸŒฆ๏ธ","id":"s4-s5-verdict","kind":"theorem","name":"S-4 and S-5: honest cash verdicts","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:792","docs/proposals/mathesis-research-programme.adoc:824"],"size":"M","status":"open","summary":"A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2).","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} {"evidence":[{"path":"scripts/site/site.mjs"}],"glyph":"๐Ÿ—๏ธ","id":"site-build","kind":"view","name":"Atlas site (build)","needs":["atlas-views"],"size":"S","status":"done","summary":"Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy.","track":"engineering","value":{"engineering":1,"teaching":2}} {"counsel":{"science":"Takes a statistical result that is only tested and makes it a theorem."},"glyph":"๐ŸŽฒ","id":"statistical-bridge","kind":"theorem","name":"From oracle to theorem","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:641"],"size":"L","status":"open","summary":"S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6).","track":"science","value":{"maths":2,"publications":2,"science":3}} @@ -46,7 +46,7 @@ {"counsel":{"teacher":"Shows why a proof matters to someone who reads spreadsheets, not theorems."},"glyph":"๐Ÿ““","id":"teaching-cohort","kind":"paper","name":"Cohort economics, taught","needs":["app-proofs"],"owner_value":"high","size":"M","status":"open","summary":"A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only.","track":"publications","value":{"economics":1,"publications":2,"teaching":3}} {"evidence":[{"path":"docs/theory/admissions.jsonl"},{"path":"docs/theory/ledger.jsonl"}],"glyph":"๐Ÿ“š","id":"theory-shelf","kind":"data","name":"Theory shelf and ledger","needs":["claims-registry","thy1"],"size":"S","status":"done","summary":"The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far.","track":"maths","value":{"maths":2,"soundness":2}} {"evidence":[{"claim":"hyperpolymath/mathesis#THY-1","min_pwg":"PWG-2ii"}],"glyph":"๐Ÿงญ","id":"thy1","kind":"theorem","name":"THY-1: reachability is monotone","needs":["proof-gate"],"size":"M","status":"done","summary":"In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean.","track":"maths","value":{"engineering":2,"maths":2,"publications":2}} -{"counsel":{"cartographer":"The ruling lands in standards PROOF-POLICY, not here; carry it there.","maths":"A theorem about an order is only as good as the order; settle it first."},"glyph":"โš–๏ธ","id":"token-order","kind":"decision","name":"Settle the order of status tokens","needs":["claims-registry"],"refs":["docs/proposals/mathesis-research-programme.adoc:337","docs/atlas/generated/registry.adoc:39"],"size":"S","status":"active","summary":"The research programme rules open < argued < tested-only < proven-with-postulates < proven (R-1), but resource-algebra E-1 states tested-only < argued, and both cite PROOF-POLICY section 5. One order must win before the token algebra is proved.","track":"maths","value":{"ecosystem":2,"maths":2,"soundness":3}} +{"counsel":{"cartographer":"The canon order is the ownerโ€™s ruling in standards, and resource-algebra E-1 may need re-proving; carry both.","maths":"Two careful readings disagree; that is a sign the two tokens are incomparable, which is outcome C."},"glyph":"โš–๏ธ","id":"token-order","kind":"decision","name":"Settle the order of status tokens","needs":["chain-question"],"refs":["docs/proposals/mathesis-research-programme.adoc:335","docs/atlas/generated/registry.adoc:39","metadatastician/standards 3-practice/PROOF-POLICY.adoc:348 (at 745fc74)"],"size":"S","status":"open","summary":"Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order.","track":"maths","value":{"ecosystem":2,"maths":2,"soundness":3}} {"evidence":[{"path":"docs/ultraplan/tree.jsonl"},{"path":"scripts/ultraplan/ultraplan.mjs"}],"glyph":"๐ŸŒณ","id":"ultraplan","kind":"view","name":"The ultraplan","needs":["atlas-views"],"size":"S","status":"done","summary":"This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence.","track":"engineering","value":{"engineering":1,"teaching":1}} {"glyph":"๐Ÿ”ญ","id":"value-of-information","kind":"method","name":"Value of information","needs":["liquidity-shelf"],"refs":["applied-systems/decision-science/README.adoc"],"size":"L","status":"open","summary":"Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README).","track":"economics","value":{"economics":3,"maths":2,"science":2}} {"glyph":"๐Ÿ“‹","id":"whats-owed","kind":"view","name":"What is owed","needs":["census-workflow","claims-registry"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1079"],"size":"M","status":"open","summary":"A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"soundness":2}} From 84118607f0a37355cc632ae71b701b0ca5623894 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:53:51 +0000 Subject: [PATCH 05/41] ultraplan: answer the review of PR 123 Codex and CodeRabbit findings, each checked against the code first. - Sizes: a size must be one of the four own keys of SIZES. Before, an inherited name such as "toString" passed the `in` check, and the effort arithmetic then gave NaN. Applies to nodes and to return tickets. - Lone surrogates: a line holding one is refused. JSON.parse and JSON.stringify both pass a lone surrogate through, so the JCS comparison alone accepted input that I-JSON and RFC 8785 refuse. Valid surrogate pairs still pass. - Path evidence: it must be a regular file. Before, "." or a directory passed the existence check. - Evidence on an active node: it is now checked like a done node's. Before, `{}` passed and rendered as "ADR undefined accepted". - The generated SVG carries SPDX comments after its opening element. - An explicit comparator replaces a default sort (SonarCloud S2871, the one reliability issue behind the D rating). The order is unchanged. - The SVG namespace URI carries the documented Hypatia exemption with its reason. XML Namespaces 1.0 fixes it as http, and it is an identifier that is never fetched. - "Publish the atlas" is blocked on the owner's go-ahead. Before, it was open and so sat on the frontier, although deploying needs a fresh owner question. - The README now states the rule the generator applies: an advisor picks only frontier nodes it marks above zero. - The GELS panel node names the feed/panel contract the estate coordinator described. The panel is read-only and fed by Mathesis. Open decisions route to the decision desk. Tests: 14 pass. New cases cover each refusal above. Mutation controls: removing the own-key size check, the surrogate refusal, the regular-file check or the active-evidence check each makes a test fail. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/README.adoc | 6 ++-- docs/ultraplan/generated/tree.svg | 12 ++++---- docs/ultraplan/generated/ultraplan.adoc | 16 +++++----- docs/ultraplan/tree.jsonl | 4 +-- scripts/ultraplan/ultraplan.mjs | 39 ++++++++++++++++++------- tests/ultraplan/ultraplan.test.mjs | 19 +++++++++++- 6 files changed, 67 insertions(+), 29 deletions(-) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index f07ea129..a2aa7ae7 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -74,8 +74,10 @@ and contrarian). Each asks one question of every node. Each names one pick from the frontier: -* An advisor that reads a value mark ranks by it, then by how much the node -unlocks. +* An advisor that reads a value mark ranks the frontier nodes it marks above +zero: by the mark, then by how much the node unlocks. A node it marks zero is +not one it would pick, so when no node is marked above zero the advisor names +nothing. * The contrarian names the frontier node the council rates lowest that still unlocks the most. That keeps the road not taken in view. * The *me* advisor looks out for what could help the owner's own life. Its notes diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index d620eece..22ea4d9e 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -1,4 +1,6 @@ + + The Mathesis tech tree Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. 52 nodes in 8 eras; each arrow runs from a node to a node it enables. @@ -64,7 +66,7 @@ - + @@ -269,7 +271,7 @@ ๐ŸŒฑ -Maths panel in GELS: A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions. +Maths panel in GELS: The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel. ๐ŸชŸ Maths panel in GELS @@ -341,12 +343,12 @@ โœ… -Publish the atlas: Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. - +Publish the atlas: Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node. + ๐ŸŒ Publish the atlas ๐Ÿ“œ publications ยท S -๐ŸŒฑ +โ›” Back to PWG-1: THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 2284768e..3544961c 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -13,7 +13,7 @@ never typed. A node marked done carries evidence the generator checks: a file, a claim grade that the registry derives, or an accepted decision record. The value marks are judgements, written down so they can be argued with. -Census of the tree: 12 done, 2 active (at most 3), 36 open, 2 blocked, 0 dropped, of 52 nodes. 13 can be started now. +Census of the tree: 12 done, 2 active (at most 3), 35 open, 3 blocked, 0 dropped, of 52 nodes. 12 can be started now. toc::[] @@ -37,7 +37,6 @@ counts the live nodes that depend on it, directly or through others. |<> |maths |S |1 |The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. |<> |ecosystem |S |1 |File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. _(upstream:Deducteam/agda2dedukti)_ |<> |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. -|<> |publications |S |1 |Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. |<> |maths |S |1 |Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). |<> |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. |<> |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. @@ -79,7 +78,7 @@ _Pick:_ <>. A forecast _Asks:_ Is there a paper, a talk or a citable artefact here? -_Pick:_ <>. Everything else here is invisible until this happens. +_Pick:_ <>. A complete, small, checked result: the easiest first paper. === ๐Ÿ” Soundness auditor @@ -506,14 +505,15 @@ A short note on THY-1: why requesting every feature is a sound check for absence * ๐Ÿ“œ _Publisher:_ A complete, small, checked result: the easiest first paper. [[publish-atlas]] -==== ๐ŸŒฑ ๐ŸŒ Publish the atlas +==== โ›” ๐ŸŒ Publish the atlas -Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first. +Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node. -*Track:* ๐Ÿ“œ publications ยท *Kind:* view ยท *Size:* S ยท *Status:* open +*Track:* ๐Ÿ“œ publications ยท *Kind:* view ยท *Size:* S ยท *Status:* blocked *Needs:* <> + *Enables:* <> + +*Blocked by:* the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk + *Value (judgement):* publications โ—โ—โ—, teaching โ—โ—, ecosystem โ—โ— + *See:* docs/status/ROADMAP.adoc:262; docs/proposals/mathesis-re-anchoring.adoc:1058 @@ -550,12 +550,12 @@ The full bridge record for two pilots, a squeakwell ladder row and resource-alge [[gels-maths-panel]] ==== โ›” ๐ŸชŸ Maths panel in GELS -A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions. +The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked ยท *Beyond this repository:* estate:metadatastician/gels *Needs:* <>, <> + -*Blocked by:* the estate coordinator's answer on how GELS panels take their data (asked 2026-11-24); no feed is written until a reader is agreed + +*Blocked by:* the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then publishes a read-only I-JSON/JCS feed and GELS renders it + *Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— === โ™พ๏ธ Era 4: Cantor diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index 0ef6fe5e..e2afb104 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -20,7 +20,7 @@ {"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":["docs/proposals/mathesis-research-programme.adoc:883","docs/proposals/mathesis-research-programme.adoc:903"],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} {"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":["docs/status/ROADMAP.adoc:92","docs/proposals/mathesis-research-programme.adoc:693"],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} {"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":["docs/proposals/mathesis-research-programme.adoc:824","applied-systems/finance/liquidity/README.adoc"],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} -{"blocked_by":"the estate coordinator's answer on how GELS panels take their data (asked 2026-11-24); no feed is written until a reader is agreed","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"A panel in GELS, the estate display, for the maths: the frontier of this tree, the grade census with its denominator, and the open decisions.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} +{"blocked_by":"the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then publishes a read-only I-JSON/JCS feed and GELS renders it","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} {"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:760"],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} {"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":["docs/proposals/mathesis-research-programme.adoc:743","docs/proposals/mathesis-research-programme.adoc:755"],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} {"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} @@ -29,7 +29,7 @@ {"counsel":{"publications":"A complete, small, checked result: the easiest first paper."},"glyph":"๐Ÿ“„","id":"paper-thy1","kind":"paper","name":"Note: feature reachability","needs":["thy1","receipts"],"owner_value":"high","size":"M","status":"open","summary":"A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule.","track":"publications","value":{"maths":1,"publications":3,"teaching":1}} {"counsel":{"soundness":"The only road back to PWG-1 for THY-1 and APP-1 to APP-4."},"glyph":"๐Ÿ“ฆ","id":"pinned-image","kind":"infrastructure","name":"Proof lanes in a pinned image","needs":["proof-gate"],"refs":["docs/status/PROOF-STATUS.adoc:33"],"size":"M","status":"open","summary":"Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify.","track":"engineering","value":{"engineering":2,"soundness":3}} {"evidence":[{"path":"scripts/check-proofs.sh"},{"path":"tests/proofs/gate_controls_test.sh"}],"glyph":"๐Ÿ›ก๏ธ","id":"proof-gate","kind":"infrastructure","name":"Proof gate in pinned Guix","size":"L","status":"done","summary":"Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail.","track":"engineering","value":{"engineering":3,"soundness":3}} -{"counsel":{"publications":"Everything else here is invisible until this happens.","soundness":"Publish only views whose checks are green, or the site states what the receipts do not."},"glyph":"๐ŸŒ","id":"publish-atlas","kind":"view","name":"Publish the atlas","needs":["site-build"],"refs":["docs/status/ROADMAP.adoc:262","docs/proposals/mathesis-re-anchoring.adoc:1058"],"size":"S","status":"open","summary":"Deploy the built site (WO 4.3). The hold ran to 2026-11-24; deploying is outward-facing, so it waits for a fresh owner question first.","track":"publications","value":{"ecosystem":2,"publications":3,"teaching":2}} +{"blocked_by":"the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk","counsel":{"publications":"Everything else here is invisible until this happens.","soundness":"Publish only views whose checks are green, or the site states what the receipts do not."},"glyph":"๐ŸŒ","id":"publish-atlas","kind":"view","name":"Publish the atlas","needs":["site-build"],"refs":["docs/status/ROADMAP.adoc:262","docs/proposals/mathesis-re-anchoring.adoc:1058"],"size":"S","status":"blocked","summary":"Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node.","track":"publications","value":{"ecosystem":2,"publications":3,"teaching":2}} {"glyph":"๐Ÿฅ‡","id":"pwg1-regained","kind":"data","name":"Back to PWG-1","needs":["pinned-image","receipt-generator"],"size":"S","status":"open","summary":"THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image.","track":"engineering","value":{"publications":1,"soundness":2}} {"counsel":{"engineering":"One generator for the estate instead of one per repository."},"glyph":"๐Ÿญ","id":"receipt-generator","kind":"tool","name":"Shared receipt generator","needs":["receipts"],"size":"M","status":"active","summary":"Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122.","track":"engineering","value":{"engineering":3,"soundness":3}} {"evidence":[{"path":"verification/receipts/theory_praxis.deed"}],"glyph":"๐Ÿ”","id":"receipts","kind":"data","name":"Proof receipts","needs":["proof-gate","claims-registry"],"size":"M","status":"done","summary":"The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader.","track":"engineering","value":{"engineering":2,"soundness":3}} diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 4bc7043c..e069b5cb 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -27,7 +27,7 @@ // The "me" advisor is private (owner ruling 2026-11-24): its notes are kept // outside this public repository, and a node carries at most the neutral tag // `owner_value: "high"`. Counsel under the key `me` is refused. -import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync} from 'node:fs'; +import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync} from 'node:fs'; import path from 'node:path'; import {parseJsonl} from '../atlas/census-atlas.mjs'; import {jcs} from '../registry/theory-ledger.mjs'; @@ -60,15 +60,28 @@ export const TRACK_FILL = { }; const SLUG = /^[a-z0-9]+(-[a-z0-9]+)*$/; +// A size is one of the four own keys of SIZES, never an inherited name such as "toString". +const isSize = s => typeof s === 'string' && Object.hasOwn(SIZES, s); const isStr = (v, max = 400) => typeof v === 'string' && v.length > 0 && v.length <= max && v === v.trim() && !/[\u0000-\u001f]/.test(v); // โ”€โ”€ Reading โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // Each source line must already be its own JCS form, so the data has one // spelling and a diff shows only real change. +// I-JSON (RFC 7493) and JCS (RFC 8785) refuse a string or a member name that +// holds a lone surrogate, which JSON.parse would otherwise accept and +// JSON.stringify would write back unchanged. +export function wellFormed(v) { + if (typeof v === 'string') return v.isWellFormed(); + if (Array.isArray(v)) return v.every(wellFormed); + if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => k.isWellFormed() && wellFormed(x)); + return true; +} + export function readSource(text, name) { const rows = parseJsonl(text, name); const lines = text === '' ? [] : text.slice(0, -1).split('\n'); rows.forEach((r, i) => { + if (!wellFormed(r)) throw new Error(`${name}: line ${i + 1} holds a lone surrogate, which I-JSON and JCS refuse`); if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); write it as ${jcs(r)}`); }); return rows; @@ -105,7 +118,7 @@ export function checkEvidence(ev, ctx) { if (kinds.length !== 1) return 'an evidence item names exactly one of path, claim or adr'; if (ev.path !== undefined) { if (!isStr(ev.path, 300) || ev.path.startsWith('/') || ev.path.split('/').includes('..')) return `evidence path ${JSON.stringify(ev.path)} is not a repository path`; - return ctx.exists(ev.path) ? null : `evidence path ${ev.path} does not exist`; + return ctx.isFile(ev.path) ? null : `evidence path ${ev.path} is not a file in the repository`; } if (ev.claim !== undefined) { if (!isStr(ev.claim) || !/^[\w.-]+\/[\w.-]+#[A-Z]+-[0-9A-Za-z]+$/.test(ev.claim)) return `evidence claim ${JSON.stringify(ev.claim)} is not OWNER/REPO#ID`; @@ -151,7 +164,7 @@ export function validate({advisors, nodes, expeditions}, ctx) { if (!TRACKS.includes(n.track)) fail(`${where}: track must be one of ${TRACKS.join(', ')}`); if (!KINDS.includes(n.kind)) fail(`${where}: kind must be one of ${KINDS.join(', ')}`); if (!STATUSES.includes(n.status)) fail(`${where}: status must be one of ${STATUSES.join(', ')}`); - if (!(n.size in SIZES)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); + if (!isSize(n.size)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); if (!isStr(n.summary, 600)) fail(`${where}: summary is required (at most 600 characters)`); for (const k of ['needs', 'rivals', 'evidence', 'refs']) if (n[k] !== undefined && !Array.isArray(n[k])) fail(`${where}: ${k} must be a list`); if (n.value !== undefined) { @@ -185,17 +198,18 @@ export function validate({advisors, nodes, expeditions}, ctx) { } } for (const r of n.rivals ?? []) if (byId.has(r) && !(byId.get(r).rivals ?? []).includes(n.id)) fail(`${where}: rival ${r} does not name ${n.id} back`); - if (n.status === 'done') { - if (!(n.evidence ?? []).length) fail(`${where}: done needs evidence (a path, a claim grade or an accepted ADR)`); + if (n.status === 'done' && !(n.evidence ?? []).length) fail(`${where}: done needs evidence (a path, a claim grade or an accepted ADR)`); + if (n.status === 'done' || n.status === 'active') { + // Evidence an active node shows must hold as much as a done node's. for (const ev of n.evidence ?? []) { let e; try { e = checkEvidence(ev, ctx); } catch (x) { e = x.message; } if (e) fail(`${where}: ${e}`); } - for (const t of n.needs ?? []) if (byId.get(t)?.status !== 'done') fail(`${where}: done, but its need ${t} is not done`); - } else if (n.evidence !== undefined && n.status !== 'active') { + } else if (n.evidence !== undefined) { fail(`${where}: evidence belongs to a done or active node`); } + if (n.status === 'done') for (const t of n.needs ?? []) if (byId.get(t)?.status !== 'done') fail(`${where}: done, but its need ${t} is not done`); } // The needs form a DAG. @@ -219,7 +233,7 @@ export function validate({advisors, nodes, expeditions}, ctx) { if (!isStr(x.id, 20) || !/^X-\d{3}$/.test(x.id) || exIds.has(x.id)) fail(`${where}: id is X-NNN and unique`); exIds.add(x.id); for (const k of ['what', 'why']) if (!isStr(x[k])) fail(`${where}: ${k} is required`); - if (!(x.size in SIZES)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); + if (!isSize(x.size)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); if (!/^\d{4}-\d{2}-\d{2}$/.test(x.date ?? '')) fail(`${where}: date is YYYY-MM-DD`); if (!['out', 'grafted', 'archived'].includes(x.status)) fail(`${where}: status is out, grafted or archived`); if (x.status === 'grafted' && !byId.has(x.graft)) fail(`${where}: a grafted expedition names the node it became (graft)`); @@ -236,7 +250,7 @@ export function validate({advisors, nodes, expeditions}, ctx) { export function derive(byId, advisors) { const children = new Map([...byId.keys()].map(id => [id, []])); for (const n of byId.values()) for (const t of n.needs ?? []) children.get(t).push(n.id); - for (const c of children.values()) c.sort(); + for (const c of children.values()) c.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)); const depth = new Map(); const depthOf = id => { @@ -475,7 +489,10 @@ export function renderSvg(byId, d) { const frontier = new Set(d.frontier.map(n => n.id)); const xOf = id => LEFT + d.depth.get(id) * COL; const o = []; - o.push(``); + // The SVG namespace is an identifier, never fetched, and XML Namespaces 1.0 fixes it as http. + o.push(``); // hypatia: allow code_safety/js_http_url_in_code -- the SVG namespace URI is an identifier, not a fetched URL + o.push(''); + o.push(''); o.push(`The Mathesis tech tree`); o.push(`Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. ${byId.size} nodes in ${maxDepth + 1} eras; each arrow runs from a node to a node it enables.`); o.push(``); @@ -524,7 +541,7 @@ export function renderSvg(byId, d) { export function context(root = ROOT) { const decisions = path.join(root, 'docs/decisions'); return { - exists: p => existsSync(path.join(root, p)), + isFile: p => { try { return statSync(path.join(root, p)).isFile(); } catch { return false; } }, read: p => readFileSync(path.join(root, p), 'utf8'), registry: existsSync(path.join(root, 'docs/atlas/generated/registry.adoc')) ? readFileSync(path.join(root, 'docs/atlas/generated/registry.adoc'), 'utf8') : '', adrFile: n => { diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index fdf3318d..f6b2454e 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -66,6 +66,7 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(out[VIEW]).toContain('== Research now: the frontier'); expect(out[VIEW]).toContain('_Pick:_ <>. The deep one.'); expect(out[SVG].startsWith(''); }); test('the views are deterministic', () => { @@ -76,8 +77,10 @@ test('the views are deterministic', () => { test('done needs evidence that holds', () => { refuses({nodes: swap('root', {evidence: []})}, /node root: done needs evidence/); - refuses({nodes: swap('root', {evidence: [{path: 'NOPE.adoc'}]})}, /evidence path NOPE.adoc does not exist/); + refuses({nodes: swap('root', {evidence: [{path: 'NOPE.adoc'}]})}, /evidence path NOPE.adoc is not a file in the repository/); refuses({nodes: swap('root', {evidence: [{path: '../etc/passwd'}]})}, /is not a repository path/); + refuses({nodes: swap('root', {evidence: [{path: '.'}]})}, /evidence path \. is not a file in the repository/); + refuses({nodes: swap('root', {evidence: [{path: 'docs/decisions'}]})}, /evidence path docs\/decisions is not a file/); refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); @@ -112,6 +115,13 @@ test('the me advisor writes nothing into the public tree', () => { refuses({nodes: swap('theorem', {owner_value: 'medium'})}, /owner_value is "high" or absent/); }); +test('evidence on an active node must hold too', () => { + refuses({nodes: swap('theorem', {status: 'active', evidence: [{}]})}, /exactly one of path, claim or adr/); + refuses({nodes: swap('theorem', {status: 'active', evidence: [{path: 'NOPE.adoc'}]})}, /is not a file in the repository/); + expect(() => generate(fixture({nodes: swap('theorem', {status: 'active', evidence: [{path: 'README.adoc'}]})}))).not.toThrow(); + refuses({nodes: swap('paper', {evidence: [{path: 'README.adoc'}]})}, /evidence belongs to a done or active node/); +}); + test(`at most ${ACTIVE_LIMIT} nodes are active`, () => { const busy = BASE.map(n => ['theorem', 'paper', 'cheap', 'panel'].includes(n.id) ? {...n, status: 'active'} : n); refuses({nodes: busy}, new RegExp(`4 nodes are active .* at most ${ACTIVE_LIMIT}`)); @@ -123,7 +133,14 @@ test('closed schema, blocked reasons and canonical lines', () => { refuses({nodes: swap('paper', {track: 'poetry'})}, /track must be one of/); refuses({nodes: swap('paper', {value: {maths: 4}})}, /value\.maths must be 0, 1, 2 or 3/); refuses({nodes: swap('paper', {where: 'elsewhere'})}, /where is estate:OWNER\/REPO/); + refuses({nodes: swap('paper', {size: 'toString'})}, /size must be one of S, M, L, XL/); + refuses({nodes: swap('paper', {size: 'constructor'})}, /size must be one of/); refuses({raw: {nodes: BASE.map(n => JSON.stringify(n, null, 0)).join('\n') + '\n'}}, /not in JCS form/); + // A lone surrogate survives JSON.parse and JSON.stringify alike; I-JSON refuses it. + const lone = jcs({...BASE[0], name: 'x'}).replace('"name":"x"', '"name":"\\ud800"'); + refuses({raw: {nodes: [lone, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate/); + const pair = jcs({...BASE[0], name: 'x \u{1F600}'}); + expect(() => generate(fixture({raw: {nodes: [pair, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}))).not.toThrow(); }); test('return tickets are grafted or archived honestly', () => { From e69a9f303ad9141c8a45f94976cd4237a9790cdf Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:59:17 +0000 Subject: [PATCH 06/41] ultraplan: the me advisor's notes live in a private GELS panel The owner ruled through the selector on 2026-11-24 that the private me advisor's notes live in a private panel of GELS that the owner owns. They are never in this repository and never in any feed; this is the estate coordinator's advice too. The public tree still carries at most the neutral owner_value tag. The README and the ROADMAP ruling say so. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/status/ROADMAP.adoc | 5 +++-- docs/ultraplan/README.adoc | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 06dbf802..61d10686 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -418,8 +418,9 @@ scheduled census, a view of what each repository owes ** The advisors are the owner's six (mathematician, scientist, engineer, economist, publisher, me) and four more (soundness auditor, estate cartographer, teacher, contrarian). -** The me advisor is private. Its notes stay outside this repository, and a - node carries at most the tag `owner_value`. +** The me advisor is private. Its notes stay outside this repository and every + feed, in a private GELS panel the owner owns, and a node carries at most the + tag `owner_value`. ** Off-tree trips are return tickets: each is grafted onto the tree or archived with what it taught. ** The GELS maths panel waits on the estate coordinator's answer about panel diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index a2aa7ae7..1676fbaa 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -81,7 +81,8 @@ nothing. * The contrarian names the frontier node the council rates lowest that still unlocks the most. That keeps the road not taken in view. * The *me* advisor looks out for what could help the owner's own life. Its notes -are kept privately, outside this public repository. A node carries at most the +are kept privately, outside this public repository and out of every feed: in +a private panel of GELS that the owner owns (owner ruling 2026-11-24). A node carries at most the neutral tag `"owner_value":"high"`, and the generator refuses any counsel under the key `me`. From a77fe79f3a3f5736f8020d8b44af230bf431737d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 12:01:19 +0000 Subject: [PATCH 07/41] ultraplan: answer Codex's second review of PR 123 Each finding was checked against the code; all six hold. - An active node's needs must be done. A node starts only from the frontier. Before, an active node could rest on open needs. - A return ticket's date must be a real calendar day. Before, 2026-02-30 and 2026-99-99 passed the shape check. My first fix crashed on 2026-99-99 ("Invalid Date"); the tests caught it, and the guard now refuses it cleanly. - Exactly the me advisor is private. "me" without private:true is refused, and so is private on any other advisor. The me ranking and the page's privacy claim can no longer diverge. - min_pwg belongs to claim evidence only. Before, it was silently ignored on path or ADR evidence. - The README's GELS section now records the coordinator's answer. The panel is blocked on the GELS feed/panel contract, not on that answer. - The CHANGELOG no longer states a node count, which went stale when the tree grew. Tests: 15 pass. A mutation of each new guard makes a test fail. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 2 +- docs/ultraplan/README.adoc | 17 +++++++++++++---- scripts/ultraplan/ultraplan.mjs | 15 +++++++++++++-- tests/ultraplan/ultraplan.test.mjs | 14 +++++++++++++- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 7dad8d8c..a5ebabe7 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -74,7 +74,7 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. * **The ultraplan: a tech tree of Mathesis, data first.** `docs/ultraplan/` holds three JCS JSON Lines files: - ** `tree.jsonl`, 51 nodes whose needs are the edges; + ** `tree.jsonl`, the nodes, whose needs are the edges; ** `advisors.jsonl`, the ten advisors; ** `expeditions.jsonl`, the return tickets. + diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 1676fbaa..828bd21a 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -120,7 +120,16 @@ there. == GELS The owner asked for a maths panel in GELS, the estate display. The estate -coordinator was asked on 2026-11-24 how GELS panels take their data. Until it -answers, nothing here writes a feed for GELS. A feed with no agreed reader would -be unwired. The panel is a node in the tree (`gels-maths-panel`), blocked on that -answer. +coordinator answered on 2026-11-24: + +* Mathesis publishes a read-only I-JSON/JCS feed, and GELS renders it as one +panel type beside the work-queue lanes and the Plan tab. +* The feed carries the tree's nodes, the advisors' picks (never the me +advisor's), the grade census with its denominator, and the claim pins. +* Open decisions go to the owner's decision desk, not this panel. + +The GELS thread is drafting the feed and panel contract +(`docs/proposals/feed-panel-contract.adoc` in metadatastician/gels). Until it +exists, nothing here writes a feed: a feed with no agreed reader would be +unwired. The panel is a node in the tree (`gels-maths-panel`), blocked on that +contract. diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index e069b5cb..6f6bd13a 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -62,6 +62,12 @@ export const TRACK_FILL = { const SLUG = /^[a-z0-9]+(-[a-z0-9]+)*$/; // A size is one of the four own keys of SIZES, never an inherited name such as "toString". const isSize = s => typeof s === 'string' && Object.hasOwn(SIZES, s); +// A YYYY-MM-DD that names a real day (no 2026-02-30). +export const isDate = s => { + if (typeof s !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(s)) return false; + const d = new Date(`${s}T00:00:00Z`); + return !Number.isNaN(d.getTime()) && d.toISOString().slice(0, 10) === s; +}; const isStr = (v, max = 400) => typeof v === 'string' && v.length > 0 && v.length <= max && v === v.trim() && !/[\u0000-\u001f]/.test(v); // โ”€โ”€ Reading โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ @@ -116,6 +122,7 @@ export function checkEvidence(ev, ctx) { closed(ev, ['path', 'claim', 'min_pwg', 'adr'], 'evidence'); const kinds = ['path', 'claim', 'adr'].filter(k => k in ev); if (kinds.length !== 1) return 'an evidence item names exactly one of path, claim or adr'; + if (ev.min_pwg !== undefined && ev.claim === undefined) return 'min_pwg belongs to claim evidence only'; if (ev.path !== undefined) { if (!isStr(ev.path, 300) || ev.path.startsWith('/') || ev.path.split('/').includes('..')) return `evidence path ${JSON.stringify(ev.path)} is not a repository path`; return ctx.isFile(ev.path) ? null : `evidence path ${ev.path} is not a file in the repository`; @@ -147,6 +154,9 @@ export function validate({advisors, nodes, expeditions}, ctx) { for (const k of ['name', 'glyph', 'asks']) if (!isStr(a[k])) fail(`advisor ${a.id}: ${k} is required`); if (a.reads !== undefined && !VALUE_KEYS.includes(a.reads)) fail(`advisor ${a.id}: reads must be one of ${VALUE_KEYS.join(', ')}`); if (a.private !== undefined && a.private !== true) fail(`advisor ${a.id}: private is true or absent`); + // Exactly the me advisor is private: its ranking and the page's privacy claim depend on it. + if (a.id === 'me' && a.private !== true) fail('advisor me: must be private ("private":true)'); + if (a.id !== 'me' && a.private !== undefined) fail(`advisor ${a.id}: only the me advisor is private`); } const byId = new Map(); @@ -209,7 +219,8 @@ export function validate({advisors, nodes, expeditions}, ctx) { } else if (n.evidence !== undefined) { fail(`${where}: evidence belongs to a done or active node`); } - if (n.status === 'done') for (const t of n.needs ?? []) if (byId.get(t)?.status !== 'done') fail(`${where}: done, but its need ${t} is not done`); + // A node is started only from the frontier, so an active node's needs are done too. + if (n.status === 'done' || n.status === 'active') for (const t of n.needs ?? []) if (byId.get(t)?.status !== 'done') fail(`${where}: ${n.status}, but its need ${t} is not done`); } // The needs form a DAG. @@ -234,7 +245,7 @@ export function validate({advisors, nodes, expeditions}, ctx) { exIds.add(x.id); for (const k of ['what', 'why']) if (!isStr(x[k])) fail(`${where}: ${k} is required`); if (!isSize(x.size)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); - if (!/^\d{4}-\d{2}-\d{2}$/.test(x.date ?? '')) fail(`${where}: date is YYYY-MM-DD`); + if (!isDate(x.date)) fail(`${where}: date is a real calendar date, YYYY-MM-DD`); if (!['out', 'grafted', 'archived'].includes(x.status)) fail(`${where}: status is out, grafted or archived`); if (x.status === 'grafted' && !byId.has(x.graft)) fail(`${where}: a grafted expedition names the node it became (graft)`); if (x.status !== 'grafted' && x.graft !== undefined) fail(`${where}: graft belongs to a grafted expedition`); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index f6b2454e..0e59d3ad 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -84,6 +84,8 @@ test('done needs evidence that holds', () => { refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); + refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', min_pwg: 'PWG-1'}]})}, /min_pwg belongs to claim evidence only/); + refuses({nodes: swap('tool', {evidence: [{adr: '0004', min_pwg: 'PWG-1'}]})}, /min_pwg belongs to claim evidence only/); }); test('a claim is evidence only at the grade the registry derives', () => { @@ -94,8 +96,10 @@ test('a claim is evidence only at the grade the registry derives', () => { refuses({nodes: swap('root', {evidence: [{claim: 'o/r#T-9'}]}), registry}, /does not list o\/r#T-9/); }); -test('a done node cannot rest on an unfinished need', () => { +test('a done or active node cannot rest on an unfinished need', () => { refuses({nodes: swap('cheap', {status: 'done', evidence: [{path: 'README.adoc'}], needs: ['theorem']})}, /node cheap: done, but its need theorem is not done/); + refuses({nodes: swap('panel', {status: 'active'})}, /node panel: active, but its need theorem is not done/); + expect(() => generate(fixture({nodes: swap('cheap', {status: 'active'})}))).not.toThrow(); }); test('the needs form a DAG over known nodes', () => { @@ -110,6 +114,11 @@ test('rivals name each other back', () => { expect(generate(fixture({nodes: both})).derived.rivalries).toEqual([['cheap', 'paper']]); }); +test('exactly the me advisor is private', () => { + refuses({advisors: ADVISORS.map(a => a.id === 'me' ? {...a, private: undefined} : a).map(a => JSON.parse(JSON.stringify(a)))}, /advisor me: must be private/); + refuses({advisors: ADVISORS.map(a => a.id === 'maths' ? {...a, private: true} : a)}, /advisor maths: only the me advisor is private/); +}); + test('the me advisor writes nothing into the public tree', () => { refuses({nodes: swap('theorem', {counsel: {me: 'personal note'}})}, /counsel\.me is refused/); refuses({nodes: swap('theorem', {owner_value: 'medium'})}, /owner_value is "high" or absent/); @@ -149,6 +158,9 @@ test('return tickets are grafted or archived honestly', () => { refuses({expeditions: [{...x, status: 'grafted', graft: 'ghost'}]}, /names the node it became/); refuses({expeditions: [{...x, status: 'archived'}]}, /records what it taught/); refuses({expeditions: [x, {...x}]}, /id is X-NNN and unique/); + refuses({expeditions: [{...x, date: '2026-02-30'}]}, /date is a real calendar date/); + refuses({expeditions: [{...x, date: '2026-99-99'}]}, /date is a real calendar date/); + expect(() => generate(fixture({expeditions: [{...x, date: '2028-02-29'}]}))).not.toThrow(); }); test('the evidence parsers read the real registry view and ADRs', () => { From ec874f23d5fe75aef815fb6b0aa3ce845a677a77 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 12:09:27 +0000 Subject: [PATCH 08/41] ultraplan: answer Codex's third review of PR 123 All six findings were checked against the code; all hold. - The me advisor's record is required. Before, removing it passed, and the page still described a private advisor. - Every ordinary advisor must name the mark it ranks by (reads). Before, an advisor without one silently never picked. The contrarian and the me advisor have their own ranking and may not name one. - Evidence must stay in the repository, with symlinks resolved. Before, a committed symlink to a file outside the checkout passed. A symlink inside the repository still passes. - A claim is matched in the registry row's claim cell only. Before, an id mentioned in another row's statement counted as listed. - Return tickets show their size in the generated table. - The SVG canvas is at least as wide as its fixed legend, so small trees no longer clip it. The superseded-manifests-option node now refers to metadatastician/standards#1705, the draft that adds the option. Tests: 16 pass. A mutation of each new guard makes a test fail. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/generated/ultraplan.adoc | 3 +- docs/ultraplan/tree.jsonl | 2 +- scripts/ultraplan/ultraplan.mjs | 38 ++++++++++++++++++------- tests/ultraplan/ultraplan.test.mjs | 25 ++++++++++++++-- 4 files changed, 54 insertions(+), 14 deletions(-) diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 3544961c..c0c824be 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -642,7 +642,8 @@ A generator option in standards that keeps the inputs digest, manifest and axiom *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards *Needs:* <> + -*Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ— +*Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ— + +*See:* metadatastician/standards#1705 (draft): RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, set alike for --write and --check * ๐Ÿƒ _Contrarian:_ The ledger already holds every digest; check the option earns its keep. * ๐Ÿ” _Soundness auditor:_ Lineage you can re-check without git archaeology. diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index e2afb104..10dc74a6 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -41,7 +41,7 @@ {"counsel":{"economics":"A forecast that can say undecided is worth more than one that guesses.","teacher":"Three-valued logic with money attached: an easy story to teach."},"glyph":"๐ŸŒฆ๏ธ","id":"s4-s5-verdict","kind":"theorem","name":"S-4 and S-5: honest cash verdicts","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:792","docs/proposals/mathesis-research-programme.adoc:824"],"size":"M","status":"open","summary":"A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2).","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} {"evidence":[{"path":"scripts/site/site.mjs"}],"glyph":"๐Ÿ—๏ธ","id":"site-build","kind":"view","name":"Atlas site (build)","needs":["atlas-views"],"size":"S","status":"done","summary":"Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy.","track":"engineering","value":{"engineering":1,"teaching":2}} {"counsel":{"science":"Takes a statistical result that is only tested and makes it a theorem."},"glyph":"๐ŸŽฒ","id":"statistical-bridge","kind":"theorem","name":"From oracle to theorem","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:641"],"size":"L","status":"open","summary":"S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6).","track":"science","value":{"maths":2,"publications":2,"science":3}} -{"counsel":{"contrarian":"The ledger already holds every digest; check the option earns its keep.","soundness":"Lineage you can re-check without git archaeology."},"glyph":"๐Ÿ—„๏ธ","id":"superseded-manifests-option","kind":"tool","name":"Keep superseded manifests (option)","needs":["receipt-generator"],"size":"S","status":"open","summary":"A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest.","track":"engineering","value":{"ecosystem":1,"engineering":1,"soundness":2},"where":"estate:metadatastician/standards"} +{"counsel":{"contrarian":"The ledger already holds every digest; check the option earns its keep.","soundness":"Lineage you can re-check without git archaeology."},"glyph":"๐Ÿ—„๏ธ","id":"superseded-manifests-option","kind":"tool","name":"Keep superseded manifests (option)","needs":["receipt-generator"],"refs":["metadatastician/standards#1705 (draft): RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, set alike for --write and --check"],"size":"S","status":"open","summary":"A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest.","track":"engineering","value":{"ecosystem":1,"engineering":1,"soundness":2},"where":"estate:metadatastician/standards"} {"glyph":"๐ŸŽค","id":"talk-atlas","kind":"paper","name":"Talk: an atlas of an estate","needs":["publish-atlas"],"owner_value":"high","size":"S","status":"open","summary":"A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt.","track":"publications","value":{"ecosystem":1,"publications":2,"teaching":2}} {"counsel":{"teacher":"Shows why a proof matters to someone who reads spreadsheets, not theorems."},"glyph":"๐Ÿ““","id":"teaching-cohort","kind":"paper","name":"Cohort economics, taught","needs":["app-proofs"],"owner_value":"high","size":"M","status":"open","summary":"A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only.","track":"publications","value":{"economics":1,"publications":2,"teaching":3}} {"evidence":[{"path":"docs/theory/admissions.jsonl"},{"path":"docs/theory/ledger.jsonl"}],"glyph":"๐Ÿ“š","id":"theory-shelf","kind":"data","name":"Theory shelf and ledger","needs":["claims-registry","thy1"],"size":"S","status":"done","summary":"The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far.","track":"maths","value":{"maths":2,"soundness":2}} diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 6f6bd13a..860390d0 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -27,7 +27,7 @@ // The "me" advisor is private (owner ruling 2026-11-24): its notes are kept // outside this public repository, and a node carries at most the neutral tag // `owner_value: "high"`. Counsel under the key `me` is refused. -import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync} from 'node:fs'; +import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync, realpathSync} from 'node:fs'; import path from 'node:path'; import {parseJsonl} from '../atlas/census-atlas.mjs'; import {jcs} from '../registry/theory-ledger.mjs'; @@ -43,6 +43,7 @@ export const SIZES = {S: 1, M: 2, L: 4, XL: 8}; export const VALUE_KEYS = ['maths', 'engineering', 'science', 'economics', 'publications', 'teaching', 'soundness', 'ecosystem']; export const KINDS = ['theorem', 'tool', 'data', 'view', 'paper', 'decision', 'infrastructure', 'method']; export const ACTIVE_LIMIT = 3; +export const SPECIAL_ADVISORS = ['contrarian', 'me']; export const PWG_ORDER = ['ungraded', 'PWG-3', 'PWG-2i', 'PWG-2ii', 'PWG-1']; // The eras of the tree, by depth (the longest chain of needs below a node). @@ -101,11 +102,16 @@ function closed(obj, allowed, where) { // โ”€โ”€ Evidence โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // The grade the registry view derives for a claim id, or null when the view // does not list it. The view is generated and checked by registry-check. +// A registry row opens with its claim cell (a link whose label is the claim id), +// then its kind and its grade. Only the claim cell names the row's claim: an id +// mentioned in another row's statement is not that claim's row. +const ROW = /^\|https:\/\/\S*?\[([^\]]+)\][^|]* \|(?:theorem|demonstration|assumption) \|`(PWG-1|PWG-2ii|PWG-2i|PWG-3|ungraded)` \|/; export function registryGrade(registryText, id) { - const line = registryText.split('\n').find(l => l.includes(`[${id}]`)); - if (!line) return null; - const m = /\|`(PWG-1|PWG-2ii|PWG-2i|PWG-3|ungraded)`/.exec(line) || /\|`?(ungraded)`?\s*\|/.exec(line); - return m ? m[1] : null; + for (const line of registryText.split('\n')) { + const m = ROW.exec(line); + if (m && m[1] === id) return m[2]; + } + return null; } // Whether an ADR's Status section opens with "Accepted". @@ -157,7 +163,11 @@ export function validate({advisors, nodes, expeditions}, ctx) { // Exactly the me advisor is private: its ranking and the page's privacy claim depend on it. if (a.id === 'me' && a.private !== true) fail('advisor me: must be private ("private":true)'); if (a.id !== 'me' && a.private !== undefined) fail(`advisor ${a.id}: only the me advisor is private`); + // The contrarian and the me advisor have their own ranking; every other advisor ranks by one mark. + if (SPECIAL_ADVISORS.includes(a.id) && a.reads !== undefined) fail(`advisor ${a.id}: reads no value mark (it has its own ranking)`); + if (!SPECIAL_ADVISORS.includes(a.id) && a.reads === undefined) fail(`advisor ${a.id}: reads is required (the value mark it ranks by)`); } + if (!advisorIds.has('me')) fail('advisors: the me advisor is required ("id":"me","private":true)'); const byId = new Map(); for (const n of nodes) { @@ -452,12 +462,12 @@ export function renderAdoc(byId, advisors, expeditions, d) { L.push(''); if (!expeditions.length) L.push('No trip is out.'); else { - L.push('[cols="1,1,3,3,3",options="header"]'); + L.push('[cols="1,1,1,3,3,3",options="header"]'); L.push('|==='); - L.push('|Card |Date |What |Why |Outcome'); + L.push('|Card |Date |Size |What |Why |Outcome'); for (const x of expeditions) { const out = x.status === 'out' ? '๐ŸŽ’ out' : x.status === 'grafted' ? `๐ŸŒฟ grafted as ${xref(byId, x.graft)}` : `๐Ÿ“ฆ archived: ${cell(x.lesson)}`; - L.push(`|${x.id} |${x.date} |${cell(x.what)} |${cell(x.why)} |${out}`); + L.push(`|${x.id} |${x.date} |${x.size} |${cell(x.what)} |${cell(x.why)} |${out}`); } L.push('|==='); } @@ -495,7 +505,9 @@ export function renderSvg(byId, d) { cols[k].forEach((n, i) => yOf.set(n.id, TOP + i * (BOX_H + GAP))); } const tallest = Math.max(1, ...cols.map(c => c.length)); - const W = LEFT * 2 + (maxDepth + 1) * COL - (COL - BOX_W); + // At least as wide as the fixed legend (six tracks and the beyond-repository key). + const LEGEND_W = LEFT + TRACKS.length * 128 + 260; + const W = Math.max(LEFT * 2 + (maxDepth + 1) * COL - (COL - BOX_W), LEGEND_W); const H = TOP + tallest * (BOX_H + GAP) + 70; const frontier = new Set(d.frontier.map(n => n.id)); const xOf = id => LEFT + d.depth.get(id) * COL; @@ -552,7 +564,13 @@ export function renderSvg(byId, d) { export function context(root = ROOT) { const decisions = path.join(root, 'docs/decisions'); return { - isFile: p => { try { return statSync(path.join(root, p)).isFile(); } catch { return false; } }, + // A regular file whose real path (symlinks resolved) stays inside the repository. + isFile: p => { + try { + const base = realpathSync(root), real = realpathSync(path.join(root, p)); + return real.startsWith(base + path.sep) && statSync(real).isFile(); + } catch { return false; } + }, read: p => readFileSync(path.join(root, p), 'utf8'), registry: existsSync(path.join(root, 'docs/atlas/generated/registry.adoc')) ? readFileSync(path.join(root, 'docs/atlas/generated/registry.adoc'), 'utf8') : '', adrFile: n => { diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 0e59d3ad..1c31e73a 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -3,7 +3,7 @@ // // The ultraplan generator: what it derives, and each thing it refuses. import {test, expect, afterAll} from 'bun:test'; -import {mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync} from 'node:fs'; +import {mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync, symlinkSync} from 'node:fs'; import {tmpdir} from 'node:os'; import path from 'node:path'; import {generate, validate, derive, readSource, registryGrade, adrAccepted, context, ACTIVE_LIMIT, ROOT, VIEW, SVG} @@ -67,6 +67,8 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(out[VIEW]).toContain('_Pick:_ <>. The deep one.'); expect(out[SVG].startsWith(''); + // Three eras are narrower than the legend; the canvas still holds the legend. + expect(Number(/width="(\d+)"/.exec(out[SVG])[1])).toBeGreaterThanOrEqual(24 + 6 * 128 + 260); }); test('the views are deterministic', () => { @@ -81,6 +83,16 @@ test('done needs evidence that holds', () => { refuses({nodes: swap('root', {evidence: [{path: '../etc/passwd'}]})}, /is not a repository path/); refuses({nodes: swap('root', {evidence: [{path: '.'}]})}, /evidence path \. is not a file in the repository/); refuses({nodes: swap('root', {evidence: [{path: 'docs/decisions'}]})}, /evidence path docs\/decisions is not a file/); + // A committed symlink to a file outside the repository is not evidence in it. + const outside = mkdtempSync(path.join(tmpdir(), 'ultraplan-outside-')); + roots.push(outside); + writeFileSync(path.join(outside, 'secret.txt'), 'x\n'); + const root = fixture({nodes: swap('root', {evidence: [{path: 'link.txt'}]})}); + symlinkSync(path.join(outside, 'secret.txt'), path.join(root, 'link.txt')); + expect(() => generate(root)).toThrow(/evidence path link.txt is not a file in the repository/); + const inside = fixture({nodes: swap('root', {evidence: [{path: 'inner.adoc'}]})}); + symlinkSync('README.adoc', path.join(inside, 'inner.adoc')); + expect(() => generate(inside)).not.toThrow(); refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); @@ -94,6 +106,9 @@ test('a claim is evidence only at the grade the registry derives', () => { expect(() => generate(fixture({nodes: ok, registry}))).not.toThrow(); refuses({nodes: swap('root', {evidence: [{claim: 'o/r#T-1', min_pwg: 'PWG-2ii'}]}), registry}, /o\/r#T-1 derives PWG-2i, below PWG-2ii/); refuses({nodes: swap('root', {evidence: [{claim: 'o/r#T-9'}]}), registry}, /does not list o\/r#T-9/); + // An id mentioned inside another row's statement does not list that claim. + const mention = '|https://x/blob/c/P.adoc[o/r#T-1] at `c` |theorem |`PWG-2ii` |Builds on [o/r#GHOST-1] |why\n'; + refuses({nodes: swap('root', {evidence: [{claim: 'o/r#GHOST-1'}]}), registry: mention}, /does not list o\/r#GHOST-1/); }); test('a done or active node cannot rest on an unfinished need', () => { @@ -114,6 +129,12 @@ test('rivals name each other back', () => { expect(generate(fixture({nodes: both})).derived.rivalries).toEqual([['cheap', 'paper']]); }); +test('the council is well formed', () => { + refuses({advisors: ADVISORS.filter(a => a.id !== 'me')}, /the me advisor is required/); + refuses({advisors: ADVISORS.map(a => a.id === 'maths' ? {id: a.id, name: a.name, glyph: a.glyph, asks: a.asks} : a)}, /advisor maths: reads is required/); + refuses({advisors: ADVISORS.map(a => a.id === 'contrarian' ? {...a, reads: 'maths'} : a)}, /advisor contrarian: reads no value mark/); +}); + test('exactly the me advisor is private', () => { refuses({advisors: ADVISORS.map(a => a.id === 'me' ? {...a, private: undefined} : a).map(a => JSON.parse(JSON.stringify(a)))}, /advisor me: must be private/); refuses({advisors: ADVISORS.map(a => a.id === 'maths' ? {...a, private: true} : a)}, /advisor maths: only the me advisor is private/); @@ -154,7 +175,7 @@ test('closed schema, blocked reasons and canonical lines', () => { test('return tickets are grafted or archived honestly', () => { const x = {id: 'X-001', what: 'A trip', why: 'Because', size: 'S', date: '2026-11-24', status: 'out'}; - expect(() => generate(fixture({expeditions: [x]}))).not.toThrow(); + expect(generate(fixture({expeditions: [x]}))[VIEW]).toContain('|X-001 |2026-11-24 |S |A trip |Because |๐ŸŽ’ out'); refuses({expeditions: [{...x, status: 'grafted', graft: 'ghost'}]}, /names the node it became/); refuses({expeditions: [{...x, status: 'archived'}]}, /records what it taught/); refuses({expeditions: [x, {...x}]}, /id is X-NNN and unique/); From 8c129b8f143e55ac97bfb89abbafa38b3c3f7a90 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 12:23:59 +0000 Subject: [PATCH 09/41] ultraplan: checks as rule tables, each rule with a witness Sonar's review of PR 123 found no bug and no vulnerability. It found 115 code smells, all in the generator. Two mattered: - The new registry-row pattern could backtrack in super-linear time (S8786). The link now runs to the first "[", which matches in linear time. Every real registry row still matches. - validate() had a cognitive complexity of 187, against Sonar's limit of 15 (S3776), and renderAdoc() had 73. The checks are now data. A rule is [holds, message], kept in three tables (advisors, nodes, return tickets), and validate() is an orchestrator of small checks. The page is a list of sections, each a list of lines, and the picture is a layout and its parts. eslint-plugin-sonarjs reports no cognitive-complexity or nested-template finding on the new file; it reported 15 on the old one. Behaviour is kept, and this was checked rather than assumed: - Both generated views are byte-identical. - A differential fuzz ran the old and new code on 4000 mutated copies of the real data. 3840 gave identical results. Each of the other 160 had a list field that was not a list, or a "where" that was not a string. The old code crashed on the first, walked a string's characters as if it were a list, and accepted ["estate:o/r"] as a place. The new code refuses each with its message. The rule tables exposed a gap that predates this change: 15 of the 28 rules, and 6 other guards, failed no test when disabled. Each rule now has a witness: a change to the fixture that breaks it and is refused with its message. A test fails if any rule has no witness, so a rule cannot be added untested. Disabling any of the 28 rules, or any of 28 other guards, now fails a test. Tests: 18 pass. check-views, site-check and the I-JSON gate pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- scripts/ultraplan/ultraplan.mjs | 827 +++++++++++++++++------------ tests/ultraplan/ultraplan.test.mjs | 50 +- 2 files changed, 537 insertions(+), 340 deletions(-) diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 860390d0..c8ed6469 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -94,18 +94,34 @@ export function readSource(text, name) { return rows; } +// โ”€โ”€ Rules โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// The checks are data. A rule is [holds, message]: holds(record, env) is true +// when the record keeps the rule, and the message says what it must be. +const list = v => (Array.isArray(v) ? v : []); +// Byte order, the same in every locale, so the views are deterministic. +const cmp = (a, b) => (a < b ? -1 : Number(a > b)); +const oneOf = (name, allowed) => `${name} must be one of ${allowed.join(', ')}`; + function closed(obj, allowed, where) { if (obj === null || typeof obj !== 'object' || Array.isArray(obj)) throw new Error(`${where}: must be an object`); for (const k of Object.keys(obj)) if (!allowed.includes(k)) throw new Error(`${where}: unknown field "${k}"`); } +// Whether a record is an object with only the allowed fields; a failure is recorded. +function isClosed(obj, allowed, where, fail) { + try { closed(obj, allowed, where); return true; } catch (e) { fail(e.message); return false; } +} +function applyRules(rules, rec, env, where, fail) { + for (const [holds, message] of rules) if (!holds(rec, env)) fail(`${where}: ${message}`); +} // โ”€โ”€ Evidence โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // The grade the registry view derives for a claim id, or null when the view // does not list it. The view is generated and checked by registry-check. // A registry row opens with its claim cell (a link whose label is the claim id), // then its kind and its grade. Only the claim cell names the row's claim: an id -// mentioned in another row's statement is not that claim's row. -const ROW = /^\|https:\/\/\S*?\[([^\]]+)\][^|]* \|(?:theorem|demonstration|assumption) \|`(PWG-1|PWG-2ii|PWG-2i|PWG-3|ungraded)` \|/; +// mentioned in another row's statement is not that claim's row. The link runs +// to the first "[", so the pattern matches in linear time. +const ROW = /^\|https:\/\/[^\s[]*\[([^\]]+)\][^|]* \|(?:theorem|demonstration|assumption) \|`(PWG-1|PWG-2ii|PWG-2i|PWG-3|ungraded)` \|/; export function registryGrade(registryText, id) { for (const line of registryText.split('\n')) { const m = ROW.exec(line); @@ -123,160 +139,237 @@ export function adrAccepted(text) { return !!first && /^\**Accepted\b/.test(first.trim()); } -// Check one evidence item against the repository; return an error or null. -export function checkEvidence(ev, ctx) { - closed(ev, ['path', 'claim', 'min_pwg', 'adr'], 'evidence'); - const kinds = ['path', 'claim', 'adr'].filter(k => k in ev); - if (kinds.length !== 1) return 'an evidence item names exactly one of path, claim or adr'; - if (ev.min_pwg !== undefined && ev.claim === undefined) return 'min_pwg belongs to claim evidence only'; - if (ev.path !== undefined) { - if (!isStr(ev.path, 300) || ev.path.startsWith('/') || ev.path.split('/').includes('..')) return `evidence path ${JSON.stringify(ev.path)} is not a repository path`; - return ctx.isFile(ev.path) ? null : `evidence path ${ev.path} is not a file in the repository`; - } - if (ev.claim !== undefined) { +// One check for each kind of evidence; each returns an error or null. +const EVIDENCE = { + path(ev, ctx) { + const p = ev.path; + if (!isStr(p, 300) || p.startsWith('/') || p.split('/').includes('..')) return `evidence path ${JSON.stringify(p)} is not a repository path`; + return ctx.isFile(p) ? null : `evidence path ${p} is not a file in the repository`; + }, + claim(ev, ctx) { if (!isStr(ev.claim) || !/^[\w.-]+\/[\w.-]+#[A-Z]+-[0-9A-Za-z]+$/.test(ev.claim)) return `evidence claim ${JSON.stringify(ev.claim)} is not OWNER/REPO#ID`; const min = ev.min_pwg ?? 'PWG-3'; if (!PWG_ORDER.includes(min) || min === 'ungraded') return `evidence min_pwg ${JSON.stringify(min)} is not a grade`; const got = registryGrade(ctx.registry, ev.claim); if (got === null) return `the registry view does not list ${ev.claim}`; return PWG_ORDER.indexOf(got) >= PWG_ORDER.indexOf(min) ? null : `${ev.claim} derives ${got}, below ${min}`; + }, + adr(ev, ctx) { + if (!isStr(ev.adr) || !/^\d{4}$/.test(ev.adr)) return `evidence adr ${JSON.stringify(ev.adr)} is not a four-digit ADR number`; + const file = ctx.adrFile(ev.adr); + if (!file) return `no ADR ${ev.adr} in docs/decisions`; + return adrAccepted(ctx.read(file)) ? null : `ADR ${ev.adr} is not Accepted`; + }, +}; + +// Check one evidence item against the repository; return an error or null. +export function checkEvidence(ev, ctx) { + closed(ev, ['path', 'claim', 'min_pwg', 'adr'], 'evidence'); + const kinds = Object.keys(EVIDENCE).filter(k => k in ev); + if (kinds.length !== 1) return 'an evidence item names exactly one of path, claim or adr'; + if (ev.min_pwg !== undefined && ev.claim === undefined) return 'min_pwg belongs to claim evidence only'; + return EVIDENCE[kinds[0]](ev, ctx); +} +const evidenceError = (ev, ctx) => { try { return checkEvidence(ev, ctx); } catch (e) { return e.message; } }; + +// โ”€โ”€ Validation: the council โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +const ADVISOR_FIELDS = ['id', 'name', 'glyph', 'asks', 'reads', 'private']; +const ADVISOR_RULES = [ + ...['name', 'glyph', 'asks'].map(k => [a => isStr(a[k]), `${k} is required`]), + [a => a.reads === undefined || VALUE_KEYS.includes(a.reads), oneOf('reads', VALUE_KEYS)], + [a => a.private === undefined || a.private === true, 'private is true or absent'], + // Exactly the me advisor is private: its ranking and the page's privacy claim depend on it. + [a => a.id !== 'me' || a.private === true, 'must be private ("private":true)'], + [a => a.id === 'me' || a.private === undefined, 'only the me advisor is private'], + // The contrarian and the me advisor have their own ranking; every other advisor ranks by one mark. + [a => !SPECIAL_ADVISORS.includes(a.id) || a.reads === undefined, 'reads no value mark (it has its own ranking)'], + [a => SPECIAL_ADVISORS.includes(a.id) || a.reads !== undefined, 'reads is required (the value mark it ranks by)'], +]; + +function checkAdvisors(advisors, fail) { + const ids = new Set(); + for (const a of advisors) { + if (!isClosed(a, ADVISOR_FIELDS, `advisor ${a?.id}`, fail)) continue; + if (!isStr(a.id, 40) || !SLUG.test(a.id) || ids.has(a.id)) fail(`advisor id ${JSON.stringify(a.id)} is missing, not a slug, or repeated`); + ids.add(a.id); + applyRules(ADVISOR_RULES, a, null, `advisor ${a.id}`, fail); } - if (!isStr(ev.adr) || !/^\d{4}$/.test(ev.adr)) return `evidence adr ${JSON.stringify(ev.adr)} is not a four-digit ADR number`; - const file = ctx.adrFile(ev.adr); - if (!file) return `no ADR ${ev.adr} in docs/decisions`; - return adrAccepted(ctx.read(file)) ? null : `ADR ${ev.adr} is not Accepted`; + if (!ids.has('me')) fail('advisors: the me advisor is required ("id":"me","private":true)'); + return ids; } -// โ”€โ”€ Validation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ -export function validate({advisors, nodes, expeditions}, ctx) { - const errors = []; - const fail = m => errors.push(m); +// โ”€โ”€ Validation: the nodes โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +const NODE_FIELDS = ['id', 'name', 'glyph', 'track', 'kind', 'status', 'size', 'summary', 'needs', 'rivals', 'value', + 'counsel', 'evidence', 'blocked_by', 'where', 'owner_value', 'refs']; +const NODE_RULES = [ + [n => isStr(n.name, 80), 'name is required (at most 80 characters)'], + [n => isStr(n.glyph, 16), 'glyph is required'], + [n => TRACKS.includes(n.track), oneOf('track', TRACKS)], + [n => KINDS.includes(n.kind), oneOf('kind', KINDS)], + [n => STATUSES.includes(n.status), oneOf('status', STATUSES)], + [n => isSize(n.size), oneOf('size', Object.keys(SIZES))], + [n => isStr(n.summary, 600), 'summary is required (at most 600 characters)'], + ...['needs', 'rivals', 'evidence', 'refs'].map(k => [n => n[k] === undefined || Array.isArray(n[k]), `${k} must be a list`]), + [n => n.where === undefined || (typeof n.where === 'string' && /^(estate|upstream):[\w.-]+\/[\w.-]+$/.test(n.where)), + 'where is estate:OWNER/REPO or upstream:OWNER/REPO, or absent for this repository'], + [n => n.owner_value === undefined || n.owner_value === 'high', 'owner_value is "high" or absent'], + [n => n.status !== 'blocked' || isStr(n.blocked_by), 'a blocked node says what blocks it (blocked_by)'], + [n => n.status === 'blocked' || n.blocked_by === undefined, 'blocked_by belongs to a blocked node only'], + [n => list(n.refs).every(r => isStr(r, 300)), 'each ref is a short text'], +]; - const advisorIds = new Set(); - for (const a of advisors) { - try { closed(a, ['id', 'name', 'glyph', 'asks', 'reads', 'private'], `advisor ${a?.id}`); } catch (e) { fail(e.message); continue; } - if (!isStr(a.id, 40) || !SLUG.test(a.id) || advisorIds.has(a.id)) fail(`advisor id ${JSON.stringify(a.id)} is missing, not a slug, or repeated`); - advisorIds.add(a.id); - for (const k of ['name', 'glyph', 'asks']) if (!isStr(a[k])) fail(`advisor ${a.id}: ${k} is required`); - if (a.reads !== undefined && !VALUE_KEYS.includes(a.reads)) fail(`advisor ${a.id}: reads must be one of ${VALUE_KEYS.join(', ')}`); - if (a.private !== undefined && a.private !== true) fail(`advisor ${a.id}: private is true or absent`); - // Exactly the me advisor is private: its ranking and the page's privacy claim depend on it. - if (a.id === 'me' && a.private !== true) fail('advisor me: must be private ("private":true)'); - if (a.id !== 'me' && a.private !== undefined) fail(`advisor ${a.id}: only the me advisor is private`); - // The contrarian and the me advisor have their own ranking; every other advisor ranks by one mark. - if (SPECIAL_ADVISORS.includes(a.id) && a.reads !== undefined) fail(`advisor ${a.id}: reads no value mark (it has its own ranking)`); - if (!SPECIAL_ADVISORS.includes(a.id) && a.reads === undefined) fail(`advisor ${a.id}: reads is required (the value mark it ranks by)`); +function checkValue(n, where, fail) { + if (n.value === undefined) return; + isClosed(n.value, VALUE_KEYS, `${where} value`, fail); + for (const [k, v] of Object.entries(n.value ?? {})) if (!Number.isInteger(v) || v < 0 || v > 3) fail(`${where}: value.${k} must be 0, 1, 2 or 3`); +} + +function checkCounsel(n, advisorIds, where, fail) { + if (n.counsel === undefined) return; + if (n.counsel === null || typeof n.counsel !== 'object' || Array.isArray(n.counsel)) { fail(`${where}: counsel must be an object`); return; } + for (const [k, v] of Object.entries(n.counsel)) { + if (k === 'me') fail(`${where}: counsel.me is refused; the me advisor's notes stay outside the public repository`); + else if (!advisorIds.has(k)) fail(`${where}: counsel from unknown advisor ${k}`); + if (!isStr(v, 300)) fail(`${where}: counsel.${k} must be a short text`); } - if (!advisorIds.has('me')) fail('advisors: the me advisor is required ("id":"me","private":true)'); +} +function checkNodes(nodes, advisorIds, fail) { const byId = new Map(); for (const n of nodes) { const where = `node ${n?.id}`; - try { - closed(n, ['id', 'name', 'glyph', 'track', 'kind', 'status', 'size', 'summary', 'needs', 'rivals', 'value', - 'counsel', 'evidence', 'blocked_by', 'where', 'owner_value', 'refs'], where); - } catch (e) { fail(e.message); continue; } + if (!isClosed(n, NODE_FIELDS, where, fail)) continue; if (!isStr(n.id, 60) || !SLUG.test(n.id)) { fail(`${where}: id must be a lowercase slug`); continue; } if (byId.has(n.id)) { fail(`${where}: repeated id`); continue; } byId.set(n.id, n); - if (!isStr(n.name, 80)) fail(`${where}: name is required (at most 80 characters)`); - if (!isStr(n.glyph, 16)) fail(`${where}: glyph is required`); - if (!TRACKS.includes(n.track)) fail(`${where}: track must be one of ${TRACKS.join(', ')}`); - if (!KINDS.includes(n.kind)) fail(`${where}: kind must be one of ${KINDS.join(', ')}`); - if (!STATUSES.includes(n.status)) fail(`${where}: status must be one of ${STATUSES.join(', ')}`); - if (!isSize(n.size)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); - if (!isStr(n.summary, 600)) fail(`${where}: summary is required (at most 600 characters)`); - for (const k of ['needs', 'rivals', 'evidence', 'refs']) if (n[k] !== undefined && !Array.isArray(n[k])) fail(`${where}: ${k} must be a list`); - if (n.value !== undefined) { - try { closed(n.value, VALUE_KEYS, `${where} value`); } catch (e) { fail(e.message); } - for (const [k, v] of Object.entries(n.value ?? {})) if (!Number.isInteger(v) || v < 0 || v > 3) fail(`${where}: value.${k} must be 0, 1, 2 or 3`); - } - if (n.counsel !== undefined) { - if (n.counsel === null || typeof n.counsel !== 'object' || Array.isArray(n.counsel)) fail(`${where}: counsel must be an object`); - else for (const [k, v] of Object.entries(n.counsel)) { - if (k === 'me') fail(`${where}: counsel.me is refused; the me advisor's notes stay outside the public repository`); - else if (!advisorIds.has(k)) fail(`${where}: counsel from unknown advisor ${k}`); - if (!isStr(v, 300)) fail(`${where}: counsel.${k} must be a short text`); - } - } - if (n.where !== undefined && !/^(estate|upstream):[\w.-]+\/[\w.-]+$/.test(n.where)) fail(`${where}: where is estate:OWNER/REPO or upstream:OWNER/REPO, or absent for this repository`); - if (n.owner_value !== undefined && n.owner_value !== 'high') fail(`${where}: owner_value is "high" or absent`); - if (n.status === 'blocked' && !isStr(n.blocked_by)) fail(`${where}: a blocked node says what blocks it (blocked_by)`); - if (n.status !== 'blocked' && n.blocked_by !== undefined) fail(`${where}: blocked_by belongs to a blocked node only`); - for (const r of n.refs ?? []) if (!isStr(r, 300)) fail(`${where}: each ref is a short text`); + applyRules(NODE_RULES, n, null, where, fail); + checkValue(n, where, fail); + checkCounsel(n, advisorIds, where, fail); } + return byId; +} + +// โ”€โ”€ Validation: the edges โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// needs and rivals name known nodes, never the node itself, and each at most once. +function checkNames(n, k, byId, fail) { + const seen = new Set(); + for (const t of list(n[k])) { + if (!byId.has(t)) fail(`node ${n.id}: ${k} names unknown node ${t}`); + if (t === n.id) fail(`node ${n.id}: ${k} names itself`); + if (seen.has(t)) fail(`node ${n.id}: ${k} names ${t} twice`); + seen.add(t); + } +} + +function checkLinks(n, byId, fail) { + checkNames(n, 'needs', byId, fail); + checkNames(n, 'rivals', byId, fail); + for (const r of list(n.rivals)) if (byId.has(r) && !list(byId.get(r).rivals).includes(n.id)) fail(`node ${n.id}: rival ${r} does not name ${n.id} back`); +} - for (const n of byId.values()) { - const where = `node ${n.id}`; - for (const k of ['needs', 'rivals']) { - const seen = new Set(); - for (const t of n[k] ?? []) { - if (!byId.has(t)) fail(`${where}: ${k} names unknown node ${t}`); - if (t === n.id) fail(`${where}: ${k} names itself`); - if (seen.has(t)) fail(`${where}: ${k} names ${t} twice`); - seen.add(t); - } - } - for (const r of n.rivals ?? []) if (byId.has(r) && !(byId.get(r).rivals ?? []).includes(n.id)) fail(`${where}: rival ${r} does not name ${n.id} back`); - if (n.status === 'done' && !(n.evidence ?? []).length) fail(`${where}: done needs evidence (a path, a claim grade or an accepted ADR)`); - if (n.status === 'done' || n.status === 'active') { - // Evidence an active node shows must hold as much as a done node's. - for (const ev of n.evidence ?? []) { - let e; - try { e = checkEvidence(ev, ctx); } catch (x) { e = x.message; } - if (e) fail(`${where}: ${e}`); - } - } else if (n.evidence !== undefined) { - fail(`${where}: evidence belongs to a done or active node`); - } - // A node is started only from the frontier, so an active node's needs are done too. - if (n.status === 'done' || n.status === 'active') for (const t of n.needs ?? []) if (byId.get(t)?.status !== 'done') fail(`${where}: ${n.status}, but its need ${t} is not done`); +// What a node's status asks of it: a done node shows evidence, a started +// node's evidence holds, and only a started node carries evidence. +function checkStarted(n, byId, ctx, fail) { + const where = `node ${n.id}`; + if (n.status === 'done' && !list(n.evidence).length) fail(`${where}: done needs evidence (a path, a claim grade or an accepted ADR)`); + if (n.status !== 'done' && n.status !== 'active') { + if (n.evidence !== undefined) fail(`${where}: evidence belongs to a done or active node`); + return; + } + // Evidence an active node shows must hold as much as a done node's. + for (const ev of list(n.evidence)) { + const e = evidenceError(ev, ctx); + if (e) fail(`${where}: ${e}`); } + // A node is started only from the frontier, so an active node's needs are done too. + for (const t of list(n.needs)) if (byId.get(t)?.status !== 'done') fail(`${where}: ${n.status}, but its need ${t} is not done`); +} - // The needs form a DAG. +// The needs form a DAG. +function checkAcyclic(byId, fail) { const state = new Map(); const visit = (id, trail) => { if (state.get(id) === 2) return; if (state.get(id) === 1) { fail(`the needs form a cycle: ${[...trail, id].join(' -> ')}`); return; } state.set(id, 1); - for (const t of byId.get(id)?.needs ?? []) if (byId.has(t)) visit(t, [...trail, id]); + for (const t of list(byId.get(id)?.needs)) if (byId.has(t)) visit(t, [...trail, id]); state.set(id, 2); }; for (const id of byId.keys()) visit(id, []); +} +function checkActiveLimit(byId, fail) { const active = [...byId.values()].filter(n => n.status === 'active'); if (active.length > ACTIVE_LIMIT) fail(`${active.length} nodes are active (${active.map(n => n.id).join(', ')}); at most ${ACTIVE_LIMIT} may be, so finish or park one first`); +} + +// โ”€โ”€ Validation: the return tickets โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +const EXPEDITION_FIELDS = ['id', 'what', 'why', 'size', 'date', 'status', 'graft', 'lesson']; +const EXPEDITION_RULES = [ + ...['what', 'why'].map(k => [x => isStr(x[k]), `${k} is required`]), + [x => isSize(x.size), oneOf('size', Object.keys(SIZES))], + [x => isDate(x.date), 'date is a real calendar date, YYYY-MM-DD'], + [x => ['out', 'grafted', 'archived'].includes(x.status), 'status is out, grafted or archived'], + [(x, byId) => x.status !== 'grafted' || byId.has(x.graft), 'a grafted expedition names the node it became (graft)'], + [x => x.status === 'grafted' || x.graft === undefined, 'graft belongs to a grafted expedition'], + [x => x.status !== 'archived' || isStr(x.lesson), 'an archived expedition records what it taught (lesson)'], + [x => x.status === 'archived' || x.lesson === undefined, 'lesson belongs to an archived expedition'], +]; - const exIds = new Set(); +// The rule tables, exported so the tests can show that every rule has a witness. +export const RULES = {advisor: ADVISOR_RULES, node: NODE_RULES, expedition: EXPEDITION_RULES}; + +function checkExpeditions(expeditions, byId, fail) { + const ids = new Set(); for (const x of expeditions) { const where = `expedition ${x?.id}`; - try { closed(x, ['id', 'what', 'why', 'size', 'date', 'status', 'graft', 'lesson'], where); } catch (e) { fail(e.message); continue; } - if (!isStr(x.id, 20) || !/^X-\d{3}$/.test(x.id) || exIds.has(x.id)) fail(`${where}: id is X-NNN and unique`); - exIds.add(x.id); - for (const k of ['what', 'why']) if (!isStr(x[k])) fail(`${where}: ${k} is required`); - if (!isSize(x.size)) fail(`${where}: size must be one of ${Object.keys(SIZES).join(', ')}`); - if (!isDate(x.date)) fail(`${where}: date is a real calendar date, YYYY-MM-DD`); - if (!['out', 'grafted', 'archived'].includes(x.status)) fail(`${where}: status is out, grafted or archived`); - if (x.status === 'grafted' && !byId.has(x.graft)) fail(`${where}: a grafted expedition names the node it became (graft)`); - if (x.status !== 'grafted' && x.graft !== undefined) fail(`${where}: graft belongs to a grafted expedition`); - if (x.status === 'archived' && !isStr(x.lesson)) fail(`${where}: an archived expedition records what it taught (lesson)`); - if (x.status !== 'archived' && x.lesson !== undefined) fail(`${where}: lesson belongs to an archived expedition`); + if (!isClosed(x, EXPEDITION_FIELDS, where, fail)) continue; + if (!isStr(x.id, 20) || !/^X-\d{3}$/.test(x.id) || ids.has(x.id)) fail(`${where}: id is X-NNN and unique`); + ids.add(x.id); + applyRules(EXPEDITION_RULES, x, byId, where, fail); } +} +// โ”€โ”€ Validation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// Every failure is collected, so one run reports them all. +export function validate({advisors, nodes, expeditions}, ctx) { + const errors = []; + const fail = m => errors.push(m); + const advisorIds = checkAdvisors(advisors, fail); + const byId = checkNodes(nodes, advisorIds, fail); + for (const n of byId.values()) { checkLinks(n, byId, fail); checkStarted(n, byId, ctx, fail); } + checkAcyclic(byId, fail); + checkActiveLimit(byId, fail); + checkExpeditions(expeditions, byId, fail); if (errors.length) throw new Error(errors.join('\n')); return byId; } // โ”€โ”€ Derivation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// Each advisor's pick from the frontier. An advisor that reads a value key +// ranks the nodes it marks above zero by that mark, then by leverage, then by +// value for effort; the contrarian takes the frontier node the council rates +// lowest that still unlocks the most; the me advisor names only nodes tagged +// owner_value, with no notes. +function pickFor(a, frontier, total, leverage) { + const first = (pool, order) => [...pool].sort(order)[0] ?? null; + const byKey = k => (x, y) => (y.value?.[k] ?? 0) - (x.value?.[k] ?? 0) || leverage(y.id) - leverage(x.id) + || total(y) / SIZES[y.size] - total(x) / SIZES[x.size] || cmp(x.id, y.id); + if (a.id === 'contrarian') return first(frontier, (x, y) => total(x) - total(y) || leverage(y.id) - leverage(x.id) || cmp(x.id, y.id)); + if (a.private) return first(frontier.filter(n => n.owner_value === 'high'), byKey('maths')); + if (a.reads) return first(frontier.filter(n => (n.value?.[a.reads] ?? 0) > 0), byKey(a.reads)); + return null; +} + export function derive(byId, advisors) { const children = new Map([...byId.keys()].map(id => [id, []])); - for (const n of byId.values()) for (const t of n.needs ?? []) children.get(t).push(n.id); - for (const c of children.values()) c.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0)); + for (const n of byId.values()) for (const t of list(n.needs)) children.get(t).push(n.id); + for (const c of children.values()) c.sort(cmp); const depth = new Map(); const depthOf = id => { if (depth.has(id)) return depth.get(id); - const ns = byId.get(id).needs ?? []; + const ns = list(byId.get(id).needs); const d = ns.length ? 1 + Math.max(...ns.map(depthOf)) : 0; depth.set(id, d); return d; @@ -292,274 +385,330 @@ export function derive(byId, advisors) { for (const id of byId.keys()) { depthOf(id); belowOf(id); } const live = n => n.status !== 'dropped'; - const frontier = [...byId.values()].filter(n => n.status === 'open' && (n.needs ?? []).every(t => byId.get(t).status === 'done')); + const nodes = [...byId.values()]; + const frontier = nodes.filter(n => n.status === 'open' && list(n.needs).every(t => byId.get(t).status === 'done')); const total = n => Object.values(n.value ?? {}).reduce((a, b) => a + b, 0); const leverage = id => [...below.get(id)].filter(x => live(byId.get(x))).length; + const tracksOf = ids => new Set(ids.map(t => byId.get(t)).filter(live).map(t => t.track)); + const byNodeId = (a, b) => cmp(a.id, b.id); - const forks = [...byId.values()].filter(n => live(n) && new Set(children.get(n.id).map(c => byId.get(c)).filter(live).map(c => c.track)).size >= 2); - const confluences = [...byId.values()].filter(n => live(n) && new Set((n.needs ?? []).map(t => byId.get(t).track)).size >= 2); + const forks = nodes.filter(n => live(n) && tracksOf(children.get(n.id)).size >= 2).sort(byNodeId); + const confluences = nodes.filter(n => live(n) && new Set(list(n.needs).map(t => byId.get(t).track)).size >= 2).sort(byNodeId); const rivalries = []; - for (const n of byId.values()) for (const r of n.rivals ?? []) if (n.id < r) rivalries.push([n.id, r]); - - // Each advisor's pick from the frontier. An advisor that reads a value key - // ranks by it, then by leverage, then by value for effort; the contrarian - // takes the frontier node the council rates lowest that still unlocks the - // most; the me advisor names only nodes tagged owner_value, with no notes. - const byKey = (k) => (a, b) => (b.value?.[k] ?? 0) - (a.value?.[k] ?? 0) || leverage(b.id) - leverage(a.id) - || total(b) / SIZES[b.size] - total(a) / SIZES[a.size] || (a.id < b.id ? -1 : 1); - const picks = new Map(); - for (const a of advisors) { - let pick = null; - if (a.id === 'contrarian') { - pick = [...frontier].sort((x, y) => total(x) - total(y) || leverage(y.id) - leverage(x.id) || (x.id < y.id ? -1 : 1))[0] ?? null; - } else if (a.private) { - pick = [...frontier].filter(n => n.owner_value === 'high').sort(byKey('maths'))[0] ?? null; - } else if (a.reads) { - pick = [...frontier].filter(n => (n.value?.[a.reads] ?? 0) > 0).sort(byKey(a.reads))[0] ?? null; - } - picks.set(a.id, pick); - } + for (const n of nodes) for (const r of list(n.rivals)) if (n.id < r) rivalries.push([n.id, r]); + + const picks = new Map(advisors.map(a => [a.id, pickFor(a, frontier, total, leverage)])); return {children, depth, below, frontier, forks, confluences, rivalries, picks, leverage, total}; } // โ”€โ”€ Rendering: AsciiDoc โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ -const cell = s => String(s).replace(/\|/g, '\\|'); +// The page is a list of sections; each section is a list of lines. +const cell = s => String(s).replaceAll('|', String.raw`\|`); const nameOf = (byId, id) => `${byId.get(id).glyph} ${byId.get(id).name}`; const xref = (byId, id) => `<<${id},${cell(nameOf(byId, id))}>>`; +const xrefs = (byId, ids, sep = ', ') => ids.map(t => xref(byId, t)).join(sep); +const orNone = (items, none) => (items.length ? items : [none]); +const trackKey = t => `${TRACK_GLYPH[t]} ${t}`; -export function renderAdoc(byId, advisors, expeditions, d) { - const L = []; +function introLines(byId, d) { const nodes = [...byId.values()]; const count = s => nodes.filter(n => n.status === s).length; - L.push('// SPDX-License-Identifier: CC-BY-SA-4.0'); - L.push('// GENERATED by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl,'); - L.push('// docs/ultraplan/advisors.jsonl and docs/ultraplan/expeditions.jsonl; do not hand-edit.'); - L.push('= Mathesis ultraplan: the tech tree'); - L.push(':toc: macro'); - L.push(':toclevels: 1'); - L.push(''); - L.push('Each node is a capability. Its needs are the nodes it is built on, so the tree reads'); - L.push('like a civilisation game: one discovery enables the next. The data in'); - L.push('`docs/ultraplan/` is the source; this page and its picture are generated from it.'); - L.push('The era, the frontier, the forks, the confluences and each advisor\'s pick are derived,'); - L.push('never typed. A node marked done carries evidence the generator checks: a file, a'); - L.push('claim grade that the registry derives, or an accepted decision record. The value marks'); - L.push('are judgements, written down so they can be argued with.'); - L.push(''); - L.push(`Census of the tree: ${count('done')} done, ${count('active')} active (at most ${ACTIVE_LIMIT}), ${count('open')} open, ${count('blocked')} blocked, ${count('dropped')} dropped, of ${nodes.length} nodes. ${d.frontier.length} can be started now.`); - L.push(''); - L.push('toc::[]'); - L.push(''); - L.push('image::tree.svg[The tech tree of Mathesis, from the first era on the left to the frontier on the right]'); - L.push(''); - L.push('Key: โœ… done ยท ๐Ÿ”จ active ยท ๐ŸŒฑ open ยท โ›” blocked ยท ๐Ÿ‚ dropped. A gold border marks a node'); - L.push('that can be started now. Colours are tracks: ' + TRACKS.map(t => `${TRACK_GLYPH[t]} ${t}`).join(' ยท ') + '.'); - L.push(''); - - L.push('== Research now: the frontier'); - L.push(''); - L.push('These open nodes have every need done, so any of them can start today. "Unlocks"'); - L.push('counts the live nodes that depend on it, directly or through others.'); - L.push(''); - if (!d.frontier.length) L.push('Nothing is on the frontier.'); - else { - L.push('[cols="3,1,1,1,5",options="header"]'); - L.push('|==='); - L.push('|Node |Track |Size |Unlocks |Summary'); - for (const n of [...d.frontier].sort((a, b) => d.leverage(b.id) - d.leverage(a.id) || (a.id < b.id ? -1 : 1))) { - L.push(`|${xref(byId, n.id)} |${n.track} |${n.size} |${d.leverage(n.id)} |${cell(n.summary)}${n.where ? ` _(${cell(n.where)})_` : ''}`); - } - L.push('|==='); - } - L.push(''); - - L.push('== The council'); - L.push(''); - L.push('Each advisor asks one question of every node and names one pick from the frontier.'); - L.push('The me advisor is private: its notes stay outside this repository, and it names only'); - L.push('nodes the owner has tagged.'); - L.push(''); - for (const a of advisors) { - const p = d.picks.get(a.id); - L.push(`=== ${a.glyph} ${a.name}`); - L.push(''); - L.push(`_Asks:_ ${a.asks}`); - L.push(''); - if (!p) L.push('_Pick:_ nothing on the frontier answers this advisor yet.'); - else { - const note = p.counsel?.[a.id]; - L.push(`_Pick:_ ${xref(byId, p.id)}${note ? `. ${note}` : '.'}`); - } - L.push(''); - } + return [ + '// SPDX-License-Identifier: CC-BY-SA-4.0', + '// GENERATED by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl,', + '// docs/ultraplan/advisors.jsonl and docs/ultraplan/expeditions.jsonl; do not hand-edit.', + '= Mathesis ultraplan: the tech tree', + ':toc: macro', + ':toclevels: 1', + '', + 'Each node is a capability. Its needs are the nodes it is built on, so the tree reads', + 'like a civilisation game: one discovery enables the next. The data in', + '`docs/ultraplan/` is the source; this page and its picture are generated from it.', + 'The era, the frontier, the forks, the confluences and each advisor\'s pick are derived,', + 'never typed. A node marked done carries evidence the generator checks: a file, a', + 'claim grade that the registry derives, or an accepted decision record. The value marks', + 'are judgements, written down so they can be argued with.', + '', + `Census of the tree: ${count('done')} done, ${count('active')} active (at most ${ACTIVE_LIMIT}), ${count('open')} open, ${count('blocked')} blocked, ${count('dropped')} dropped, of ${nodes.length} nodes. ${d.frontier.length} can be started now.`, + '', + 'toc::[]', + '', + 'image::tree.svg[The tech tree of Mathesis, from the first era on the left to the frontier on the right]', + '', + 'Key: โœ… done ยท ๐Ÿ”จ active ยท ๐ŸŒฑ open ยท โ›” blocked ยท ๐Ÿ‚ dropped. A gold border marks a node', + `that can be started now. Colours are tracks: ${TRACKS.map(trackKey).join(' ยท ')}.`, + '', + ]; +} - L.push('== Forks and confluences'); - L.push(''); - L.push('A fork enables nodes on two or more tracks: work there spreads. A confluence needs'); - L.push('nodes from two or more tracks: work there joins. Rivals are different routes to the'); - L.push('same place; the contrarian keeps the road not taken in view.'); - L.push(''); - L.push('.Forks'); - for (const n of d.forks.sort((a, b) => (a.id < b.id ? -1 : 1))) { - L.push(`* ${xref(byId, n.id)} -> ${d.children.get(n.id).map(c => xref(byId, c)).join(', ')}`); - } - if (!d.forks.length) L.push('* None yet.'); - L.push(''); - L.push('.Confluences'); - for (const n of d.confluences.sort((a, b) => (a.id < b.id ? -1 : 1))) { - L.push(`* ${(n.needs ?? []).map(t => xref(byId, t)).join(' + ')} -> ${xref(byId, n.id)}`); - } - if (!d.confluences.length) L.push('* None yet.'); - L.push(''); - L.push('.Rivals'); - for (const [a, b] of d.rivalries) L.push(`* ${xref(byId, a)} or ${xref(byId, b)}`); - if (!d.rivalries.length) L.push('* None yet.'); - L.push(''); - - L.push('== The eras'); - L.push(''); - const maxDepth = Math.max(0, ...[...d.depth.values()]); +const beyondNote = n => (n.where ? ` _(${cell(n.where)})_` : ''); +function frontierLines(byId, d) { + const head = [ + '== Research now: the frontier', + '', + 'These open nodes have every need done, so any of them can start today. "Unlocks"', + 'counts the live nodes that depend on it, directly or through others.', + '', + ]; + if (!d.frontier.length) return [...head, 'Nothing is on the frontier.', '']; + const rows = [...d.frontier].sort((a, b) => d.leverage(b.id) - d.leverage(a.id) || cmp(a.id, b.id)); + return [ + ...head, + '[cols="3,1,1,1,5",options="header"]', + '|===', + '|Node |Track |Size |Unlocks |Summary', + ...rows.map(n => `|${xref(byId, n.id)} |${n.track} |${n.size} |${d.leverage(n.id)} |${cell(n.summary)}${beyondNote(n)}`), + '|===', + '', + ]; +} + +function pickLine(byId, a, p) { + if (!p) return '_Pick:_ nothing on the frontier answers this advisor yet.'; + const note = p.counsel?.[a.id]; + return `_Pick:_ ${xref(byId, p.id)}${note ? '. ' + note : '.'}`; +} +function councilLines(byId, advisors, d) { + return [ + '== The council', + '', + 'Each advisor asks one question of every node and names one pick from the frontier.', + 'The me advisor is private: its notes stay outside this repository, and it names only', + 'nodes the owner has tagged.', + '', + ...advisors.flatMap(a => [`=== ${a.glyph} ${a.name}`, '', `_Asks:_ ${a.asks}`, '', pickLine(byId, a, d.picks.get(a.id)), '']), + ]; +} + +function forkLines(byId, d) { + return [ + '== Forks and confluences', + '', + 'A fork enables nodes on two or more tracks: work there spreads. A confluence needs', + 'nodes from two or more tracks: work there joins. Rivals are different routes to the', + 'same place; the contrarian keeps the road not taken in view.', + '', + '.Forks', + ...orNone(d.forks.map(n => `* ${xref(byId, n.id)} -> ${xrefs(byId, d.children.get(n.id))}`), '* None yet.'), + '', + '.Confluences', + ...orNone(d.confluences.map(n => `* ${xrefs(byId, list(n.needs), ' + ')} -> ${xref(byId, n.id)}`), '* None yet.'), + '', + '.Rivals', + ...orNone(d.rivalries.map(([a, b]) => `* ${xref(byId, a)} or ${xref(byId, b)}`), '* None yet.'), + '', + ]; +} + +function evidenceText(ev) { + if (ev.path) return `\`${ev.path}\``; + if (ev.claim) return `${ev.claim} at ${ev.min_pwg ?? 'PWG-3'} or above`; + return `ADR ${ev.adr} accepted`; +} +const marks = value => VALUE_KEYS.filter(k => value[k]).map(k => `${k} ${'โ—'.repeat(value[k])}`).join(', '); + +function nodeLines(byId, advisors, d, n) { + const facts = [`*Track:* ${trackKey(n.track)}`, `*Kind:* ${n.kind}`, `*Size:* ${n.size}`, `*Status:* ${n.status}`]; + if (n.where) facts.push(`*Beyond this repository:* ${n.where}`); + const enables = d.children.get(n.id); + // Each fact the node has, one a line, joined by hard line breaks. + const details = [ + [list(n.needs).length, () => `*Needs:* ${xrefs(byId, n.needs)}`], + [enables.length, () => `*Enables:* ${xrefs(byId, enables)}`], + [list(n.rivals).length, () => `*Rivals:* ${xrefs(byId, n.rivals)}`], + [n.status === 'blocked', () => `*Blocked by:* ${n.blocked_by}`], + [list(n.evidence).length, () => `*Evidence:* ${n.evidence.map(evidenceText).join('; ')}`], + [n.value && Object.keys(n.value).length, () => `*Value (judgement):* ${marks(n.value)}`], + [list(n.refs).length, () => `*See:* ${n.refs.join('; ')}`], + ].filter(([has]) => has).map(([, text]) => text()); + const counsel = Object.entries(n.counsel ?? {}).map(([id, text]) => { + const adv = advisors.find(x => x.id === id); + return `* ${adv.glyph} _${adv.name}:_ ${text}`; + }); + return [ + `[[${n.id}]]`, + `==== ${STATUS_GLYPH[n.status]} ${n.glyph} ${n.name}`, + '', + n.summary, + '', + facts.join(' ยท '), + '', + ...details.map((line, i) => (i < details.length - 1 ? `${line} +` : line)), + '', + ...(counsel.length ? [...counsel, ''] : []), + ]; +} + +function eraLines(byId, advisors, d) { + const nodes = [...byId.values()]; + const maxDepth = Math.max(0, ...d.depth.values()); + const L = ['== The eras', '']; for (let k = 0; k <= maxDepth; k++) { - const [g, name] = era(k); - const inEra = nodes.filter(n => d.depth.get(n.id) === k).sort((a, b) => TRACKS.indexOf(a.track) - TRACKS.indexOf(b.track) || (a.id < b.id ? -1 : 1)); + const inEra = nodes.filter(n => d.depth.get(n.id) === k).sort((a, b) => TRACKS.indexOf(a.track) - TRACKS.indexOf(b.track) || cmp(a.id, b.id)); if (!inEra.length) continue; - L.push(`=== ${g} Era ${k}: ${name}`); - L.push(''); - for (const n of inEra) { - L.push(`[[${n.id}]]`); - L.push(`==== ${STATUS_GLYPH[n.status]} ${n.glyph} ${n.name}`); - L.push(''); - L.push(n.summary); - L.push(''); - const facts = [`*Track:* ${TRACK_GLYPH[n.track]} ${n.track}`, `*Kind:* ${n.kind}`, `*Size:* ${n.size}`, `*Status:* ${n.status}`]; - if (n.where) facts.push(`*Beyond this repository:* ${n.where}`); - L.push(facts.join(' ยท ')); - L.push(''); - if ((n.needs ?? []).length) L.push(`*Needs:* ${n.needs.map(t => xref(byId, t)).join(', ')}` + ' +'); - if (d.children.get(n.id).length) L.push(`*Enables:* ${d.children.get(n.id).map(c => xref(byId, c)).join(', ')}` + ' +'); - if ((n.rivals ?? []).length) L.push(`*Rivals:* ${n.rivals.map(t => xref(byId, t)).join(', ')}` + ' +'); - if (n.status === 'blocked') L.push(`*Blocked by:* ${n.blocked_by}` + ' +'); - if ((n.evidence ?? []).length) L.push(`*Evidence:* ${n.evidence.map(ev => ev.path ? `\`${ev.path}\`` : ev.claim ? `${ev.claim} at ${ev.min_pwg ?? 'PWG-3'} or above` : `ADR ${ev.adr} accepted`).join('; ')}` + ' +'); - if (n.value && Object.keys(n.value).length) L.push(`*Value (judgement):* ${VALUE_KEYS.filter(k => n.value[k]).map(k => `${k} ${'โ—'.repeat(n.value[k])}`).join(', ')}` + ' +'); - if ((n.refs ?? []).length) L.push(`*See:* ${n.refs.join('; ')}` + ' +'); - if (L[L.length - 1].endsWith(' +')) L[L.length - 1] = L[L.length - 1].slice(0, -2); - L.push(''); - const counsel = Object.entries(n.counsel ?? {}); - if (counsel.length) { - for (const [a, text] of counsel) { - const adv = advisors.find(x => x.id === a); - L.push(`* ${adv.glyph} _${adv.name}:_ ${text}`); - } - L.push(''); - } - } + const [g, name] = era(k); + L.push(`=== ${g} Era ${k}: ${name}`, '', ...inEra.flatMap(n => nodeLines(byId, advisors, d, n))); } + return L; +} - L.push('== Return tickets'); - L.push(''); - L.push('Wandering off the tree is allowed. Each trip gets a card: what, why, and how big.'); - L.push('On return it is grafted onto the tree as a node, or archived with what it taught.'); - L.push(''); - if (!expeditions.length) L.push('No trip is out.'); - else { - L.push('[cols="1,1,1,3,3,3",options="header"]'); - L.push('|==='); - L.push('|Card |Date |Size |What |Why |Outcome'); - for (const x of expeditions) { - const out = x.status === 'out' ? '๐ŸŽ’ out' : x.status === 'grafted' ? `๐ŸŒฟ grafted as ${xref(byId, x.graft)}` : `๐Ÿ“ฆ archived: ${cell(x.lesson)}`; - L.push(`|${x.id} |${x.date} |${x.size} |${cell(x.what)} |${cell(x.why)} |${out}`); - } - L.push('|==='); - } - L.push(''); +function outcomeText(byId, x) { + if (x.status === 'out') return '๐ŸŽ’ out'; + if (x.status === 'grafted') return `๐ŸŒฟ grafted as ${xref(byId, x.graft)}`; + return `๐Ÿ“ฆ archived: ${cell(x.lesson)}`; +} +function ticketLines(byId, expeditions) { + const head = [ + '== Return tickets', + '', + 'Wandering off the tree is allowed. Each trip gets a card: what, why, and how big.', + 'On return it is grafted onto the tree as a node, or archived with what it taught.', + '', + ]; + if (!expeditions.length) return [...head, 'No trip is out.', '']; + return [ + ...head, + '[cols="1,1,1,3,3,3",options="header"]', + '|===', + '|Card |Date |Size |What |Why |Outcome', + ...expeditions.map(x => `|${x.id} |${x.date} |${x.size} |${cell(x.what)} |${cell(x.why)} |${outcomeText(byId, x)}`), + '|===', + '', + ]; +} + +function beyondLines(byId) { + const beyond = [...byId.values()].filter(n => n.where).sort((a, b) => cmp(a.where, b.where) || cmp(a.id, b.id)); + return [ + '== Beyond this repository', + '', + 'Nodes whose work lands in another repository. They are listed here so they can be', + 'carried to that repository, not done here.', + '', + ...orNone(beyond.map(n => `* ${n.where}: ${xref(byId, n.id)} (${n.status})`), 'None.'), + '', + ]; +} - L.push('== Beyond this repository'); - L.push(''); - L.push('Nodes whose work lands in another repository. They are listed here so they can be'); - L.push('carried to that repository, not done here.'); - L.push(''); - const beyond = nodes.filter(n => n.where).sort((a, b) => (a.where < b.where ? -1 : a.where > b.where ? 1 : a.id < b.id ? -1 : 1)); - if (!beyond.length) L.push('None.'); - for (const n of beyond) L.push(`* ${n.where}: ${xref(byId, n.id)} (${n.status})`); - L.push(''); - return L.join('\n'); +export function renderAdoc(byId, advisors, expeditions, d) { + return [ + ...introLines(byId, d), + ...frontierLines(byId, d), + ...councilLines(byId, advisors, d), + ...forkLines(byId, d), + ...eraLines(byId, advisors, d), + ...ticketLines(byId, expeditions), + ...beyondLines(byId), + ].join('\n'); } // โ”€โ”€ Rendering: SVG โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ -const esc = s => String(s).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); +const esc = s => String(s).replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"'); const clip = (s, n) => [...s].length <= n ? s : [...s].slice(0, n - 1).join('') + 'โ€ฆ'; +const COL = 250, BOX_W = 214, BOX_H = 50, GAP = 14, TOP = 96, LEFT = 24, LEGEND_STEP = 128; +const GOLD = '#d4a017'; -export function renderSvg(byId, d) { - const COL = 250, BOX_W = 214, BOX_H = 50, GAP = 14, TOP = 96, LEFT = 24; - const maxDepth = Math.max(0, ...[...d.depth.values()]); +// Where each node sits: its era is its column, and each column is ordered by +// track, then by where its needs sit, so edges cross less. +function layout(byId, d) { + const maxDepth = Math.max(0, ...d.depth.values()); const cols = Array.from({length: maxDepth + 1}, () => []); for (const n of byId.values()) cols[d.depth.get(n.id)].push(n); - // Order each column by track, then by where its needs sit, so edges cross less. const yOf = new Map(); - for (let k = 0; k <= maxDepth; k++) { - const bary = n => { - const ys = (n.needs ?? []).map(t => yOf.get(t)).filter(v => v !== undefined); - return ys.length ? ys.reduce((a, b) => a + b, 0) / ys.length : -1; - }; - cols[k].sort((a, b) => TRACKS.indexOf(a.track) - TRACKS.indexOf(b.track) || bary(a) - bary(b) || (a.id < b.id ? -1 : 1)); - cols[k].forEach((n, i) => yOf.set(n.id, TOP + i * (BOX_H + GAP))); + const bary = n => { + const ys = list(n.needs).map(t => yOf.get(t)).filter(v => v !== undefined); + return ys.length ? ys.reduce((a, b) => a + b, 0) / ys.length : -1; + }; + for (const col of cols) { + col.sort((a, b) => TRACKS.indexOf(a.track) - TRACKS.indexOf(b.track) || bary(a) - bary(b) || cmp(a.id, b.id)); + col.forEach((n, i) => yOf.set(n.id, TOP + i * (BOX_H + GAP))); } const tallest = Math.max(1, ...cols.map(c => c.length)); // At least as wide as the fixed legend (six tracks and the beyond-repository key). - const LEGEND_W = LEFT + TRACKS.length * 128 + 260; - const W = Math.max(LEFT * 2 + (maxDepth + 1) * COL - (COL - BOX_W), LEGEND_W); + const legendW = LEFT + TRACKS.length * LEGEND_STEP + 260; + const W = Math.max(LEFT * 2 + (maxDepth + 1) * COL - (COL - BOX_W), legendW); const H = TOP + tallest * (BOX_H + GAP) + 70; - const frontier = new Set(d.frontier.map(n => n.id)); - const xOf = id => LEFT + d.depth.get(id) * COL; - const o = []; - // The SVG namespace is an identifier, never fetched, and XML Namespaces 1.0 fixes it as http. - o.push(``); // hypatia: allow code_safety/js_http_url_in_code -- the SVG namespace URI is an identifier, not a fetched URL - o.push(''); - o.push(''); - o.push(`The Mathesis tech tree`); - o.push(`Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. ${byId.size} nodes in ${maxDepth + 1} eras; each arrow runs from a node to a node it enables.`); - o.push(``); - o.push(`๐Ÿฆ‰ Mathesis tech tree`); - o.push(`each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped`); - for (let k = 0; k <= maxDepth; k++) { + return {maxDepth, yOf, xOf: id => LEFT + d.depth.get(id) * COL, W, H}; +} + +function svgHead(byId, {maxDepth, W, H}) { + const desc = `Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. ${byId.size} nodes in ${maxDepth + 1} eras; each arrow runs from a node to a node it enables.`; + return [ + // The SVG namespace is an identifier, never fetched, and XML Namespaces 1.0 fixes it as http. + ``, // hypatia: allow code_safety/js_http_url_in_code -- the SVG namespace URI is an identifier, not a fetched URL + '', + '', + 'The Mathesis tech tree', + `${desc}`, + ``, + `๐Ÿฆ‰ Mathesis tech tree`, + `each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped`, + ]; +} + +function svgEras({maxDepth, H}) { + return Array.from({length: maxDepth + 1}, (_, k) => { const [g, name] = era(k); const x = LEFT + k * COL; - o.push(``); - o.push(`${esc(`${g} ${name}`)}`); - } - for (const n of byId.values()) { - for (const t of n.needs ?? []) { - const x1 = xOf(t) + BOX_W, y1 = yOf.get(t) + BOX_H / 2, x2 = xOf(n.id), y2 = yOf.get(n.id) + BOX_H / 2; - const dx = Math.max(30, (x2 - x1) / 2); - const hot = frontier.has(n.id); - o.push(``); - } - } - for (const n of byId.values()) { - const x = xOf(n.id), y = yOf.get(n.id); - const hot = frontier.has(n.id); - const faded = n.status === 'dropped' ? ' opacity="0.45"' : ''; - o.push(``); - o.push(`${esc(`${n.name}: ${n.summary}`)}`); - o.push(``); - o.push(`${esc(n.glyph)}`); - o.push(`${esc(clip(n.name, 22))}`); - o.push(`${esc(`${TRACK_GLYPH[n.track]} ${n.track} ยท ${n.size}${n.where ? ' ยท ๐ŸŒ' : ''}`)}`); - o.push(`${STATUS_GLYPH[n.status]}`); - o.push(''); - } - let lx = LEFT; + return [ + ``, + `${esc(g + ' ' + name)}`, + ]; + }).flat(); +} + +function svgEdge(n, t, hot, {xOf, yOf}) { + const x1 = xOf(t) + BOX_W, y1 = yOf.get(t) + BOX_H / 2, x2 = xOf(n.id), y2 = yOf.get(n.id) + BOX_H / 2; + const dx = Math.max(30, (x2 - x1) / 2); + const stroke = hot ? `stroke="${GOLD}" stroke-width="2"` : 'stroke="#b9ab8c" stroke-width="1.3"'; + return ``; +} + +function svgBox(n, hot, {xOf, yOf}) { + const x = xOf(n.id), y = yOf.get(n.id); + const faded = n.status === 'dropped' ? ' opacity="0.45"' : ''; + const border = hot ? `stroke="${GOLD}" stroke-width="3"` : 'stroke="#a8977a" stroke-width="1"'; + const dashed = n.status === 'blocked' ? ' stroke-dasharray="5 3"' : ''; + const tag = `${trackKey(n.track)} ยท ${n.size}${n.where ? ' ยท ๐ŸŒ' : ''}`; + return [ + ``, + `${esc(n.name + ': ' + n.summary)}`, + ``, + `${esc(n.glyph)}`, + `${esc(clip(n.name, 22))}`, + `${esc(tag)}`, + `${STATUS_GLYPH[n.status]}`, + '', + ]; +} + +function svgLegend({H}) { const ly = H - 22; - for (const t of TRACKS) { - o.push(``); - o.push(`${esc(`${TRACK_GLYPH[t]} ${t}`)}`); - lx += 128; - } - o.push(`๐ŸŒ lands in another repository`); - o.push(''); - return o.join('\n') + '\n'; + const keys = TRACKS.flatMap((t, i) => { + const lx = LEFT + i * LEGEND_STEP; + return [ + ``, + `${esc(trackKey(t))}`, + ]; + }); + return [...keys, `๐ŸŒ lands in another repository`]; } +export function renderSvg(byId, d) { + const g = layout(byId, d); + const frontier = new Set(d.frontier.map(n => n.id)); + const nodes = [...byId.values()]; + return [ + ...svgHead(byId, g), + ...svgEras(g), + ...nodes.flatMap(n => list(n.needs).map(t => svgEdge(n, t, frontier.has(n.id), g))), + ...nodes.flatMap(n => svgBox(n, frontier.has(n.id), g)), + ...svgLegend(g), + '', + ].join('\n') + '\n'; +} + + // โ”€โ”€ Driver โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ export function context(root = ROOT) { const decisions = path.join(root, 'docs/decisions'); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 1c31e73a..5a3347dd 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -6,7 +6,7 @@ import {test, expect, afterAll} from 'bun:test'; import {mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync, symlinkSync} from 'node:fs'; import {tmpdir} from 'node:os'; import path from 'node:path'; -import {generate, validate, derive, readSource, registryGrade, adrAccepted, context, ACTIVE_LIMIT, ROOT, VIEW, SVG} +import {generate, validate, derive, readSource, registryGrade, adrAccepted, context, ACTIVE_LIMIT, ROOT, VIEW, SVG, RULES} from '../../scripts/ultraplan/ultraplan.mjs'; import {jcs} from '../../scripts/registry/theory-ledger.mjs'; @@ -163,6 +163,11 @@ test('closed schema, blocked reasons and canonical lines', () => { refuses({nodes: swap('paper', {track: 'poetry'})}, /track must be one of/); refuses({nodes: swap('paper', {value: {maths: 4}})}, /value\.maths must be 0, 1, 2 or 3/); refuses({nodes: swap('paper', {where: 'elsewhere'})}, /where is estate:OWNER\/REPO/); + // A list holding a valid place is not a place (a regular expression would read it as one). + refuses({nodes: swap('paper', {where: ['estate:o/r']})}, /where is estate:OWNER\/REPO/); + // A list field that is not a list is refused by name, not by a crash. + refuses({nodes: swap('paper', {needs: {}})}, /node paper: needs must be a list/); + refuses({nodes: swap('paper', {rivals: 'cheap'})}, /node paper: rivals must be a list/); refuses({nodes: swap('paper', {size: 'toString'})}, /size must be one of S, M, L, XL/); refuses({nodes: swap('paper', {size: 'constructor'})}, /size must be one of/); refuses({raw: {nodes: BASE.map(n => JSON.stringify(n, null, 0)).join('\n') + '\n'}}, /not in JCS form/); @@ -173,6 +178,49 @@ test('closed schema, blocked reasons and canonical lines', () => { expect(() => generate(fixture({raw: {nodes: [pair, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}))).not.toThrow(); }); +// Every rule in the generator's rule tables has a witness: a change to the sound +// fixture that breaks the rule and is refused with its message. A rule with no +// witness fails this test, so no rule can be vacuous, and none can be added +// without a test. +test('every rule has a witness', () => { + const ctx = context(fixture()); + const on = (rows, id, extra) => rows.map(r => r.id === id ? strip({...r, ...extra}) : r); + const A = (id, extra) => ({advisors: on(ADVISORS, id, extra)}); + const N = (id, extra) => ({nodes: on(BASE, id, extra)}); + const T = extra => ({expeditions: [strip({id: 'X-001', what: 'A trip', why: 'Because', size: 'S', date: '2026-11-24', status: 'out', ...extra})]}); + const witnesses = [ + A('maths', {name: ''}), A('maths', {glyph: undefined}), A('maths', {asks: ' padded'}), + A('maths', {reads: 'poetry'}), A('me', {private: false}), A('maths', {private: true}), + A('contrarian', {reads: 'maths'}), A('engineering', {reads: undefined}), + N('paper', {name: 'x'.repeat(81)}), N('paper', {glyph: ''}), N('paper', {track: 'poetry'}), + N('paper', {kind: 'novel'}), N('paper', {status: 'finished'}), N('paper', {size: 'XXL'}), + N('paper', {summary: undefined}), N('paper', {needs: 'theorem'}), N('paper', {rivals: {}}), + N('root', {evidence: 'README.adoc'}), N('paper', {refs: 'see'}), N('paper', {where: ['estate:o/r']}), + N('paper', {owner_value: 'low'}), N('paper', {status: 'blocked'}), N('paper', {blocked_by: 'the owner'}), + N('paper', {refs: ['']}), + T({what: ''}), T({why: undefined}), T({size: 'toString'}), T({date: '2026-02-30'}), T({status: 'lost'}), + T({status: 'grafted', graft: 'ghost'}), T({graft: 'paper'}), T({status: 'archived'}), T({lesson: 'It taught.'}), + ]; + const seen = new Set(); + for (const w of witnesses) { + let refusal = ''; + try { validate({advisors: ADVISORS, nodes: BASE, expeditions: [], ...w}, ctx); } catch (e) { refusal = e.message; } + expect(refusal).not.toBe(''); + for (const line of refusal.split('\n')) seen.add(line.slice(line.indexOf(': ') + 2)); + } + const unwitnessed = Object.entries(RULES).flatMap(([kind, rules]) => rules.filter(([, m]) => !seen.has(m)).map(([, m]) => `${kind}: ${m}`)); + expect(unwitnessed).toEqual([]); +}); + +test('ids are slugs and unique, and counsel comes from the council', () => { + refuses({nodes: swap('paper', {id: 'Paper X'})}, /id must be a lowercase slug/); + refuses({nodes: [...BASE, BASE[4]]}, /node paper: repeated id/); + refuses({advisors: [...ADVISORS, ADVISORS[0]]}, /advisor id "maths" is missing, not a slug, or repeated/); + refuses({nodes: swap('paper', {rivals: ['paper']})}, /node paper: rivals names itself/); + refuses({nodes: swap('theorem', {counsel: {ghost: 'Hm.'}})}, /counsel from unknown advisor ghost/); + refuses({nodes: swap('theorem', {counsel: {maths: ''}})}, /counsel\.maths must be a short text/); +}); + test('return tickets are grafted or archived honestly', () => { const x = {id: 'X-001', what: 'A trip', why: 'Because', size: 'S', date: '2026-11-24', status: 'out'}; expect(generate(fixture({expeditions: [x]}))[VIEW]).toContain('|X-001 |2026-11-24 |S |A trip |Because |๐ŸŽ’ out'); From 3964c969dfb49ffa94c70cb9be90a0eefed3701f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 12:27:55 +0000 Subject: [PATCH 10/41] ultraplan: answer Codex's fourth review of PR 123 All three findings were checked against the code. Two are fixed in code; the third is fixed in the docs, departing from Codex's suggestion. - ADR evidence stays in the repository. The context now has one containment check, and every file the evidence checks read goes through it. Before, an ADR that was a symlink to an accepted record outside the checkout passed. read() also refuses such a file directly. - The me advisor no longer ranks by the mathematician's mark. Another advisor's mark is not the owner's preference. Among the frontier nodes the owner tagged, it ranks as the council does: unlocks, then value for effort. Its pick moves from paper-thy1, which won only on maths:1, to forecast-13wk, which unlocks two nodes. - The council is not hardcoded. Codex asked the generator to require the exact ten advisors, because the README and ROADMAP promised ten. The council is the owner's data, so requiring a fixed set would put the code in charge of a data-first ruling. The fault was the present-tense count in the docs, which goes stale as data changes, like the node count earlier. The README, ROADMAP and CHANGELOG no longer state a count, and the README records the 2026-11-24 council with its date. The generator still requires the me advisor, because the page's privacy claim rests on it. Tests: 19 pass. Each new test fails on 8c129b8. Disabling any of the 28 rules, or any of 31 other guards, fails a test. eslint-plugin-sonarjs is clean, and check-views, site-check and the I-JSON gate pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 2 +- docs/status/ROADMAP.adoc | 2 +- docs/ultraplan/README.adoc | 16 +++++++---- docs/ultraplan/generated/ultraplan.adoc | 2 +- scripts/ultraplan/ultraplan.mjs | 37 +++++++++++++++---------- tests/ultraplan/ultraplan.test.mjs | 14 ++++++++++ 6 files changed, 51 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a5ebabe7..780a472a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -75,7 +75,7 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. * **The ultraplan: a tech tree of Mathesis, data first.** `docs/ultraplan/` holds three JCS JSON Lines files: ** `tree.jsonl`, the nodes, whose needs are the edges; - ** `advisors.jsonl`, the ten advisors; + ** `advisors.jsonl`, the council; ** `expeditions.jsonl`, the return tickets. + `scripts/ultraplan/ultraplan.mjs` generates `generated/ultraplan.adoc` and a diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 61d10686..7a6318f2 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -13,7 +13,7 @@ under <>. What comes next is drawn as a tech tree, the ultraplan (link:../ultraplan/generated/ultraplan.adoc[`docs/ultraplan/generated/ultraplan.adoc`], from the data in `docs/ultraplan/`). Its frontier is the list of work that can -start now, and ten advisors each name a pick from it. This roadmap keeps the +start now, and each advisor of the council names a pick from it. This roadmap keeps the record of what happened; the tree says what each piece enables. === Applied Systems (2026-11-07) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 828bd21a..bb6807b8 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -65,17 +65,21 @@ written down so they can be argued with. The page labels them as judgements. == The council -Ten advisors read the tree: +The council is the data in `advisors.jsonl`, and the generated page lists it. On +2026-11-24 the owner set it to: * the six the owner named (mathematician, scientist, engineer, economist, publisher, and "me"); -* the four added on 2026-11-24 (soundness auditor, estate cartographer, teacher -and contrarian). +* four more (soundness auditor, estate cartographer, teacher and contrarian). + +The generator requires only the me advisor, because the page's privacy claim +rests on it. Who else sits on the council is the owner's to change in the data. Each asks one question of every node. Each names one pick from the frontier: * An advisor that reads a value mark ranks the frontier nodes it marks above -zero: by the mark, then by how much the node unlocks. A node it marks zero is +zero: by the mark, then by how much the node unlocks, then by value for effort +(its marks summed, over its size). A node it marks zero is not one it would pick, so when no node is marked above zero the advisor names nothing. * The contrarian names the frontier node the council rates lowest that still @@ -84,7 +88,9 @@ unlocks the most. That keeps the road not taken in view. are kept privately, outside this public repository and out of every feed: in a private panel of GELS that the owner owns (owner ruling 2026-11-24). A node carries at most the neutral tag `"owner_value":"high"`, and the generator refuses any counsel under -the key `me`. +the key `me`. The me advisor reads no value mark, since another advisor's mark +is not the owner's preference. Among the frontier nodes the owner tagged, it +names the one that unlocks the most, then the one with the best value for effort. == Wandering: return tickets diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index c0c824be..18af7703 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -108,7 +108,7 @@ _Pick:_ <>. _Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. -_Pick:_ <>. +_Pick:_ <>. == Forks and confluences diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index c8ed6469..1e184ff4 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -158,6 +158,7 @@ const EVIDENCE = { if (!isStr(ev.adr) || !/^\d{4}$/.test(ev.adr)) return `evidence adr ${JSON.stringify(ev.adr)} is not a four-digit ADR number`; const file = ctx.adrFile(ev.adr); if (!file) return `no ADR ${ev.adr} in docs/decisions`; + if (!ctx.isFile(file)) return `ADR ${ev.adr} (${file}) is not a file in the repository`; return adrAccepted(ctx.read(file)) ? null : `ADR ${ev.adr} is not Accepted`; }, }; @@ -347,16 +348,18 @@ export function validate({advisors, nodes, expeditions}, ctx) { // โ”€โ”€ Derivation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // Each advisor's pick from the frontier. An advisor that reads a value key -// ranks the nodes it marks above zero by that mark, then by leverage, then by -// value for effort; the contrarian takes the frontier node the council rates -// lowest that still unlocks the most; the me advisor names only nodes tagged -// owner_value, with no notes. +// ranks the nodes it marks above zero by that mark, then as the council +// ranks: by leverage, then by value for effort. The contrarian takes the +// frontier node the council rates lowest that still unlocks the most. The me +// advisor reads no mark, since another advisor's mark is not the owner's +// preference: it ranks the nodes the owner tagged owner_value as the council +// ranks, and has no notes. function pickFor(a, frontier, total, leverage) { const first = (pool, order) => [...pool].sort(order)[0] ?? null; - const byKey = k => (x, y) => (y.value?.[k] ?? 0) - (x.value?.[k] ?? 0) || leverage(y.id) - leverage(x.id) - || total(y) / SIZES[y.size] - total(x) / SIZES[x.size] || cmp(x.id, y.id); + const council = (x, y) => leverage(y.id) - leverage(x.id) || total(y) / SIZES[y.size] - total(x) / SIZES[x.size] || cmp(x.id, y.id); + const byKey = k => (x, y) => (y.value?.[k] ?? 0) - (x.value?.[k] ?? 0) || council(x, y); if (a.id === 'contrarian') return first(frontier, (x, y) => total(x) - total(y) || leverage(y.id) - leverage(x.id) || cmp(x.id, y.id)); - if (a.private) return first(frontier.filter(n => n.owner_value === 'high'), byKey('maths')); + if (a.private) return first(frontier.filter(n => n.owner_value === 'high'), council); if (a.reads) return first(frontier.filter(n => (n.value?.[a.reads] ?? 0) > 0), byKey(a.reads)); return null; } @@ -712,15 +715,21 @@ export function renderSvg(byId, d) { // โ”€โ”€ Driver โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ export function context(root = ROOT) { const decisions = path.join(root, 'docs/decisions'); + // The real path of a regular file inside the repository (symlinks resolved), or null. + // Every file the evidence checks read goes through it. + const inside = p => { + try { + const base = realpathSync(root), real = realpathSync(path.join(root, p)); + return real.startsWith(base + path.sep) && statSync(real).isFile() ? real : null; + } catch { return null; } + }; return { - // A regular file whose real path (symlinks resolved) stays inside the repository. - isFile: p => { - try { - const base = realpathSync(root), real = realpathSync(path.join(root, p)); - return real.startsWith(base + path.sep) && statSync(real).isFile(); - } catch { return false; } + isFile: p => inside(p) !== null, + read: p => { + const real = inside(p); + if (!real) throw new Error(`${p} is not a file in the repository`); + return readFileSync(real, 'utf8'); }, - read: p => readFileSync(path.join(root, p), 'utf8'), registry: existsSync(path.join(root, 'docs/atlas/generated/registry.adoc')) ? readFileSync(path.join(root, 'docs/atlas/generated/registry.adoc'), 'utf8') : '', adrFile: n => { const f = existsSync(decisions) && readdirSync(decisions).find(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && !x.includes('template')); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 5a3347dd..ff1877ee 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -93,6 +93,14 @@ test('done needs evidence that holds', () => { const inside = fixture({nodes: swap('root', {evidence: [{path: 'inner.adoc'}]})}); symlinkSync('README.adoc', path.join(inside, 'inner.adoc')); expect(() => generate(inside)).not.toThrow(); + // An ADR that is a symlink to an accepted record outside the repository is not one in it. + writeFileSync(path.join(outside, 'accepted.adoc'), '= ADR\n\n=== Status\n\n*Accepted.*\n'); + const adr = fixture({nodes: swap('tool', {evidence: [{adr: '0007'}]})}); + symlinkSync(path.join(outside, 'accepted.adoc'), path.join(adr, 'docs/decisions/0007-outside.adoc')); + expect(() => generate(adr)).toThrow(/ADR 0007 \(docs\/decisions\/0007-outside\.adoc\) is not a file in the repository/); + // The context reads no file outside the repository, whoever asks. + expect(() => context(adr).read('docs/decisions/0007-outside.adoc')).toThrow(/is not a file in the repository/); + expect(context(adr).read('README.adoc')).toBe('= Fixture\n'); refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); @@ -212,6 +220,12 @@ test('every rule has a witness', () => { expect(unwitnessed).toEqual([]); }); +test('the me advisor ranks the owner\'s tags as the council does, not by another advisor\'s mark', () => { + // cheap carries the higher maths mark; theorem unlocks two nodes and cheap none. + const nodes = swap('cheap', {owner_value: 'high', value: {maths: 3}}, swap('theorem', {value: {maths: 1}})); + expect(generate(fixture({nodes})).derived.picks.get('me').id).toBe('theorem'); +}); + test('ids are slugs and unique, and counsel comes from the council', () => { refuses({nodes: swap('paper', {id: 'Paper X'})}, /id must be a lowercase slug/); refuses({nodes: [...BASE, BASE[4]]}, /node paper: repeated id/); From cbd7ae9a313b55e82d27a2bcb608a35fccbb1467 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 12:44:27 +0000 Subject: [PATCH 11/41] ultraplan: answer Codex's fifth review of PR 123 All three findings were checked against the code, and all three hold. - The registry view now goes through the repository containment check, like every other evidence file. Before, a committed symlink from docs/atlas/generated/registry.adoc to a file outside the checkout was read, and claim evidence could pass from it. Such a symlink is now refused loudly. A missing view still means that no claim is listed. - Each edge in the picture ends in an arrowhead. It is gold where the edge leads to the frontier, so the direction of "enables" shows, as the legend and the description say. The arrowheads have a fixed size, with the tip on the end of the edge. The SVG is well-formed XML, and I checked it by eye in Chromium. - The ROADMAP's GELS ruling no longer says the panel waits on the coordinator's answer, which has arrived. It now names the actual blocker, the feed/panel contract the GELS thread is drafting. The Squabble gate failed on 3964c96 because its runner could not reach github.com (the fetch timed out after 132 s). The failure is in the infrastructure, not in this change; this push runs the gate again. Tests: 19 pass. The two new checks fail on 3964c96. Disabling any of the 28 rules, or any of 33 other guards, fails a test. eslint-plugin-sonarjs is clean, and check-views, site-check and the I-JSON gate pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/status/ROADMAP.adoc | 5 +- docs/ultraplan/generated/tree.svg | 148 +++++++++++++++-------------- scripts/ultraplan/ultraplan.mjs | 25 +++-- tests/ultraplan/ultraplan.test.mjs | 12 +++ 4 files changed, 108 insertions(+), 82 deletions(-) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 7a6318f2..312f5e0d 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -423,5 +423,6 @@ scheduled census, a view of what each repository owes tag `owner_value`. ** Off-tree trips are return tickets: each is grafted onto the tree or archived with what it taught. -** The GELS maths panel waits on the estate coordinator's answer about panel - data. +** The GELS maths panel waits on the GELS feed/panel contract, which the GELS + thread is drafting. The estate coordinator has answered: a read-only feed, + one panel type, and open decisions sent to the owner's decision desk. diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index 22ea4d9e..292753b9 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -3,6 +3,10 @@ The Mathesis tech tree Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. 52 nodes in 8 eras; each arrow runs from a node to a node it enables. + + + + ๐Ÿฆ‰ Mathesis tech tree each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped @@ -22,78 +26,78 @@ ๐ŸŒ€ Grothendieck ๐Ÿš€ Frontier beyond - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + APP-1 to APP-4: missing stays missing: Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean. diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 1e184ff4..bee2ef9f 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -609,7 +609,9 @@ export function renderAdoc(byId, advisors, expeditions, d) { const esc = s => String(s).replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"'); const clip = (s, n) => [...s].length <= n ? s : [...s].slice(0, n - 1).join('') + 'โ€ฆ'; const COL = 250, BOX_W = 214, BOX_H = 50, GAP = 14, TOP = 96, LEFT = 24, LEGEND_STEP = 128; -const GOLD = '#d4a017'; +const GOLD = '#d4a017', EDGE = '#b9ab8c'; +// An arrowhead of fixed size whose tip sits on the end of its edge. +const arrowHead = (id, fill) => ``; // Where each node sits: its era is its column, and each column is ordered by // track, then by where its needs sit, so edges cross less. @@ -643,6 +645,10 @@ function svgHead(byId, {maxDepth, W, H}) { '', 'The Mathesis tech tree', `${desc}`, + '', + arrowHead('arrow', EDGE), + arrowHead('arrow-hot', GOLD), + '', ``, `๐Ÿฆ‰ Mathesis tech tree`, `each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped`, @@ -663,7 +669,7 @@ function svgEras({maxDepth, H}) { function svgEdge(n, t, hot, {xOf, yOf}) { const x1 = xOf(t) + BOX_W, y1 = yOf.get(t) + BOX_H / 2, x2 = xOf(n.id), y2 = yOf.get(n.id) + BOX_H / 2; const dx = Math.max(30, (x2 - x1) / 2); - const stroke = hot ? `stroke="${GOLD}" stroke-width="2"` : 'stroke="#b9ab8c" stroke-width="1.3"'; + const stroke = hot ? `stroke="${GOLD}" stroke-width="2" marker-end="url(#arrow-hot)"` : `stroke="${EDGE}" stroke-width="1.3" marker-end="url(#arrow)"`; return ``; } @@ -715,6 +721,7 @@ export function renderSvg(byId, d) { // โ”€โ”€ Driver โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ export function context(root = ROOT) { const decisions = path.join(root, 'docs/decisions'); + const registry = 'docs/atlas/generated/registry.adoc'; // The real path of a regular file inside the repository (symlinks resolved), or null. // Every file the evidence checks read goes through it. const inside = p => { @@ -723,14 +730,16 @@ export function context(root = ROOT) { return real.startsWith(base + path.sep) && statSync(real).isFile() ? real : null; } catch { return null; } }; + const read = p => { + const real = inside(p); + if (!real) throw new Error(`${p} is not a file in the repository`); + return readFileSync(real, 'utf8'); + }; return { isFile: p => inside(p) !== null, - read: p => { - const real = inside(p); - if (!real) throw new Error(`${p} is not a file in the repository`); - return readFileSync(real, 'utf8'); - }, - registry: existsSync(path.join(root, 'docs/atlas/generated/registry.adoc')) ? readFileSync(path.join(root, 'docs/atlas/generated/registry.adoc'), 'utf8') : '', + read, + // No registry view means no claim is listed; one that leads outside the repository is refused. + registry: existsSync(path.join(root, registry)) ? read(registry) : '', adrFile: n => { const f = existsSync(decisions) && readdirSync(decisions).find(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && !x.includes('template')); return f ? `docs/decisions/${f}` : null; diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index ff1877ee..427bde48 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -69,6 +69,12 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(out[SVG]).toContain(''); // Three eras are narrower than the legend; the canvas still holds the legend. expect(Number(/width="(\d+)"/.exec(out[SVG])[1])).toBeGreaterThanOrEqual(24 + 6 * 128 + 260); + // Every edge (six in the fixture) ends in an arrowhead, gold where it leads to the frontier. + const edges = out[SVG].match(/]*\/>/g); + expect(edges.length).toBe(6); + expect(edges.every(e => /marker-end="url\(#arrow(-hot)?\)"/.test(e))).toBe(true); + expect(out[SVG]).toContain(' { @@ -101,6 +107,12 @@ test('done needs evidence that holds', () => { // The context reads no file outside the repository, whoever asks. expect(() => context(adr).read('docs/decisions/0007-outside.adoc')).toThrow(/is not a file in the repository/); expect(context(adr).read('README.adoc')).toBe('= Fixture\n'); + // The registry view is evidence too: one that leads outside the repository is refused. + writeFileSync(path.join(outside, 'registry.adoc'), '|https://x/blob/c/P.adoc[o/r#T-1] at `c` |theorem |`PWG-1` |s |w\n'); + const reg = fixture({nodes: swap('root', {evidence: [{claim: 'o/r#T-1'}]})}); + rmSync(path.join(reg, 'docs/atlas/generated/registry.adoc')); + symlinkSync(path.join(outside, 'registry.adoc'), path.join(reg, 'docs/atlas/generated/registry.adoc')); + expect(() => generate(reg)).toThrow(/docs\/atlas\/generated\/registry\.adoc is not a file in the repository/); refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); From d3731988fabf5bbfa5a0749213c215f11407771d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 13:09:53 +0000 Subject: [PATCH 12/41] ultraplan: answer CodeRabbit's review of cbd7ae9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All four findings were checked against the code, and all four hold. Two claims were tested first: Asciidoctor leaves [[13-week]] as text with no anchor, and the repository's I-JSON gate already refuses U+FFFE. - Noncharacters. The generator now refuses Unicode noncharacters as well as lone surrogates, in values and member names (RFC 7493 ยง2.1), as the I-JSON gate does. Before, U+FFFE passed and reached the SVG, where XML 1.0 forbids it. The gate's Bun fallback runs its command on import, so it cannot be reused here. Exporting its checks is a change for the template. - Witnesses per rule. Each witness now counts for one table and one message, and a test requires each message to be unique within its table, so (table, message) identifies a rule. Before, a witness for the advisor rule "glyph is required" also counted for the node rule. - Full active slots. When every active slot is taken, the census, the frontier section, the key and the picture's legend say that the frontier is ready but cannot start. While a slot is free, they are unchanged. - Ids are AsciiDoc anchors. A node or advisor id must now begin with a letter, so the id is its own anchor, and a frontier link always reaches the node. CodeRabbit suggested a prefixed anchor; that would give each node two names. No current id begins with a digit, and the committed views are unchanged. Tests: 20 pass. The three new behavioural tests fail on cbd7ae9. Disabling any of the 28 rules, or any of 38 other guards, fails a test. eslint-plugin-sonarjs is clean, the SVG is well-formed XML, and check-views, site-check and the I-JSON gate pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/README.adoc | 5 +++- scripts/ultraplan/ultraplan.mjs | 38 +++++++++++++++++++----------- tests/ultraplan/ultraplan.test.mjs | 36 ++++++++++++++++++++++++++-- 3 files changed, 62 insertions(+), 17 deletions(-) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index bb6807b8..72d83e7f 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -57,6 +57,8 @@ above a stated grade, or a decision record whose status is Accepted. A done node's needs must be done too. * *Active* is limited: at most three nodes may be active at once. To start a fourth, finish or park one first. This is the guard against starting everything. +When every slot is taken, the page and the picture still show the frontier, and +say that it is ready but cannot start. * *Blocked* must say what blocks it. The value marks (0 to 3 on maths, science, engineering, economics, publications, @@ -113,7 +115,8 @@ still counts. . Add or edit the line in `tree.jsonl`, keeping its JCS form. Keys are sorted and there are no spaces; `bun scripts/ijson-jcs-cli.js` or the generator's error -message gives the exact form. +message gives the exact form. Its id is a lowercase slug that begins with a +letter, because the id is also the node's anchor on the page. . Give it needs, so it sits in the right era. A node with no needs starts a new root. . If it is another route to a node that already exists, name each in the other's diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index bee2ef9f..5fcd5d9f 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -60,7 +60,9 @@ export const TRACK_FILL = { economics: '#ffe0d6', publications: '#eee0ff', ecosystem: '#ffe9c7', }; -const SLUG = /^[a-z0-9]+(-[a-z0-9]+)*$/; +// A lowercase slug that begins with a letter: a node's id is also its AsciiDoc +// anchor, and an anchor cannot begin with a digit. +const SLUG = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/; // A size is one of the four own keys of SIZES, never an inherited name such as "toString". const isSize = s => typeof s === 'string' && Object.hasOwn(SIZES, s); // A YYYY-MM-DD that names a real day (no 2026-02-30). @@ -74,13 +76,16 @@ const isStr = (v, max = 400) => typeof v === 'string' && v.length > 0 && v.lengt // โ”€โ”€ Reading โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // Each source line must already be its own JCS form, so the data has one // spelling and a diff shows only real change. -// I-JSON (RFC 7493) and JCS (RFC 8785) refuse a string or a member name that -// holds a lone surrogate, which JSON.parse would otherwise accept and -// JSON.stringify would write back unchanged. +// I-JSON (RFC 7493 ยง2.1) refuses a string or a member name that holds a lone +// surrogate or a Unicode noncharacter (U+FDD0 to U+FDEF, and the last two code +// points of every plane). JSON.parse accepts both and JSON.stringify writes them +// back unchanged, so they are refused here, as the I-JSON gate refuses them. +const isNonchar = cp => (cp >= 0xFDD0 && cp <= 0xFDEF) || (cp & 0xFFFE) === 0xFFFE; +const isIJsonString = s => s.isWellFormed() && ![...s].some(c => isNonchar(c.codePointAt(0))); export function wellFormed(v) { - if (typeof v === 'string') return v.isWellFormed(); + if (typeof v === 'string') return isIJsonString(v); if (Array.isArray(v)) return v.every(wellFormed); - if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => k.isWellFormed() && wellFormed(x)); + if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => isIJsonString(k) && wellFormed(x)); return true; } @@ -88,7 +93,7 @@ export function readSource(text, name) { const rows = parseJsonl(text, name); const lines = text === '' ? [] : text.slice(0, -1).split('\n'); rows.forEach((r, i) => { - if (!wellFormed(r)) throw new Error(`${name}: line ${i + 1} holds a lone surrogate, which I-JSON and JCS refuse`); + if (!wellFormed(r)) throw new Error(`${name}: line ${i + 1} holds a lone surrogate or a Unicode noncharacter, which I-JSON refuses`); if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); write it as ${jcs(r)}`); }); return rows; @@ -240,7 +245,7 @@ function checkNodes(nodes, advisorIds, fail) { for (const n of nodes) { const where = `node ${n?.id}`; if (!isClosed(n, NODE_FIELDS, where, fail)) continue; - if (!isStr(n.id, 60) || !SLUG.test(n.id)) { fail(`${where}: id must be a lowercase slug`); continue; } + if (!isStr(n.id, 60) || !SLUG.test(n.id)) { fail(`${where}: id must be a lowercase slug that begins with a letter`); continue; } if (byId.has(n.id)) { fail(`${where}: repeated id`); continue; } byId.set(n.id, n); applyRules(NODE_RULES, n, null, where, fail); @@ -389,6 +394,8 @@ export function derive(byId, advisors) { const live = n => n.status !== 'dropped'; const nodes = [...byId.values()]; + // Active slots still free: when none is, the frontier is ready but cannot start. + const slots = ACTIVE_LIMIT - nodes.filter(n => n.status === 'active').length; const frontier = nodes.filter(n => n.status === 'open' && list(n.needs).every(t => byId.get(t).status === 'done')); const total = n => Object.values(n.value ?? {}).reduce((a, b) => a + b, 0); const leverage = id => [...below.get(id)].filter(x => live(byId.get(x))).length; @@ -401,7 +408,7 @@ export function derive(byId, advisors) { for (const n of nodes) for (const r of list(n.rivals)) if (n.id < r) rivalries.push([n.id, r]); const picks = new Map(advisors.map(a => [a.id, pickFor(a, frontier, total, leverage)])); - return {children, depth, below, frontier, forks, confluences, rivalries, picks, leverage, total}; + return {children, depth, below, frontier, forks, confluences, rivalries, picks, leverage, total, slots}; } // โ”€โ”€ Rendering: AsciiDoc โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ @@ -432,19 +439,21 @@ function introLines(byId, d) { 'claim grade that the registry derives, or an accepted decision record. The value marks', 'are judgements, written down so they can be argued with.', '', - `Census of the tree: ${count('done')} done, ${count('active')} active (at most ${ACTIVE_LIMIT}), ${count('open')} open, ${count('blocked')} blocked, ${count('dropped')} dropped, of ${nodes.length} nodes. ${d.frontier.length} can be started now.`, + `Census of the tree: ${count('done')} done, ${count('active')} active (at most ${ACTIVE_LIMIT}), ${count('open')} open, ${count('blocked')} blocked, ${count('dropped')} dropped, of ${nodes.length} nodes. ${startable(d)}`, '', 'toc::[]', '', 'image::tree.svg[The tech tree of Mathesis, from the first era on the left to the frontier on the right]', '', 'Key: โœ… done ยท ๐Ÿ”จ active ยท ๐ŸŒฑ open ยท โ›” blocked ยท ๐Ÿ‚ dropped. A gold border marks a node', - `that can be started now. Colours are tracks: ${TRACKS.map(trackKey).join(' ยท ')}.`, + `that ${d.slots > 0 ? 'can be started now' : 'is ready, once an active slot is free'}. Colours are tracks: ${TRACKS.map(trackKey).join(' ยท ')}.`, '', ]; } const beyondNote = n => (n.where ? ` _(${cell(n.where)})_` : ''); +const startable = d => (d.slots > 0 ? `${d.frontier.length} can be started now.` : `${d.frontier.length} are ready, but all ${ACTIVE_LIMIT} active slots are full.`); +const slotsFull = `*All ${ACTIVE_LIMIT} active slots are full.* These nodes are ready, but none can start until an active node is finished or parked.`; function frontierLines(byId, d) { const head = [ '== Research now: the frontier', @@ -454,6 +463,7 @@ function frontierLines(byId, d) { '', ]; if (!d.frontier.length) return [...head, 'Nothing is on the frontier.', '']; + if (d.slots <= 0) head.push(slotsFull, ''); const rows = [...d.frontier].sort((a, b) => d.leverage(b.id) - d.leverage(a.id) || cmp(a.id, b.id)); return [ ...head, @@ -636,7 +646,7 @@ function layout(byId, d) { return {maxDepth, yOf, xOf: id => LEFT + d.depth.get(id) * COL, W, H}; } -function svgHead(byId, {maxDepth, W, H}) { +function svgHead(byId, {maxDepth, W, H}, d) { const desc = `Generated by scripts/ultraplan/ultraplan.mjs from docs/ultraplan/tree.jsonl. ${byId.size} nodes in ${maxDepth + 1} eras; each arrow runs from a node to a node it enables.`; return [ // The SVG namespace is an identifier, never fetched, and XML Namespaces 1.0 fixes it as http. @@ -651,7 +661,7 @@ function svgHead(byId, {maxDepth, W, H}) { '', ``, `๐Ÿฆ‰ Mathesis tech tree`, - `each arrow: this enables that ยท gold border: start it now ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped`, + `each arrow: this enables that ยท gold border: ${d.slots > 0 ? 'start it now' : 'ready, once an active slot is free'} ยท โœ… done ๐Ÿ”จ active ๐ŸŒฑ open โ›” blocked ๐Ÿ‚ dropped`, ]; } @@ -708,7 +718,7 @@ export function renderSvg(byId, d) { const frontier = new Set(d.frontier.map(n => n.id)); const nodes = [...byId.values()]; return [ - ...svgHead(byId, g), + ...svgHead(byId, g, d), ...svgEras(g), ...nodes.flatMap(n => list(n.needs).map(t => svgEdge(n, t, frontier.has(n.id), g))), ...nodes.flatMap(n => svgBox(n, frontier.has(n.id), g)), diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 427bde48..aa2b07eb 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -196,6 +196,13 @@ test('closed schema, blocked reasons and canonical lines', () => { refuses({raw: {nodes: [lone, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate/); const pair = jcs({...BASE[0], name: 'x \u{1F600}'}); expect(() => generate(fixture({raw: {nodes: [pair, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}))).not.toThrow(); + // I-JSON refuses Unicode noncharacters too: U+FDD0 to U+FDEF and the last two code points of each plane. + for (const nc of ['\uFFFE', '\uFDD0', '\u{1FFFF}', '\u{10FFFE}']) { + const line = jcs({...BASE[0], name: `x${nc}y`}); + refuses({raw: {nodes: [line, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate or a Unicode noncharacter/); + } + const key = jcs({...BASE[0], value: {maths: 1}}).replace('"maths"', '"m\uFFFEaths"'); + refuses({raw: {nodes: [key, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate or a Unicode noncharacter/); }); // Every rule in the generator's rule tables has a witness: a change to the sound @@ -221,14 +228,19 @@ test('every rule has a witness', () => { T({what: ''}), T({why: undefined}), T({size: 'toString'}), T({date: '2026-02-30'}), T({status: 'lost'}), T({status: 'grafted', graft: 'ghost'}), T({graft: 'paper'}), T({status: 'archived'}), T({lesson: 'It taught.'}), ]; + // Within a table each message names one rule, so (table, message) is the rule's identity. + for (const rules of Object.values(RULES)) expect(new Set(rules.map(([, m]) => m)).size).toBe(rules.length); const seen = new Set(); for (const w of witnesses) { let refusal = ''; try { validate({advisors: ADVISORS, nodes: BASE, expeditions: [], ...w}, ctx); } catch (e) { refusal = e.message; } expect(refusal).not.toBe(''); - for (const line of refusal.split('\n')) seen.add(line.slice(line.indexOf(': ') + 2)); + for (const line of refusal.split('\n')) { + const m = /^(advisor|node|expedition) [^\s:]+: (.*)$/.exec(line); + if (m) seen.add(`${m[1]}: ${m[2]}`); + } } - const unwitnessed = Object.entries(RULES).flatMap(([kind, rules]) => rules.filter(([, m]) => !seen.has(m)).map(([, m]) => `${kind}: ${m}`)); + const unwitnessed = Object.entries(RULES).flatMap(([kind, rules]) => rules.map(([, m]) => `${kind}: ${m}`).filter(id => !seen.has(id))); expect(unwitnessed).toEqual([]); }); @@ -238,8 +250,28 @@ test('the me advisor ranks the owner\'s tags as the council does, not by another expect(generate(fixture({nodes})).derived.picks.get('me').id).toBe('theorem'); }); +test('when every active slot is taken, the frontier is ready but cannot start', () => { + const open = generate(fixture()); + expect(open.derived.slots).toBe(ACTIVE_LIMIT); + expect(open[VIEW]).toContain('can be started now.'); + expect(open[VIEW]).not.toContain('active slots are full'); + expect(open[SVG]).toContain('gold border: start it now'); + // theorem and cheap are ready; with a third started node, every slot is taken and spare waits. + const nodes = [...swap('cheap', {status: 'active'}, swap('theorem', {status: 'active'})), + node('extra', {needs: ['root'], status: 'active'}), node('spare', {needs: ['root']})]; + const full = generate(fixture({nodes})); + expect(full.derived.slots).toBe(0); + expect(full.derived.frontier.map(n => n.id)).toEqual(['spare']); + expect(full[VIEW]).toContain(`1 are ready, but all ${ACTIVE_LIMIT} active slots are full.`); + expect(full[VIEW]).toContain(`*All ${ACTIVE_LIMIT} active slots are full.* These nodes are ready`); + expect(full[VIEW]).toContain('A gold border marks a node\nthat is ready, once an active slot is free.'); + expect(full[SVG]).toContain('gold border: ready, once an active slot is free'); +}); + test('ids are slugs and unique, and counsel comes from the council', () => { refuses({nodes: swap('paper', {id: 'Paper X'})}, /id must be a lowercase slug/); + refuses({nodes: swap('paper', {id: '13-week'})}, /node 13-week: id must be a lowercase slug that begins with a letter/); + refuses({advisors: [...ADVISORS, {id: '2nd', name: 'Second', glyph: '2', asks: 'Again?', reads: 'maths'}]}, /advisor id "2nd" is missing, not a slug, or repeated/); refuses({nodes: [...BASE, BASE[4]]}, /node paper: repeated id/); refuses({advisors: [...ADVISORS, ADVISORS[0]]}, /advisor id "maths" is missing, not a slug, or repeated/); refuses({nodes: swap('paper', {rivals: ['paper']})}, /node paper: rivals names itself/); From 891a469c2e656d44c3ffe1ed70f0f23e504fb5d3 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 13:12:37 +0000 Subject: [PATCH 13/41] ultraplan: the frontier's first sentence honours full slots CodeRabbit noted that when every active slot is taken, the frontier section still opened with "any of them can start today", against the note just below it, and that the test did not check that sentence. Both points hold. The sentence now says each node "can start once an active slot is free" when no slot is free, and is unchanged otherwise, so the committed views do not change. The test checks both wordings, and checks that a full page has neither "can start today" nor "can be started now". Tests: 20 pass. Disabling any of the 28 rules, or any of 39 other guards, fails a test. eslint-plugin-sonarjs is clean, and check-views and site-check pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- scripts/ultraplan/ultraplan.mjs | 3 ++- tests/ultraplan/ultraplan.test.mjs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 5fcd5d9f..2b232287 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -458,7 +458,8 @@ function frontierLines(byId, d) { const head = [ '== Research now: the frontier', '', - 'These open nodes have every need done, so any of them can start today. "Unlocks"', + d.slots > 0 ? 'These open nodes have every need done, so any of them can start today. "Unlocks"' + : 'These open nodes have every need done, so each can start once an active slot is free. "Unlocks"', 'counts the live nodes that depend on it, directly or through others.', '', ]; diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index aa2b07eb..606bef1d 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -254,6 +254,7 @@ test('when every active slot is taken, the frontier is ready but cannot start', const open = generate(fixture()); expect(open.derived.slots).toBe(ACTIVE_LIMIT); expect(open[VIEW]).toContain('can be started now.'); + expect(open[VIEW]).toContain('so any of them can start today.'); expect(open[VIEW]).not.toContain('active slots are full'); expect(open[SVG]).toContain('gold border: start it now'); // theorem and cheap are ready; with a third started node, every slot is taken and spare waits. @@ -264,6 +265,9 @@ test('when every active slot is taken, the frontier is ready but cannot start', expect(full.derived.frontier.map(n => n.id)).toEqual(['spare']); expect(full[VIEW]).toContain(`1 are ready, but all ${ACTIVE_LIMIT} active slots are full.`); expect(full[VIEW]).toContain(`*All ${ACTIVE_LIMIT} active slots are full.* These nodes are ready`); + expect(full[VIEW]).toContain('so each can start once an active slot is free.'); + expect(full[VIEW]).not.toContain('can start today'); + expect(full[VIEW]).not.toContain('can be started now'); expect(full[VIEW]).toContain('A gold border marks a node\nthat is ready, once an active slot is free.'); expect(full[SVG]).toContain('gold border: ready, once an active slot is free'); }); From 4440b8c0dd51862aeb0bf85cdba9cc8ed1356cfa Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 13:20:56 +0000 Subject: [PATCH 14/41] ultraplan: answer Codex's review of 891a469 All three findings were checked against the code and the data, and all three hold. - A mark of 0 is shown. A 0 is a judgement, and it is the mark that keeps a node out of an advisor's picks. The page now shows every mark the data holds, a 0 as an open circle. Before, a 0 vanished, and a node whose only mark was 0 had an empty value field. No node in the tree has a 0 today, so the committed views are unchanged. - An ADR number must name one record. Every record with the number (the template aside) is collected in a fixed order, and two or more are refused as ambiguous. Before, directory order chose one. The repository has two 0001 files today, but one is the template, so no evidence is ambiguous. - The README and ROADMAP define the frontier as the work that is ready, to start when an active slot is free, as the generated page already does. Before, they said it could always start today. Tests: 21 pass. The two new behavioural tests fail on 891a469. Disabling any of the 28 rules, or any of 41 other guards, fails a test. eslint-plugin-sonarjs is clean, and check-views, site-check and Asciidoctor on both documents pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/status/ROADMAP.adoc | 7 ++++--- docs/ultraplan/README.adoc | 3 ++- scripts/ultraplan/ultraplan.mjs | 17 ++++++++++------- tests/ultraplan/ultraplan.test.mjs | 15 +++++++++++++-- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 312f5e0d..770d4e6a 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -12,9 +12,10 @@ under <>. What comes next is drawn as a tech tree, the ultraplan (link:../ultraplan/generated/ultraplan.adoc[`docs/ultraplan/generated/ultraplan.adoc`], -from the data in `docs/ultraplan/`). Its frontier is the list of work that can -start now, and each advisor of the council names a pick from it. This roadmap keeps the -record of what happened; the tree says what each piece enables. +from the data in `docs/ultraplan/`). Its frontier is the work that is ready, to +start when an active slot is free, and each advisor of the council names a pick +from it. This roadmap keeps the record of what happened; the tree says what each +piece enables. === Applied Systems (2026-11-07) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 72d83e7f..68fd2ff5 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -43,7 +43,8 @@ Typed by hand: Derived by `scripts/ultraplan/ultraplan.mjs`, and never typed: * *Era*: the length of the longest chain of needs below a node. -* *Frontier*: the open nodes whose needs are all done, which can be started today. +* *Frontier*: the open nodes whose needs are all done. They are ready, and one can +start today whenever an active slot is free. * *Unlocks*: how many live nodes depend on a node, directly or through others. * *Forks*: nodes that enable two or more tracks, where work spreads. * *Confluences*: nodes that need two or more tracks, where work joins. diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 2b232287..7734a336 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -161,8 +161,10 @@ const EVIDENCE = { }, adr(ev, ctx) { if (!isStr(ev.adr) || !/^\d{4}$/.test(ev.adr)) return `evidence adr ${JSON.stringify(ev.adr)} is not a four-digit ADR number`; - const file = ctx.adrFile(ev.adr); - if (!file) return `no ADR ${ev.adr} in docs/decisions`; + const files = ctx.adrFiles(ev.adr); + if (!files.length) return `no ADR ${ev.adr} in docs/decisions`; + if (files.length > 1) return `ADR ${ev.adr} is ambiguous: ${files.join(', ')} share the number`; + const [file] = files; if (!ctx.isFile(file)) return `ADR ${ev.adr} (${file}) is not a file in the repository`; return adrAccepted(ctx.read(file)) ? null : `ADR ${ev.adr} is not Accepted`; }, @@ -519,7 +521,8 @@ function evidenceText(ev) { if (ev.claim) return `${ev.claim} at ${ev.min_pwg ?? 'PWG-3'} or above`; return `ADR ${ev.adr} accepted`; } -const marks = value => VALUE_KEYS.filter(k => value[k]).map(k => `${k} ${'โ—'.repeat(value[k])}`).join(', '); +// Every mark the data holds is shown, a 0 as an open circle: a 0 is a judgement too. +const marks = value => VALUE_KEYS.filter(k => Object.hasOwn(value, k)).map(k => `${k} ${'โ—'.repeat(value[k]) || 'โ—‹'}`).join(', '); function nodeLines(byId, advisors, d, n) { const facts = [`*Track:* ${trackKey(n.track)}`, `*Kind:* ${n.kind}`, `*Size:* ${n.size}`, `*Status:* ${n.status}`]; @@ -751,10 +754,10 @@ export function context(root = ROOT) { read, // No registry view means no claim is listed; one that leads outside the repository is refused. registry: existsSync(path.join(root, registry)) ? read(registry) : '', - adrFile: n => { - const f = existsSync(decisions) && readdirSync(decisions).find(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && !x.includes('template')); - return f ? `docs/decisions/${f}` : null; - }, + // Every decision record with this number (the template aside), in a fixed order. + adrFiles: n => (existsSync(decisions) ? readdirSync(decisions) : []) + .filter(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && !x.includes('template')) + .sort(cmp).map(x => `docs/decisions/${x}`), }; } diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 606bef1d..133181d6 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -77,6 +77,13 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(out[SVG]).toContain(' { + const page = generate(fixture({nodes: swap('paper', {value: {maths: 0, publications: 3}})}))[VIEW]; + expect(page).toContain('*Value (judgement):* maths โ—‹, publications โ—โ—โ—'); + const zero = generate(fixture({nodes: swap('paper', {value: {maths: 0}})}))[VIEW]; + expect(zero).toContain('*Value (judgement):* maths โ—‹'); +}); + test('the views are deterministic', () => { const a = generate(fixture()), b = generate(fixture()); expect(a[VIEW]).toBe(b[VIEW]); @@ -115,6 +122,10 @@ test('done needs evidence that holds', () => { expect(() => generate(reg)).toThrow(/docs\/atlas\/generated\/registry\.adoc is not a file in the repository/); refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); + // Two records with one number are refused, not picked between by directory order. + const twin = fixture(); + writeFileSync(path.join(twin, 'docs/decisions/0004-second.adoc'), '= ADR\n\n=== Status\n\n*Proposed.*\n'); + expect(() => generate(twin)).toThrow(/ADR 0004 is ambiguous: docs\/decisions\/0004-claims-registry\.adoc, docs\/decisions\/0004-second\.adoc share the number/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', min_pwg: 'PWG-1'}]})}, /min_pwg belongs to claim evidence only/); refuses({nodes: swap('tool', {evidence: [{adr: '0004', min_pwg: 'PWG-1'}]})}, /min_pwg belongs to claim evidence only/); @@ -297,8 +308,8 @@ test('return tickets are grafted or archived honestly', () => { test('the evidence parsers read the real registry view and ADRs', () => { const ctx = context(ROOT); expect(registryGrade(ctx.registry, 'hyperpolymath/mathesis#THY-1')).toMatch(/^PWG-/); - expect(adrAccepted(ctx.read(ctx.adrFile('0004')))).toBe(true); - expect(adrAccepted(ctx.read(ctx.adrFile('0005')))).toBe(false); + expect(adrAccepted(ctx.read(ctx.adrFiles('0004')[0]))).toBe(true); + expect(adrAccepted(ctx.read(ctx.adrFiles('0005')[0]))).toBe(false); }); test('the committed views match the committed data', () => { From 16df2404467d26e3cab182c654898889266f18eb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 13:37:06 +0000 Subject: [PATCH 15/41] ultraplan: answer Codex's review of 4440b8c All three findings were checked, and all three hold. Each fix was tested against Asciidoctor or just before it was made. - Links hold any node name. A <> link ends at the first ">>", so a name such as "a >> b" broke it. Links are now the xref:id[text] macro. Asciidoctor showed that this macro's text ends at "]" and turns into an attribute list at "=". It also showed that the old \| escape printed a backslash outside a table. So "|", "]" and "=" are written as character references, which render the same inside a table and outside one. The page source changes on every link line, but the rendered HTML is byte-identical to before, and all 152 links reach their anchors. - Only the boilerplate NNNN-template.adoc is set aside. Before, a record whose title said "template" (0006-template-inheritance.adoc) was hidden from the ADR lookup. - ultraplan-check depends on registry-check, so claim evidence is never checked against a stale registry view. check-views still runs registry-check once, before the ultraplan check, because just runs a dependency only once. Tests: 22 pass. Three new tests fail on 4440b8c. Disabling any of the 28 rules, or any of 45 other guards, fails a test. eslint-plugin-sonarjs is clean, and check-views, site-check and Asciidoctor on the generated page pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- Justfile | 6 +- docs/ultraplan/generated/ultraplan.adoc | 292 ++++++++++++------------ scripts/ultraplan/ultraplan.mjs | 12 +- tests/ultraplan/ultraplan.test.mjs | 18 +- 4 files changed, 176 insertions(+), 152 deletions(-) diff --git a/Justfile b/Justfile index 3128e8f2..8e3d8f5a 100644 --- a/Justfile +++ b/Justfile @@ -803,8 +803,10 @@ ultraplan: bun scripts/ultraplan/ultraplan.mjs build # Fail if the ultraplan views are stale, or the tree's data is not sound: an unknown -# or cyclic need, a done node without evidence that holds, too many active nodes -ultraplan-check: +# or cyclic need, a done node without evidence that holds, too many active nodes. +# Claim evidence is read from the registry view, so registry-check runs first: a +# stale view would let a done node rest on a grade the receipts no longer give. +ultraplan-check: registry-check bun scripts/ultraplan/ultraplan.mjs check bun test tests/ultraplan/ diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 18af7703..dae276b2 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -30,18 +30,18 @@ counts the live nodes that depend on it, directly or through others. [cols="3,1,1,1,5",options="header"] |=== |Node |Track |Size |Unlocks |Summary -|<> |ecosystem |M |8 |The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. -|<> |engineering |M |2 |A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. -|<> |economics |M |2 |A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. -|<> |maths |M |2 |A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). -|<> |maths |S |1 |The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. -|<> |ecosystem |S |1 |File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. _(upstream:Deducteam/agda2dedukti)_ -|<> |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. -|<> |maths |S |1 |Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). -|<> |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. -|<> |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. -|<> |science |L |0 |S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). -|<> |publications |M |0 |A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. +|xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] |ecosystem |M |8 |The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. +|xref:census-workflow[โฐ Census on a schedule] |engineering |M |2 |A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. +|xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] |economics |M |2 |A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. +|xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts] |maths |M |2 |A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). +|xref:dossier[๐Ÿ—‚๏ธ Theorem dossier] |maths |S |1 |The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. +|xref:file-transport-bugs[๐Ÿ› File the transport reproducers] |ecosystem |S |1 |File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. _(upstream:Deducteam/agda2dedukti)_ +|xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image] |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. +|xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone] |maths |S |1 |Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). +|xref:doc-drift-fix[๐Ÿงน Mend the status documents] |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. +|xref:paper-thy1[๐Ÿ“„ Note: feature reachability] |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. +|xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] |science |L |0 |S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). +|xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] |publications |M |0 |A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. |=== == The council @@ -54,61 +54,61 @@ nodes the owner has tagged. _Asks:_ Is it true, is it new, and does it join two things that were apart? -_Pick:_ <>. Equivalence as identity, made checkable. +_Pick:_ xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot]. Equivalence as identity, made checkable. === ๐Ÿ”ฌ Scientist _Asks:_ What would we measure, and what result would change our mind? -_Pick:_ <>. Takes a statistical result that is only tested and makes it a theorem. +_Pick:_ xref:statistical-bridge[๐ŸŽฒ From oracle to theorem]. Takes a statistical result that is only tested and makes it a theorem. === โš™๏ธ Engineer _Asks:_ Does it run in the gate, fail loudly, and stay cheap to keep? -_Pick:_ <>. +_Pick:_ xref:census-workflow[โฐ Census on a schedule]. === ๐Ÿช™ Economist _Asks:_ What does it cost, what does it return, and who would fund or use it? -_Pick:_ <>. A forecast that can say undecided is worth more than one that guesses. +_Pick:_ xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts]. A forecast that can say undecided is worth more than one that guesses. === ๐Ÿ“œ Publisher _Asks:_ Is there a paper, a talk or a citable artefact here? -_Pick:_ <>. A complete, small, checked result: the easiest first paper. +_Pick:_ xref:paper-thy1[๐Ÿ“„ Note: feature reachability]. A complete, small, checked result: the easiest first paper. === ๐Ÿ” Soundness auditor _Asks:_ Is every done backed by a receipt, and where is the hole? -_Pick:_ <>. The only road back to PWG-1 for THY-1 and APP-1 to APP-4. +_Pick:_ xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image]. The only road back to PWG-1 for THY-1 and APP-1 to APP-4. === ๐Ÿ—บ๏ธ Estate cartographer _Asks:_ Does another repository already have this, or need it? Converge rather than rebuild. -_Pick:_ <>. The first real convergence between repositories; everything cross-repo waits on it. +_Pick:_ xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot]. The first real convergence between repositories; everything cross-repo waits on it. === ๐ŸŽ Teacher _Asks:_ Could a newcomer learn something true and useful from it? -_Pick:_ <>. Shows why a proof matters to someone who reads spreadsheets, not theorems. +_Pick:_ xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. Shows why a proof matters to someone who reads spreadsheets, not theorems. === ๐Ÿƒ Contrarian _Asks:_ What if we took the other road? Which cheap node is everyone overlooking? -_Pick:_ <>. +_Pick:_ xref:file-transport-bugs[๐Ÿ› File the transport reproducers]. === ๐Ÿซถ Me _Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. -_Pick:_ <>. +_Pick:_ xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast]. == Forks and confluences @@ -117,36 +117,36 @@ nodes from two or more tracks: work there joins. Rivals are different routes to same place; the contrarian keeps the road not taken in view. .Forks -* <> -> <>, <>, <> -* <> -> <>, <>, <>, <> -* <> -> <>, <> -* <> -> <>, <>, <>, <>, <>, <>, <>, <> -* <> -> <>, <>, <>, <> -* <> -> <>, <>, <>, <>, <> -* <> -> <>, <>, <> -* <> -> <>, <>, <> -* <> -> <>, <>, <> -* <> -> <>, <>, <>, <> -* <> -> <>, <>, <>, <> -* <> -> <>, <>, <>, <> +* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] -> xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] +* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] +* xref:centre-computations[๐ŸŽฏ Centre computations] -> xref:concept-commons[๐Ÿ›๏ธ Concept commons], xref:corpus[๐Ÿงช Propose and dispose corpus] +* xref:claims-registry[๐Ÿ“’ Claims registry] -> xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] +* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] -> xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] +* xref:receipt-generator[๐Ÿญ Shared receipt generator] -> xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] +* xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] +* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] -> xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] +* xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:corpus[๐Ÿงช Propose and dispose corpus], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] +* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] -> xref:dossier[๐Ÿ—‚๏ธ Theorem dossier], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] +* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] -> xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti], xref:file-transport-bugs[๐Ÿ› File the transport reproducers], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] +* xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] .Confluences -* <> + <> -> <> -* <> + <> -> <> -* <> + <> -> <> -* <> + <> + <> -> <> -* <> + <> -> <> -* <> + <> + <> -> <> -* <> + <> -> <> -* <> + <> + <> -> <> -* <> + <> -> <> -* <> + <> -> <> -* <> + <> -> <> -* <> + <> -> <> +* xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences] + xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] -> xref:bridge-by-construction[๐Ÿ— Bridges by construction] +* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:centre-computations[๐ŸŽฏ Centre computations] +* xref:centre-computations[๐ŸŽฏ Centre computations] + xref:whats-owed[๐Ÿ“‹ What is owed] -> xref:concept-commons[๐Ÿ›๏ธ Concept commons] +* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + xref:centre-computations[๐ŸŽฏ Centre computations] + xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:corpus[๐Ÿงช Propose and dispose corpus] +* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + xref:file-transport-bugs[๐Ÿ› File the transport reproducers] -> xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] +* xref:corpus[๐Ÿงช Propose and dispose corpus] + xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign] + xref:ci-recorder[๐Ÿค– CI records its own runs] -> xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] +* xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts] + xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] -> xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] +* xref:receipt-generator[๐Ÿญ Shared receipt generator] + xref:claims-registry[๐Ÿ“’ Claims registry] + xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims] +* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability] +* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] +* xref:receipts[๐Ÿ” Proof receipts] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] +* xref:claims-registry[๐Ÿ“’ Claims registry] + xref:thy1[๐Ÿงญ THY-1: reachability is monotone] -> xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] .Rivals -* <> or <> -* <> or <> +* xref:bridge-by-construction[๐Ÿ— Bridges by construction] or xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] +* xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] or xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] == The eras @@ -159,7 +159,7 @@ The proof census of 465 public repositories: 249 rows of proof files, holes and *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* L ยท *Status:* done -*Enables:* <>, <>, <> + +*Enables:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views], xref:census-workflow[โฐ Census on a schedule], xref:claims-registry[๐Ÿ“’ Claims registry] + *Evidence:* `docs/atlas/census/rows.jsonl`; `scripts/census/run-census.sh` + *Value (judgement):* engineering โ—โ—, science โ—โ—, ecosystem โ—โ—โ— @@ -170,7 +170,7 @@ Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every comm *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* L ยท *Status:* done -*Enables:* <>, <>, <>, <> + +*Enables:* xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + *Evidence:* `scripts/check-proofs.sh`; `tests/proofs/gate_controls_test.sh` + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ— @@ -183,8 +183,8 @@ The cohort-economics model of the applied shelf, with three number modes and syn *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* M ยท *Status:* done -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] + +*Enables:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + *Evidence:* `verification/proofs/agda/Applied/Cohort.agda`; `applied-systems/methods/input-schema.adoc` + *Value (judgement):* maths โ—โ—, economics โ—โ—, teaching โ—โ— @@ -195,8 +195,8 @@ In a dependency graph with feature-guarded edges, a node unreachable with every *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done -*Needs:* <> + -*Enables:* <>, <>, <>, <> + +*Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] + +*Enables:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti], xref:file-transport-bugs[๐Ÿ› File the transport reproducers], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + *Evidence:* hyperpolymath/mathesis#THY-1 at PWG-2ii or above + *Value (judgement):* maths โ—โ—, engineering โ—โ—, publications โ—โ— @@ -207,8 +207,8 @@ The catalogue and the A to Z and organisation views, generated from the census r *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* M ยท *Status:* done -*Needs:* <> + -*Enables:* <>, <> + +*Needs:* xref:census[๐Ÿงพ Census of the estate] + +*Enables:* xref:site-build[๐Ÿ—๏ธ Atlas site (build)], xref:ultraplan[๐ŸŒณ The ultraplan] + *Evidence:* `docs/atlas/generated/catalogue.adoc`; `docs/atlas/generated/az.adoc` + *Value (judgement):* engineering โ—โ—, teaching โ—โ—, ecosystem โ—โ— @@ -219,8 +219,8 @@ A scheduled census workflow as the one writer of the census rows (WO 5.3), so re *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:census[๐Ÿงพ Census of the estate] + +*Enables:* xref:whats-owed[๐Ÿ“‹ What is owed] + *Value (judgement):* engineering โ—โ—, ecosystem โ—โ— + *See:* docs/proposals/mathesis-re-anchoring.adoc:1075 @@ -231,8 +231,8 @@ Pins 53 claims in their home repositories and derives each grade from the home r *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done -*Needs:* <> + -*Enables:* <>, <>, <>, <>, <>, <>, <>, <> + +*Needs:* xref:census[๐Ÿงพ Census of the estate] + +*Enables:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] + *Evidence:* ADR 0004 accepted; `docs/atlas/generated/registry.adoc` + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— @@ -243,8 +243,8 @@ Run the three proof lanes in a container image pinned by digest, the condition P *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] + +*Enables:* xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1] + *Value (judgement):* engineering โ—โ—, soundness โ—โ—โ— + *See:* docs/status/PROOF-STATUS.adoc:33 @@ -259,8 +259,8 @@ Missing inputs propagate and never read as zero; the cash identity; the least fu *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done -*Needs:* <> + -*Enables:* <>, <>, <> + +*Needs:* xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda] + +*Enables:* xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] + *Evidence:* hyperpolymath/mathesis#APP-1 at PWG-2ii or above; hyperpolymath/mathesis#APP-2 at PWG-2ii or above; hyperpolymath/mathesis#APP-3 at PWG-2ii or above; hyperpolymath/mathesis#APP-4 at PWG-2ii or above + *Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— @@ -271,8 +271,8 @@ Experiment X-PF1, pre-registered: list each rule, gate and report in the estate *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* active -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + +*Enables:* xref:token-order[โš–๏ธ Settle the order of status tokens] + *Value (judgement):* maths โ—โ—โ—, science โ—โ—, soundness โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:390; docs/proposals/mathesis-research-programme.adoc:458 @@ -286,8 +286,8 @@ The admission rule for theory no single system owns, with an append-only ledger *Track:* โˆ‘ maths ยท *Kind:* data ยท *Size:* S ยท *Status:* done -*Needs:* <>, <> + -*Enables:* <>, <>, <>, <> + +*Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + +*Enables:* xref:dossier[๐Ÿ—‚๏ธ Theorem dossier], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] + *Evidence:* `docs/theory/admissions.jsonl`; `docs/theory/ledger.jsonl` + *Value (judgement):* maths โ—โ—, soundness โ—โ— @@ -298,7 +298,7 @@ ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PW *Track:* โš™ engineering ยท *Kind:* decision ยท *Size:* S ยท *Status:* open -*Needs:* <> + +*Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + *Value (judgement):* teaching โ—, soundness โ—โ—โ— + *See:* docs/status/ROADMAP.adoc:30; docs/status/PROOF-NEEDS.adoc:27; README.adoc:46; .machine_readable/contractiles/intend @@ -312,8 +312,8 @@ The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* M ยท *Status:* done -*Needs:* <>, <> + -*Enables:* <>, <>, <> + +*Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix], xref:claims-registry[๐Ÿ“’ Claims registry] + +*Enables:* xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Evidence:* `verification/receipts/theory_praxis.deed` + *Value (judgement):* engineering โ—โ—, soundness โ—โ—โ— @@ -324,8 +324,8 @@ Renders every generated view with Asciidoctor and fails on any warning or broken *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views] + +*Enables:* xref:publish-atlas[๐ŸŒ Publish the atlas] + *Evidence:* `scripts/site/site.mjs` + *Value (judgement):* engineering โ—, teaching โ—โ— @@ -336,8 +336,8 @@ This tech tree: data first, with derived eras, frontier, forks, confluences and *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views] + +*Enables:* xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS] + *Evidence:* `docs/ultraplan/tree.jsonl`; `scripts/ultraplan/ultraplan.mjs` + *Value (judgement):* engineering โ—, teaching โ— @@ -348,8 +348,8 @@ Three unassessed candidate links between theorems in different repositories and *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* S ยท *Status:* done -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + +*Enables:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + *Evidence:* `docs/atlas/claims/bridges.jsonl` + *Value (judgement):* maths โ—โ—, ecosystem โ—โ—โ— @@ -360,8 +360,8 @@ File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option g *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* decision ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* upstream:Deducteam/agda2dedukti -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + +*Enables:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] + *Value (judgement):* engineering โ—, ecosystem โ—โ— + *See:* docs/status/ROADMAP.adoc:92; docs/proposals/mathesis-research-programme.adoc:693 @@ -374,8 +374,8 @@ A view of the standards requirements master list beside the census and the regis *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* open -*Needs:* <>, <> + -*Enables:* <> + +*Needs:* xref:census-workflow[โฐ Census on a schedule], xref:claims-registry[๐Ÿ“’ Claims registry] + +*Enables:* xref:concept-commons[๐Ÿ›๏ธ Concept commons] + *Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ—โ—โ— + *See:* docs/proposals/mathesis-re-anchoring.adoc:1079 @@ -388,8 +388,8 @@ The eight-item dossier for each theorem (Line 0), scored first on THY-1, five ja *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* S ยท *Status:* open -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + +*Enables:* xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] + *Value (judgement):* maths โ—, teaching โ—โ—, soundness โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:291; docs/proposals/mathesis-research-programme.adoc:1017 @@ -400,8 +400,8 @@ Positive evaluation of status is monotone. It holds for each ordered resource al *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* S ยท *Status:* open -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + +*Enables:* xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + *Value (judgement):* maths โ—โ—, soundness โ— + *See:* docs/proposals/mathesis-research-programme.adoc:368 @@ -414,8 +414,8 @@ A sound three-valued cash verdict over intervals, where missing means unbounded *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + +*Enables:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:792; docs/proposals/mathesis-research-programme.adoc:824 @@ -429,8 +429,8 @@ Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. *Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* open -*Needs:* <> + -*Enables:* <>, <>, <>, <> + +*Needs:* xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)] + +*Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Value (judgement):* maths โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:335; docs/atlas/generated/registry.adoc:39; metadatastician/standards 3-practice/PROOF-POLICY.adoc:348 (at 745fc74) @@ -444,8 +444,8 @@ Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambd *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* blocked ยท *Beyond this repository:* upstream:Deducteam/lambdapi -*Needs:* <>, <> + -*Rivals:* <> + +*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone], xref:file-transport-bugs[๐Ÿ› File the transport reproducers] + +*Rivals:* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + *Blocked by:* Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip. + *Value (judgement):* maths โ—, engineering โ—โ—, soundness โ—โ— + *See:* docs/status/ROADMAP.adoc:92 @@ -459,8 +459,8 @@ Adopt the standards generator: the receipt is generated from a run ledger, and t *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* active -*Needs:* <> + -*Enables:* <>, <>, <>, <>, <> + +*Needs:* xref:receipts[๐Ÿ” Proof receipts] + +*Enables:* xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ— * โš™๏ธ _Engineer:_ One generator for the estate instead of one per repository. @@ -472,7 +472,7 @@ S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are *Track:* ๐Ÿ”ฌ science ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open -*Needs:* <> + +*Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + *Value (judgement):* maths โ—โ—, science โ—โ—โ—, publications โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:641 @@ -485,8 +485,8 @@ A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the *Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* M ยท *Status:* open -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + +*Enables:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* engineering โ—, economics โ—โ—โ—, teaching โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:824; applied-systems/finance/liquidity/README.adoc @@ -499,7 +499,7 @@ A short note on THY-1: why requesting every feature is a sound check for absence *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open -*Needs:* <>, <> + +*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone], xref:receipts[๐Ÿ” Proof receipts] + *Value (judgement):* maths โ—, publications โ—โ—โ—, teaching โ— * ๐Ÿ“œ _Publisher:_ A complete, small, checked result: the easiest first paper. @@ -511,8 +511,8 @@ Deploy the built site (WO 4.3), once the owner says go. Publication is outward-f *Track:* ๐Ÿ“œ publications ยท *Kind:* view ยท *Size:* S ยท *Status:* blocked -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:site-build[๐Ÿ—๏ธ Atlas site (build)] + +*Enables:* xref:talk-atlas[๐ŸŽค Talk: an atlas of an estate] + *Blocked by:* the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk + *Value (judgement):* publications โ—โ—โ—, teaching โ—โ—, ecosystem โ—โ— + *See:* docs/status/ROADMAP.adoc:262; docs/proposals/mathesis-re-anchoring.adoc:1058 @@ -527,7 +527,7 @@ A worked tutorial: a small business model where missing data stays missing, with *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open -*Needs:* <> + +*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + *Value (judgement):* economics โ—, publications โ—โ—, teaching โ—โ—โ— * ๐ŸŽ _Teacher:_ Shows why a proof matters to someone who reads spreadsheets, not theorems. @@ -539,8 +539,8 @@ The full bridge record for two pilots, a squeakwell ladder row and resource-alge *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* M ยท *Status:* open -*Needs:* <> + -*Enables:* <>, <>, <>, <> + +*Needs:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates] + +*Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + *Value (judgement):* maths โ—โ—, science โ—, ecosystem โ—โ—โ— + *See:* docs/proposals/mathesis-re-anchoring.adoc:803; docs/proposals/mathesis-re-anchoring.adoc:1071 @@ -554,7 +554,7 @@ The tech tree as one panel type in GELS, beside the work-queue lanes and the Pla *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked ยท *Beyond this repository:* estate:metadatastician/gels -*Needs:* <>, <> + +*Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:ultraplan[๐ŸŒณ The ultraplan] + *Blocked by:* the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then publishes a read-only I-JSON/JCS feed and GELS renders it + *Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— @@ -567,8 +567,8 @@ Over locked bridges: classes under a criterion, their order, contradictions, and *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* L ยท *Status:* open -*Needs:* <>, <> + -*Enables:* <>, <> + +*Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot], xref:token-order[โš–๏ธ Settle the order of status tokens] + +*Enables:* xref:concept-commons[๐Ÿ›๏ธ Concept commons], xref:corpus[๐Ÿงช Propose and dispose corpus] + *Value (judgement):* maths โ—โ—โ—, science โ—โ— + *See:* docs/proposals/mathesis-re-anchoring.adoc:786 @@ -579,9 +579,9 @@ The status tokens form a ResourceAlgebra and dioid with an annihilating zero, wi *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open -*Needs:* <>, <> + -*Enables:* <>, <>, <> + -*Rivals:* <> + +*Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:token-order[โš–๏ธ Settle the order of status tokens] + +*Enables:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + +*Rivals:* xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + *Value (judgement):* maths โ—โ—โ—, publications โ—โ—, soundness โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:346; docs/proposals/mathesis-research-programme.adoc:544 @@ -595,8 +595,8 @@ The Proof Witness Grade is a total monotone function of the receipt, and the can *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open -*Needs:* <>, <> + -*Enables:* <>, <>, <> + +*Needs:* xref:receipts[๐Ÿ” Proof receipts], xref:token-order[โš–๏ธ Settle the order of status tokens] + +*Enables:* xref:corpus[๐Ÿงช Propose and dispose corpus], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + *Value (judgement):* maths โ—โ—, engineering โ—โ—, soundness โ—โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:378; docs/proposals/mathesis-research-programme.adoc:550 @@ -609,8 +609,8 @@ A trusted publisher that writes each green run's ledger rows to the repository, *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + +*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—, ecosystem โ—โ— [[januskey-slice]] @@ -620,7 +620,7 @@ Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 *Track:* โš™ engineering ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/januskey -*Needs:* <> + +*Needs:* xref:dossier[๐Ÿ—‚๏ธ Theorem dossier] + *Value (judgement):* maths โ—, engineering โ—โ—โ—, soundness โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:743; docs/proposals/mathesis-research-programme.adoc:755 @@ -631,7 +631,7 @@ THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the p *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* S ยท *Status:* open -*Needs:* <>, <> + +*Needs:* xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipt-generator[๐Ÿญ Shared receipt generator] + *Value (judgement):* publications โ—, soundness โ—โ— [[superseded-manifests-option]] @@ -641,7 +641,7 @@ A generator option in standards that keeps the inputs digest, manifest and axiom *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards -*Needs:* <> + +*Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + *Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ— + *See:* metadatastician/standards#1705 (draft): RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, set alike for --write and --check @@ -655,8 +655,8 @@ A closed, tested list of the ways the same statement differs between Agda, Rocq *Track:* ๐Ÿ”ฌ science ยท *Kind:* data ยท *Size:* M ยท *Status:* open -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + +*Enables:* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + *Value (judgement):* maths โ—, science โ—โ—โ—, publications โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:609; docs/proposals/mathesis-research-programme.adoc:679 @@ -670,8 +670,8 @@ The liquidity part of the applied shelf: a forecast whose every verdict carries *Track:* ๐Ÿช™ economics ยท *Kind:* view ยท *Size:* M ยท *Status:* open -*Needs:* <>, <> + -*Enables:* <> + +*Needs:* xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] + +*Enables:* xref:value-of-information[๐Ÿ”ญ Value of information] + *Value (judgement):* economics โ—โ—โ—, publications โ—, teaching โ—โ— [[talk-atlas]] @@ -681,7 +681,7 @@ A talk on mapping the mathematics of hundreds of repositories, with every status *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* S ยท *Status:* open -*Needs:* <> + +*Needs:* xref:publish-atlas[๐ŸŒ Publish the atlas] + *Value (judgement):* publications โ—โ—, teaching โ—โ—, ecosystem โ— [[echo-mirrors]] @@ -691,7 +691,7 @@ Bridge records for the six languages that mirror echo-types (E-2.5), with the gr *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/echo-types -*Needs:* <> + +*Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + *Value (judgement):* maths โ—โ—, ecosystem โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:695 @@ -702,8 +702,8 @@ Home repositories re-record their receipts (WO 5.1): secret-types and lintel for *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/secret-types -*Needs:* <> + -*Enables:* <> + +*Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + +*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* soundness โ—โ—, ecosystem โ—โ—โ— + *See:* docs/status/ROADMAP.adoc:330; docs/proposals/mathesis-re-anchoring.adoc:1065 @@ -716,8 +716,8 @@ Prove only the morphism here, and take the dioid laws from resource-algebra's E- *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/resource-algebra -*Needs:* <>, <> + -*Rivals:* <> + +*Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot], xref:token-order[โš–๏ธ Settle the order of status tokens] + +*Rivals:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + *Value (judgement):* maths โ—โ—, engineering โ—, ecosystem โ—โ—โ— * ๐Ÿ—บ๏ธ _Estate cartographer:_ Converge: the laws exist, at a grade, in their home repository. @@ -731,7 +731,7 @@ The horizon of the atlas (M4): a commons of the estate's concepts, navigable by *Track:* โˆ‘ maths ยท *Kind:* view ยท *Size:* XL ยท *Status:* open -*Needs:* <>, <> + +*Needs:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:whats-owed[๐Ÿ“‹ What is owed] + *Value (judgement):* maths โ—โ—, teaching โ—โ—โ—, ecosystem โ—โ— + *See:* docs/proposals/mathesis-re-anchoring.adoc:441; docs/proposals/estate-mathematical-architecture.adoc:158 @@ -742,9 +742,9 @@ Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E- *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* open -*Needs:* <>, <> + -*Enables:* <> + -*Rivals:* <> + +*Needs:* xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + +*Enables:* xref:corpus[๐Ÿงช Propose and dispose corpus] + +*Rivals:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] + *Value (judgement):* maths โ—โ—, engineering โ—โ—โ—, publications โ— + *See:* docs/proposals/mathesis-research-programme.adoc:620; docs/proposals/mathesis-research-programme.adoc:690 @@ -757,7 +757,7 @@ Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards -*Needs:* <> + +*Needs:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + *Value (judgement):* maths โ—, engineering โ—โ—, ecosystem โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:760 @@ -768,7 +768,7 @@ Decision science on the shelf: what a missing input is worth to know, computed f *Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* L ยท *Status:* open -*Needs:* <> + +*Needs:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* maths โ—โ—, science โ—โ—, economics โ—โ—โ— + *See:* applied-systems/decision-science/README.adoc @@ -779,7 +779,7 @@ A methods paper: proof status derived from machine receipts, graded by witness c *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open -*Needs:* <>, <>, <> + +*Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:claims-registry[๐Ÿ“’ Claims registry], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Value (judgement):* engineering โ—, publications โ—โ—โ—, soundness โ—โ— [[paper-status-algebra]] @@ -789,7 +789,7 @@ S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open -*Needs:* <>, <>, <> + +*Needs:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Value (judgement):* maths โ—โ—โ—, publications โ—โ—โ— === ๐ŸŒ€ Era 6: Grothendieck @@ -801,8 +801,8 @@ A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theor *Track:* ๐Ÿ”ฌ science ยท *Kind:* method ยท *Size:* XL ยท *Status:* open -*Needs:* <>, <>, <> + -*Enables:* <> + +*Needs:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:centre-computations[๐ŸŽฏ Centre computations], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + +*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* maths โ—โ—, engineering โ—โ—, science โ—โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:891 @@ -815,7 +815,7 @@ The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* XL ยท *Status:* open -*Needs:* <>, <>, <> + +*Needs:* xref:corpus[๐Ÿงช Propose and dispose corpus], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:ci-recorder[๐Ÿค– CI records its own runs] + *Value (judgement):* maths โ—โ—, science โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— + *See:* docs/proposals/mathesis-research-programme.adoc:883; docs/proposals/mathesis-research-programme.adoc:903 @@ -831,13 +831,13 @@ No trip is out. Nodes whose work lands in another repository. They are listed here so they can be carried to that repository, not done here. -* estate:hyperpolymath/echo-types: <> (open) -* estate:hyperpolymath/januskey: <> (open) -* estate:hyperpolymath/resource-algebra: <> (open) -* estate:hyperpolymath/secret-types: <> (open) -* estate:metadatastician/gels: <> (blocked) -* estate:metadatastician/standards: <> (open) -* estate:metadatastician/standards: <> (open) -* estate:metadatastician/standards: <> (open) -* upstream:Deducteam/agda2dedukti: <> (open) -* upstream:Deducteam/lambdapi: <> (blocked) +* estate:hyperpolymath/echo-types: xref:echo-mirrors[๐Ÿชž Echo mirror records] (open) +* estate:hyperpolymath/januskey: xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] (open) +* estate:hyperpolymath/resource-algebra: xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] (open) +* estate:hyperpolymath/secret-types: xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign] (open) +* estate:metadatastician/gels: xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS] (blocked) +* estate:metadatastician/standards: xref:ci-recorder[๐Ÿค– CI records its own runs] (open) +* estate:metadatastician/standards: xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws] (open) +* estate:metadatastician/standards: xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] (open) +* upstream:Deducteam/agda2dedukti: xref:file-transport-bugs[๐Ÿ› File the transport reproducers] (open) +* upstream:Deducteam/lambdapi: xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] (blocked) diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 7734a336..f59c7a81 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -417,7 +417,12 @@ export function derive(byId, advisors) { // The page is a list of sections; each section is a list of lines. const cell = s => String(s).replaceAll('|', String.raw`\|`); const nameOf = (byId, id) => `${byId.get(id).glyph} ${byId.get(id).name}`; -const xref = (byId, id) => `<<${id},${cell(nameOf(byId, id))}>>`; +// A link to a node, as the xref macro. Its text may hold anything but a few +// characters, written as character references so they mean the same everywhere, +// in a table or not: "|" (a table cell's end), "]" (the macro's end) and "=" +// (which makes the text an attribute list). "<>" cannot hold ">>". +const linkText = s => String(s).replaceAll('|', '|').replaceAll(']', ']').replaceAll('=', '='); +const xref = (byId, id) => `xref:${id}[${linkText(nameOf(byId, id))}]`; const xrefs = (byId, ids, sep = ', ') => ids.map(t => xref(byId, t)).join(sep); const orNone = (items, none) => (items.length ? items : [none]); const trackKey = t => `${TRACK_GLYPH[t]} ${t}`; @@ -754,9 +759,10 @@ export function context(root = ROOT) { read, // No registry view means no claim is listed; one that leads outside the repository is refused. registry: existsSync(path.join(root, registry)) ? read(registry) : '', - // Every decision record with this number (the template aside), in a fixed order. + // Every decision record with this number, in a fixed order. Only the boilerplate + // NNNN-template.adoc is set aside; a record such as 0006-template-inheritance.adoc counts. adrFiles: n => (existsSync(decisions) ? readdirSync(decisions) : []) - .filter(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && !x.includes('template')) + .filter(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && x !== `${n}-template.adoc`) .sort(cmp).map(x => `docs/decisions/${x}`), }; } diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 133181d6..5f0d7765 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -64,7 +64,7 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(d.picks.get('contrarian').id).toBe('cheap'); // rated lowest by the council expect(d.picks.get('me').id).toBe('theorem'); // tagged owner_value, no notes expect(out[VIEW]).toContain('== Research now: the frontier'); - expect(out[VIEW]).toContain('_Pick:_ <>. The deep one.'); + expect(out[VIEW]).toContain('_Pick:_ xref:theorem[๐Ÿ”ท theorem]. The deep one.'); expect(out[SVG].startsWith(''); // Three eras are narrower than the legend; the canvas still holds the legend. @@ -77,6 +77,14 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(out[SVG]).toContain(' { + // `<>` ends at ">>"; the xref macro's text ends at "]", turns into attributes at "=", + // and a table cell ends at "|". Those three are character references, so the link text is the name. + const page = generate(fixture({nodes: swap('theorem', {name: 'a >> b = c ] d | e'})}))[VIEW]; + expect(page).toContain('xref:theorem[๐Ÿ”ท a >> b = c ] d | e]'); + expect(page).not.toContain('< { const page = generate(fixture({nodes: swap('paper', {value: {maths: 0, publications: 3}})}))[VIEW]; expect(page).toContain('*Value (judgement):* maths โ—‹, publications โ—โ—โ—'); @@ -126,6 +134,14 @@ test('done needs evidence that holds', () => { const twin = fixture(); writeFileSync(path.join(twin, 'docs/decisions/0004-second.adoc'), '= ADR\n\n=== Status\n\n*Proposed.*\n'); expect(() => generate(twin)).toThrow(/ADR 0004 is ambiguous: docs\/decisions\/0004-claims-registry\.adoc, docs\/decisions\/0004-second\.adoc share the number/); + // Only the boilerplate NNNN-template.adoc is set aside: a record whose title says template counts, + // and a template that shares a number with a record does not make it ambiguous. + const titled = fixture({nodes: swap('tool', {evidence: [{adr: '0006'}]})}); + writeFileSync(path.join(titled, 'docs/decisions/0006-template-inheritance.adoc'), '= ADR\n\n=== Status\n\n*Accepted.*\n'); + expect(() => generate(titled)).not.toThrow(); + const boiler = fixture(); + writeFileSync(path.join(boiler, 'docs/decisions/0004-template.adoc'), '= Template\n\n=== Status\n\nProposed\n'); + expect(() => generate(boiler)).not.toThrow(); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', min_pwg: 'PWG-1'}]})}, /min_pwg belongs to claim evidence only/); refuses({nodes: swap('tool', {evidence: [{adr: '0004', min_pwg: 'PWG-1'}]})}, /min_pwg belongs to claim evidence only/); From 9e2bf6377df66f84c76a364857e13092a14e3d4f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 13:42:53 +0000 Subject: [PATCH 16/41] ultraplan: the lineage option has landed in standards standards#1705 is merged at 84c2d1c. I checked this on standards main: 84c2d1c is its head, and the generator's digest there matches the coordinator's message. hyperpolymath/mathesis#122 now turns the option on (5121dd8). The superseded-manifests-option node no longer calls #1705 a draft, and its remaining work is in this repository, so it no longer points at standards. It stays open, because its need (the receipt generator, #122) is not done yet. It is done when #122 merges. check-views, site-check, the I-JSON gate and the 22 ultraplan tests pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/generated/tree.svg | 4 ++-- docs/ultraplan/generated/ultraplan.adoc | 7 +++---- docs/ultraplan/tree.jsonl | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index 292753b9..61c046ee 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -443,11 +443,11 @@ ๐ŸŒฑ -Keep superseded manifests (option): A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest. +Keep superseded manifests (option): A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges. ๐Ÿ—„๏ธ Keep superseded manifโ€ฆ -โš™ engineering ยท S ยท ๐ŸŒ +โš™ engineering ยท S ๐ŸŒฑ diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index dae276b2..42bb955b 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -637,13 +637,13 @@ THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the p [[superseded-manifests-option]] ==== ๐ŸŒฑ ๐Ÿ—„๏ธ Keep superseded manifests (option) -A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest. +A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges. -*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* S ยท *Status:* open *Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + *Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ— + -*See:* metadatastician/standards#1705 (draft): RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, set alike for --write and --check +*See:* metadatastician/standards#1705, merged at 84c2d1c; hyperpolymath/mathesis#122 turns it on: RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, alike for --write and --check * ๐Ÿƒ _Contrarian:_ The ledger already holds every digest; check the option earns its keep. * ๐Ÿ” _Soundness auditor:_ Lineage you can re-check without git archaeology. @@ -838,6 +838,5 @@ carried to that repository, not done here. * estate:metadatastician/gels: xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS] (blocked) * estate:metadatastician/standards: xref:ci-recorder[๐Ÿค– CI records its own runs] (open) * estate:metadatastician/standards: xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws] (open) -* estate:metadatastician/standards: xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] (open) * upstream:Deducteam/agda2dedukti: xref:file-transport-bugs[๐Ÿ› File the transport reproducers] (open) * upstream:Deducteam/lambdapi: xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] (blocked) diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index 10dc74a6..e3858636 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -41,7 +41,7 @@ {"counsel":{"economics":"A forecast that can say undecided is worth more than one that guesses.","teacher":"Three-valued logic with money attached: an easy story to teach."},"glyph":"๐ŸŒฆ๏ธ","id":"s4-s5-verdict","kind":"theorem","name":"S-4 and S-5: honest cash verdicts","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:792","docs/proposals/mathesis-research-programme.adoc:824"],"size":"M","status":"open","summary":"A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2).","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} {"evidence":[{"path":"scripts/site/site.mjs"}],"glyph":"๐Ÿ—๏ธ","id":"site-build","kind":"view","name":"Atlas site (build)","needs":["atlas-views"],"size":"S","status":"done","summary":"Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy.","track":"engineering","value":{"engineering":1,"teaching":2}} {"counsel":{"science":"Takes a statistical result that is only tested and makes it a theorem."},"glyph":"๐ŸŽฒ","id":"statistical-bridge","kind":"theorem","name":"From oracle to theorem","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:641"],"size":"L","status":"open","summary":"S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6).","track":"science","value":{"maths":2,"publications":2,"science":3}} -{"counsel":{"contrarian":"The ledger already holds every digest; check the option earns its keep.","soundness":"Lineage you can re-check without git archaeology."},"glyph":"๐Ÿ—„๏ธ","id":"superseded-manifests-option","kind":"tool","name":"Keep superseded manifests (option)","needs":["receipt-generator"],"refs":["metadatastician/standards#1705 (draft): RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, set alike for --write and --check"],"size":"S","status":"open","summary":"A generator option in standards that keeps the inputs digest, manifest and axioms on superseded receipts. Mathesis turns it on once it lands (owner ruling 2026-11-24); until then the run ledger keeps each digest.","track":"engineering","value":{"ecosystem":1,"engineering":1,"soundness":2},"where":"estate:metadatastician/standards"} +{"counsel":{"contrarian":"The ledger already holds every digest; check the option earns its keep.","soundness":"Lineage you can re-check without git archaeology."},"glyph":"๐Ÿ—„๏ธ","id":"superseded-manifests-option","kind":"tool","name":"Keep superseded manifests (option)","needs":["receipt-generator"],"refs":["metadatastician/standards#1705, merged at 84c2d1c","hyperpolymath/mathesis#122 turns it on: RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, alike for --write and --check"],"size":"S","status":"open","summary":"A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges.","track":"engineering","value":{"ecosystem":1,"engineering":1,"soundness":2}} {"glyph":"๐ŸŽค","id":"talk-atlas","kind":"paper","name":"Talk: an atlas of an estate","needs":["publish-atlas"],"owner_value":"high","size":"S","status":"open","summary":"A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt.","track":"publications","value":{"ecosystem":1,"publications":2,"teaching":2}} {"counsel":{"teacher":"Shows why a proof matters to someone who reads spreadsheets, not theorems."},"glyph":"๐Ÿ““","id":"teaching-cohort","kind":"paper","name":"Cohort economics, taught","needs":["app-proofs"],"owner_value":"high","size":"M","status":"open","summary":"A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only.","track":"publications","value":{"economics":1,"publications":2,"teaching":3}} {"evidence":[{"path":"docs/theory/admissions.jsonl"},{"path":"docs/theory/ledger.jsonl"}],"glyph":"๐Ÿ“š","id":"theory-shelf","kind":"data","name":"Theory shelf and ledger","needs":["claims-registry","thy1"],"size":"S","status":"done","summary":"The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far.","track":"maths","value":{"maths":2,"soundness":2}} From e6f0f41cc715ee3bd3bc6cb9110d32beac028262 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 13:56:36 +0000 Subject: [PATCH 17/41] ultraplan: the me advisor names no public pick (owner ruling) The owner ruled on 2026-11-24, through the selector, that the private me advisor names no public pick. The page lists the frontier nodes the owner tagged, in id order and unranked. The owner chooses in the private GELS panel, where the me advisor's notes also live. Codex had shown that the advisor ranked the tagged nodes by the mathematician's mark, and 3964c96 had replaced that with the council's order. With this ruling the public page carries no ranking of the owner's priorities at all. It lists Thirteen-week forecast, Note: feature reachability and Cohort economics taught. - derive() gives the me advisor no pick, and adds ownerTagged, the tagged frontier in id order. - The council section says the me advisor's choice stays outside the repository, and gives the list, or says that nothing tagged is on the frontier. - The README and the ROADMAP ruling say the same. Tests: 22 pass. The ranking test became a test of the list: neither unlocks nor marks order it. Disabling any of the 28 rules, or any of 48 other guards, fails a test. eslint-plugin-sonarjs is clean, and check-views, site-check and Asciidoctor on the changed pages pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/status/ROADMAP.adoc | 3 ++- docs/ultraplan/README.adoc | 9 +++++---- docs/ultraplan/generated/ultraplan.adoc | 8 ++++---- scripts/ultraplan/ultraplan.mjs | 22 ++++++++++++++++------ tests/ultraplan/ultraplan.test.mjs | 15 +++++++++++---- 5 files changed, 38 insertions(+), 19 deletions(-) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 770d4e6a..04bc5ea0 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -421,7 +421,8 @@ scheduled census, a view of what each repository owes cartographer, teacher, contrarian). ** The me advisor is private. Its notes stay outside this repository and every feed, in a private GELS panel the owner owns, and a node carries at most the - tag `owner_value`. + tag `owner_value`. It names no public pick: the page lists the tagged + frontier nodes unranked, and the owner chooses in that panel. ** Off-tree trips are return tickets: each is grafted onto the tree or archived with what it taught. ** The GELS maths panel waits on the GELS feed/panel contract, which the GELS diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 68fd2ff5..ac9d54c3 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -78,7 +78,8 @@ publisher, and "me"); The generator requires only the me advisor, because the page's privacy claim rests on it. Who else sits on the council is the owner's to change in the data. -Each asks one question of every node. Each names one pick from the frontier: +Each asks one question of every node. Each names one pick from the frontier, +except the me advisor: * An advisor that reads a value mark ranks the frontier nodes it marks above zero: by the mark, then by how much the node unlocks, then by value for effort @@ -91,9 +92,9 @@ unlocks the most. That keeps the road not taken in view. are kept privately, outside this public repository and out of every feed: in a private panel of GELS that the owner owns (owner ruling 2026-11-24). A node carries at most the neutral tag `"owner_value":"high"`, and the generator refuses any counsel under -the key `me`. The me advisor reads no value mark, since another advisor's mark -is not the owner's preference. Among the frontier nodes the owner tagged, it -names the one that unlocks the most, then the one with the best value for effort. +the key `me`. The me advisor names no public pick (owner ruling 2026-11-24): the +owner chooses in the private GELS panel, and the page lists, in id order and +unranked, the frontier nodes the owner tagged. == Wandering: return tickets diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 42bb955b..eb44c35c 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -46,9 +46,9 @@ counts the live nodes that depend on it, directly or through others. == The council -Each advisor asks one question of every node and names one pick from the frontier. -The me advisor is private: its notes stay outside this repository, and it names only -nodes the owner has tagged. +Each advisor asks one question of every node and names one pick from the frontier, +except the me advisor. It is private: its notes and its choice stay outside this +repository, and the page lists, unranked, the frontier nodes the owner has tagged. === โˆ‘ Mathematician @@ -108,7 +108,7 @@ _Pick:_ xref:file-transport-bugs[๐Ÿ› File the transport reproducers]. _Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. -_Pick:_ xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast]. +_No public pick:_ the owner chooses in a private GELS panel. Tagged on the frontier, in id order: xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. == Forks and confluences diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index f59c7a81..88de92a2 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -366,7 +366,9 @@ function pickFor(a, frontier, total, leverage) { const council = (x, y) => leverage(y.id) - leverage(x.id) || total(y) / SIZES[y.size] - total(x) / SIZES[x.size] || cmp(x.id, y.id); const byKey = k => (x, y) => (y.value?.[k] ?? 0) - (x.value?.[k] ?? 0) || council(x, y); if (a.id === 'contrarian') return first(frontier, (x, y) => total(x) - total(y) || leverage(y.id) - leverage(x.id) || cmp(x.id, y.id)); - if (a.private) return first(frontier.filter(n => n.owner_value === 'high'), council); + // The me advisor names no public pick (owner ruling 2026-11-24): the owner chooses in a + // private GELS panel, and the page lists the tagged frontier unranked (ownerTagged). + if (a.private) return null; if (a.reads) return first(frontier.filter(n => (n.value?.[a.reads] ?? 0) > 0), byKey(a.reads)); return null; } @@ -410,7 +412,9 @@ export function derive(byId, advisors) { for (const n of nodes) for (const r of list(n.rivals)) if (n.id < r) rivalries.push([n.id, r]); const picks = new Map(advisors.map(a => [a.id, pickFor(a, frontier, total, leverage)])); - return {children, depth, below, frontier, forks, confluences, rivalries, picks, leverage, total, slots}; + // The frontier nodes the owner tagged, in id order: a list, never a ranking. + const ownerTagged = frontier.filter(n => n.owner_value === 'high').sort(byNodeId); + return {children, depth, below, frontier, forks, confluences, rivalries, picks, ownerTagged, leverage, total, slots}; } // โ”€โ”€ Rendering: AsciiDoc โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ @@ -489,15 +493,21 @@ function pickLine(byId, a, p) { const note = p.counsel?.[a.id]; return `_Pick:_ ${xref(byId, p.id)}${note ? '. ' + note : '.'}`; } +// The me advisor's line: its choice is made privately, so the page shows only what the +// owner tagged, unranked. +function privateLine(byId, d) { + const tagged = d.ownerTagged.length ? `Tagged on the frontier, in id order: ${xrefs(byId, d.ownerTagged.map(n => n.id))}.` : 'Nothing tagged is on the frontier.'; + return `_No public pick:_ the owner chooses in a private GELS panel. ${tagged}`; +} function councilLines(byId, advisors, d) { return [ '== The council', '', - 'Each advisor asks one question of every node and names one pick from the frontier.', - 'The me advisor is private: its notes stay outside this repository, and it names only', - 'nodes the owner has tagged.', + 'Each advisor asks one question of every node and names one pick from the frontier,', + 'except the me advisor. It is private: its notes and its choice stay outside this', + 'repository, and the page lists, unranked, the frontier nodes the owner has tagged.', '', - ...advisors.flatMap(a => [`=== ${a.glyph} ${a.name}`, '', `_Asks:_ ${a.asks}`, '', pickLine(byId, a, d.picks.get(a.id)), '']), + ...advisors.flatMap(a => [`=== ${a.glyph} ${a.name}`, '', `_Asks:_ ${a.asks}`, '', a.private ? privateLine(byId, d) : pickLine(byId, a, d.picks.get(a.id)), '']), ]; } diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 5f0d7765..c88a9339 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -62,9 +62,11 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(d.picks.get('maths').id).toBe('theorem'); expect(d.picks.get('engineering').id).toBe('cheap'); expect(d.picks.get('contrarian').id).toBe('cheap'); // rated lowest by the council - expect(d.picks.get('me').id).toBe('theorem'); // tagged owner_value, no notes + expect(d.picks.get('me')).toBe(null); // no public pick (owner ruling 2026-11-24) + expect(d.ownerTagged.map(n => n.id)).toEqual(['theorem']); // tagged owner_value, no notes expect(out[VIEW]).toContain('== Research now: the frontier'); expect(out[VIEW]).toContain('_Pick:_ xref:theorem[๐Ÿ”ท theorem]. The deep one.'); + expect(out[VIEW]).toContain('_No public pick:_ the owner chooses in a private GELS panel. Tagged on the frontier, in id order: xref:theorem[๐Ÿ”ท theorem].'); expect(out[SVG].startsWith(''); // Three eras are narrower than the legend; the canvas still holds the legend. @@ -271,10 +273,15 @@ test('every rule has a witness', () => { expect(unwitnessed).toEqual([]); }); -test('the me advisor ranks the owner\'s tags as the council does, not by another advisor\'s mark', () => { - // cheap carries the higher maths mark; theorem unlocks two nodes and cheap none. +test('the me advisor names no public pick, and lists the owner\'s tags unranked', () => { + // theorem unlocks more and cheap carries the higher maths mark: neither orders the list. const nodes = swap('cheap', {owner_value: 'high', value: {maths: 3}}, swap('theorem', {value: {maths: 1}})); - expect(generate(fixture({nodes})).derived.picks.get('me').id).toBe('theorem'); + const out = generate(fixture({nodes})); + expect(out.derived.picks.get('me')).toBe(null); + expect(out.derived.ownerTagged.map(n => n.id)).toEqual(['cheap', 'theorem']); + expect(out[VIEW]).toContain('Tagged on the frontier, in id order: xref:cheap[๐Ÿ”ท cheap], xref:theorem[๐Ÿ”ท theorem].'); + const none = generate(fixture({nodes: swap('theorem', {owner_value: undefined})}))[VIEW]; + expect(none).toContain('_No public pick:_ the owner chooses in a private GELS panel. Nothing tagged is on the frontier.'); }); test('when every active slot is taken, the frontier is ready but cannot start', () => { From 25992cf3370bea58c4e53807cce2c2c532313dc4 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 14:14:34 +0000 Subject: [PATCH 18/41] ultraplan: answer the reviews of e6f0f41 Codex and CodeRabbit raised the same point, and Codex one more. Each was checked against the code, and all hold. - The me advisor's exception is stated everywhere. The README's list of derived fields, the ROADMAP's introduction and the CHANGELOG still promised a pick from every advisor. Each now says the private me advisor names none and the page lists the owner's tags unranked. - A claim cited as evidence follows the registry's own rule. The generator allowed only one hyphen then letters and digits, so an id the registry accepts, such as N-7.1 or THY-1-A, could not be cited. The registry now exports its rule, isClaimId: OWNER/REPO, then '#', then a non-empty claim. The registry's row check and the ultraplan both use it, so the two cannot drift apart. - CodeRabbit's nit: the member-name noncharacter test replaced the first "maths", which JCS puts in the track's value, not in a member name. It now replaces "maths": so it tests a member name. Tests: 98 pass across the ultraplan and registry suites. The claim-id test fails on e6f0f41. Disabling any of the 28 rules, or any of 49 other guards, fails a test. eslint-plugin-sonarjs is clean, and check-views, site-check and Asciidoctor on the changed docs pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 3 ++- docs/status/ROADMAP.adoc | 4 ++-- docs/ultraplan/README.adoc | 3 ++- scripts/registry/claims-registry.mjs | 11 ++++++++++- scripts/ultraplan/ultraplan.mjs | 4 +++- tests/ultraplan/ultraplan.test.mjs | 7 ++++++- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 780a472a..4ab11a2a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -80,7 +80,8 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. + `scripts/ultraplan/ultraplan.mjs` generates `generated/ultraplan.adoc` and a picture, `generated/tree.svg`. They show the eras, the frontier, the forks, - the confluences and each advisor's pick, all derived and none typed. + the confluences and each advisor's pick (the private me advisor names none), all + derived and none typed. + The generator refuses: ** a done node without evidence that holds: a file, a claim grade the diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 04bc5ea0..9dc85614 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -13,8 +13,8 @@ under <>. What comes next is drawn as a tech tree, the ultraplan (link:../ultraplan/generated/ultraplan.adoc[`docs/ultraplan/generated/ultraplan.adoc`], from the data in `docs/ultraplan/`). Its frontier is the work that is ready, to -start when an active slot is free, and each advisor of the council names a pick -from it. This roadmap keeps the record of what happened; the tree says what each +start when an active slot is free, and each advisor of the council, except the +private me advisor, names a pick from it. This roadmap keeps the record of what happened; the tree says what each piece enables. === Applied Systems (2026-11-07) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index ac9d54c3..8e6d1885 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -48,7 +48,8 @@ start today whenever an active slot is free. * *Unlocks*: how many live nodes depend on a node, directly or through others. * *Forks*: nodes that enable two or more tracks, where work spreads. * *Confluences*: nodes that need two or more tracks, where work joins. -* *Each advisor's pick*: one node from the frontier. +* *Each advisor's pick*: one node from the frontier. The private me advisor names +none; the page lists the frontier nodes the owner tagged, unranked. A typed status is held to account: diff --git a/scripts/registry/claims-registry.mjs b/scripts/registry/claims-registry.mjs index 61ed9f6f..9faad6be 100644 --- a/scripts/registry/claims-registry.mjs +++ b/scripts/registry/claims-registry.mjs @@ -93,6 +93,15 @@ export const CHECKER = { // โ”€โ”€ Validation of the registry rows โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// A claim id is OWNER/REPO#CLAIM: a repository name, then a non-empty claim. The +// registry's rows obey it, and readers that cite a claim (the ultraplan) use it too. +export const CLAIM_REPO = /^[-\w.]+\/[-\w.]+$/; +export function isClaimId(id) { + if (typeof id !== 'string') return false; + const i = id.indexOf('#'); + return i > 0 && CLAIM_REPO.test(id.slice(0, i)) && id.length > i + 1; +} + // Throw unless every row is well formed and its repository is public in the // census inventory (the registry never names a private repository). export function validate(rows, inventory) { @@ -103,7 +112,7 @@ export function validate(rows, inventory) { const where = r && r.id ? r.id : JSON.stringify(r); if (r === null || typeof r !== 'object' || Array.isArray(r)) throw new Error(`A claim record is an object: ${where}`); closed(r, FIELDS, 'Unknown field (a record holds no grade, token, leg or flag):', where); - if (typeof r.repo !== 'string' || !/^[-\w.]+\/[-\w.]+$/.test(r.repo)) throw new Error(`Invalid repo: ${where}`); + if (typeof r.repo !== 'string' || !CLAIM_REPO.test(r.repo)) throw new Error(`Invalid repo: ${where}`); if (typeof r.claim !== 'string' || r.claim === '') throw new Error(`Missing claim id: ${where}`); if (r.id !== `${r.repo}#${r.claim}`) throw new Error(`id must be repo#claim: ${where}`); if (seen.has(r.id)) throw new Error(`Duplicate id: ${r.id}`); diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 88de92a2..4a86cfc4 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -31,6 +31,7 @@ import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSyn import path from 'node:path'; import {parseJsonl} from '../atlas/census-atlas.mjs'; import {jcs} from '../registry/theory-ledger.mjs'; +import {isClaimId} from '../registry/claims-registry.mjs'; export const ROOT = path.resolve(import.meta.dir, '../..'); export const DIR = 'docs/ultraplan'; @@ -152,7 +153,8 @@ const EVIDENCE = { return ctx.isFile(p) ? null : `evidence path ${p} is not a file in the repository`; }, claim(ev, ctx) { - if (!isStr(ev.claim) || !/^[\w.-]+\/[\w.-]+#[A-Z]+-[0-9A-Za-z]+$/.test(ev.claim)) return `evidence claim ${JSON.stringify(ev.claim)} is not OWNER/REPO#ID`; + // The registry's own rule, so any claim it can list can be cited here. + if (!isStr(ev.claim) || !isClaimId(ev.claim)) return `evidence claim ${JSON.stringify(ev.claim)} is not OWNER/REPO#ID`; const min = ev.min_pwg ?? 'PWG-3'; if (!PWG_ORDER.includes(min) || min === 'ungraded') return `evidence min_pwg ${JSON.stringify(min)} is not a grade`; const got = registryGrade(ctx.registry, ev.claim); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index c88a9339..228b9cd5 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -158,6 +158,11 @@ test('a claim is evidence only at the grade the registry derives', () => { // An id mentioned inside another row's statement does not list that claim. const mention = '|https://x/blob/c/P.adoc[o/r#T-1] at `c` |theorem |`PWG-2ii` |Builds on [o/r#GHOST-1] |why\n'; refuses({nodes: swap('root', {evidence: [{claim: 'o/r#GHOST-1'}]}), registry: mention}, /does not list o\/r#GHOST-1/); + // Any id the registry accepts can be cited: OWNER/REPO#CLAIM with a non-empty claim (its rule, shared). + const odd = '|https://x/blob/c/P.adoc[o/r#N-7.1] at `c` |theorem |`PWG-2i` |s |w\n|https://x/blob/c/P.adoc[o/r#THY-1-A] at `c` |theorem |`PWG-3` |s |w\n'; + expect(() => generate(fixture({nodes: swap('root', {evidence: [{claim: 'o/r#N-7.1'}, {claim: 'o/r#THY-1-A'}]}), registry: odd}))).not.toThrow(); + refuses({nodes: swap('root', {evidence: [{claim: 'o/r#'}]}), registry: odd}, /evidence claim "o\/r#" is not OWNER\/REPO#ID/); + refuses({nodes: swap('root', {evidence: [{claim: 'or#N-1'}]}), registry: odd}, /evidence claim "or#N-1" is not OWNER\/REPO#ID/); }); test('a done or active node cannot rest on an unfinished need', () => { @@ -230,7 +235,7 @@ test('closed schema, blocked reasons and canonical lines', () => { const line = jcs({...BASE[0], name: `x${nc}y`}); refuses({raw: {nodes: [line, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate or a Unicode noncharacter/); } - const key = jcs({...BASE[0], value: {maths: 1}}).replace('"maths"', '"m\uFFFEaths"'); + const key = jcs({...BASE[0], value: {maths: 1}}).replace('"maths":', '"m\uFFFEaths":'); refuses({raw: {nodes: [key, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate or a Unicode noncharacter/); }); From 358be7d4006362dcfd5514c89def0544628a0c9b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 18:11:30 +0000 Subject: [PATCH 19/41] ultraplan: record the ruling that GELS pins the feed by commit The owner ruled through the selector on 2026-11-24. GELS asks the GitHub API for the head commit of main, then reads the feed at that commit, so each read names its commit. Mathesis commits the feed as a generated view that `just check` refuses when stale. It needs no new permission and holds no inbound secret. - ROADMAP: the ruling joins the 2026-11-24 ultraplan rulings. - docs/ultraplan/README.adoc: the GELS section states it. - tree.jsonl: the GELS panel node's blocker names it. The page is regenerated. The panel stays blocked on the GELS feed/panel contract. No feed is written until the contract fixes its path and fields. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/status/ROADMAP.adoc | 5 +++++ docs/ultraplan/README.adoc | 6 ++++++ docs/ultraplan/generated/ultraplan.adoc | 2 +- docs/ultraplan/tree.jsonl | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 9dc85614..1a491c53 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -428,3 +428,8 @@ scheduled census, a view of what each repository owes ** The GELS maths panel waits on the GELS feed/panel contract, which the GELS thread is drafting. The estate coordinator has answered: a read-only feed, one panel type, and open decisions sent to the owner's decision desk. +** GELS pins by commit (owner ruling 2026-11-24). Mathesis commits the feed as + a generated view, which `just check` refuses when stale. GELS asks the + GitHub API for the head commit of main, then reads the feed at that commit, + so each read names its commit. The fetch logic and its rate limits belong to + GELS. Mathesis needs no new permission and holds no inbound secret. diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 8e6d1885..22e70b19 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -140,6 +140,12 @@ panel type beside the work-queue lanes and the Plan tab. advisor's), the grade census with its denominator, and the claim pins. * Open decisions go to the owner's decision desk, not this panel. +The owner ruled on 2026-11-24 that GELS pins by commit. Mathesis commits the +feed as a generated view, which `just check` refuses when stale. GELS asks the +GitHub API for the head commit of main and reads the feed at that commit, so +each read names its commit. No secret comes into this repository, and nothing +here needs a new permission. + The GELS thread is drafting the feed and panel contract (`docs/proposals/feed-panel-contract.adoc` in metadatastician/gels). Until it exists, nothing here writes a feed: a feed with no agreed reader would be diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index eb44c35c..e619153f 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -555,7 +555,7 @@ The tech tree as one panel type in GELS, beside the work-queue lanes and the Pla *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked ยท *Beyond this repository:* estate:metadatastician/gels *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:ultraplan[๐ŸŒณ The ultraplan] + -*Blocked by:* the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then publishes a read-only I-JSON/JCS feed and GELS renders it + +*Blocked by:* the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then commits a read-only I-JSON/JCS feed, and GELS reads it pinned by commit (owner ruling 2026-11-24) and renders it + *Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— === โ™พ๏ธ Era 4: Cantor diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index e3858636..acf2b9e7 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -20,7 +20,7 @@ {"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":["docs/proposals/mathesis-research-programme.adoc:883","docs/proposals/mathesis-research-programme.adoc:903"],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} {"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":["docs/status/ROADMAP.adoc:92","docs/proposals/mathesis-research-programme.adoc:693"],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} {"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":["docs/proposals/mathesis-research-programme.adoc:824","applied-systems/finance/liquidity/README.adoc"],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} -{"blocked_by":"the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then publishes a read-only I-JSON/JCS feed and GELS renders it","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} +{"blocked_by":"the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then commits a read-only I-JSON/JCS feed, and GELS reads it pinned by commit (owner ruling 2026-11-24) and renders it","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} {"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:760"],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} {"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":["docs/proposals/mathesis-research-programme.adoc:743","docs/proposals/mathesis-research-programme.adoc:755"],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} {"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} From 1aab6a6374170cf57e8e7288e00ee5b9bb6269d3 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 08:44:39 +0000 Subject: [PATCH 20/41] registry: a claim id uses only characters its view can carry Codex found that the shared rule accepted a claim such as "A]B". The registry validated such a row and rendered it, but in the view the id is a link's text inside a table row, so the ultraplan read "o/r#A]B" back as "o/r#A" and could not cite it. A probe confirmed it, and showed the rule also accepted "A B", "A|B" and "A#B". The claim part now follows CLAIM_NAME, the characters of a repository name (letters, digits, "-", "_" and "."). isClaimId and validate() both use it, so every id the registry accepts can be read back from its view. All 53 claims in the registry already fit, so its view is unchanged. validate() folds the check into its existing claim line. Its cognitive complexity stays at 54, as on main. Codex's other finding, on the table-cell escape, does not hold. Under Asciidoctor 2.0.26, the version CI pins, a cell holding "a\|b" renders as two cells with that exact text. The suggested character reference would instead print "|" for it. The escape is unchanged. Tests: 98 pass across the ultraplan and registry suites. With the old rule, the two changed tests fail. check-views and site-check pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- scripts/registry/claims-registry.mjs | 11 +++++++---- tests/registry/claims-registry.test.mjs | 5 +++++ tests/ultraplan/ultraplan.test.mjs | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/registry/claims-registry.mjs b/scripts/registry/claims-registry.mjs index 9faad6be..e3a95ecf 100644 --- a/scripts/registry/claims-registry.mjs +++ b/scripts/registry/claims-registry.mjs @@ -93,13 +93,16 @@ export const CHECKER = { // โ”€โ”€ Validation of the registry rows โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ -// A claim id is OWNER/REPO#CLAIM: a repository name, then a non-empty claim. The -// registry's rows obey it, and readers that cite a claim (the ultraplan) use it too. +// A claim id is OWNER/REPO#CLAIM. The claim uses the characters of a repository +// name, so every id survives the registry view, where it is a link's text inside +// a table row: "]", "|", "#" and white space cannot occur in it. The registry's +// rows obey this rule, and readers that cite a claim (the ultraplan) use it too. export const CLAIM_REPO = /^[-\w.]+\/[-\w.]+$/; +export const CLAIM_NAME = /^[-\w.]+$/; export function isClaimId(id) { if (typeof id !== 'string') return false; const i = id.indexOf('#'); - return i > 0 && CLAIM_REPO.test(id.slice(0, i)) && id.length > i + 1; + return i > 0 && CLAIM_REPO.test(id.slice(0, i)) && CLAIM_NAME.test(id.slice(i + 1)); } // Throw unless every row is well formed and its repository is public in the @@ -113,7 +116,7 @@ export function validate(rows, inventory) { if (r === null || typeof r !== 'object' || Array.isArray(r)) throw new Error(`A claim record is an object: ${where}`); closed(r, FIELDS, 'Unknown field (a record holds no grade, token, leg or flag):', where); if (typeof r.repo !== 'string' || !CLAIM_REPO.test(r.repo)) throw new Error(`Invalid repo: ${where}`); - if (typeof r.claim !== 'string' || r.claim === '') throw new Error(`Missing claim id: ${where}`); + if (typeof r.claim !== 'string' || !CLAIM_NAME.test(r.claim)) throw new Error(`Missing or invalid claim id (letters, digits, "-", "_" and "." only): ${where}`); if (r.id !== `${r.repo}#${r.claim}`) throw new Error(`id must be repo#claim: ${where}`); if (seen.has(r.id)) throw new Error(`Duplicate id: ${r.id}`); seen.add(r.id); diff --git a/tests/registry/claims-registry.test.mjs b/tests/registry/claims-registry.test.mjs index 96fe952f..5c265a81 100644 --- a/tests/registry/claims-registry.test.mjs +++ b/tests/registry/claims-registry.test.mjs @@ -63,6 +63,11 @@ test('validation fails closed', () => { expect(() => validate([{...theorem, kind: 'machine-verified'}], inv)).toThrow(/Unknown kind/); expect(() => validate([{...theorem, agda: null}], inv)).toThrow(/Agda module/); expect(() => validate([{...theorem, id: 'o/r#X'}], inv)).toThrow(/repo#claim/); + // A claim must survive the view, where its id is a link's text in a table row. + for (const claim of ['A]B', 'A|B', 'A#B', 'A B', '']) + expect(() => validate([{...theorem, id: `o/r#${claim}`, claim}], inv)).toThrow(/invalid claim id/); + for (const claim of ['N-7.1', 'THY-1-A', 'C-4a']) + expect(validate([{...theorem, id: `o/r#${claim}`, claim}], inv)).toHaveLength(1); expect(() => validate([theorem], [{full_name: 'o/r', visibility: 'private'}])).toThrow(/Nonpublic/); expect(() => validate([{...theorem, receipt: {path: 'x', sha256: 'nope'}}], inv)).toThrow(/sha256/); const home = {...theorem, id: 'hyperpolymath/mathesis#T-1', repo: 'hyperpolymath/mathesis', shelf: 'theory'}; diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 228b9cd5..967112c0 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -158,11 +158,12 @@ test('a claim is evidence only at the grade the registry derives', () => { // An id mentioned inside another row's statement does not list that claim. const mention = '|https://x/blob/c/P.adoc[o/r#T-1] at `c` |theorem |`PWG-2ii` |Builds on [o/r#GHOST-1] |why\n'; refuses({nodes: swap('root', {evidence: [{claim: 'o/r#GHOST-1'}]}), registry: mention}, /does not list o\/r#GHOST-1/); - // Any id the registry accepts can be cited: OWNER/REPO#CLAIM with a non-empty claim (its rule, shared). + // Any id the registry accepts can be cited, and only those: its rule is shared. const odd = '|https://x/blob/c/P.adoc[o/r#N-7.1] at `c` |theorem |`PWG-2i` |s |w\n|https://x/blob/c/P.adoc[o/r#THY-1-A] at `c` |theorem |`PWG-3` |s |w\n'; expect(() => generate(fixture({nodes: swap('root', {evidence: [{claim: 'o/r#N-7.1'}, {claim: 'o/r#THY-1-A'}]}), registry: odd}))).not.toThrow(); refuses({nodes: swap('root', {evidence: [{claim: 'o/r#'}]}), registry: odd}, /evidence claim "o\/r#" is not OWNER\/REPO#ID/); refuses({nodes: swap('root', {evidence: [{claim: 'or#N-1'}]}), registry: odd}, /evidence claim "or#N-1" is not OWNER\/REPO#ID/); + refuses({nodes: swap('root', {evidence: [{claim: 'o/r#A]B'}]}), registry: odd}, /evidence claim "o\/r#A\]B" is not OWNER\/REPO#ID/); }); test('a done or active node cannot rest on an unfinished need', () => { From a0f73c845e6927814f6e7b3fb80a21674fd7fde7 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 09:12:32 +0000 Subject: [PATCH 21/41] ultraplan: read an ADR's status as AsciiDoc does; keep summaries text Codex raised two findings on 1aab6a6. Probes confirmed both. An ADR's status. The parser took the first "Status" heading anywhere in the file. An ADR that showed an old "Accepted" inside a comment block, a listing or an ifdef, or that had a second Status section, was read as accepted while its real status was Proposed: four crafted ADRs did so. A done node could then rest on an unaccepted ADR. adrAccepted() now skips headings inside delimited blocks, requires exactly one Status section, and fails closed on an ADR that holds a preprocessor directive. The real ADRs read as before: 0001 to 0004 accepted, 0005 not, the templates not. A summary that looks like block syntax. A node's summary starts a line of the page, where AsciiDoc reads "|===", "image::x[]", "//" and the like as structure; 18 of 19 such summaries changed the page under Asciidoctor 2.0.26. The summary line now starts with "{empty}", an empty attribute, which keeps all 19 as one plain paragraph and adds nothing to the text. The rendered page is byte-identical. Each text in the plan is also one line now: a control character in any string or member name is refused, so no other field can start a line either. No current text holds one. Tests: 100 pass across the ultraplan and registry suites. The three new or changed tests fail on the old generator. Disabling each of 58 guards, 9 of them new, makes a test fail. check-views, site-check, sonarjs and Asciidoctor pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/generated/ultraplan.adoc | 104 ++++++++++++------------ scripts/ultraplan/ultraplan.mjs | 46 +++++++++-- tests/ultraplan/ultraplan.test.mjs | 39 +++++++++ 3 files changed, 130 insertions(+), 59 deletions(-) diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index e619153f..8274e289 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -155,7 +155,7 @@ same place; the contrarian keeps the road not taken in view. [[census]] ==== โœ… ๐Ÿงพ Census of the estate -The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time. +{empty}The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time. *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* L ยท *Status:* done @@ -166,7 +166,7 @@ The proof census of 465 public repositories: 249 rows of proof files, holes and [[proof-gate]] ==== โœ… ๐Ÿ›ก๏ธ Proof gate in pinned Guix -Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail. +{empty}Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail. *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* L ยท *Status:* done @@ -179,7 +179,7 @@ Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every comm [[cohort-model]] ==== โœ… ๐Ÿ‘ฅ Cohort model in Agda -The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines. +{empty}The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines. *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* M ยท *Status:* done @@ -191,7 +191,7 @@ The cohort-economics model of the applied shelf, with three number modes and syn [[thy1]] ==== โœ… ๐Ÿงญ THY-1: reachability is monotone -In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean. +{empty}In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean. *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done @@ -203,7 +203,7 @@ In a dependency graph with feature-guarded edges, a node unreachable with every [[atlas-views]] ==== โœ… ๐Ÿ—บ๏ธ Atlas views -The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`. +{empty}The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`. *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* M ยท *Status:* done @@ -215,7 +215,7 @@ The catalogue and the A to Z and organisation views, generated from the census r [[census-workflow]] ==== ๐ŸŒฑ โฐ Census on a schedule -A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. +{empty}A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open @@ -227,7 +227,7 @@ A scheduled census workflow as the one writer of the census rows (WO 5.3), so re [[claims-registry]] ==== โœ… ๐Ÿ“’ Claims registry -Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed. +{empty}Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done @@ -239,7 +239,7 @@ Pins 53 claims in their home repositories and derives each grade from the home r [[pinned-image]] ==== ๐ŸŒฑ ๐Ÿ“ฆ Proof lanes in a pinned image -Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. +{empty}Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open @@ -255,7 +255,7 @@ Run the three proof lanes in a container image pinned by digest, the condition P [[app-proofs]] ==== โœ… ๐Ÿ’ง APP-1 to APP-4: missing stays missing -Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean. +{empty}Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean. *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done @@ -267,7 +267,7 @@ Missing inputs propagate and never read as zero; the cash identity; the least fu [[chain-question]] ==== ๐Ÿ”จ ๐Ÿงฉ Is a chain enough? (X-PF1) -Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order. +{empty}Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order. *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* active @@ -282,7 +282,7 @@ Experiment X-PF1, pre-registered: list each rule, gate and report in the estate [[theory-shelf]] ==== โœ… ๐Ÿ“š Theory shelf and ledger -The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far. +{empty}The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far. *Track:* โˆ‘ maths ยท *Kind:* data ยท *Size:* S ยท *Status:* done @@ -294,7 +294,7 @@ The admission rule for theory no single system owns, with an append-only ledger [[doc-drift-fix]] ==== ๐ŸŒฑ ๐Ÿงน Mend the status documents -ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. +{empty}ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. *Track:* โš™ engineering ยท *Kind:* decision ยท *Size:* S ยท *Status:* open @@ -308,7 +308,7 @@ ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PW [[receipts]] ==== โœ… ๐Ÿ” Proof receipts -The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader. +{empty}The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader. *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* M ยท *Status:* done @@ -320,7 +320,7 @@ The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs [[site-build]] ==== โœ… ๐Ÿ—๏ธ Atlas site (build) -Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy. +{empty}Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy. *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done @@ -332,7 +332,7 @@ Renders every generated view with Asciidoctor and fails on any warning or broken [[ultraplan]] ==== โœ… ๐ŸŒณ The ultraplan -This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. +{empty}This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done @@ -344,7 +344,7 @@ This tech tree: data first, with derived eras, frontier, forks, confluences and [[bridge-candidates]] ==== โœ… ๐ŸŒ‰ Bridge candidates -Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence. +{empty}Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* S ยท *Status:* done @@ -356,7 +356,7 @@ Three unassessed candidate links between theorems in different repositories and [[file-transport-bugs]] ==== ๐ŸŒฑ ๐Ÿ› File the transport reproducers -File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. +{empty}File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* decision ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* upstream:Deducteam/agda2dedukti @@ -370,7 +370,7 @@ File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option g [[whats-owed]] ==== ๐ŸŒฑ ๐Ÿ“‹ What is owed -A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has. +{empty}A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* open @@ -384,7 +384,7 @@ A view of the standards requirements master list beside the census and the regis [[dossier]] ==== ๐ŸŒฑ ๐Ÿ—‚๏ธ Theorem dossier -The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. +{empty}The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* S ยท *Status:* open @@ -396,7 +396,7 @@ The eight-item dossier for each theorem (Line 0), scored first on THY-1, five ja [[s2-monotone]] ==== ๐ŸŒฑ ๐Ÿ“ˆ S-2: evaluation is monotone -Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). +{empty}Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* S ยท *Status:* open @@ -410,7 +410,7 @@ Positive evaluation of status is monotone. It holds for each ordered resource al [[s4-s5-verdict]] ==== ๐ŸŒฑ ๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts -A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). +{empty}A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open @@ -425,7 +425,7 @@ A sound three-valued cash verdict over intervals, where missing means unbounded [[token-order]] ==== ๐ŸŒฑ โš–๏ธ Settle the order of status tokens -Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order. +{empty}Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order. *Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* open @@ -440,7 +440,7 @@ Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. [[dedukti-transport]] ==== โ›” ๐Ÿš‚ Transport through Dedukti -Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first. +{empty}Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* blocked ยท *Beyond this repository:* upstream:Deducteam/lambdapi @@ -455,7 +455,7 @@ Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambd [[receipt-generator]] ==== ๐Ÿ”จ ๐Ÿญ Shared receipt generator -Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. +{empty}Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* active @@ -468,7 +468,7 @@ Adopt the standards generator: the receipt is generated from a run ledger, and t [[statistical-bridge]] ==== ๐ŸŒฑ ๐ŸŽฒ From oracle to theorem -S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). +{empty}S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). *Track:* ๐Ÿ”ฌ science ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open @@ -481,7 +481,7 @@ S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are [[forecast-13wk]] ==== ๐ŸŒฑ ๐Ÿ“… Thirteen-week forecast -A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. +{empty}A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. *Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* M ยท *Status:* open @@ -495,7 +495,7 @@ A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the [[paper-thy1]] ==== ๐ŸŒฑ ๐Ÿ“„ Note: feature reachability -A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. +{empty}A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open @@ -507,7 +507,7 @@ A short note on THY-1: why requesting every feature is a sound check for absence [[publish-atlas]] ==== โ›” ๐ŸŒ Publish the atlas -Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node. +{empty}Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node. *Track:* ๐Ÿ“œ publications ยท *Kind:* view ยท *Size:* S ยท *Status:* blocked @@ -523,7 +523,7 @@ Deploy the built site (WO 4.3), once the owner says go. Publication is outward-f [[teaching-cohort]] ==== ๐ŸŒฑ ๐Ÿ““ Cohort economics, taught -A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. +{empty}A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open @@ -535,7 +535,7 @@ A worked tutorial: a small business model where missing data stays missing, with [[bridge-lock-pilot]] ==== ๐ŸŒฑ ๐Ÿ”— Bridge lock pilot -The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. +{empty}The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* M ยท *Status:* open @@ -550,7 +550,7 @@ The full bridge record for two pilots, a squeakwell ladder row and resource-alge [[gels-maths-panel]] ==== โ›” ๐ŸชŸ Maths panel in GELS -The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel. +{empty}The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked ยท *Beyond this repository:* estate:metadatastician/gels @@ -563,7 +563,7 @@ The tech tree as one panel type in GELS, beside the work-queue lanes and the Pla [[centre-computations]] ==== ๐ŸŒฑ ๐ŸŽฏ Centre computations -Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801). +{empty}Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801). *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* L ยท *Status:* open @@ -575,7 +575,7 @@ Over locked bridges: classes under a criterion, their order, contradictions, and [[s1-token-algebra]] ==== ๐ŸŒฑ ๐Ÿ”ข S-1: tokens form a dioid -The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). +{empty}The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open @@ -591,7 +591,7 @@ The status tokens form a ResourceAlgebra and dioid with an annihilating zero, wi [[s3-grade-function]] ==== ๐ŸŒฑ ๐ŸŽš๏ธ S-3: the grade is a function -The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3). +{empty}The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open @@ -605,7 +605,7 @@ The Proof Witness Grade is a total monotone function of the receipt, and the can [[ci-recorder]] ==== ๐ŸŒฑ ๐Ÿค– CI records its own runs -A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open. +{empty}A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open. *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards @@ -616,7 +616,7 @@ A trusted publisher that writes each green run's ledger rows to the repository, [[januskey-slice]] ==== ๐ŸŒฑ ๐Ÿ—๏ธ Theorem to code: januskey -Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1). +{empty}Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1). *Track:* โš™ engineering ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/januskey @@ -627,7 +627,7 @@ Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 [[pwg1-regained]] ==== ๐ŸŒฑ ๐Ÿฅ‡ Back to PWG-1 -THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. +{empty}THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* S ยท *Status:* open @@ -637,7 +637,7 @@ THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the p [[superseded-manifests-option]] ==== ๐ŸŒฑ ๐Ÿ—„๏ธ Keep superseded manifests (option) -A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges. +{empty}A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* S ยท *Status:* open @@ -651,7 +651,7 @@ A generator option that keeps the inputs digest, manifest and axioms on supersed [[encoding-differences]] ==== ๐ŸŒฑ ๐Ÿ”ค Closed list of encoding differences -A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). +{empty}A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). *Track:* ๐Ÿ”ฌ science ยท *Kind:* data ยท *Size:* M ยท *Status:* open @@ -666,7 +666,7 @@ A closed, tested list of the ways the same statement differs between Agda, Rocq [[liquidity-shelf]] ==== ๐ŸŒฑ ๐Ÿ’ถ Liquidity shelf -The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. +{empty}The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. *Track:* ๐Ÿช™ economics ยท *Kind:* view ยท *Size:* M ยท *Status:* open @@ -677,7 +677,7 @@ The liquidity part of the applied shelf: a forecast whose every verdict carries [[talk-atlas]] ==== ๐ŸŒฑ ๐ŸŽค Talk: an atlas of an estate -A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. +{empty}A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* S ยท *Status:* open @@ -687,7 +687,7 @@ A talk on mapping the mathematics of hundreds of repositories, with every status [[echo-mirrors]] ==== ๐ŸŒฑ ๐Ÿชž Echo mirror records -Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. +{empty}Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/echo-types @@ -698,7 +698,7 @@ Bridge records for the six languages that mirror echo-types (E-2.5), with the gr [[receipts-campaign]] ==== ๐ŸŒฑ ๐Ÿ“ฃ Receipts campaign -Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. +{empty}Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/secret-types @@ -712,7 +712,7 @@ Home repositories re-record their receipts (WO 5.1): secret-types and lintel for [[s1-reuse]] ==== ๐ŸŒฑ โ™ป๏ธ S-1 by reuse of resource-algebra -Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. +{empty}Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/resource-algebra @@ -727,7 +727,7 @@ Prove only the morphism here, and take the dioid laws from resource-algebra's E- [[concept-commons]] ==== ๐ŸŒฑ ๐Ÿ›๏ธ Concept commons -The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance. +{empty}The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance. *Track:* โˆ‘ maths ยท *Kind:* view ยท *Size:* XL ยท *Status:* open @@ -738,7 +738,7 @@ The horizon of the atlas (M4): a commons of the estate's concepts, navigable by [[bridge-by-construction]] ==== ๐ŸŒฑ ๐Ÿ— Bridges by construction -Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match. +{empty}Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* open @@ -753,7 +753,7 @@ Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E- [[idris-token-laws]] ==== ๐ŸŒฑ ๐Ÿงฌ Generated Idris2 token laws -Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. +{empty}Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards @@ -764,7 +764,7 @@ Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), [[value-of-information]] ==== ๐ŸŒฑ ๐Ÿ”ญ Value of information -Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README). +{empty}Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README). *Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* L ยท *Status:* open @@ -775,7 +775,7 @@ Decision science on the shelf: what a missing input is worth to know, computed f [[paper-receipts]] ==== ๐ŸŒฑ ๐Ÿ“ฐ Paper: receipts, not claims -A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. +{empty}A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open @@ -785,7 +785,7 @@ A methods paper: proof status derived from machine receipts, graded by witness c [[paper-status-algebra]] ==== ๐ŸŒฑ ๐Ÿ“˜ Paper: an algebra of proof status -S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt. +{empty}S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open @@ -797,7 +797,7 @@ S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the [[corpus]] ==== ๐ŸŒฑ ๐Ÿงช Propose and dispose corpus -A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2). +{empty}A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2). *Track:* ๐Ÿ”ฌ science ยท *Kind:* method ยท *Size:* XL ยท *Status:* open @@ -811,7 +811,7 @@ A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theor [[estate-pwg2ii]] ==== ๐ŸŒฑ ๐Ÿ”๏ธ PWG-2ii across the estate -The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. +{empty}The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* XL ยท *Status:* open diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 4a86cfc4..6b5879d6 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -90,11 +90,23 @@ export function wellFormed(v) { return true; } +// Each text in the plan is one line: a control character (a line break among +// them) would let a text start a line of the page, where AsciiDoc reads block +// syntax. This is the plan's own rule, stricter than I-JSON. +const hasControl = s => /[\u0000-\u001f\u007f-\u009f]/.test(s); +function oneLine(v) { + if (typeof v === 'string') return !hasControl(v); + if (Array.isArray(v)) return v.every(oneLine); + if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => !hasControl(k) && oneLine(x)); + return true; +} + export function readSource(text, name) { const rows = parseJsonl(text, name); const lines = text === '' ? [] : text.slice(0, -1).split('\n'); rows.forEach((r, i) => { if (!wellFormed(r)) throw new Error(`${name}: line ${i + 1} holds a lone surrogate or a Unicode noncharacter, which I-JSON refuses`); + if (!oneLine(r)) throw new Error(`${name}: line ${i + 1} holds a control character; each text in the plan is one line`); if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); write it as ${jcs(r)}`); }); return rows; @@ -136,13 +148,28 @@ export function registryGrade(registryText, id) { return null; } -// Whether an ADR's Status section opens with "Accepted". +// Whether an ADR's Status section opens with "Accepted", read as AsciiDoc reads +// it. A heading inside a delimited block (a comment, a listing, an example) is +// not a section of the ADR. The ADR must have exactly one Status section, and +// the first line after its heading must say "Accepted": a comment line or a +// block delimiter there does not. A preprocessor directive could change which +// lines count, so an ADR that holds one is not read: it fails closed, as an +// unaccepted ADR. +const DELIMITER = /^(?:\/{4,}|-{4,}|\.{4,}|\+{4,}|\*{4,}|={4,}|_{4,}|--|[|,:!]={3,})$/; +const PREPROCESSOR = /^(?:ifdef|ifndef|ifeval|endif|include)::/; export function adrAccepted(text) { - const lines = text.split('\n'); - const i = lines.findIndex(l => /^=+ Status\s*$/.test(l)); - if (i < 0) return false; - const first = lines.slice(i + 1).find(l => l.trim() !== ''); - return !!first && /^\**Accepted\b/.test(first.trim()); + const lines = text.split('\n').map(l => l.trimEnd()); + if (lines.some(l => PREPROCESSOR.test(l))) return false; + const heads = []; + let open = null; + lines.forEach((l, i) => { + if (open) open = l === open ? null : open; + else if (DELIMITER.test(l)) open = l; + else if (/^=+ Status$/.test(l)) heads.push(i); + }); + if (heads.length !== 1) return false; + const next = lines.find((l, i) => i > heads[0] && l.trim() !== ''); + return /^\**Accepted\b/.test(next?.trim() ?? ''); } // One check for each kind of evidence; each returns an error or null. @@ -422,6 +449,11 @@ export function derive(byId, advisors) { // โ”€โ”€ Rendering: AsciiDoc โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // The page is a list of sections; each section is a list of lines. const cell = s => String(s).replaceAll('|', String.raw`\|`); +// A text that starts a line of the page (a node's summary) is read by AsciiDoc as +// block syntax if it looks like some: "|===" opens a table, "image::x[]" places an +// image, "//" makes a comment. "{empty}" (an attribute that is empty) in front makes +// the line a plain paragraph, whatever follows, and adds nothing to the text. +const lineStart = s => `{empty}${s}`; const nameOf = (byId, id) => `${byId.get(id).glyph} ${byId.get(id).name}`; // A link to a node, as the xref macro. Its text may hold anything but a few // characters, written as character references so they mean the same everywhere, @@ -563,7 +595,7 @@ function nodeLines(byId, advisors, d, n) { `[[${n.id}]]`, `==== ${STATUS_GLYPH[n.status]} ${n.glyph} ${n.name}`, '', - n.summary, + lineStart(n.summary), '', facts.join(' ยท '), '', diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 967112c0..6a3d0e64 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -238,6 +238,24 @@ test('closed schema, blocked reasons and canonical lines', () => { } const key = jcs({...BASE[0], value: {maths: 1}}).replace('"maths":', '"m\uFFFEaths":'); refuses({raw: {nodes: [key, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate or a Unicode noncharacter/); + // Each text is one line: a line break would let a text start a line of the page. + for (const cc of ['\n', '\r', '\t', '\u0000', '\u007f', '\u0085']) { + const line = jcs({...BASE[0], summary: `x${cc}|===`}); + refuses({raw: {nodes: [line, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a control character; each text in the plan is one line/); + } + const ckey = jcs({...BASE[0], value: {maths: 1}}).replace('"maths":', '"m\\naths":'); + refuses({raw: {nodes: [ckey, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a control character/); +}); + +test('a summary that looks like block syntax is text on the page', () => { + const base = generate(fixture())[VIEW].split('\n'); + const bare = (lines, s) => lines.filter(l => l === s).length; + for (const s of ['|===', 'image::missing.svg[]', '// a comment', 'include::x.adoc[]', '== heading', '* item']) { + const page = generate(fixture({nodes: swap('cheap', {summary: s})}))[VIEW].split('\n'); + expect(page).toContain(`{empty}${s}`); + expect(bare(page, s)).toBe(bare(base, s)); // the summary adds no line of its own syntax + } + for (const n of BASE) expect(base).toContain(`{empty}${n.summary}`); }); // Every rule in the generator's rule tables has a witness: a change to the sound @@ -339,6 +357,27 @@ test('the evidence parsers read the real registry view and ADRs', () => { expect(registryGrade(ctx.registry, 'hyperpolymath/mathesis#THY-1')).toMatch(/^PWG-/); expect(adrAccepted(ctx.read(ctx.adrFiles('0004')[0]))).toBe(true); expect(adrAccepted(ctx.read(ctx.adrFiles('0005')[0]))).toBe(false); + for (const n of ['0001', '0002', '0003']) expect(adrAccepted(ctx.read(ctx.adrFiles(n)[0]))).toBe(true); +}); + +// The status is the ADR's own text, as AsciiDoc reads it. Each of these was +// accepted when the first "Status" heading anywhere in the file was taken. +test('an ADR is accepted only by its own one Status section', () => { + const adr = body => `= ADR\n\n${body}\n`; + expect(adrAccepted(adr('=== Status\n\n*Accepted (ratified).*'))).toBe(true); + expect(adrAccepted(adr('=== Status\n\nAccepted\n\n----\n=== Status\nProposed\n----'))).toBe(true); + expect(adrAccepted(adr('----\nan example\n----\n\n=== Status\n\nAccepted'))).toBe(true); + expect(adrAccepted(adr('=== Status'))).toBe(false); + expect(adrAccepted(adr('=== Status\n\nProposed.'))).toBe(false); + expect(adrAccepted(adr('////\n=== Status\nAccepted\n////\n\n=== Status\n\nProposed.'))).toBe(false); + expect(adrAccepted(adr('----\n=== Status\nAccepted\n----\n\n=== Status\n\nProposed.'))).toBe(false); + expect(adrAccepted(adr('....\n=== Status\nAccepted\n....\n\n=== Status\n\nProposed.'))).toBe(false); + expect(adrAccepted(adr('ifdef::never[]\n=== Status\nAccepted\nendif::[]\n\n=== Status\n\nProposed.'))).toBe(false); + expect(adrAccepted(adr('=== Status\n\nAccepted\n\n=== Status\n\nProposed.'))).toBe(false); + expect(adrAccepted(adr('=== Status\n// Accepted\nProposed.'))).toBe(false); + expect(adrAccepted(adr('=== Status\n----\nAccepted\n----'))).toBe(false); + expect(adrAccepted(adr('include::status.adoc[]\n\n=== Status\n\nAccepted'))).toBe(false); + expect(adrAccepted(adr('// === Status\n// Accepted'))).toBe(false); }); test('the committed views match the committed data', () => { From b1d915e550fc93bf05f3005c9fba786e4fd231f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 09:21:01 +0000 Subject: [PATCH 22/41] ultraplan: one backreference for the block delimiters SonarCloud flagged the delimiter pattern of the ADR reader (S5843): its complexity was 25, over the 20 allowed. Seven alternatives, one for each character that repeats four or more times, become one backreference, ([/\-.+*=_])\1{3,}. The two patterns match the same strings: they agree on all 67,977,560 strings of up to 7 characters drawn from the delimiter characters, a letter and a space. Tests: 100 pass. Disabling each of 59 guards, the new alternative among them, makes a test fail. check-views passes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- scripts/ultraplan/ultraplan.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 6b5879d6..565b5e47 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -155,7 +155,8 @@ export function registryGrade(registryText, id) { // block delimiter there does not. A preprocessor directive could change which // lines count, so an ADR that holds one is not read: it fails closed, as an // unaccepted ADR. -const DELIMITER = /^(?:\/{4,}|-{4,}|\.{4,}|\+{4,}|\*{4,}|={4,}|_{4,}|--|[|,:!]={3,})$/; +// A delimiter is one of these characters four or more times, "--", or a table's "|===". +const DELIMITER = /^(?:([/\-.+*=_])\1{3,}|--|[|,:!]={3,})$/; const PREPROCESSOR = /^(?:ifdef|ifndef|ifeval|endif|include)::/; export function adrAccepted(text) { const lines = text.split('\n').map(l => l.trimEnd()); From 5bf747f0a9419c22dc24a50fce040ec99d5349e0 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 09:34:31 +0000 Subject: [PATCH 23/41] ultraplan: never accept an ADR Asciidoctor would not; registry paths Codex raised three findings on b1d915e. Two hold and are fixed; the third is answered by stating the contract. The ADR reader against Asciidoctor itself. Asciidoctor's own parser (Ruby API, 2.0.26) judged 24,480 generated ADR variants, built from attribute lines, block titles, comments, delimited blocks (some with blank lines inside), preceding paragraphs, heading forms, status lines and second sections. b1d915e accepted 1,184 that Asciidoctor does not; the reader now accepts none. - A heading starts a section only after a blank line, with no block attribute line or block title waiting above it, across blank lines and comments: "[discrete]" makes it a floating title. - Comment blocks and comment lines are dropped as Asciidoctor drops them, both when looking above a heading and when finding the status. - Where the two could differ (an anchor or a block title above the heading), the reader says no: it fails closed on 2,160 variants. The real ADRs read as before: 0001 to 0004 accepted, 0005 not. The registry's status_doc. The view puts it in a link's target, so a path holding "[" or white space broke the row's parse. It is now a relative path of letters, digits, "-", "_" and "." with "/" between its parts, none "." or "..". Both paths in the registry already fit. Attribute references in a text. Plan texts are AsciiDoc inline markup by design (one already uses a code span), so an attribute reference is substituted like any other markup. The README now states the contract: a text is one line of inline markup, and block syntax cannot occur. lineKinds() is split so that sonarjs reports nothing. Tests: 100 pass. The new ADR and status_doc tests fail on b1d915e. Disabling each of 65 guards in the generator, and each of the 2 new ones in the registry, makes a test fail. check-views and site-check pass; the generated views are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/README.adoc | 6 +++ scripts/registry/claims-registry.mjs | 6 ++- scripts/ultraplan/ultraplan.mjs | 50 ++++++++++++++++++------- tests/registry/claims-registry.test.mjs | 7 +++- tests/ultraplan/ultraplan.test.mjs | 13 +++++++ 5 files changed, 66 insertions(+), 16 deletions(-) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 22e70b19..239a4df2 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -63,6 +63,12 @@ When every slot is taken, the page and the picture still show the frontier, and say that it is ready but cannot start. * *Blocked* must say what blocks it. +Each text (a name, a summary, a piece of counsel, a reason) is one line of +AsciiDoc inline markup. A code span, bold text or an attribute reference such as +`+{nbsp}+` renders as it would in any AsciiDoc paragraph. Block syntax cannot +occur: the generator refuses a line break or any other control character, and it +writes a summary, the one text that starts a line of the page, after `+{empty}+`. + The value marks (0 to 3 on maths, science, engineering, economics, publications, teaching, soundness and ecosystem) are judgements, not measurements. They are written down so they can be argued with. The page labels them as judgements. diff --git a/scripts/registry/claims-registry.mjs b/scripts/registry/claims-registry.mjs index e3a95ecf..1bfb98d1 100644 --- a/scripts/registry/claims-registry.mjs +++ b/scripts/registry/claims-registry.mjs @@ -99,6 +99,10 @@ export const CHECKER = { // rows obey this rule, and readers that cite a claim (the ultraplan) use it too. export const CLAIM_REPO = /^[-\w.]+\/[-\w.]+$/; export const CLAIM_NAME = /^[-\w.]+$/; +// A status document is named by a relative path in its repository. The view puts +// it in a link's target, so it uses the same characters, with "/" between its +// parts, and no part is "." or "..": "[", "]", "|", "#" and white space cannot occur. +const isDocPath = p => p.split('/').every(s => CLAIM_NAME.test(s) && s !== '.' && s !== '..'); export function isClaimId(id) { if (typeof id !== 'string') return false; const i = id.indexOf('#'); @@ -122,7 +126,7 @@ export function validate(rows, inventory) { seen.add(r.id); if (!KINDS.has(r.kind)) throw new Error(`Unknown kind ${r.kind}: ${r.id}`); if (typeof r.statement !== 'string' || r.statement.length < 10) throw new Error(`Missing statement: ${r.id}`); - if (typeof r.status_doc !== 'string' || r.status_doc === '') throw new Error(`Missing status_doc: ${r.id}`); + if (typeof r.status_doc !== 'string' || !isDocPath(r.status_doc)) throw new Error(`Missing or invalid status_doc (a relative path of letters, digits, "-", "_", "." and "/"): ${r.id}`); if (typeof r.source_commit !== 'string' || !/^[0-9a-f]{40}$/.test(r.source_commit)) throw new Error(`source_commit must be 40 lowercase hex: ${r.id}`); if (r.kind === 'theorem') { if (!r.agda || typeof r.agda.module !== 'string' || !Array.isArray(r.agda.names) || r.agda.names.length === 0) diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 565b5e47..0cf98aa7 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -149,27 +149,49 @@ export function registryGrade(registryText, id) { } // Whether an ADR's Status section opens with "Accepted", read as AsciiDoc reads -// it. A heading inside a delimited block (a comment, a listing, an example) is -// not a section of the ADR. The ADR must have exactly one Status section, and -// the first line after its heading must say "Accepted": a comment line or a -// block delimiter there does not. A preprocessor directive could change which -// lines count, so an ADR that holds one is not read: it fails closed, as an -// unaccepted ADR. +// it. It must never say yes where Asciidoctor finds no such section; where the +// two could differ, it says no (fails closed). +// - A heading inside a delimited block (a comment, a listing, an example) is +// not a section of the ADR. +// - A heading starts a section only after a blank line, with no block attribute +// line or block title waiting above it, across blank lines and comments: +// "[discrete]" makes it a floating title. +// - The ADR must have exactly one Status section, and its first line of text, +// after any comments, must say "Accepted". +// - A preprocessor directive could change which lines count, so an ADR that +// holds one is not read. // A delimiter is one of these characters four or more times, "--", or a table's "|===". const DELIMITER = /^(?:([/\-.+*=_])\1{3,}|--|[|,:!]={3,})$/; const PREPROCESSOR = /^(?:ifdef|ifndef|ifeval|endif|include)::/; +// What each line is: inside a delimited block or one of its delimiters +// ('block'), part of a comment, which AsciiDoc drops ('comment'), or text. +const kindOf = (l, block) => { + if (block) return block.startsWith('//') ? 'comment' : 'block'; + return l.startsWith('//') ? 'comment' : 'text'; +}; +function lineKinds(lines) { + let open = null; + return lines.map(l => { + const block = open ?? (DELIMITER.test(l) ? l : null); + const closes = open !== null && l === open; + open = closes ? null : block; + return kindOf(l, block); + }); +} +function startsSection(lines, kinds, i) { + if (i > 0 && lines[i - 1] !== '') return false; + let j = i - 1; + while (j >= 0 && (lines[j] === '' || kinds[j] === 'comment')) j--; + return j < 0 || !/^(?:\[.*\]|\.[^.\s].*)$/.test(lines[j]); +} export function adrAccepted(text) { const lines = text.split('\n').map(l => l.trimEnd()); if (lines.some(l => PREPROCESSOR.test(l))) return false; - const heads = []; - let open = null; - lines.forEach((l, i) => { - if (open) open = l === open ? null : open; - else if (DELIMITER.test(l)) open = l; - else if (/^=+ Status$/.test(l)) heads.push(i); - }); + const kinds = lineKinds(lines); + const heads = lines.flatMap((l, i) => + kinds[i] === 'text' && /^=+ Status$/.test(l) && startsSection(lines, kinds, i) ? [i] : []); if (heads.length !== 1) return false; - const next = lines.find((l, i) => i > heads[0] && l.trim() !== ''); + const next = lines.find((l, i) => i > heads[0] && l !== '' && kinds[i] !== 'comment'); return /^\**Accepted\b/.test(next?.trim() ?? ''); } diff --git a/tests/registry/claims-registry.test.mjs b/tests/registry/claims-registry.test.mjs index 5c265a81..69069a06 100644 --- a/tests/registry/claims-registry.test.mjs +++ b/tests/registry/claims-registry.test.mjs @@ -91,7 +91,12 @@ test('validation is closed over the ADR 0004 field set', () => { expect(validate([{...theorem, receipt}], inv)).toHaveLength(1); expect(() => validate([{...theorem, receipt: {...receipt, pwg: 'PWG-1'}}], inv)).toThrow(/Unknown receipt field/); const {status_doc: _, ...missing} = theorem; - expect(() => validate([missing], inv)).toThrow(/Missing status_doc/); + expect(() => validate([missing], inv)).toThrow(/Missing or invalid status_doc/); + // The view puts the path in a link's target, so it holds only what survives there. + for (const status_doc of ['', 'docs/P[old].adoc', 'docs/a b.adoc', 'docs/x|y.adoc', 'a#b.adoc', '../x.adoc', '/abs.adoc', 'a//b.adoc', './x.adoc']) + expect(() => validate([{...theorem, status_doc}], inv)).toThrow(/Missing or invalid status_doc/); + for (const status_doc of ['PROOF-STATUS.adoc', 'docs/status/PROOF-STATUS.adoc', 'v1.2/notes_x.adoc']) + expect(validate([{...theorem, status_doc}], inv)).toHaveLength(1); }); test('only the pinned reader is loaded', async () => { diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 6a3d0e64..2845bdba 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -378,6 +378,19 @@ test('an ADR is accepted only by its own one Status section', () => { expect(adrAccepted(adr('=== Status\n----\nAccepted\n----'))).toBe(false); expect(adrAccepted(adr('include::status.adoc[]\n\n=== Status\n\nAccepted'))).toBe(false); expect(adrAccepted(adr('// === Status\n// Accepted'))).toBe(false); + // Each of these agrees with Asciidoctor 2.0.26: a "[discrete]" waiting above the + // heading, across blank lines and comments, makes it a floating title, not a + // section; a heading straight after a paragraph line belongs to the paragraph. + for (const above of ['[discrete]\n', '[float]\n', '[discrete]\n\n', '[discrete]\n////\nx\n////\n\n', '[discrete]\n// note\n\n', 'Some text.\n']) + expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); + expect(adrAccepted(adr('=== Status\n// a comment\nAccepted'))).toBe(true); + // A heading inside a block is not a section even with a blank line above it. + for (const block of ['----\nexample\n\n=== Status\n\nAccepted\n----', '////\nold\n\n=== Status\n\nAccepted\n////', '====\n\n=== Status\n\nAccepted\n====']) + expect(adrAccepted(adr(block))).toBe(false); + expect(adrAccepted(adr('=== Status\n\n////\nAccepted\n////\n\nProposed.'))).toBe(false); + // Asciidoctor reads a section here, but the reader says no: it fails closed on + // any attribute line or block title above a Status heading. + for (const above of ['[[status]]\n', '.A title\n']) expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); }); test('the committed views match the committed data', () => { From ed013420ac4a88a0beb5eb5a2624fe4c3be70e7a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 09:47:09 +0000 Subject: [PATCH 24/41] ultraplan: "= Status" is a title, not a section; no typed counts Codex raised two findings on 8599174, and both hold. "= Status" is the document's title. The ADR reader counted any "=+ Status" heading, so a document titled "Status" whose first line said Accepted read as accepted. The differential test now also takes the level-0 heading and documents that are the variant alone, with no title of their own: 58,752 variants. 8599174 accepted 120 that Asciidoctor does not, every one of them a "= Status" title, some after leading comments. A Status heading must now be "==" or deeper. The reader accepts none of the 120, fails closed on 7,290, and reads the real ADRs as before. Typed counts go stale. The claims-registry node said the registry pins 53 claims; #124 made it 54. The census and receipts-campaign nodes also typed counts of live data: 465 repositories and 249 rows, and 12 ungraded theorems. Those are right today but would drift the same way. All three now say it without a number. The views and the registry carry the derived counts, and the README now says a text does not type a count the data derives. Tests: 129 pass. The new title test fails on 8599174. Disabling each of 66 guards makes a test fail. check-views, site-check, the ijson-jcs gate, Asciidoctor and sonarjs pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/README.adoc | 2 ++ docs/ultraplan/generated/tree.svg | 6 +++--- docs/ultraplan/generated/ultraplan.adoc | 6 +++--- docs/ultraplan/tree.jsonl | 6 +++--- scripts/ultraplan/ultraplan.mjs | 4 +++- tests/ultraplan/ultraplan.test.mjs | 5 +++++ 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 239a4df2..2d4fb99e 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -68,6 +68,8 @@ AsciiDoc inline markup. A code span, bold text or an attribute reference such as `+{nbsp}+` renders as it would in any AsciiDoc paragraph. Block syntax cannot occur: the generator refuses a line break or any other control character, and it writes a summary, the one text that starts a line of the page, after `+{empty}+`. +A text does not type a count that the data derives, such as a number of claims, +repositories or theorems: the views carry those counts, and a typed one goes stale. The value marks (0 to 3 on maths, science, engineering, economics, publications, teaching, soundness and ecosystem) are judgements, not measurements. They are diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index 61c046ee..d963d5dd 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -139,7 +139,7 @@ ๐ŸŒฑ -Census of the estate: The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time. +Census of the estate: The proof census of the public repositories: a row for each proof file, with its holes and axioms, at a pinned commit and time. ๐Ÿงพ Census of the estate @@ -179,7 +179,7 @@ ๐ŸŒฑ -Claims registry: Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed. +Claims registry: Pins each claim in its home repository and derives each grade from the home receipt with the pinned canon reader. No grade is typed. ๐Ÿ“’ Claims registry @@ -379,7 +379,7 @@ โœ… -Receipts campaign: Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. +Receipts campaign: Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes the ungraded theorems towards a grade. ๐Ÿ“ฃ Receipts campaign diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 8274e289..18b484f5 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -155,7 +155,7 @@ same place; the contrarian keeps the road not taken in view. [[census]] ==== โœ… ๐Ÿงพ Census of the estate -{empty}The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time. +{empty}The proof census of the public repositories: a row for each proof file, with its holes and axioms, at a pinned commit and time. *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* L ยท *Status:* done @@ -227,7 +227,7 @@ same place; the contrarian keeps the road not taken in view. [[claims-registry]] ==== โœ… ๐Ÿ“’ Claims registry -{empty}Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed. +{empty}Pins each claim in its home repository and derives each grade from the home receipt with the pinned canon reader. No grade is typed. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done @@ -698,7 +698,7 @@ same place; the contrarian keeps the road not taken in view. [[receipts-campaign]] ==== ๐ŸŒฑ ๐Ÿ“ฃ Receipts campaign -{empty}Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade. +{empty}Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes the ungraded theorems towards a grade. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/secret-types diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index acf2b9e7..16603445 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -3,12 +3,12 @@ {"counsel":{"engineering":"Removes the hand-copying of statements that every re-proof does today."},"glyph":"๐Ÿ—","id":"bridge-by-construction","kind":"tool","name":"Bridges by construction","needs":["encoding-differences","s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:620","docs/proposals/mathesis-research-programme.adoc:690"],"rivals":["dedukti-transport"],"size":"L","status":"open","summary":"Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match.","track":"engineering","value":{"engineering":3,"maths":2,"publications":1}} {"evidence":[{"path":"docs/atlas/claims/bridges.jsonl"}],"glyph":"๐ŸŒ‰","id":"bridge-candidates","kind":"data","name":"Bridge candidates","needs":["claims-registry"],"size":"S","status":"done","summary":"Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence.","track":"ecosystem","value":{"ecosystem":3,"maths":2}} {"counsel":{"cartographer":"The first real convergence between repositories; everything cross-repo waits on it.","maths":"Equivalence as identity, made checkable."},"glyph":"๐Ÿ”—","id":"bridge-lock-pilot","kind":"method","name":"Bridge lock pilot","needs":["bridge-candidates"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:803","docs/proposals/mathesis-re-anchoring.adoc:1071"],"size":"M","status":"open","summary":"The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1}} -{"evidence":[{"path":"docs/atlas/census/rows.jsonl"},{"path":"scripts/census/run-census.sh"}],"glyph":"๐Ÿงพ","id":"census","kind":"data","name":"Census of the estate","size":"L","status":"done","summary":"The proof census of 465 public repositories: 249 rows of proof files, holes and axioms, each at a pinned commit and time.","track":"engineering","value":{"ecosystem":3,"engineering":2,"science":2}} +{"evidence":[{"path":"docs/atlas/census/rows.jsonl"},{"path":"scripts/census/run-census.sh"}],"glyph":"๐Ÿงพ","id":"census","kind":"data","name":"Census of the estate","size":"L","status":"done","summary":"The proof census of the public repositories: a row for each proof file, with its holes and axioms, at a pinned commit and time.","track":"engineering","value":{"ecosystem":3,"engineering":2,"science":2}} {"glyph":"โฐ","id":"census-workflow","kind":"infrastructure","name":"Census on a schedule","needs":["census"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1075"],"size":"M","status":"open","summary":"A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded.","track":"engineering","value":{"ecosystem":2,"engineering":2}} {"glyph":"๐ŸŽฏ","id":"centre-computations","kind":"method","name":"Centre computations","needs":["bridge-lock-pilot","token-order"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:786"],"size":"L","status":"open","summary":"Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801).","track":"maths","value":{"maths":3,"science":2}} {"counsel":{"maths":"The deepest open question on the board; it decides what S-1 even says.","science":"Pre-register what result means A, B or C before computing."},"glyph":"๐Ÿงฉ","id":"chain-question","kind":"theorem","name":"Is a chain enough? (X-PF1)","needs":["claims-registry"],"refs":["docs/proposals/mathesis-research-programme.adoc:390","docs/proposals/mathesis-research-programme.adoc:458"],"size":"M","status":"active","summary":"Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order.","track":"maths","value":{"maths":3,"science":2,"soundness":2}} {"glyph":"๐Ÿค–","id":"ci-recorder","kind":"infrastructure","name":"CI records its own runs","needs":["receipt-generator"],"size":"M","status":"open","summary":"A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open.","track":"engineering","value":{"ecosystem":2,"engineering":3,"soundness":2},"where":"estate:metadatastician/standards"} -{"evidence":[{"adr":"0004"},{"path":"docs/atlas/generated/registry.adoc"}],"glyph":"๐Ÿ“’","id":"claims-registry","kind":"tool","name":"Claims registry","needs":["census"],"size":"L","status":"done","summary":"Pins 53 claims in their home repositories and derives each grade from the home receipt with the pinned canon reader. No grade is typed.","track":"engineering","value":{"ecosystem":3,"engineering":3,"soundness":3}} +{"evidence":[{"adr":"0004"},{"path":"docs/atlas/generated/registry.adoc"}],"glyph":"๐Ÿ“’","id":"claims-registry","kind":"tool","name":"Claims registry","needs":["census"],"size":"L","status":"done","summary":"Pins each claim in its home repository and derives each grade from the home receipt with the pinned canon reader. No grade is typed.","track":"engineering","value":{"ecosystem":3,"engineering":3,"soundness":3}} {"evidence":[{"path":"verification/proofs/agda/Applied/Cohort.agda"},{"path":"applied-systems/methods/input-schema.adoc"}],"glyph":"๐Ÿ‘ฅ","id":"cohort-model","kind":"method","name":"Cohort model in Agda","needs":["proof-gate"],"size":"M","status":"done","summary":"The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines.","track":"maths","value":{"economics":2,"maths":2,"teaching":2}} {"glyph":"๐Ÿ›๏ธ","id":"concept-commons","kind":"view","name":"Concept commons","needs":["centre-computations","whats-owed"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:441","docs/proposals/estate-mathematical-architecture.adoc:158"],"size":"XL","status":"open","summary":"The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance.","track":"maths","value":{"ecosystem":2,"maths":2,"teaching":3}} {"glyph":"๐Ÿงช","id":"corpus","kind":"method","name":"Propose and dispose corpus","needs":["bridge-by-construction","centre-computations","s3-grade-function"],"refs":["docs/proposals/mathesis-research-programme.adoc:891"],"size":"XL","status":"open","summary":"A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2).","track":"science","value":{"engineering":2,"maths":2,"science":3}} @@ -33,7 +33,7 @@ {"glyph":"๐Ÿฅ‡","id":"pwg1-regained","kind":"data","name":"Back to PWG-1","needs":["pinned-image","receipt-generator"],"size":"S","status":"open","summary":"THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image.","track":"engineering","value":{"publications":1,"soundness":2}} {"counsel":{"engineering":"One generator for the estate instead of one per repository."},"glyph":"๐Ÿญ","id":"receipt-generator","kind":"tool","name":"Shared receipt generator","needs":["receipts"],"size":"M","status":"active","summary":"Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122.","track":"engineering","value":{"engineering":3,"soundness":3}} {"evidence":[{"path":"verification/receipts/theory_praxis.deed"}],"glyph":"๐Ÿ”","id":"receipts","kind":"data","name":"Proof receipts","needs":["proof-gate","claims-registry"],"size":"M","status":"done","summary":"The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader.","track":"engineering","value":{"engineering":2,"soundness":3}} -{"counsel":{"cartographer":"The registry is only as current as the home receipts."},"glyph":"๐Ÿ“ฃ","id":"receipts-campaign","kind":"method","name":"Receipts campaign","needs":["receipt-generator"],"refs":["docs/status/ROADMAP.adoc:330","docs/proposals/mathesis-re-anchoring.adoc:1065"],"size":"L","status":"open","summary":"Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes 12 ungraded theorems towards a grade.","track":"ecosystem","value":{"ecosystem":3,"soundness":2},"where":"estate:hyperpolymath/secret-types"} +{"counsel":{"cartographer":"The registry is only as current as the home receipts."},"glyph":"๐Ÿ“ฃ","id":"receipts-campaign","kind":"method","name":"Receipts campaign","needs":["receipt-generator"],"refs":["docs/status/ROADMAP.adoc:330","docs/proposals/mathesis-re-anchoring.adoc:1065"],"size":"L","status":"open","summary":"Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes the ungraded theorems towards a grade.","track":"ecosystem","value":{"ecosystem":3,"soundness":2},"where":"estate:hyperpolymath/secret-types"} {"counsel":{"cartographer":"Converge: the laws exist, at a grade, in their home repository."},"glyph":"โ™ป๏ธ","id":"s1-reuse","kind":"theorem","name":"S-1 by reuse of resource-algebra","needs":["bridge-lock-pilot","token-order"],"rivals":["s1-token-algebra"],"size":"M","status":"open","summary":"Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"maths":2},"where":"estate:hyperpolymath/resource-algebra"} {"counsel":{"contrarian":"resource-algebra already pins E-1 to E-3; proving it again here may be duplication.","maths":"A real algebra of evidence; the centre of the research programme."},"glyph":"๐Ÿ”ข","id":"s1-token-algebra","kind":"theorem","name":"S-1: tokens form a dioid","needs":["theory-shelf","token-order"],"refs":["docs/proposals/mathesis-research-programme.adoc:346","docs/proposals/mathesis-research-programme.adoc:544"],"rivals":["s1-reuse"],"size":"L","status":"open","summary":"The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1).","track":"maths","value":{"maths":3,"publications":2,"soundness":2}} {"counsel":{"contrarian":"The one theorem of the line that does not wait for the order: start it early."},"glyph":"๐Ÿ“ˆ","id":"s2-monotone","kind":"theorem","name":"S-2: evaluation is monotone","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:368"],"size":"S","status":"open","summary":"Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3).","track":"maths","value":{"maths":2,"soundness":1}} diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 0cf98aa7..c136c675 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -153,6 +153,8 @@ export function registryGrade(registryText, id) { // two could differ, it says no (fails closed). // - A heading inside a delimited block (a comment, a listing, an example) is // not a section of the ADR. +// - A Status heading is a section heading, "==" or deeper: "= Status" is the +// document's title. // - A heading starts a section only after a blank line, with no block attribute // line or block title waiting above it, across blank lines and comments: // "[discrete]" makes it a floating title. @@ -189,7 +191,7 @@ export function adrAccepted(text) { if (lines.some(l => PREPROCESSOR.test(l))) return false; const kinds = lineKinds(lines); const heads = lines.flatMap((l, i) => - kinds[i] === 'text' && /^=+ Status$/.test(l) && startsSection(lines, kinds, i) ? [i] : []); + kinds[i] === 'text' && /^==+ Status$/.test(l) && startsSection(lines, kinds, i) ? [i] : []); if (heads.length !== 1) return false; const next = lines.find((l, i) => i > heads[0] && l !== '' && kinds[i] !== 'comment'); return /^\**Accepted\b/.test(next?.trim() ?? ''); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 2845bdba..9e301734 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -384,6 +384,11 @@ test('an ADR is accepted only by its own one Status section', () => { for (const above of ['[discrete]\n', '[float]\n', '[discrete]\n\n', '[discrete]\n////\nx\n////\n\n', '[discrete]\n// note\n\n', 'Some text.\n']) expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); expect(adrAccepted(adr('=== Status\n// a comment\nAccepted'))).toBe(true); + // "= Status" is the document's title, not a section (Asciidoctor agrees), also + // after leading comments, which may come before a document header. + expect(adrAccepted('= Status\n\nAccepted\n')).toBe(false); + expect(adrAccepted('// note\n////\nx\n////\n\n= Status\n\nAccepted\n')).toBe(false); + expect(adrAccepted('== Status\n\nAccepted\n')).toBe(true); // A heading inside a block is not a section even with a blank line above it. for (const block of ['----\nexample\n\n=== Status\n\nAccepted\n----', '////\nold\n\n=== Status\n\nAccepted\n////', '====\n\n=== Status\n\nAccepted\n====']) expect(adrAccepted(adr(block))).toBe(false); From 7eac1c223e4e05120e372ef38486b1566e2fb8a6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 10:17:31 +0000 Subject: [PATCH 25/41] ultraplan: refs point at checked passages; the ADR reader over-counts Codex found two problems on ed01342. Checking them found more. The ADR reader did not know Markdown fences. Asciidoctor reads three backticks, with any language after them, as a fenced block that only a bare "```" closes; "````" and "~~~" delimit nothing. A probe found nine cases where the reader accepted an ADR that Asciidoctor does not. Widening the differential corpus to 124,800 variants, with fences among the prefixes, exposed a wider hole. The reader counted Status headings only in the form "==" or deeper, so a second Status section in another form went uncounted. Asciidoctor reads all of these as sections: "= Status" after the title, "## Status", "== Status ==", two blanks or a tab after the markers, an underlined two-line title, a title that a substitution spells ("{s}", "+Status+", "pass:[Status]", "Stat{empty}us", "((Status))"), one under an attribute line, and one straight after a closed block. Seven "=" make no heading at all. The section's first line could also fail to be a paragraph: an indented line, a description-list term, an underlined title, or a line starting "///", which is text, not a comment. With fences fixed, the reader still accepted 23 of 43 such probe cases that Asciidoctor does not. On the new corpus, ed01342 accepts 7,056 that Asciidoctor does not. The earlier claim of none in 58,752 variants held for that corpus only, which lacked these shapes. So the reader no longer tries to mirror Asciidoctor. It over-counts: every line that could be a heading titled Status counts, inside a block or not, and an ADR is read only when exactly one does. That line must be "==" to "======", one blank and "Status", outside any block. It must follow a blank line, with nothing above it that attaches it to what came before: a block attribute line, a block title, a list continuation or a description-list term. The first line after it, past blank lines and comments, must begin "Accepted", unindented and with no list marker. No text line may stand over an underline of about its length. Against Asciidoctor 2.0.26 it now accepts nothing that Asciidoctor refuses, on the 124,800 variants and the 43 probes. It agrees on every file in docs/decisions. It refuses more than before: on 38,320 variants that Asciidoctor accepts, most with a Status heading hidden in a block, it fails closed. The same probe found a hole in the page's own text contract. "::", ":::", "::::" or ";;" before a blank or the end of a line makes Asciidoctor read the whole line as a description-list term, wherever the marker stands, and the {empty} before a summary does not stop it. No text holds one today. The plan's reader now refuses any text or member name that does. The refs typed line numbers, and several were wrong from the start: ROADMAP:92 named an Agda version note, not the Dedukti findings. Renumbering them would rot again with the next edit. A ref is now an object the generator checks: - {"at","path"}: a passage that occurs exactly once in a file here, so a reworded, moved or repeated passage fails `just check`; - {"path"}: a file or directory here, which must exist; - {"at","commit","path","repo"}: a file of another repository at a full commit, whose content cannot drift (not checked here); - {"issue"}: a GitHub issue or pull request. Each of the 50 refs now names the passage its node meant, recovered from the line it named at 2e7b202 and from the node's summary. The page shows each quote verbatim as a literal code span. The tests cover each fence, heading form, opening-line trap, attachment, list marker and kind of ref. Each case was checked against Asciidoctor 2.0.26, and the comments say where the reader fails closed on a case Asciidoctor accepts. A mutation sweep disabled each of 104 guards in turn, the new ones included, and every mutant made a test fail. One check, that the line after the heading is text, was dead, because no delimiter begins "Accepted"; it is removed. All 30 tests pass. eslint-plugin-sonarjs reports nothing. Asciidoctor renders the README, the CHANGELOG and the page at WARN, with no description list on the page. just ultraplan-check, check-views and site-check pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 10 +- docs/ultraplan/README.adoc | 31 ++++- docs/ultraplan/generated/ultraplan.adoc | 58 ++++----- docs/ultraplan/tree.jsonl | 58 ++++----- scripts/ultraplan/ultraplan.mjs | 161 ++++++++++++++++++++---- tests/ultraplan/ultraplan.test.mjs | 114 ++++++++++++++++- 6 files changed, 343 insertions(+), 89 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 4ab11a2a..07dd07bb 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -85,10 +85,18 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. + The generator refuses: ** a done node without evidence that holds: a file, a claim grade the - registry derives, or an accepted ADR; + registry derives, or an accepted ADR. The ADR reader over-counts: every + line that could be a Status heading counts, inside a block or not, and + the ADR is read only when exactly one does, a plain section whose first + paragraph begins "Accepted"; ** a done node whose needs are not done; ** a cycle; ** more than three active nodes; + ** a ref that does not point at one place: each names a passage that occurs + exactly once in a file here, a path here, a file of another repository at + a full commit, or an issue, and never a line number; + ** a text holding a line break or a description-list marker, either of which + would make block syntax on the page; ** any note from the private me advisor. + `just ultraplan` and `just ultraplan-check` run it, and `check-views` includes diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 2d4fb99e..a3426138 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -57,6 +57,13 @@ A typed status is held to account: accepts a file that exists, a claim whose grade the registry view derives at or above a stated grade, or a decision record whose status is Accepted. A done node's needs must be done too. ++ +The decision record is read conservatively, so the reader never finds an +Accepted that Asciidoctor would not. Every line that could be a heading titled +Status counts, inside a block or not. The record is read only when exactly one +does, and that one is a plain section heading (`==` to `======`, then `Status`) +whose first paragraph begins "Accepted". Anything it cannot read plainly, such +as a preprocessor directive or an underlined title, is refused. * *Active* is limited: at most three nodes may be active at once. To start a fourth, finish or park one first. This is the guard against starting everything. When every slot is taken, the page and the picture still show the frontier, and @@ -66,8 +73,15 @@ say that it is ready but cannot start. Each text (a name, a summary, a piece of counsel, a reason) is one line of AsciiDoc inline markup. A code span, bold text or an attribute reference such as `+{nbsp}+` renders as it would in any AsciiDoc paragraph. Block syntax cannot -occur: the generator refuses a line break or any other control character, and it -writes a summary, the one text that starts a line of the page, after `+{empty}+`. +occur: + +* The generator refuses a line break or any other control character. +* It refuses a description-list marker: `+::+`, `+:::+`, `+::::+` or `+;;+` +followed by a blank or the end of the text. Asciidoctor reads a line holding +one as a list term wherever the marker stands, so no prefix keeps it text. A +`+::+` with no blank after it, as in a URL, is not a marker. +* It writes a summary, the one text that starts a line of the page, after +`+{empty}+`. A text does not type a count that the data derives, such as a number of claims, repositories or theorems: the views carry those counts, and a typed one goes stale. @@ -135,6 +149,19 @@ root. . If the work lands in another repository, set `"where":"estate:OWNER/REPO"` or `"upstream:OWNER/REPO"`. The page lists those nodes so they can be carried there. +. Point at its sources in `refs`, by what they say and never by line number: a +line number goes stale with the next edit, and nothing notices. A ref is one of +these: +** `+{"at":"a passage","path":"docs/x.adoc"}+`: a passage of a file in this +repository. The passage must occur in the file exactly once. `just check` +refuses the ref when the passage is reworded, moved away or repeated, so a ref +never points nowhere unseen. A passage holds no backtick, plus or backslash. +** `+{"path":"docs/x"}+`: a file or a directory of this repository, which must +exist. +** `+{"at":"โ€ฆ","commit":"","path":"โ€ฆ","repo":"OWNER/REPO"}+`: a +file of another repository at a commit. The commit fixes its content, so it +cannot drift. It is not checked here. +** `+{"issue":"OWNER/REPO#N"}+`: a GitHub issue or pull request. . Run `just ultraplan`, then `just check`. == GELS diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 18b484f5..3f7b8341 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -222,7 +222,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:census[๐Ÿงพ Census of the estate] + *Enables:* xref:whats-owed[๐Ÿ“‹ What is owed] + *Value (judgement):* engineering โ—โ—, ecosystem โ—โ— + -*See:* docs/proposals/mathesis-re-anchoring.adoc:1075 +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.3 Schedule the census+` [[claims-registry]] ==== โœ… ๐Ÿ“’ Claims registry @@ -246,7 +246,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] + *Enables:* xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1] + *Value (judgement):* engineering โ—โ—, soundness โ—โ—โ— + -*See:* docs/status/PROOF-STATUS.adoc:33 +*See:* `docs/status/PROOF-STATUS.adoc`, at `+standards#1625 (2026-11-17)+` * ๐Ÿ” _Soundness auditor:_ The only road back to PWG-1 for THY-1 and APP-1 to APP-4. @@ -274,7 +274,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + *Enables:* xref:token-order[โš–๏ธ Settle the order of status tokens] + *Value (judgement):* maths โ—โ—โ—, science โ—โ—, soundness โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:390; docs/proposals/mathesis-research-programme.adoc:458 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+=== What experiment X-PF1 can change+`; `docs/proposals/mathesis-research-programme.adoc`, at `+the list covers the proof-route ABI, the registry and+` * โˆ‘ _Mathematician:_ The deepest open question on the board; it decides what S-1 even says. * ๐Ÿ”ฌ _Scientist:_ Pre-register what result means A, B or C before computing. @@ -300,7 +300,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + *Value (judgement):* teaching โ—, soundness โ—โ—โ— + -*See:* docs/status/ROADMAP.adoc:30; docs/status/PROOF-NEEDS.adoc:27; README.adoc:46; .machine_readable/contractiles/intend +*See:* `docs/status/ROADMAP.adoc`, at `+=== First theory theorem (2026-11-09)+`; `docs/status/PROOF-NEEDS.adoc`, at `+Discharged: the receipt derives+`; `README.adoc`, at `+The token-lattice theorems of the theory shelf, receipts for the cohort model+`; `.machine_readable/contractiles/intend` * ๐Ÿƒ _Contrarian:_ Cheapest node on the board, and the auditor's favourite. * ๐Ÿ” _Soundness auditor:_ Every one of these is a claim with no receipt behind it; mend before adding. @@ -363,7 +363,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + *Enables:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] + *Value (judgement):* engineering โ—, ecosystem โ—โ— + -*See:* docs/status/ROADMAP.adoc:92; docs/proposals/mathesis-research-programme.adoc:693 +*See:* `docs/status/ROADMAP.adoc`, at `+Next action: the owner files both reports+`; `docs/proposals/mathesis-research-programme.adoc`, at `+File the THY-1 reproducer with the translator's authors+` * ๐Ÿช™ _Economist:_ A few hours of filing could unblock a whole route for everyone. @@ -377,7 +377,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:census-workflow[โฐ Census on a schedule], xref:claims-registry[๐Ÿ“’ Claims registry] + *Enables:* xref:concept-commons[๐Ÿ›๏ธ Concept commons] + *Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ—โ—โ— + -*See:* docs/proposals/mathesis-re-anchoring.adoc:1079 +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.4 Report what is owed+` === ๐ŸŒŒ Era 3: Kepler @@ -391,7 +391,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + *Enables:* xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] + *Value (judgement):* maths โ—, teaching โ—โ—, soundness โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:291; docs/proposals/mathesis-research-programme.adoc:1017 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Describe the method of the previous section as one checklist+`; `docs/proposals/mathesis-research-programme.adoc`, at `+R-5 The dossier.+` [[s2-monotone]] ==== ๐ŸŒฑ ๐Ÿ“ˆ S-2: evaluation is monotone @@ -403,7 +403,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + *Enables:* xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + *Value (judgement):* maths โ—โ—, soundness โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:368 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-2 (positive evaluation is monotone)+` * ๐Ÿƒ _Contrarian:_ The one theorem of the line that does not wait for the order: start it early. @@ -417,7 +417,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + *Enables:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:792; docs/proposals/mathesis-research-programme.adoc:824 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-4 (a sound cash verdict)+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Write one synthetic 13-week forecast as records+` * ๐Ÿช™ _Economist:_ A forecast that can say undecided is worth more than one that guesses. * ๐ŸŽ _Teacher:_ Three-valued logic with money attached: an easy story to teach. @@ -432,7 +432,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)] + *Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Value (judgement):* maths โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:335; docs/atlas/generated/registry.adoc:39; metadatastician/standards 3-practice/PROOF-POLICY.adoc:348 (at 745fc74) +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+R-1 The order of the tokens.+`; `docs/atlas/generated/registry.adoc`, at `+[hyperpolymath/resource-algebra#E-1]+`; https://github.com/metadatastician/standards/blob/745fc744158047a675eeb92464167c9961d66c4b/3-practice/PROOF-POLICY.adoc[metadatastician/standards: 3-practice/PROOF-POLICY.adoc] at `745fc7441580`, at `+== 5. Status vocabulary+` * ๐Ÿ—บ๏ธ _Estate cartographer:_ The canon order is the ownerโ€™s ruling in standards, and resource-algebra E-1 may need re-proving; carry both. * โˆ‘ _Mathematician:_ Two careful readings disagree; that is a sign the two tokens are incomparable, which is outcome C. @@ -448,7 +448,7 @@ same place; the contrarian keeps the road not taken in view. *Rivals:* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + *Blocked by:* Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip. + *Value (judgement):* maths โ—, engineering โ—โ—, soundness โ—โ— + -*See:* docs/status/ROADMAP.adoc:92 +*See:* `docs/status/ROADMAP.adoc`, at `+PROOF-POLICY ยง2 puts Dedukti transport first and a re-proof by hand second.+` * ๐Ÿƒ _Contrarian:_ Policy puts this route first, yet every re-proof so far went the other way. @@ -474,7 +474,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + *Value (judgement):* maths โ—โ—, science โ—โ—โ—, publications โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:641 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-2.6 Can a statistical oracle become theory?+` * ๐Ÿ”ฌ _Scientist:_ Takes a statistical result that is only tested and makes it a theorem. @@ -488,7 +488,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + *Enables:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* engineering โ—, economics โ—โ—โ—, teaching โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:824; applied-systems/finance/liquidity/README.adoc +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Write one synthetic 13-week forecast as records+`; `applied-systems/finance/liquidity/README.adoc` * ๐Ÿช™ _Economist:_ The first output a business reader would recognise. @@ -515,7 +515,7 @@ same place; the contrarian keeps the road not taken in view. *Enables:* xref:talk-atlas[๐ŸŽค Talk: an atlas of an estate] + *Blocked by:* the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk + *Value (judgement):* publications โ—โ—โ—, teaching โ—โ—, ecosystem โ—โ— + -*See:* docs/status/ROADMAP.adoc:262; docs/proposals/mathesis-re-anchoring.adoc:1058 +*See:* `docs/status/ROADMAP.adoc`, at `+WO 4.3, publish the atlas+`; `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 4.3 Publish the atlas+` * ๐Ÿ“œ _Publisher:_ Everything else here is invisible until this happens. * ๐Ÿ” _Soundness auditor:_ Publish only views whose checks are green, or the site states what the receipts do not. @@ -542,7 +542,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates] + *Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + *Value (judgement):* maths โ—โ—, science โ—, ecosystem โ—โ—โ— + -*See:* docs/proposals/mathesis-re-anchoring.adoc:803; docs/proposals/mathesis-re-anchoring.adoc:1071 +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+=== The lock+`; `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.2 Pilot the bridge lock+` * ๐Ÿ—บ๏ธ _Estate cartographer:_ The first real convergence between repositories; everything cross-repo waits on it. * โˆ‘ _Mathematician:_ Equivalence as identity, made checkable. @@ -570,7 +570,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot], xref:token-order[โš–๏ธ Settle the order of status tokens] + *Enables:* xref:concept-commons[๐Ÿ›๏ธ Concept commons], xref:corpus[๐Ÿงช Propose and dispose corpus] + *Value (judgement):* maths โ—โ—โ—, science โ—โ— + -*See:* docs/proposals/mathesis-re-anchoring.adoc:786 +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+=== What the centre computes+` [[s1-token-algebra]] ==== ๐ŸŒฑ ๐Ÿ”ข S-1: tokens form a dioid @@ -583,7 +583,7 @@ same place; the contrarian keeps the road not taken in view. *Enables:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + *Rivals:* xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + *Value (judgement):* maths โ—โ—โ—, publications โ—โ—, soundness โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:346; docs/proposals/mathesis-research-programme.adoc:544 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-1 (the tokens are a bottleneck grade)+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Prove S-1 in Agda against+` * ๐Ÿƒ _Contrarian:_ resource-algebra already pins E-1 to E-3; proving it again here may be duplication. * โˆ‘ _Mathematician:_ A real algebra of evidence; the centre of the research programme. @@ -598,7 +598,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:receipts[๐Ÿ” Proof receipts], xref:token-order[โš–๏ธ Settle the order of status tokens] + *Enables:* xref:corpus[๐Ÿงช Propose and dispose corpus], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + *Value (judgement):* maths โ—โ—, engineering โ—โ—, soundness โ—โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:378; docs/proposals/mathesis-research-programme.adoc:550 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-3 (the grade is a function of the receipt)+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Run the table of S-3 against the canon reader+` * ๐Ÿ” _Soundness auditor:_ Turns the reader from trusted code into a checked one. @@ -622,7 +622,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:dossier[๐Ÿ—‚๏ธ Theorem dossier] + *Value (judgement):* maths โ—, engineering โ—โ—โ—, soundness โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:743; docs/proposals/mathesis-research-programme.adoc:755 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-3.1 Can the composite status be computed?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+as the first vertical slice (ruling R-4)+` [[pwg1-regained]] ==== ๐ŸŒฑ ๐Ÿฅ‡ Back to PWG-1 @@ -643,7 +643,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + *Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ— + -*See:* metadatastician/standards#1705, merged at 84c2d1c; hyperpolymath/mathesis#122 turns it on: RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, alike for --write and --check +*See:* https://github.com/metadatastician/standards/issues/1705[metadatastician/standards#1705]; https://github.com/hyperpolymath/mathesis/issues/122[hyperpolymath/mathesis#122] * ๐Ÿƒ _Contrarian:_ The ledger already holds every digest; check the option earns its keep. * ๐Ÿ” _Soundness auditor:_ Lineage you can re-check without git archaeology. @@ -658,7 +658,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + *Enables:* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + *Value (judgement):* maths โ—, science โ—โ—โ—, publications โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:609; docs/proposals/mathesis-research-programme.adoc:679 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-2.1 What must a statement comparison record?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Write the five existing comparisons as bridge records+` * ๐Ÿ“œ _Publisher:_ Nobody has this list; it is citable on its own. * ๐Ÿ”ฌ _Scientist:_ Each entry should come with a counterexample that shows it. @@ -693,7 +693,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + *Value (judgement):* maths โ—โ—, ecosystem โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:695 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Write one bridge record for each of the six Echo mirrors+` [[receipts-campaign]] ==== ๐ŸŒฑ ๐Ÿ“ฃ Receipts campaign @@ -705,7 +705,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + *Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* soundness โ—โ—, ecosystem โ—โ—โ— + -*See:* docs/status/ROADMAP.adoc:330; docs/proposals/mathesis-re-anchoring.adoc:1065 +*See:* `docs/status/ROADMAP.adoc`, at `+(re-anchoring plan WO 5.1)+`; `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.1 Bring receipts to the home repositories+` * ๐Ÿ—บ๏ธ _Estate cartographer:_ The registry is only as current as the home receipts. @@ -733,7 +733,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:whats-owed[๐Ÿ“‹ What is owed] + *Value (judgement):* maths โ—โ—, teaching โ—โ—โ—, ecosystem โ—โ— + -*See:* docs/proposals/mathesis-re-anchoring.adoc:441; docs/proposals/estate-mathematical-architecture.adoc:158 +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+M4. Concept commons+`; `docs/proposals/estate-mathematical-architecture.adoc`, at `+4. Navigation Views+` [[bridge-by-construction]] ==== ๐ŸŒฑ ๐Ÿ— Bridges by construction @@ -746,7 +746,7 @@ same place; the contrarian keeps the road not taken in view. *Enables:* xref:corpus[๐Ÿงช Propose and dispose corpus] + *Rivals:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] + *Value (judgement):* maths โ—โ—, engineering โ—โ—โ—, publications โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:620; docs/proposals/mathesis-research-programme.adoc:690 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-2.3 Can a bridge hold by construction?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Generate the three forms of S-1 from one source+` * โš™๏ธ _Engineer:_ Removes the hand-copying of statements that every re-proof does today. @@ -759,7 +759,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + *Value (judgement):* maths โ—, engineering โ—โ—, ecosystem โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:760 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Generate the Idris2 statement of the token laws from the source of+` [[value-of-information]] ==== ๐ŸŒฑ ๐Ÿ”ญ Value of information @@ -770,7 +770,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* maths โ—โ—, science โ—โ—, economics โ—โ—โ— + -*See:* applied-systems/decision-science/README.adoc +*See:* `applied-systems/decision-science/README.adoc` [[paper-receipts]] ==== ๐ŸŒฑ ๐Ÿ“ฐ Paper: receipts, not claims @@ -804,7 +804,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:centre-computations[๐ŸŽฏ Centre computations], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* maths โ—โ—, engineering โ—โ—, science โ—โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:891 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Define the corpus as a view over bridge records and receipts+` === ๐Ÿš€ Era 7: Frontier beyond @@ -817,7 +817,7 @@ same place; the contrarian keeps the road not taken in view. *Needs:* xref:corpus[๐Ÿงช Propose and dispose corpus], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:ci-recorder[๐Ÿค– CI records its own runs] + *Value (judgement):* maths โ—โ—, science โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— + -*See:* docs/proposals/mathesis-research-programme.adoc:883; docs/proposals/mathesis-research-programme.adoc:903 +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-H.3 What does a recheck leg cost?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+A measured cost for a recheck leg, and with it a+` == Return tickets diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index 16603445..6990a764 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -1,52 +1,52 @@ {"evidence":[{"claim":"hyperpolymath/mathesis#APP-1","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-2","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-3","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-4","min_pwg":"PWG-2ii"}],"glyph":"๐Ÿ’ง","id":"app-proofs","kind":"theorem","name":"APP-1 to APP-4: missing stays missing","needs":["cohort-model"],"size":"M","status":"done","summary":"Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean.","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} {"evidence":[{"path":"docs/atlas/generated/catalogue.adoc"},{"path":"docs/atlas/generated/az.adoc"}],"glyph":"๐Ÿ—บ๏ธ","id":"atlas-views","kind":"view","name":"Atlas views","needs":["census"],"size":"M","status":"done","summary":"The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`.","track":"engineering","value":{"ecosystem":2,"engineering":2,"teaching":2}} -{"counsel":{"engineering":"Removes the hand-copying of statements that every re-proof does today."},"glyph":"๐Ÿ—","id":"bridge-by-construction","kind":"tool","name":"Bridges by construction","needs":["encoding-differences","s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:620","docs/proposals/mathesis-research-programme.adoc:690"],"rivals":["dedukti-transport"],"size":"L","status":"open","summary":"Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match.","track":"engineering","value":{"engineering":3,"maths":2,"publications":1}} +{"counsel":{"engineering":"Removes the hand-copying of statements that every re-proof does today."},"glyph":"๐Ÿ—","id":"bridge-by-construction","kind":"tool","name":"Bridges by construction","needs":["encoding-differences","s1-token-algebra"],"refs":[{"at":"Q-2.3 Can a bridge hold by construction?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"Generate the three forms of S-1 from one source","path":"docs/proposals/mathesis-research-programme.adoc"}],"rivals":["dedukti-transport"],"size":"L","status":"open","summary":"Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match.","track":"engineering","value":{"engineering":3,"maths":2,"publications":1}} {"evidence":[{"path":"docs/atlas/claims/bridges.jsonl"}],"glyph":"๐ŸŒ‰","id":"bridge-candidates","kind":"data","name":"Bridge candidates","needs":["claims-registry"],"size":"S","status":"done","summary":"Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence.","track":"ecosystem","value":{"ecosystem":3,"maths":2}} -{"counsel":{"cartographer":"The first real convergence between repositories; everything cross-repo waits on it.","maths":"Equivalence as identity, made checkable."},"glyph":"๐Ÿ”—","id":"bridge-lock-pilot","kind":"method","name":"Bridge lock pilot","needs":["bridge-candidates"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:803","docs/proposals/mathesis-re-anchoring.adoc:1071"],"size":"M","status":"open","summary":"The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1}} +{"counsel":{"cartographer":"The first real convergence between repositories; everything cross-repo waits on it.","maths":"Equivalence as identity, made checkable."},"glyph":"๐Ÿ”—","id":"bridge-lock-pilot","kind":"method","name":"Bridge lock pilot","needs":["bridge-candidates"],"refs":[{"at":"=== The lock","path":"docs/proposals/mathesis-re-anchoring.adoc"},{"at":"WO 5.2 Pilot the bridge lock","path":"docs/proposals/mathesis-re-anchoring.adoc"}],"size":"M","status":"open","summary":"The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1}} {"evidence":[{"path":"docs/atlas/census/rows.jsonl"},{"path":"scripts/census/run-census.sh"}],"glyph":"๐Ÿงพ","id":"census","kind":"data","name":"Census of the estate","size":"L","status":"done","summary":"The proof census of the public repositories: a row for each proof file, with its holes and axioms, at a pinned commit and time.","track":"engineering","value":{"ecosystem":3,"engineering":2,"science":2}} -{"glyph":"โฐ","id":"census-workflow","kind":"infrastructure","name":"Census on a schedule","needs":["census"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1075"],"size":"M","status":"open","summary":"A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded.","track":"engineering","value":{"ecosystem":2,"engineering":2}} -{"glyph":"๐ŸŽฏ","id":"centre-computations","kind":"method","name":"Centre computations","needs":["bridge-lock-pilot","token-order"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:786"],"size":"L","status":"open","summary":"Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801).","track":"maths","value":{"maths":3,"science":2}} -{"counsel":{"maths":"The deepest open question on the board; it decides what S-1 even says.","science":"Pre-register what result means A, B or C before computing."},"glyph":"๐Ÿงฉ","id":"chain-question","kind":"theorem","name":"Is a chain enough? (X-PF1)","needs":["claims-registry"],"refs":["docs/proposals/mathesis-research-programme.adoc:390","docs/proposals/mathesis-research-programme.adoc:458"],"size":"M","status":"active","summary":"Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order.","track":"maths","value":{"maths":3,"science":2,"soundness":2}} +{"glyph":"โฐ","id":"census-workflow","kind":"infrastructure","name":"Census on a schedule","needs":["census"],"refs":[{"at":"WO 5.3 Schedule the census","path":"docs/proposals/mathesis-re-anchoring.adoc"}],"size":"M","status":"open","summary":"A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded.","track":"engineering","value":{"ecosystem":2,"engineering":2}} +{"glyph":"๐ŸŽฏ","id":"centre-computations","kind":"method","name":"Centre computations","needs":["bridge-lock-pilot","token-order"],"refs":[{"at":"=== What the centre computes","path":"docs/proposals/mathesis-re-anchoring.adoc"}],"size":"L","status":"open","summary":"Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801).","track":"maths","value":{"maths":3,"science":2}} +{"counsel":{"maths":"The deepest open question on the board; it decides what S-1 even says.","science":"Pre-register what result means A, B or C before computing."},"glyph":"๐Ÿงฉ","id":"chain-question","kind":"theorem","name":"Is a chain enough? (X-PF1)","needs":["claims-registry"],"refs":[{"at":"=== What experiment X-PF1 can change","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"the list covers the proof-route ABI, the registry and","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"active","summary":"Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order.","track":"maths","value":{"maths":3,"science":2,"soundness":2}} {"glyph":"๐Ÿค–","id":"ci-recorder","kind":"infrastructure","name":"CI records its own runs","needs":["receipt-generator"],"size":"M","status":"open","summary":"A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open.","track":"engineering","value":{"ecosystem":2,"engineering":3,"soundness":2},"where":"estate:metadatastician/standards"} {"evidence":[{"adr":"0004"},{"path":"docs/atlas/generated/registry.adoc"}],"glyph":"๐Ÿ“’","id":"claims-registry","kind":"tool","name":"Claims registry","needs":["census"],"size":"L","status":"done","summary":"Pins each claim in its home repository and derives each grade from the home receipt with the pinned canon reader. No grade is typed.","track":"engineering","value":{"ecosystem":3,"engineering":3,"soundness":3}} {"evidence":[{"path":"verification/proofs/agda/Applied/Cohort.agda"},{"path":"applied-systems/methods/input-schema.adoc"}],"glyph":"๐Ÿ‘ฅ","id":"cohort-model","kind":"method","name":"Cohort model in Agda","needs":["proof-gate"],"size":"M","status":"done","summary":"The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines.","track":"maths","value":{"economics":2,"maths":2,"teaching":2}} -{"glyph":"๐Ÿ›๏ธ","id":"concept-commons","kind":"view","name":"Concept commons","needs":["centre-computations","whats-owed"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:441","docs/proposals/estate-mathematical-architecture.adoc:158"],"size":"XL","status":"open","summary":"The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance.","track":"maths","value":{"ecosystem":2,"maths":2,"teaching":3}} -{"glyph":"๐Ÿงช","id":"corpus","kind":"method","name":"Propose and dispose corpus","needs":["bridge-by-construction","centre-computations","s3-grade-function"],"refs":["docs/proposals/mathesis-research-programme.adoc:891"],"size":"XL","status":"open","summary":"A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2).","track":"science","value":{"engineering":2,"maths":2,"science":3}} -{"blocked_by":"Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip.","counsel":{"contrarian":"Policy puts this route first, yet every re-proof so far went the other way."},"glyph":"๐Ÿš‚","id":"dedukti-transport","kind":"tool","name":"Transport through Dedukti","needs":["thy1","file-transport-bugs"],"refs":["docs/status/ROADMAP.adoc:92"],"rivals":["bridge-by-construction"],"size":"L","status":"blocked","summary":"Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first.","track":"engineering","value":{"engineering":2,"maths":1,"soundness":2},"where":"upstream:Deducteam/lambdapi"} -{"counsel":{"contrarian":"Cheapest node on the board, and the auditor's favourite.","soundness":"Every one of these is a claim with no receipt behind it; mend before adding."},"glyph":"๐Ÿงน","id":"doc-drift-fix","kind":"decision","name":"Mend the status documents","needs":["claims-registry"],"refs":["docs/status/ROADMAP.adoc:30","docs/status/PROOF-NEEDS.adoc:27","README.adoc:46",".machine_readable/contractiles/intend"],"size":"S","status":"open","summary":"ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts.","track":"engineering","value":{"soundness":3,"teaching":1}} -{"glyph":"๐Ÿ—‚๏ธ","id":"dossier","kind":"method","name":"Theorem dossier","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:291","docs/proposals/mathesis-research-programme.adoc:1017"],"size":"S","status":"open","summary":"The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open.","track":"maths","value":{"maths":1,"soundness":2,"teaching":2}} -{"glyph":"๐Ÿชž","id":"echo-mirrors","kind":"data","name":"Echo mirror records","needs":["bridge-lock-pilot"],"refs":["docs/proposals/mathesis-research-programme.adoc:695"],"size":"M","status":"open","summary":"Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question.","track":"ecosystem","value":{"ecosystem":2,"maths":2},"where":"estate:hyperpolymath/echo-types"} -{"counsel":{"publications":"Nobody has this list; it is citable on its own.","science":"Each entry should come with a counterexample that shows it."},"glyph":"๐Ÿ”ค","id":"encoding-differences","kind":"data","name":"Closed list of encoding differences","needs":["bridge-lock-pilot"],"refs":["docs/proposals/mathesis-research-programme.adoc:609","docs/proposals/mathesis-research-programme.adoc:679"],"size":"M","status":"open","summary":"A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1).","track":"science","value":{"maths":1,"publications":2,"science":3}} -{"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":["docs/proposals/mathesis-research-programme.adoc:883","docs/proposals/mathesis-research-programme.adoc:903"],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} -{"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":["docs/status/ROADMAP.adoc:92","docs/proposals/mathesis-research-programme.adoc:693"],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} -{"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":["docs/proposals/mathesis-research-programme.adoc:824","applied-systems/finance/liquidity/README.adoc"],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} +{"glyph":"๐Ÿ›๏ธ","id":"concept-commons","kind":"view","name":"Concept commons","needs":["centre-computations","whats-owed"],"refs":[{"at":"M4. Concept commons","path":"docs/proposals/mathesis-re-anchoring.adoc"},{"at":"4. Navigation Views","path":"docs/proposals/estate-mathematical-architecture.adoc"}],"size":"XL","status":"open","summary":"The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance.","track":"maths","value":{"ecosystem":2,"maths":2,"teaching":3}} +{"glyph":"๐Ÿงช","id":"corpus","kind":"method","name":"Propose and dispose corpus","needs":["bridge-by-construction","centre-computations","s3-grade-function"],"refs":[{"at":"Define the corpus as a view over bridge records and receipts","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"XL","status":"open","summary":"A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2).","track":"science","value":{"engineering":2,"maths":2,"science":3}} +{"blocked_by":"Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip.","counsel":{"contrarian":"Policy puts this route first, yet every re-proof so far went the other way."},"glyph":"๐Ÿš‚","id":"dedukti-transport","kind":"tool","name":"Transport through Dedukti","needs":["thy1","file-transport-bugs"],"refs":[{"at":"PROOF-POLICY ยง2 puts Dedukti transport first and a re-proof by hand second.","path":"docs/status/ROADMAP.adoc"}],"rivals":["bridge-by-construction"],"size":"L","status":"blocked","summary":"Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first.","track":"engineering","value":{"engineering":2,"maths":1,"soundness":2},"where":"upstream:Deducteam/lambdapi"} +{"counsel":{"contrarian":"Cheapest node on the board, and the auditor's favourite.","soundness":"Every one of these is a claim with no receipt behind it; mend before adding."},"glyph":"๐Ÿงน","id":"doc-drift-fix","kind":"decision","name":"Mend the status documents","needs":["claims-registry"],"refs":[{"at":"=== First theory theorem (2026-11-09)","path":"docs/status/ROADMAP.adoc"},{"at":"Discharged: the receipt derives","path":"docs/status/PROOF-NEEDS.adoc"},{"at":"The token-lattice theorems of the theory shelf, receipts for the cohort model","path":"README.adoc"},{"path":".machine_readable/contractiles/intend"}],"size":"S","status":"open","summary":"ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts.","track":"engineering","value":{"soundness":3,"teaching":1}} +{"glyph":"๐Ÿ—‚๏ธ","id":"dossier","kind":"method","name":"Theorem dossier","needs":["theory-shelf"],"refs":[{"at":"Describe the method of the previous section as one checklist","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"R-5 The dossier.","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"S","status":"open","summary":"The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open.","track":"maths","value":{"maths":1,"soundness":2,"teaching":2}} +{"glyph":"๐Ÿชž","id":"echo-mirrors","kind":"data","name":"Echo mirror records","needs":["bridge-lock-pilot"],"refs":[{"at":"Write one bridge record for each of the six Echo mirrors","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question.","track":"ecosystem","value":{"ecosystem":2,"maths":2},"where":"estate:hyperpolymath/echo-types"} +{"counsel":{"publications":"Nobody has this list; it is citable on its own.","science":"Each entry should come with a counterexample that shows it."},"glyph":"๐Ÿ”ค","id":"encoding-differences","kind":"data","name":"Closed list of encoding differences","needs":["bridge-lock-pilot"],"refs":[{"at":"Q-2.1 What must a statement comparison record?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"Write the five existing comparisons as bridge records","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1).","track":"science","value":{"maths":1,"publications":2,"science":3}} +{"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":[{"at":"Q-H.3 What does a recheck leg cost?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"A measured cost for a recheck leg, and with it a","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} +{"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":[{"at":"Next action: the owner files both reports","path":"docs/status/ROADMAP.adoc"},{"at":"File the THY-1 reproducer with the translator's authors","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} +{"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":[{"at":"Write one synthetic 13-week forecast as records","path":"docs/proposals/mathesis-research-programme.adoc"},{"path":"applied-systems/finance/liquidity/README.adoc"}],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} {"blocked_by":"the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then commits a read-only I-JSON/JCS feed, and GELS reads it pinned by commit (owner ruling 2026-11-24) and renders it","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} -{"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":["docs/proposals/mathesis-research-programme.adoc:760"],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} -{"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":["docs/proposals/mathesis-research-programme.adoc:743","docs/proposals/mathesis-research-programme.adoc:755"],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} +{"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":[{"at":"Generate the Idris2 statement of the token laws from the source of","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} +{"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":[{"at":"Q-3.1 Can the composite status be computed?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"as the first vertical slice (ruling R-4)","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} {"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} {"glyph":"๐Ÿ“ฐ","id":"paper-receipts","kind":"paper","name":"Paper: receipts, not claims","needs":["receipt-generator","claims-registry","s3-grade-function"],"size":"L","status":"open","summary":"A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate.","track":"publications","value":{"engineering":1,"publications":3,"soundness":2}} {"glyph":"๐Ÿ“˜","id":"paper-status-algebra","kind":"paper","name":"Paper: an algebra of proof status","needs":["s1-token-algebra","s2-monotone","s3-grade-function"],"size":"L","status":"open","summary":"S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt.","track":"publications","value":{"maths":3,"publications":3}} {"counsel":{"publications":"A complete, small, checked result: the easiest first paper."},"glyph":"๐Ÿ“„","id":"paper-thy1","kind":"paper","name":"Note: feature reachability","needs":["thy1","receipts"],"owner_value":"high","size":"M","status":"open","summary":"A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule.","track":"publications","value":{"maths":1,"publications":3,"teaching":1}} -{"counsel":{"soundness":"The only road back to PWG-1 for THY-1 and APP-1 to APP-4."},"glyph":"๐Ÿ“ฆ","id":"pinned-image","kind":"infrastructure","name":"Proof lanes in a pinned image","needs":["proof-gate"],"refs":["docs/status/PROOF-STATUS.adoc:33"],"size":"M","status":"open","summary":"Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify.","track":"engineering","value":{"engineering":2,"soundness":3}} +{"counsel":{"soundness":"The only road back to PWG-1 for THY-1 and APP-1 to APP-4."},"glyph":"๐Ÿ“ฆ","id":"pinned-image","kind":"infrastructure","name":"Proof lanes in a pinned image","needs":["proof-gate"],"refs":[{"at":"standards#1625 (2026-11-17)","path":"docs/status/PROOF-STATUS.adoc"}],"size":"M","status":"open","summary":"Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify.","track":"engineering","value":{"engineering":2,"soundness":3}} {"evidence":[{"path":"scripts/check-proofs.sh"},{"path":"tests/proofs/gate_controls_test.sh"}],"glyph":"๐Ÿ›ก๏ธ","id":"proof-gate","kind":"infrastructure","name":"Proof gate in pinned Guix","size":"L","status":"done","summary":"Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail.","track":"engineering","value":{"engineering":3,"soundness":3}} -{"blocked_by":"the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk","counsel":{"publications":"Everything else here is invisible until this happens.","soundness":"Publish only views whose checks are green, or the site states what the receipts do not."},"glyph":"๐ŸŒ","id":"publish-atlas","kind":"view","name":"Publish the atlas","needs":["site-build"],"refs":["docs/status/ROADMAP.adoc:262","docs/proposals/mathesis-re-anchoring.adoc:1058"],"size":"S","status":"blocked","summary":"Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node.","track":"publications","value":{"ecosystem":2,"publications":3,"teaching":2}} +{"blocked_by":"the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk","counsel":{"publications":"Everything else here is invisible until this happens.","soundness":"Publish only views whose checks are green, or the site states what the receipts do not."},"glyph":"๐ŸŒ","id":"publish-atlas","kind":"view","name":"Publish the atlas","needs":["site-build"],"refs":[{"at":"WO 4.3, publish the atlas","path":"docs/status/ROADMAP.adoc"},{"at":"WO 4.3 Publish the atlas","path":"docs/proposals/mathesis-re-anchoring.adoc"}],"size":"S","status":"blocked","summary":"Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node.","track":"publications","value":{"ecosystem":2,"publications":3,"teaching":2}} {"glyph":"๐Ÿฅ‡","id":"pwg1-regained","kind":"data","name":"Back to PWG-1","needs":["pinned-image","receipt-generator"],"size":"S","status":"open","summary":"THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image.","track":"engineering","value":{"publications":1,"soundness":2}} {"counsel":{"engineering":"One generator for the estate instead of one per repository."},"glyph":"๐Ÿญ","id":"receipt-generator","kind":"tool","name":"Shared receipt generator","needs":["receipts"],"size":"M","status":"active","summary":"Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122.","track":"engineering","value":{"engineering":3,"soundness":3}} {"evidence":[{"path":"verification/receipts/theory_praxis.deed"}],"glyph":"๐Ÿ”","id":"receipts","kind":"data","name":"Proof receipts","needs":["proof-gate","claims-registry"],"size":"M","status":"done","summary":"The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader.","track":"engineering","value":{"engineering":2,"soundness":3}} -{"counsel":{"cartographer":"The registry is only as current as the home receipts."},"glyph":"๐Ÿ“ฃ","id":"receipts-campaign","kind":"method","name":"Receipts campaign","needs":["receipt-generator"],"refs":["docs/status/ROADMAP.adoc:330","docs/proposals/mathesis-re-anchoring.adoc:1065"],"size":"L","status":"open","summary":"Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes the ungraded theorems towards a grade.","track":"ecosystem","value":{"ecosystem":3,"soundness":2},"where":"estate:hyperpolymath/secret-types"} +{"counsel":{"cartographer":"The registry is only as current as the home receipts."},"glyph":"๐Ÿ“ฃ","id":"receipts-campaign","kind":"method","name":"Receipts campaign","needs":["receipt-generator"],"refs":[{"at":"(re-anchoring plan WO 5.1)","path":"docs/status/ROADMAP.adoc"},{"at":"WO 5.1 Bring receipts to the home repositories","path":"docs/proposals/mathesis-re-anchoring.adoc"}],"size":"L","status":"open","summary":"Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes the ungraded theorems towards a grade.","track":"ecosystem","value":{"ecosystem":3,"soundness":2},"where":"estate:hyperpolymath/secret-types"} {"counsel":{"cartographer":"Converge: the laws exist, at a grade, in their home repository."},"glyph":"โ™ป๏ธ","id":"s1-reuse","kind":"theorem","name":"S-1 by reuse of resource-algebra","needs":["bridge-lock-pilot","token-order"],"rivals":["s1-token-algebra"],"size":"M","status":"open","summary":"Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"maths":2},"where":"estate:hyperpolymath/resource-algebra"} -{"counsel":{"contrarian":"resource-algebra already pins E-1 to E-3; proving it again here may be duplication.","maths":"A real algebra of evidence; the centre of the research programme."},"glyph":"๐Ÿ”ข","id":"s1-token-algebra","kind":"theorem","name":"S-1: tokens form a dioid","needs":["theory-shelf","token-order"],"refs":["docs/proposals/mathesis-research-programme.adoc:346","docs/proposals/mathesis-research-programme.adoc:544"],"rivals":["s1-reuse"],"size":"L","status":"open","summary":"The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1).","track":"maths","value":{"maths":3,"publications":2,"soundness":2}} -{"counsel":{"contrarian":"The one theorem of the line that does not wait for the order: start it early."},"glyph":"๐Ÿ“ˆ","id":"s2-monotone","kind":"theorem","name":"S-2: evaluation is monotone","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:368"],"size":"S","status":"open","summary":"Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3).","track":"maths","value":{"maths":2,"soundness":1}} -{"counsel":{"soundness":"Turns the reader from trusted code into a checked one."},"glyph":"๐ŸŽš๏ธ","id":"s3-grade-function","kind":"theorem","name":"S-3: the grade is a function","needs":["receipts","token-order"],"refs":["docs/proposals/mathesis-research-programme.adoc:378","docs/proposals/mathesis-research-programme.adoc:550"],"size":"M","status":"open","summary":"The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3).","track":"maths","value":{"engineering":2,"maths":2,"soundness":3}} -{"counsel":{"economics":"A forecast that can say undecided is worth more than one that guesses.","teacher":"Three-valued logic with money attached: an easy story to teach."},"glyph":"๐ŸŒฆ๏ธ","id":"s4-s5-verdict","kind":"theorem","name":"S-4 and S-5: honest cash verdicts","needs":["app-proofs"],"refs":["docs/proposals/mathesis-research-programme.adoc:792","docs/proposals/mathesis-research-programme.adoc:824"],"size":"M","status":"open","summary":"A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2).","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} +{"counsel":{"contrarian":"resource-algebra already pins E-1 to E-3; proving it again here may be duplication.","maths":"A real algebra of evidence; the centre of the research programme."},"glyph":"๐Ÿ”ข","id":"s1-token-algebra","kind":"theorem","name":"S-1: tokens form a dioid","needs":["theory-shelf","token-order"],"refs":[{"at":"S-1 (the tokens are a bottleneck grade)","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"Prove S-1 in Agda against","path":"docs/proposals/mathesis-research-programme.adoc"}],"rivals":["s1-reuse"],"size":"L","status":"open","summary":"The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1).","track":"maths","value":{"maths":3,"publications":2,"soundness":2}} +{"counsel":{"contrarian":"The one theorem of the line that does not wait for the order: start it early."},"glyph":"๐Ÿ“ˆ","id":"s2-monotone","kind":"theorem","name":"S-2: evaluation is monotone","needs":["theory-shelf"],"refs":[{"at":"S-2 (positive evaluation is monotone)","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"S","status":"open","summary":"Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3).","track":"maths","value":{"maths":2,"soundness":1}} +{"counsel":{"soundness":"Turns the reader from trusted code into a checked one."},"glyph":"๐ŸŽš๏ธ","id":"s3-grade-function","kind":"theorem","name":"S-3: the grade is a function","needs":["receipts","token-order"],"refs":[{"at":"S-3 (the grade is a function of the receipt)","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"Run the table of S-3 against the canon reader","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3).","track":"maths","value":{"engineering":2,"maths":2,"soundness":3}} +{"counsel":{"economics":"A forecast that can say undecided is worth more than one that guesses.","teacher":"Three-valued logic with money attached: an easy story to teach."},"glyph":"๐ŸŒฆ๏ธ","id":"s4-s5-verdict","kind":"theorem","name":"S-4 and S-5: honest cash verdicts","needs":["app-proofs"],"refs":[{"at":"S-4 (a sound cash verdict)","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"Write one synthetic 13-week forecast as records","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2).","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} {"evidence":[{"path":"scripts/site/site.mjs"}],"glyph":"๐Ÿ—๏ธ","id":"site-build","kind":"view","name":"Atlas site (build)","needs":["atlas-views"],"size":"S","status":"done","summary":"Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy.","track":"engineering","value":{"engineering":1,"teaching":2}} -{"counsel":{"science":"Takes a statistical result that is only tested and makes it a theorem."},"glyph":"๐ŸŽฒ","id":"statistical-bridge","kind":"theorem","name":"From oracle to theorem","needs":["theory-shelf"],"refs":["docs/proposals/mathesis-research-programme.adoc:641"],"size":"L","status":"open","summary":"S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6).","track":"science","value":{"maths":2,"publications":2,"science":3}} -{"counsel":{"contrarian":"The ledger already holds every digest; check the option earns its keep.","soundness":"Lineage you can re-check without git archaeology."},"glyph":"๐Ÿ—„๏ธ","id":"superseded-manifests-option","kind":"tool","name":"Keep superseded manifests (option)","needs":["receipt-generator"],"refs":["metadatastician/standards#1705, merged at 84c2d1c","hyperpolymath/mathesis#122 turns it on: RECEIPT_KEEP_LINEAGE_DETAIL=1 in scripts/grade-receipt.sh, alike for --write and --check"],"size":"S","status":"open","summary":"A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges.","track":"engineering","value":{"ecosystem":1,"engineering":1,"soundness":2}} +{"counsel":{"science":"Takes a statistical result that is only tested and makes it a theorem."},"glyph":"๐ŸŽฒ","id":"statistical-bridge","kind":"theorem","name":"From oracle to theorem","needs":["theory-shelf"],"refs":[{"at":"Q-2.6 Can a statistical oracle become theory?","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"L","status":"open","summary":"S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6).","track":"science","value":{"maths":2,"publications":2,"science":3}} +{"counsel":{"contrarian":"The ledger already holds every digest; check the option earns its keep.","soundness":"Lineage you can re-check without git archaeology."},"glyph":"๐Ÿ—„๏ธ","id":"superseded-manifests-option","kind":"tool","name":"Keep superseded manifests (option)","needs":["receipt-generator"],"refs":[{"issue":"metadatastician/standards#1705"},{"issue":"hyperpolymath/mathesis#122"}],"size":"S","status":"open","summary":"A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges.","track":"engineering","value":{"ecosystem":1,"engineering":1,"soundness":2}} {"glyph":"๐ŸŽค","id":"talk-atlas","kind":"paper","name":"Talk: an atlas of an estate","needs":["publish-atlas"],"owner_value":"high","size":"S","status":"open","summary":"A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt.","track":"publications","value":{"ecosystem":1,"publications":2,"teaching":2}} {"counsel":{"teacher":"Shows why a proof matters to someone who reads spreadsheets, not theorems."},"glyph":"๐Ÿ““","id":"teaching-cohort","kind":"paper","name":"Cohort economics, taught","needs":["app-proofs"],"owner_value":"high","size":"M","status":"open","summary":"A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only.","track":"publications","value":{"economics":1,"publications":2,"teaching":3}} {"evidence":[{"path":"docs/theory/admissions.jsonl"},{"path":"docs/theory/ledger.jsonl"}],"glyph":"๐Ÿ“š","id":"theory-shelf","kind":"data","name":"Theory shelf and ledger","needs":["claims-registry","thy1"],"size":"S","status":"done","summary":"The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far.","track":"maths","value":{"maths":2,"soundness":2}} {"evidence":[{"claim":"hyperpolymath/mathesis#THY-1","min_pwg":"PWG-2ii"}],"glyph":"๐Ÿงญ","id":"thy1","kind":"theorem","name":"THY-1: reachability is monotone","needs":["proof-gate"],"size":"M","status":"done","summary":"In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean.","track":"maths","value":{"engineering":2,"maths":2,"publications":2}} -{"counsel":{"cartographer":"The canon order is the ownerโ€™s ruling in standards, and resource-algebra E-1 may need re-proving; carry both.","maths":"Two careful readings disagree; that is a sign the two tokens are incomparable, which is outcome C."},"glyph":"โš–๏ธ","id":"token-order","kind":"decision","name":"Settle the order of status tokens","needs":["chain-question"],"refs":["docs/proposals/mathesis-research-programme.adoc:335","docs/atlas/generated/registry.adoc:39","metadatastician/standards 3-practice/PROOF-POLICY.adoc:348 (at 745fc74)"],"size":"S","status":"open","summary":"Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order.","track":"maths","value":{"ecosystem":2,"maths":2,"soundness":3}} +{"counsel":{"cartographer":"The canon order is the ownerโ€™s ruling in standards, and resource-algebra E-1 may need re-proving; carry both.","maths":"Two careful readings disagree; that is a sign the two tokens are incomparable, which is outcome C."},"glyph":"โš–๏ธ","id":"token-order","kind":"decision","name":"Settle the order of status tokens","needs":["chain-question"],"refs":[{"at":"R-1 The order of the tokens.","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"[hyperpolymath/resource-algebra#E-1]","path":"docs/atlas/generated/registry.adoc"},{"at":"== 5. Status vocabulary","commit":"745fc744158047a675eeb92464167c9961d66c4b","path":"3-practice/PROOF-POLICY.adoc","repo":"metadatastician/standards"}],"size":"S","status":"open","summary":"Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order.","track":"maths","value":{"ecosystem":2,"maths":2,"soundness":3}} {"evidence":[{"path":"docs/ultraplan/tree.jsonl"},{"path":"scripts/ultraplan/ultraplan.mjs"}],"glyph":"๐ŸŒณ","id":"ultraplan","kind":"view","name":"The ultraplan","needs":["atlas-views"],"size":"S","status":"done","summary":"This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence.","track":"engineering","value":{"engineering":1,"teaching":1}} -{"glyph":"๐Ÿ”ญ","id":"value-of-information","kind":"method","name":"Value of information","needs":["liquidity-shelf"],"refs":["applied-systems/decision-science/README.adoc"],"size":"L","status":"open","summary":"Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README).","track":"economics","value":{"economics":3,"maths":2,"science":2}} -{"glyph":"๐Ÿ“‹","id":"whats-owed","kind":"view","name":"What is owed","needs":["census-workflow","claims-registry"],"refs":["docs/proposals/mathesis-re-anchoring.adoc:1079"],"size":"M","status":"open","summary":"A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"soundness":2}} +{"glyph":"๐Ÿ”ญ","id":"value-of-information","kind":"method","name":"Value of information","needs":["liquidity-shelf"],"refs":[{"path":"applied-systems/decision-science/README.adoc"}],"size":"L","status":"open","summary":"Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README).","track":"economics","value":{"economics":3,"maths":2,"science":2}} +{"glyph":"๐Ÿ“‹","id":"whats-owed","kind":"view","name":"What is owed","needs":["census-workflow","claims-registry"],"refs":[{"at":"WO 5.4 Report what is owed","path":"docs/proposals/mathesis-re-anchoring.adoc"}],"size":"M","status":"open","summary":"A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has.","track":"ecosystem","value":{"ecosystem":3,"engineering":1,"soundness":2}} diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index c136c675..96c92f55 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -100,6 +100,17 @@ function oneLine(v) { if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => !hasControl(k) && oneLine(x)); return true; } +// A description-list marker ("::", ":::", "::::" or ";;", then a blank or the +// end) makes Asciidoctor read the line that holds it as a list term, wherever +// in the line it sits, so no prefix such as {empty} keeps it text. No text in +// the plan may hold one. +const LIST_MARKER = /(?::{2,4}|;;)(?:[ \t]|$)/; +function noListMarker(v) { + if (typeof v === 'string') return !LIST_MARKER.test(v); + if (Array.isArray(v)) return v.every(noListMarker); + if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => !LIST_MARKER.test(k) && noListMarker(x)); + return true; +} export function readSource(text, name) { const rows = parseJsonl(text, name); @@ -107,6 +118,7 @@ export function readSource(text, name) { rows.forEach((r, i) => { if (!wellFormed(r)) throw new Error(`${name}: line ${i + 1} holds a lone surrogate or a Unicode noncharacter, which I-JSON refuses`); if (!oneLine(r)) throw new Error(`${name}: line ${i + 1} holds a control character; each text in the plan is one line`); + if (!noListMarker(r)) throw new Error(`${name}: line ${i + 1} holds a description-list marker (:: or ;; before a blank or the end), which would make its line of the page a list term`); if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); write it as ${jcs(r)}`); }); return rows; @@ -148,53 +160,88 @@ export function registryGrade(registryText, id) { return null; } -// Whether an ADR's Status section opens with "Accepted", read as AsciiDoc reads -// it. It must never say yes where Asciidoctor finds no such section; where the -// two could differ, it says no (fails closed). -// - A heading inside a delimited block (a comment, a listing, an example) is -// not a section of the ADR. -// - A Status heading is a section heading, "==" or deeper: "= Status" is the -// document's title. -// - A heading starts a section only after a blank line, with no block attribute -// line or block title waiting above it, across blank lines and comments: -// "[discrete]" makes it a floating title. -// - The ADR must have exactly one Status section, and its first line of text, -// after any comments, must say "Accepted". +// Whether an ADR's Status section opens with "Accepted", as AsciiDoc reads it. +// It must never say yes where Asciidoctor finds no such section. So it does not +// try to mirror every way Asciidoctor reads a heading: it over-counts, and it +// accepts one plain shape only (it fails closed). +// - Every line that could be a heading titled Status counts, inside a block or +// not: "=" or "#" markers and a blank, then a title that holds the letters +// "status" in any case, or a reference that could spell them. An ADR with a +// count other than one is not read. +// - That one line is "==" to "======", one space and "Status"; it is outside any +// delimited block; and it follows a blank line, with nothing above it, across +// blank lines and comments, that attaches it to what came before: a block +// attribute line, a block title, a list continuation or a description-list term. +// - The first line after it, past blank lines and comments, is text that begins +// "Accepted": not indented, and holding no description-list marker. +// - No text line stands over an underline ("-", "=", "~", "^" or "+" repeated) +// of about its length: Asciidoctor reads such a pair as a section title. // - A preprocessor directive could change which lines count, so an ADR that // holds one is not read. // A delimiter is one of these characters four or more times, "--", or a table's "|===". +// It closes on the same line again. const DELIMITER = /^(?:([/\-.+*=_])\1{3,}|--|[|,:!]={3,})$/; +// A Markdown fence, which Asciidoctor reads too: three backticks open it, with +// any language after them but never a fourth backtick, and only a line of +// exactly three backticks closes it. "````" and "~~~" delimit nothing. +const FENCE = /^```(?!`)/; +const opener = l => { + if (DELIMITER.test(l)) return l; + return FENCE.test(l) ? '```' : null; +}; const PREPROCESSOR = /^(?:ifdef|ifndef|ifeval|endif|include)::/; +// "//" begins a line comment, but "///" begins text. +const COMMENT = /^\/\/(?!\/)/; // What each line is: inside a delimited block or one of its delimiters // ('block'), part of a comment, which AsciiDoc drops ('comment'), or text. const kindOf = (l, block) => { if (block) return block.startsWith('//') ? 'comment' : 'block'; - return l.startsWith('//') ? 'comment' : 'text'; + return COMMENT.test(l) ? 'comment' : 'text'; }; function lineKinds(lines) { let open = null; return lines.map(l => { - const block = open ?? (DELIMITER.test(l) ? l : null); + const block = open ?? opener(l); const closes = open !== null && l === open; open = closes ? null : block; return kindOf(l, block); }); } +// A heading in any form AsciiDoc or Markdown gives one, whose title could read "Status". +const HEADING = /^[=#]+[ \t]+(.*)$/; +const mayBeStatus = l => { + const m = HEADING.exec(l); + return m !== null && (/\{|&#?\w+;/.test(m[1]) || /status/i.test(m[1].replace(/[^\p{L}]/gu, ''))); +}; +// Asciidoctor reads a line over an underline within one character of its +// length as a two-line section title; two characters are allowed here. +const UNDERLINE = /^([-=~^+])\1+$/; +const width = s => [...s].length; +const overUnderline = (lines, kinds, i) => kinds[i] === 'text' && lines[i] !== '' && UNDERLINE.test(lines[i + 1] ?? '') + && Math.abs(width(lines[i + 1]) - width(lines[i])) <= 2; +// What, standing above a heading across blank lines and comments, attaches the +// heading to it: a block attribute line, a block title, a list continuation or +// a description-list term. +const ATTACHES = /^(?:\[.*\]|\.[^.\s].*|\+)$|(?::{2,4}|;;)(?:[ \t]|$)/; function startsSection(lines, kinds, i) { if (i > 0 && lines[i - 1] !== '') return false; let j = i - 1; while (j >= 0 && (lines[j] === '' || kinds[j] === 'comment')) j--; - return j < 0 || !/^(?:\[.*\]|\.[^.\s].*)$/.test(lines[j]); + return j < 0 || !ATTACHES.test(lines[j]); } export function adrAccepted(text) { const lines = text.split('\n').map(l => l.trimEnd()); if (lines.some(l => PREPROCESSOR.test(l))) return false; const kinds = lineKinds(lines); - const heads = lines.flatMap((l, i) => - kinds[i] === 'text' && /^==+ Status$/.test(l) && startsSection(lines, kinds, i) ? [i] : []); + if (lines.some((_, i) => overUnderline(lines, kinds, i))) return false; + const heads = lines.flatMap((l, i) => (mayBeStatus(l) ? [i] : [])); if (heads.length !== 1) return false; - const next = lines.find((l, i) => i > heads[0] && l !== '' && kinds[i] !== 'comment'); - return /^\**Accepted\b/.test(next?.trim() ?? ''); + const [h] = heads; + if (kinds[h] !== 'text' || !/^={2,6} Status$/.test(lines[h]) || !startsSection(lines, kinds, h)) return false; + // The heading is text, so the line after it is text too, unless it opens a + // block, and no delimiter that opens one begins "Accepted". + const n = lines.findIndex((l, i) => i > h && l !== '' && kinds[i] !== 'comment'); + return n > h && /^\**Accepted\b/.test(lines[n]) && !LIST_MARKER.test(lines[n]); } // One check for each kind of evidence; each returns an error or null. @@ -234,6 +281,49 @@ export function checkEvidence(ev, ctx) { } const evidenceError = (ev, ctx) => { try { return checkEvidence(ev, ctx); } catch (e) { return e.message; } }; +// โ”€โ”€ References โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// A ref points at one place, and no ref types a line number, which goes stale +// with the next edit. A ref into this repository is checked: its path exists, +// and its quote ("at") occurs in the file exactly once, so a ref whose passage +// was reworded, moved away or repeated is refused, never left pointing nowhere. +// A ref into another repository names a full commit, so its content cannot +// drift; it is not checked here. An issue ref names a GitHub issue or pull request. +const REF_FIELDS = ['path', 'at', 'repo', 'commit', 'issue']; +const isRepoPath = p => isStr(p, 300) && p.split('/').every(s => /^[-\w.]+$/.test(s) && s !== '.' && s !== '..'); +// The page shows a quote verbatim in a literal code span, which a backtick, a +// plus or a backslash could end early. +const isQuote = s => isStr(s, 160) && !/[`+\\]/.test(s); +const occurrences = (text, s) => text.split(s).length - 1; +const REF = { + issue: r => (Object.keys(r).length === 1 && typeof r.issue === 'string' && /^[\w.-]+\/[\w.-]+#[1-9]\d*$/.test(r.issue) + ? null : `ref issue ${JSON.stringify(r.issue)} is not OWNER/REPO#N, alone`), + pinned(r) { + if (typeof r.repo !== 'string' || !/^[\w.-]+\/[\w.-]+$/.test(r.repo)) return `ref repo ${JSON.stringify(r.repo)} is not OWNER/REPO`; + return typeof r.commit === 'string' && /^[0-9a-f]{40}$/.test(r.commit) ? null : `ref commit ${JSON.stringify(r.commit)} is not a full commit id`; + }, + here(r, ctx) { + if (r.at === undefined) return ctx.exists(r.path) ? null : `ref path ${r.path} is not in the repository`; + if (!ctx.isFile(r.path)) return `ref path ${r.path} is not a file in the repository`; + const k = occurrences(ctx.read(r.path), r.at); + return k === 1 ? null : `ref ${r.path} holds ${JSON.stringify(r.at)} ${k} times; a ref quotes a passage that occurs exactly once`; + }, +}; +const refKind = r => { + if (r.issue !== undefined) return 'issue'; + return r.repo !== undefined || r.commit !== undefined ? 'pinned' : 'here'; +}; + +// Check one ref; return an error or null. +export function checkRef(r, ctx) { + closed(r, REF_FIELDS, 'ref'); + const kind = refKind(r); + if (kind === 'issue') return REF.issue(r); + if (!isRepoPath(r.path)) return `ref path ${JSON.stringify(r.path)} is not a repository path`; + if (r.at !== undefined && !isQuote(r.at)) return `ref at ${JSON.stringify(r.at)} is not a short quote without a backtick, plus or backslash`; + return REF[kind](r, ctx); +} +const refError = (r, ctx) => { try { return checkRef(r, ctx); } catch (e) { return e.message; } }; + // โ”€โ”€ Validation: the council โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ const ADVISOR_FIELDS = ['id', 'name', 'glyph', 'asks', 'reads', 'private']; const ADVISOR_RULES = [ @@ -277,7 +367,6 @@ const NODE_RULES = [ [n => n.owner_value === undefined || n.owner_value === 'high', 'owner_value is "high" or absent'], [n => n.status !== 'blocked' || isStr(n.blocked_by), 'a blocked node says what blocks it (blocked_by)'], [n => n.status === 'blocked' || n.blocked_by === undefined, 'blocked_by belongs to a blocked node only'], - [n => list(n.refs).every(r => isStr(r, 300)), 'each ref is a short text'], ]; function checkValue(n, where, fail) { @@ -347,6 +436,14 @@ function checkStarted(n, byId, ctx, fail) { for (const t of list(n.needs)) if (byId.get(t)?.status !== 'done') fail(`${where}: ${n.status}, but its need ${t} is not done`); } +// Every ref of every node holds, whatever the node's status. +function checkRefs(n, ctx, fail) { + for (const r of list(n.refs)) { + const e = refError(r, ctx); + if (e) fail(`node ${n.id}: ${e}`); + } +} + // The needs form a DAG. function checkAcyclic(byId, fail) { const state = new Map(); @@ -399,7 +496,7 @@ export function validate({advisors, nodes, expeditions}, ctx) { const fail = m => errors.push(m); const advisorIds = checkAdvisors(advisors, fail); const byId = checkNodes(nodes, advisorIds, fail); - for (const n of byId.values()) { checkLinks(n, byId, fail); checkStarted(n, byId, ctx, fail); } + for (const n of byId.values()) { checkLinks(n, byId, fail); checkStarted(n, byId, ctx, fail); checkRefs(n, ctx, fail); } checkAcyclic(byId, fail); checkActiveLimit(byId, fail); checkExpeditions(expeditions, byId, fail); @@ -595,6 +692,16 @@ function evidenceText(ev) { if (ev.claim) return `${ev.claim} at ${ev.min_pwg ?? 'PWG-3'} or above`; return `ADR ${ev.adr} accepted`; } +// A quote is shown verbatim, as a literal code span. +function refText(r) { + if (r.issue) { + const [repo, number] = r.issue.split('#'); + return `https://github.com/${repo}/issues/${number}[${r.issue}]`; + } + const at = r.at === undefined ? '' : `, at \`+${r.at}+\``; + if (r.repo) return `https://github.com/${r.repo}/blob/${r.commit}/${r.path}[${r.repo}: ${r.path}] at \`${r.commit.slice(0, 12)}\`${at}`; + return `\`${r.path}\`${at}`; +} // Every mark the data holds is shown, a 0 as an open circle: a 0 is a judgement too. const marks = value => VALUE_KEYS.filter(k => Object.hasOwn(value, k)).map(k => `${k} ${'โ—'.repeat(value[k]) || 'โ—‹'}`).join(', '); @@ -610,7 +717,7 @@ function nodeLines(byId, advisors, d, n) { [n.status === 'blocked', () => `*Blocked by:* ${n.blocked_by}`], [list(n.evidence).length, () => `*Evidence:* ${n.evidence.map(evidenceText).join('; ')}`], [n.value && Object.keys(n.value).length, () => `*Value (judgement):* ${marks(n.value)}`], - [list(n.refs).length, () => `*See:* ${n.refs.join('; ')}`], + [list(n.refs).length, () => `*See:* ${n.refs.map(refText).join('; ')}`], ].filter(([has]) => has).map(([, text]) => text()); const counsel = Object.entries(n.counsel ?? {}).map(([id, text]) => { const adv = advisors.find(x => x.id === id); @@ -810,12 +917,12 @@ export function renderSvg(byId, d) { export function context(root = ROOT) { const decisions = path.join(root, 'docs/decisions'); const registry = 'docs/atlas/generated/registry.adoc'; - // The real path of a regular file inside the repository (symlinks resolved), or null. - // Every file the evidence checks read goes through it. - const inside = p => { + // The real path inside the repository (symlinks resolved) of a regular file, or + // of what `kind` accepts, or null. Every path the checks read goes through it. + const inside = (p, kind = s => s.isFile()) => { try { const base = realpathSync(root), real = realpathSync(path.join(root, p)); - return real.startsWith(base + path.sep) && statSync(real).isFile() ? real : null; + return real.startsWith(base + path.sep) && kind(statSync(real)) ? real : null; } catch { return null; } }; const read = p => { @@ -825,6 +932,8 @@ export function context(root = ROOT) { }; return { isFile: p => inside(p) !== null, + // A file or a directory: a ref may name either. + exists: p => inside(p, s => s.isFile() || s.isDirectory()) !== null, read, // No registry view means no claim is listed; one that leads outside the repository is refused. registry: existsSync(path.join(root, registry)) ? read(registry) : '', diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 9e301734..b8c891ae 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -247,6 +247,61 @@ test('closed schema, blocked reasons and canonical lines', () => { refuses({raw: {nodes: [ckey, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a control character/); }); +// Asciidoctor 2.0.26 reads a line that holds "::", ":::", "::::" or ";;" before a +// blank or the end as a description-list term, wherever the marker sits, and a +// prefix such as {empty} does not stop it. So no text in the plan may hold one. +test('a description-list marker in any text is refused', () => { + const withRoot = extra => [jcs({...BASE[0], ...extra}), ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'; + for (const s of ['The lock:: and more', 'The lock;; and more', 'The lock::', ':: at the start', 'a ::: b', 'a:::: b']) + refuses({raw: {nodes: withRoot({summary: s})}}, /line 1 holds a description-list marker/); + refuses({raw: {nodes: withRoot({counsel: {maths: 'Deep;; really'}})}}, /line 1 holds a description-list marker/); + refuses({raw: {nodes: withRoot({refs: [{at: 'Fixture::', path: 'README.adoc'}]})}}, /line 1 holds a description-list marker/); + const mkey = jcs({...BASE[0], value: {maths: 1}}).replace('"maths":', '"m:: aths":'); + refuses({raw: {nodes: [mkey, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a description-list marker/); + // "::" with no blank after it marks nothing: a macro name or a URL stays text. + for (const s of ['image::x.svg[]', 'a::b', 'See https://example.org/a::b']) + expect(() => generate(fixture({nodes: swap('cheap', {summary: s})}))).not.toThrow(); +}); + +test('a ref points at one place, and each ref in this repository is checked', () => { + const page = refs => generate(fixture({nodes: swap('paper', {refs})}))[VIEW]; + const refused = (refs, re) => refuses({nodes: swap('paper', {refs})}, re); + // A file or a directory, and a quote that occurs in its file exactly once. + const shown = page([{path: 'README.adoc'}, {path: 'docs/decisions'}, {at: '= Fixture', path: 'README.adoc'}, + {issue: 'metadatastician/standards#1705'}, + {at: '== 5. Status vocabulary', commit: 'a'.repeat(40), path: '3-practice/PROOF-POLICY.adoc', repo: 'metadatastician/standards'}]); + expect(shown).toContain('*See:* `README.adoc`; `docs/decisions`; `README.adoc`, at `+= Fixture+`; ' + + 'https://github.com/metadatastician/standards/issues/1705[metadatastician/standards#1705]; ' + + `https://github.com/metadatastician/standards/blob/${'a'.repeat(40)}/3-practice/PROOF-POLICY.adoc[metadatastician/standards: 3-practice/PROOF-POLICY.adoc] at \`aaaaaaaaaaaa\`, at \`+== 5. Status vocabulary+\``); + // A quote that is gone, or that occurs more than once, names no one place. + refused([{at: 'Gone', path: 'README.adoc'}], /node paper: ref README\.adoc holds "Gone" 0 times; a ref quotes a passage that occurs exactly once/); + refused([{at: 'at', path: 'docs/decisions/0004-claims-registry.adoc'}], /holds "at" [2-9] times/); + // Each part is checked: the path, what it names, the quote, the commit and the issue. + refused([{path: 'missing.adoc'}], /node paper: ref path missing\.adoc is not in the repository/); + refused([{at: 'x', path: 'docs/decisions'}], /ref path docs\/decisions is not a file in the repository/); + for (const p of ['../outside', '/etc/passwd', 'a/./b', 'a b', '']) refused([{path: p}], /is not a repository path/); + for (const q of ['with `code`', 'a + b', 'back\\slash', ' padded', 'x'.repeat(161)]) refused([{at: q, path: 'README.adoc'}], /is not a short quote/); + refused([{at: 'x', commit: '745fc74', path: 'a.adoc', repo: 'o/r'}], /ref commit "745fc74" is not a full commit id/); + refused([{commit: 'a'.repeat(40), path: 'a.adoc', repo: 'nobody'}], /ref repo "nobody" is not OWNER\/REPO/); + refused([{commit: 'a'.repeat(40), path: 'a.adoc'}], /ref repo undefined is not OWNER\/REPO/); + refused([{issue: 'standards#1705'}], /ref issue "standards#1705" is not OWNER\/REPO#N, alone/); + refused([{issue: 'o/r#1', path: 'README.adoc'}], /is not OWNER\/REPO#N, alone/); + refused([{line: 92, path: 'README.adoc'}], /node paper: ref: unknown field "line"/); + refused(['README.adoc:46'], /node paper: ref: must be an object/); +}); + +test('a ref cannot lead out of the repository', () => { + const outside = mkdtempSync(path.join(tmpdir(), 'ultraplan-out-')); + roots.push(outside); + writeFileSync(path.join(outside, 'secret.adoc'), 'only once\n'); + const root = fixture({nodes: swap('paper', {refs: [{at: 'only once', path: 'link.adoc'}]})}); + symlinkSync(path.join(outside, 'secret.adoc'), path.join(root, 'link.adoc')); + expect(() => generate(root)).toThrow(/ref path link\.adoc is not a file in the repository/); + const dirRoot = fixture({nodes: swap('paper', {refs: [{path: 'away'}]})}); + symlinkSync(outside, path.join(dirRoot, 'away')); + expect(() => generate(dirRoot)).toThrow(/ref path away is not in the repository/); +}); + test('a summary that looks like block syntax is text on the page', () => { const base = generate(fixture())[VIEW].split('\n'); const bare = (lines, s) => lines.filter(l => l === s).length; @@ -277,7 +332,6 @@ test('every rule has a witness', () => { N('paper', {summary: undefined}), N('paper', {needs: 'theorem'}), N('paper', {rivals: {}}), N('root', {evidence: 'README.adoc'}), N('paper', {refs: 'see'}), N('paper', {where: ['estate:o/r']}), N('paper', {owner_value: 'low'}), N('paper', {status: 'blocked'}), N('paper', {blocked_by: 'the owner'}), - N('paper', {refs: ['']}), T({what: ''}), T({why: undefined}), T({size: 'toString'}), T({date: '2026-02-30'}), T({status: 'lost'}), T({status: 'grafted', graft: 'ghost'}), T({graft: 'paper'}), T({status: 'archived'}), T({lesson: 'It taught.'}), ]; @@ -365,7 +419,9 @@ test('the evidence parsers read the real registry view and ADRs', () => { test('an ADR is accepted only by its own one Status section', () => { const adr = body => `= ADR\n\n${body}\n`; expect(adrAccepted(adr('=== Status\n\n*Accepted (ratified).*'))).toBe(true); - expect(adrAccepted(adr('=== Status\n\nAccepted\n\n----\n=== Status\nProposed\n----'))).toBe(true); + // A heading that could read Status counts even inside a block, so this ADR is + // not read. Asciidoctor finds one Status section here; the reader fails closed. + expect(adrAccepted(adr('=== Status\n\nAccepted\n\n----\n=== Status\nProposed\n----'))).toBe(false); expect(adrAccepted(adr('----\nan example\n----\n\n=== Status\n\nAccepted'))).toBe(true); expect(adrAccepted(adr('=== Status'))).toBe(false); expect(adrAccepted(adr('=== Status\n\nProposed.'))).toBe(false); @@ -398,6 +454,60 @@ test('an ADR is accepted only by its own one Status section', () => { for (const above of ['[[status]]\n', '.A title\n']) expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); }); +// Each case below was checked against Asciidoctor 2.0.26. Where the comment says +// the reader fails closed, Asciidoctor would accept and the reader refuses. +test('a Markdown fence hides what it holds, as Asciidoctor reads it', () => { + const adr = body => `= ADR\n\n${body}\n`; + // A heading inside a fence is not a section, blank lines around it or not. + expect(adrAccepted(adr('```\n\n=== Status\n\nAccepted\n```'))).toBe(false); + expect(adrAccepted(adr('```\n=== Status\nAccepted\n```'))).toBe(false); + // A fence opens with a language after it, and only three bare backticks close it. + expect(adrAccepted(adr('```ruby\ncode\n```\n\n=== Status\n\nAccepted'))).toBe(true); + expect(adrAccepted(adr('```ruby\ncode\n```ruby\n\n=== Status\n\nAccepted'))).toBe(false); + expect(adrAccepted(adr('``` ruby\ncode\n``` ruby\n\n=== Status\n\nAccepted'))).toBe(false); + // "````" and "~~~" delimit nothing, so a later "```" opens a fence that hides the rest. + expect(adrAccepted(adr('````\ncode\n````\n\n=== Status\n\nAccepted'))).toBe(true); + for (const lead of ['````', '~~~', '`` `']) expect(adrAccepted(adr(`${lead}\ncode\n\`\`\`\n\n=== Status\n\nAccepted`))).toBe(false); +}); + +test('a second heading that could read Status leaves the ADR unread', () => { + const adr = body => `= ADR\n\n=== Status\n\nAccepted\n\n${body}\n\nProposed.\n`; + expect(adrAccepted(adr('=== Context'))).toBe(true); + // Each is a second section titled Status to Asciidoctor: a later level-0 title, + // Markdown and symmetric markers, extra blanks, an underlined title, a title that + // a substitution spells, an attribute line above, and a heading straight after a block. + for (const second of ['= Status', '## Status', '### Status', '== Status ==', '== Status', '==\tStatus', + 'Status\n------', 'Status\n~~~~~~', ':s: Status\n\n== {s}', '== +Status+', '== pass:[Status]', + '== Stat{empty}us', '== ((Status))', '[#sid]\n== Status', '[appendix]\n== Status', '----\ncode\n----\n== Status']) + expect(adrAccepted(adr(second))).toBe(false); + // Seven markers make no heading, so the line cannot be the Status section. + expect(adrAccepted('= ADR\n\n======= Status\n\nAccepted\n')).toBe(false); + for (const level of ['==', '===', '======']) expect(adrAccepted(`= ADR\n\n${level} Status\n\nAccepted\n`)).toBe(true); +}); + +test('the Status section opens with a paragraph that says Accepted', () => { + const adr = body => `= ADR\n\n${body}\n`; + // To Asciidoctor none of these opens with such a paragraph: a literal (indented) + // line, a description-list term, an underlined title, and "///", which is text. + for (const opening of [' Accepted', 'Accepted:: yes', 'Accepted::', 'Accepted;; yes', 'Accepted\n--------', '/// x\nAccepted', '///\nAccepted']) + expect(adrAccepted(adr(`=== Status\n\n${opening}`))).toBe(false); + expect(adrAccepted(adr('=== Status\n\n// a comment\nAccepted'))).toBe(true); + // A heading inside a comment block is no section, though text follows the block. + expect(adrAccepted(adr('////\n\n=== Status\n////\nAccepted'))).toBe(false); + // A heading below a list continuation, or below a term with nothing after it, + // belongs to the list. Below a term with a description the reader fails closed. + for (const above of ['* item\n+\n\n', 'term::\n\n', 'term:: words\n\n']) + expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); + expect(adrAccepted(adr('* item\n\n=== Status\n\nAccepted'))).toBe(true); + // A short line over a delimiter of about its length is a two-line title, so no + // block opens there; the reader does not read such an ADR. + expect(adrAccepted(adr('foo\n----\n=== Status\nProposed\n----\n\n=== Status\n\nAccepted'))).toBe(false); + // A line far from the delimiter's length leaves it a delimiter, and inside a + // block no title is read at all, whatever the lengths. + expect(adrAccepted(adr('A much longer paragraph line\n----\ncode\n----\n\n=== Status\n\nAccepted'))).toBe(true); + expect(adrAccepted(adr('----\nfoo\n----\n\n=== Status\n\nAccepted'))).toBe(true); +}); + test('the committed views match the committed data', () => { const out = generate(ROOT); expect(readFileSync(path.join(ROOT, VIEW), 'utf8')).toBe(out[VIEW]); From f8fa1993c787cef4db41b00c028cf7f4aa9b8c91 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 10:23:32 +0000 Subject: [PATCH 26/41] ultraplan: read a heading's title without backtracking SonarCloud (S8786) flagged the heading pattern in 7eac1c2, /^[=#]+[ \t]+(.*)$/, as super-linear, and it is. Its ".*" can also take the blanks that "[ \t]+" takes, so a line whose end "$" cannot reach is tried quadratically often. A line holding U+2028 is one, since "." does not match it. On "=", 20,000 blanks and U+2028 the pattern took 276 ms, four times the time for half as many blanks, and then did not match: such a heading went uncounted. The pattern now matches only the markers and one blank, and the title is the rest of the line, taken whole. It counts every line the old pattern counted and more, so the over-count stays sound, and it runs in linear time. The new tests cover a title holding U+2028, before or after "Status", and a line of 50,000 blanks before U+2028, which must be read in under 200 ms. The old pattern fails both. A mutation sweep of 105 guards, the earlier 104 and one for the separator, killed every mutant. The reader still accepts none of the 124,800 corpus variants or the 43 probes that Asciidoctor 2.0.26 refuses, fails closed on the same 38,320 and 18, and agrees on every file in docs/decisions. All 30 tests pass. eslint-plugin-sonarjs reports nothing. just ultraplan-check and check-views pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- scripts/ultraplan/ultraplan.mjs | 10 +++++++--- tests/ultraplan/ultraplan.test.mjs | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 96c92f55..fd86e0e8 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -207,11 +207,15 @@ function lineKinds(lines) { return kindOf(l, block); }); } -// A heading in any form AsciiDoc or Markdown gives one, whose title could read "Status". -const HEADING = /^[=#]+[ \t]+(.*)$/; +// A heading in any form AsciiDoc or Markdown gives one: its markers and a blank, +// then a title that could read "Status". The title is the rest of the line, taken +// whole, so the pattern cannot backtrack and no character of the title escapes it. +const HEADING = /^[=#]+[ \t]/; const mayBeStatus = l => { const m = HEADING.exec(l); - return m !== null && (/\{|&#?\w+;/.test(m[1]) || /status/i.test(m[1].replace(/[^\p{L}]/gu, ''))); + if (m === null) return false; + const title = l.slice(m[0].length); + return /\{|&#?\w+;/.test(title) || /status/i.test(title.replace(/[^\p{L}]/gu, '')); }; // Asciidoctor reads a line over an underline within one character of its // length as a two-line section title; two characters are allowed here. diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index b8c891ae..370ae977 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -480,6 +480,12 @@ test('a second heading that could read Status leaves the ADR unread', () => { 'Status\n------', 'Status\n~~~~~~', ':s: Status\n\n== {s}', '== +Status+', '== pass:[Status]', '== Stat{empty}us', '== ((Status))', '[#sid]\n== Status', '[appendix]\n== Status', '----\ncode\n----\n== Status']) expect(adrAccepted(adr(second))).toBe(false); + // A title is read whole, past a line separator (which the earlier pattern's "." + // stopped at), and a long run of blanks before one costs no backtracking. + for (const title of ['Statusโ€จ', 'xโ€จStatus']) expect(adrAccepted(adr(`== ${title}`))).toBe(false); + const started = performance.now(); + expect(adrAccepted(adr(`=${' '.repeat(50000)}โ€จ`))).toBe(true); + expect(performance.now() - started).toBeLessThan(200); // Seven markers make no heading, so the line cannot be the Status section. expect(adrAccepted('= ADR\n\n======= Status\n\nAccepted\n')).toBe(false); for (const level of ['==', '===', '======']) expect(adrAccepted(`= ADR\n\n${level} Status\n\nAccepted\n`)).toBe(true); From 2538608f4002b6319428769bc90c9c50b39b8fde Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 10:38:52 +0000 Subject: [PATCH 27/41] ultraplan: every path read or written stays in the repository Codex found three faults on f8fa199. A probe on a copy of the repository reproduced each before the fix. - The three sources were read with a bare readFileSync. A committed expeditions.jsonl linked to /dev/null was accepted as an empty source, so ultraplan-check could approve views whose data is not committed. The sources are now read through the same containment check as evidence: a regular file whose real path is inside the repository. The views had the same hole. The check read them, and a build wrote them, through whatever stood at the path, so a view linked out of the repository could be approved or written over. Two exported functions, staleViews and writeViews, now hold the views to plain files inside the repository: never a link (to a file outside, to one inside, or to nothing yet), and never under a directory that leads outside. writeViews refuses before it writes anything. The command line uses both, so they are tested. - A quote was counted with split, which misses overlaps: "aaaa" occurs twice in "aaaaa", yet passed as exactly once. It is now counted at every offset. - An evidence path only had to avoid a leading "/" and "..", so a file named a`b.adoc passed and closed its code span early on the page ("*Evidence:* `a`b.adoc`"). Evidence and refs now share the registry's own path rule, isDocPath, now exported: letters, digits, "-", "_" and "." in each part, "/" between them, and no part "." or "..". Every evidence path in the tree already fits. "." is now refused as not a path, where before it failed as not a file. Tests cover each case, including a view linked to a file inside the repository, which must not be written over, and views with the right text in a linked-out directory, which still count as stale. A mutation sweep of the generator's 115 guards, 11 of them new, killed every mutant. Two mutants of isDocPath, run against both suites, were killed too. All 165 tests pass. The reader still accepts none of the 124,800 corpus variants that Asciidoctor refuses. eslint-plugin-sonarjs reports nothing new: the registry keeps the two complexity findings it has on main. just ultraplan-check, check-views, site-check and site-test pass, and the I-JSON gate finds 26 of 26 files canonical. A build rewrites the views byte for byte. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- scripts/registry/claims-registry.mjs | 2 +- scripts/ultraplan/ultraplan.mjs | 55 +++++++++++++---- tests/ultraplan/ultraplan.test.mjs | 89 +++++++++++++++++++++++++++- 3 files changed, 130 insertions(+), 16 deletions(-) diff --git a/scripts/registry/claims-registry.mjs b/scripts/registry/claims-registry.mjs index 9f0fe131..0c0b5d43 100644 --- a/scripts/registry/claims-registry.mjs +++ b/scripts/registry/claims-registry.mjs @@ -103,7 +103,7 @@ export const CLAIM_NAME = /^[-\w.]+$/; // A status document is named by a relative path in its repository. The view puts // it in a link's target, so it uses the same characters, with "/" between its // parts, and no part is "." or "..": "[", "]", "|", "#" and white space cannot occur. -const isDocPath = p => p.split('/').every(s => CLAIM_NAME.test(s) && s !== '.' && s !== '..'); +export const isDocPath = p => p.split('/').every(s => CLAIM_NAME.test(s) && s !== '.' && s !== '..'); export function isClaimId(id) { if (typeof id !== 'string') return false; const i = id.indexOf('#'); diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index fd86e0e8..68e5ecaf 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -27,11 +27,11 @@ // The "me" advisor is private (owner ruling 2026-11-24): its notes are kept // outside this public repository, and a node carries at most the neutral tag // `owner_value: "high"`. Counsel under the key `me` is refused. -import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync, realpathSync} from 'node:fs'; +import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync, lstatSync, realpathSync} from 'node:fs'; import path from 'node:path'; import {parseJsonl} from '../atlas/census-atlas.mjs'; import {jcs} from '../registry/theory-ledger.mjs'; -import {isClaimId} from '../registry/claims-registry.mjs'; +import {isClaimId, isDocPath} from '../registry/claims-registry.mjs'; export const ROOT = path.resolve(import.meta.dir, '../..'); export const DIR = 'docs/ultraplan'; @@ -248,11 +248,16 @@ export function adrAccepted(text) { return n > h && /^\**Accepted\b/.test(lines[n]) && !LIST_MARKER.test(lines[n]); } +// A path in this repository, by the registry's own rule: letters, digits, "-", "_" +// and "." in each part, "/" between parts, and no part "." or "..". Nothing in it +// can end a code span on the page, and it cannot climb out of the repository. +const isRepoPath = p => isStr(p, 300) && isDocPath(p); + // One check for each kind of evidence; each returns an error or null. const EVIDENCE = { path(ev, ctx) { const p = ev.path; - if (!isStr(p, 300) || p.startsWith('/') || p.split('/').includes('..')) return `evidence path ${JSON.stringify(p)} is not a repository path`; + if (!isRepoPath(p)) return `evidence path ${JSON.stringify(p)} is not a repository path`; return ctx.isFile(p) ? null : `evidence path ${p} is not a file in the repository`; }, claim(ev, ctx) { @@ -293,11 +298,15 @@ const evidenceError = (ev, ctx) => { try { return checkEvidence(ev, ctx); } catc // A ref into another repository names a full commit, so its content cannot // drift; it is not checked here. An issue ref names a GitHub issue or pull request. const REF_FIELDS = ['path', 'at', 'repo', 'commit', 'issue']; -const isRepoPath = p => isStr(p, 300) && p.split('/').every(s => /^[-\w.]+$/.test(s) && s !== '.' && s !== '..'); // The page shows a quote verbatim in a literal code span, which a backtick, a // plus or a backslash could end early. const isQuote = s => isStr(s, 160) && !/[`+\\]/.test(s); -const occurrences = (text, s) => text.split(s).length - 1; +// How often s occurs in text, overlaps counted: "aaaa" occurs twice in "aaaaa". +const occurrences = (text, s) => { + let k = 0; + for (let i = text.indexOf(s); i !== -1; i = text.indexOf(s, i + 1)) k++; + return k; +}; const REF = { issue: r => (Object.keys(r).length === 1 && typeof r.issue === 'string' && /^[\w.-]+\/[\w.-]+#[1-9]\d*$/.test(r.issue) ? null : `ref issue ${JSON.stringify(r.issue)} is not OWNER/REPO#N, alone`), @@ -934,10 +943,16 @@ export function context(root = ROOT) { if (!real) throw new Error(`${p} is not a file in the repository`); return readFileSync(real, 'utf8'); }; + // What stands at a path itself, a link not followed, or null when nothing does. + const entry = p => { try { return lstatSync(path.join(root, p)); } catch { return null; } }; return { isFile: p => inside(p) !== null, // A file or a directory: a ref may name either. exists: p => inside(p, s => s.isFile() || s.isDirectory()) !== null, + isDir: p => inside(p, s => s.isDirectory()) !== null, + // A regular file inside the repository that is not itself a link. + isPlainFile: p => entry(p)?.isFile() === true && inside(p) !== null, + isAbsent: p => entry(p) === null, read, // No registry view means no claim is listed; one that leads outside the repository is refused. registry: existsSync(path.join(root, registry)) ? read(registry) : '', @@ -950,25 +965,41 @@ export function context(root = ROOT) { } export function generate(root = ROOT) { - const read = f => readSource(readFileSync(path.join(root, DIR, f), 'utf8'), `${DIR}/${f}`); + const ctx = context(root); + // The sources are read as evidence is: regular files inside the repository. + const read = f => readSource(ctx.read(`${DIR}/${f}`), `${DIR}/${f}`); const data = {advisors: read('advisors.jsonl'), nodes: read('tree.jsonl'), expeditions: read('expeditions.jsonl')}; - const byId = validate(data, context(root)); + const byId = validate(data, ctx); const d = derive(byId, data.advisors); return {[VIEW]: renderAdoc(byId, data.advisors, data.expeditions, d), [SVG]: renderSvg(byId, d), derived: d, byId}; } +// The views are plain files inside the repository, never links: a check would +// read through a link, and a build would write through one, out of the repository. +const VIEWS = [VIEW, SVG]; +export function staleViews(out, root = ROOT) { + const ctx = context(root); + return VIEWS.filter(f => !ctx.isPlainFile(f) || ctx.read(f) !== out[f]); +} +export function writeViews(out, root = ROOT) { + const ctx = context(root); + if (!ctx.isDir(DIR)) throw new Error(`${DIR} is not a directory in the repository`); + mkdirSync(path.join(root, DIR, 'generated'), {recursive: true}); + const unsafe = VIEWS.filter(f => !ctx.isDir(path.dirname(f)) || !(ctx.isAbsent(f) || ctx.isPlainFile(f))); + if (unsafe.length) throw new Error(`not written: ${unsafe.join(', ')}; a view is a plain file inside the repository, not a link`); + for (const f of VIEWS) writeFileSync(path.join(root, f), out[f]); +} + if (import.meta.main) { const cmd = process.argv[2]; if (!['build', 'check'].includes(cmd)) { console.error('usage: ultraplan.mjs build|check'); process.exit(2); } let out; try { out = generate(); } catch (e) { console.error(`ultraplan: FAIL\n${e.message}`); process.exit(1); } - const files = [VIEW, SVG]; if (cmd === 'build') { - mkdirSync(path.join(ROOT, DIR, 'generated'), {recursive: true}); - for (const f of files) writeFileSync(path.join(ROOT, f), out[f]); - console.log(`WROTE ${files.join(' and ')} (${out.byId.size} nodes, ${out.derived.frontier.length} on the frontier)`); + try { writeViews(out); } catch (e) { console.error(`ultraplan: FAIL\n${e.message}`); process.exit(1); } + console.log(`WROTE ${VIEWS.join(' and ')} (${out.byId.size} nodes, ${out.derived.frontier.length} on the frontier)`); } else { - const stale = files.filter(f => !existsSync(path.join(ROOT, f)) || readFileSync(path.join(ROOT, f), 'utf8') !== out[f]); + const stale = staleViews(out); if (stale.length) { console.error(`ultraplan: FAIL\nstale: ${stale.join(', ')}; run: bun scripts/ultraplan/ultraplan.mjs build`); process.exit(1); } console.log(`PASS: the ultraplan views match the data (${out.byId.size} nodes, ${out.derived.frontier.length} on the frontier)`); } diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 370ae977..c7eff414 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -3,10 +3,10 @@ // // The ultraplan generator: what it derives, and each thing it refuses. import {test, expect, afterAll} from 'bun:test'; -import {mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync, symlinkSync} from 'node:fs'; +import {mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync, symlinkSync, existsSync, readdirSync} from 'node:fs'; import {tmpdir} from 'node:os'; import path from 'node:path'; -import {generate, validate, derive, readSource, registryGrade, adrAccepted, context, ACTIVE_LIMIT, ROOT, VIEW, SVG, RULES} +import {generate, validate, derive, readSource, registryGrade, adrAccepted, context, staleViews, writeViews, ACTIVE_LIMIT, ROOT, VIEW, SVG, RULES} from '../../scripts/ultraplan/ultraplan.mjs'; import {jcs} from '../../scripts/registry/theory-ledger.mjs'; @@ -104,7 +104,8 @@ test('done needs evidence that holds', () => { refuses({nodes: swap('root', {evidence: []})}, /node root: done needs evidence/); refuses({nodes: swap('root', {evidence: [{path: 'NOPE.adoc'}]})}, /evidence path NOPE.adoc is not a file in the repository/); refuses({nodes: swap('root', {evidence: [{path: '../etc/passwd'}]})}, /is not a repository path/); - refuses({nodes: swap('root', {evidence: [{path: '.'}]})}, /evidence path \. is not a file in the repository/); + refuses({nodes: swap('root', {evidence: [{path: '.'}]})}, /evidence path "." is not a repository path/); + refuses({nodes: swap('root', {evidence: [{path: 'docs'}]})}, /evidence path docs is not a file in the repository/); refuses({nodes: swap('root', {evidence: [{path: 'docs/decisions'}]})}, /evidence path docs\/decisions is not a file/); // A committed symlink to a file outside the repository is not evidence in it. const outside = mkdtempSync(path.join(tmpdir(), 'ultraplan-outside-')); @@ -290,6 +291,88 @@ test('a ref points at one place, and each ref in this repository is checked', () refused(['README.adoc:46'], /node paper: ref: must be an object/); }); +test('a quote counts every place it occurs, overlaps included', () => { + const root = fixture({nodes: swap('paper', {refs: [{at: 'aaaa', path: 'notes.adoc'}]})}); + writeFileSync(path.join(root, 'notes.adoc'), 'aaaaa\n'); + expect(() => generate(root)).toThrow(/ref notes\.adoc holds "aaaa" 2 times/); + writeFileSync(path.join(root, 'notes.adoc'), 'aaaa b\n'); + expect(() => generate(root)).not.toThrow(); +}); + +test('an evidence path follows the repository path rule, so it renders as written', () => { + for (const p of ['a`b.adoc', 'a b.adoc', 'docs/../README.adoc', './README.adoc', '/etc/passwd']) { + const root = fixture({nodes: swap('root', {evidence: [{path: p}]})}); + if (!p.startsWith('/') && !p.includes('..')) writeFileSync(path.join(root, p), 'x\n'); + expect(() => generate(root)).toThrow(/node root: evidence path .* is not a repository path/); + } +}); + +test('the sources are read only as regular files inside the repository', () => { + const outside = mkdtempSync(path.join(tmpdir(), 'ultraplan-out-')); + roots.push(outside); + writeFileSync(path.join(outside, 'tree.jsonl'), BASE.map(n => jcs(n) + '\n').join('')); + for (const [file, target] of [['expeditions.jsonl', '/dev/null'], ['tree.jsonl', path.join(outside, 'tree.jsonl')]]) { + const root = fixture(); + rmSync(path.join(root, 'docs/ultraplan', file)); + symlinkSync(target, path.join(root, 'docs/ultraplan', file)); + expect(() => generate(root)).toThrow(new RegExp(`docs/ultraplan/${file.replace('.', '\\.')} is not a file in the repository`)); + } +}); + +test('the views are plain files: a check never reads, nor a build writes, through a link', () => { + const root = fixture(); + const out = generate(root); + expect(staleViews(out, root)).toEqual([VIEW, SVG]); + writeViews(out, root); + expect(staleViews(out, root)).toEqual([]); + // A view linked to a file outside, even one holding the right text, is stale, + // and a build refuses to write through the link. + const outside = mkdtempSync(path.join(tmpdir(), 'ultraplan-out-')); + roots.push(outside); + writeFileSync(path.join(outside, 'page.adoc'), out[VIEW]); + rmSync(path.join(root, VIEW)); + symlinkSync(path.join(outside, 'page.adoc'), path.join(root, VIEW)); + expect(staleViews(out, root)).toEqual([VIEW]); + writeFileSync(path.join(outside, 'page.adoc'), 'untouched\n'); + expect(() => writeViews(out, root)).toThrow(/not written: docs\/ultraplan\/generated\/ultraplan\.adoc; a view is a plain file/); + expect(readFileSync(path.join(outside, 'page.adoc'), 'utf8')).toBe('untouched\n'); + // A link that leads nowhere yet is refused too: writing would create its target. + rmSync(path.join(root, VIEW)); + symlinkSync(path.join(outside, 'new.adoc'), path.join(root, VIEW)); + expect(() => writeViews(out, root)).toThrow(/not written/); + expect(existsSync(path.join(outside, 'new.adoc'))).toBe(false); + // A link to a file inside the repository is refused too, and that file is + // neither read as the view nor written over. + rmSync(path.join(root, VIEW)); + writeFileSync(path.join(root, 'copy.adoc'), out[VIEW]); + symlinkSync(path.join(root, 'copy.adoc'), path.join(root, VIEW)); + expect(staleViews(out, root)).toEqual([VIEW]); + expect(() => writeViews(out, root)).toThrow(/not written/); + expect(readFileSync(path.join(root, 'copy.adoc'), 'utf8')).toBe(out[VIEW]); + // So is a generated directory that is a link out of the repository. + const dirRoot = fixture(); + const away = mkdtempSync(path.join(tmpdir(), 'ultraplan-out-')); + roots.push(away); + symlinkSync(away, path.join(dirRoot, 'docs/ultraplan/generated')); + expect(() => writeViews(generate(dirRoot), dirRoot)).toThrow(/not written: docs\/ultraplan\/generated\/ultraplan\.adoc, docs\/ultraplan\/generated\/tree\.svg/); + expect(readdirSync(away)).toEqual([]); + // Views placed there, though plain files with the right text, are outside the + // repository, so the check counts them stale. + const dirOut = generate(dirRoot); + writeFileSync(path.join(away, 'ultraplan.adoc'), dirOut[VIEW]); + writeFileSync(path.join(away, 'tree.svg'), dirOut[SVG]); + expect(staleViews(dirOut, dirRoot)).toEqual([VIEW, SVG]); + // And a plan directory that leads out of the repository gets nothing made in it. + const planRoot = fixture(); + const planOut = generate(planRoot); + const elsewhere = mkdtempSync(path.join(tmpdir(), 'ultraplan-out-')); + roots.push(elsewhere); + rmSync(path.join(planRoot, 'docs/ultraplan'), {recursive: true}); + symlinkSync(elsewhere, path.join(planRoot, 'docs/ultraplan')); + expect(() => writeViews(planOut, planRoot)).toThrow(/docs\/ultraplan is not a directory in the repository/); + expect(readdirSync(elsewhere)).toEqual([]); +}); + test('a ref cannot lead out of the repository', () => { const outside = mkdtempSync(path.join(tmpdir(), 'ultraplan-out-')); roots.push(outside); From 8d1fbf3bf673cffbdb97676d0b49c6b1e9101f95 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 10:52:23 +0000 Subject: [PATCH 28/41] ultraplan: GELS is the Git Estate Logistics System, not the display The owner made clear on 2026-11-25 that two systems had been mixed up: - GELS is the Git Estate Logistics System, in metadatastician/gels. - MPSCI is the Master Production and Scheduling Command Interface, also in metadatastician. The owner's first request asked for "a sub panel of the gels thing", and the ultraplan took GELS for "the estate display". On that reading, the maths panel, the owner's private panel and the reader of the feed all sat in GELS. That reading was the mix-up. Now: - The README's panel section states the clarification. It keeps what was settled on 2026-11-24 (a read-only feed, one panel type, open decisions to the decision desk, the reader pinning by commit) without naming a system, and says that which system shows the panels and reads the feed is open for the owner. - The panel node is now maths-panel, "Maths panel for the estate". It is blocked on the owner's choice of host, then on the feed and panel contract, and names no repository, since that is what is open. - The me advisor's line on the page reads "a private panel of their own", not "a private GELS panel". - The ROADMAP keeps the 2026-11-24 rulings, notes they were recorded as GELS's, and records the clarification. The gels feed-panel contract thread, the estate coordinator and the decision desk were told the same day. No feed was ever written, so nothing else depended on the old reading. All 34 ultraplan tests pass. Asciidoctor renders the README, the ROADMAP and the page at WARN. just ultraplan-check, check-views and site-check pass. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/status/ROADMAP.adoc | 30 +++++++++++------ docs/ultraplan/README.adoc | 43 ++++++++++++++++--------- docs/ultraplan/generated/tree.svg | 6 ++-- docs/ultraplan/generated/ultraplan.adoc | 19 ++++++----- docs/ultraplan/tree.jsonl | 2 +- scripts/ultraplan/ultraplan.mjs | 4 +-- tests/ultraplan/ultraplan.test.mjs | 4 +-- 7 files changed, 66 insertions(+), 42 deletions(-) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index d36011f1..be0f0c10 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -453,16 +453,28 @@ scheduled census, a view of what each repository owes economist, publisher, me) and four more (soundness auditor, estate cartographer, teacher, contrarian). ** The me advisor is private. Its notes stay outside this repository and every - feed, in a private GELS panel the owner owns, and a node carries at most the + feed, in a private panel the owner owns, and a node carries at most the tag `owner_value`. It names no public pick: the page lists the tagged frontier nodes unranked, and the owner chooses in that panel. ** Off-tree trips are return tickets: each is grafted onto the tree or archived with what it taught. -** The GELS maths panel waits on the GELS feed/panel contract, which the GELS - thread is drafting. The estate coordinator has answered: a read-only feed, - one panel type, and open decisions sent to the owner's decision desk. -** GELS pins by commit (owner ruling 2026-11-24). Mathesis commits the feed as - a generated view, which `just check` refuses when stale. GELS asks the - GitHub API for the head commit of main, then reads the feed at that commit, - so each read names its commit. The fetch logic and its rate limits belong to - GELS. Mathesis needs no new permission and holds no inbound secret. +** The maths panel waits on a feed and panel contract. The estate coordinator + has answered: a read-only feed, one panel type, and open decisions sent to + the owner's decision desk. +** The feed's reader pins by commit (owner ruling 2026-11-24). Mathesis + commits the feed as a generated view, which `just check` refuses when + stale. The reader asks the GitHub API for the head commit of main, then + reads the feed at that commit, so each read names its commit. The fetch + logic and its rate limits belong to the reader. Mathesis needs no new + permission and holds no inbound secret. +** These rulings were recorded as GELS's. See the clarification of 2026-11-25 + below. +* Owner clarification (2026-11-25): two systems had been mixed up. +** GELS is the Git Estate Logistics System, in metadatastician/gels. +** MPSCI is the Master Production and Scheduling Command Interface, also in + metadatastician. +** Earlier text here and in the ultraplan called GELS "the estate display". + Which system shows the maths panel and the owner's private panel, and which + reads the feed, is open for the owner. The panel node is now `maths-panel`. +** The gels feed-panel contract thread, the estate coordinator and the + decision desk were told the same day. diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index a3426138..92bf9dc1 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -113,10 +113,11 @@ nothing. unlocks the most. That keeps the road not taken in view. * The *me* advisor looks out for what could help the owner's own life. Its notes are kept privately, outside this public repository and out of every feed: in -a private panel of GELS that the owner owns (owner ruling 2026-11-24). A node carries at most the +a private panel that the owner owns (owner ruling 2026-11-24; which system hosts +it is open, see <>). A node carries at most the neutral tag `"owner_value":"high"`, and the generator refuses any counsel under the key `me`. The me advisor names no public pick (owner ruling 2026-11-24): the -owner chooses in the private GELS panel, and the page lists, in id order and +owner chooses in that private panel, and the page lists, in id order and unranked, the frontier nodes the owner tagged. == Wandering: return tickets @@ -164,25 +165,37 @@ cannot drift. It is not checked here. ** `+{"issue":"OWNER/REPO#N"}+`: a GitHub issue or pull request. . Run `just ultraplan`, then `just check`. -== GELS +[[estate-panel]] +== The estate panel -The owner asked for a maths panel in GELS, the estate display. The estate -coordinator answered on 2026-11-24: +The owner asked for a maths panel, "a sub panel of the gels thing". On +2026-11-25 the owner made clear that two systems had been mixed up in that +request. Both live in metadatastician: -* Mathesis publishes a read-only I-JSON/JCS feed, and GELS renders it as one -panel type beside the work-queue lanes and the Plan tab. +* *GELS* is the Git Estate Logistics System, in metadatastician/gels. +* *MPSCI* is the Master Production and Scheduling Command Interface. + +Earlier text here called GELS "the estate display"; that was the mix-up. Which +system shows the maths panel and the owner's private panel, and which reads the +feed, is open for the owner to settle. + +What was settled on 2026-11-24 still stands, whichever system it lands in: + +* Mathesis publishes a read-only I-JSON/JCS feed, which the estate shows as one +panel type. The estate coordinator gave this answer while the panel was taken +to be in GELS. * The feed carries the tree's nodes, the advisors' picks (never the me advisor's), the grade census with its denominator, and the claim pins. * Open decisions go to the owner's decision desk, not this panel. - -The owner ruled on 2026-11-24 that GELS pins by commit. Mathesis commits the -feed as a generated view, which `just check` refuses when stale. GELS asks the +* The reader pins by commit (owner ruling). Mathesis commits the feed as a +generated view, which `just check` refuses when stale. The reader asks the GitHub API for the head commit of main and reads the feed at that commit, so each read names its commit. No secret comes into this repository, and nothing here needs a new permission. -The GELS thread is drafting the feed and panel contract -(`docs/proposals/feed-panel-contract.adoc` in metadatastician/gels). Until it -exists, nothing here writes a feed: a feed with no agreed reader would be -unwired. The panel is a node in the tree (`gels-maths-panel`), blocked on that -contract. +A draft of the feed and panel contract was begun in metadatastician/gels +(`docs/proposals/feed-panel-contract.adoc`). Its thread, the estate coordinator +and the decision desk have been told of the clarification. Until the owner +settles the host and the contract exists, nothing here writes a feed: a feed +with no agreed reader would be unwired. The panel is a node in the tree +(`maths-panel`), blocked on both. diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index d963d5dd..1bcb5445 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -275,11 +275,11 @@ ๐ŸŒฑ -Maths panel in GELS: The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel. +Maths panel for the estate: The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel. ๐ŸชŸ -Maths panel in GELS -๐Ÿ—บ ecosystem ยท M ยท ๐ŸŒ +Maths panel for the eโ€ฆ +๐Ÿ—บ ecosystem ยท M โ›” diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 3f7b8341..b2885269 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -108,7 +108,7 @@ _Pick:_ xref:file-transport-bugs[๐Ÿ› File the transport reproducers]. _Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. -_No public pick:_ the owner chooses in a private GELS panel. Tagged on the frontier, in id order: xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. +_No public pick:_ the owner chooses in a private panel of their own. Tagged on the frontier, in id order: xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. == Forks and confluences @@ -120,7 +120,7 @@ same place; the contrarian keeps the road not taken in view. * xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] -> xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] * xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] * xref:centre-computations[๐ŸŽฏ Centre computations] -> xref:concept-commons[๐Ÿ›๏ธ Concept commons], xref:corpus[๐Ÿงช Propose and dispose corpus] -* xref:claims-registry[๐Ÿ“’ Claims registry] -> xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] +* xref:claims-registry[๐Ÿ“’ Claims registry] -> xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] * xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] -> xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] * xref:receipt-generator[๐Ÿญ Shared receipt generator] -> xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] * xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] @@ -232,7 +232,7 @@ same place; the contrarian keeps the road not taken in view. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done *Needs:* xref:census[๐Ÿงพ Census of the estate] + -*Enables:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] + +*Enables:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] + *Evidence:* ADR 0004 accepted; `docs/atlas/generated/registry.adoc` + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— @@ -337,7 +337,7 @@ same place; the contrarian keeps the road not taken in view. *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done *Needs:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views] + -*Enables:* xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS] + +*Enables:* xref:maths-panel[๐ŸชŸ Maths panel for the estate] + *Evidence:* `docs/ultraplan/tree.jsonl`; `scripts/ultraplan/ultraplan.mjs` + *Value (judgement):* engineering โ—, teaching โ— @@ -547,15 +547,15 @@ same place; the contrarian keeps the road not taken in view. * ๐Ÿ—บ๏ธ _Estate cartographer:_ The first real convergence between repositories; everything cross-repo waits on it. * โˆ‘ _Mathematician:_ Equivalence as identity, made checkable. -[[gels-maths-panel]] -==== โ›” ๐ŸชŸ Maths panel in GELS +[[maths-panel]] +==== โ›” ๐ŸชŸ Maths panel for the estate -{empty}The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel. +{empty}The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel. -*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked ยท *Beyond this repository:* estate:metadatastician/gels +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:ultraplan[๐ŸŒณ The ultraplan] + -*Blocked by:* the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then commits a read-only I-JSON/JCS feed, and GELS reads it pinned by commit (owner ruling 2026-11-24) and renders it + +*Blocked by:* the ownerโ€™s choice of host (owner clarification 2026-11-25): GELS, the Git Estate Logistics System, and MPSCI, the Master Production and Scheduling Command Interface, are separate systems in metadatastician, and which of them shows the panel and reads the feed is open; then their feed and panel contract + *Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— === โ™พ๏ธ Era 4: Cantor @@ -835,7 +835,6 @@ carried to that repository, not done here. * estate:hyperpolymath/januskey: xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] (open) * estate:hyperpolymath/resource-algebra: xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] (open) * estate:hyperpolymath/secret-types: xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign] (open) -* estate:metadatastician/gels: xref:gels-maths-panel[๐ŸชŸ Maths panel in GELS] (blocked) * estate:metadatastician/standards: xref:ci-recorder[๐Ÿค– CI records its own runs] (open) * estate:metadatastician/standards: xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws] (open) * upstream:Deducteam/agda2dedukti: xref:file-transport-bugs[๐Ÿ› File the transport reproducers] (open) diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index 6990a764..9e74c229 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -20,7 +20,7 @@ {"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":[{"at":"Q-H.3 What does a recheck leg cost?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"A measured cost for a recheck leg, and with it a","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} {"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":[{"at":"Next action: the owner files both reports","path":"docs/status/ROADMAP.adoc"},{"at":"File the THY-1 reproducer with the translator's authors","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} {"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":[{"at":"Write one synthetic 13-week forecast as records","path":"docs/proposals/mathesis-research-programme.adoc"},{"path":"applied-systems/finance/liquidity/README.adoc"}],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} -{"blocked_by":"the GELS feed and panel contract (docs/proposals/feed-panel-contract.adoc in metadatastician/gels), which the GELS thread is drafting (estate coordinator, 2026-11-24); Mathesis then commits a read-only I-JSON/JCS feed, and GELS reads it pinned by commit (owner ruling 2026-11-24) and renders it","glyph":"๐ŸชŸ","id":"gels-maths-panel","kind":"view","name":"Maths panel in GELS","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in GELS, beside the work-queue lanes and the Plan tab: frontier, grade census with its denominator, and claim pins, from a Mathesis feed whose fields the feed owns. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1},"where":"estate:metadatastician/gels"} +{"blocked_by":"the ownerโ€™s choice of host (owner clarification 2026-11-25): GELS, the Git Estate Logistics System, and MPSCI, the Master Production and Scheduling Command Interface, are separate systems in metadatastician, and which of them shows the panel and reads the feed is open; then their feed and panel contract","glyph":"๐ŸชŸ","id":"maths-panel","kind":"view","name":"Maths panel for the estate","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1}} {"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":[{"at":"Generate the Idris2 statement of the token laws from the source of","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} {"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":[{"at":"Q-3.1 Can the composite status be computed?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"as the first vertical slice (ruling R-4)","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} {"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 68e5ecaf..4c275cab 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -531,7 +531,7 @@ function pickFor(a, frontier, total, leverage) { const byKey = k => (x, y) => (y.value?.[k] ?? 0) - (x.value?.[k] ?? 0) || council(x, y); if (a.id === 'contrarian') return first(frontier, (x, y) => total(x) - total(y) || leverage(y.id) - leverage(x.id) || cmp(x.id, y.id)); // The me advisor names no public pick (owner ruling 2026-11-24): the owner chooses in a - // private GELS panel, and the page lists the tagged frontier unranked (ownerTagged). + // private panel the owner owns, and the page lists the tagged frontier unranked (ownerTagged). if (a.private) return null; if (a.reads) return first(frontier.filter(n => (n.value?.[a.reads] ?? 0) > 0), byKey(a.reads)); return null; @@ -666,7 +666,7 @@ function pickLine(byId, a, p) { // owner tagged, unranked. function privateLine(byId, d) { const tagged = d.ownerTagged.length ? `Tagged on the frontier, in id order: ${xrefs(byId, d.ownerTagged.map(n => n.id))}.` : 'Nothing tagged is on the frontier.'; - return `_No public pick:_ the owner chooses in a private GELS panel. ${tagged}`; + return `_No public pick:_ the owner chooses in a private panel of their own. ${tagged}`; } function councilLines(byId, advisors, d) { return [ diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index c7eff414..80605adc 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -66,7 +66,7 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(d.ownerTagged.map(n => n.id)).toEqual(['theorem']); // tagged owner_value, no notes expect(out[VIEW]).toContain('== Research now: the frontier'); expect(out[VIEW]).toContain('_Pick:_ xref:theorem[๐Ÿ”ท theorem]. The deep one.'); - expect(out[VIEW]).toContain('_No public pick:_ the owner chooses in a private GELS panel. Tagged on the frontier, in id order: xref:theorem[๐Ÿ”ท theorem].'); + expect(out[VIEW]).toContain('_No public pick:_ the owner chooses in a private panel of their own. Tagged on the frontier, in id order: xref:theorem[๐Ÿ”ท theorem].'); expect(out[SVG].startsWith(''); // Three eras are narrower than the legend; the canvas still holds the legend. @@ -442,7 +442,7 @@ test('the me advisor names no public pick, and lists the owner\'s tags unranked' expect(out.derived.ownerTagged.map(n => n.id)).toEqual(['cheap', 'theorem']); expect(out[VIEW]).toContain('Tagged on the frontier, in id order: xref:cheap[๐Ÿ”ท cheap], xref:theorem[๐Ÿ”ท theorem].'); const none = generate(fixture({nodes: swap('theorem', {owner_value: undefined})}))[VIEW]; - expect(none).toContain('_No public pick:_ the owner chooses in a private GELS panel. Nothing tagged is on the frontier.'); + expect(none).toContain('_No public pick:_ the owner chooses in a private panel of their own. Nothing tagged is on the frontier.'); }); test('when every active slot is taken, the frontier is ready but cannot start', () => { From 8f1b761df98295f26ddb2fc1b3fa88c9da6b78eb Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 11:00:16 +0000 Subject: [PATCH 29/41] ultraplan: every text is plain, and the page shows it as written The owner ruled on 2026-11-25, through the selector, that plan texts are plain text everywhere: in the data, on the page and in any feed. Until now each text was AsciiDoc inline markup. Each markup hole found (block syntax at a line's start, description-list markers, attribute references) needed its own guard: the {empty} prefix, the list-marker refusal, and a literal span with a narrowed quote charset. The ruling removes the cause. AsciiDoc builds all its markup from ASCII punctuation. One escaper, text(), now writes each such mark in a data text as a numeric character reference, which Asciidoctor shows as the mark itself and never reads as markup. Every data text on the page goes through it: names, glyphs, summaries, counsel, reasons, asks, ticket texts, places, evidence and ref paths, claim ids and quoted passages. That covers headings, table cells, link texts and list items alike. So: - the {empty} prefix, the list-marker refusal and the old link-text escape are gone, since text() covers each of them; - a quoted passage may hold any characters of one line; - the one text that used markup, a code span in the atlas-views summary, is now plain words. Asciidoctor 2.0.26 was checked on the real page and on 300 fuzzed pages. Their texts mix punctuation, block and list syntax, attribute and index references, passthroughs, character references and Unicode, including U+2028. Each of the 3,503 texts appears verbatim in the rendered HTML, and each fuzzed page has the same tag structure as a twin whose texts are plain letters. With the escaper disabled, the same check reports 2,964 failures. Even the real page fails then, because Asciidoctor turns the straight apostrophe in "run's" into a curly one. So the old page did not show every text as written either. The tests check the page against an independent statement of the rule: each of the 32 ASCII punctuation marks becomes a character reference. A mutation sweep of the generator's 120 guards killed every mutant, including 14 new ones for the escaper and each place it is applied. All 165 tests pass. eslint-plugin-sonarjs reports nothing. Asciidoctor renders the README, the ROADMAP, the CHANGELOG and the page at WARN. just ultraplan-check, check-views, site-check and site-test pass, and the I-JSON gate finds 26 of 26 files canonical. The ROADMAP records the three rulings of 2026-11-25: plain text, ADR status as a header attribute (next), and an estate-wide Guix fix, queued as its own task. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 5 +- docs/status/ROADMAP.adoc | 8 + docs/ultraplan/README.adoc | 27 +- docs/ultraplan/generated/tree.svg | 2 +- docs/ultraplan/generated/ultraplan.adoc | 502 ++++++++++++------------ docs/ultraplan/tree.jsonl | 2 +- scripts/ultraplan/ultraplan.mjs | 81 ++-- tests/ultraplan/ultraplan.test.mjs | 57 +-- 8 files changed, 348 insertions(+), 336 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 07dd07bb..74b83724 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -95,8 +95,9 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ** a ref that does not point at one place: each names a passage that occurs exactly once in a file here, a path here, a file of another repository at a full commit, or an issue, and never a line number; - ** a text holding a line break or a description-list marker, either of which - would make block syntax on the page; + ** a text holding a line break. Every text is plain text (owner ruling + 2026-11-25): the page writes each ASCII punctuation mark in it as a + character reference, so it shows exactly as written and forms no markup; ** any note from the private me advisor. + `just ultraplan` and `just ultraplan-check` run it, and `check-views` includes diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index be0f0c10..1c29e28f 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -478,3 +478,11 @@ scheduled census, a view of what each repository owes reads the feed, is open for the owner. The panel node is now `maths-panel`. ** The gels feed-panel contract thread, the estate coordinator and the decision desk were told the same day. +* Owner rulings (2026-11-25), through the selector: +** Plan texts are plain text everywhere: in the data, on the page and in the + feed. The page writes each ASCII punctuation mark in a text as a character + reference, so the text shows as written and forms no markup. +** An ADR's status becomes a header attribute, `:status:`, kept in step with + its Status section. +** Guix proof CI gets one estate-wide fix at source, queued as its own task + (CI upkeep, on a cheaper model). diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 92bf9dc1..177ba5cf 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -70,18 +70,19 @@ When every slot is taken, the page and the picture still show the frontier, and say that it is ready but cannot start. * *Blocked* must say what blocks it. -Each text (a name, a summary, a piece of counsel, a reason) is one line of -AsciiDoc inline markup. A code span, bold text or an attribute reference such as -`+{nbsp}+` renders as it would in any AsciiDoc paragraph. Block syntax cannot -occur: - -* The generator refuses a line break or any other control character. -* It refuses a description-list marker: `+::+`, `+:::+`, `+::::+` or `+;;+` -followed by a blank or the end of the text. Asciidoctor reads a line holding -one as a list term wherever the marker stands, so no prefix keeps it text. A -`+::+` with no blank after it, as in a URL, is not a marker. -* It writes a summary, the one text that starts a line of the page, after -`+{empty}+`. +Each text (a name, a summary, a piece of counsel, a reason, a quote) is plain +text on one line (owner ruling 2026-11-25). It carries no markup, and the page +shows it exactly as written: + +* AsciiDoc builds all its markup from ASCII punctuation. The generator writes +each such mark in a text as a numeric character reference, which Asciidoctor +shows as the mark itself and never reads as markup. +* So no text can open a block, start a list or a description list, end a table +cell or a link, form a span, or name an attribute, wherever it stands on the +page. +* A feed can carry the same strings unchanged, as plain text. +* The generator refuses a line break or any other control character in a text. + A text does not type a count that the data derives, such as a number of claims, repositories or theorems: the views carry those counts, and a typed one goes stale. @@ -156,7 +157,7 @@ these: ** `+{"at":"a passage","path":"docs/x.adoc"}+`: a passage of a file in this repository. The passage must occur in the file exactly once. `just check` refuses the ref when the passage is reworded, moved away or repeated, so a ref -never points nowhere unseen. A passage holds no backtick, plus or backslash. +never points nowhere unseen. A passage is one line of up to 160 characters. ** `+{"path":"docs/x"}+`: a file or a directory of this repository, which must exist. ** `+{"at":"โ€ฆ","commit":"","path":"โ€ฆ","repo":"OWNER/REPO"}+`: a diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index 1bcb5445..4a89ca57 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -107,7 +107,7 @@ โœ… -Atlas views: The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`. +Atlas views: The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by just check-views. ๐Ÿ—บ๏ธ Atlas views diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index b2885269..89faa1ba 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -30,18 +30,18 @@ counts the live nodes that depend on it, directly or through others. [cols="3,1,1,1,5",options="header"] |=== |Node |Track |Size |Unlocks |Summary -|xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] |ecosystem |M |8 |The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. -|xref:census-workflow[โฐ Census on a schedule] |engineering |M |2 |A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. -|xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] |economics |M |2 |A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. -|xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts] |maths |M |2 |A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). -|xref:dossier[๐Ÿ—‚๏ธ Theorem dossier] |maths |S |1 |The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. -|xref:file-transport-bugs[๐Ÿ› File the transport reproducers] |ecosystem |S |1 |File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. _(upstream:Deducteam/agda2dedukti)_ -|xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image] |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. -|xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone] |maths |S |1 |Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). -|xref:doc-drift-fix[๐Ÿงน Mend the status documents] |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. -|xref:paper-thy1[๐Ÿ“„ Note: feature reachability] |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. -|xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] |science |L |0 |S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). -|xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] |publications |M |0 |A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. +|xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] |ecosystem |M |8 |The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. +|xref:census-workflow[โฐ Census on a schedule] |engineering |M |2 |A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. +|xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] |economics |M |2 |A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. +|xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts] |maths |M |2 |A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). +|xref:dossier[๐Ÿ—‚๏ธ Theorem dossier] |maths |S |1 |The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. +|xref:file-transport-bugs[๐Ÿ› File the transport reproducers] |ecosystem |S |1 |File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. _(upstream:Deducteam/agda2dedukti)_ +|xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image] |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. +|xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone] |maths |S |1 |Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). +|xref:doc-drift-fix[๐Ÿงน Mend the status documents] |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. +|xref:paper-thy1[๐Ÿ“„ Note: feature reachability] |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. +|xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] |science |L |0 |S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). +|xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] |publications |M |0 |A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. |=== == The council @@ -52,63 +52,63 @@ repository, and the page lists, unranked, the frontier nodes the owner has tagge === โˆ‘ Mathematician -_Asks:_ Is it true, is it new, and does it join two things that were apart? +_Asks:_ Is it true, is it new, and does it join two things that were apart? -_Pick:_ xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot]. Equivalence as identity, made checkable. +_Pick:_ xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot]. Equivalence as identity, made checkable. === ๐Ÿ”ฌ Scientist -_Asks:_ What would we measure, and what result would change our mind? +_Asks:_ What would we measure, and what result would change our mind? -_Pick:_ xref:statistical-bridge[๐ŸŽฒ From oracle to theorem]. Takes a statistical result that is only tested and makes it a theorem. +_Pick:_ xref:statistical-bridge[๐ŸŽฒ From oracle to theorem]. Takes a statistical result that is only tested and makes it a theorem. === โš™๏ธ Engineer -_Asks:_ Does it run in the gate, fail loudly, and stay cheap to keep? +_Asks:_ Does it run in the gate, fail loudly, and stay cheap to keep? _Pick:_ xref:census-workflow[โฐ Census on a schedule]. === ๐Ÿช™ Economist -_Asks:_ What does it cost, what does it return, and who would fund or use it? +_Asks:_ What does it cost, what does it return, and who would fund or use it? -_Pick:_ xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts]. A forecast that can say undecided is worth more than one that guesses. +_Pick:_ xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts]. A forecast that can say undecided is worth more than one that guesses. === ๐Ÿ“œ Publisher -_Asks:_ Is there a paper, a talk or a citable artefact here? +_Asks:_ Is there a paper, a talk or a citable artefact here? -_Pick:_ xref:paper-thy1[๐Ÿ“„ Note: feature reachability]. A complete, small, checked result: the easiest first paper. +_Pick:_ xref:paper-thy1[๐Ÿ“„ Note: feature reachability]. A complete, small, checked result: the easiest first paper. === ๐Ÿ” Soundness auditor -_Asks:_ Is every done backed by a receipt, and where is the hole? +_Asks:_ Is every done backed by a receipt, and where is the hole? -_Pick:_ xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image]. The only road back to PWG-1 for THY-1 and APP-1 to APP-4. +_Pick:_ xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image]. The only road back to PWG-1 for THY-1 and APP-1 to APP-4. === ๐Ÿ—บ๏ธ Estate cartographer -_Asks:_ Does another repository already have this, or need it? Converge rather than rebuild. +_Asks:_ Does another repository already have this, or need it? Converge rather than rebuild. -_Pick:_ xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot]. The first real convergence between repositories; everything cross-repo waits on it. +_Pick:_ xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot]. The first real convergence between repositories; everything cross-repo waits on it. === ๐ŸŽ Teacher -_Asks:_ Could a newcomer learn something true and useful from it? +_Asks:_ Could a newcomer learn something true and useful from it? -_Pick:_ xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. Shows why a proof matters to someone who reads spreadsheets, not theorems. +_Pick:_ xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. Shows why a proof matters to someone who reads spreadsheets, not theorems. === ๐Ÿƒ Contrarian -_Asks:_ What if we took the other road? Which cheap node is everyone overlooking? +_Asks:_ What if we took the other road? Which cheap node is everyone overlooking? _Pick:_ xref:file-transport-bugs[๐Ÿ› File the transport reproducers]. === ๐Ÿซถ Me -_Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. +_Asks:_ Does it help the ownerโ€™s own life and work? Its notes are kept privately, outside this repository. -_No public pick:_ the owner chooses in a private panel of their own. Tagged on the frontier, in id order: xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. +_No public pick:_ the owner chooses in a private panel of their own. Tagged on the frontier, in id order: xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught]. == Forks and confluences @@ -117,36 +117,36 @@ nodes from two or more tracks: work there joins. Rivals are different routes to same place; the contrarian keeps the road not taken in view. .Forks -* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] -> xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] -* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] +* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] -> xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] +* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] * xref:centre-computations[๐ŸŽฏ Centre computations] -> xref:concept-commons[๐Ÿ›๏ธ Concept commons], xref:corpus[๐Ÿงช Propose and dispose corpus] -* xref:claims-registry[๐Ÿ“’ Claims registry] -> xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] -* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] -> xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] -* xref:receipt-generator[๐Ÿญ Shared receipt generator] -> xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] -* xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] -> xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] -* xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:corpus[๐Ÿงช Propose and dispose corpus], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] -* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] -> xref:dossier[๐Ÿ—‚๏ธ Theorem dossier], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] -* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] -> xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti], xref:file-transport-bugs[๐Ÿ› File the transport reproducers], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] -* xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] +* xref:claims-registry[๐Ÿ“’ Claims registry] -> xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] +* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] -> xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] +* xref:receipt-generator[๐Ÿญ Shared receipt generator] -> xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] +* xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] +* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] -> xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] +* xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:corpus[๐Ÿงช Propose and dispose corpus], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] +* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] -> xref:dossier[๐Ÿ—‚๏ธ Theorem dossier], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] +* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] -> xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti], xref:file-transport-bugs[๐Ÿ› File the transport reproducers], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] +* xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] .Confluences -* xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences] + xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] -> xref:bridge-by-construction[๐Ÿ— Bridges by construction] +* xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences] + xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] -> xref:bridge-by-construction[๐Ÿ— Bridges by construction] * xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:centre-computations[๐ŸŽฏ Centre computations] * xref:centre-computations[๐ŸŽฏ Centre computations] + xref:whats-owed[๐Ÿ“‹ What is owed] -> xref:concept-commons[๐Ÿ›๏ธ Concept commons] -* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + xref:centre-computations[๐ŸŽฏ Centre computations] + xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:corpus[๐Ÿงช Propose and dispose corpus] -* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + xref:file-transport-bugs[๐Ÿ› File the transport reproducers] -> xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] -* xref:corpus[๐Ÿงช Propose and dispose corpus] + xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign] + xref:ci-recorder[๐Ÿค– CI records its own runs] -> xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] -* xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts] + xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] -> xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] -* xref:receipt-generator[๐Ÿญ Shared receipt generator] + xref:claims-registry[๐Ÿ“’ Claims registry] + xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims] -* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability] -* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] -* xref:receipts[๐Ÿ” Proof receipts] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -* xref:claims-registry[๐Ÿ“’ Claims registry] + xref:thy1[๐Ÿงญ THY-1: reachability is monotone] -> xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] +* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + xref:centre-computations[๐ŸŽฏ Centre computations] + xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:corpus[๐Ÿงช Propose and dispose corpus] +* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + xref:file-transport-bugs[๐Ÿ› File the transport reproducers] -> xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] +* xref:corpus[๐Ÿงช Propose and dispose corpus] + xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign] + xref:ci-recorder[๐Ÿค– CI records its own runs] -> xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] +* xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts] + xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] -> xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] +* xref:receipt-generator[๐Ÿญ Shared receipt generator] + xref:claims-registry[๐Ÿ“’ Claims registry] + xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] -> xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims] +* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability] +* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] +* xref:receipts[๐Ÿ” Proof receipts] + xref:token-order[โš–๏ธ Settle the order of status tokens] -> xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] +* xref:claims-registry[๐Ÿ“’ Claims registry] + xref:thy1[๐Ÿงญ THY-1: reachability is monotone] -> xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] .Rivals * xref:bridge-by-construction[๐Ÿ— Bridges by construction] or xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] -* xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] or xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] +* xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] or xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] == The eras @@ -155,23 +155,23 @@ same place; the contrarian keeps the road not taken in view. [[census]] ==== โœ… ๐Ÿงพ Census of the estate -{empty}The proof census of the public repositories: a row for each proof file, with its holes and axioms, at a pinned commit and time. +The proof census of the public repositories: a row for each proof file, with its holes and axioms, at a pinned commit and time. *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* L ยท *Status:* done *Enables:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views], xref:census-workflow[โฐ Census on a schedule], xref:claims-registry[๐Ÿ“’ Claims registry] + -*Evidence:* `docs/atlas/census/rows.jsonl`; `scripts/census/run-census.sh` + +*Evidence:* `docs/atlas/census/rows.jsonl`; `scripts/census/run-census.sh` + *Value (judgement):* engineering โ—โ—, science โ—โ—, ecosystem โ—โ—โ— [[proof-gate]] ==== โœ… ๐Ÿ›ก๏ธ Proof gate in pinned Guix -{empty}Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail. +Agda 2.7.0.1, Rocq 8.18.0 and Lean 4.29.0 check every gated module on every commit, with an axiom audit over theorems and definitions and planted controls that must fail. *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* L ยท *Status:* done -*Enables:* xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + -*Evidence:* `scripts/check-proofs.sh`; `tests/proofs/gate_controls_test.sh` + +*Enables:* xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + +*Evidence:* `scripts/check-proofs.sh`; `tests/proofs/gate_controls_test.sh` + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ— === ๐Ÿงฎ Era 1: Abacus @@ -179,383 +179,383 @@ same place; the contrarian keeps the road not taken in view. [[cohort-model]] ==== โœ… ๐Ÿ‘ฅ Cohort model in Agda -{empty}The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines. +The cohort-economics model of the applied shelf, with three number modes and synthetic examples generated into Agda from JSON Lines. *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* M ยท *Status:* done *Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] + -*Enables:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + -*Evidence:* `verification/proofs/agda/Applied/Cohort.agda`; `applied-systems/methods/input-schema.adoc` + +*Enables:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + +*Evidence:* `verification/proofs/agda/Applied/Cohort.agda`; `applied-systems/methods/input-schema.adoc` + *Value (judgement):* maths โ—โ—, economics โ—โ—, teaching โ—โ— [[thy1]] -==== โœ… ๐Ÿงญ THY-1: reachability is monotone +==== โœ… ๐Ÿงญ THY-1: reachability is monotone -{empty}In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean. +In a dependency graph with feature-guarded edges, a node unreachable with every feature requested is unreachable under any request. Proved in Agda, re-proved in Rocq and Lean. *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done *Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] + -*Enables:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti], xref:file-transport-bugs[๐Ÿ› File the transport reproducers], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + -*Evidence:* hyperpolymath/mathesis#THY-1 at PWG-2ii or above + +*Enables:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti], xref:file-transport-bugs[๐Ÿ› File the transport reproducers], xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + +*Evidence:* hyperpolymath/mathesis#THY-1 at PWG-2ii or above + *Value (judgement):* maths โ—โ—, engineering โ—โ—, publications โ—โ— [[atlas-views]] ==== โœ… ๐Ÿ—บ๏ธ Atlas views -{empty}The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`. +The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by just check-views. *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* M ยท *Status:* done *Needs:* xref:census[๐Ÿงพ Census of the estate] + -*Enables:* xref:site-build[๐Ÿ—๏ธ Atlas site (build)], xref:ultraplan[๐ŸŒณ The ultraplan] + -*Evidence:* `docs/atlas/generated/catalogue.adoc`; `docs/atlas/generated/az.adoc` + +*Enables:* xref:site-build[๐Ÿ—๏ธ Atlas site (build)], xref:ultraplan[๐ŸŒณ The ultraplan] + +*Evidence:* `docs/atlas/generated/catalogue.adoc`; `docs/atlas/generated/az.adoc` + *Value (judgement):* engineering โ—โ—, teaching โ—โ—, ecosystem โ—โ— [[census-workflow]] ==== ๐ŸŒฑ โฐ Census on a schedule -{empty}A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. +A scheduled census workflow as the one writer of the census rows (WO 5.3), so refreshes stop arriving by hand and unrecorded. *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open *Needs:* xref:census[๐Ÿงพ Census of the estate] + *Enables:* xref:whats-owed[๐Ÿ“‹ What is owed] + *Value (judgement):* engineering โ—โ—, ecosystem โ—โ— + -*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.3 Schedule the census+` +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `WO 5.3 Schedule the census` [[claims-registry]] ==== โœ… ๐Ÿ“’ Claims registry -{empty}Pins each claim in its home repository and derives each grade from the home receipt with the pinned canon reader. No grade is typed. +Pins each claim in its home repository and derives each grade from the home receipt with the pinned canon reader. No grade is typed. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done *Needs:* xref:census[๐Ÿงพ Census of the estate] + -*Enables:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] + -*Evidence:* ADR 0004 accepted; `docs/atlas/generated/registry.adoc` + +*Enables:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] + +*Evidence:* ADR 0004 accepted; `docs/atlas/generated/registry.adoc` + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— [[pinned-image]] ==== ๐ŸŒฑ ๐Ÿ“ฆ Proof lanes in a pinned image -{empty}Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. +Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. *Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open *Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] + -*Enables:* xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1] + +*Enables:* xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1] + *Value (judgement):* engineering โ—โ—, soundness โ—โ—โ— + -*See:* `docs/status/PROOF-STATUS.adoc`, at `+standards#1625 (2026-11-17)+` +*See:* `docs/status/PROOF-STATUS.adoc`, at `standards#1625 (2026-11-17)` -* ๐Ÿ” _Soundness auditor:_ The only road back to PWG-1 for THY-1 and APP-1 to APP-4. +* ๐Ÿ” _Soundness auditor:_ The only road back to PWG-1 for THY-1 and APP-1 to APP-4. === ๐Ÿ“ Era 2: Euclid [[app-proofs]] -==== โœ… ๐Ÿ’ง APP-1 to APP-4: missing stays missing +==== โœ… ๐Ÿ’ง APP-1 to APP-4: missing stays missing -{empty}Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean. +Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean. *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* done *Needs:* xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda] + -*Enables:* xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] + -*Evidence:* hyperpolymath/mathesis#APP-1 at PWG-2ii or above; hyperpolymath/mathesis#APP-2 at PWG-2ii or above; hyperpolymath/mathesis#APP-3 at PWG-2ii or above; hyperpolymath/mathesis#APP-4 at PWG-2ii or above + +*Enables:* xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] + +*Evidence:* hyperpolymath/mathesis#APP-1 at PWG-2ii or above; hyperpolymath/mathesis#APP-2 at PWG-2ii or above; hyperpolymath/mathesis#APP-3 at PWG-2ii or above; hyperpolymath/mathesis#APP-4 at PWG-2ii or above + *Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— [[chain-question]] -==== ๐Ÿ”จ ๐Ÿงฉ Is a chain enough? (X-PF1) +==== ๐Ÿ”จ ๐Ÿงฉ Is a chain enough? (X-PF1) -{empty}Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order. +Experiment X-PF1, pre-registered: list each rule, gate and report in the estate that reads a status token (at least the proof-route ABI, the registry and ledger rule 3) and ask whether its result changes between the two members of a fibre. Outcome A, B or C (or D: two tokens the wrong way round) decides the order. *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* active *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + *Enables:* xref:token-order[โš–๏ธ Settle the order of status tokens] + *Value (judgement):* maths โ—โ—โ—, science โ—โ—, soundness โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+=== What experiment X-PF1 can change+`; `docs/proposals/mathesis-research-programme.adoc`, at `+the list covers the proof-route ABI, the registry and+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `=== What experiment X-PF1 can change`; `docs/proposals/mathesis-research-programme.adoc`, at `the list covers the proof-route ABI, the registry and` -* โˆ‘ _Mathematician:_ The deepest open question on the board; it decides what S-1 even says. -* ๐Ÿ”ฌ _Scientist:_ Pre-register what result means A, B or C before computing. +* โˆ‘ _Mathematician:_ The deepest open question on the board; it decides what S-1 even says. +* ๐Ÿ”ฌ _Scientist:_ Pre-register what result means A, B or C before computing. [[theory-shelf]] ==== โœ… ๐Ÿ“š Theory shelf and ledger -{empty}The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far. +The admission rule for theory no single system owns, with an append-only ledger of every grade and receipt change. One theorem admitted so far. *Track:* โˆ‘ maths ยท *Kind:* data ยท *Size:* S ยท *Status:* done -*Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + -*Enables:* xref:dossier[๐Ÿ—‚๏ธ Theorem dossier], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] + -*Evidence:* `docs/theory/admissions.jsonl`; `docs/theory/ledger.jsonl` + +*Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + +*Enables:* xref:dossier[๐Ÿ—‚๏ธ Theorem dossier], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] + +*Evidence:* `docs/theory/admissions.jsonl`; `docs/theory/ledger.jsonl` + *Value (judgement):* maths โ—โ—, soundness โ—โ— [[doc-drift-fix]] ==== ๐ŸŒฑ ๐Ÿงน Mend the status documents -{empty}ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. +ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. *Track:* โš™ engineering ยท *Kind:* decision ยท *Size:* S ยท *Status:* open *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + *Value (judgement):* teaching โ—, soundness โ—โ—โ— + -*See:* `docs/status/ROADMAP.adoc`, at `+=== First theory theorem (2026-11-09)+`; `docs/status/PROOF-NEEDS.adoc`, at `+Discharged: the receipt derives+`; `README.adoc`, at `+The token-lattice theorems of the theory shelf, receipts for the cohort model+`; `.machine_readable/contractiles/intend` +*See:* `docs/status/ROADMAP.adoc`, at `=== First theory theorem (2026-11-09)`; `docs/status/PROOF-NEEDS.adoc`, at `Discharged: the receipt derives`; `README.adoc`, at `The token-lattice theorems of the theory shelf, receipts for the cohort model`; `.machine_readable/contractiles/intend` -* ๐Ÿƒ _Contrarian:_ Cheapest node on the board, and the auditor's favourite. -* ๐Ÿ” _Soundness auditor:_ Every one of these is a claim with no receipt behind it; mend before adding. +* ๐Ÿƒ _Contrarian:_ Cheapest node on the board, and the auditor's favourite. +* ๐Ÿ” _Soundness auditor:_ Every one of these is a claim with no receipt behind it; mend before adding. [[receipts]] ==== โœ… ๐Ÿ” Proof receipts -{empty}The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader. +The PROOF-POLICY 8.5.1 receipt of Mathesis: per-leg run, commit, checker, inputs manifest and axioms, checked by the shared git checker and read by the canon reader. *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* M ยท *Status:* done *Needs:* xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix], xref:claims-registry[๐Ÿ“’ Claims registry] + -*Enables:* xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + -*Evidence:* `verification/receipts/theory_praxis.deed` + +*Enables:* xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + +*Evidence:* `verification/receipts/theory_praxis.deed` + *Value (judgement):* engineering โ—โ—, soundness โ—โ—โ— [[site-build]] -==== โœ… ๐Ÿ—๏ธ Atlas site (build) +==== โœ… ๐Ÿ—๏ธ Atlas site (build) -{empty}Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy. +Renders every generated view with Asciidoctor and fails on any warning or broken link. It builds; it does not deploy. *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done *Needs:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views] + *Enables:* xref:publish-atlas[๐ŸŒ Publish the atlas] + -*Evidence:* `scripts/site/site.mjs` + +*Evidence:* `scripts/site/site.mjs` + *Value (judgement):* engineering โ—, teaching โ—โ— [[ultraplan]] ==== โœ… ๐ŸŒณ The ultraplan -{empty}This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. +This tech tree: data first, with derived eras, frontier, forks, confluences and advisor picks, and a done that must show evidence. *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done *Needs:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views] + *Enables:* xref:maths-panel[๐ŸชŸ Maths panel for the estate] + -*Evidence:* `docs/ultraplan/tree.jsonl`; `scripts/ultraplan/ultraplan.mjs` + +*Evidence:* `docs/ultraplan/tree.jsonl`; `scripts/ultraplan/ultraplan.mjs` + *Value (judgement):* engineering โ—, teaching โ— [[bridge-candidates]] ==== โœ… ๐ŸŒ‰ Bridge candidates -{empty}Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence. +Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* S ยท *Status:* done *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry] + *Enables:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + -*Evidence:* `docs/atlas/claims/bridges.jsonl` + +*Evidence:* `docs/atlas/claims/bridges.jsonl` + *Value (judgement):* maths โ—โ—, ecosystem โ—โ—โ— [[file-transport-bugs]] ==== ๐ŸŒฑ ๐Ÿ› File the transport reproducers -{empty}File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. +File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act. -*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* decision ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* upstream:Deducteam/agda2dedukti +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* decision ยท *Size:* S ยท *Status:* open ยท *Beyond this repository:* upstream:Deducteam/agda2dedukti -*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + +*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone] + *Enables:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] + *Value (judgement):* engineering โ—, ecosystem โ—โ— + -*See:* `docs/status/ROADMAP.adoc`, at `+Next action: the owner files both reports+`; `docs/proposals/mathesis-research-programme.adoc`, at `+File the THY-1 reproducer with the translator's authors+` +*See:* `docs/status/ROADMAP.adoc`, at `Next action: the owner files both reports`; `docs/proposals/mathesis-research-programme.adoc`, at `File the THY-1 reproducer with the translator's authors` -* ๐Ÿช™ _Economist:_ A few hours of filing could unblock a whole route for everyone. +* ๐Ÿช™ _Economist:_ A few hours of filing could unblock a whole route for everyone. [[whats-owed]] ==== ๐ŸŒฑ ๐Ÿ“‹ What is owed -{empty}A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has. +A view of the standards requirements master list beside the census and the registry (WO 5.4): what each repository owes, and what it has. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* open *Needs:* xref:census-workflow[โฐ Census on a schedule], xref:claims-registry[๐Ÿ“’ Claims registry] + *Enables:* xref:concept-commons[๐Ÿ›๏ธ Concept commons] + *Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ—โ—โ— + -*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.4 Report what is owed+` +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `WO 5.4 Report what is owed` === ๐ŸŒŒ Era 3: Kepler [[dossier]] ==== ๐ŸŒฑ ๐Ÿ—‚๏ธ Theorem dossier -{empty}The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. +The eight-item dossier for each theorem (Line 0), scored first on THY-1, five januskey theorems and two each of secret-types and lintel (E-0). Its home (here or standards, R-5) is still open. *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* S ยท *Status:* open *Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + -*Enables:* xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] + +*Enables:* xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] + *Value (judgement):* maths โ—, teaching โ—โ—, soundness โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Describe the method of the previous section as one checklist+`; `docs/proposals/mathesis-research-programme.adoc`, at `+R-5 The dossier.+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Describe the method of the previous section as one checklist`; `docs/proposals/mathesis-research-programme.adoc`, at `R-5 The dossier.` [[s2-monotone]] -==== ๐ŸŒฑ ๐Ÿ“ˆ S-2: evaluation is monotone +==== ๐ŸŒฑ ๐Ÿ“ˆ S-2: evaluation is monotone -{empty}Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). +Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* S ยท *Status:* open *Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + -*Enables:* xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + +*Enables:* xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + *Value (judgement):* maths โ—โ—, soundness โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-2 (positive evaluation is monotone)+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `S-2 (positive evaluation is monotone)` -* ๐Ÿƒ _Contrarian:_ The one theorem of the line that does not wait for the order: start it early. +* ๐Ÿƒ _Contrarian:_ The one theorem of the line that does not wait for the order: start it early. [[s4-s5-verdict]] -==== ๐ŸŒฑ ๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts +==== ๐ŸŒฑ ๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts -{empty}A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). +A sound three-valued cash verdict over intervals, where missing means unbounded (S-4), and more uncertainty never strengthens a verdict (S-5). Reuses residual-evidence-types at a pin; pass is PWG-3 (E-4.2). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open -*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + +*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + *Enables:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* maths โ—โ—, economics โ—โ—โ—, teaching โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-4 (a sound cash verdict)+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Write one synthetic 13-week forecast as records+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `S-4 (a sound cash verdict)`; `docs/proposals/mathesis-research-programme.adoc`, at `Write one synthetic 13-week forecast as records` -* ๐Ÿช™ _Economist:_ A forecast that can say undecided is worth more than one that guesses. -* ๐ŸŽ _Teacher:_ Three-valued logic with money attached: an easy story to teach. +* ๐Ÿช™ _Economist:_ A forecast that can say undecided is worth more than one that guesses. +* ๐ŸŽ _Teacher:_ Three-valued logic with money attached: an easy story to teach. [[token-order]] ==== ๐ŸŒฑ โš–๏ธ Settle the order of status tokens -{empty}Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order. +Record the order X-PF1 decides, in Mathesis (R-1, provisional) and in the canon. Evidence it must answer: R-1 reads PROOF-POLICY section 5 as open < argued < tested-only, resource-algebra E-1 (PWG-2i) proves open < tested-only < argued, and section 5 itself lists the tokens without stating an order. *Track:* โˆ‘ maths ยท *Kind:* decision ยท *Size:* S ยท *Status:* open -*Needs:* xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)] + -*Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + +*Needs:* xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)] + +*Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Value (judgement):* maths โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+R-1 The order of the tokens.+`; `docs/atlas/generated/registry.adoc`, at `+[hyperpolymath/resource-algebra#E-1]+`; https://github.com/metadatastician/standards/blob/745fc744158047a675eeb92464167c9961d66c4b/3-practice/PROOF-POLICY.adoc[metadatastician/standards: 3-practice/PROOF-POLICY.adoc] at `745fc7441580`, at `+== 5. Status vocabulary+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `R-1 The order of the tokens.`; `docs/atlas/generated/registry.adoc`, at `[hyperpolymath/resource-algebra#E-1]`; https://github.com/metadatastician/standards/blob/745fc744158047a675eeb92464167c9961d66c4b/3-practice/PROOF-POLICY.adoc[metadatastician/standards: 3-practice/PROOF-POLICY.adoc] at `745fc7441580`, at `== 5. Status vocabulary` -* ๐Ÿ—บ๏ธ _Estate cartographer:_ The canon order is the ownerโ€™s ruling in standards, and resource-algebra E-1 may need re-proving; carry both. -* โˆ‘ _Mathematician:_ Two careful readings disagree; that is a sign the two tokens are incomparable, which is outcome C. +* ๐Ÿ—บ๏ธ _Estate cartographer:_ The canon order is the ownerโ€™s ruling in standards, and resource-algebra E-1 may need re-proving; carry both. +* โˆ‘ _Mathematician:_ Two careful readings disagree; that is a sign the two tokens are incomparable, which is outcome C. [[dedukti-transport]] ==== โ›” ๐Ÿš‚ Transport through Dedukti -{empty}Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first. +Check an Agda proof in Rocq and Lean by translating it through Dedukti and Lambdapi instead of re-proving it, the route PROOF-POLICY section 2 puts first. -*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* blocked ยท *Beyond this repository:* upstream:Deducteam/lambdapi +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* blocked ยท *Beyond this repository:* upstream:Deducteam/lambdapi -*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone], xref:file-transport-bugs[๐Ÿ› File the transport reproducers] + +*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone], xref:file-transport-bugs[๐Ÿ› File the transport reproducers] + *Rivals:* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + -*Blocked by:* Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip. + +*Blocked by:* Agda2Dedukti fails on a parameterised record in Set1 and rejects --cubical-compatible; Lambdapi raw_lean and raw_coq drop rewrite rules. A transport row stays a re-proof until a fixed release passes the round trip. + *Value (judgement):* maths โ—, engineering โ—โ—, soundness โ—โ— + -*See:* `docs/status/ROADMAP.adoc`, at `+PROOF-POLICY ยง2 puts Dedukti transport first and a re-proof by hand second.+` +*See:* `docs/status/ROADMAP.adoc`, at `PROOF-POLICY ยง2 puts Dedukti transport first and a re-proof by hand second.` -* ๐Ÿƒ _Contrarian:_ Policy puts this route first, yet every re-proof so far went the other way. +* ๐Ÿƒ _Contrarian:_ Policy puts this route first, yet every re-proof so far went the other way. [[receipt-generator]] ==== ๐Ÿ”จ ๐Ÿญ Shared receipt generator -{empty}Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. +Adopt the standards generator: the receipt is generated from a run ledger, and the gate lists each green run's ledger rows. Pull request 122. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* active *Needs:* xref:receipts[๐Ÿ” Proof receipts] + -*Enables:* xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] + +*Enables:* xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ— -* โš™๏ธ _Engineer:_ One generator for the estate instead of one per repository. +* โš™๏ธ _Engineer:_ One generator for the estate instead of one per repository. [[statistical-bridge]] ==== ๐ŸŒฑ ๐ŸŽฒ From oracle to theorem -{empty}S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). +S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). *Track:* ๐Ÿ”ฌ science ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open *Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger] + *Value (judgement):* maths โ—โ—, science โ—โ—โ—, publications โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-2.6 Can a statistical oracle become theory?+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Q-2.6 Can a statistical oracle become theory?` -* ๐Ÿ”ฌ _Scientist:_ Takes a statistical result that is only tested and makes it a theorem. +* ๐Ÿ”ฌ _Scientist:_ Takes a statistical result that is only tested and makes it a theorem. [[forecast-13wk]] -==== ๐ŸŒฑ ๐Ÿ“… Thirteen-week forecast +==== ๐ŸŒฑ ๐Ÿ“… Thirteen-week forecast -{empty}A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. +A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf. *Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* M ยท *Status:* open -*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + +*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + *Enables:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* engineering โ—, economics โ—โ—โ—, teaching โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Write one synthetic 13-week forecast as records+`; `applied-systems/finance/liquidity/README.adoc` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Write one synthetic 13-week forecast as records`; `applied-systems/finance/liquidity/README.adoc` -* ๐Ÿช™ _Economist:_ The first output a business reader would recognise. +* ๐Ÿช™ _Economist:_ The first output a business reader would recognise. [[paper-thy1]] -==== ๐ŸŒฑ ๐Ÿ“„ Note: feature reachability +==== ๐ŸŒฑ ๐Ÿ“„ Note: feature reachability -{empty}A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. +A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open -*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone], xref:receipts[๐Ÿ” Proof receipts] + +*Needs:* xref:thy1[๐Ÿงญ THY-1: reachability is monotone], xref:receipts[๐Ÿ” Proof receipts] + *Value (judgement):* maths โ—, publications โ—โ—โ—, teaching โ— -* ๐Ÿ“œ _Publisher:_ A complete, small, checked result: the easiest first paper. +* ๐Ÿ“œ _Publisher:_ A complete, small, checked result: the easiest first paper. [[publish-atlas]] ==== โ›” ๐ŸŒ Publish the atlas -{empty}Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node. +Deploy the built site (WO 4.3), once the owner says go. Publication is outward-facing, so it is gated on the owner, not on any node. *Track:* ๐Ÿ“œ publications ยท *Kind:* view ยท *Size:* S ยท *Status:* blocked -*Needs:* xref:site-build[๐Ÿ—๏ธ Atlas site (build)] + -*Enables:* xref:talk-atlas[๐ŸŽค Talk: an atlas of an estate] + -*Blocked by:* the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk + +*Needs:* xref:site-build[๐Ÿ—๏ธ Atlas site (build)] + +*Enables:* xref:talk-atlas[๐ŸŽค Talk: an atlas of an estate] + +*Blocked by:* the ownerโ€™s go-ahead to deploy (WO 4.3): deploying is outward-facing, so the hold that ended on 2026-11-24 is followed by a fresh owner question, through the decision desk + *Value (judgement):* publications โ—โ—โ—, teaching โ—โ—, ecosystem โ—โ— + -*See:* `docs/status/ROADMAP.adoc`, at `+WO 4.3, publish the atlas+`; `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 4.3 Publish the atlas+` +*See:* `docs/status/ROADMAP.adoc`, at `WO 4.3, publish the atlas`; `docs/proposals/mathesis-re-anchoring.adoc`, at `WO 4.3 Publish the atlas` -* ๐Ÿ“œ _Publisher:_ Everything else here is invisible until this happens. -* ๐Ÿ” _Soundness auditor:_ Publish only views whose checks are green, or the site states what the receipts do not. +* ๐Ÿ“œ _Publisher:_ Everything else here is invisible until this happens. +* ๐Ÿ” _Soundness auditor:_ Publish only views whose checks are green, or the site states what the receipts do not. [[teaching-cohort]] -==== ๐ŸŒฑ ๐Ÿ““ Cohort economics, taught +==== ๐ŸŒฑ ๐Ÿ““ Cohort economics, taught -{empty}A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. +A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* M ยท *Status:* open -*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + +*Needs:* xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] + *Value (judgement):* economics โ—, publications โ—โ—, teaching โ—โ—โ— -* ๐ŸŽ _Teacher:_ Shows why a proof matters to someone who reads spreadsheets, not theorems. +* ๐ŸŽ _Teacher:_ Shows why a proof matters to someone who reads spreadsheets, not theorems. [[bridge-lock-pilot]] ==== ๐ŸŒฑ ๐Ÿ”— Bridge lock pilot -{empty}The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. +The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* M ยท *Status:* open *Needs:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates] + -*Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + +*Enables:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + *Value (judgement):* maths โ—โ—, science โ—, ecosystem โ—โ—โ— + -*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+=== The lock+`; `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.2 Pilot the bridge lock+` +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `=== The lock`; `docs/proposals/mathesis-re-anchoring.adoc`, at `WO 5.2 Pilot the bridge lock` -* ๐Ÿ—บ๏ธ _Estate cartographer:_ The first real convergence between repositories; everything cross-repo waits on it. -* โˆ‘ _Mathematician:_ Equivalence as identity, made checkable. +* ๐Ÿ—บ๏ธ _Estate cartographer:_ The first real convergence between repositories; everything cross-repo waits on it. +* โˆ‘ _Mathematician:_ Equivalence as identity, made checkable. [[maths-panel]] ==== โ›” ๐ŸชŸ Maths panel for the estate -{empty}The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel. +The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:ultraplan[๐ŸŒณ The ultraplan] + -*Blocked by:* the ownerโ€™s choice of host (owner clarification 2026-11-25): GELS, the Git Estate Logistics System, and MPSCI, the Master Production and Scheduling Command Interface, are separate systems in metadatastician, and which of them shows the panel and reads the feed is open; then their feed and panel contract + +*Blocked by:* the ownerโ€™s choice of host (owner clarification 2026-11-25): GELS, the Git Estate Logistics System, and MPSCI, the Master Production and Scheduling Command Interface, are separate systems in metadatastician, and which of them shows the panel and reads the feed is open; then their feed and panel contract + *Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— === โ™พ๏ธ Era 4: Cantor @@ -563,71 +563,71 @@ same place; the contrarian keeps the road not taken in view. [[centre-computations]] ==== ๐ŸŒฑ ๐ŸŽฏ Centre computations -{empty}Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801). +Over locked bridges: classes under a criterion, their order, contradictions, and the five different absences (RA 786-801). *Track:* โˆ‘ maths ยท *Kind:* method ยท *Size:* L ยท *Status:* open *Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot], xref:token-order[โš–๏ธ Settle the order of status tokens] + *Enables:* xref:concept-commons[๐Ÿ›๏ธ Concept commons], xref:corpus[๐Ÿงช Propose and dispose corpus] + *Value (judgement):* maths โ—โ—โ—, science โ—โ— + -*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+=== What the centre computes+` +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `=== What the centre computes` [[s1-token-algebra]] -==== ๐ŸŒฑ ๐Ÿ”ข S-1: tokens form a dioid +==== ๐ŸŒฑ ๐Ÿ”ข S-1: tokens form a dioid -{empty}The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). +The status tokens form a ResourceAlgebra and dioid with an annihilating zero, with an injective strict morphism into MinMax. Agda against resource-algebra at a pin, re-proved in Rocq and Lean (E-1.1). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* L ยท *Status:* open *Needs:* xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:token-order[โš–๏ธ Settle the order of status tokens] + -*Enables:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + -*Rivals:* xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + +*Enables:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + +*Rivals:* xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] + *Value (judgement):* maths โ—โ—โ—, publications โ—โ—, soundness โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-1 (the tokens are a bottleneck grade)+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Prove S-1 in Agda against+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `S-1 (the tokens are a bottleneck grade)`; `docs/proposals/mathesis-research-programme.adoc`, at `Prove S-1 in Agda against` -* ๐Ÿƒ _Contrarian:_ resource-algebra already pins E-1 to E-3; proving it again here may be duplication. -* โˆ‘ _Mathematician:_ A real algebra of evidence; the centre of the research programme. +* ๐Ÿƒ _Contrarian:_ resource-algebra already pins E-1 to E-3; proving it again here may be duplication. +* โˆ‘ _Mathematician:_ A real algebra of evidence; the centre of the research programme. [[s3-grade-function]] -==== ๐ŸŒฑ ๐ŸŽš๏ธ S-3: the grade is a function +==== ๐ŸŒฑ ๐ŸŽš๏ธ S-3: the grade is a function -{empty}The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3). +The Proof Witness Grade is a total monotone function of the receipt, and the canon reader agrees with it on every case, shown by exhaustion as in residual-evidence-types (E-1.3). *Track:* โˆ‘ maths ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open *Needs:* xref:receipts[๐Ÿ” Proof receipts], xref:token-order[โš–๏ธ Settle the order of status tokens] + -*Enables:* xref:corpus[๐Ÿงช Propose and dispose corpus], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + +*Enables:* xref:corpus[๐Ÿงช Propose and dispose corpus], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:paper-status-algebra[๐Ÿ“˜ Paper: an algebra of proof status] + *Value (judgement):* maths โ—โ—, engineering โ—โ—, soundness โ—โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+S-3 (the grade is a function of the receipt)+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Run the table of S-3 against the canon reader+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `S-3 (the grade is a function of the receipt)`; `docs/proposals/mathesis-research-programme.adoc`, at `Run the table of S-3 against the canon reader` -* ๐Ÿ” _Soundness auditor:_ Turns the reader from trusted code into a checked one. +* ๐Ÿ” _Soundness auditor:_ Turns the reader from trusted code into a checked one. [[ci-recorder]] ==== ๐ŸŒฑ ๐Ÿค– CI records its own runs -{empty}A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open. +A trusted publisher that writes each green run's ledger rows to the repository, so no human copies rows. The piece standards PR 1675 leaves open. -*Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards +*Track:* โš™ engineering ยท *Kind:* infrastructure ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards *Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + -*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + +*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—, ecosystem โ—โ— [[januskey-slice]] -==== ๐ŸŒฑ ๐Ÿ—๏ธ Theorem to code: januskey +==== ๐ŸŒฑ ๐Ÿ—๏ธ Theorem to code: januskey -{empty}Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1). +Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1). -*Track:* โš™ engineering ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/januskey +*Track:* โš™ engineering ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/januskey *Needs:* xref:dossier[๐Ÿ—‚๏ธ Theorem dossier] + *Value (judgement):* maths โ—, engineering โ—โ—โ—, soundness โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-3.1 Can the composite status be computed?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+as the first vertical slice (ruling R-4)+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Q-3.1 Can the composite status be computed?`; `docs/proposals/mathesis-research-programme.adoc`, at `as the first vertical slice (ruling R-4)` [[pwg1-regained]] -==== ๐ŸŒฑ ๐Ÿฅ‡ Back to PWG-1 +==== ๐ŸŒฑ ๐Ÿฅ‡ Back to PWG-1 -{empty}THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. +THY-1 and APP-1 to APP-4 derive PWG-1 again, from receipts whose rows name the pinned image. *Track:* โš™ engineering ยท *Kind:* data ยท *Size:* S ยท *Status:* open @@ -635,49 +635,49 @@ same place; the contrarian keeps the road not taken in view. *Value (judgement):* publications โ—, soundness โ—โ— [[superseded-manifests-option]] -==== ๐ŸŒฑ ๐Ÿ—„๏ธ Keep superseded manifests (option) +==== ๐ŸŒฑ ๐Ÿ—„๏ธ Keep superseded manifests (option) -{empty}A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges. +A generator option that keeps the inputs digest, manifest and axioms on superseded receipts (owner ruling 2026-11-24). It landed in standards as #1705, and hyperpolymath/mathesis#122 turns it on; it is done when that pull request merges. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* S ยท *Status:* open *Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + *Value (judgement):* engineering โ—, soundness โ—โ—, ecosystem โ— + -*See:* https://github.com/metadatastician/standards/issues/1705[metadatastician/standards#1705]; https://github.com/hyperpolymath/mathesis/issues/122[hyperpolymath/mathesis#122] +*See:* https://github.com/metadatastician/standards/issues/1705[metadatastician/standards#1705]; https://github.com/hyperpolymath/mathesis/issues/122[hyperpolymath/mathesis#122] -* ๐Ÿƒ _Contrarian:_ The ledger already holds every digest; check the option earns its keep. -* ๐Ÿ” _Soundness auditor:_ Lineage you can re-check without git archaeology. +* ๐Ÿƒ _Contrarian:_ The ledger already holds every digest; check the option earns its keep. +* ๐Ÿ” _Soundness auditor:_ Lineage you can re-check without git archaeology. [[encoding-differences]] ==== ๐ŸŒฑ ๐Ÿ”ค Closed list of encoding differences -{empty}A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). +A closed, tested list of the ways the same statement differs between Agda, Rocq and Lean (Q-2.1), built from the existing comparisons as bridge records (E-2.1). *Track:* ๐Ÿ”ฌ science ยท *Kind:* data ยท *Size:* M ยท *Status:* open *Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + *Enables:* xref:bridge-by-construction[๐Ÿ— Bridges by construction] + *Value (judgement):* maths โ—, science โ—โ—โ—, publications โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-2.1 What must a statement comparison record?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Write the five existing comparisons as bridge records+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Q-2.1 What must a statement comparison record?`; `docs/proposals/mathesis-research-programme.adoc`, at `Write the five existing comparisons as bridge records` -* ๐Ÿ“œ _Publisher:_ Nobody has this list; it is citable on its own. -* ๐Ÿ”ฌ _Scientist:_ Each entry should come with a counterexample that shows it. +* ๐Ÿ“œ _Publisher:_ Nobody has this list; it is citable on its own. +* ๐Ÿ”ฌ _Scientist:_ Each entry should come with a counterexample that shows it. [[liquidity-shelf]] ==== ๐ŸŒฑ ๐Ÿ’ถ Liquidity shelf -{empty}The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. +The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only. *Track:* ๐Ÿช™ economics ยท *Kind:* view ยท *Size:* M ยท *Status:* open -*Needs:* xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] + +*Needs:* xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast] + *Enables:* xref:value-of-information[๐Ÿ”ญ Value of information] + *Value (judgement):* economics โ—โ—โ—, publications โ—, teaching โ—โ— [[talk-atlas]] -==== ๐ŸŒฑ ๐ŸŽค Talk: an atlas of an estate +==== ๐ŸŒฑ ๐ŸŽค Talk: an atlas of an estate -{empty}A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. +A talk on mapping the mathematics of hundreds of repositories, with every status traced to a receipt. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* S ยท *Status:* open @@ -687,109 +687,109 @@ same place; the contrarian keeps the road not taken in view. [[echo-mirrors]] ==== ๐ŸŒฑ ๐Ÿชž Echo mirror records -{empty}Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. +Bridge records for the six languages that mirror echo-types (E-2.5), with the graded-comonad disagreement kept as an open question. -*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/echo-types +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/echo-types *Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] + *Value (judgement):* maths โ—โ—, ecosystem โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Write one bridge record for each of the six Echo mirrors+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Write one bridge record for each of the six Echo mirrors` [[receipts-campaign]] ==== ๐ŸŒฑ ๐Ÿ“ฃ Receipts campaign -{empty}Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes the ungraded theorems towards a grade. +Home repositories re-record their receipts (WO 5.1): secret-types and lintel for the reader they fail, resource-algebra for its Lean leg. Takes the ungraded theorems towards a grade. -*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/secret-types +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* method ยท *Size:* L ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/secret-types *Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator] + -*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + +*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* soundness โ—โ—, ecosystem โ—โ—โ— + -*See:* `docs/status/ROADMAP.adoc`, at `+(re-anchoring plan WO 5.1)+`; `docs/proposals/mathesis-re-anchoring.adoc`, at `+WO 5.1 Bring receipts to the home repositories+` +*See:* `docs/status/ROADMAP.adoc`, at `(re-anchoring plan WO 5.1)`; `docs/proposals/mathesis-re-anchoring.adoc`, at `WO 5.1 Bring receipts to the home repositories` -* ๐Ÿ—บ๏ธ _Estate cartographer:_ The registry is only as current as the home receipts. +* ๐Ÿ—บ๏ธ _Estate cartographer:_ The registry is only as current as the home receipts. [[s1-reuse]] -==== ๐ŸŒฑ โ™ป๏ธ S-1 by reuse of resource-algebra +==== ๐ŸŒฑ โ™ป๏ธ S-1 by reuse of resource-algebra -{empty}Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. +Prove only the morphism here, and take the dioid laws from resource-algebra's E-1 to E-3 (already PWG-2i) through a locked bridge, instead of proving them again. -*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/resource-algebra +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* theorem ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:hyperpolymath/resource-algebra *Needs:* xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot], xref:token-order[โš–๏ธ Settle the order of status tokens] + -*Rivals:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + +*Rivals:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + *Value (judgement):* maths โ—โ—, engineering โ—, ecosystem โ—โ—โ— -* ๐Ÿ—บ๏ธ _Estate cartographer:_ Converge: the laws exist, at a grade, in their home repository. +* ๐Ÿ—บ๏ธ _Estate cartographer:_ Converge: the laws exist, at a grade, in their home repository. === ๐Ÿงฉ Era 5: Gรถdel [[concept-commons]] ==== ๐ŸŒฑ ๐Ÿ›๏ธ Concept commons -{empty}The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance. +The horizon of the atlas (M4): a commons of the estate's concepts, navigable by A to Z, subject (MSC2020), project and provenance. *Track:* โˆ‘ maths ยท *Kind:* view ยท *Size:* XL ยท *Status:* open *Needs:* xref:centre-computations[๐ŸŽฏ Centre computations], xref:whats-owed[๐Ÿ“‹ What is owed] + *Value (judgement):* maths โ—โ—, teaching โ—โ—โ—, ecosystem โ—โ— + -*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `+M4. Concept commons+`; `docs/proposals/estate-mathematical-architecture.adoc`, at `+4. Navigation Views+` +*See:* `docs/proposals/mathesis-re-anchoring.adoc`, at `M4. Concept commons`; `docs/proposals/estate-mathematical-architecture.adoc`, at `4. Navigation Views` [[bridge-by-construction]] ==== ๐ŸŒฑ ๐Ÿ— Bridges by construction -{empty}Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match. +Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match. *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* open -*Needs:* xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + +*Needs:* xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + *Enables:* xref:corpus[๐Ÿงช Propose and dispose corpus] + *Rivals:* xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] + *Value (judgement):* maths โ—โ—, engineering โ—โ—โ—, publications โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-2.3 Can a bridge hold by construction?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+Generate the three forms of S-1 from one source+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Q-2.3 Can a bridge hold by construction?`; `docs/proposals/mathesis-research-programme.adoc`, at `Generate the three forms of S-1 from one source` -* โš™๏ธ _Engineer:_ Removes the hand-copying of statements that every re-proof does today. +* โš™๏ธ _Engineer:_ Removes the hand-copying of statements that every re-proof does today. [[idris-token-laws]] ==== ๐ŸŒฑ ๐Ÿงฌ Generated Idris2 token laws -{empty}Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. +Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. -*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards +*Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* M ยท *Status:* open ยท *Beyond this repository:* estate:metadatastician/standards -*Needs:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + +*Needs:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid] + *Value (judgement):* maths โ—, engineering โ—โ—, ecosystem โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Generate the Idris2 statement of the token laws from the source of+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Generate the Idris2 statement of the token laws from the source of` [[value-of-information]] ==== ๐ŸŒฑ ๐Ÿ”ญ Value of information -{empty}Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README). +Decision science on the shelf: what a missing input is worth to know, computed from the three-valued verdicts. No optimiser (decision-science README). *Track:* ๐Ÿช™ economics ยท *Kind:* method ยท *Size:* L ยท *Status:* open *Needs:* xref:liquidity-shelf[๐Ÿ’ถ Liquidity shelf] + *Value (judgement):* maths โ—โ—, science โ—โ—, economics โ—โ—โ— + -*See:* `applied-systems/decision-science/README.adoc` +*See:* `applied-systems/decision-science/README.adoc` [[paper-receipts]] -==== ๐ŸŒฑ ๐Ÿ“ฐ Paper: receipts, not claims +==== ๐ŸŒฑ ๐Ÿ“ฐ Paper: receipts, not claims -{empty}A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. +A methods paper: proof status derived from machine receipts, graded by witness count, never typed, with the registry as a working instance across an estate. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open -*Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:claims-registry[๐Ÿ“’ Claims registry], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + +*Needs:* xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:claims-registry[๐Ÿ“’ Claims registry], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Value (judgement):* engineering โ—, publications โ—โ—โ—, soundness โ—โ— [[paper-status-algebra]] -==== ๐ŸŒฑ ๐Ÿ“˜ Paper: an algebra of proof status +==== ๐ŸŒฑ ๐Ÿ“˜ Paper: an algebra of proof status -{empty}S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt. +S-1 to S-3 written up: proof status as a dioid, its monotone evaluation, and the grade as a checked function of the receipt. *Track:* ๐Ÿ“œ publications ยท *Kind:* paper ยท *Size:* L ยท *Status:* open -*Needs:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + +*Needs:* xref:s1-token-algebra[๐Ÿ”ข S-1: tokens form a dioid], xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + *Value (judgement):* maths โ—โ—โ—, publications โ—โ—โ— === ๐ŸŒ€ Era 6: Grothendieck @@ -797,27 +797,27 @@ same place; the contrarian keeps the road not taken in view. [[corpus]] ==== ๐ŸŒฑ ๐Ÿงช Propose and dispose corpus -{empty}A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2). +A corpus as a view over bridges and receipts (E-H.1), and 20 ungraded Agda theorems given model-proposed Rocq and Lean legs, kept BRIDGE-PENDING until checked (E-H.2). *Track:* ๐Ÿ”ฌ science ยท *Kind:* method ยท *Size:* XL ยท *Status:* open -*Needs:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:centre-computations[๐ŸŽฏ Centre computations], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + -*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + +*Needs:* xref:bridge-by-construction[๐Ÿ— Bridges by construction], xref:centre-computations[๐ŸŽฏ Centre computations], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] + +*Enables:* xref:estate-pwg2ii[๐Ÿ”๏ธ PWG-2ii across the estate] + *Value (judgement):* maths โ—โ—, engineering โ—โ—, science โ—โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Define the corpus as a view over bridge records and receipts+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Define the corpus as a view over bridge records and receipts` === ๐Ÿš€ Era 7: Frontier beyond [[estate-pwg2ii]] -==== ๐ŸŒฑ ๐Ÿ”๏ธ PWG-2ii across the estate +==== ๐ŸŒฑ ๐Ÿ”๏ธ PWG-2ii across the estate -{empty}The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. +The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years. *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* data ยท *Size:* XL ยท *Status:* open *Needs:* xref:corpus[๐Ÿงช Propose and dispose corpus], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:ci-recorder[๐Ÿค– CI records its own runs] + *Value (judgement):* maths โ—โ—, science โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— + -*See:* `docs/proposals/mathesis-research-programme.adoc`, at `+Q-H.3 What does a recheck leg cost?+`; `docs/proposals/mathesis-research-programme.adoc`, at `+A measured cost for a recheck leg, and with it a+` +*See:* `docs/proposals/mathesis-research-programme.adoc`, at `Q-H.3 What does a recheck leg cost?`; `docs/proposals/mathesis-research-programme.adoc`, at `A measured cost for a recheck leg, and with it a` == Return tickets @@ -831,11 +831,11 @@ No trip is out. Nodes whose work lands in another repository. They are listed here so they can be carried to that repository, not done here. -* estate:hyperpolymath/echo-types: xref:echo-mirrors[๐Ÿชž Echo mirror records] (open) -* estate:hyperpolymath/januskey: xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] (open) -* estate:hyperpolymath/resource-algebra: xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] (open) -* estate:hyperpolymath/secret-types: xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign] (open) -* estate:metadatastician/standards: xref:ci-recorder[๐Ÿค– CI records its own runs] (open) -* estate:metadatastician/standards: xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws] (open) -* upstream:Deducteam/agda2dedukti: xref:file-transport-bugs[๐Ÿ› File the transport reproducers] (open) -* upstream:Deducteam/lambdapi: xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] (blocked) +* estate:hyperpolymath/echo-types: xref:echo-mirrors[๐Ÿชž Echo mirror records] (open) +* estate:hyperpolymath/januskey: xref:januskey-slice[๐Ÿ—๏ธ Theorem to code: januskey] (open) +* estate:hyperpolymath/resource-algebra: xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] (open) +* estate:hyperpolymath/secret-types: xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign] (open) +* estate:metadatastician/standards: xref:ci-recorder[๐Ÿค– CI records its own runs] (open) +* estate:metadatastician/standards: xref:idris-token-laws[๐Ÿงฌ Generated Idris2 token laws] (open) +* upstream:Deducteam/agda2dedukti: xref:file-transport-bugs[๐Ÿ› File the transport reproducers] (open) +* upstream:Deducteam/lambdapi: xref:dedukti-transport[๐Ÿš‚ Transport through Dedukti] (blocked) diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index 9e74c229..22813ad1 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -1,5 +1,5 @@ {"evidence":[{"claim":"hyperpolymath/mathesis#APP-1","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-2","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-3","min_pwg":"PWG-2ii"},{"claim":"hyperpolymath/mathesis#APP-4","min_pwg":"PWG-2ii"}],"glyph":"๐Ÿ’ง","id":"app-proofs","kind":"theorem","name":"APP-1 to APP-4: missing stays missing","needs":["cohort-model"],"size":"M","status":"done","summary":"Missing inputs propagate and never read as zero; the cash identity; the least funding gap; status never upgrades. Each proved in Agda, Rocq and Lean.","track":"maths","value":{"economics":3,"maths":2,"teaching":2}} -{"evidence":[{"path":"docs/atlas/generated/catalogue.adoc"},{"path":"docs/atlas/generated/az.adoc"}],"glyph":"๐Ÿ—บ๏ธ","id":"atlas-views","kind":"view","name":"Atlas views","needs":["census"],"size":"M","status":"done","summary":"The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by `just check-views`.","track":"engineering","value":{"ecosystem":2,"engineering":2,"teaching":2}} +{"evidence":[{"path":"docs/atlas/generated/catalogue.adoc"},{"path":"docs/atlas/generated/az.adoc"}],"glyph":"๐Ÿ—บ๏ธ","id":"atlas-views","kind":"view","name":"Atlas views","needs":["census"],"size":"M","status":"done","summary":"The catalogue and the A to Z and organisation views, generated from the census rows and checked for staleness by just check-views.","track":"engineering","value":{"ecosystem":2,"engineering":2,"teaching":2}} {"counsel":{"engineering":"Removes the hand-copying of statements that every re-proof does today."},"glyph":"๐Ÿ—","id":"bridge-by-construction","kind":"tool","name":"Bridges by construction","needs":["encoding-differences","s1-token-algebra"],"refs":[{"at":"Q-2.3 Can a bridge hold by construction?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"Generate the three forms of S-1 from one source","path":"docs/proposals/mathesis-research-programme.adoc"}],"rivals":["dedukti-transport"],"size":"L","status":"open","summary":"Generate the Agda, Rocq and Lean forms of a statement from one source (Q-2.3, E-2.3), so a re-proof starts from a statement known to match.","track":"engineering","value":{"engineering":3,"maths":2,"publications":1}} {"evidence":[{"path":"docs/atlas/claims/bridges.jsonl"}],"glyph":"๐ŸŒ‰","id":"bridge-candidates","kind":"data","name":"Bridge candidates","needs":["claims-registry"],"size":"S","status":"done","summary":"Three unassessed candidate links between theorems in different repositories and provers (tropical MaxPlus, resource-algebra M-2, squeakwell). Candidates, not evidence.","track":"ecosystem","value":{"ecosystem":3,"maths":2}} {"counsel":{"cartographer":"The first real convergence between repositories; everything cross-repo waits on it.","maths":"Equivalence as identity, made checkable."},"glyph":"๐Ÿ”—","id":"bridge-lock-pilot","kind":"method","name":"Bridge lock pilot","needs":["bridge-candidates"],"refs":[{"at":"=== The lock","path":"docs/proposals/mathesis-re-anchoring.adoc"},{"at":"WO 5.2 Pilot the bridge lock","path":"docs/proposals/mathesis-re-anchoring.adoc"}],"size":"M","status":"open","summary":"The full bridge record for two pilots, a squeakwell ladder row and resource-algebra to tropical-types (WO 5.2, ruling D-7 a): what is claimed equal, by which map, checked how.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1}} diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 4c275cab..a546fa0d 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -102,15 +102,9 @@ function oneLine(v) { } // A description-list marker ("::", ":::", "::::" or ";;", then a blank or the // end) makes Asciidoctor read the line that holds it as a list term, wherever -// in the line it sits, so no prefix such as {empty} keeps it text. No text in -// the plan may hold one. +// in the line it sits. The ADR reader looks for one; the plan's own texts are +// escaped on the page (text(), below), so they can hold one harmlessly. const LIST_MARKER = /(?::{2,4}|;;)(?:[ \t]|$)/; -function noListMarker(v) { - if (typeof v === 'string') return !LIST_MARKER.test(v); - if (Array.isArray(v)) return v.every(noListMarker); - if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => !LIST_MARKER.test(k) && noListMarker(x)); - return true; -} export function readSource(text, name) { const rows = parseJsonl(text, name); @@ -118,7 +112,6 @@ export function readSource(text, name) { rows.forEach((r, i) => { if (!wellFormed(r)) throw new Error(`${name}: line ${i + 1} holds a lone surrogate or a Unicode noncharacter, which I-JSON refuses`); if (!oneLine(r)) throw new Error(`${name}: line ${i + 1} holds a control character; each text in the plan is one line`); - if (!noListMarker(r)) throw new Error(`${name}: line ${i + 1} holds a description-list marker (:: or ;; before a blank or the end), which would make its line of the page a list term`); if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); write it as ${jcs(r)}`); }); return rows; @@ -298,9 +291,9 @@ const evidenceError = (ev, ctx) => { try { return checkEvidence(ev, ctx); } catc // A ref into another repository names a full commit, so its content cannot // drift; it is not checked here. An issue ref names a GitHub issue or pull request. const REF_FIELDS = ['path', 'at', 'repo', 'commit', 'issue']; -// The page shows a quote verbatim in a literal code span, which a backtick, a -// plus or a backslash could end early. -const isQuote = s => isStr(s, 160) && !/[`+\\]/.test(s); +// A quote is plain text like any other, escaped on the page, so any one line of +// up to 160 characters can be quoted. +const isQuote = s => isStr(s, 160); // How often s occurs in text, overlaps counted: "aaaa" occurs twice in "aaaaa". const occurrences = (text, s) => { let k = 0; @@ -332,7 +325,7 @@ export function checkRef(r, ctx) { const kind = refKind(r); if (kind === 'issue') return REF.issue(r); if (!isRepoPath(r.path)) return `ref path ${JSON.stringify(r.path)} is not a repository path`; - if (r.at !== undefined && !isQuote(r.at)) return `ref at ${JSON.stringify(r.at)} is not a short quote without a backtick, plus or backslash`; + if (r.at !== undefined && !isQuote(r.at)) return `ref at ${JSON.stringify(r.at)} is not a short quote (one line of up to 160 characters, no blank at either end)`; return REF[kind](r, ctx); } const refError = (r, ctx) => { try { return checkRef(r, ctx); } catch (e) { return e.message; } }; @@ -583,19 +576,19 @@ export function derive(byId, advisors) { // โ”€โ”€ Rendering: AsciiDoc โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // The page is a list of sections; each section is a list of lines. -const cell = s => String(s).replaceAll('|', String.raw`\|`); -// A text that starts a line of the page (a node's summary) is read by AsciiDoc as -// block syntax if it looks like some: "|===" opens a table, "image::x[]" places an -// image, "//" makes a comment. "{empty}" (an attribute that is empty) in front makes -// the line a plain paragraph, whatever follows, and adds nothing to the text. -const lineStart = s => `{empty}${s}`; +// +// Every text in the plan is plain text (owner ruling 2026-11-25), and the page +// shows it exactly as written. AsciiDoc builds all its markup from ASCII +// punctuation, so text() writes each such character as a numeric character +// reference, which Asciidoctor shows as that character and never reads as +// markup. A text can then open no block, start no list or description list, +// end no table cell or link, form no span and name no attribute, wherever it +// stands: at the start of a line, in a table, in a heading or in a link's text. +// Letters, digits, blanks and every character beyond ASCII pass unchanged. +const text = s => String(s).replace(/[\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/g, c => `&#${c.charCodeAt(0)};`); const nameOf = (byId, id) => `${byId.get(id).glyph} ${byId.get(id).name}`; -// A link to a node, as the xref macro. Its text may hold anything but a few -// characters, written as character references so they mean the same everywhere, -// in a table or not: "|" (a table cell's end), "]" (the macro's end) and "=" -// (which makes the text an attribute list). "<>" cannot hold ">>". -const linkText = s => String(s).replaceAll('|', '|').replaceAll(']', ']').replaceAll('=', '='); -const xref = (byId, id) => `xref:${id}[${linkText(nameOf(byId, id))}]`; +// A link to a node, as the xref macro, with its text escaped like any other. +const xref = (byId, id) => `xref:${id}[${text(nameOf(byId, id))}]`; const xrefs = (byId, ids, sep = ', ') => ids.map(t => xref(byId, t)).join(sep); const orNone = (items, none) => (items.length ? items : [none]); const trackKey = t => `${TRACK_GLYPH[t]} ${t}`; @@ -631,7 +624,7 @@ function introLines(byId, d) { ]; } -const beyondNote = n => (n.where ? ` _(${cell(n.where)})_` : ''); +const beyondNote = n => (n.where ? ` _(${text(n.where)})_` : ''); const startable = d => (d.slots > 0 ? `${d.frontier.length} can be started now.` : `${d.frontier.length} are ready, but all ${ACTIVE_LIMIT} active slots are full.`); const slotsFull = `*All ${ACTIVE_LIMIT} active slots are full.* These nodes are ready, but none can start until an active node is finished or parked.`; function frontierLines(byId, d) { @@ -651,7 +644,7 @@ function frontierLines(byId, d) { '[cols="3,1,1,1,5",options="header"]', '|===', '|Node |Track |Size |Unlocks |Summary', - ...rows.map(n => `|${xref(byId, n.id)} |${n.track} |${n.size} |${d.leverage(n.id)} |${cell(n.summary)}${beyondNote(n)}`), + ...rows.map(n => `|${xref(byId, n.id)} |${n.track} |${n.size} |${d.leverage(n.id)} |${text(n.summary)}${beyondNote(n)}`), '|===', '', ]; @@ -660,7 +653,7 @@ function frontierLines(byId, d) { function pickLine(byId, a, p) { if (!p) return '_Pick:_ nothing on the frontier answers this advisor yet.'; const note = p.counsel?.[a.id]; - return `_Pick:_ ${xref(byId, p.id)}${note ? '. ' + note : '.'}`; + return `_Pick:_ ${xref(byId, p.id)}${note ? '. ' + text(note) : '.'}`; } // The me advisor's line: its choice is made privately, so the page shows only what the // owner tagged, unranked. @@ -676,7 +669,7 @@ function councilLines(byId, advisors, d) { 'except the me advisor. It is private: its notes and its choice stay outside this', 'repository, and the page lists, unranked, the frontier nodes the owner has tagged.', '', - ...advisors.flatMap(a => [`=== ${a.glyph} ${a.name}`, '', `_Asks:_ ${a.asks}`, '', a.private ? privateLine(byId, d) : pickLine(byId, a, d.picks.get(a.id)), '']), + ...advisors.flatMap(a => [`=== ${text(a.glyph)} ${text(a.name)}`, '', `_Asks:_ ${text(a.asks)}`, '', a.private ? privateLine(byId, d) : pickLine(byId, a, d.picks.get(a.id)), '']), ]; } @@ -701,46 +694,46 @@ function forkLines(byId, d) { } function evidenceText(ev) { - if (ev.path) return `\`${ev.path}\``; - if (ev.claim) return `${ev.claim} at ${ev.min_pwg ?? 'PWG-3'} or above`; + if (ev.path) return `\`${text(ev.path)}\``; + if (ev.claim) return `${text(ev.claim)} at ${ev.min_pwg ?? 'PWG-3'} or above`; return `ADR ${ev.adr} accepted`; } // A quote is shown verbatim, as a literal code span. function refText(r) { if (r.issue) { const [repo, number] = r.issue.split('#'); - return `https://github.com/${repo}/issues/${number}[${r.issue}]`; + return `https://github.com/${repo}/issues/${number}[${text(r.issue)}]`; } - const at = r.at === undefined ? '' : `, at \`+${r.at}+\``; - if (r.repo) return `https://github.com/${r.repo}/blob/${r.commit}/${r.path}[${r.repo}: ${r.path}] at \`${r.commit.slice(0, 12)}\`${at}`; - return `\`${r.path}\`${at}`; + const at = r.at === undefined ? '' : `, at \`${text(r.at)}\``; + if (r.repo) return `https://github.com/${r.repo}/blob/${r.commit}/${r.path}[${text(r.repo + ': ' + r.path)}] at \`${r.commit.slice(0, 12)}\`${at}`; + return `\`${text(r.path)}\`${at}`; } // Every mark the data holds is shown, a 0 as an open circle: a 0 is a judgement too. const marks = value => VALUE_KEYS.filter(k => Object.hasOwn(value, k)).map(k => `${k} ${'โ—'.repeat(value[k]) || 'โ—‹'}`).join(', '); function nodeLines(byId, advisors, d, n) { const facts = [`*Track:* ${trackKey(n.track)}`, `*Kind:* ${n.kind}`, `*Size:* ${n.size}`, `*Status:* ${n.status}`]; - if (n.where) facts.push(`*Beyond this repository:* ${n.where}`); + if (n.where) facts.push(`*Beyond this repository:* ${text(n.where)}`); const enables = d.children.get(n.id); // Each fact the node has, one a line, joined by hard line breaks. const details = [ [list(n.needs).length, () => `*Needs:* ${xrefs(byId, n.needs)}`], [enables.length, () => `*Enables:* ${xrefs(byId, enables)}`], [list(n.rivals).length, () => `*Rivals:* ${xrefs(byId, n.rivals)}`], - [n.status === 'blocked', () => `*Blocked by:* ${n.blocked_by}`], + [n.status === 'blocked', () => `*Blocked by:* ${text(n.blocked_by)}`], [list(n.evidence).length, () => `*Evidence:* ${n.evidence.map(evidenceText).join('; ')}`], [n.value && Object.keys(n.value).length, () => `*Value (judgement):* ${marks(n.value)}`], [list(n.refs).length, () => `*See:* ${n.refs.map(refText).join('; ')}`], ].filter(([has]) => has).map(([, text]) => text()); - const counsel = Object.entries(n.counsel ?? {}).map(([id, text]) => { + const counsel = Object.entries(n.counsel ?? {}).map(([id, words]) => { const adv = advisors.find(x => x.id === id); - return `* ${adv.glyph} _${adv.name}:_ ${text}`; + return `* ${text(adv.glyph)} _${text(adv.name)}:_ ${text(words)}`; }); return [ `[[${n.id}]]`, - `==== ${STATUS_GLYPH[n.status]} ${n.glyph} ${n.name}`, + `==== ${STATUS_GLYPH[n.status]} ${text(n.glyph)} ${text(n.name)}`, '', - lineStart(n.summary), + text(n.summary), '', facts.join(' ยท '), '', @@ -766,7 +759,7 @@ function eraLines(byId, advisors, d) { function outcomeText(byId, x) { if (x.status === 'out') return '๐ŸŽ’ out'; if (x.status === 'grafted') return `๐ŸŒฟ grafted as ${xref(byId, x.graft)}`; - return `๐Ÿ“ฆ archived: ${cell(x.lesson)}`; + return `๐Ÿ“ฆ archived: ${text(x.lesson)}`; } function ticketLines(byId, expeditions) { const head = [ @@ -782,7 +775,7 @@ function ticketLines(byId, expeditions) { '[cols="1,1,1,3,3,3",options="header"]', '|===', '|Card |Date |Size |What |Why |Outcome', - ...expeditions.map(x => `|${x.id} |${x.date} |${x.size} |${cell(x.what)} |${cell(x.why)} |${outcomeText(byId, x)}`), + ...expeditions.map(x => `|${text(x.id)} |${text(x.date)} |${x.size} |${text(x.what)} |${text(x.why)} |${outcomeText(byId, x)}`), '|===', '', ]; @@ -796,7 +789,7 @@ function beyondLines(byId) { 'Nodes whose work lands in another repository. They are listed here so they can be', 'carried to that repository, not done here.', '', - ...orNone(beyond.map(n => `* ${n.where}: ${xref(byId, n.id)} (${n.status})`), 'None.'), + ...orNone(beyond.map(n => `* ${text(n.where)}: ${xref(byId, n.id)} (${n.status})`), 'None.'), '', ]; } diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 80605adc..13b8a692 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -46,6 +46,10 @@ function fixture({advisors = ADVISORS, nodes = BASE, expeditions = [], registry writeFileSync(path.join(root, 'docs/ultraplan/expeditions.jsonl'), raw.expeditions ?? jl(expeditions)); return root; } +// The page shows each text as written: every ASCII punctuation mark in it is a +// numeric character reference (the rule, stated here apart from the generator). +const PUNCTUATION = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'; +const plainOnPage = t => [...t].map(c => (PUNCTUATION.includes(c) ? `&#${c.charCodeAt(0)};` : c)).join(''); const refuses = (opts, re) => expect(() => generate(fixture(opts))).toThrow(re); // Replace fields of one node; a field set to undefined is removed. const strip = o => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined)); @@ -65,7 +69,7 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', expect(d.picks.get('me')).toBe(null); // no public pick (owner ruling 2026-11-24) expect(d.ownerTagged.map(n => n.id)).toEqual(['theorem']); // tagged owner_value, no notes expect(out[VIEW]).toContain('== Research now: the frontier'); - expect(out[VIEW]).toContain('_Pick:_ xref:theorem[๐Ÿ”ท theorem]. The deep one.'); + expect(out[VIEW]).toContain(`_Pick:_ xref:theorem[๐Ÿ”ท theorem]. ${plainOnPage('The deep one.')}`); expect(out[VIEW]).toContain('_No public pick:_ the owner chooses in a private panel of their own. Tagged on the frontier, in id order: xref:theorem[๐Ÿ”ท theorem].'); expect(out[SVG].startsWith(''); @@ -81,9 +85,9 @@ test('derives eras, the frontier, forks, confluences and each advisor\'s pick', test('a link to a node holds any name', () => { // `<>` ends at ">>"; the xref macro's text ends at "]", turns into attributes at "=", - // and a table cell ends at "|". Those three are character references, so the link text is the name. + // and a table cell ends at "|". Every one is a character reference, so the link text is the name. const page = generate(fixture({nodes: swap('theorem', {name: 'a >> b = c ] d | e'})}))[VIEW]; - expect(page).toContain('xref:theorem[๐Ÿ”ท a >> b = c ] d | e]'); + expect(page).toContain('xref:theorem[๐Ÿ”ท a >> b = c ] d | e]'); expect(page).not.toContain('< { refuses({raw: {nodes: [ckey, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a control character/); }); -// Asciidoctor 2.0.26 reads a line that holds "::", ":::", "::::" or ";;" before a -// blank or the end as a description-list term, wherever the marker sits, and a -// prefix such as {empty} does not stop it. So no text in the plan may hold one. -test('a description-list marker in any text is refused', () => { - const withRoot = extra => [jcs({...BASE[0], ...extra}), ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'; - for (const s of ['The lock:: and more', 'The lock;; and more', 'The lock::', ':: at the start', 'a ::: b', 'a:::: b']) - refuses({raw: {nodes: withRoot({summary: s})}}, /line 1 holds a description-list marker/); - refuses({raw: {nodes: withRoot({counsel: {maths: 'Deep;; really'}})}}, /line 1 holds a description-list marker/); - refuses({raw: {nodes: withRoot({refs: [{at: 'Fixture::', path: 'README.adoc'}]})}}, /line 1 holds a description-list marker/); - const mkey = jcs({...BASE[0], value: {maths: 1}}).replace('"maths":', '"m:: aths":'); - refuses({raw: {nodes: [mkey, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a description-list marker/); - // "::" with no blank after it marks nothing: a macro name or a URL stays text. - for (const s of ['image::x.svg[]', 'a::b', 'See https://example.org/a::b']) - expect(() => generate(fixture({nodes: swap('cheap', {summary: s})}))).not.toThrow(); +// Every text is plain (owner ruling 2026-11-25). A description-list marker, which +// Asciidoctor 2.0.26 reads as a list term wherever it stands in a line, is +// accepted like any other characters and shown as written. +test('a text holding list or block syntax is shown as written', () => { + for (const s of ['The lock:: and more', 'The lock;; and more', 'The lock::', ':: at the start', 'a ::: b', 'NOTE: x', '{nbsp} and {empty}']) { + const page = generate(fixture({nodes: swap('cheap', {summary: s, counsel: {maths: s}, name: s.slice(0, 80)})}))[VIEW]; + expect(page).toContain(plainOnPage(s)); + for (const line of page.split('\n')) expect(line.includes(s)).toBe(false); + } }); test('a ref points at one place, and each ref in this repository is checked', () => { @@ -271,9 +270,15 @@ test('a ref points at one place, and each ref in this repository is checked', () const shown = page([{path: 'README.adoc'}, {path: 'docs/decisions'}, {at: '= Fixture', path: 'README.adoc'}, {issue: 'metadatastician/standards#1705'}, {at: '== 5. Status vocabulary', commit: 'a'.repeat(40), path: '3-practice/PROOF-POLICY.adoc', repo: 'metadatastician/standards'}]); - expect(shown).toContain('*See:* `README.adoc`; `docs/decisions`; `README.adoc`, at `+= Fixture+`; ' - + 'https://github.com/metadatastician/standards/issues/1705[metadatastician/standards#1705]; ' - + `https://github.com/metadatastician/standards/blob/${'a'.repeat(40)}/3-practice/PROOF-POLICY.adoc[metadatastician/standards: 3-practice/PROOF-POLICY.adoc] at \`aaaaaaaaaaaa\`, at \`+== 5. Status vocabulary+\``); + const P = plainOnPage; + expect(shown).toContain(`*See:* \`${P('README.adoc')}\`; \`${P('docs/decisions')}\`; \`${P('README.adoc')}\`, at \`${P('= Fixture')}\`; ` + + `https://github.com/metadatastician/standards/issues/1705[${P('metadatastician/standards#1705')}]; ` + + `https://github.com/metadatastician/standards/blob/${'a'.repeat(40)}/3-practice/PROOF-POLICY.adoc[${P('metadatastician/standards: 3-practice/PROOF-POLICY.adoc')}] at \`aaaaaaaaaaaa\`, at \`${P('== 5. Status vocabulary')}\``); + // A quote may hold any characters of one line, a backtick, plus or backslash among them. + const odd = 'a `tick` + back\\slash'; + const oddRoot = fixture({nodes: swap('paper', {refs: [{at: odd, path: 'notes.adoc'}]})}); + writeFileSync(path.join(oddRoot, 'notes.adoc'), `${odd}\n`); + expect(generate(oddRoot)[VIEW]).toContain(`at \`${P(odd)}\``); // A quote that is gone, or that occurs more than once, names no one place. refused([{at: 'Gone', path: 'README.adoc'}], /node paper: ref README\.adoc holds "Gone" 0 times; a ref quotes a passage that occurs exactly once/); refused([{at: 'at', path: 'docs/decisions/0004-claims-registry.adoc'}], /holds "at" [2-9] times/); @@ -281,7 +286,7 @@ test('a ref points at one place, and each ref in this repository is checked', () refused([{path: 'missing.adoc'}], /node paper: ref path missing\.adoc is not in the repository/); refused([{at: 'x', path: 'docs/decisions'}], /ref path docs\/decisions is not a file in the repository/); for (const p of ['../outside', '/etc/passwd', 'a/./b', 'a b', '']) refused([{path: p}], /is not a repository path/); - for (const q of ['with `code`', 'a + b', 'back\\slash', ' padded', 'x'.repeat(161)]) refused([{at: q, path: 'README.adoc'}], /is not a short quote/); + for (const q of [' padded', 'x'.repeat(161), '']) refused([{at: q, path: 'README.adoc'}], /is not a short quote/); refused([{at: 'x', commit: '745fc74', path: 'a.adoc', repo: 'o/r'}], /ref commit "745fc74" is not a full commit id/); refused([{commit: 'a'.repeat(40), path: 'a.adoc', repo: 'nobody'}], /ref repo "nobody" is not OWNER\/REPO/); refused([{commit: 'a'.repeat(40), path: 'a.adoc'}], /ref repo undefined is not OWNER\/REPO/); @@ -390,10 +395,10 @@ test('a summary that looks like block syntax is text on the page', () => { const bare = (lines, s) => lines.filter(l => l === s).length; for (const s of ['|===', 'image::missing.svg[]', '// a comment', 'include::x.adoc[]', '== heading', '* item']) { const page = generate(fixture({nodes: swap('cheap', {summary: s})}))[VIEW].split('\n'); - expect(page).toContain(`{empty}${s}`); + expect(page).toContain(plainOnPage(s)); expect(bare(page, s)).toBe(bare(base, s)); // the summary adds no line of its own syntax } - for (const n of BASE) expect(base).toContain(`{empty}${n.summary}`); + for (const n of BASE) expect(base).toContain(plainOnPage(n.summary)); }); // Every rule in the generator's rule tables has a witness: a change to the sound @@ -480,7 +485,11 @@ test('ids are slugs and unique, and counsel comes from the council', () => { test('return tickets are grafted or archived honestly', () => { const x = {id: 'X-001', what: 'A trip', why: 'Because', size: 'S', date: '2026-11-24', status: 'out'}; - expect(generate(fixture({expeditions: [x]}))[VIEW]).toContain('|X-001 |2026-11-24 |S |A trip |Because |๐ŸŽ’ out'); + expect(generate(fixture({expeditions: [x]}))[VIEW]).toContain(`|${plainOnPage('X-001')} |${plainOnPage('2026-11-24')} |S |A trip |Because |๐ŸŽ’ out`); + // A ticket's texts sit in table cells, so a "|" in one would end its cell: each is escaped. + const odd = {...x, what: 'Try | this: *now*', why: 'Since [a] = b', status: 'archived', lesson: 'It taught | much'}; + expect(generate(fixture({expeditions: [odd]}))[VIEW]).toContain( + `|${plainOnPage(odd.what)} |${plainOnPage(odd.why)} |๐Ÿ“ฆ archived: ${plainOnPage(odd.lesson)}`); refuses({expeditions: [{...x, status: 'grafted', graft: 'ghost'}]}, /names the node it became/); refuses({expeditions: [{...x, status: 'archived'}]}, /records what it taught/); refuses({expeditions: [x, {...x}]}, /id is X-NNN and unique/); From cb15753afe1d1e61f2f1f69deaaee504a293818d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 11:08:44 +0000 Subject: [PATCH 30/41] decisions: an ADR states its status in its header, in step with its prose The owner ruled on 2026-11-25, through the selector, that an ADR's status becomes a header attribute, kept in step with its Status section. The attribute uses the words the ADR template already gives (docs/decisions/0001-template.adoc, which came with the RSR template): PROPOSED, ACCEPTED, DEPRECATED and SUPERSEDED (by NNNN), plus REJECTED from 0000-template.adoc. That template already wrote `:status: ACCEPTED` in its header, so this follows the estate's convention rather than inventing one. - Records 0001 to 0004 now hold `:status: ACCEPTED` and 0005 `:status: PROPOSED`, each matching what its Status section already says. 0000-template holds `:status: PROPOSED`, so a new record starts with the convention. 0006 states no status anywhere and is left as it is: setting it is the owner's. - The ADR reading moves out of the ultraplan into scripts/decisions/adr-status.mjs. - sectionStatus is the over-counting Status-section reader, moved unchanged except that it returns the section's opening word. - headerStatus reads the header strictly. The title comes after any comments. Each header line is a comment or an attribute entry, with no continuation. Exactly one line in the whole file sets or unsets status, inside the header. No preprocessor directive or {set:...} appears anywhere. The value is one of the template's words, written exactly. - adrAccepted holds only when the header says ACCEPTED and the section agrees. - `just adr-check`, part of check-views, fails when a record's header and section disagree or only one states a status. It lists a record that states neither (today 0006), for the owner. - The ultraplan's ADR evidence now names which part fails: no header status, out of step, or a status other than ACCEPTED. Soundness was checked against Asciidoctor 2.0.26. - The header reader ran on 40,329 variants of prefix, title, header lines, status line, continuation and body (later entries, unsets, inline sets, conditionals, comment blocks). It never named a status Asciidoctor does not set: 0 unsound, 10,066 refused. A naive reader that takes the first `:status:` line is unsound on 28,960 of them. - On every file in docs/decisions it reads exactly what Asciidoctor reads. - The moved section reader still has 0 unsound of the 124,800 corpus variants and the 43 probes. Tests: - 172 pass across 11 files, the section reader's tests among them in tests/decisions/adr-status.test.mjs. - A mutation sweep killed every mutant that applies: 90 in the generator and 49 in the new module. The case that killed the last survivor is an include in the body, since an included file could set the status. - eslint-plugin-sonarjs reports nothing. - Asciidoctor renders every changed document at WARN, the edited ADRs among them. - just adr-check, ultraplan-check, check-views, site-check and site-test pass. The I-JSON gate finds 26 of 26 files canonical. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 8 +- Justfile | 9 +- docs/decisions/0000-template.adoc | 1 + docs/decisions/0001-adopt-rsr-standard.adoc | 1 + docs/decisions/0002-variant-contract.adoc | 1 + .../0003-forge-and-sustain-lifecycle.adoc | 1 + docs/decisions/0004-claims-registry.adoc | 1 + docs/decisions/0005-jcs-json-receipt.adoc | 1 + docs/decisions/README.adoc | 48 ++++ docs/ultraplan/README.adoc | 11 +- scripts/decisions/adr-status.mjs | 191 ++++++++++++++++ scripts/ultraplan/ultraplan.mjs | 100 +-------- tests/decisions/adr-status.test.mjs | 211 ++++++++++++++++++ tests/ultraplan/ultraplan.test.mjs | 122 ++-------- 14 files changed, 498 insertions(+), 208 deletions(-) create mode 100644 scripts/decisions/adr-status.mjs create mode 100644 tests/decisions/adr-status.test.mjs diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 74b83724..e00e375a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -85,10 +85,10 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. + The generator refuses: ** a done node without evidence that holds: a file, a claim grade the - registry derives, or an accepted ADR. The ADR reader over-counts: every - line that could be a Status heading counts, inside a block or not, and - the ADR is read only when exactly one does, a plain section whose first - paragraph begins "Accepted"; + registry derives, or an accepted ADR. An ADR is accepted only when its + header states `:status: ACCEPTED` and its Status section agrees (owner + ruling 2026-11-25), each read by `scripts/decisions/adr-status.mjs` so + that it never finds a status Asciidoctor would not; ** a done node whose needs are not done; ** a cycle; ** more than three active nodes; diff --git a/Justfile b/Justfile index 8e3d8f5a..c4737a98 100644 --- a/Justfile +++ b/Justfile @@ -712,7 +712,7 @@ check: check-views site-check check-proofs receipt-check # Needs bun, network for the receipts, and MATHESIS_STANDARDS (see `registry`). # Views current: catalogue, census tests, atlas, claims registry, bridges and # the worked cohort examples -check-views: catalogue-check census-test atlas-check registry-check applied-check ultraplan-check +check-views: catalogue-check census-test atlas-check registry-check applied-check ultraplan-check adr-check # Needs agda, coqc and lean, e.g. in the pinned Guix: # guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- just check-proofs @@ -810,6 +810,13 @@ ultraplan-check: registry-check bun scripts/ultraplan/ultraplan.mjs check bun test tests/ultraplan/ +# Fail if a decision record's header status (`:status:`) and its Status section +# disagree, or only one of them states a status (owner ruling 2026-11-25). A +# record that states neither is listed, for the owner to set. +adr-check: + bun scripts/decisions/adr-status.mjs check + bun test tests/decisions/ + # โ”€โ”€ mathesis: static site of the generated views (re-anchoring plan WO 4.3) โ”€โ”€ # Build the site into OUT (default: a fresh temp dir; never a tracked path). diff --git a/docs/decisions/0000-template.adoc b/docs/decisions/0000-template.adoc index 0345028b..b5ecdfc9 100644 --- a/docs/decisions/0000-template.adoc +++ b/docs/decisions/0000-template.adoc @@ -1,6 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0000-template +:status: PROPOSED // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <6759885+hyperpolymath@users.noreply.github.com> diff --git a/docs/decisions/0001-adopt-rsr-standard.adoc b/docs/decisions/0001-adopt-rsr-standard.adoc index 80ce7d60..bec4f972 100644 --- a/docs/decisions/0001-adopt-rsr-standard.adoc +++ b/docs/decisions/0001-adopt-rsr-standard.adoc @@ -1,6 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0001-adopt-rsr-standard +:status: ACCEPTED // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <6759885+hyperpolymath@users.noreply.github.com> diff --git a/docs/decisions/0002-variant-contract.adoc b/docs/decisions/0002-variant-contract.adoc index 80e16742..2a1bacfb 100644 --- a/docs/decisions/0002-variant-contract.adoc +++ b/docs/decisions/0002-variant-contract.adoc @@ -1,6 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0002-variant-contract +:status: ACCEPTED NOTE: Superseded in part (2026-10-06, rsr-template-repo#209): the `.a2ml` files named below no longer exist; their facts are clauses of the repo deed (`*_chora.deed`). The variant contract is the `(variant)` clause that `just repo-init` writes into a minted child's deed. diff --git a/docs/decisions/0003-forge-and-sustain-lifecycle.adoc b/docs/decisions/0003-forge-and-sustain-lifecycle.adoc index 540fffce..7a00174e 100644 --- a/docs/decisions/0003-forge-and-sustain-lifecycle.adoc +++ b/docs/decisions/0003-forge-and-sustain-lifecycle.adoc @@ -1,6 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0003-forge-and-sustain-lifecycle +:status: ACCEPTED NOTE: Superseded in part (2026-10-06, rsr-template-repo#209): the `.a2ml` files named below no longer exist; their facts are clauses of the repo deed (`*_chora.deed`). `just repo-init` writes the `(rsr-profile)`, `(variant)` and `(provenance)` clauses into a minted child's deed, and an archetype is `archetypes//_praxis.deed`. diff --git a/docs/decisions/0004-claims-registry.adoc b/docs/decisions/0004-claims-registry.adoc index eed4286f..0e10f04e 100644 --- a/docs/decisions/0004-claims-registry.adoc +++ b/docs/decisions/0004-claims-registry.adoc @@ -1,6 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0004-claims-registry +:status: ACCEPTED == 4. A theorem-level claims registry that derives grades and never assigns them diff --git a/docs/decisions/0005-jcs-json-receipt.adoc b/docs/decisions/0005-jcs-json-receipt.adoc index 17fdb208..5c3f76ac 100644 --- a/docs/decisions/0005-jcs-json-receipt.adoc +++ b/docs/decisions/0005-jcs-json-receipt.adoc @@ -1,6 +1,7 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = Architecture Decision Record: 0005-jcs-json-receipt +:status: PROPOSED == 5. The claims registry also reads a proof receipt written as canonical JCS I-JSON diff --git a/docs/decisions/README.adoc b/docs/decisions/README.adoc index cb9c6d84..22b5aa24 100644 --- a/docs/decisions/README.adoc +++ b/docs/decisions/README.adoc @@ -1,3 +1,51 @@ // SPDX-License-Identifier: CC-BY-SA-4.0 // Copyright (c) Jonathan D.A. Jewell = decisions Unit + +== The status of a decision record + +Each decision record (`NNNN-title.adoc`) states its status twice, and the two +must agree (owner ruling 2026-11-25): + +* once in its document header, as the attribute `:status:`, on a line of the +header (the title line and the lines after it, up to the first blank line); +* once in its prose, as the first word of its Status section. + +The header uses the words of the ADR template (`0001-template.adoc`, with +REJECTED from `0000-template.adoc`), written exactly so: `PROPOSED`, `ACCEPTED`, +`DEPRECATED`, `SUPERSEDED by NNNN` or `REJECTED`. The Status section may write +the word in any case and add what it likes after it, such as "*Accepted +(ratified by owner 2026-11-10).*". + +[source,asciidoc] +---- += Architecture Decision Record: 0004-claims-registry +:status: ACCEPTED + +== 4. A theorem-level claims registry ... + +=== Status + +*Accepted (ratified by owner 2026-11-10).* ... +---- + +`just adr-check` (part of `just check-views`) runs +`scripts/decisions/adr-status.mjs check`. It fails when a record's header and +Status section disagree, or when only one of them states a status. A record that +states neither is listed, for the owner to set; it does not count as accepted. + +Both are read conservatively, so the reader never finds a status Asciidoctor +would not: + +* The header is the title line, after any blank lines and line comments, and +the lines up to the first blank line. Each of those lines is a line comment or +an attribute entry, and none ends in a continuation. Exactly one line in the +whole record sets or unsets `status`, and it is in the header. A preprocessor +directive or an inline `{set:...}` anywhere leaves the header unread. +* In the Status section, every line that could be a heading titled Status counts, +inside a block or not. The section is read only when exactly one does, and that +one is a plain section heading (`==` to `======`, then `Status`) whose first +paragraph opens with the word. + +Only a record whose header says ACCEPTED, with a Status section that agrees, can +stand as evidence in the ultraplan. diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 177ba5cf..be0db91f 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -58,12 +58,11 @@ accepts a file that exists, a claim whose grade the registry view derives at or above a stated grade, or a decision record whose status is Accepted. A done node's needs must be done too. + -The decision record is read conservatively, so the reader never finds an -Accepted that Asciidoctor would not. Every line that could be a heading titled -Status counts, inside a block or not. The record is read only when exactly one -does, and that one is a plain section heading (`==` to `======`, then `Status`) -whose first paragraph begins "Accepted". Anything it cannot read plainly, such -as a preprocessor directive or an underlined title, is refused. +A decision record counts only when it states its status twice, in agreement +(owner ruling 2026-11-25). Its header must hold `:status: ACCEPTED`, and its +Status section must open with the same word. `scripts/decisions/adr-status.mjs` +reads both conservatively, so it never finds a status that Asciidoctor would +not; `docs/decisions/README.adoc` sets out the rules. * *Active* is limited: at most three nodes may be active at once. To start a fourth, finish or park one first. This is the guard against starting everything. When every slot is taken, the page and the picture still show the frontier, and diff --git a/scripts/decisions/adr-status.mjs b/scripts/decisions/adr-status.mjs new file mode 100644 index 00000000..2725ff69 --- /dev/null +++ b/scripts/decisions/adr-status.mjs @@ -0,0 +1,191 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// The status of a decision record (ADR), read soundly. +// +// bun scripts/decisions/adr-status.mjs check every ADR's header and Status section agree +// +// An ADR states its status twice (owner ruling 2026-11-25): once as an +// attribute of its document header, `:status: ACCEPTED`, in the words of the +// estate's ADR template (docs/decisions/0001-template.adoc: PROPOSED, +// ACCEPTED, DEPRECATED, SUPERSEDED, and REJECTED from 0000-template.adoc), +// and once in its prose, as the opening word of its Status section. The header +// is what a machine reads; the section is what a person reads; `check` keeps +// the two in step. An ADR counts as ACCEPTED only when both say so. +import {readdirSync, readFileSync, lstatSync} from 'node:fs'; +import path from 'node:path'; + +export const ROOT = path.resolve(import.meta.dir, '../..'); +export const DECISIONS = 'docs/decisions'; + +// A description-list marker ("::", ":::", "::::" or ";;", then a blank or the +// end) makes Asciidoctor read the line that holds it as a list term, wherever +// in the line it sits. +const LIST_MARKER = /(?::{2,4}|;;)(?:[ \t]|$)/; + +// โ”€โ”€ The Status section โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// The word an ADR's Status section opens with, as AsciiDoc reads it, or null. +// It must never name a word where Asciidoctor finds no such section. So it does +// not try to mirror every way Asciidoctor reads a heading: it over-counts, and +// it reads one plain shape only (it fails closed). +// - Every line that could be a heading titled Status counts, inside a block or +// not: "=" or "#" markers and a blank, then a title that holds the letters +// "status" in any case, or a reference that could spell them. An ADR with a +// count other than one is not read. +// - That one line is "==" to "======", one space and "Status"; it is outside any +// delimited block; and it follows a blank line, with nothing above it, across +// blank lines and comments, that attaches it to what came before: a block +// attribute line, a block title, a list continuation or a description-list term. +// - The first line after it, past blank lines and comments, is text that begins +// with a word, after any "*": not indented, and holding no description-list marker. +// - No text line stands over an underline ("-", "=", "~", "^" or "+" repeated) +// of about its length: Asciidoctor reads such a pair as a section title. +// - A preprocessor directive could change which lines count, so an ADR that +// holds one is not read. +// A delimiter is one of these characters four or more times, "--", or a table's "|===". +// It closes on the same line again. +const DELIMITER = /^(?:([/\-.+*=_])\1{3,}|--|[|,:!]={3,})$/; +// A Markdown fence, which Asciidoctor reads too: three backticks open it, with +// any language after them but never a fourth backtick, and only a line of +// exactly three backticks closes it. "````" and "~~~" delimit nothing. +const FENCE = /^```(?!`)/; +const opener = l => { + if (DELIMITER.test(l)) return l; + return FENCE.test(l) ? '```' : null; +}; +const PREPROCESSOR = /^(?:ifdef|ifndef|ifeval|endif|include)::/; +// "//" begins a line comment, but "///" begins text. +const COMMENT = /^\/\/(?!\/)/; +// What each line is: inside a delimited block or one of its delimiters +// ('block'), part of a comment, which AsciiDoc drops ('comment'), or text. +const kindOf = (l, block) => { + if (block) return block.startsWith('//') ? 'comment' : 'block'; + return COMMENT.test(l) ? 'comment' : 'text'; +}; +function lineKinds(lines) { + let open = null; + return lines.map(l => { + const block = open ?? opener(l); + const closes = open !== null && l === open; + open = closes ? null : block; + return kindOf(l, block); + }); +} +// A heading in any form AsciiDoc or Markdown gives one: its markers and a blank, +// then a title that could read "Status". The title is the rest of the line, taken +// whole, so the pattern cannot backtrack and no character of the title escapes it. +const HEADING = /^[=#]+[ \t]/; +const mayBeStatus = l => { + const m = HEADING.exec(l); + if (m === null) return false; + const title = l.slice(m[0].length); + return /\{|&#?\w+;/.test(title) || /status/i.test(title.replace(/[^\p{L}]/gu, '')); +}; +// Asciidoctor reads a line over an underline within one character of its +// length as a two-line section title; two characters are allowed here. +const UNDERLINE = /^([-=~^+])\1+$/; +const width = s => [...s].length; +const overUnderline = (lines, kinds, i) => kinds[i] === 'text' && lines[i] !== '' && UNDERLINE.test(lines[i + 1] ?? '') + && Math.abs(width(lines[i + 1]) - width(lines[i])) <= 2; +// What, standing above a heading across blank lines and comments, attaches the +// heading to it: a block attribute line, a block title, a list continuation or +// a description-list term. +const ATTACHES = /^(?:\[.*\]|\.[^.\s].*|\+)$|(?::{2,4}|;;)(?:[ \t]|$)/; +function startsSection(lines, kinds, i) { + if (i > 0 && lines[i - 1] !== '') return false; + let j = i - 1; + while (j >= 0 && (lines[j] === '' || kinds[j] === 'comment')) j--; + return j < 0 || !ATTACHES.test(lines[j]); +} +const linesOf = text => text.split('\n').map(l => l.trimEnd()); +export function sectionStatus(text) { + const lines = linesOf(text); + if (lines.some(l => PREPROCESSOR.test(l))) return null; + const kinds = lineKinds(lines); + if (lines.some((_, i) => overUnderline(lines, kinds, i))) return null; + const heads = lines.flatMap((l, i) => (mayBeStatus(l) ? [i] : [])); + if (heads.length !== 1) return null; + const [h] = heads; + if (kinds[h] !== 'text' || !/^={2,6} Status$/.test(lines[h]) || !startsSection(lines, kinds, h)) return null; + // The heading is text, so the line after it is text too, unless it opens a + // block, and no delimiter that opens one begins with a letter. + const n = lines.findIndex((l, i) => i > h && l !== '' && kinds[i] !== 'comment'); + const word = n > h && !LIST_MARKER.test(lines[n]) ? /^\**([A-Za-z]+)\b/.exec(lines[n]) : null; + return word ? word[1].toUpperCase() : null; +} + +// โ”€โ”€ The header attribute โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// The status an ADR's document header states, or null. The header is the title +// line ("= Title"), after any blank lines and line comments, and the lines that +// follow it up to the first blank line. Read strictly, so it never names a +// status Asciidoctor would not set: +// - Each header line after the title is a line comment or an attribute entry, +// and none ends in a continuation ("\" or "+"). An author or revision line, +// or a comment block, could change what the header holds, so it is refused. +// - Exactly one line in the whole file sets or unsets "status", and it is in +// the header. Nothing later (":status:", ":status!:", ":!status:", or an +// inline "{set:...}") can change it. +// - Its value is one of the template's words: PROPOSED, ACCEPTED, DEPRECATED, +// SUPERSEDED (optionally "by NNNN") or REJECTED, written exactly so. +const ENTRY = /^:!?[\w-]+!?:(?: |$)/; +const STATUS_ENTRY = /^:!?status!?:/; +const STATUS_VALUE = /^:status: (PROPOSED|ACCEPTED|DEPRECATED|SUPERSEDED(?: by \d{4})?|REJECTED)$/; +function headerRange(lines) { + let t = 0; + while (t < lines.length && (lines[t] === '' || COMMENT.test(lines[t]))) t++; + if (!/^= \S/.test(lines[t] ?? '')) return null; + let end = t + 1; + while (end < lines.length && lines[end] !== '') end++; + const body = lines.slice(t + 1, end); + const plain = body.every(l => (COMMENT.test(l) || ENTRY.test(l)) && !/[\\+]$/.test(l)); + return plain ? [t, end] : null; +} +export function headerStatus(text) { + const lines = linesOf(text); + if (lines.some(l => PREPROCESSOR.test(l) || l.includes('{set:'))) return null; + const range = headerRange(lines); + if (range === null) return null; + const entries = lines.flatMap((l, i) => (STATUS_ENTRY.test(l) ? [i] : [])); + if (entries.length !== 1 || entries[0] <= range[0] || entries[0] >= range[1]) return null; + const m = STATUS_VALUE.exec(lines[entries[0]]); + return m ? m[1] : null; +} + +// โ”€โ”€ Both, in step โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// The header's status, the section's opening word, and whether they agree (the +// section names the header's first word: "SUPERSEDED by 0007" agrees with a +// section opening "Superseded"). +export function adrStatus(text) { + const header = headerStatus(text), section = sectionStatus(text); + return {header, section, inStep: header !== null && header.split(' ')[0] === section}; +} +export const adrAccepted = text => { + const s = adrStatus(text); + return s.inStep && s.header === 'ACCEPTED'; +}; + +// โ”€โ”€ The check โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// Every decision record, NNNN-title.adoc with the boilerplate NNNN-template.adoc +// set aside, states its status in both places and they agree; or it states it in +// neither (a status the owner has yet to set), which is reported, not refused. +export function checkDecisions(root = ROOT) { + const dir = path.join(root, DECISIONS); + const files = readdirSync(dir).filter(f => /^\d{4}-.+\.adoc$/.test(f) && !/^\d{4}-template\.adoc$/.test(f)).sort(); + return files.map(f => { + const p = path.join(dir, f); + if (!lstatSync(p).isFile()) return {file: f, problem: 'is not a plain file'}; + const s = adrStatus(readFileSync(p, 'utf8')); + if (s.inStep) return {file: f, status: s.header}; + if (s.header === null && s.section === null) return {file: f, status: null}; + return {file: f, problem: `its header says ${s.header ?? 'nothing readable'} but its Status section says ${s.section ?? 'nothing readable'}`}; + }); +} + +if (import.meta.main) { + if (process.argv[2] !== 'check') { console.error('usage: adr-status.mjs check'); process.exit(2); } + const results = checkDecisions(); + for (const r of results) console.log(`${r.problem ? 'FAIL' : 'ok '} ${r.file}: ${r.problem ?? r.status ?? 'no status stated (the owner sets it)'}`); + const failed = results.filter(r => r.problem); + if (failed.length) { console.error(`adr-status: FAIL: ${failed.length} decision record(s) out of step`); process.exit(1); } + console.log(`PASS: ${results.length} decision records; each states its status in step, or states none`); +} diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index a546fa0d..df409af8 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -32,6 +32,7 @@ import path from 'node:path'; import {parseJsonl} from '../atlas/census-atlas.mjs'; import {jcs} from '../registry/theory-ledger.mjs'; import {isClaimId, isDocPath} from '../registry/claims-registry.mjs'; +import {adrStatus} from '../decisions/adr-status.mjs'; export const ROOT = path.resolve(import.meta.dir, '../..'); export const DIR = 'docs/ultraplan'; @@ -100,11 +101,6 @@ function oneLine(v) { if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => !hasControl(k) && oneLine(x)); return true; } -// A description-list marker ("::", ":::", "::::" or ";;", then a blank or the -// end) makes Asciidoctor read the line that holds it as a list term, wherever -// in the line it sits. The ADR reader looks for one; the plan's own texts are -// escaped on the page (text(), below), so they can hold one harmlessly. -const LIST_MARKER = /(?::{2,4}|;;)(?:[ \t]|$)/; export function readSource(text, name) { const rows = parseJsonl(text, name); @@ -153,94 +149,6 @@ export function registryGrade(registryText, id) { return null; } -// Whether an ADR's Status section opens with "Accepted", as AsciiDoc reads it. -// It must never say yes where Asciidoctor finds no such section. So it does not -// try to mirror every way Asciidoctor reads a heading: it over-counts, and it -// accepts one plain shape only (it fails closed). -// - Every line that could be a heading titled Status counts, inside a block or -// not: "=" or "#" markers and a blank, then a title that holds the letters -// "status" in any case, or a reference that could spell them. An ADR with a -// count other than one is not read. -// - That one line is "==" to "======", one space and "Status"; it is outside any -// delimited block; and it follows a blank line, with nothing above it, across -// blank lines and comments, that attaches it to what came before: a block -// attribute line, a block title, a list continuation or a description-list term. -// - The first line after it, past blank lines and comments, is text that begins -// "Accepted": not indented, and holding no description-list marker. -// - No text line stands over an underline ("-", "=", "~", "^" or "+" repeated) -// of about its length: Asciidoctor reads such a pair as a section title. -// - A preprocessor directive could change which lines count, so an ADR that -// holds one is not read. -// A delimiter is one of these characters four or more times, "--", or a table's "|===". -// It closes on the same line again. -const DELIMITER = /^(?:([/\-.+*=_])\1{3,}|--|[|,:!]={3,})$/; -// A Markdown fence, which Asciidoctor reads too: three backticks open it, with -// any language after them but never a fourth backtick, and only a line of -// exactly three backticks closes it. "````" and "~~~" delimit nothing. -const FENCE = /^```(?!`)/; -const opener = l => { - if (DELIMITER.test(l)) return l; - return FENCE.test(l) ? '```' : null; -}; -const PREPROCESSOR = /^(?:ifdef|ifndef|ifeval|endif|include)::/; -// "//" begins a line comment, but "///" begins text. -const COMMENT = /^\/\/(?!\/)/; -// What each line is: inside a delimited block or one of its delimiters -// ('block'), part of a comment, which AsciiDoc drops ('comment'), or text. -const kindOf = (l, block) => { - if (block) return block.startsWith('//') ? 'comment' : 'block'; - return COMMENT.test(l) ? 'comment' : 'text'; -}; -function lineKinds(lines) { - let open = null; - return lines.map(l => { - const block = open ?? opener(l); - const closes = open !== null && l === open; - open = closes ? null : block; - return kindOf(l, block); - }); -} -// A heading in any form AsciiDoc or Markdown gives one: its markers and a blank, -// then a title that could read "Status". The title is the rest of the line, taken -// whole, so the pattern cannot backtrack and no character of the title escapes it. -const HEADING = /^[=#]+[ \t]/; -const mayBeStatus = l => { - const m = HEADING.exec(l); - if (m === null) return false; - const title = l.slice(m[0].length); - return /\{|&#?\w+;/.test(title) || /status/i.test(title.replace(/[^\p{L}]/gu, '')); -}; -// Asciidoctor reads a line over an underline within one character of its -// length as a two-line section title; two characters are allowed here. -const UNDERLINE = /^([-=~^+])\1+$/; -const width = s => [...s].length; -const overUnderline = (lines, kinds, i) => kinds[i] === 'text' && lines[i] !== '' && UNDERLINE.test(lines[i + 1] ?? '') - && Math.abs(width(lines[i + 1]) - width(lines[i])) <= 2; -// What, standing above a heading across blank lines and comments, attaches the -// heading to it: a block attribute line, a block title, a list continuation or -// a description-list term. -const ATTACHES = /^(?:\[.*\]|\.[^.\s].*|\+)$|(?::{2,4}|;;)(?:[ \t]|$)/; -function startsSection(lines, kinds, i) { - if (i > 0 && lines[i - 1] !== '') return false; - let j = i - 1; - while (j >= 0 && (lines[j] === '' || kinds[j] === 'comment')) j--; - return j < 0 || !ATTACHES.test(lines[j]); -} -export function adrAccepted(text) { - const lines = text.split('\n').map(l => l.trimEnd()); - if (lines.some(l => PREPROCESSOR.test(l))) return false; - const kinds = lineKinds(lines); - if (lines.some((_, i) => overUnderline(lines, kinds, i))) return false; - const heads = lines.flatMap((l, i) => (mayBeStatus(l) ? [i] : [])); - if (heads.length !== 1) return false; - const [h] = heads; - if (kinds[h] !== 'text' || !/^={2,6} Status$/.test(lines[h]) || !startsSection(lines, kinds, h)) return false; - // The heading is text, so the line after it is text too, unless it opens a - // block, and no delimiter that opens one begins "Accepted". - const n = lines.findIndex((l, i) => i > h && l !== '' && kinds[i] !== 'comment'); - return n > h && /^\**Accepted\b/.test(lines[n]) && !LIST_MARKER.test(lines[n]); -} - // A path in this repository, by the registry's own rule: letters, digits, "-", "_" // and "." in each part, "/" between parts, and no part "." or "..". Nothing in it // can end a code span on the page, and it cannot climb out of the repository. @@ -269,7 +177,11 @@ const EVIDENCE = { if (files.length > 1) return `ADR ${ev.adr} is ambiguous: ${files.join(', ')} share the number`; const [file] = files; if (!ctx.isFile(file)) return `ADR ${ev.adr} (${file}) is not a file in the repository`; - return adrAccepted(ctx.read(file)) ? null : `ADR ${ev.adr} is not Accepted`; + // Its header states the status and its Status section agrees (owner ruling 2026-11-25). + const st = adrStatus(ctx.read(file)); + if (st.header === null) return `ADR ${ev.adr} states no readable status in its header (:status: ACCEPTED, as the ADR template has it)`; + if (!st.inStep) return `ADR ${ev.adr}'s header says ${st.header} but its Status section says ${st.section ?? 'nothing readable'}`; + return st.header === 'ACCEPTED' ? null : `ADR ${ev.adr} is ${st.header}, not ACCEPTED`; }, }; diff --git a/tests/decisions/adr-status.test.mjs b/tests/decisions/adr-status.test.mjs new file mode 100644 index 00000000..5dea11cf --- /dev/null +++ b/tests/decisions/adr-status.test.mjs @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// The status of a decision record: the Status section (read so that it never +// names a word where Asciidoctor finds no such section), the header attribute +// (read so that it never names a status Asciidoctor would not set), and the +// check that keeps the two in step (owner ruling 2026-11-25). +import {test, expect, afterAll} from 'bun:test'; +import {mkdtempSync, mkdirSync, writeFileSync, rmSync, symlinkSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import path from 'node:path'; +import {sectionStatus, headerStatus, adrStatus, adrAccepted, checkDecisions} from '../../scripts/decisions/adr-status.mjs'; + +const roots = []; +afterAll(() => { for (const r of roots) rmSync(r, {recursive: true, force: true}); }); +const sectionAccepted = t => sectionStatus(t) === 'ACCEPTED'; + + +// The status is the ADR's own text, as AsciiDoc reads it. Each of these was +// accepted when the first "Status" heading anywhere in the file was taken. +test('an ADR is accepted only by its own one Status section', () => { + const adr = body => `= ADR\n\n${body}\n`; + expect(sectionAccepted(adr('=== Status\n\n*Accepted (ratified).*'))).toBe(true); + // A heading that could read Status counts even inside a block, so this ADR is + // not read. Asciidoctor finds one Status section here; the reader fails closed. + expect(sectionAccepted(adr('=== Status\n\nAccepted\n\n----\n=== Status\nProposed\n----'))).toBe(false); + expect(sectionAccepted(adr('----\nan example\n----\n\n=== Status\n\nAccepted'))).toBe(true); + expect(sectionAccepted(adr('=== Status'))).toBe(false); + expect(sectionAccepted(adr('=== Status\n\nProposed.'))).toBe(false); + expect(sectionAccepted(adr('////\n=== Status\nAccepted\n////\n\n=== Status\n\nProposed.'))).toBe(false); + expect(sectionAccepted(adr('----\n=== Status\nAccepted\n----\n\n=== Status\n\nProposed.'))).toBe(false); + expect(sectionAccepted(adr('....\n=== Status\nAccepted\n....\n\n=== Status\n\nProposed.'))).toBe(false); + expect(sectionAccepted(adr('ifdef::never[]\n=== Status\nAccepted\nendif::[]\n\n=== Status\n\nProposed.'))).toBe(false); + expect(sectionAccepted(adr('=== Status\n\nAccepted\n\n=== Status\n\nProposed.'))).toBe(false); + expect(sectionAccepted(adr('=== Status\n// Accepted\nProposed.'))).toBe(false); + expect(sectionAccepted(adr('=== Status\n----\nAccepted\n----'))).toBe(false); + expect(sectionAccepted(adr('include::status.adoc[]\n\n=== Status\n\nAccepted'))).toBe(false); + expect(sectionAccepted(adr('// === Status\n// Accepted'))).toBe(false); + // Each of these agrees with Asciidoctor 2.0.26: a "[discrete]" waiting above the + // heading, across blank lines and comments, makes it a floating title, not a + // section; a heading straight after a paragraph line belongs to the paragraph. + for (const above of ['[discrete]\n', '[float]\n', '[discrete]\n\n', '[discrete]\n////\nx\n////\n\n', '[discrete]\n// note\n\n', 'Some text.\n']) + expect(sectionAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); + expect(sectionAccepted(adr('=== Status\n// a comment\nAccepted'))).toBe(true); + // "= Status" is the document's title, not a section (Asciidoctor agrees), also + // after leading comments, which may come before a document header. + expect(sectionAccepted('= Status\n\nAccepted\n')).toBe(false); + expect(sectionAccepted('// note\n////\nx\n////\n\n= Status\n\nAccepted\n')).toBe(false); + expect(sectionAccepted('== Status\n\nAccepted\n')).toBe(true); + // A heading inside a block is not a section even with a blank line above it. + for (const block of ['----\nexample\n\n=== Status\n\nAccepted\n----', '////\nold\n\n=== Status\n\nAccepted\n////', '====\n\n=== Status\n\nAccepted\n====']) + expect(sectionAccepted(adr(block))).toBe(false); + expect(sectionAccepted(adr('=== Status\n\n////\nAccepted\n////\n\nProposed.'))).toBe(false); + // Asciidoctor reads a section here, but the reader says no: it fails closed on + // any attribute line or block title above a Status heading. + for (const above of ['[[status]]\n', '.A title\n']) expect(sectionAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); +}); + +// Each case below was checked against Asciidoctor 2.0.26. Where the comment says +// the reader fails closed, Asciidoctor would accept and the reader refuses. +test('a Markdown fence hides what it holds, as Asciidoctor reads it', () => { + const adr = body => `= ADR\n\n${body}\n`; + // A heading inside a fence is not a section, blank lines around it or not. + expect(sectionAccepted(adr('```\n\n=== Status\n\nAccepted\n```'))).toBe(false); + expect(sectionAccepted(adr('```\n=== Status\nAccepted\n```'))).toBe(false); + // A fence opens with a language after it, and only three bare backticks close it. + expect(sectionAccepted(adr('```ruby\ncode\n```\n\n=== Status\n\nAccepted'))).toBe(true); + expect(sectionAccepted(adr('```ruby\ncode\n```ruby\n\n=== Status\n\nAccepted'))).toBe(false); + expect(sectionAccepted(adr('``` ruby\ncode\n``` ruby\n\n=== Status\n\nAccepted'))).toBe(false); + // "````" and "~~~" delimit nothing, so a later "```" opens a fence that hides the rest. + expect(sectionAccepted(adr('````\ncode\n````\n\n=== Status\n\nAccepted'))).toBe(true); + for (const lead of ['````', '~~~', '`` `']) expect(sectionAccepted(adr(`${lead}\ncode\n\`\`\`\n\n=== Status\n\nAccepted`))).toBe(false); +}); + +test('a second heading that could read Status leaves the ADR unread', () => { + const adr = body => `= ADR\n\n=== Status\n\nAccepted\n\n${body}\n\nProposed.\n`; + expect(sectionAccepted(adr('=== Context'))).toBe(true); + // Each is a second section titled Status to Asciidoctor: a later level-0 title, + // Markdown and symmetric markers, extra blanks, an underlined title, a title that + // a substitution spells, an attribute line above, and a heading straight after a block. + for (const second of ['= Status', '## Status', '### Status', '== Status ==', '== Status', '==\tStatus', + 'Status\n------', 'Status\n~~~~~~', ':s: Status\n\n== {s}', '== +Status+', '== pass:[Status]', + '== Stat{empty}us', '== ((Status))', '[#sid]\n== Status', '[appendix]\n== Status', '----\ncode\n----\n== Status']) + expect(sectionAccepted(adr(second))).toBe(false); + // A title is read whole, past a line separator (which the earlier pattern's "." + // stopped at), and a long run of blanks before one costs no backtracking. + for (const title of ['Statusโ€จ', 'xโ€จStatus']) expect(sectionAccepted(adr(`== ${title}`))).toBe(false); + const started = performance.now(); + expect(sectionAccepted(adr(`=${' '.repeat(50000)}โ€จ`))).toBe(true); + expect(performance.now() - started).toBeLessThan(200); + // Seven markers make no heading, so the line cannot be the Status section. + expect(sectionAccepted('= ADR\n\n======= Status\n\nAccepted\n')).toBe(false); + for (const level of ['==', '===', '======']) expect(sectionAccepted(`= ADR\n\n${level} Status\n\nAccepted\n`)).toBe(true); +}); + +test('the Status section opens with a paragraph that says Accepted', () => { + const adr = body => `= ADR\n\n${body}\n`; + // To Asciidoctor none of these opens with such a paragraph: a literal (indented) + // line, a description-list term, an underlined title, and "///", which is text. + for (const opening of [' Accepted', 'Accepted:: yes', 'Accepted::', 'Accepted;; yes', 'Accepted\n--------', '/// x\nAccepted', '///\nAccepted']) + expect(sectionAccepted(adr(`=== Status\n\n${opening}`))).toBe(false); + expect(sectionAccepted(adr('=== Status\n\n// a comment\nAccepted'))).toBe(true); + // A heading inside a comment block is no section, though text follows the block. + expect(sectionAccepted(adr('////\n\n=== Status\n////\nAccepted'))).toBe(false); + // A heading below a list continuation, or below a term with nothing after it, + // belongs to the list. Below a term with a description the reader fails closed. + for (const above of ['* item\n+\n\n', 'term::\n\n', 'term:: words\n\n']) + expect(sectionAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); + expect(sectionAccepted(adr('* item\n\n=== Status\n\nAccepted'))).toBe(true); + // A short line over a delimiter of about its length is a two-line title, so no + // block opens there; the reader does not read such an ADR. + expect(sectionAccepted(adr('foo\n----\n=== Status\nProposed\n----\n\n=== Status\n\nAccepted'))).toBe(false); + // A line far from the delimiter's length leaves it a delimiter, and inside a + // block no title is read at all, whatever the lengths. + expect(sectionAccepted(adr('A much longer paragraph line\n----\ncode\n----\n\n=== Status\n\nAccepted'))).toBe(true); + expect(sectionAccepted(adr('----\nfoo\n----\n\n=== Status\n\nAccepted'))).toBe(true); +}); + +test('the Status section names its opening word, whatever the status', () => { + const adr = body => `= ADR\n\n=== Status\n\n${body}\n`; + for (const [opening, word] of [['Accepted', 'ACCEPTED'], ['*Proposed. Not yet.*', 'PROPOSED'], ['Superseded by 0007.', 'SUPERSEDED'], ['Deprecated', 'DEPRECATED']]) + expect(sectionStatus(adr(opening))).toBe(word); + // A word is a whole word: "Acceptedly" is not "Accepted". + expect(sectionStatus(adr('Acceptedly'))).toBe('ACCEPTEDLY'); + expect(sectionStatus(adr('Accepted2'))).toBe(null); + expect(sectionStatus(adr('`Accepted`'))).toBe(null); +}); + +// Each case below was checked against Asciidoctor 2.0.26's own status attribute. +test('the header states the status once, as the ADR template words it', () => { + const doc = (head, body = '') => `= ADR\n${head}\n\n${body}`; + for (const v of ['PROPOSED', 'ACCEPTED', 'DEPRECATED', 'SUPERSEDED', 'SUPERSEDED by 0007', 'REJECTED']) + expect(headerStatus(doc(`:status: ${v}`))).toBe(v); + // Leading comments and blank lines before the title, and comments and other + // attribute entries in the header, are allowed. + expect(headerStatus(`// SPDX\n// x\n\n= ADR\n// note\n:revdate: 2026-11-25\n:status: ACCEPTED\n\nBody.\n`)).toBe('ACCEPTED'); + // Other spellings and values are refused: the template's words, written exactly. + // A blank after the value is no difference: Asciidoctor, like the reader, drops it. + expect(headerStatus(doc(':status: ACCEPTED '))).toBe('ACCEPTED'); + for (const v of ['Accepted', 'accepted', ' ACCEPTED', 'ACCEPTED, really', 'SUPERSEDED by 7', 'DONE']) + expect(headerStatus(doc(`:status: ${v}`))).toBe(null); + // Not a document title, or no header at all. + expect(headerStatus('== ADR\n:status: ACCEPTED\n')).toBe(null); + expect(headerStatus('Text first.\n\n= ADR\n:status: ACCEPTED\n')).toBe(null); + // Below a blank line the entry is in the body, not the header. + expect(headerStatus('= ADR\n\n:status: ACCEPTED\n')).toBe(null); +}); + +test('nothing but the one header entry can set or unset the status', () => { + const doc = (head, body = '') => `= ADR\n${head}\n\n${body}`; + // A second entry, an unset, an inline set or a conditional anywhere. + for (const body of [':status: PROPOSED\n', ':status!:\n', ':!status:\n', 'Text {set:status:PROPOSED} here.\n', 'ifdef::x[]\n:status: PROPOSED\nendif::[]\n']) + expect(headerStatus(doc(':status: ACCEPTED', body))).toBe(null); + expect(headerStatus(doc(':status: ACCEPTED\n:status: ACCEPTED'))).toBe(null); + // An included file could set the status where no line here does. + expect(headerStatus(doc(':status: ACCEPTED', 'include::more.adoc[]\n'))).toBe(null); + // A header line that is neither a comment nor an entry could change what the + // header holds (an author line, a comment block), and a continuation joins + // the next line to an entry's value; each is refused. + for (const head of ['Ann Author\n:status: ACCEPTED', '////\n:status: ACCEPTED\n////', ':foo: bar \\\n:status: ACCEPTED', ':foo: bar +\n:status: ACCEPTED', ':status: ACCEPTED \\']) + expect(headerStatus(doc(head))).toBe(null); +}); + +test('an ADR is accepted only when its header and its Status section both say so', () => { + const adr = (head, opening) => `= ADR\n${head}\n\n=== Status\n\n${opening}\n`; + expect(adrAccepted(adr(':status: ACCEPTED', '*Accepted (ratified).*'))).toBe(true); + expect(adrStatus(adr(':status: ACCEPTED', 'Accepted'))).toEqual({header: 'ACCEPTED', section: 'ACCEPTED', inStep: true}); + // Out of step either way, or half stated: not accepted. + expect(adrStatus(adr(':status: ACCEPTED', 'Proposed.'))).toEqual({header: 'ACCEPTED', section: 'PROPOSED', inStep: false}); + expect(adrAccepted(adr(':status: ACCEPTED', 'Proposed.'))).toBe(false); + expect(adrAccepted(adr(':status: PROPOSED', 'Accepted'))).toBe(false); + expect(adrAccepted(adr(':revdate: x', 'Accepted'))).toBe(false); + expect(adrAccepted(`= ADR\n:status: ACCEPTED\n\nNo Status section.\n`)).toBe(false); + // In step, but not accepted. + expect(adrStatus(adr(':status: SUPERSEDED by 0007', 'Superseded by ADR 0007.'))).toEqual({header: 'SUPERSEDED by 0007', section: 'SUPERSEDED', inStep: true}); + expect(adrAccepted(adr(':status: PROPOSED', 'Proposed.'))).toBe(false); +}); + +test('the check keeps every decision record in step, and reports one that states none', () => { + const root = mkdtempSync(path.join(tmpdir(), 'adr-')); + roots.push(root); + const dir = path.join(root, 'docs/decisions'); + mkdirSync(dir, {recursive: true}); + const put = (f, s) => writeFileSync(path.join(dir, f), s); + put('0001-a.adoc', '= A\n:status: ACCEPTED\n\n=== Status\n\nAccepted\n'); + put('0002-b.adoc', '= B\n\n== Scope\n\nNo status yet.\n'); + put('0003-template.adoc', '= Template\n:status: PROPOSED\n'); + put('README.adoc', '= Decisions\n'); + expect(checkDecisions(root)).toEqual([{file: '0001-a.adoc', status: 'ACCEPTED'}, {file: '0002-b.adoc', status: null}]); + put('0004-c.adoc', '= C\n:status: ACCEPTED\n\n=== Status\n\nProposed.\n'); + put('0005-d.adoc', '= D\n\n=== Status\n\nAccepted\n'); + put('0006-e.adoc', '= E\n:status: PROPOSED\n\nNo section.\n'); + const problems = checkDecisions(root).filter(r => r.problem).map(r => `${r.file}: ${r.problem}`); + expect(problems).toEqual([ + '0004-c.adoc: its header says ACCEPTED but its Status section says PROPOSED', + '0005-d.adoc: its header says nothing readable but its Status section says ACCEPTED', + '0006-e.adoc: its header says PROPOSED but its Status section says nothing readable', + ]); + // A record that is a link is not read. + const other = mkdtempSync(path.join(tmpdir(), 'adr-out-')); + roots.push(other); + writeFileSync(path.join(other, 'x.adoc'), '= X\n:status: ACCEPTED\n\n=== Status\n\nAccepted\n'); + symlinkSync(path.join(other, 'x.adoc'), path.join(dir, '0007-link.adoc')); + expect(checkDecisions(root).find(r => r.file === '0007-link.adoc')).toEqual({file: '0007-link.adoc', problem: 'is not a plain file'}); +}); + +test('the decision records here are in step', () => { + const results = checkDecisions(); + expect(results.filter(r => r.problem)).toEqual([]); + expect(results.find(r => r.file === '0004-claims-registry.adoc')?.status).toBe('ACCEPTED'); +}); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 13b8a692..cba0267f 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -6,9 +6,10 @@ import {test, expect, afterAll} from 'bun:test'; import {mkdtempSync, mkdirSync, writeFileSync, rmSync, readFileSync, symlinkSync, existsSync, readdirSync} from 'node:fs'; import {tmpdir} from 'node:os'; import path from 'node:path'; -import {generate, validate, derive, readSource, registryGrade, adrAccepted, context, staleViews, writeViews, ACTIVE_LIMIT, ROOT, VIEW, SVG, RULES} +import {generate, validate, derive, readSource, registryGrade, context, staleViews, writeViews, ACTIVE_LIMIT, ROOT, VIEW, SVG, RULES} from '../../scripts/ultraplan/ultraplan.mjs'; import {jcs} from '../../scripts/registry/theory-ledger.mjs'; +import {adrAccepted} from '../../scripts/decisions/adr-status.mjs'; const roots = []; afterAll(() => { for (const r of roots) rmSync(r, {recursive: true, force: true}); }); @@ -37,8 +38,8 @@ function fixture({advisors = ADVISORS, nodes = BASE, expeditions = [], registry mkdirSync(path.join(root, 'docs/decisions'), {recursive: true}); mkdirSync(path.join(root, 'docs/atlas/generated'), {recursive: true}); writeFileSync(path.join(root, 'README.adoc'), '= Fixture\n'); - writeFileSync(path.join(root, 'docs/decisions/0004-claims-registry.adoc'), '= ADR\n\n=== Status\n\n*Accepted (ratified).*\n'); - writeFileSync(path.join(root, 'docs/decisions/0005-jcs.adoc'), '= ADR\n\n=== Status\n\n*Proposed. Not accepted.*\n'); + writeFileSync(path.join(root, 'docs/decisions/0004-claims-registry.adoc'), '= ADR\n:status: ACCEPTED\n\n=== Status\n\n*Accepted (ratified).*\n'); + writeFileSync(path.join(root, 'docs/decisions/0005-jcs.adoc'), '= ADR\n:status: PROPOSED\n\n=== Status\n\n*Proposed. Not accepted.*\n'); writeFileSync(path.join(root, 'docs/atlas/generated/registry.adoc'), registry); const jl = rows => rows.map(r => jcs(r) + '\n').join(''); writeFileSync(path.join(root, 'docs/ultraplan/advisors.jsonl'), raw.advisors ?? jl(advisors)); @@ -135,7 +136,7 @@ test('done needs evidence that holds', () => { rmSync(path.join(reg, 'docs/atlas/generated/registry.adoc')); symlinkSync(path.join(outside, 'registry.adoc'), path.join(reg, 'docs/atlas/generated/registry.adoc')); expect(() => generate(reg)).toThrow(/docs\/atlas\/generated\/registry\.adoc is not a file in the repository/); - refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is not Accepted/); + refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is PROPOSED, not ACCEPTED/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); // Two records with one number are refused, not picked between by directory order. const twin = fixture(); @@ -144,7 +145,7 @@ test('done needs evidence that holds', () => { // Only the boilerplate NNNN-template.adoc is set aside: a record whose title says template counts, // and a template that shares a number with a record does not make it ambiguous. const titled = fixture({nodes: swap('tool', {evidence: [{adr: '0006'}]})}); - writeFileSync(path.join(titled, 'docs/decisions/0006-template-inheritance.adoc'), '= ADR\n\n=== Status\n\n*Accepted.*\n'); + writeFileSync(path.join(titled, 'docs/decisions/0006-template-inheritance.adoc'), '= ADR\n:status: ACCEPTED\n\n=== Status\n\n*Accepted.*\n'); expect(() => generate(titled)).not.toThrow(); const boiler = fixture(); writeFileSync(path.join(boiler, 'docs/decisions/0004-template.adoc'), '= Template\n\n=== Status\n\nProposed\n'); @@ -506,104 +507,19 @@ test('the evidence parsers read the real registry view and ADRs', () => { for (const n of ['0001', '0002', '0003']) expect(adrAccepted(ctx.read(ctx.adrFiles(n)[0]))).toBe(true); }); -// The status is the ADR's own text, as AsciiDoc reads it. Each of these was -// accepted when the first "Status" heading anywhere in the file was taken. -test('an ADR is accepted only by its own one Status section', () => { - const adr = body => `= ADR\n\n${body}\n`; - expect(adrAccepted(adr('=== Status\n\n*Accepted (ratified).*'))).toBe(true); - // A heading that could read Status counts even inside a block, so this ADR is - // not read. Asciidoctor finds one Status section here; the reader fails closed. - expect(adrAccepted(adr('=== Status\n\nAccepted\n\n----\n=== Status\nProposed\n----'))).toBe(false); - expect(adrAccepted(adr('----\nan example\n----\n\n=== Status\n\nAccepted'))).toBe(true); - expect(adrAccepted(adr('=== Status'))).toBe(false); - expect(adrAccepted(adr('=== Status\n\nProposed.'))).toBe(false); - expect(adrAccepted(adr('////\n=== Status\nAccepted\n////\n\n=== Status\n\nProposed.'))).toBe(false); - expect(adrAccepted(adr('----\n=== Status\nAccepted\n----\n\n=== Status\n\nProposed.'))).toBe(false); - expect(adrAccepted(adr('....\n=== Status\nAccepted\n....\n\n=== Status\n\nProposed.'))).toBe(false); - expect(adrAccepted(adr('ifdef::never[]\n=== Status\nAccepted\nendif::[]\n\n=== Status\n\nProposed.'))).toBe(false); - expect(adrAccepted(adr('=== Status\n\nAccepted\n\n=== Status\n\nProposed.'))).toBe(false); - expect(adrAccepted(adr('=== Status\n// Accepted\nProposed.'))).toBe(false); - expect(adrAccepted(adr('=== Status\n----\nAccepted\n----'))).toBe(false); - expect(adrAccepted(adr('include::status.adoc[]\n\n=== Status\n\nAccepted'))).toBe(false); - expect(adrAccepted(adr('// === Status\n// Accepted'))).toBe(false); - // Each of these agrees with Asciidoctor 2.0.26: a "[discrete]" waiting above the - // heading, across blank lines and comments, makes it a floating title, not a - // section; a heading straight after a paragraph line belongs to the paragraph. - for (const above of ['[discrete]\n', '[float]\n', '[discrete]\n\n', '[discrete]\n////\nx\n////\n\n', '[discrete]\n// note\n\n', 'Some text.\n']) - expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); - expect(adrAccepted(adr('=== Status\n// a comment\nAccepted'))).toBe(true); - // "= Status" is the document's title, not a section (Asciidoctor agrees), also - // after leading comments, which may come before a document header. - expect(adrAccepted('= Status\n\nAccepted\n')).toBe(false); - expect(adrAccepted('// note\n////\nx\n////\n\n= Status\n\nAccepted\n')).toBe(false); - expect(adrAccepted('== Status\n\nAccepted\n')).toBe(true); - // A heading inside a block is not a section even with a blank line above it. - for (const block of ['----\nexample\n\n=== Status\n\nAccepted\n----', '////\nold\n\n=== Status\n\nAccepted\n////', '====\n\n=== Status\n\nAccepted\n====']) - expect(adrAccepted(adr(block))).toBe(false); - expect(adrAccepted(adr('=== Status\n\n////\nAccepted\n////\n\nProposed.'))).toBe(false); - // Asciidoctor reads a section here, but the reader says no: it fails closed on - // any attribute line or block title above a Status heading. - for (const above of ['[[status]]\n', '.A title\n']) expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); -}); - -// Each case below was checked against Asciidoctor 2.0.26. Where the comment says -// the reader fails closed, Asciidoctor would accept and the reader refuses. -test('a Markdown fence hides what it holds, as Asciidoctor reads it', () => { - const adr = body => `= ADR\n\n${body}\n`; - // A heading inside a fence is not a section, blank lines around it or not. - expect(adrAccepted(adr('```\n\n=== Status\n\nAccepted\n```'))).toBe(false); - expect(adrAccepted(adr('```\n=== Status\nAccepted\n```'))).toBe(false); - // A fence opens with a language after it, and only three bare backticks close it. - expect(adrAccepted(adr('```ruby\ncode\n```\n\n=== Status\n\nAccepted'))).toBe(true); - expect(adrAccepted(adr('```ruby\ncode\n```ruby\n\n=== Status\n\nAccepted'))).toBe(false); - expect(adrAccepted(adr('``` ruby\ncode\n``` ruby\n\n=== Status\n\nAccepted'))).toBe(false); - // "````" and "~~~" delimit nothing, so a later "```" opens a fence that hides the rest. - expect(adrAccepted(adr('````\ncode\n````\n\n=== Status\n\nAccepted'))).toBe(true); - for (const lead of ['````', '~~~', '`` `']) expect(adrAccepted(adr(`${lead}\ncode\n\`\`\`\n\n=== Status\n\nAccepted`))).toBe(false); -}); - -test('a second heading that could read Status leaves the ADR unread', () => { - const adr = body => `= ADR\n\n=== Status\n\nAccepted\n\n${body}\n\nProposed.\n`; - expect(adrAccepted(adr('=== Context'))).toBe(true); - // Each is a second section titled Status to Asciidoctor: a later level-0 title, - // Markdown and symmetric markers, extra blanks, an underlined title, a title that - // a substitution spells, an attribute line above, and a heading straight after a block. - for (const second of ['= Status', '## Status', '### Status', '== Status ==', '== Status', '==\tStatus', - 'Status\n------', 'Status\n~~~~~~', ':s: Status\n\n== {s}', '== +Status+', '== pass:[Status]', - '== Stat{empty}us', '== ((Status))', '[#sid]\n== Status', '[appendix]\n== Status', '----\ncode\n----\n== Status']) - expect(adrAccepted(adr(second))).toBe(false); - // A title is read whole, past a line separator (which the earlier pattern's "." - // stopped at), and a long run of blanks before one costs no backtracking. - for (const title of ['Statusโ€จ', 'xโ€จStatus']) expect(adrAccepted(adr(`== ${title}`))).toBe(false); - const started = performance.now(); - expect(adrAccepted(adr(`=${' '.repeat(50000)}โ€จ`))).toBe(true); - expect(performance.now() - started).toBeLessThan(200); - // Seven markers make no heading, so the line cannot be the Status section. - expect(adrAccepted('= ADR\n\n======= Status\n\nAccepted\n')).toBe(false); - for (const level of ['==', '===', '======']) expect(adrAccepted(`= ADR\n\n${level} Status\n\nAccepted\n`)).toBe(true); -}); - -test('the Status section opens with a paragraph that says Accepted', () => { - const adr = body => `= ADR\n\n${body}\n`; - // To Asciidoctor none of these opens with such a paragraph: a literal (indented) - // line, a description-list term, an underlined title, and "///", which is text. - for (const opening of [' Accepted', 'Accepted:: yes', 'Accepted::', 'Accepted;; yes', 'Accepted\n--------', '/// x\nAccepted', '///\nAccepted']) - expect(adrAccepted(adr(`=== Status\n\n${opening}`))).toBe(false); - expect(adrAccepted(adr('=== Status\n\n// a comment\nAccepted'))).toBe(true); - // A heading inside a comment block is no section, though text follows the block. - expect(adrAccepted(adr('////\n\n=== Status\n////\nAccepted'))).toBe(false); - // A heading below a list continuation, or below a term with nothing after it, - // belongs to the list. Below a term with a description the reader fails closed. - for (const above of ['* item\n+\n\n', 'term::\n\n', 'term:: words\n\n']) - expect(adrAccepted(adr(`${above}=== Status\n\nAccepted`))).toBe(false); - expect(adrAccepted(adr('* item\n\n=== Status\n\nAccepted'))).toBe(true); - // A short line over a delimiter of about its length is a two-line title, so no - // block opens there; the reader does not read such an ADR. - expect(adrAccepted(adr('foo\n----\n=== Status\nProposed\n----\n\n=== Status\n\nAccepted'))).toBe(false); - // A line far from the delimiter's length leaves it a delimiter, and inside a - // block no title is read at all, whatever the lengths. - expect(adrAccepted(adr('A much longer paragraph line\n----\ncode\n----\n\n=== Status\n\nAccepted'))).toBe(true); - expect(adrAccepted(adr('----\nfoo\n----\n\n=== Status\n\nAccepted'))).toBe(true); +// ADR evidence counts only when the header states ACCEPTED and the Status +// section agrees (owner ruling 2026-11-25); each failure says which part fails. +test('ADR evidence needs its header and its Status section to agree', () => { + const root = fixture({nodes: swap('tool', {evidence: [{adr: '0007'}]})}); + const put = s => writeFileSync(path.join(root, 'docs/decisions/0007-x.adoc'), s); + put('= ADR\n\n=== Status\n\nAccepted\n'); + expect(() => generate(root)).toThrow(/node tool: ADR 0007 states no readable status in its header/); + put('= ADR\n:status: ACCEPTED\n\n=== Status\n\nProposed.\n'); + expect(() => generate(root)).toThrow(/node tool: ADR 0007's header says ACCEPTED but its Status section says PROPOSED/); + put('= ADR\n:status: ACCEPTED\n\nNo section.\n'); + expect(() => generate(root)).toThrow(/its Status section says nothing readable/); + put('= ADR\n:status: ACCEPTED\n\n=== Status\n\nAccepted\n'); + expect(() => generate(root)).not.toThrow(); }); test('the committed views match the committed data', () => { From 682d6f400aece4090fb041fb2176d21cfdc6f114 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 11:36:57 +0000 Subject: [PATCH 31/41] ultraplan, site: read only files git tracks; texts shown as written Review of hyperpolymath/mathesis#123 (SonarCloud and Codex): - No error message echoes a record (SonarCloud S8689). A line not in JCS form is named with the command that writes its form: `sed -n Np FILE | bun scripts/ijson-jcs-cli.js canon`. - scripts/repo/files.mjs: what a generator may read is a file git tracks, at its own path: no link along it, nothing untracked, nothing in .git. A clone and a linked worktree read the same. The ultraplan's evidence, refs, ADRs, registry view and sources go through it; the views are read and written as plain local files. - The site reads its views, front-page sources and assets the same way, and fails the build otherwise, so no linked asset is copied in from outside. Asciidoctor runs in secure mode: in safe mode with base dir "/" a view could include any file on the system (probed); now an include becomes a link that the link check refuses. Output is otherwise byte-identical. A GitHub link is made only for a tracked file. - A plan text may not hold U+2028, U+2029, a run of spaces, or a space at its start or end: the page could not show it as written. - site-check runs the site tests, so CI runs them (it did not), and check-views runs the new tests/repo. - GELS is retired: MPSCI and GELO, per the owner's naming of 2026-11-25. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 27 ++++- Justfile | 17 +++- docs/status/ROADMAP.adoc | 25 +++-- docs/ultraplan/README.adoc | 44 +++++--- docs/ultraplan/generated/ultraplan.adoc | 2 +- docs/ultraplan/tree.jsonl | 2 +- scripts/repo/files.mjs | 84 ++++++++++++++++ scripts/site/site.mjs | 36 ++++--- scripts/ultraplan/ultraplan.mjs | 104 +++++++++---------- tests/repo/files.test.mjs | 127 ++++++++++++++++++++++++ tests/site/site.test.mjs | 89 ++++++++++++++++- tests/ultraplan/ultraplan.test.mjs | 126 +++++++++++++++++++---- 12 files changed, 561 insertions(+), 122 deletions(-) create mode 100644 scripts/repo/files.mjs create mode 100644 tests/repo/files.test.mjs diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index e00e375a..92d13b2f 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -84,8 +84,12 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. derived and none typed. + The generator refuses: - ** a done node without evidence that holds: a file, a claim grade the - registry derives, or an accepted ADR. An ADR is accepted only when its + ** a done node without evidence that holds: a file that git tracks, a claim + grade the registry derives, or an accepted ADR. Every file the checks read + (evidence, refs, ADRs, the registry view and the plan's own sources) is + one git tracks, at its own path: no link along it, nothing untracked, + nothing in `.git`. `scripts/repo/files.mjs` reads them, so a clone and + a linked worktree read the same; An ADR is accepted only when its header states `:status: ACCEPTED` and its Status section agrees (owner ruling 2026-11-25), each read by `scripts/decisions/adr-status.mjs` so that it never finds a status Asciidoctor would not; @@ -95,13 +99,26 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ** a ref that does not point at one place: each names a passage that occurs exactly once in a file here, a path here, a file of another repository at a full commit, or an issue, and never a line number; - ** a text holding a line break. Every text is plain text (owner ruling - 2026-11-25): the page writes each ASCII punctuation mark in it as a + ** a text the page could not show as written: one holding a control + character, a line or paragraph separator (U+2028, U+2029), a run of + spaces, or a space at its start or end. Every text is plain text (owner + ruling 2026-11-25): the page writes each ASCII punctuation mark in it as a character reference, so it shows exactly as written and forms no markup; ** any note from the private me advisor. + `just ultraplan` and `just ultraplan-check` run it, and `check-views` includes - the check. The site copies a view's pictures, so the tree's image works there. + the check. A line not in JCS form is named with the command that writes its + form; no error message echoes a record. The site copies a view's pictures, + so the tree's image works there. +* **The site reads nothing from outside the repository.** `scripts/site/site.mjs` + reads each view, the front page's sources and each asset it copies only as a + file git tracks, at its own path, and fails the build otherwise. Asciidoctor + now runs in secure mode, so an `include::` in a view becomes a link, which + the link check refuses, instead of the included file's text: in safe mode, + with the base directory at `/`, a view could include any file on the + system. The output is otherwise byte-identical. A link to a repository file + becomes a GitHub link only when git tracks the file. `site-check` now runs + the site tests, so CI runs them; it did not before. * The 27 `hyperpolymath/resource-algebra` claims move their pin to `a17ffb6` (2026-11-17), whose receipt describes `47de4a8`, the merge of diff --git a/Justfile b/Justfile index c4737a98..7419326c 100644 --- a/Justfile +++ b/Justfile @@ -712,7 +712,7 @@ check: check-views site-check check-proofs receipt-check # Needs bun, network for the receipts, and MATHESIS_STANDARDS (see `registry`). # Views current: catalogue, census tests, atlas, claims registry, bridges and # the worked cohort examples -check-views: catalogue-check census-test atlas-check registry-check applied-check ultraplan-check adr-check +check-views: catalogue-check census-test atlas-check registry-check applied-check ultraplan-check adr-check repo-files-test # Needs agda, coqc and lean, e.g. in the pinned Guix: # guix time-machine -C build/channels.scm -- shell -m build/manifest.scm -- just check-proofs @@ -810,6 +810,12 @@ ultraplan-check: registry-check bun scripts/ultraplan/ultraplan.mjs check bun test tests/ultraplan/ +# Test what the generators may read from the repository: a file that git tracks, +# at its own path, with no link along it (scripts/repo/files.mjs). The ultraplan's +# evidence and the site's views and assets are read only so. +repo-files-test: + bun test tests/repo/ + # Fail if a decision record's header status (`:status:`) and its Status section # disagree, or only one of them states a status (owner ruling 2026-11-25). A # record that states neither is listed, for the owner to set. @@ -825,15 +831,16 @@ adr-check: site out="": bun scripts/site/site.mjs build {{out}} -# Build the site into a temp dir, then discard it. `check` runs this, so CI -# builds the site on every pull request and push to main. -site-check: +# Test the site, then build it into a temp dir and discard it. `check` runs +# this, so CI tests and builds the site on every pull request and push to main. +site-check: site-test #!/usr/bin/env bash set -euo pipefail out="$(mktemp -d)" trap 'rm -rf "$out"' EXIT bun scripts/site/site.mjs build "$out" -# Test the front-page generator and the link check (no asciidoctor needed) +# Test the front page, the link check, and that the build reads nothing from +# outside the repository. Needs asciidoctor, as `site` does. site-test: bun test tests/site/ diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index 1c29e28f..f73f7c43 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -467,17 +467,20 @@ scheduled census, a view of what each repository owes reads the feed at that commit, so each read names its commit. The fetch logic and its rate limits belong to the reader. Mathesis needs no new permission and holds no inbound secret. -** These rulings were recorded as GELS's. See the clarification of 2026-11-25 - below. -* Owner clarification (2026-11-25): two systems had been mixed up. -** GELS is the Git Estate Logistics System, in metadatastician/gels. -** MPSCI is the Master Production and Scheduling Command Interface, also in - metadatastician. -** Earlier text here and in the ultraplan called GELS "the estate display". - Which system shows the maths panel and the owner's private panel, and which - reads the feed, is open for the owner. The panel node is now `maths-panel`. -** The gels feed-panel contract thread, the estate coordinator and the - decision desk were told the same day. +** These rulings were recorded while the panel was taken to be in GELS, a name + now retired. See the clarification of 2026-11-25 below. +* Owner clarification (2026-11-25): two systems had been mixed up. The owner + named them the same day (relayed to this work by the estate hub session). + Both are in metadatastician: +** MPSCI is the Master Production and Scheduling Command Interface. +** GELO is the Git Estate Logistics Office. It was called GELS, the Git + Estate Logistics System; "GELS" is retired. +** Earlier text here and in the ultraplan called that system GELS, and "the + estate display". Which system, MPSCI or GELO, shows the maths panel and the + owner's private panel, and reads the feed, is open for the owner. The + panel node is now `maths-panel`. +** The feed-panel contract thread, the estate coordinator and the decision + desk were told of the clarification the same day. * Owner rulings (2026-11-25), through the selector: ** Plan texts are plain text everywhere: in the data, on the page and in the feed. The page writes each ASCII punctuation mark in a text as a character diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index be0db91f..fe3dad80 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -54,8 +54,14 @@ none; the page lists the frontier nodes the owner tagged, unranked. A typed status is held to account: * *Done* needs evidence that the generator checks against the repository. It -accepts a file that exists, a claim whose grade the registry view derives at or -above a stated grade, or a decision record whose status is Accepted. A done +accepts a file that git tracks, a claim whose grade the registry view derives at +or above a stated grade, or a decision record whose status is Accepted. ++ +Every file the checks read is one that git tracks, at its own path: no link +along the path, nothing untracked, nothing in `.git`. That holds for evidence, +refs, decision records, the registry view and the three sources here. So the +evidence is what a reviewer reads in the commit, and a clone and a linked +worktree read the same. `scripts/repo/files.mjs` reads them. A done node's needs must be done too. + A decision record counts only when it states its status twice, in agreement @@ -80,7 +86,11 @@ shows as the mark itself and never reads as markup. cell or a link, form a span, or name an attribute, wherever it stands on the page. * A feed can carry the same strings unchanged, as plain text. -* The generator refuses a line break or any other control character in a text. +* The generator refuses a text the page could not show as written: one that +holds a control character (a line break among them), a line or paragraph +separator (U+2028 or U+2029, where a browser breaks the line), a run of two or +more spaces (HTML shows a run as one), or a space at its start or end. A +no-break space is shown as written, and is allowed. A text does not type a count that the data derives, such as a number of claims, repositories or theorems: the views carry those counts, and a typed one goes stale. @@ -140,8 +150,9 @@ still counts. == Adding or changing a node . Add or edit the line in `tree.jsonl`, keeping its JCS form. Keys are sorted -and there are no spaces; `bun scripts/ijson-jcs-cli.js` or the generator's error -message gives the exact form. Its id is a lowercase slug that begins with a +and there are no spaces between tokens. When a line is not in that form, the +generator names it and the command that writes its form, such as +`sed -n 23p docs/ultraplan/tree.jsonl | bun scripts/ijson-jcs-cli.js canon`. Its id is a lowercase slug that begins with a letter, because the id is also the node's anchor on the page. . Give it needs, so it sits in the right era. A node with no needs starts a new root. @@ -157,8 +168,8 @@ these: repository. The passage must occur in the file exactly once. `just check` refuses the ref when the passage is reworded, moved away or repeated, so a ref never points nowhere unseen. A passage is one line of up to 160 characters. -** `+{"path":"docs/x"}+`: a file or a directory of this repository, which must -exist. +** `+{"path":"docs/x"}+`: a file of this repository, or a directory that holds +one, which git must track. ** `+{"at":"โ€ฆ","commit":"","path":"โ€ฆ","repo":"OWNER/REPO"}+`: a file of another repository at a commit. The commit fixes its content, so it cannot drift. It is not checked here. @@ -168,22 +179,23 @@ cannot drift. It is not checked here. [[estate-panel]] == The estate panel -The owner asked for a maths panel, "a sub panel of the gels thing". On -2026-11-25 the owner made clear that two systems had been mixed up in that -request. Both live in metadatastician: +The owner asked for a maths panel, as a sub-panel of one of the estate's +systems. On 2026-11-25 the owner made clear that two systems had been mixed up +in that request, and named them. Both live in metadatastician: -* *GELS* is the Git Estate Logistics System, in metadatastician/gels. * *MPSCI* is the Master Production and Scheduling Command Interface. +* *GELO* is the Git Estate Logistics Office. It was called GELS, the Git Estate +Logistics System, a name now retired. -Earlier text here called GELS "the estate display"; that was the mix-up. Which -system shows the maths panel and the owner's private panel, and which reads the -feed, is open for the owner to settle. +Earlier text here called that system GELS, and "the estate display"; that was +the mix-up. Which system, MPSCI or GELO, shows the maths panel and the owner's +private panel, and reads the feed, is open for the owner to settle. What was settled on 2026-11-24 still stands, whichever system it lands in: * Mathesis publishes a read-only I-JSON/JCS feed, which the estate shows as one panel type. The estate coordinator gave this answer while the panel was taken -to be in GELS. +to be in the system then called GELS. * The feed carries the tree's nodes, the advisors' picks (never the me advisor's), the grade census with its denominator, and the claim pins. * Open decisions go to the owner's decision desk, not this panel. @@ -193,7 +205,7 @@ GitHub API for the head commit of main and reads the feed at that commit, so each read names its commit. No secret comes into this repository, and nothing here needs a new permission. -A draft of the feed and panel contract was begun in metadatastician/gels +A draft of the feed and panel contract was begun in MPSCI's repository (`docs/proposals/feed-panel-contract.adoc`). Its thread, the estate coordinator and the decision desk have been told of the clarification. Until the owner settles the host and the contract exists, nothing here writes a feed: a feed diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index 89faa1ba..f94521ea 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -555,7 +555,7 @@ The tech tree as one panel type in the estateโ€™s interface: frontier, g *Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:ultraplan[๐ŸŒณ The ultraplan] + -*Blocked by:* the ownerโ€™s choice of host (owner clarification 2026-11-25): GELS, the Git Estate Logistics System, and MPSCI, the Master Production and Scheduling Command Interface, are separate systems in metadatastician, and which of them shows the panel and reads the feed is open; then their feed and panel contract + +*Blocked by:* the ownerโ€™s choice of host (owner clarification 2026-11-25): MPSCI, the Master Production and Scheduling Command Interface, or GELO, the Git Estate Logistics Office, both in metadatastician; then their feed and panel contract + *Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— === โ™พ๏ธ Era 4: Cantor diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index 22813ad1..c12f645b 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -20,7 +20,7 @@ {"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":[{"at":"Q-H.3 What does a recheck leg cost?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"A measured cost for a recheck leg, and with it a","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} {"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":[{"at":"Next action: the owner files both reports","path":"docs/status/ROADMAP.adoc"},{"at":"File the THY-1 reproducer with the translator's authors","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} {"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":[{"at":"Write one synthetic 13-week forecast as records","path":"docs/proposals/mathesis-research-programme.adoc"},{"path":"applied-systems/finance/liquidity/README.adoc"}],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} -{"blocked_by":"the ownerโ€™s choice of host (owner clarification 2026-11-25): GELS, the Git Estate Logistics System, and MPSCI, the Master Production and Scheduling Command Interface, are separate systems in metadatastician, and which of them shows the panel and reads the feed is open; then their feed and panel contract","glyph":"๐ŸชŸ","id":"maths-panel","kind":"view","name":"Maths panel for the estate","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1}} +{"blocked_by":"the ownerโ€™s choice of host (owner clarification 2026-11-25): MPSCI, the Master Production and Scheduling Command Interface, or GELO, the Git Estate Logistics Office, both in metadatastician; then their feed and panel contract","glyph":"๐ŸชŸ","id":"maths-panel","kind":"view","name":"Maths panel for the estate","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1}} {"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":[{"at":"Generate the Idris2 statement of the token laws from the source of","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} {"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":[{"at":"Q-3.1 Can the composite status be computed?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"as the first vertical slice (ruling R-4)","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} {"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} diff --git a/scripts/repo/files.mjs b/scripts/repo/files.mjs new file mode 100644 index 00000000..e8024f6d --- /dev/null +++ b/scripts/repo/files.mjs @@ -0,0 +1,84 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// The files of the repository, as the generators may read them. +// +// A generator that checks evidence, or copies a file into the site, reads only +// what a reviewer can read in the commit: a file that git tracks, at its own +// path. So a path counts only when +// - git tracks it (it is in the index): nothing untracked, nothing in .git; +// - no part of it is a link: the file system holds, at that very path, what +// the path names, so nothing is read from outside the repository; +// - it is a regular file, or, where a directory may be named, a directory that +// holds a tracked file. +// The answer is the same in a clone and in a linked worktree, where .git is a file. +// +// The generated views are the one exception: a generator writes them before git +// tracks them, so `local` reads and checks a path with the same link rule but +// without asking git. +import {readFileSync, realpathSync, statSync, lstatSync, existsSync} from 'node:fs'; +import {spawnSync} from 'node:child_process'; +import path from 'node:path'; + +// Find a program in the absolute directories of PATH, and run it by that absolute +// path, so no relative PATH entry (such as ".") can pick the program. +export function findProgram(name, env = process.env) { + for (const d of (env.PATH || '').split(path.delimiter)) { + if (path.isAbsolute(d) && existsSync(path.join(d, name))) return path.join(d, name); + } + throw new Error(`${name} not found in an absolute directory of PATH`); +} + +// The paths git tracks in the checkout at `base`, which must be the top of its +// work tree, relative to it. +function trackedPaths(base) { + const git = args => spawnSync(findProgram('git'), ['-C', base, ...args], {encoding: 'utf8', maxBuffer: 1 << 28}); + const top = git(['rev-parse', '--show-toplevel']); + if (top.error || top.status !== 0 || realpathSync(top.stdout.trim()) !== base) { + throw new Error(`${base} is not the top of a git checkout; the files read here are the files git tracks`); + } + const ls = git(['ls-files', '-z', '--full-name']); + if (ls.error || ls.status !== 0) throw new Error(`git ls-files failed in ${base}`); + return new Set(ls.stdout.split('\0').filter(Boolean)); +} + +export function repoFiles(root) { + const base = realpathSync(root); + let tracked = null; + const isTracked = p => (tracked ??= trackedPaths(base)).has(p); + const holdsTracked = p => { tracked ??= trackedPaths(base); return [...tracked].some(t => t.startsWith(`${p}/`)); }; + // What stands at the path itself, when no part of it is a link; else null. + const at = p => { + if (typeof p !== 'string' || p === '') return null; + const full = path.join(base, p); + try { return realpathSync(full) === full ? statSync(full) : null; } catch { return null; } + }; + const isFile = p => isTracked(p) && at(p)?.isFile() === true; + const isDir = p => at(p)?.isDirectory() === true && holdsTracked(p); + const bytes = p => { + if (!isFile(p)) throw new Error(`${p} is not a file that git tracks in the repository`); + return readFileSync(path.join(base, p)); + }; + const localFile = p => at(p)?.isFile() === true; + return { + root: base, + isFile, + isDir, + // A file or a directory: a ref may name either. + exists: p => isFile(p) || isDir(p), + bytes, + read: p => bytes(p).toString('utf8'), + // The tracked paths under a directory, in the order git lists them (sorted). + under: dir => { tracked ??= trackedPaths(base); return [...tracked].filter(t => t.startsWith(`${dir}/`)); }, + local: { + isFile: localFile, + isDir: p => at(p)?.isDirectory() === true, + // Nothing at all stands at the path, not even a link that leads nowhere. + isAbsent: p => { try { lstatSync(path.join(base, p)); return false; } catch { return true; } }, + read: p => { + if (!localFile(p)) throw new Error(`${p} is not a plain file inside the repository`); + return readFileSync(path.join(base, p), 'utf8'); + }, + }, + }; +} diff --git a/scripts/site/site.mjs b/scripts/site/site.mjs index 9750479a..55a75710 100644 --- a/scripts/site/site.mjs +++ b/scripts/site/site.mjs @@ -8,15 +8,21 @@ // // It writes one generated front page, then renders that page and each view // with Asciidoctor into OUT, at the same paths as the views. It fails closed: -// - Asciidoctor runs with --failure-level=WARN, so any warning fails. +// - Asciidoctor runs with --failure-level=WARN, so any warning fails, and +// in secure mode, so it reads no file but the page it renders. // - A view header that no longer names its source fails the build. // - A relative link to a file that is neither in the site nor in the // repository fails. A relative link to a repository file that is not in // the site becomes an absolute GitHub link at `main`. -import {readFileSync, writeFileSync, existsSync, mkdirSync, mkdtempSync, readdirSync, statSync} from 'node:fs'; +// - It reads from the repository only files that git tracks, at their own +// path (scripts/repo/files.mjs): each view, the front page's sources and +// each asset it copies. A view or an asset that is a link, or untracked, +// fails the build, so nothing from outside the repository enters the site. +import {readFileSync, writeFileSync, mkdirSync, mkdtempSync, readdirSync, statSync} from 'node:fs'; import {spawnSync} from 'node:child_process'; import {tmpdir} from 'node:os'; import path from 'node:path'; +import {repoFiles, findProgram} from '../repo/files.mjs'; export const GITHUB = 'https://github.com/hyperpolymath/mathesis'; @@ -125,21 +131,27 @@ const walk = (root, dir = '') => readdirSync(path.join(root, dir)).flatMap(n => // run it by its absolute path, so no relative PATH entry can pick the program. export function findAsciidoctor(env = process.env) { if (env.ASCIIDOCTOR) return env.ASCIIDOCTOR; - for (const d of (env.PATH || '').split(path.delimiter)) { - if (path.isAbsolute(d) && existsSync(path.join(d, 'asciidoctor'))) return path.join(d, 'asciidoctor'); - } - throw new Error('asciidoctor not found in an absolute directory of PATH (set ASCIIDOCTOR to its path)'); + try { return findProgram('asciidoctor', env); } catch (e) { throw new Error(`${e.message} (set ASCIIDOCTOR to its path)`); } } +// Asciidoctor runs in secure mode, so it reads no file but the page it renders: +// an include:: in a view becomes a link to its target (which the link check then +// fails), never the target's text, wherever the target is. Safe mode would read it, +// and with the base directory at "/" its jail is the whole file system. linkcss! +// keeps the stylesheet embedded, as it was in safe mode; it is part of Asciidoctor, +// not a file of the repository. function asciidoctor(args) { - const r = spawnSync(findAsciidoctor(), ['-S', 'safe', '-B', '/', '--failure-level=WARN', '-a', 'nofooter', '-a', 'webfonts!', ...args], {encoding: 'utf8'}); + const r = spawnSync(findAsciidoctor(), ['-S', 'secure', '-a', 'linkcss!', '-B', '/', '--failure-level=WARN', '-a', 'nofooter', '-a', 'webfonts!', ...args], {encoding: 'utf8'}); if (r.error) throw new Error(`asciidoctor not runnable: ${r.error.message}`); process.stderr.write(r.stderr || ''); if (r.status !== 0) throw new Error(`asciidoctor failed (status ${r.status})`); } export function build(root, out) { - const read = f => readFileSync(path.join(root, f), 'utf8'); + const files = repoFiles(root); + const unread = [...VIEWS.map(v => v.file), ...VIEWS.flatMap(v => v.assets ?? [])].filter(f => !files.isFile(f)); + if (unread.length) throw new Error(unread.map(f => `${f} is not a file that git tracks in the repository`).join('\n')); + const read = files.read; mkdirSync(out, {recursive: true}); const stage = mkdtempSync(path.join(tmpdir(), 'mathesis-site-')); writeFileSync(path.join(stage, 'index.adoc'), frontPage(read)); @@ -149,20 +161,20 @@ export function build(root, out) { // a relative image stays relative there and is checked like any link. for (const a of VIEWS.flatMap(v => v.assets ?? [])) { mkdirSync(path.dirname(path.join(out, a)), {recursive: true}); - writeFileSync(path.join(out, a), readFileSync(path.join(root, a))); + writeFileSync(path.join(out, a), files.bytes(a)); } const pages = walk(out).filter(f => f.endsWith('.html')); - const files = new Set(walk(out)); + const built = new Set(walk(out)); const ids = new Map(); const idsOf = p => ids.get(p) ?? ids.set(p, new Set([...readFileSync(path.join(out, p), 'utf8').matchAll(/\bid="([^"]+)"/g)].map(m => m[1]))).get(p); const errors = []; for (const p of pages) { - const r = checkLinks(p, readFileSync(path.join(out, p), 'utf8'), x => files.has(x), x => existsSync(path.join(root, x)), idsOf); + const r = checkLinks(p, readFileSync(path.join(out, p), 'utf8'), x => built.has(x), x => files.exists(x.replace(/\/$/, '')), idsOf); writeFileSync(path.join(out, p), r.html); errors.push(...r.errors); } - for (const v of VIEWS) if (!files.has(htmlPath(v.file))) errors.push(`missing page ${htmlPath(v.file)}`); + for (const v of VIEWS) if (!built.has(htmlPath(v.file))) errors.push(`missing page ${htmlPath(v.file)}`); if (errors.length) throw new Error(errors.join('\n')); return pages; } diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index df409af8..f067adc5 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -27,12 +27,13 @@ // The "me" advisor is private (owner ruling 2026-11-24): its notes are kept // outside this public repository, and a node carries at most the neutral tag // `owner_value: "high"`. Counsel under the key `me` is refused. -import {readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, statSync, lstatSync, realpathSync} from 'node:fs'; +import {writeFileSync, mkdirSync} from 'node:fs'; import path from 'node:path'; import {parseJsonl} from '../atlas/census-atlas.mjs'; import {jcs} from '../registry/theory-ledger.mjs'; import {isClaimId, isDocPath} from '../registry/claims-registry.mjs'; import {adrStatus} from '../decisions/adr-status.mjs'; +import {repoFiles} from '../repo/files.mjs'; export const ROOT = path.resolve(import.meta.dir, '../..'); export const DIR = 'docs/ultraplan'; @@ -91,15 +92,29 @@ export function wellFormed(v) { return true; } -// Each text in the plan is one line: a control character (a line break among -// them) would let a text start a line of the page, where AsciiDoc reads block -// syntax. This is the plan's own rule, stricter than I-JSON. -const hasControl = s => /[\u0000-\u001f\u007f-\u009f]/.test(s); -function oneLine(v) { - if (typeof v === 'string') return !hasControl(v); - if (Array.isArray(v)) return v.every(oneLine); - if (v !== null && typeof v === 'object') return Object.entries(v).every(([k, x]) => !hasControl(k) && oneLine(x)); - return true; +// Each text in the plan is one line of plain text, and the page shows it exactly +// as written. So no string in a record, its keys included, holds any of these. +// This is the plan's own rule, stricter than I-JSON. +// - A control character: a line break among them would let a text start a line +// of the page, where AsciiDoc reads block syntax. +// - A line or paragraph separator (U+2028, U+2029): a browser breaks the line there. +// - A run of two or more spaces, or a space at the start or end: HTML shows a run +// of spaces as one, and drops a space at the edge of a cell. +const TEXT_FAULTS = [ + [/[\u0000-\u001f\u007f-\u009f]/, 'a control character'], + [/[\u2028\u2029]/, 'a line or paragraph separator (U+2028 or U+2029)'], + [/ {2}/, 'a run of spaces'], + [/^ | $/, 'a space at the start or end of a text'], +]; +// The first fault of any string in a record, or null. +function textFault(v) { + if (typeof v === 'string') return TEXT_FAULTS.find(([re]) => re.test(v))?.[1] ?? null; + const parts = Array.isArray(v) ? v : (v !== null && typeof v === 'object' ? Object.entries(v).flat() : []); + for (const x of parts) { + const fault = textFault(x); + if (fault) return fault; + } + return null; } export function readSource(text, name) { @@ -107,8 +122,9 @@ export function readSource(text, name) { const lines = text === '' ? [] : text.slice(0, -1).split('\n'); rows.forEach((r, i) => { if (!wellFormed(r)) throw new Error(`${name}: line ${i + 1} holds a lone surrogate or a Unicode noncharacter, which I-JSON refuses`); - if (!oneLine(r)) throw new Error(`${name}: line ${i + 1} holds a control character; each text in the plan is one line`); - if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); write it as ${jcs(r)}`); + const fault = textFault(r); + if (fault) throw new Error(`${name}: line ${i + 1} holds ${fault}; each text in the plan is one line of plain text, shown as written`); + if (jcs(r) !== lines[i]) throw new Error(`${name}: line ${i + 1} is not in JCS form (RFC 8785); run: sed -n ${i + 1}p ${name} | bun scripts/ijson-jcs-cli.js canon`); }); return rows; } @@ -159,7 +175,7 @@ const EVIDENCE = { path(ev, ctx) { const p = ev.path; if (!isRepoPath(p)) return `evidence path ${JSON.stringify(p)} is not a repository path`; - return ctx.isFile(p) ? null : `evidence path ${p} is not a file in the repository`; + return ctx.isFile(p) ? null : `evidence path ${p} is not a file that git tracks in the repository`; }, claim(ev, ctx) { // The registry's own rule, so any claim it can list can be cited here. @@ -176,7 +192,7 @@ const EVIDENCE = { if (!files.length) return `no ADR ${ev.adr} in docs/decisions`; if (files.length > 1) return `ADR ${ev.adr} is ambiguous: ${files.join(', ')} share the number`; const [file] = files; - if (!ctx.isFile(file)) return `ADR ${ev.adr} (${file}) is not a file in the repository`; + if (!ctx.isFile(file)) return `ADR ${ev.adr} (${file}) is not a file that git tracks in the repository`; // Its header states the status and its Status section agrees (owner ruling 2026-11-25). const st = adrStatus(ctx.read(file)); if (st.header === null) return `ADR ${ev.adr} states no readable status in its header (:status: ACCEPTED, as the ADR template has it)`; @@ -220,8 +236,8 @@ const REF = { return typeof r.commit === 'string' && /^[0-9a-f]{40}$/.test(r.commit) ? null : `ref commit ${JSON.stringify(r.commit)} is not a full commit id`; }, here(r, ctx) { - if (r.at === undefined) return ctx.exists(r.path) ? null : `ref path ${r.path} is not in the repository`; - if (!ctx.isFile(r.path)) return `ref path ${r.path} is not a file in the repository`; + if (r.at === undefined) return ctx.exists(r.path) ? null : `ref path ${r.path} is not a file or directory that git tracks in the repository`; + if (!ctx.isFile(r.path)) return `ref path ${r.path} is not a file that git tracks in the repository`; const k = occurrences(ctx.read(r.path), r.at); return k === 1 ? null : `ref ${r.path} holds ${JSON.stringify(r.at)} ${k} times; a ref quotes a passage that occurs exactly once`; }, @@ -497,7 +513,7 @@ export function derive(byId, advisors) { // end no table cell or link, form no span and name no attribute, wherever it // stands: at the start of a line, in a table, in a heading or in a link's text. // Letters, digits, blanks and every character beyond ASCII pass unchanged. -const text = s => String(s).replace(/[\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/g, c => `&#${c.charCodeAt(0)};`); +const text = s => String(s).replace(/[\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/g, c => `&#${c.codePointAt(0)};`); const nameOf = (byId, id) => `${byId.get(id).glyph} ${byId.get(id).name}`; // A link to a node, as the xref macro, with its text escaped like any other. const xref = (byId, id) => `xref:${id}[${text(nameOf(byId, id))}]`; @@ -832,40 +848,26 @@ export function renderSvg(byId, d) { // โ”€โ”€ Driver โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ +// Every path a check reads goes through the repository's files (scripts/repo/files.mjs): +// a file that git tracks, at its own path, with no link along it. The views are +// read and written as plain files inside the repository, tracked yet or not. export function context(root = ROOT) { - const decisions = path.join(root, 'docs/decisions'); + const files = repoFiles(root); const registry = 'docs/atlas/generated/registry.adoc'; - // The real path inside the repository (symlinks resolved) of a regular file, or - // of what `kind` accepts, or null. Every path the checks read goes through it. - const inside = (p, kind = s => s.isFile()) => { - try { - const base = realpathSync(root), real = realpathSync(path.join(root, p)); - return real.startsWith(base + path.sep) && kind(statSync(real)) ? real : null; - } catch { return null; } - }; - const read = p => { - const real = inside(p); - if (!real) throw new Error(`${p} is not a file in the repository`); - return readFileSync(real, 'utf8'); - }; - // What stands at a path itself, a link not followed, or null when nothing does. - const entry = p => { try { return lstatSync(path.join(root, p)); } catch { return null; } }; return { - isFile: p => inside(p) !== null, - // A file or a directory: a ref may name either. - exists: p => inside(p, s => s.isFile() || s.isDirectory()) !== null, - isDir: p => inside(p, s => s.isDirectory()) !== null, - // A regular file inside the repository that is not itself a link. - isPlainFile: p => entry(p)?.isFile() === true && inside(p) !== null, - isAbsent: p => entry(p) === null, - read, - // No registry view means no claim is listed; one that leads outside the repository is refused. - registry: existsSync(path.join(root, registry)) ? read(registry) : '', - // Every decision record with this number, in a fixed order. Only the boilerplate - // NNNN-template.adoc is set aside; a record such as 0006-template-inheritance.adoc counts. - adrFiles: n => (existsSync(decisions) ? readdirSync(decisions) : []) - .filter(x => x.startsWith(`${n}-`) && x.endsWith('.adoc') && x !== `${n}-template.adoc`) - .sort(cmp).map(x => `docs/decisions/${x}`), + isFile: files.isFile, + exists: files.exists, + read: files.read, + local: files.local, + // No registry view means no claim is listed; anything else at its path must be + // a tracked file, or it is refused. + registry: files.local.isAbsent(registry) ? '' : files.read(registry), + // Every tracked decision record with this number, in a fixed order. Only the + // boilerplate NNNN-template.adoc is set aside; a record such as + // 0006-template-inheritance.adoc counts. + adrFiles: n => files.under('docs/decisions') + .filter(x => /^docs\/decisions\/[^/]+\.adoc$/.test(x) && x.startsWith(`docs/decisions/${n}-`) && x !== `docs/decisions/${n}-template.adoc`) + .sort(cmp), }; } @@ -884,13 +886,13 @@ export function generate(root = ROOT) { const VIEWS = [VIEW, SVG]; export function staleViews(out, root = ROOT) { const ctx = context(root); - return VIEWS.filter(f => !ctx.isPlainFile(f) || ctx.read(f) !== out[f]); + return VIEWS.filter(f => !ctx.local.isFile(f) || ctx.local.read(f) !== out[f]); } export function writeViews(out, root = ROOT) { const ctx = context(root); - if (!ctx.isDir(DIR)) throw new Error(`${DIR} is not a directory in the repository`); + if (!ctx.local.isDir(DIR)) throw new Error(`${DIR} is not a directory in the repository`); mkdirSync(path.join(root, DIR, 'generated'), {recursive: true}); - const unsafe = VIEWS.filter(f => !ctx.isDir(path.dirname(f)) || !(ctx.isAbsent(f) || ctx.isPlainFile(f))); + const unsafe = VIEWS.filter(f => !ctx.local.isDir(path.dirname(f)) || !(ctx.local.isAbsent(f) || ctx.local.isFile(f))); if (unsafe.length) throw new Error(`not written: ${unsafe.join(', ')}; a view is a plain file inside the repository, not a link`); for (const f of VIEWS) writeFileSync(path.join(root, f), out[f]); } diff --git a/tests/repo/files.test.mjs b/tests/repo/files.test.mjs new file mode 100644 index 00000000..b67d72d5 --- /dev/null +++ b/tests/repo/files.test.mjs @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// What the generators may read from the repository: a file that git tracks, at +// its own path, with no link along it (scripts/repo/files.mjs). +import {test, expect, afterAll} from 'bun:test'; +import {mkdtempSync, mkdirSync, writeFileSync, rmSync, symlinkSync, chmodSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import path from 'node:path'; +import {repoFiles, findProgram} from '../../scripts/repo/files.mjs'; + +const dirs = []; +afterAll(() => { for (const d of dirs) rmSync(d, {recursive: true, force: true}); }); +const temp = prefix => { const d = mkdtempSync(path.join(tmpdir(), prefix)); dirs.push(d); return d; }; +const git = (root, ...args) => { + const r = Bun.spawnSync(['git', '-C', root, '-c', 'init.defaultBranch=main', ...args]); + if (r.exitCode !== 0) throw new Error(`git ${args.join(' ')}: ${r.stderr}`); +}; +// A checkout: README.adoc, docs/a.adoc and docs/sub/b.adoc tracked, docs/loose.adoc and the +// directory doc/ (a prefix of docs) holding only an untracked file. +function checkout() { + const root = temp('repo-files-'); + mkdirSync(path.join(root, 'docs/sub'), {recursive: true}); + mkdirSync(path.join(root, 'doc')); + mkdirSync(path.join(root, 'empty')); + writeFileSync(path.join(root, 'README.adoc'), 'r\n'); + writeFileSync(path.join(root, 'docs/a.adoc'), 'a\n'); + writeFileSync(path.join(root, 'docs/sub/b.adoc'), 'b\n'); + git(root, 'init', '-q'); + git(root, 'add', '-A'); + writeFileSync(path.join(root, 'docs/loose.adoc'), 'loose\n'); + writeFileSync(path.join(root, 'doc/x.adoc'), 'x\n'); + return root; +} + +test('a file counts when git tracks it and it stands at its own path', () => { + const root = checkout(); + const files = repoFiles(root); + expect(files.isFile('docs/a.adoc')).toBe(true); + expect(files.read('docs/sub/b.adoc')).toBe('b\n'); + expect(files.bytes('docs/a.adoc')).toEqual(Buffer.from('a\n')); + // Untracked, in .git, absent, or not a path at all: not a file of the repository. + for (const p of ['docs/loose.adoc', '.git/HEAD', '.git/config', 'docs/none.adoc', '', 42, undefined]) { + expect(files.isFile(p)).toBe(false); + expect(files.exists(p)).toBe(false); + } + expect(() => files.read('docs/loose.adoc')).toThrow(/^docs\/loose\.adoc is not a file that git tracks in the repository$/); + // A tracked path that is now a directory is not a file. + rmSync(path.join(root, 'docs/a.adoc')); + mkdirSync(path.join(root, 'docs/a.adoc')); + writeFileSync(path.join(root, 'docs/a.adoc/inner'), 'x\n'); + expect(files.isFile('docs/a.adoc')).toBe(false); +}); + +test('a directory counts when it stands at its own path and holds a tracked file', () => { + const root = checkout(); + const files = repoFiles(root); + expect(files.isDir('docs')).toBe(true); + expect(files.isDir('docs/sub')).toBe(true); + expect(files.exists('docs/sub')).toBe(true); + // An empty directory, one holding only untracked files, and one whose name is a + // prefix of a tracked directory's (doc, beside docs) hold no tracked file. + for (const p of ['empty', 'doc', 'docs/sub/b.adoc']) { + expect(files.isDir(p)).toBe(false); + if (p !== 'docs/sub/b.adoc') expect(files.exists(p)).toBe(false); + } + // A tracked directory gone from the checkout is not one. + rmSync(path.join(root, 'docs/sub'), {recursive: true}); + expect(files.isDir('docs/sub')).toBe(false); + expect(files.exists('docs/sub')).toBe(false); + expect(files.under('docs')).toEqual(['docs/a.adoc', 'docs/sub/b.adoc']); +}); + +test('no link along a path counts, even one git tracks that stays inside', () => { + const root = checkout(); + const outside = temp('repo-files-out-'); + writeFileSync(path.join(outside, 'secret.adoc'), 'secret\n'); + symlinkSync(path.join(outside, 'secret.adoc'), path.join(root, 'docs/out.adoc')); + symlinkSync('a.adoc', path.join(root, 'docs/in.adoc')); + symlinkSync('docs', path.join(root, 'linked')); + git(root, 'add', '-A'); + const files = repoFiles(root); + for (const p of ['docs/out.adoc', 'docs/in.adoc', 'linked/a.adoc']) { + expect(files.isFile(p)).toBe(false); + expect(files.local.isFile(p)).toBe(false); + expect(() => files.read(p)).toThrow(/is not a file that git tracks/); + expect(() => files.local.read(p)).toThrow(/is not a plain file inside the repository/); + } + expect(files.isDir('linked')).toBe(false); + expect(files.local.isDir('linked')).toBe(false); +}); + +test('local paths: plain files and directories inside, tracked or not', () => { + const root = checkout(); + const files = repoFiles(root); + expect(files.local.isFile('docs/loose.adoc')).toBe(true); + expect(files.local.read('docs/loose.adoc')).toBe('loose\n'); + expect(files.local.isDir('empty')).toBe(true); + expect(files.local.isDir('')).toBe(false); + expect(files.local.isFile('empty')).toBe(false); + expect(files.local.isAbsent('docs/none.adoc')).toBe(true); + expect(files.local.isAbsent('docs/a.adoc')).toBe(false); + // A link that leads nowhere is not absent: something stands at the path. + symlinkSync(path.join(root, 'nowhere'), path.join(root, 'dangling')); + expect(files.local.isAbsent('dangling')).toBe(false); + expect(files.local.isFile('dangling')).toBe(false); +}); + +test('only the top of a git checkout is read, and a failing git fails loudly', () => { + const bare = temp('repo-files-nogit-'); + expect(() => repoFiles(bare).isFile('x')).toThrow(/is not the top of a git checkout/); + const root = checkout(); + expect(() => repoFiles(path.join(root, 'docs')).isFile('a.adoc')).toThrow(/is not the top of a git checkout/); + // An index git cannot read: git rev-parse still answers, git ls-files does not. + writeFileSync(path.join(root, '.git/index'), 'not an index'); + expect(() => repoFiles(root).isFile('docs/a.adoc')).toThrow(/^git ls-files failed in /); +}); + +test('a program is found only in an absolute directory of PATH', () => { + const bin = temp('repo-files-bin-'); + writeFileSync(path.join(bin, 'prog'), '#!/bin/sh\n'); + chmodSync(path.join(bin, 'prog'), 0o755); + expect(findProgram('prog', {PATH: `/nonexistent${path.delimiter}${bin}`})).toBe(path.join(bin, 'prog')); + // The same directory named relatively is passed over. + expect(() => findProgram('prog', {PATH: path.relative(process.cwd(), bin)})).toThrow(/^prog not found in an absolute directory of PATH$/); + expect(() => findProgram('prog', {})).toThrow(/not found/); +}); diff --git a/tests/site/site.test.mjs b/tests/site/site.test.mjs index 2570e728..dd57e420 100644 --- a/tests/site/site.test.mjs +++ b/tests/site/site.test.mjs @@ -1,8 +1,10 @@ // SPDX-License-Identifier: MPL-2.0 // SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell import {test, expect} from 'bun:test'; -import {readFileSync} from 'node:fs'; -import {VIEWS, frontPage, checkLinks, htmlPath, findAsciidoctor, GITHUB} from '../../scripts/site/site.mjs'; +import {readFileSync, writeFileSync, mkdirSync, mkdtempSync, rmSync, symlinkSync, existsSync, readdirSync, statSync} from 'node:fs'; +import {tmpdir} from 'node:os'; +import path from 'node:path'; +import {VIEWS, frontPage, checkLinks, htmlPath, findAsciidoctor, build, GITHUB} from '../../scripts/site/site.mjs'; const root = new URL('../../', import.meta.url).pathname; const read = f => readFileSync(root + f, 'utf8'); @@ -55,3 +57,86 @@ test('asciidoctor is found only in an absolute directory of PATH', () => { expect(findAsciidoctor({ASCIIDOCTOR: '/x/asciidoctor'})).toBe('/x/asciidoctor'); expect(() => findAsciidoctor({PATH: 'relative/dir'})).toThrow(/not found/); }); + +// A throwaway checkout holding every view, each a plain tracked file whose header +// names its source, and a directory outside it. Removed when `body` returns. +function withSite(body) { + const tmp = prefix => mkdtempSync(path.join(tmpdir(), prefix)); + const fix = tmp('site-fix-'), outside = tmp('site-outside-'), outs = tmp('site-out-'); + const git = (...args) => { + const r = Bun.spawnSync(['git', '-C', fix, '-c', 'init.defaultBranch=main', ...args]); + if (r.exitCode !== 0) throw new Error(`git ${args.join(' ')}: ${r.stderr}`); + }; + try { + git('init', '-q'); + for (const f of [...VIEWS.map(v => v.file), ...VIEWS.flatMap(v => v.assets ?? [])]) { + mkdirSync(path.dirname(path.join(fix, f)), {recursive: true}); + const v = VIEWS.find(x => x.file === f); + writeFileSync(path.join(fix, f), v ? `// ${v.needs}\n= View\n` : '\n'); + } + git('add', '-A'); + body({fix, outside, out: path.join(outs, 'site'), git}); + } finally { + for (const d of [fix, outside, outs]) rmSync(d, {recursive: true, force: true}); + } +} +const pathRe = p => p.replaceAll('.', '\\.'); +// Every file the build wrote, and whether any holds `s`. +const holds = (dir, s) => existsSync(dir) && readdirSync(dir, {recursive: true}) + .some(f => statSync(path.join(dir, f)).isFile() && readFileSync(path.join(dir, f), 'utf8').includes(s)); + +// The site takes from the repository only files that git tracks, at their own +// path. An asset or a view that is a link, even one git tracks, or one git does +// not track, fails the build before anything is written or copied. +test('the site copies nothing from outside the repository', () => withSite(({fix, outside, out, git}) => { + writeFileSync(path.join(outside, 'secret.svg'), 'secret\n'); + const [asset] = VIEWS.flatMap(v => v.assets ?? []); + rmSync(path.join(fix, asset)); + symlinkSync(path.join(outside, 'secret.svg'), path.join(fix, asset)); + git('add', '-A'); + expect(() => build(fix, out)).toThrow(new RegExp(`^${pathRe(asset)} is not a file that git tracks in the repository$`)); + expect(existsSync(out)).toBe(false); + // A plain asset that git does not track is refused the same way. + rmSync(path.join(fix, asset)); + writeFileSync(path.join(fix, asset), '\n'); + git('rm', '-q', '--cached', '-f', asset); + expect(() => build(fix, out)).toThrow(new RegExp(`^${pathRe(asset)} is not a file that git tracks in the repository$`)); + // So is a view that is a link into the repository. + git('add', '-A'); + const [view] = VIEWS; + rmSync(path.join(fix, view.file)); + symlinkSync(path.join(fix, VIEWS[1].file), path.join(fix, view.file)); + git('add', '-A'); + expect(() => build(fix, out)).toThrow(new RegExp(`^${pathRe(view.file)} is not a file that git tracks`)); + expect(existsSync(out)).toBe(false); +})); + +// A link in a view to a file of the repository that the site does not hold +// becomes a GitHub link, but only when git tracks the file: an untracked one +// would be a link to nothing on GitHub, so it fails the build. +test('a view links on GitHub only to files git tracks', () => withSite(({fix, out, git}) => { + const [view] = VIEWS; + const up = path.posix.relative(path.posix.dirname(view.file), 'notes.adoc'); + writeFileSync(path.join(fix, view.file), `// ${view.needs}\n= View\n\nlink:${up}[notes]\n`); + writeFileSync(path.join(fix, 'notes.adoc'), '= Notes\n'); + git('add', view.file); + expect(() => build(fix, out)).toThrow(/broken relative link .*notes\.adoc \(not in the site, not in the repository\)/); + git('add', 'notes.adoc'); + build(fix, `${out}-tracked`); + expect(readFileSync(path.join(`${out}-tracked`, htmlPath(view.file)), 'utf8')).toContain(`${GITHUB}/blob/main/notes.adoc`); +})); + +// Asciidoctor reads no file but the page it renders: an include in a view, of a +// file outside the repository, is not read into the site; it fails the build. +test('an include in a view reads nothing into the site', () => withSite(({fix, outside, out, git}) => { + expect(build(fix, out).length).toBe(VIEWS.length + 1); + writeFileSync(path.join(outside, 'secret.txt'), 'SECRET-LINE\n'); + const [view] = VIEWS; + writeFileSync(path.join(fix, view.file), `// ${view.needs}\n= View\n\ninclude::${path.join(outside, 'secret.txt')}[]\n`); + git('add', '-A'); + const again = `${out}-again`; + expect(() => build(fix, again)).toThrow(/broken relative link .*secret\.txt/); + expect(holds(again, 'SECRET-LINE')).toBe(false); + expect(holds(again, 'secret.txt')).toBe(true); // a link to it, never its text + rmSync(again, {recursive: true, force: true}); +})); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index cba0267f..47341596 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -12,6 +12,14 @@ import {jcs} from '../../scripts/registry/theory-ledger.mjs'; import {adrAccepted} from '../../scripts/decisions/adr-status.mjs'; const roots = []; +// git, run in a fixture: the generator reads only what git tracks there. +const git = (root, ...args) => { + const r = Bun.spawnSync(['git', '-C', root, '-c', 'user.name=t', '-c', 'user.email=t@example.invalid', '-c', 'init.defaultBranch=main', ...args]); + if (r.exitCode !== 0) throw new Error(`git ${args.join(' ')}: ${r.stderr}`); + return r.stdout.toString(); +}; +// Track everything now in the fixture, as a commit would. +const track = root => { git(root, 'add', '-A'); return root; }; afterAll(() => { for (const r of roots) rmSync(r, {recursive: true, force: true}); }); const ADVISORS = [ @@ -45,12 +53,13 @@ function fixture({advisors = ADVISORS, nodes = BASE, expeditions = [], registry writeFileSync(path.join(root, 'docs/ultraplan/advisors.jsonl'), raw.advisors ?? jl(advisors)); writeFileSync(path.join(root, 'docs/ultraplan/tree.jsonl'), raw.nodes ?? jl(nodes)); writeFileSync(path.join(root, 'docs/ultraplan/expeditions.jsonl'), raw.expeditions ?? jl(expeditions)); - return root; + git(root, 'init', '-q'); + return track(root); } // The page shows each text as written: every ASCII punctuation mark in it is a // numeric character reference (the rule, stated here apart from the generator). const PUNCTUATION = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'; -const plainOnPage = t => [...t].map(c => (PUNCTUATION.includes(c) ? `&#${c.charCodeAt(0)};` : c)).join(''); +const plainOnPage = t => [...t].map(c => (PUNCTUATION.includes(c) ? `&#${c.codePointAt(0)};` : c)).join(''); const refuses = (opts, re) => expect(() => generate(fixture(opts))).toThrow(re); // Replace fields of one node; a field set to undefined is removed. const strip = o => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined)); @@ -107,48 +116,80 @@ test('the views are deterministic', () => { test('done needs evidence that holds', () => { refuses({nodes: swap('root', {evidence: []})}, /node root: done needs evidence/); - refuses({nodes: swap('root', {evidence: [{path: 'NOPE.adoc'}]})}, /evidence path NOPE.adoc is not a file in the repository/); + refuses({nodes: swap('root', {evidence: [{path: 'NOPE.adoc'}]})}, /evidence path NOPE.adoc is not a file that git tracks in the repository/); refuses({nodes: swap('root', {evidence: [{path: '../etc/passwd'}]})}, /is not a repository path/); refuses({nodes: swap('root', {evidence: [{path: '.'}]})}, /evidence path "." is not a repository path/); - refuses({nodes: swap('root', {evidence: [{path: 'docs'}]})}, /evidence path docs is not a file in the repository/); + refuses({nodes: swap('root', {evidence: [{path: 'docs'}]})}, /evidence path docs is not a file that git tracks in the repository/); refuses({nodes: swap('root', {evidence: [{path: 'docs/decisions'}]})}, /evidence path docs\/decisions is not a file/); // A committed symlink to a file outside the repository is not evidence in it. const outside = mkdtempSync(path.join(tmpdir(), 'ultraplan-outside-')); roots.push(outside); writeFileSync(path.join(outside, 'secret.txt'), 'x\n'); const root = fixture({nodes: swap('root', {evidence: [{path: 'link.txt'}]})}); - symlinkSync(path.join(outside, 'secret.txt'), path.join(root, 'link.txt')); - expect(() => generate(root)).toThrow(/evidence path link.txt is not a file in the repository/); + symlinkSync(path.join(outside, 'secret.txt'), path.join(track(root), 'link.txt')); + track(root); + expect(() => generate(root)).toThrow(/evidence path link.txt is not a file that git tracks in the repository/); const inside = fixture({nodes: swap('root', {evidence: [{path: 'inner.adoc'}]})}); + // A link that stays inside is refused too: a path names the file itself, and + // git tracks a link, not the file it leads to. symlinkSync('README.adoc', path.join(inside, 'inner.adoc')); - expect(() => generate(inside)).not.toThrow(); + track(inside); + expect(() => generate(inside)).toThrow(/evidence path inner\.adoc is not a file that git tracks in the repository/); + // So is a path through a linked directory, though the file it reaches is tracked. + const viaDir = fixture({nodes: swap('root', {evidence: [{path: 'notes/README.adoc'}]})}); + symlinkSync('.', path.join(viaDir, 'notes')); + track(viaDir); + expect(() => generate(viaDir)).toThrow(/evidence path notes\/README\.adoc is not a file that git tracks/); + // A file git does not track is no evidence, though it stands in the checkout: + // nothing a reviewer could read in the commit. Nor is anything in .git. + const loose = fixture({nodes: swap('root', {evidence: [{path: 'draft.adoc'}]})}); + writeFileSync(path.join(loose, 'draft.adoc'), 'x\n'); + expect(() => generate(loose)).toThrow(/evidence path draft\.adoc is not a file that git tracks in the repository/); + track(loose); + expect(() => generate(loose)).not.toThrow(); + for (const p of ['.git/config', '.git/HEAD']) refuses({nodes: swap('root', {evidence: [{path: p}]})}, /is not a file that git tracks in the repository/); + // A tracked file that is gone from the checkout is no evidence either. + const gone = fixture(); + rmSync(path.join(gone, 'README.adoc')); + expect(() => generate(gone)).toThrow(/evidence path README\.adoc is not a file that git tracks/); // An ADR that is a symlink to an accepted record outside the repository is not one in it. writeFileSync(path.join(outside, 'accepted.adoc'), '= ADR\n\n=== Status\n\n*Accepted.*\n'); const adr = fixture({nodes: swap('tool', {evidence: [{adr: '0007'}]})}); symlinkSync(path.join(outside, 'accepted.adoc'), path.join(adr, 'docs/decisions/0007-outside.adoc')); - expect(() => generate(adr)).toThrow(/ADR 0007 \(docs\/decisions\/0007-outside\.adoc\) is not a file in the repository/); + track(adr); + expect(() => generate(adr)).toThrow(/ADR 0007 \(docs\/decisions\/0007-outside\.adoc\) is not a file that git tracks in the repository/); // The context reads no file outside the repository, whoever asks. - expect(() => context(adr).read('docs/decisions/0007-outside.adoc')).toThrow(/is not a file in the repository/); + expect(() => context(adr).read('docs/decisions/0007-outside.adoc')).toThrow(/is not a file that git tracks in the repository/); expect(context(adr).read('README.adoc')).toBe('= Fixture\n'); // The registry view is evidence too: one that leads outside the repository is refused. writeFileSync(path.join(outside, 'registry.adoc'), '|https://x/blob/c/P.adoc[o/r#T-1] at `c` |theorem |`PWG-1` |s |w\n'); const reg = fixture({nodes: swap('root', {evidence: [{claim: 'o/r#T-1'}]})}); rmSync(path.join(reg, 'docs/atlas/generated/registry.adoc')); symlinkSync(path.join(outside, 'registry.adoc'), path.join(reg, 'docs/atlas/generated/registry.adoc')); - expect(() => generate(reg)).toThrow(/docs\/atlas\/generated\/registry\.adoc is not a file in the repository/); + track(reg); + expect(() => generate(reg)).toThrow(/docs\/atlas\/generated\/registry\.adoc is not a file that git tracks in the repository/); refuses({nodes: swap('tool', {evidence: [{adr: '0005'}]})}, /ADR 0005 is PROPOSED, not ACCEPTED/); refuses({nodes: swap('tool', {evidence: [{adr: '0009'}]})}, /no ADR 0009/); // Two records with one number are refused, not picked between by directory order. const twin = fixture(); writeFileSync(path.join(twin, 'docs/decisions/0004-second.adoc'), '= ADR\n\n=== Status\n\n*Proposed.*\n'); + expect(() => generate(twin)).not.toThrow(); // untracked, so not yet a record + track(twin); + // A file in a directory named like a record is not a record. + const nested = fixture(); + mkdirSync(path.join(nested, 'docs/decisions/0004-notes')); + writeFileSync(path.join(nested, 'docs/decisions/0004-notes/draft.adoc'), '= Draft\n:status: PROPOSED\n\n=== Status\n\nProposed.\n'); + expect(() => generate(track(nested))).not.toThrow(); expect(() => generate(twin)).toThrow(/ADR 0004 is ambiguous: docs\/decisions\/0004-claims-registry\.adoc, docs\/decisions\/0004-second\.adoc share the number/); // Only the boilerplate NNNN-template.adoc is set aside: a record whose title says template counts, // and a template that shares a number with a record does not make it ambiguous. const titled = fixture({nodes: swap('tool', {evidence: [{adr: '0006'}]})}); writeFileSync(path.join(titled, 'docs/decisions/0006-template-inheritance.adoc'), '= ADR\n:status: ACCEPTED\n\n=== Status\n\n*Accepted.*\n'); + track(titled); expect(() => generate(titled)).not.toThrow(); const boiler = fixture(); writeFileSync(path.join(boiler, 'docs/decisions/0004-template.adoc'), '= Template\n\n=== Status\n\nProposed\n'); + track(boiler); expect(() => generate(boiler)).not.toThrow(); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', adr: '0004'}]})}, /exactly one of path, claim or adr/); refuses({nodes: swap('root', {evidence: [{path: 'README.adoc', min_pwg: 'PWG-1'}]})}, /min_pwg belongs to claim evidence only/); @@ -208,7 +249,7 @@ test('the me advisor writes nothing into the public tree', () => { test('evidence on an active node must hold too', () => { refuses({nodes: swap('theorem', {status: 'active', evidence: [{}]})}, /exactly one of path, claim or adr/); - refuses({nodes: swap('theorem', {status: 'active', evidence: [{path: 'NOPE.adoc'}]})}, /is not a file in the repository/); + refuses({nodes: swap('theorem', {status: 'active', evidence: [{path: 'NOPE.adoc'}]})}, /is not a file that git tracks in the repository/); expect(() => generate(fixture({nodes: swap('theorem', {status: 'active', evidence: [{path: 'README.adoc'}]})}))).not.toThrow(); refuses({nodes: swap('paper', {evidence: [{path: 'README.adoc'}]})}, /evidence belongs to a done or active node/); }); @@ -232,6 +273,16 @@ test('closed schema, blocked reasons and canonical lines', () => { refuses({nodes: swap('paper', {size: 'toString'})}, /size must be one of S, M, L, XL/); refuses({nodes: swap('paper', {size: 'constructor'})}, /size must be one of/); refuses({raw: {nodes: BASE.map(n => JSON.stringify(n, null, 0)).join('\n') + '\n'}}, /not in JCS form/); + // The message names the line and a command that writes its JCS form. It never + // echoes the record: a log is no place for a file's content. + const loose = BASE.map((n, i) => (i === 1 ? JSON.stringify(n, null, 1).replaceAll('\n', '') : jcs(n))); + let msg = ''; + try { generate(fixture({raw: {nodes: loose.join('\n') + '\n'}})); } catch (e) { msg = e.message; } + expect(msg).toBe('docs/ultraplan/tree.jsonl: line 2 is not in JCS form (RFC 8785); run: sed -n 2p docs/ultraplan/tree.jsonl | bun scripts/ijson-jcs-cli.js canon'); + // The command does what the message says: it writes the line's JCS form. + const canon = Bun.spawnSync(['bun', path.join(ROOT, 'scripts/ijson-jcs-cli.js'), 'canon'], {stdin: Buffer.from(loose[1] + '\n')}); + expect(canon.exitCode).toBe(0); + expect(canon.stdout.toString()).toBe(jcs(BASE[1])); // A lone surrogate survives JSON.parse and JSON.stringify alike; I-JSON refuses it. const lone = jcs({...BASE[0], name: 'x'}).replace('"name":"x"', '"name":"\\ud800"'); refuses({raw: {nodes: [lone, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a lone surrogate/); @@ -251,6 +302,18 @@ test('closed schema, blocked reasons and canonical lines', () => { } const ckey = jcs({...BASE[0], value: {maths: 1}}).replace('"maths":', '"m\\naths":'); refuses({raw: {nodes: [ckey, ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, /line 1 holds a control character/); + // And the page shows each text as written: a browser breaks a line at U+2028 or + // U+2029, and HTML shows a run of spaces as one and drops a space at a cell's edge. + const faulty = (extra, re) => refuses({raw: {nodes: [jcs({...BASE[0], ...extra}), ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, re); + for (const sep of ['\u2028', '\u2029']) faulty({summary: `one${sep}two`}, /line 1 holds a line or paragraph separator \(U\+2028 or U\+2029\)/); + faulty({summary: 'two spaces'}, /line 1 holds a run of spaces; each text in the plan is one line of plain text, shown as written/); + faulty({counsel: {maths: 'a wide gap'}}, /line 1 holds a run of spaces/); + faulty({refs: [{at: 'a b', path: 'README.adoc'}]}, /line 1 holds a run of spaces/); + faulty({summary: ' leading'}, /line 1 holds a space at the start or end of a text/); + faulty({counsel: {maths: 'trailing '}}, /line 1 holds a space at the start or end of a text/); + // One space, a no-break space and a tab-free text are as written, and pass. + const fine = generate(fixture({nodes: swap('root', {summary: 'one space and a\u00a0no-break space'})}))[VIEW]; + expect(fine).toContain(plainOnPage('one space and a\u00a0no-break space')); }); // Every text is plain (owner ruling 2026-11-25). A description-list marker, which @@ -279,15 +342,16 @@ test('a ref points at one place, and each ref in this repository is checked', () const odd = 'a `tick` + back\\slash'; const oddRoot = fixture({nodes: swap('paper', {refs: [{at: odd, path: 'notes.adoc'}]})}); writeFileSync(path.join(oddRoot, 'notes.adoc'), `${odd}\n`); + track(oddRoot); expect(generate(oddRoot)[VIEW]).toContain(`at \`${P(odd)}\``); // A quote that is gone, or that occurs more than once, names no one place. refused([{at: 'Gone', path: 'README.adoc'}], /node paper: ref README\.adoc holds "Gone" 0 times; a ref quotes a passage that occurs exactly once/); refused([{at: 'at', path: 'docs/decisions/0004-claims-registry.adoc'}], /holds "at" [2-9] times/); // Each part is checked: the path, what it names, the quote, the commit and the issue. - refused([{path: 'missing.adoc'}], /node paper: ref path missing\.adoc is not in the repository/); - refused([{at: 'x', path: 'docs/decisions'}], /ref path docs\/decisions is not a file in the repository/); + refused([{path: 'missing.adoc'}], /node paper: ref path missing\.adoc is not a file or directory that git tracks in the repository/); + refused([{at: 'x', path: 'docs/decisions'}], /ref path docs\/decisions is not a file that git tracks in the repository/); for (const p of ['../outside', '/etc/passwd', 'a/./b', 'a b', '']) refused([{path: p}], /is not a repository path/); - for (const q of [' padded', 'x'.repeat(161), '']) refused([{at: q, path: 'README.adoc'}], /is not a short quote/); + for (const q of ['\u00a0padded', 'x'.repeat(161), '']) refused([{at: q, path: 'README.adoc'}], /is not a short quote/); refused([{at: 'x', commit: '745fc74', path: 'a.adoc', repo: 'o/r'}], /ref commit "745fc74" is not a full commit id/); refused([{commit: 'a'.repeat(40), path: 'a.adoc', repo: 'nobody'}], /ref repo "nobody" is not OWNER\/REPO/); refused([{commit: 'a'.repeat(40), path: 'a.adoc'}], /ref repo undefined is not OWNER\/REPO/); @@ -300,6 +364,7 @@ test('a ref points at one place, and each ref in this repository is checked', () test('a quote counts every place it occurs, overlaps included', () => { const root = fixture({nodes: swap('paper', {refs: [{at: 'aaaa', path: 'notes.adoc'}]})}); writeFileSync(path.join(root, 'notes.adoc'), 'aaaaa\n'); + track(root); expect(() => generate(root)).toThrow(/ref notes\.adoc holds "aaaa" 2 times/); writeFileSync(path.join(root, 'notes.adoc'), 'aaaa b\n'); expect(() => generate(root)).not.toThrow(); @@ -321,7 +386,8 @@ test('the sources are read only as regular files inside the repository', () => { const root = fixture(); rmSync(path.join(root, 'docs/ultraplan', file)); symlinkSync(target, path.join(root, 'docs/ultraplan', file)); - expect(() => generate(root)).toThrow(new RegExp(`docs/ultraplan/${file.replace('.', '\\.')} is not a file in the repository`)); + track(root); + expect(() => generate(root)).toThrow(new RegExp(`docs/ultraplan/${file.replace('.', '\\.')} is not a file that git tracks in the repository`)); } }); @@ -385,10 +451,34 @@ test('a ref cannot lead out of the repository', () => { writeFileSync(path.join(outside, 'secret.adoc'), 'only once\n'); const root = fixture({nodes: swap('paper', {refs: [{at: 'only once', path: 'link.adoc'}]})}); symlinkSync(path.join(outside, 'secret.adoc'), path.join(root, 'link.adoc')); - expect(() => generate(root)).toThrow(/ref path link\.adoc is not a file in the repository/); + track(root); + expect(() => generate(root)).toThrow(/ref path link\.adoc is not a file that git tracks in the repository/); const dirRoot = fixture({nodes: swap('paper', {refs: [{path: 'away'}]})}); symlinkSync(outside, path.join(dirRoot, 'away')); - expect(() => generate(dirRoot)).toThrow(/ref path away is not in the repository/); + track(dirRoot); + expect(() => generate(dirRoot)).toThrow(/ref path away is not a file or directory that git tracks in the repository/); +}); + +// The answer does not hang on how the checkout is laid out: a linked worktree, +// where .git is a file, reads what a clone reads. And the generator runs only at +// the top of a checkout, where git can say what it tracks. +test('a linked worktree reads what a clone reads, and only a checkout is read', () => { + const main = fixture(); + git(main, 'commit', '-q', '-m', 'fixture'); + const linked = path.join(mkdtempSync(path.join(tmpdir(), 'ultraplan-wt-')), 'linked'); + roots.push(path.dirname(linked)); + git(main, 'worktree', 'add', '-q', linked); + expect(generate(linked)[VIEW]).toBe(generate(main)[VIEW]); + for (const root of [main, linked]) { + rmSync(path.join(root, 'docs/ultraplan/tree.jsonl')); + writeFileSync(path.join(root, 'docs/ultraplan/tree.jsonl'), swap('root', {evidence: [{path: '.git'}]}).map(n => jcs(n) + '\n').join('')); + expect(() => generate(root)).toThrow(/evidence path \.git is not a file that git tracks in the repository/); + } + // A directory that is not a checkout, or that is not the top of one, is refused. + const bare = mkdtempSync(path.join(tmpdir(), 'ultraplan-nogit-')); + roots.push(bare); + expect(() => context(bare).isFile('x')).toThrow(/is not the top of a git checkout/); + expect(() => generate(path.join(main, 'docs'))).toThrow(/is not the top of a git checkout/); }); test('a summary that looks like block syntax is text on the page', () => { @@ -511,7 +601,7 @@ test('the evidence parsers read the real registry view and ADRs', () => { // section agrees (owner ruling 2026-11-25); each failure says which part fails. test('ADR evidence needs its header and its Status section to agree', () => { const root = fixture({nodes: swap('tool', {evidence: [{adr: '0007'}]})}); - const put = s => writeFileSync(path.join(root, 'docs/decisions/0007-x.adoc'), s); + const put = s => { writeFileSync(path.join(root, 'docs/decisions/0007-x.adoc'), s); track(root); }; put('= ADR\n\n=== Status\n\nAccepted\n'); expect(() => generate(root)).toThrow(/node tool: ADR 0007 states no readable status in its header/); put('= ADR\n:status: ACCEPTED\n\n=== Status\n\nProposed.\n'); From 6d96935d8f76199e98546a5ba9cb9d7b5341fcee Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 11:42:53 +0000 Subject: [PATCH 32/41] repo names by GitHub's rule; ADRs read as tracked files; no counters Second Codex review of hyperpolymath/mathesis#123 (on 682d6f4): - One OWNER/REPO rule, GitHub's own, in scripts/repo/github.mjs: a login, then a repository name that is not dots alone. The census, the claims registry (which also clones by that name), engineering receipts and the ultraplan's refs, issue refs and places each had a pattern that let "../.." through, making a github.com link that resolves to another page. Every name in the current data passes the new rule (just check-views). - adr-check reads docs/decisions through scripts/repo/files.mjs: only the records git tracks, each at its own path. A decisions directory that is a link fails the check and nothing through it is read. - An ADR holding {counter:...} or {counter2:...} has no readable header, as with {set:...}: Asciidoctor 2.0.26 turns ACCEPTED into ACCEPTEE (probed through its Ruby API). Mutation sweeps: 19 of 19 mutants killed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 13 +++++++- docs/decisions/README.adoc | 8 +++-- scripts/atlas/census-atlas.mjs | 3 +- scripts/decisions/adr-status.mjs | 30 ++++++++++++------ scripts/registry/claims-registry.mjs | 4 ++- scripts/registry/engineering-receipt.mjs | 3 +- scripts/repo/github.mjs | 15 +++++++++ scripts/ultraplan/ultraplan.mjs | 7 +++-- tests/atlas/census-atlas.test.mjs | 1 + tests/decisions/adr-status.test.mjs | 35 +++++++++++++++++++-- tests/registry/claims-registry.test.mjs | 9 +++++- tests/registry/engineering-receipt.test.mjs | 1 + tests/repo/github.test.mjs | 24 ++++++++++++++ tests/ultraplan/ultraplan.test.mjs | 8 +++++ 14 files changed, 139 insertions(+), 22 deletions(-) create mode 100644 scripts/repo/github.mjs create mode 100644 tests/repo/github.test.mjs diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 92d13b2f..d3548f75 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,6 +10,13 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. ==== Fixed +* **A repository named `../..` is no longer accepted.** The census, the claims + registry, engineering receipts and the ultraplan each checked `OWNER/REPO` + with a pattern like `[-\w.]+/[-\w.]+`, which accepts dot segments. A + github.com link made from such a name resolves, in a browser, to some other + page. All of them now use one rule, GitHub's own, in `scripts/repo/github.mjs`: + a login, then a repository name that is not dots alone. Every name in the + current data passes it. * **A `CI/gate` publisher may not filter `workflow_run` by branch.** GitHub applies `branches` and `branches-ignore` to the triggering run's branch, so a filtered publisher never posts the status on a PR head and the @@ -92,7 +99,11 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. a linked worktree read the same; An ADR is accepted only when its header states `:status: ACCEPTED` and its Status section agrees (owner ruling 2026-11-25), each read by `scripts/decisions/adr-status.mjs` so - that it never finds a status Asciidoctor would not; + that it never finds a status Asciidoctor would not. A record holding an + inline reference that changes an attribute (`{set:...}`, `{counter:...}` + or `{counter2:...}`; a counter turns ACCEPTED into ACCEPTEE) has no + readable header. `just adr-check` reads the records git tracks, each at + its own path, and fails when `docs/decisions` is a link; ** a done node whose needs are not done; ** a cycle; ** more than three active nodes; diff --git a/docs/decisions/README.adoc b/docs/decisions/README.adoc index 22b5aa24..8ac86de1 100644 --- a/docs/decisions/README.adoc +++ b/docs/decisions/README.adoc @@ -31,7 +31,9 @@ the word in any case and add what it likes after it, such as "*Accepted `just adr-check` (part of `just check-views`) runs `scripts/decisions/adr-status.mjs check`. It fails when a record's header and -Status section disagree, or when only one of them states a status. A record that +Status section disagree, or when only one of them states a status. It reads the +records that git tracks here, each at its own path: when this directory, or a +record, is a link, the check fails and reads nothing through it. A record that states neither is listed, for the owner to set; it does not count as accepted. Both are read conservatively, so the reader never finds a status Asciidoctor @@ -41,7 +43,9 @@ would not: the lines up to the first blank line. Each of those lines is a line comment or an attribute entry, and none ends in a continuation. Exactly one line in the whole record sets or unsets `status`, and it is in the header. A preprocessor -directive or an inline `{set:...}` anywhere leaves the header unread. +directive, or an inline reference that changes an attribute (`{set:...}`, +`{counter:...}` or `{counter2:...}`), anywhere leaves the header unread: a +counter turns ACCEPTED into ACCEPTEE. * In the Status section, every line that could be a heading titled Status counts, inside a block or not. The section is read only when exactly one does, and that one is a plain section heading (`==` to `======`, then `Status`) whose first diff --git a/scripts/atlas/census-atlas.mjs b/scripts/atlas/census-atlas.mjs index 469c66a8..b0642e94 100644 --- a/scripts/atlas/census-atlas.mjs +++ b/scripts/atlas/census-atlas.mjs @@ -3,6 +3,7 @@ import {readFile, writeFile, mkdir} from 'node:fs/promises'; import {fileURLToPath} from 'node:url'; import path from 'node:path'; +import {isGitHubRepo} from '../repo/github.mjs'; const root=path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..'); const censusDir=path.join(root,'docs/atlas/census'); const rowsFile=path.join(censusDir,'rows.jsonl'); @@ -38,7 +39,7 @@ export function validate(rows){ if(!Array.isArray(rows))throw new Error('Census rows must be an array'); const seen=new Set(); for(const r of rows){ - if(typeof r.repo!=='string'||!/^[-\w.]+\/[-\w.]+$/.test(r.repo)||seen.has(r.repo))throw new Error('Invalid or duplicate repo'); + if(!isGitHubRepo(r.repo)||seen.has(r.repo))throw new Error('Invalid or duplicate repo'); if(!validClass.has(r.class))throw new Error('Unknown census class '+r.repo); for(const name of ['own_files','declarations','holes','axioms','fixture_files','unsafe','policy']) if(!Number.isSafeInteger(r[name])||r[name]<0)throw new Error('Invalid census counts '+r.repo+': '+name); diff --git a/scripts/decisions/adr-status.mjs b/scripts/decisions/adr-status.mjs index 2725ff69..3f9c4d14 100644 --- a/scripts/decisions/adr-status.mjs +++ b/scripts/decisions/adr-status.mjs @@ -12,8 +12,8 @@ // and once in its prose, as the opening word of its Status section. The header // is what a machine reads; the section is what a person reads; `check` keeps // the two in step. An ADR counts as ACCEPTED only when both say so. -import {readdirSync, readFileSync, lstatSync} from 'node:fs'; import path from 'node:path'; +import {repoFiles} from '../repo/files.mjs'; export const ROOT = path.resolve(import.meta.dir, '../..'); export const DECISIONS = 'docs/decisions'; @@ -123,11 +123,16 @@ export function sectionStatus(text) { // and none ends in a continuation ("\" or "+"). An author or revision line, // or a comment block, could change what the header holds, so it is refused. // - Exactly one line in the whole file sets or unsets "status", and it is in -// the header. Nothing later (":status:", ":status!:", ":!status:", or an -// inline "{set:...}") can change it. +// the header. Nothing later can change it: no ":status:", ":status!:" or +// ":!status:", and no inline reference that changes an attribute +// ("{set:...}", "{counter:...}" or "{counter2:...}"; a counter turns +// ACCEPTED into ACCEPTEE). Any such reference, to any attribute, leaves the +// header unread. // - Its value is one of the template's words: PROPOSED, ACCEPTED, DEPRECATED, // SUPERSEDED (optionally "by NNNN") or REJECTED, written exactly so. const ENTRY = /^:!?[\w-]+!?:(?: |$)/; +// An inline reference that changes an attribute where it stands. +const MUTATES = /\{(?:set|counter2?):/i; const STATUS_ENTRY = /^:!?status!?:/; const STATUS_VALUE = /^:status: (PROPOSED|ACCEPTED|DEPRECATED|SUPERSEDED(?: by \d{4})?|REJECTED)$/; function headerRange(lines) { @@ -142,7 +147,7 @@ function headerRange(lines) { } export function headerStatus(text) { const lines = linesOf(text); - if (lines.some(l => PREPROCESSOR.test(l) || l.includes('{set:'))) return null; + if (lines.some(l => PREPROCESSOR.test(l) || MUTATES.test(l))) return null; const range = headerRange(lines); if (range === null) return null; const entries = lines.flatMap((l, i) => (STATUS_ENTRY.test(l) ? [i] : [])); @@ -168,13 +173,18 @@ export const adrAccepted = text => { // Every decision record, NNNN-title.adoc with the boilerplate NNNN-template.adoc // set aside, states its status in both places and they agree; or it states it in // neither (a status the owner has yet to set), which is reported, not refused. +// The records are the files git tracks in docs/decisions, read at their own path +// (scripts/repo/files.mjs): a directory or a record that is a link leads out of +// the repository, so it is refused, and never read. export function checkDecisions(root = ROOT) { - const dir = path.join(root, DECISIONS); - const files = readdirSync(dir).filter(f => /^\d{4}-.+\.adoc$/.test(f) && !/^\d{4}-template\.adoc$/.test(f)).sort(); - return files.map(f => { - const p = path.join(dir, f); - if (!lstatSync(p).isFile()) return {file: f, problem: 'is not a plain file'}; - const s = adrStatus(readFileSync(p, 'utf8')); + const files = repoFiles(root); + if (!files.isDir(DECISIONS)) return [{file: DECISIONS, problem: 'is not a directory in the repository that holds a file git tracks'}]; + const records = files.under(DECISIONS).map(p => p.slice(DECISIONS.length + 1)) + .filter(f => /^\d{4}-[^/]+\.adoc$/.test(f) && !/^\d{4}-template\.adoc$/.test(f)); + return records.map(f => { + const p = `${DECISIONS}/${f}`; + if (!files.isFile(p)) return {file: f, problem: 'is not a file that git tracks in the repository, at its own path'}; + const s = adrStatus(files.read(p)); if (s.inStep) return {file: f, status: s.header}; if (s.header === null && s.section === null) return {file: f, status: null}; return {file: f, problem: `its header says ${s.header ?? 'nothing readable'} but its Status section says ${s.section ?? 'nothing readable'}`}; diff --git a/scripts/registry/claims-registry.mjs b/scripts/registry/claims-registry.mjs index 0c0b5d43..1347a13c 100644 --- a/scripts/registry/claims-registry.mjs +++ b/scripts/registry/claims-registry.mjs @@ -30,6 +30,7 @@ import {createHash} from 'node:crypto'; import {fileURLToPath, pathToFileURL} from 'node:url'; import path from 'node:path'; import {readJsonl} from '../atlas/census-atlas.mjs'; +import {GITHUB_REPO} from '../repo/github.mjs'; import {validateBridges, renderBridges} from './bridges.mjs'; import {validateAdmissions, renderTheoryIndex, HOME} from './theory.mjs'; import {validateLedger, snapshot, pending, checkAppendOnly, jcs} from './theory-ledger.mjs'; @@ -98,7 +99,8 @@ export const CHECKER = { // name, so every id survives the registry view, where it is a link's text inside // a table row: "]", "|", "#" and white space cannot occur in it. The registry's // rows obey this rule, and readers that cite a claim (the ultraplan) use it too. -export const CLAIM_REPO = /^[-\w.]+\/[-\w.]+$/; +// A claim's repository is named by GitHub's own rule (scripts/repo/github.mjs). +export const CLAIM_REPO = GITHUB_REPO; export const CLAIM_NAME = /^[-\w.]+$/; // A status document is named by a relative path in its repository. The view puts // it in a link's target, so it uses the same characters, with "/" between its diff --git a/scripts/registry/engineering-receipt.mjs b/scripts/registry/engineering-receipt.mjs index 546c91bf..7f80da0c 100644 --- a/scripts/registry/engineering-receipt.mjs +++ b/scripts/registry/engineering-receipt.mjs @@ -4,6 +4,7 @@ // validates their identity, declared source binding and retained evidence, not // the truth of an execution log or compiler correctness. See ADR 0006. import {jcs} from './theory-ledger.mjs'; +import {isGitHubRepo} from '../repo/github.mjs'; const need = (ok, message) => { if (!ok) throw new Error(`engineering receipt: ${message}`); }; const object = (v, fields) => { @@ -38,7 +39,7 @@ export function parseEngineeringReceipt(text) { need(r.profile === 'engineering-receipt' && r.schema_version === '1.0.0', 'unsupported profile/version'); need(r.kind === 'demonstration', 'engineering evidence is only a demonstration'); for (const k of ['repository', 'source_commit', 'claim', 'statement', 'status_doc']) string(r[k]); - need(/^[-\w.]+\/[-\w.]+$/.test(r.repository), 'invalid repository'); + need(isGitHubRepo(r.repository), 'invalid repository'); need(/^[a-f0-9]{40}$/.test(r.source_commit) && !/^0+$/.test(r.source_commit), 'invalid implementation source commit'); file(r.source_inputs); file(r.evidence_manifest); diff --git a/scripts/repo/github.mjs b/scripts/repo/github.mjs new file mode 100644 index 00000000..029a8feb --- /dev/null +++ b/scripts/repo/github.mjs @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// A GitHub repository named OWNER/REPO, by GitHub's own naming rules. +// +// Every generator that writes a github.com link from a repository name, or +// clones one, checks the name here first. A looser rule let "../.." through, +// and a link such as https://github.com/../../blob/c/x resolves, in a browser, +// to a page of some other repository. +// - OWNER, a user or organisation login: letters, digits and hyphens, 1 to 39, +// with no hyphen at either end. +// - REPO: letters, digits, ".", "-" and "_", 1 to 100, and not dots alone: +// GitHub has no repository named "." or "..". +export const GITHUB_REPO = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/(?!\.+$)[A-Za-z0-9._-]{1,100}$/; +export const isGitHubRepo = s => typeof s === 'string' && GITHUB_REPO.test(s); diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index f067adc5..137c55b5 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -34,6 +34,7 @@ import {jcs} from '../registry/theory-ledger.mjs'; import {isClaimId, isDocPath} from '../registry/claims-registry.mjs'; import {adrStatus} from '../decisions/adr-status.mjs'; import {repoFiles} from '../repo/files.mjs'; +import {isGitHubRepo} from '../repo/github.mjs'; export const ROOT = path.resolve(import.meta.dir, '../..'); export const DIR = 'docs/ultraplan'; @@ -229,10 +230,10 @@ const occurrences = (text, s) => { return k; }; const REF = { - issue: r => (Object.keys(r).length === 1 && typeof r.issue === 'string' && /^[\w.-]+\/[\w.-]+#[1-9]\d*$/.test(r.issue) + issue: r => (Object.keys(r).length === 1 && typeof r.issue === 'string' && /^[^#]+#[1-9]\d*$/.test(r.issue) && isGitHubRepo(r.issue.split('#')[0]) ? null : `ref issue ${JSON.stringify(r.issue)} is not OWNER/REPO#N, alone`), pinned(r) { - if (typeof r.repo !== 'string' || !/^[\w.-]+\/[\w.-]+$/.test(r.repo)) return `ref repo ${JSON.stringify(r.repo)} is not OWNER/REPO`; + if (!isGitHubRepo(r.repo)) return `ref repo ${JSON.stringify(r.repo)} is not OWNER/REPO`; return typeof r.commit === 'string' && /^[0-9a-f]{40}$/.test(r.commit) ? null : `ref commit ${JSON.stringify(r.commit)} is not a full commit id`; }, here(r, ctx) { @@ -296,7 +297,7 @@ const NODE_RULES = [ [n => isSize(n.size), oneOf('size', Object.keys(SIZES))], [n => isStr(n.summary, 600), 'summary is required (at most 600 characters)'], ...['needs', 'rivals', 'evidence', 'refs'].map(k => [n => n[k] === undefined || Array.isArray(n[k]), `${k} must be a list`]), - [n => n.where === undefined || (typeof n.where === 'string' && /^(estate|upstream):[\w.-]+\/[\w.-]+$/.test(n.where)), + [n => n.where === undefined || (typeof n.where === 'string' && /^(estate|upstream):/.test(n.where) && isGitHubRepo(n.where.replace(/^\w+:/, ''))), 'where is estate:OWNER/REPO or upstream:OWNER/REPO, or absent for this repository'], [n => n.owner_value === undefined || n.owner_value === 'high', 'owner_value is "high" or absent'], [n => n.status !== 'blocked' || isStr(n.blocked_by), 'a blocked node says what blocks it (blocked_by)'], diff --git a/tests/atlas/census-atlas.test.mjs b/tests/atlas/census-atlas.test.mjs index 0a5c5e22..92f4d1e0 100644 --- a/tests/atlas/census-atlas.test.mjs +++ b/tests/atlas/census-atlas.test.mjs @@ -18,3 +18,4 @@ test('full context budget cannot omit mandatory caveat',()=>{expect(()=>pack(row test('JSON Lines input: one record per line, LF at the end, no blank line',()=>{expect(parseJsonl('')).toEqual([]);expect(parseJsonl('{"a":1}\n{"a":2}\n')).toEqual([{a:1},{a:2}]);expect(()=>parseJsonl('{"a":1}')).toThrow(/no LF/);expect(()=>parseJsonl('{"a":1}\n\n{"a":2}\n')).toThrow(/blank/);expect(()=>parseJsonl('[{"a":1},\n')).toThrow();}); test('each row names its source commit and census time',()=>{for(const r of rows){expect(r.commit).toMatch(/^[0-9a-f]{40}$/);expect(r.censused_at).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/);}const {commit,censused_at,...bare}=rows[0];expect(()=>validate([bare])).toThrow(/source commit/);expect(()=>validate([{...rows[0],commit:'HEAD'}])).toThrow(/source commit/);expect(()=>validate([{...rows[0],censused_at:'2026-11-10'}])).toThrow(/census time/);}); test('the frame names public repositories only, and counts the private ones',()=>{const read=f=>readFileSync(new URL('../../docs/atlas/census/'+f,import.meta.url),'utf8');const repos=parseJsonl(read('repos.jsonl')),unreachable=parseJsonl(read('unreachable.jsonl')),count=JSON.parse(read('private-count.json'));expect(validateFrame(repos,unreachable,count)).toHaveLength(repos.length);expect(()=>validateFrame([...repos,{...repos[0],full_name:'o/hidden',visibility:'private'}],unreachable,count)).toThrow(/Nonpublic frame record/);expect(()=>validateFrame(repos,[...unreachable,{repo:'o/unlisted'}],count)).toThrow(/outside the public frame/);expect(()=>validateFrame(repos,unreachable,{...count,private_repositories:'40'})).toThrow(/private-count/);expect(()=>validateFrame(repos,unreachable,{...count,names:[]})).toThrow(/private-count/);}); +test('a census row names a GitHub repository by GitHub\'s own rule',()=>{for(const repo of ['../..','o/..','./x','o_x/r','o']){expect(()=>validate([{...rows[0],repo}])).toThrow(/Invalid or duplicate repo/);}}); diff --git a/tests/decisions/adr-status.test.mjs b/tests/decisions/adr-status.test.mjs index 5dea11cf..b3bd33c8 100644 --- a/tests/decisions/adr-status.test.mjs +++ b/tests/decisions/adr-status.test.mjs @@ -151,6 +151,13 @@ test('nothing but the one header entry can set or unset the status', () => { // A second entry, an unset, an inline set or a conditional anywhere. for (const body of [':status: PROPOSED\n', ':status!:\n', ':!status:\n', 'Text {set:status:PROPOSED} here.\n', 'ifdef::x[]\n:status: PROPOSED\nendif::[]\n']) expect(headerStatus(doc(':status: ACCEPTED', body))).toBe(null); + // A counter changes the attribute it names (Asciidoctor 2.0.26 turns ACCEPTED + // into ACCEPTEE), so any inline reference that changes an attribute, whichever + // it names and in whatever case, leaves the header unread. + for (const ref of ['{counter:status}', '{counter2:status}', '{counter:status:A}', '{counter:other}', '{COUNTER:status}', '{Set:status:x}']) + expect(headerStatus(doc(':status: ACCEPTED', `Accepted ${ref}\n`))).toBe(null); + // A brace that changes nothing is plain text. + expect(headerStatus(doc(':status: ACCEPTED', 'A {status} and a {counterpart}.\n'))).toBe('ACCEPTED'); expect(headerStatus(doc(':status: ACCEPTED\n:status: ACCEPTED'))).toBe(null); // An included file could set the status where no line here does. expect(headerStatus(doc(':status: ACCEPTED', 'include::more.adoc[]\n'))).toBe(null); @@ -176,12 +183,20 @@ test('an ADR is accepted only when its header and its Status section both say so expect(adrAccepted(adr(':status: PROPOSED', 'Proposed.'))).toBe(false); }); +// git, run in a fixture: the check reads only the records git tracks there. +const git = (root, ...args) => { + const r = Bun.spawnSync(['git', '-C', root, '-c', 'init.defaultBranch=main', ...args]); + if (r.exitCode !== 0) throw new Error(`git ${args.join(' ')}: ${r.stderr}`); +}; + test('the check keeps every decision record in step, and reports one that states none', () => { const root = mkdtempSync(path.join(tmpdir(), 'adr-')); roots.push(root); const dir = path.join(root, 'docs/decisions'); mkdirSync(dir, {recursive: true}); - const put = (f, s) => writeFileSync(path.join(dir, f), s); + git(root, 'init', '-q'); + // Each record is written and tracked, as a commit would track it. + const put = (f, s) => { writeFileSync(path.join(dir, f), s); git(root, 'add', '-A'); }; put('0001-a.adoc', '= A\n:status: ACCEPTED\n\n=== Status\n\nAccepted\n'); put('0002-b.adoc', '= B\n\n== Scope\n\nNo status yet.\n'); put('0003-template.adoc', '= Template\n:status: PROPOSED\n'); @@ -201,7 +216,23 @@ test('the check keeps every decision record in step, and reports one that states roots.push(other); writeFileSync(path.join(other, 'x.adoc'), '= X\n:status: ACCEPTED\n\n=== Status\n\nAccepted\n'); symlinkSync(path.join(other, 'x.adoc'), path.join(dir, '0007-link.adoc')); - expect(checkDecisions(root).find(r => r.file === '0007-link.adoc')).toEqual({file: '0007-link.adoc', problem: 'is not a plain file'}); + git(root, 'add', '-A'); + expect(checkDecisions(root).find(r => r.file === '0007-link.adoc')).toEqual({file: '0007-link.adoc', problem: 'is not a file that git tracks in the repository, at its own path'}); + // A record git does not track is not one, nor is a file in a directory named like one. + writeFileSync(path.join(dir, '0008-draft.adoc'), '= D\n:status: ACCEPTED\n\n=== Status\n\nProposed.\n'); + mkdirSync(path.join(dir, '0009-notes')); + writeFileSync(path.join(dir, '0009-notes/x.adoc'), '= N\n:status: ACCEPTED\n\n=== Status\n\nProposed.\n'); + git(root, 'add', 'docs/decisions/0009-notes'); + expect(checkDecisions(root).map(r => r.file)).toEqual(['0001-a.adoc', '0002-b.adoc', '0004-c.adoc', '0005-d.adoc', '0006-e.adoc', '0007-link.adoc']); + // A decisions directory that is a link out of the repository is refused, and + // nothing through it is read, though git tracks the link. + const linked = mkdtempSync(path.join(tmpdir(), 'adr-linked-')); + roots.push(linked); + mkdirSync(path.join(linked, 'docs')); + symlinkSync(dir, path.join(linked, 'docs/decisions')); + git(linked, 'init', '-q'); + git(linked, 'add', '-A'); + expect(checkDecisions(linked)).toEqual([{file: 'docs/decisions', problem: 'is not a directory in the repository that holds a file git tracks'}]); }); test('the decision records here are in step', () => { diff --git a/tests/registry/claims-registry.test.mjs b/tests/registry/claims-registry.test.mjs index 69069a06..1fb54a8e 100644 --- a/tests/registry/claims-registry.test.mjs +++ b/tests/registry/claims-registry.test.mjs @@ -9,7 +9,7 @@ import {readFileSync, mkdtempSync, mkdirSync, writeFileSync, copyFileSync} from import {createHash} from 'node:crypto'; import {tmpdir} from 'node:os'; import path from 'node:path'; -import {validate, loadReader, derive, deriveAll, withGitCheck, findTool, gitChecker, checkerScript, render, READER, CHECKER} from '../../scripts/registry/claims-registry.mjs'; +import {isClaimId, validate, loadReader, derive, deriveAll, withGitCheck, findTool, gitChecker, checkerScript, render, READER, CHECKER} from '../../scripts/registry/claims-registry.mjs'; import {parseJsonl} from '../../scripts/atlas/census-atlas.mjs'; const rows = parseJsonl(readFileSync(new URL('../../docs/atlas/claims/claims.jsonl', import.meta.url), 'utf8')); @@ -227,3 +227,10 @@ test('the checker runs only beside the pinned canon reader', async () => { writeFileSync(path.join(std, READER.path), '// changed\n', {flag: 'a'}); await expect(checkerScript(std)).rejects.toThrow(/is not the pinned file/); }); + +// A claim's repository is named by GitHub's own rule: the registry makes a +// github.com link and a clone URL from it. +test('a claim id names a GitHub repository by GitHub\'s own rule', () => { + expect(isClaimId('hyperpolymath/resource-algebra#C-1')).toBe(true); + for (const id of ['../..#C-1', 'o/..#C-1', 'o_x/r#C-1', 'o#C-1', '#C-1', 'o/r#']) expect(isClaimId(id)).toBe(false); +}); diff --git a/tests/registry/engineering-receipt.test.mjs b/tests/registry/engineering-receipt.test.mjs index db6b7b2e..2713e5cf 100644 --- a/tests/registry/engineering-receipt.test.mjs +++ b/tests/registry/engineering-receipt.test.mjs @@ -58,6 +58,7 @@ test('arbitrary JSON fails registration; legacy deed refusal remains visible and for (const [name, mutate, message] of [ ['wrong repository', r => {r.repository = 'o/other';}, /repo does not match/], + ['dot-segment repository', r => {r.repository = '../..';}, /invalid repository/], ['wrong claim', r => {r.claim = 'D-2';}, /claim does not match/], ['changed statement', r => {r.statement = 'A different assertion.';}, /statement does not match/], ['changed status document', r => {r.status_doc = 'OTHER.adoc';}, /status_doc does not match/], diff --git a/tests/repo/github.test.mjs b/tests/repo/github.test.mjs new file mode 100644 index 00000000..b75b5820 --- /dev/null +++ b/tests/repo/github.test.mjs @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MPL-2.0 +// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// A GitHub repository named OWNER/REPO, by GitHub's own naming rules +// (scripts/repo/github.mjs). Every generator that makes a github.com link from +// a name checks it here. +import {test, expect} from 'bun:test'; +import {isGitHubRepo, GITHUB_REPO} from '../../scripts/repo/github.mjs'; + +test('real repository names pass', () => { + for (const r of ['hyperpolymath/mathesis', 'metadatastician/ZenodoDeposits.jl', 'a/b', 'o/.github', 'o/a.b-c_d', + 'o/..x', 'o/x..', `${'x'.repeat(39)}/r`, `o/${'r'.repeat(100)}`, 'a-b/c', 'A1/B2']) expect(isGitHubRepo(r)).toBe(true); +}); + +test('a name that is not a GitHub repository is refused', () => { + // Dot segments would make a link that a browser resolves to another page. + for (const r of ['../..', './x', 'x/.', 'x/..', 'x/...', '../x', './.']) expect(isGitHubRepo(r)).toBe(false); + // An owner is a login: no dot, no underscore, no hyphen at either end, at most 39. + for (const r of ['-o/r', 'o-/r', 'o.x/r', 'o_x/r', `${'x'.repeat(40)}/r`, '/r']) expect(isGitHubRepo(r)).toBe(false); + // A repository name: at most 100 of letters, digits, ".", "-" and "_". + for (const r of [`o/${'r'.repeat(101)}`, 'o/', 'o/r x', 'o/r/x', 'o/r#1', 'o/r?x', 'o/r%2e', 'o', 'o/r\n']) expect(isGitHubRepo(r)).toBe(false); + for (const r of [undefined, null, 42, ['o/r'], {}]) expect(isGitHubRepo(r)).toBe(false); + expect(GITHUB_REPO.test('o/r')).toBe(true); +}); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 47341596..aa5ba24d 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -267,6 +267,10 @@ test('closed schema, blocked reasons and canonical lines', () => { refuses({nodes: swap('paper', {where: 'elsewhere'})}, /where is estate:OWNER\/REPO/); // A list holding a valid place is not a place (a regular expression would read it as one). refuses({nodes: swap('paper', {where: ['estate:o/r']})}, /where is estate:OWNER\/REPO/); + // A place is a GitHub repository by GitHub's own rule: no dot segments. + for (const where of ['estate:../..', 'upstream:o/..', 'estate:o', 'elsewhere:o/r']) + refuses({nodes: swap('paper', {where})}, /where is estate:OWNER\/REPO/); + expect(() => generate(fixture({nodes: swap('paper', {where: 'upstream:o/.github'})}))).not.toThrow(); // A list field that is not a list is refused by name, not by a crash. refuses({nodes: swap('paper', {needs: {}})}, /node paper: needs must be a list/); refuses({nodes: swap('paper', {rivals: 'cheap'})}, /node paper: rivals must be a list/); @@ -356,6 +360,10 @@ test('a ref points at one place, and each ref in this repository is checked', () refused([{commit: 'a'.repeat(40), path: 'a.adoc', repo: 'nobody'}], /ref repo "nobody" is not OWNER\/REPO/); refused([{commit: 'a'.repeat(40), path: 'a.adoc'}], /ref repo undefined is not OWNER\/REPO/); refused([{issue: 'standards#1705'}], /ref issue "standards#1705" is not OWNER\/REPO#N, alone/); + // A link made from "../.." would resolve to some other page of GitHub. + refused([{commit: 'a'.repeat(40), path: 'a.adoc', repo: '../..'}], /ref repo "\.\.\/\.\." is not OWNER\/REPO/); + refused([{issue: '../..#1'}], /ref issue "\.\.\/\.\.#1" is not OWNER\/REPO#N, alone/); + refused([{issue: 'o/r#1#2'}], /is not OWNER\/REPO#N, alone/); refused([{issue: 'o/r#1', path: 'README.adoc'}], /is not OWNER\/REPO#N, alone/); refused([{line: 92, path: 'README.adoc'}], /node paper: ref: unknown field "line"/); refused(['README.adoc:46'], /node paper: ref: must be an object/); From fa1c8d4345b6395942499ba8e8573651c6a1ed61 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 12:01:05 +0000 Subject: [PATCH 33/41] adr-status: a status entry in any letter case counts; two Sonar smells - Asciidoctor lowercases an attribute entry's name, so a later ":Status: PROPOSED", ":STATUS: ..." or ":Status!:" changes or unsets "status" (probed with 2.0.26). The status-entry match is now case-insensitive, so such a record has no readable header; a header spelling it ":Status: ACCEPTED" is refused too (Codex, on 6d96935). - SonarCloud S1121: files.mjs memoises git's answer in a function, not an assignment inside an expression. S3358: textFault's nested ternary becomes partsOf. Behaviour unchanged; mutation sweeps as before. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/decisions/README.adoc | 3 ++- scripts/decisions/adr-status.mjs | 5 +++-- scripts/repo/files.mjs | 11 ++++++++--- scripts/ultraplan/ultraplan.mjs | 8 ++++++-- tests/decisions/adr-status.test.mjs | 6 ++++++ 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/docs/decisions/README.adoc b/docs/decisions/README.adoc index 8ac86de1..c702a7fb 100644 --- a/docs/decisions/README.adoc +++ b/docs/decisions/README.adoc @@ -42,7 +42,8 @@ would not: * The header is the title line, after any blank lines and line comments, and the lines up to the first blank line. Each of those lines is a line comment or an attribute entry, and none ends in a continuation. Exactly one line in the -whole record sets or unsets `status`, and it is in the header. A preprocessor +whole record sets or unsets `status`, in any letter case (Asciidoctor reads +`:Status:` as `:status:`), and it is in the header. A preprocessor directive, or an inline reference that changes an attribute (`{set:...}`, `{counter:...}` or `{counter2:...}`), anywhere leaves the header unread: a counter turns ACCEPTED into ACCEPTEE. diff --git a/scripts/decisions/adr-status.mjs b/scripts/decisions/adr-status.mjs index 3f9c4d14..b4b2271d 100644 --- a/scripts/decisions/adr-status.mjs +++ b/scripts/decisions/adr-status.mjs @@ -124,7 +124,8 @@ export function sectionStatus(text) { // or a comment block, could change what the header holds, so it is refused. // - Exactly one line in the whole file sets or unsets "status", and it is in // the header. Nothing later can change it: no ":status:", ":status!:" or -// ":!status:", and no inline reference that changes an attribute +// ":!status:", in any letter case (Asciidoctor lowercases an entry's name, +// so ":Status: PROPOSED" sets "status"), and no inline reference that changes an attribute // ("{set:...}", "{counter:...}" or "{counter2:...}"; a counter turns // ACCEPTED into ACCEPTEE). Any such reference, to any attribute, leaves the // header unread. @@ -133,7 +134,7 @@ export function sectionStatus(text) { const ENTRY = /^:!?[\w-]+!?:(?: |$)/; // An inline reference that changes an attribute where it stands. const MUTATES = /\{(?:set|counter2?):/i; -const STATUS_ENTRY = /^:!?status!?:/; +const STATUS_ENTRY = /^:!?status!?:/i; const STATUS_VALUE = /^:status: (PROPOSED|ACCEPTED|DEPRECATED|SUPERSEDED(?: by \d{4})?|REJECTED)$/; function headerRange(lines) { let t = 0; diff --git a/scripts/repo/files.mjs b/scripts/repo/files.mjs index e8024f6d..02a8bd4b 100644 --- a/scripts/repo/files.mjs +++ b/scripts/repo/files.mjs @@ -44,9 +44,14 @@ function trackedPaths(base) { export function repoFiles(root) { const base = realpathSync(root); + // git is asked once, when a check first needs the answer. let tracked = null; - const isTracked = p => (tracked ??= trackedPaths(base)).has(p); - const holdsTracked = p => { tracked ??= trackedPaths(base); return [...tracked].some(t => t.startsWith(`${p}/`)); }; + const trackedSet = () => { + if (tracked === null) tracked = trackedPaths(base); + return tracked; + }; + const isTracked = p => trackedSet().has(p); + const holdsTracked = p => [...trackedSet()].some(t => t.startsWith(`${p}/`)); // What stands at the path itself, when no part of it is a link; else null. const at = p => { if (typeof p !== 'string' || p === '') return null; @@ -69,7 +74,7 @@ export function repoFiles(root) { bytes, read: p => bytes(p).toString('utf8'), // The tracked paths under a directory, in the order git lists them (sorted). - under: dir => { tracked ??= trackedPaths(base); return [...tracked].filter(t => t.startsWith(`${dir}/`)); }, + under: dir => [...trackedSet()].filter(t => t.startsWith(`${dir}/`)), local: { isFile: localFile, isDir: p => at(p)?.isDirectory() === true, diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 137c55b5..db8e17ba 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -107,11 +107,15 @@ const TEXT_FAULTS = [ [/ {2}/, 'a run of spaces'], [/^ | $/, 'a space at the start or end of a text'], ]; +// The values a record holds directly: a list's items, or an object's keys and values. +const partsOf = v => { + if (Array.isArray(v)) return v; + return v !== null && typeof v === 'object' ? Object.entries(v).flat() : []; +}; // The first fault of any string in a record, or null. function textFault(v) { if (typeof v === 'string') return TEXT_FAULTS.find(([re]) => re.test(v))?.[1] ?? null; - const parts = Array.isArray(v) ? v : (v !== null && typeof v === 'object' ? Object.entries(v).flat() : []); - for (const x of parts) { + for (const x of partsOf(v)) { const fault = textFault(x); if (fault) return fault; } diff --git a/tests/decisions/adr-status.test.mjs b/tests/decisions/adr-status.test.mjs index b3bd33c8..e07d411f 100644 --- a/tests/decisions/adr-status.test.mjs +++ b/tests/decisions/adr-status.test.mjs @@ -151,6 +151,12 @@ test('nothing but the one header entry can set or unset the status', () => { // A second entry, an unset, an inline set or a conditional anywhere. for (const body of [':status: PROPOSED\n', ':status!:\n', ':!status:\n', 'Text {set:status:PROPOSED} here.\n', 'ifdef::x[]\n:status: PROPOSED\nendif::[]\n']) expect(headerStatus(doc(':status: ACCEPTED', body))).toBe(null); + // Asciidoctor lowercases an entry's name: ":Status: PROPOSED" sets "status" + // (probed with 2.0.26), so an entry in any letter case counts. + for (const body of [':Status: PROPOSED\n', ':STATUS: PROPOSED\n', ':Status!:\n', ':!Status:\n', ':sTaTuS: REJECTED\n']) + expect(headerStatus(doc(':status: ACCEPTED', body))).toBe(null); + // The one header entry is written exactly as the template writes it. + expect(headerStatus(doc(':Status: ACCEPTED'))).toBe(null); // A counter changes the attribute it names (Asciidoctor 2.0.26 turns ACCEPTED // into ACCEPTEE), so any inline reference that changes an attribute, whichever // it names and in whatever case, leaves the header unread. From c87d6c82c09204a6650dc97541e93529be7a0cf5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 12:09:55 +0000 Subject: [PATCH 34/41] ultraplan: say plainly how the contrarian picks; test its tie-break Codex read "the node the council rates lowest that still unlocks the most" as leverage first. The code ranks by the council's rating first and uses leverage only to break a tie, as the contrarian's own question in advisors.jsonl asks ("Which cheap node is everyone overlooking?"); ranked by leverage first it would repeat the council's own first choice. The comment and README now say so. The tie-break had no test (two mutants survived); a new test pins it, and both are killed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/ultraplan/README.adoc | 7 +++++-- scripts/ultraplan/ultraplan.mjs | 7 +++++-- tests/ultraplan/ultraplan.test.mjs | 12 ++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index fe3dad80..67af3988 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -119,8 +119,11 @@ zero: by the mark, then by how much the node unlocks, then by value for effort (its marks summed, over its size). A node it marks zero is not one it would pick, so when no node is marked above zero the advisor names nothing. -* The contrarian names the frontier node the council rates lowest that still -unlocks the most. That keeps the road not taken in view. +* The contrarian asks which node everyone is overlooking. It names the frontier +node the council rates lowest (its value marks summed), and among nodes rated +equally low, the one that unlocks the most. Leverage only breaks the tie: ranked +by leverage first, the contrarian would name what the council already ranks +first. That keeps the road not taken in view. * The *me* advisor looks out for what could help the owner's own life. Its notes are kept privately, outside this public repository and out of every feed: in a private panel that the owner owns (owner ruling 2026-11-24; which system hosts diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index db8e17ba..b9577207 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -446,8 +446,11 @@ export function validate({advisors, nodes, expeditions}, ctx) { // โ”€โ”€ Derivation โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // Each advisor's pick from the frontier. An advisor that reads a value key // ranks the nodes it marks above zero by that mark, then as the council -// ranks: by leverage, then by value for effort. The contrarian takes the -// frontier node the council rates lowest that still unlocks the most. The me +// ranks: by leverage, then by value for effort. The contrarian asks which node +// everyone is overlooking: it takes the frontier node the council rates lowest +// (its marks summed), and among nodes rated equally low, the one that unlocks +// the most. Leverage only breaks the tie: ranked by leverage first, it would +// name what the council already ranks first. The me // advisor reads no mark, since another advisor's mark is not the owner's // preference: it ranks the nodes the owner tagged owner_value as the council // ranks, and has no notes. diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index aa5ba24d..04969e76 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -65,6 +65,18 @@ const refuses = (opts, re) => expect(() => generate(fixture(opts))).toThrow(re); const strip = o => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined)); const swap = (id, extra, nodes = BASE) => nodes.map(n => n.id === id ? strip({...n, ...extra}) : n); +// The contrarian names the node the council rates lowest; leverage only breaks a +// tie between nodes rated equally low, and the id breaks a tie after that. +test('the contrarian takes the lowest-rated node, and unlocks break the tie', () => { + const nodes = [...BASE, node('alpha', {needs: ['root']}), node('zeta', {needs: ['root']}), node('zeta-next', {needs: ['zeta']})]; + const d = generate(fixture({nodes})).derived; + // alpha and zeta are both rated 0, below cheap (1); zeta unlocks one live node, alpha none. + expect(d.picks.get('contrarian').id).toBe('zeta'); + // A node that unlocks more but is rated higher is not the contrarian's. + const rated = nodes.map(n => (n.id === 'zeta' ? {...n, value: {maths: 1}} : n)); + expect(generate(fixture({nodes: rated})).derived.picks.get('contrarian').id).toBe('alpha'); +}); + test('derives eras, the frontier, forks, confluences and each advisor\'s pick', () => { const out = generate(fixture()); const d = out.derived; From 86885102209c7c7f18823a38b699c2df07a48f61 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 12:19:38 +0000 Subject: [PATCH 35/41] repo/github: an owner login has single hyphens only GitHub logins cannot hold two hyphens in a row, and the shared rule still accepted owners such as foo--bar (Codex, on c87d6c8). The owner is now letters and digits joined by single hyphens, 1 to 39 characters in all. Every name in the current data passes (just check-views); the rule's 8 mutants are killed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 4 ++-- scripts/repo/github.mjs | 6 +++--- tests/repo/github.test.mjs | 9 ++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index d3548f75..153609c3 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -15,8 +15,8 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. with a pattern like `[-\w.]+/[-\w.]+`, which accepts dot segments. A github.com link made from such a name resolves, in a browser, to some other page. All of them now use one rule, GitHub's own, in `scripts/repo/github.mjs`: - a login, then a repository name that is not dots alone. Every name in the - current data passes it. + a login (single hyphens only, none at either end), then a repository name + that is not dots alone. Every name in the current data passes it. * **A `CI/gate` publisher may not filter `workflow_run` by branch.** GitHub applies `branches` and `branches-ignore` to the triggering run's branch, so a filtered publisher never posts the status on a PR head and the diff --git a/scripts/repo/github.mjs b/scripts/repo/github.mjs index 029a8feb..f731636b 100644 --- a/scripts/repo/github.mjs +++ b/scripts/repo/github.mjs @@ -7,9 +7,9 @@ // clones one, checks the name here first. A looser rule let "../.." through, // and a link such as https://github.com/../../blob/c/x resolves, in a browser, // to a page of some other repository. -// - OWNER, a user or organisation login: letters, digits and hyphens, 1 to 39, -// with no hyphen at either end. +// - OWNER, a user or organisation login: 1 to 39 letters, digits and single +// hyphens, with no hyphen at either end and never two in a row. // - REPO: letters, digits, ".", "-" and "_", 1 to 100, and not dots alone: // GitHub has no repository named "." or "..". -export const GITHUB_REPO = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?\/(?!\.+$)[A-Za-z0-9._-]{1,100}$/; +export const GITHUB_REPO = /^(?=[A-Za-z0-9-]{1,39}\/)[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*\/(?!\.+$)[A-Za-z0-9._-]{1,100}$/; export const isGitHubRepo = s => typeof s === 'string' && GITHUB_REPO.test(s); diff --git a/tests/repo/github.test.mjs b/tests/repo/github.test.mjs index b75b5820..8685f29b 100644 --- a/tests/repo/github.test.mjs +++ b/tests/repo/github.test.mjs @@ -9,14 +9,17 @@ import {isGitHubRepo, GITHUB_REPO} from '../../scripts/repo/github.mjs'; test('real repository names pass', () => { for (const r of ['hyperpolymath/mathesis', 'metadatastician/ZenodoDeposits.jl', 'a/b', 'o/.github', 'o/a.b-c_d', - 'o/..x', 'o/x..', `${'x'.repeat(39)}/r`, `o/${'r'.repeat(100)}`, 'a-b/c', 'A1/B2']) expect(isGitHubRepo(r)).toBe(true); + 'o/..x', 'o/x..', `${'x'.repeat(39)}/r`, `o/${'r'.repeat(100)}`, 'a-b/c', 'a-b-c/d', 'A1/B2', + `${'ab-'.repeat(12)}abc/r`]) expect(isGitHubRepo(r)).toBe(true); }); test('a name that is not a GitHub repository is refused', () => { // Dot segments would make a link that a browser resolves to another page. for (const r of ['../..', './x', 'x/.', 'x/..', 'x/...', '../x', './.']) expect(isGitHubRepo(r)).toBe(false); - // An owner is a login: no dot, no underscore, no hyphen at either end, at most 39. - for (const r of ['-o/r', 'o-/r', 'o.x/r', 'o_x/r', `${'x'.repeat(40)}/r`, '/r']) expect(isGitHubRepo(r)).toBe(false); + // An owner is a login: no dot, no underscore, no hyphen at either end or two in a + // row, at most 39 characters (hyphens counted). + for (const r of ['-o/r', 'o-/r', 'o.x/r', 'o_x/r', `${'x'.repeat(40)}/r`, '/r', 'foo--bar/r', 'a---b/r', '-/r', + `${'ab-'.repeat(12)}abcd/r`]) expect(isGitHubRepo(r)).toBe(false); // A repository name: at most 100 of letters, digits, ".", "-" and "_". for (const r of [`o/${'r'.repeat(101)}`, 'o/', 'o/r x', 'o/r/x', 'o/r#1', 'o/r?x', 'o/r%2e', 'o', 'o/r\n']) expect(isGitHubRepo(r)).toBe(false); for (const r of [undefined, null, 42, ['o/r'], {}]) expect(isGitHubRepo(r)).toBe(false); From 76963bac8405f598812a9acdc8a12d81ef5ee1d9 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 12:29:24 +0000 Subject: [PATCH 36/41] adr-status: a status the readers refuse fails the check, not "unset" adr-check counted a record whose header and Status section the conservative readers both refused (beside an include::, an ifdef::, a "Status quo" heading, ...) as one that states no status, and passed (Codex, on 8688510). Now a record is listed as unset only when it states no status at all: no status entry in any case, no {set:} or {counter:} naming status ({set:Status:X} sets "status", probed with 2.0.26), no preprocessor directive, and no heading that could read Status. Any other unreadable record fails the check. ADR 0006 is still listed as unset. Tests cover each form; 7 of 7 mutants killed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 4 +++- docs/decisions/README.adoc | 8 ++++++-- scripts/decisions/adr-status.mjs | 21 +++++++++++++++++---- tests/decisions/adr-status.test.mjs | 22 ++++++++++++++++++++++ 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 153609c3..682745b0 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -103,7 +103,9 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. inline reference that changes an attribute (`{set:...}`, `{counter:...}` or `{counter2:...}`; a counter turns ACCEPTED into ACCEPTEE) has no readable header. `just adr-check` reads the records git tracks, each at - its own path, and fails when `docs/decisions` is a link; + its own path, and fails when `docs/decisions` is a link. A record whose + status the readers refuse fails the check; only a record that states no + status at all is listed as unset; ** a done node whose needs are not done; ** a cycle; ** more than three active nodes; diff --git a/docs/decisions/README.adoc b/docs/decisions/README.adoc index c702a7fb..95263d9b 100644 --- a/docs/decisions/README.adoc +++ b/docs/decisions/README.adoc @@ -31,10 +31,14 @@ the word in any case and add what it likes after it, such as "*Accepted `just adr-check` (part of `just check-views`) runs `scripts/decisions/adr-status.mjs check`. It fails when a record's header and -Status section disagree, or when only one of them states a status. It reads the +Status section disagree, when only one of them states a status, or when a +record states a status the readers refuse to read (for example, beside a +preprocessor directive or under a heading such as "Status quo"). It reads the records that git tracks here, each at its own path: when this directory, or a record, is a link, the check fails and reads nothing through it. A record that -states neither is listed, for the owner to set; it does not count as accepted. +states no status at all (no `status` entry, no heading that could read Status, +no directive that could bring one in) is listed, for the owner to set; it does +not count as accepted. Both are read conservatively, so the reader never finds a status Asciidoctor would not: diff --git a/scripts/decisions/adr-status.mjs b/scripts/decisions/adr-status.mjs index b4b2271d..89b11e46 100644 --- a/scripts/decisions/adr-status.mjs +++ b/scripts/decisions/adr-status.mjs @@ -165,6 +165,16 @@ export function adrStatus(text) { const header = headerStatus(text), section = sectionStatus(text); return {header, section, inStep: header !== null && header.split(' ')[0] === section}; } +// Whether a record states no status at all, as far as can be shown: no line could +// set "status" (an entry in any letter case, a {set:...} or {counter:...} that +// names it, or a preprocessor directive that could bring either in), and no line +// could be a heading titled Status. A record the readers refuse is not one of +// these: its status is there but cannot be read soundly, and that fails the check. +// ({set:Status:X} sets "status"; a counter on another attribute does not.) +const SETS_STATUS = /\{(?:set|counter2?):status(?=[:!}])/i; +export function statesNoStatus(text) { + return !linesOf(text).some(l => STATUS_ENTRY.test(l) || SETS_STATUS.test(l) || PREPROCESSOR.test(l) || mayBeStatus(l)); +} export const adrAccepted = text => { const s = adrStatus(text); return s.inStep && s.header === 'ACCEPTED'; @@ -172,8 +182,9 @@ export const adrAccepted = text => { // โ”€โ”€ The check โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ // Every decision record, NNNN-title.adoc with the boilerplate NNNN-template.adoc -// set aside, states its status in both places and they agree; or it states it in -// neither (a status the owner has yet to set), which is reported, not refused. +// set aside, states its status in both places and they agree; or it states none +// at all (a status the owner has yet to set), which is reported, not refused. A +// record whose status the readers refuse to read is refused: it is not unset. // The records are the files git tracks in docs/decisions, read at their own path // (scripts/repo/files.mjs): a directory or a record that is a link leads out of // the repository, so it is refused, and never read. @@ -185,9 +196,11 @@ export function checkDecisions(root = ROOT) { return records.map(f => { const p = `${DECISIONS}/${f}`; if (!files.isFile(p)) return {file: f, problem: 'is not a file that git tracks in the repository, at its own path'}; - const s = adrStatus(files.read(p)); + const text = files.read(p); + const s = adrStatus(text); if (s.inStep) return {file: f, status: s.header}; - if (s.header === null && s.section === null) return {file: f, status: null}; + if (statesNoStatus(text)) return {file: f, status: null}; + if (s.header === null && s.section === null) return {file: f, problem: 'it states a status that cannot be read soundly (see docs/decisions/README.adoc)'}; return {file: f, problem: `its header says ${s.header ?? 'nothing readable'} but its Status section says ${s.section ?? 'nothing readable'}`}; }); } diff --git a/tests/decisions/adr-status.test.mjs b/tests/decisions/adr-status.test.mjs index e07d411f..af047aed 100644 --- a/tests/decisions/adr-status.test.mjs +++ b/tests/decisions/adr-status.test.mjs @@ -230,6 +230,28 @@ test('the check keeps every decision record in step, and reports one that states writeFileSync(path.join(dir, '0009-notes/x.adoc'), '= N\n:status: ACCEPTED\n\n=== Status\n\nProposed.\n'); git(root, 'add', 'docs/decisions/0009-notes'); expect(checkDecisions(root).map(r => r.file)).toEqual(['0001-a.adoc', '0002-b.adoc', '0004-c.adoc', '0005-d.adoc', '0006-e.adoc', '0007-link.adoc']); + // A record whose status the readers refuse is refused, not reported as unset: + // a directive, a mutating reference or a heading that could read Status beside + // an otherwise sound status makes it unreadable, never silently empty. + const unreadable = 'it states a status that cannot be read soundly (see docs/decisions/README.adoc)'; + for (const [f, body] of [ + ['0010-include.adoc', '= J\n:status: ACCEPTED\n\n=== Status\n\nAccepted\n\ninclude::more.adoc[]\n'], + ['0011-ifdef.adoc', '= K\n:status: ACCEPTED\n\nifdef::x[]\n\n=== Status\n\nAccepted\nendif::[]\n'], + ['0012-quo.adoc', '= L\n\n== Status quo\n\nNothing is decided.\n'], + ['0013-counter.adoc', '= M\n\nA {counter:status} count.\n'], + ['0014-entry.adoc', '= N\n\nBody.\n\n:Status: ACCEPTED\n'], + ['0016-set.adoc', '= P\n\nText {set:Status:ACCEPTED} here.\n'], + // Nothing here names a status, but the included file could set one. + ['0017-include-only.adoc', '= Q\n\ninclude::decision.adoc[]\n'], + ['0015-plain-counter.adoc', '= O\n\nA {counter:n} count and the word status in prose.\n'], + ]) put(f, body); + const byFile = new Map(checkDecisions(root).map(r => [r.file, r])); + for (const f of ['0010-include.adoc', '0011-ifdef.adoc', '0012-quo.adoc', '0013-counter.adoc', '0014-entry.adoc', '0016-set.adoc', '0017-include-only.adoc']) + expect(byFile.get(f)).toEqual({file: f, problem: unreadable}); + // A record that states nothing about status, in any form, is still listed as + // unset, though it counts something else or says "status" in its prose. + expect(byFile.get('0002-b.adoc')).toEqual({file: '0002-b.adoc', status: null}); + expect(byFile.get('0015-plain-counter.adoc')).toEqual({file: '0015-plain-counter.adoc', status: null}); // A decisions directory that is a link out of the repository is refused, and // nothing through it is read, though git tracks the link. const linked = mkdtempSync(path.join(tmpdir(), 'adr-linked-')); From ba016e78df93c704b3bc0e42429ba46f9a39cf57 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 12:38:58 +0000 Subject: [PATCH 37/41] site builds into a fresh tree; underlined Status; checkout names kept Codex, on 76963ba: - The site build wrote through a link left in an existing output tree, out of OUT (probed: it overwrote a file elsewhere). OUT must now be absent, or an empty directory that is not a link, so the build always fills a fresh tree. site and site-check already build into fresh temporary directories. - statesNoStatus now also counts a two-line title ("Status" over an underline), so such a record fails adr-check instead of passing as unset; an underlined title that cannot read Status still leaves a record unset. - repoFiles cut white space from the checkout path git prints; it now cuts only git's closing newline, so a directory name ending in white space is kept. Tests for each; 6 of 6 mutants killed. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 6 ++++-- docs/decisions/README.adoc | 3 ++- scripts/decisions/adr-status.mjs | 13 ++++++++----- scripts/repo/files.mjs | 5 +++-- scripts/site/site.mjs | 12 +++++++++++- tests/decisions/adr-status.test.mjs | 7 ++++++- tests/repo/files.test.mjs | 11 +++++++++++ tests/site/site.test.mjs | 21 +++++++++++++++++++++ 8 files changed, 66 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 682745b0..ea84b698 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -130,8 +130,10 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. the link check refuses, instead of the included file's text: in safe mode, with the base directory at `/`, a view could include any file on the system. The output is otherwise byte-identical. A link to a repository file - becomes a GitHub link only when git tracks the file. `site-check` now runs - the site tests, so CI runs them; it did not before. + becomes a GitHub link only when git tracks the file. The build writes only + into a fresh output directory (absent, or empty and not a link), so a link + left in an old output tree cannot make it overwrite a file elsewhere. + `site-check` now runs the site tests, so CI runs them; it did not before. * The 27 `hyperpolymath/resource-algebra` claims move their pin to `a17ffb6` (2026-11-17), whose receipt describes `47de4a8`, the merge of diff --git a/docs/decisions/README.adoc b/docs/decisions/README.adoc index 95263d9b..4de219c6 100644 --- a/docs/decisions/README.adoc +++ b/docs/decisions/README.adoc @@ -37,7 +37,8 @@ preprocessor directive or under a heading such as "Status quo"). It reads the records that git tracks here, each at its own path: when this directory, or a record, is a link, the check fails and reads nothing through it. A record that states no status at all (no `status` entry, no heading that could read Status, -no directive that could bring one in) is listed, for the owner to set; it does +whether `== Status` or `Status` over an underline, no directive that could bring +one in) is listed, for the owner to set; it does not count as accepted. Both are read conservatively, so the reader never finds a status Asciidoctor diff --git a/scripts/decisions/adr-status.mjs b/scripts/decisions/adr-status.mjs index 89b11e46..a84b1fbc 100644 --- a/scripts/decisions/adr-status.mjs +++ b/scripts/decisions/adr-status.mjs @@ -75,11 +75,10 @@ function lineKinds(lines) { // then a title that could read "Status". The title is the rest of the line, taken // whole, so the pattern cannot backtrack and no character of the title escapes it. const HEADING = /^[=#]+[ \t]/; +const titleMayBeStatus = title => /\{|&#?\w+;/.test(title) || /status/i.test(title.replace(/[^\p{L}]/gu, '')); const mayBeStatus = l => { const m = HEADING.exec(l); - if (m === null) return false; - const title = l.slice(m[0].length); - return /\{|&#?\w+;/.test(title) || /status/i.test(title.replace(/[^\p{L}]/gu, '')); + return m !== null && titleMayBeStatus(l.slice(m[0].length)); }; // Asciidoctor reads a line over an underline within one character of its // length as a two-line section title; two characters are allowed here. @@ -168,12 +167,16 @@ export function adrStatus(text) { // Whether a record states no status at all, as far as can be shown: no line could // set "status" (an entry in any letter case, a {set:...} or {counter:...} that // names it, or a preprocessor directive that could bring either in), and no line -// could be a heading titled Status. A record the readers refuse is not one of +// could be a heading titled Status, in either form: "== Status", or "Status" over +// an underline. A record the readers refuse is not one of // these: its status is there but cannot be read soundly, and that fails the check. // ({set:Status:X} sets "status"; a counter on another attribute does not.) const SETS_STATUS = /\{(?:set|counter2?):status(?=[:!}])/i; export function statesNoStatus(text) { - return !linesOf(text).some(l => STATUS_ENTRY.test(l) || SETS_STATUS.test(l) || PREPROCESSOR.test(l) || mayBeStatus(l)); + const lines = linesOf(text); + const kinds = lineKinds(lines); + const underlined = i => overUnderline(lines, kinds, i) && titleMayBeStatus(lines[i]); + return !lines.some((l, i) => STATUS_ENTRY.test(l) || SETS_STATUS.test(l) || PREPROCESSOR.test(l) || mayBeStatus(l) || underlined(i)); } export const adrAccepted = text => { const s = adrStatus(text); diff --git a/scripts/repo/files.mjs b/scripts/repo/files.mjs index 02a8bd4b..2f0c6b28 100644 --- a/scripts/repo/files.mjs +++ b/scripts/repo/files.mjs @@ -30,11 +30,12 @@ export function findProgram(name, env = process.env) { } // The paths git tracks in the checkout at `base`, which must be the top of its -// work tree, relative to it. +// work tree, relative to it. Only git's closing newline is cut from the path it +// prints: a directory name may itself end in white space. function trackedPaths(base) { const git = args => spawnSync(findProgram('git'), ['-C', base, ...args], {encoding: 'utf8', maxBuffer: 1 << 28}); const top = git(['rev-parse', '--show-toplevel']); - if (top.error || top.status !== 0 || realpathSync(top.stdout.trim()) !== base) { + if (top.error || top.status !== 0 || realpathSync(top.stdout.replace(/\n$/, '')) !== base) { throw new Error(`${base} is not the top of a git checkout; the files read here are the files git tracks`); } const ls = git(['ls-files', '-z', '--full-name']); diff --git a/scripts/site/site.mjs b/scripts/site/site.mjs index 55a75710..f5941037 100644 --- a/scripts/site/site.mjs +++ b/scripts/site/site.mjs @@ -14,11 +14,12 @@ // - A relative link to a file that is neither in the site nor in the // repository fails. A relative link to a repository file that is not in // the site becomes an absolute GitHub link at `main`. +// - It writes only into a fresh output directory: OUT is absent, or empty. // - It reads from the repository only files that git tracks, at their own // path (scripts/repo/files.mjs): each view, the front page's sources and // each asset it copies. A view or an asset that is a link, or untracked, // fails the build, so nothing from outside the repository enters the site. -import {readFileSync, writeFileSync, mkdirSync, mkdtempSync, readdirSync, statSync} from 'node:fs'; +import {readFileSync, writeFileSync, mkdirSync, mkdtempSync, readdirSync, statSync, lstatSync} from 'node:fs'; import {spawnSync} from 'node:child_process'; import {tmpdir} from 'node:os'; import path from 'node:path'; @@ -147,7 +148,16 @@ function asciidoctor(args) { if (r.status !== 0) throw new Error(`asciidoctor failed (status ${r.status})`); } +// The site is built into a fresh tree: OUT is absent, or an empty directory that +// is not itself a link. A stale or planted tree could hold a link where the build +// writes, and the build (or Asciidoctor) would write through it, out of OUT. +function freshOut(out) { + let st = null; + try { st = lstatSync(out); } catch { return; } + if (!st.isDirectory() || readdirSync(out).length) throw new Error(`${out} is not a fresh output directory: give a path that does not exist, or an empty directory`); +} export function build(root, out) { + freshOut(out); const files = repoFiles(root); const unread = [...VIEWS.map(v => v.file), ...VIEWS.flatMap(v => v.assets ?? [])].filter(f => !files.isFile(f)); if (unread.length) throw new Error(unread.map(f => `${f} is not a file that git tracks in the repository`).join('\n')); diff --git a/tests/decisions/adr-status.test.mjs b/tests/decisions/adr-status.test.mjs index af047aed..2f145762 100644 --- a/tests/decisions/adr-status.test.mjs +++ b/tests/decisions/adr-status.test.mjs @@ -243,15 +243,20 @@ test('the check keeps every decision record in step, and reports one that states ['0016-set.adoc', '= P\n\nText {set:Status:ACCEPTED} here.\n'], // Nothing here names a status, but the included file could set one. ['0017-include-only.adoc', '= Q\n\ninclude::decision.adoc[]\n'], + // A two-line title, "Status" over an underline, is a Status heading too. + ['0018-underlined.adoc', '= R\n\nStatus\n------\n\nAccepted\n'], + // An underlined title that cannot read Status leaves the record unset. + ['0019-context.adoc', '= S\n\nContext\n-------\n\nNothing is decided.\n'], ['0015-plain-counter.adoc', '= O\n\nA {counter:n} count and the word status in prose.\n'], ]) put(f, body); const byFile = new Map(checkDecisions(root).map(r => [r.file, r])); - for (const f of ['0010-include.adoc', '0011-ifdef.adoc', '0012-quo.adoc', '0013-counter.adoc', '0014-entry.adoc', '0016-set.adoc', '0017-include-only.adoc']) + for (const f of ['0010-include.adoc', '0011-ifdef.adoc', '0012-quo.adoc', '0013-counter.adoc', '0014-entry.adoc', '0016-set.adoc', '0017-include-only.adoc', '0018-underlined.adoc']) expect(byFile.get(f)).toEqual({file: f, problem: unreadable}); // A record that states nothing about status, in any form, is still listed as // unset, though it counts something else or says "status" in its prose. expect(byFile.get('0002-b.adoc')).toEqual({file: '0002-b.adoc', status: null}); expect(byFile.get('0015-plain-counter.adoc')).toEqual({file: '0015-plain-counter.adoc', status: null}); + expect(byFile.get('0019-context.adoc')).toEqual({file: '0019-context.adoc', status: null}); // A decisions directory that is a link out of the repository is refused, and // nothing through it is read, though git tracks the link. const linked = mkdtempSync(path.join(tmpdir(), 'adr-linked-')); diff --git a/tests/repo/files.test.mjs b/tests/repo/files.test.mjs index b67d72d5..64a96a98 100644 --- a/tests/repo/files.test.mjs +++ b/tests/repo/files.test.mjs @@ -106,6 +106,17 @@ test('local paths: plain files and directories inside, tracked or not', () => { expect(files.local.isFile('dangling')).toBe(false); }); +// git prints the top of the checkout with a closing newline, which is cut; white +// space that ends the directory's own name is part of the path and is kept. +test('a checkout whose name ends in white space is read like any other', () => { + const root = path.join(temp('repo-files-ws-'), 'repo \t '); + mkdirSync(path.join(root, 'docs'), {recursive: true}); + writeFileSync(path.join(root, 'docs/a.adoc'), 'a\n'); + git(root, 'init', '-q'); + git(root, 'add', '-A'); + expect(repoFiles(root).read('docs/a.adoc')).toBe('a\n'); +}); + test('only the top of a git checkout is read, and a failing git fails loudly', () => { const bare = temp('repo-files-nogit-'); expect(() => repoFiles(bare).isFile('x')).toThrow(/is not the top of a git checkout/); diff --git a/tests/site/site.test.mjs b/tests/site/site.test.mjs index dd57e420..c669b838 100644 --- a/tests/site/site.test.mjs +++ b/tests/site/site.test.mjs @@ -126,6 +126,27 @@ test('a view links on GitHub only to files git tracks', () => withSite(({fix, ou expect(readFileSync(path.join(`${out}-tracked`, htmlPath(view.file)), 'utf8')).toContain(`${GITHUB}/blob/main/notes.adoc`); })); +// The site is built into a fresh tree. An output directory that holds anything, +// a link where the build writes above all, or that is itself a link, is refused +// before a byte is written, so nothing outside it can be overwritten. +test('the site is built only into a fresh output directory', () => withSite(({fix, outside, out}) => { + const [asset] = VIEWS.flatMap(v => v.assets ?? []); + writeFileSync(path.join(outside, 'victim.txt'), 'ORIGINAL\n'); + mkdirSync(path.dirname(path.join(out, asset)), {recursive: true}); + symlinkSync(path.join(outside, 'victim.txt'), path.join(out, asset)); + expect(() => build(fix, out)).toThrow(/is not a fresh output directory/); + expect(readFileSync(path.join(outside, 'victim.txt'), 'utf8')).toBe('ORIGINAL\n'); + // A directory that is itself a link is refused, though empty. + const empty = path.join(outside, 'empty'); + mkdirSync(empty); + symlinkSync(empty, `${out}-link`); + expect(() => build(fix, `${out}-link`)).toThrow(/is not a fresh output directory/); + // An empty directory, or a path that does not exist yet, is fresh. + mkdirSync(`${out}-empty`); + expect(build(fix, `${out}-empty`).length).toBe(VIEWS.length + 1); + expect(build(fix, `${out}-new`).length).toBe(VIEWS.length + 1); +})); + // Asciidoctor reads no file but the page it renders: an include in a view, of a // file outside the repository, is not read into the site; it fails the build. test('an include in a view reads nothing into the site', () => withSite(({fix, outside, out, git}) => { From d86947c45aba91af757eb26bcd6b38562c546bb1 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 14:03:53 +0000 Subject: [PATCH 38/41] ultraplan: Mathesis hosts its own visual proof space (owner ruling) Owner rulings of 2026-11-25, through the decision desk (verified in the desk session's transcript): - Mathesis hosts its own visual proof space: the maths panel and the owner's private me panel live in Mathesis. MPSCI only links to it, with a summary card or a link; GELO is not involved yet. The me panel's notes still stay outside this public repository and every feed (ruling of 2026-11-24). The maths-panel node, renamed "Visual proof space", is open and joins the frontier (13 nodes); the picks are unchanged. - Agent pull requests are to be committed through the GitHub API, so each carries GitHub's verified (web-flow) signature. Recorded in the ROADMAP. Departure, labelled: this commit is pushed with git, unsigned like the branch's earlier commits. The session's proxy refuses Git Data API writes, and the only open API route (the MCP tools) would mean retyping about 170 KB of generated views inline. A squash merge through GitHub gives main one web-flow-signed commit. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/status/ROADMAP.adoc | 10 +++++++ docs/ultraplan/README.adoc | 39 +++++++++++++++---------- docs/ultraplan/generated/tree.svg | 12 ++++---- docs/ultraplan/generated/ultraplan.adoc | 16 +++++----- docs/ultraplan/tree.jsonl | 2 +- 5 files changed, 48 insertions(+), 31 deletions(-) diff --git a/docs/status/ROADMAP.adoc b/docs/status/ROADMAP.adoc index f73f7c43..f2ff26d4 100644 --- a/docs/status/ROADMAP.adoc +++ b/docs/status/ROADMAP.adoc @@ -489,3 +489,13 @@ scheduled census, a view of what each repository owes its Status section. ** Guix proof CI gets one estate-wide fix at source, queued as its own task (CI upkeep, on a cheaper model). +* Owner rulings (2026-11-25), through the decision desk: +** Mathesis hosts its own visual proof space: the maths panel and the + owner's private me panel live in Mathesis. MPSCI only links to it, with a + summary card or a link. GELO is not involved yet. The me panel's notes + still stay outside this public repository and every feed (ruling + 2026-11-24). The `maths-panel` node is now open. +** Agent pull requests are committed through the GitHub API, so each commit + carries GitHub's verified (web-flow) signature; the owner re-signs + nothing. The signature attests GitHub and the owner's account, not the + estate signing key (a doctrine 9 note). diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 67af3988..6e1ad00e 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -126,8 +126,9 @@ by leverage first, the contrarian would name what the council already ranks first. That keeps the road not taken in view. * The *me* advisor looks out for what could help the owner's own life. Its notes are kept privately, outside this public repository and out of every feed: in -a private panel that the owner owns (owner ruling 2026-11-24; which system hosts -it is open, see <>). A node carries at most the +a private panel that the owner owns (owner ruling 2026-11-24). Mathesis hosts +that panel in its own visual proof space (owner ruling 2026-11-25, see +<>), and its notes still never enter this repository or a feed. A node carries at most the neutral tag `"owner_value":"high"`, and the generator refuses any counsel under the key `me`. The me advisor names no public pick (owner ruling 2026-11-24): the owner chooses in that private panel, and the page lists, in id order and @@ -191,17 +192,24 @@ in that request, and named them. Both live in metadatastician: Logistics System, a name now retired. Earlier text here called that system GELS, and "the estate display"; that was -the mix-up. Which system, MPSCI or GELO, shows the maths panel and the owner's -private panel, and reads the feed, is open for the owner to settle. +the mix-up. -What was settled on 2026-11-24 still stands, whichever system it lands in: +The host is settled (owner ruling 2026-11-25, through the decision desk): -* Mathesis publishes a read-only I-JSON/JCS feed, which the estate shows as one -panel type. The estate coordinator gave this answer while the panel was taken -to be in the system then called GELS. -* The feed carries the tree's nodes, the advisors' picks (never the me -advisor's), the grade census with its denominator, and the claim pins. -* Open decisions go to the owner's decision desk, not this panel. +* *Mathesis hosts its own visual proof space.* The maths panel and the owner's +private me panel live in Mathesis. The me panel's notes still stay outside this +public repository and out of every feed (ruling 2026-11-24): where they are +kept is settled when the panel is built. +* *MPSCI only links to it*, with a summary card or a link. +* *GELO is not involved yet.* + +What was settled on 2026-11-24 still holds where a reader outside Mathesis needs +the data, such as MPSCI's summary card: + +* Mathesis publishes a read-only I-JSON/JCS feed. It carries the tree's nodes, +the advisors' picks (never the me advisor's), the grade census with its +denominator, and the claim pins. +* Open decisions go to the owner's decision desk, not the panel. * The reader pins by commit (owner ruling). Mathesis commits the feed as a generated view, which `just check` refuses when stale. The reader asks the GitHub API for the head commit of main and reads the feed at that commit, so @@ -209,8 +217,7 @@ each read names its commit. No secret comes into this repository, and nothing here needs a new permission. A draft of the feed and panel contract was begun in MPSCI's repository -(`docs/proposals/feed-panel-contract.adoc`). Its thread, the estate coordinator -and the decision desk have been told of the clarification. Until the owner -settles the host and the contract exists, nothing here writes a feed: a feed -with no agreed reader would be unwired. The panel is a node in the tree -(`maths-panel`), blocked on both. +(`docs/proposals/feed-panel-contract.adoc`). With the host settled, that +contract shrinks to what MPSCI's card reads. Nothing here writes a feed until +the card has an agreed reader: a feed with no reader would be unwired. The proof +space is a node in the tree (`maths-panel`), now open. diff --git a/docs/ultraplan/generated/tree.svg b/docs/ultraplan/generated/tree.svg index 4a89ca57..98c14b8a 100644 --- a/docs/ultraplan/generated/tree.svg +++ b/docs/ultraplan/generated/tree.svg @@ -55,8 +55,8 @@ - - + + @@ -275,12 +275,12 @@ ๐ŸŒฑ -Maths panel for the estate: The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel. - +Visual proof space: Mathesis hosts its own visual proof space (owner ruling 2026-11-25): the tech tree, its frontier, the grade census with its denominator, and the claim pins. The ownerโ€™s private me panel lives here too, its notes kept outside this repository and every feed. MPSCI links to it with a summary card. Open decisions go to the ownerโ€™s decision desk. + ๐ŸชŸ -Maths panel for the eโ€ฆ +Visual proof space ๐Ÿ—บ ecosystem ยท M -โ›” +๐ŸŒฑ Generated Idris2 token laws: Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it. diff --git a/docs/ultraplan/generated/ultraplan.adoc b/docs/ultraplan/generated/ultraplan.adoc index f94521ea..b55ee27a 100644 --- a/docs/ultraplan/generated/ultraplan.adoc +++ b/docs/ultraplan/generated/ultraplan.adoc @@ -13,7 +13,7 @@ never typed. A node marked done carries evidence the generator checks: a file, a claim grade that the registry derives, or an accepted decision record. The value marks are judgements, written down so they can be argued with. -Census of the tree: 12 done, 2 active (at most 3), 35 open, 3 blocked, 0 dropped, of 52 nodes. 12 can be started now. +Census of the tree: 12 done, 2 active (at most 3), 36 open, 2 blocked, 0 dropped, of 52 nodes. 13 can be started now. toc::[] @@ -39,6 +39,7 @@ counts the live nodes that depend on it, directly or through others. |xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image] |engineering |M |1 |Run the three proof lanes in a container image pinned by digest, the condition PROOF-POLICY now sets for PWG-1 (standards#1625). The Guix shell alone does not qualify. |xref:s2-monotone[๐Ÿ“ˆ S-2: evaluation is monotone] |maths |S |1 |Positive evaluation of status is monotone. It holds for each ordered resource algebra, so it can be proved once against the kernel now, whatever X-PF1 decides (R-3). |xref:doc-drift-fix[๐Ÿงน Mend the status documents] |engineering |S |0 |ROADMAP, PROOF-NEEDS, README and the intend contract contradict the receipts (PWG-1 vs PWG-2ii, receipts called planned that exist, stage states). Make each agree with the derived facts. +|xref:maths-panel[๐ŸชŸ Visual proof space] |ecosystem |M |0 |Mathesis hosts its own visual proof space (owner ruling 2026-11-25): the tech tree, its frontier, the grade census with its denominator, and the claim pins. The ownerโ€™s private me panel lives here too, its notes kept outside this repository and every feed. MPSCI links to it with a summary card. Open decisions go to the ownerโ€™s decision desk. |xref:paper-thy1[๐Ÿ“„ Note: feature reachability] |publications |M |0 |A short note on THY-1: why requesting every feature is a sound check for absence, with the three-prover receipt as artefact. Its dependant is a real standards rule. |xref:statistical-bridge[๐ŸŽฒ From oracle to theorem] |science |L |0 |S-MN and S-DM (the multinomial logit closed form and the DM contrast limit) are tested only, against MetaManifold-WebUI as oracle. Prove them in Agda, Rocq and Lean for admission (Q-2.6). |xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] |publications |M |0 |A worked tutorial: a small business model where missing data stays missing, with the proofs alongside and synthetic data only. @@ -120,7 +121,7 @@ same place; the contrarian keeps the road not taken in view. * xref:app-proofs[๐Ÿ’ง APP-1 to APP-4: missing stays missing] -> xref:forecast-13wk[๐Ÿ“… Thirteen-week forecast], xref:s4-s5-verdict[๐ŸŒฆ๏ธ S-4 and S-5: honest cash verdicts], xref:teaching-cohort[๐Ÿ““ Cohort economics, taught] * xref:bridge-lock-pilot[๐Ÿ”— Bridge lock pilot] -> xref:centre-computations[๐ŸŽฏ Centre computations], xref:echo-mirrors[๐Ÿชž Echo mirror records], xref:encoding-differences[๐Ÿ”ค Closed list of encoding differences], xref:s1-reuse[โ™ป๏ธ S-1 by reuse of resource-algebra] * xref:centre-computations[๐ŸŽฏ Centre computations] -> xref:concept-commons[๐Ÿ›๏ธ Concept commons], xref:corpus[๐Ÿงช Propose and dispose corpus] -* xref:claims-registry[๐Ÿ“’ Claims registry] -> xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] +* xref:claims-registry[๐Ÿ“’ Claims registry] -> xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Visual proof space], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] * xref:proof-gate[๐Ÿ›ก๏ธ Proof gate in pinned Guix] -> xref:cohort-model[๐Ÿ‘ฅ Cohort model in Agda], xref:pinned-image[๐Ÿ“ฆ Proof lanes in a pinned image], xref:receipts[๐Ÿ” Proof receipts], xref:thy1[๐Ÿงญ THY-1: reachability is monotone] * xref:receipt-generator[๐Ÿญ Shared receipt generator] -> xref:ci-recorder[๐Ÿค– CI records its own runs], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:pwg1-regained[๐Ÿฅ‡ Back to PWG-1], xref:receipts-campaign[๐Ÿ“ฃ Receipts campaign], xref:superseded-manifests-option[๐Ÿ—„๏ธ Keep superseded manifests (option)] * xref:receipts[๐Ÿ” Proof receipts] -> xref:paper-thy1[๐Ÿ“„ Note: feature reachability], xref:receipt-generator[๐Ÿญ Shared receipt generator], xref:s3-grade-function[๐ŸŽš๏ธ S-3: the grade is a function] @@ -232,7 +233,7 @@ Pins each claim in its home repository and derives each grade from the home rece *Track:* โš™ engineering ยท *Kind:* tool ยท *Size:* L ยท *Status:* done *Needs:* xref:census[๐Ÿงพ Census of the estate] + -*Enables:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Maths panel for the estate], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] + +*Enables:* xref:bridge-candidates[๐ŸŒ‰ Bridge candidates], xref:chain-question[๐Ÿงฉ Is a chain enough? (X-PF1)], xref:doc-drift-fix[๐Ÿงน Mend the status documents], xref:maths-panel[๐ŸชŸ Visual proof space], xref:paper-receipts[๐Ÿ“ฐ Paper: receipts, not claims], xref:receipts[๐Ÿ” Proof receipts], xref:theory-shelf[๐Ÿ“š Theory shelf and ledger], xref:whats-owed[๐Ÿ“‹ What is owed] + *Evidence:* ADR 0004 accepted; `docs/atlas/generated/registry.adoc` + *Value (judgement):* engineering โ—โ—โ—, soundness โ—โ—โ—, ecosystem โ—โ—โ— @@ -337,7 +338,7 @@ This tech tree: data first, with derived eras, frontier, forks&# *Track:* โš™ engineering ยท *Kind:* view ยท *Size:* S ยท *Status:* done *Needs:* xref:atlas-views[๐Ÿ—บ๏ธ Atlas views] + -*Enables:* xref:maths-panel[๐ŸชŸ Maths panel for the estate] + +*Enables:* xref:maths-panel[๐ŸชŸ Visual proof space] + *Evidence:* `docs/ultraplan/tree.jsonl`; `scripts/ultraplan/ultraplan.mjs` + *Value (judgement):* engineering โ—, teaching โ— @@ -548,14 +549,13 @@ The full bridge record for two pilots, a squeakwell ladder row and resource& * โˆ‘ _Mathematician:_ Equivalence as identity, made checkable. [[maths-panel]] -==== โ›” ๐ŸชŸ Maths panel for the estate +==== ๐ŸŒฑ ๐ŸชŸ Visual proof space -The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel. +Mathesis hosts its own visual proof space (owner ruling 2026-11-25): the tech tree, its frontier, the grade census with its denominator, and the claim pins. The ownerโ€™s private me panel lives here too, its notes kept outside this repository and every feed. MPSCI links to it with a summary card. Open decisions go to the ownerโ€™s decision desk. -*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* blocked +*Track:* ๐Ÿ—บ ecosystem ยท *Kind:* view ยท *Size:* M ยท *Status:* open *Needs:* xref:claims-registry[๐Ÿ“’ Claims registry], xref:ultraplan[๐ŸŒณ The ultraplan] + -*Blocked by:* the ownerโ€™s choice of host (owner clarification 2026-11-25): MPSCI, the Master Production and Scheduling Command Interface, or GELO, the Git Estate Logistics Office, both in metadatastician; then their feed and panel contract + *Value (judgement):* engineering โ—โ—, teaching โ—, ecosystem โ—โ— === โ™พ๏ธ Era 4: Cantor diff --git a/docs/ultraplan/tree.jsonl b/docs/ultraplan/tree.jsonl index c12f645b..b9eed8a9 100644 --- a/docs/ultraplan/tree.jsonl +++ b/docs/ultraplan/tree.jsonl @@ -20,7 +20,7 @@ {"glyph":"๐Ÿ”๏ธ","id":"estate-pwg2ii","kind":"data","name":"PWG-2ii across the estate","needs":["corpus","receipts-campaign","ci-recorder"],"refs":[{"at":"Q-H.3 What does a recheck leg cost?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"A measured cost for a recheck leg, and with it a","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"XL","status":"open","summary":"The long horizon (Q-H.3): the 900 and more ungraded theorems of the estate each carry two checked recheck legs. The question is whether that takes months or years.","track":"ecosystem","value":{"ecosystem":3,"maths":2,"science":1,"soundness":3}} {"counsel":{"economics":"A few hours of filing could unblock a whole route for everyone."},"glyph":"๐Ÿ›","id":"file-transport-bugs","kind":"decision","name":"File the transport reproducers","needs":["thy1"],"refs":[{"at":"Next action: the owner files both reports","path":"docs/status/ROADMAP.adoc"},{"at":"File the THY-1 reproducer with the translator's authors","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"S","status":"open","summary":"File the THY-1 reproducers upstream (E-2.4): the Agda2Dedukti crash and option gaps, and Lambdapi dropping rules. Filing is the owner's act.","track":"ecosystem","value":{"ecosystem":2,"engineering":1},"where":"upstream:Deducteam/agda2dedukti"} {"counsel":{"economics":"The first output a business reader would recognise."},"glyph":"๐Ÿ“…","id":"forecast-13wk","kind":"method","name":"Thirteen-week forecast","needs":["app-proofs"],"owner_value":"high","refs":[{"at":"Write one synthetic 13-week forecast as records","path":"docs/proposals/mathesis-research-programme.adoc"},{"path":"applied-systems/finance/liquidity/README.adoc"}],"size":"M","status":"open","summary":"A synthetic thirteen-week cash forecast on the proved cohort model (E-4.1), the first worked decision of the applied shelf.","track":"economics","value":{"economics":3,"engineering":1,"teaching":2}} -{"blocked_by":"the ownerโ€™s choice of host (owner clarification 2026-11-25): MPSCI, the Master Production and Scheduling Command Interface, or GELO, the Git Estate Logistics Office, both in metadatastician; then their feed and panel contract","glyph":"๐ŸชŸ","id":"maths-panel","kind":"view","name":"Maths panel for the estate","needs":["claims-registry","ultraplan"],"size":"M","status":"blocked","summary":"The tech tree as one panel type in the estateโ€™s interface: frontier, grade census with its denominator, and claim pins, from a read-only Mathesis feed pinned by commit. Open decisions go to the ownerโ€™s decision desk, not this panel.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1}} +{"glyph":"๐ŸชŸ","id":"maths-panel","kind":"view","name":"Visual proof space","needs":["claims-registry","ultraplan"],"size":"M","status":"open","summary":"Mathesis hosts its own visual proof space (owner ruling 2026-11-25): the tech tree, its frontier, the grade census with its denominator, and the claim pins. The ownerโ€™s private me panel lives here too, its notes kept outside this repository and every feed. MPSCI links to it with a summary card. Open decisions go to the ownerโ€™s decision desk.","track":"ecosystem","value":{"ecosystem":2,"engineering":2,"teaching":1}} {"glyph":"๐Ÿงฌ","id":"idris-token-laws","kind":"tool","name":"Generated Idris2 token laws","needs":["s1-token-algebra"],"refs":[{"at":"Generate the Idris2 statement of the token laws from the source of","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"M","status":"open","summary":"Generate the Idris2 token laws of the proof-route Token module from S-1 (E-3.2), so the engineering side cites the theorem instead of restating it.","track":"engineering","value":{"ecosystem":2,"engineering":2,"maths":1},"where":"estate:metadatastician/standards"} {"glyph":"๐Ÿ—๏ธ","id":"januskey-slice","kind":"method","name":"Theorem to code: januskey","needs":["dossier"],"refs":[{"at":"Q-3.1 Can the composite status be computed?","path":"docs/proposals/mathesis-research-programme.adoc"},{"at":"as the first vertical slice (ruling R-4)","path":"docs/proposals/mathesis-research-programme.adoc"}],"size":"L","status":"open","summary":"Follow one theorem into running code (E-3.1): the januskey slice T-1, with T-10 open and G-2 assumed, and a composite status for the whole (Q-3.1).","track":"engineering","value":{"engineering":3,"maths":1,"soundness":2},"where":"estate:hyperpolymath/januskey"} {"glyph":"๐Ÿ’ถ","id":"liquidity-shelf","kind":"view","name":"Liquidity shelf","needs":["s4-s5-verdict","forecast-13wk"],"size":"M","status":"open","summary":"The liquidity part of the applied shelf: a forecast whose every verdict carries its proof status, from synthetic data only.","track":"economics","value":{"economics":3,"publications":1,"teaching":2}} From 9d4b1e83ac22110cc0825bd17f3341ce0a6672f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 14:14:06 +0000 Subject: [PATCH 39/41] repo/files: local paths stay inside; no live node needs a dropped one Codex, on d86947c: - repoFiles(root).local followed a ".." path out of the checkout (probed: local.read of a "../../.." path read /etc/passwd). Every path, local or tracked, must now be relative and resolve below the checkout's top: "", ".", "..", absolute paths and paths that climb out are refused, and a path outside is never "absent" (nothing may be made there). A name that only begins with two dots stays inside. - Leverage counted nodes below a dropped node as unlocked. A node still in play may no longer need a dropped node (it could never start), so nothing below a dropped node is in play and the count is exact. The current tree has no dropped node; the views are unchanged. Tests for each; 9 of 9 mutants killed. Pushed with git, unsigned, for the reason given in d86947c (labelled departure from the signing ruling). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 3 ++- docs/ultraplan/README.adoc | 3 +++ scripts/repo/files.mjs | 25 ++++++++++++++++++++----- scripts/ultraplan/ultraplan.mjs | 5 +++++ tests/repo/files.test.mjs | 21 +++++++++++++++++++++ tests/ultraplan/ultraplan.test.mjs | 12 ++++++++++++ 6 files changed, 63 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index ea84b698..b8a7d05d 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -106,7 +106,8 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. its own path, and fails when `docs/decisions` is a link. A record whose status the readers refuse fails the check; only a record that states no status at all is listed as unset; - ** a done node whose needs are not done; + ** a done node whose needs are not done, and a node still in play that needs + a dropped node (it could never start); ** a cycle; ** more than three active nodes; ** a ref that does not point at one place: each names a passage that occurs diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index 6e1ad00e..fd46b311 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -74,6 +74,9 @@ fourth, finish or park one first. This is the guard against starting everything. When every slot is taken, the page and the picture still show the frontier, and say that it is ready but cannot start. * *Blocked* must say what blocks it. +* *Dropped* takes the nodes that need it along: a node still in play may not +need a dropped node, since it could never start. So nothing below a dropped node +is counted as unlocked. Each text (a name, a summary, a piece of counsel, a reason, a quote) is plain text on one line (owner ruling 2026-11-25). It carries no markup, and the page diff --git a/scripts/repo/files.mjs b/scripts/repo/files.mjs index 2f0c6b28..675277c1 100644 --- a/scripts/repo/files.mjs +++ b/scripts/repo/files.mjs @@ -53,10 +53,20 @@ export function repoFiles(root) { }; const isTracked = p => trackedSet().has(p); const holdsTracked = p => [...trackedSet()].some(t => t.startsWith(`${p}/`)); - // What stands at the path itself, when no part of it is a link; else null. - const at = p => { - if (typeof p !== 'string' || p === '') return null; + // The full path of p when p is a relative path to something inside the + // checkout, below its top: "", ".", "..", an absolute path, or a path that + // climbs out is null. + const within = p => { + if (typeof p !== 'string' || p === '' || path.isAbsolute(p)) return null; const full = path.join(base, p); + const rel = path.relative(base, full); + return rel !== '' && rel !== '..' && !rel.startsWith(`..${path.sep}`) ? full : null; + }; + // What stands at the path itself, inside the checkout, when no part of it is a + // link; else null. + const at = p => { + const full = within(p); + if (full === null) return null; try { return realpathSync(full) === full ? statSync(full) : null; } catch { return null; } }; const isFile = p => isTracked(p) && at(p)?.isFile() === true; @@ -79,8 +89,13 @@ export function repoFiles(root) { local: { isFile: localFile, isDir: p => at(p)?.isDirectory() === true, - // Nothing at all stands at the path, not even a link that leads nowhere. - isAbsent: p => { try { lstatSync(path.join(base, p)); return false; } catch { return true; } }, + // Nothing at all stands at the path, not even a link that leads nowhere. A + // path outside the checkout is never absent: nothing may be made there. + isAbsent: p => { + const full = within(p); + if (full === null) return false; + try { lstatSync(full); return false; } catch { return true; } + }, read: p => { if (!localFile(p)) throw new Error(`${p} is not a plain file inside the repository`); return readFileSync(path.join(base, p), 'utf8'); diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index b9577207..4ccd29c8 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -354,6 +354,11 @@ function checkNames(n, k, byId, fail) { function checkLinks(n, byId, fail) { checkNames(n, 'needs', byId, fail); checkNames(n, 'rivals', byId, fail); + // A node still in play needs no dropped node: it could never start, and every + // node below it would be counted as unlocked when it never can be. + if (n.status !== 'dropped') { + for (const t of list(n.needs)) if (byId.get(t)?.status === 'dropped') fail(`node ${n.id}: needs ${t}, which is dropped; drop this node too, or name another need`); + } for (const r of list(n.rivals)) if (byId.has(r) && !list(byId.get(r).rivals).includes(n.id)) fail(`node ${n.id}: rival ${r} does not name ${n.id} back`); } diff --git a/tests/repo/files.test.mjs b/tests/repo/files.test.mjs index 64a96a98..c502d75c 100644 --- a/tests/repo/files.test.mjs +++ b/tests/repo/files.test.mjs @@ -90,6 +90,27 @@ test('no link along a path counts, even one git tracks that stays inside', () => expect(files.local.isDir('linked')).toBe(false); }); +// Nothing outside the checkout is a local path: not "..", not an absolute path, +// not a path that climbs out, though a plain file stands there. +test('a local path never leads out of the checkout', () => { + const root = checkout(); + const outside = temp('repo-files-out-'); + writeFileSync(path.join(outside, 'secret.txt'), 'secret\n'); + const files = repoFiles(root); + const climb = path.relative(root, path.join(outside, 'secret.txt')); + expect(climb.startsWith('..')).toBe(true); + for (const p of [climb, path.join(outside, 'secret.txt'), '../../etc/passwd', 'docs/../../x', '..', '.']) { + expect(files.local.isFile(p)).toBe(false); + expect(files.local.isDir(p)).toBe(false); + expect(files.local.isAbsent(p)).toBe(false); + expect(() => files.local.read(p)).toThrow(/is not a plain file inside the repository/); + expect(files.isFile(p)).toBe(false); + } + // A name that only begins with two dots is inside. + writeFileSync(path.join(root, '..notes'), 'n\n'); + expect(files.local.read('..notes')).toBe('n\n'); +}); + test('local paths: plain files and directories inside, tracked or not', () => { const root = checkout(); const files = repoFiles(root); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 04969e76..01f99a27 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -237,6 +237,18 @@ test('the needs form a DAG over known nodes', () => { refuses({nodes: swap('theorem', {needs: ['root', 'root']})}, /needs names root twice/); }); +// A node still in play needs no dropped node: it could never start. Dropping a +// node means dropping what needs it too, so nothing below a dropped node is ever +// counted as unlocked. +test('a node still in play needs no dropped node', () => { + refuses({nodes: swap('theorem', {status: 'dropped', owner_value: undefined})}, /node paper: needs theorem, which is dropped; drop this node too, or name another need/); + refuses({nodes: swap('theorem', {status: 'dropped', owner_value: undefined})}, /node panel: needs theorem, which is dropped/); + const dropped = BASE.map(n => (['theorem', 'paper', 'panel'].includes(n.id) ? strip({...n, status: 'dropped', owner_value: undefined}) : n)); + const d = generate(fixture({nodes: dropped})).derived; + // root now unlocks only tool and cheap, the nodes still in play below it. + expect(d.leverage('root')).toBe(2); +}); + test('rivals name each other back', () => { refuses({nodes: swap('paper', {rivals: ['cheap']})}, /rival cheap does not name paper back/); const both = BASE.map(n => n.id === 'paper' ? {...n, rivals: ['cheap']} : n.id === 'cheap' ? {...n, rivals: ['paper']} : n); From 04aeccea76cad17314ea51f8f27a2b0134de6c22 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 14:25:02 +0000 Subject: [PATCH 40/41] repo/files: strict UTF-8, runnable programs only; no bidi controls Codex, on 9d4b1e8 (each probed before the fix): - findProgram took any entry on PATH by that name, so a plain non-executable "git" earlier on PATH broke every repoFiles consumer. It now passes over anything that is not a regular file it may run, as a shell does. - Repository text was decoded leniently: a malformed byte became U+FFFD and could pass the JCS check. It is now decoded with a fatal decoder; a malformed byte is an error ("is not valid UTF-8"), and a byte order mark is kept as a character, so a check sees it. - A plan text could hold a bidirectional control such as U+202E, which reorders what is shown. U+061C, U+200E, U+200F, U+202A to U+202E and U+2066 to U+2069 are now refused like the other text faults. Tests for each; 9 of 9 mutants killed. Pushed with git, unsigned (see d86947c for the labelled departure from the signing ruling). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- CHANGELOG.adoc | 6 ++++-- docs/ultraplan/README.adoc | 3 ++- scripts/repo/files.mjs | 26 +++++++++++++++++++++----- scripts/ultraplan/ultraplan.mjs | 5 +++++ tests/repo/files.test.mjs | 24 ++++++++++++++++++++++++ tests/ultraplan/ultraplan.test.mjs | 5 +++++ 6 files changed, 61 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index b8a7d05d..0dec532e 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -95,7 +95,8 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. grade the registry derives, or an accepted ADR. Every file the checks read (evidence, refs, ADRs, the registry view and the plan's own sources) is one git tracks, at its own path: no link along it, nothing untracked, - nothing in `.git`. `scripts/repo/files.mjs` reads them, so a clone and + nothing in `.git`, and valid UTF-8 (a malformed byte is an error, never + a silent U+FFFD). `scripts/repo/files.mjs` reads them, so a clone and a linked worktree read the same; An ADR is accepted only when its header states `:status: ACCEPTED` and its Status section agrees (owner ruling 2026-11-25), each read by `scripts/decisions/adr-status.mjs` so @@ -114,7 +115,8 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. exactly once in a file here, a path here, a file of another repository at a full commit, or an issue, and never a line number; ** a text the page could not show as written: one holding a control - character, a line or paragraph separator (U+2028, U+2029), a run of + character, a line or paragraph separator (U+2028, U+2029), a + bidirectional formatting control, a run of spaces, or a space at its start or end. Every text is plain text (owner ruling 2026-11-25): the page writes each ASCII punctuation mark in it as a character reference, so it shows exactly as written and forms no markup; diff --git a/docs/ultraplan/README.adoc b/docs/ultraplan/README.adoc index fd46b311..87e8be45 100644 --- a/docs/ultraplan/README.adoc +++ b/docs/ultraplan/README.adoc @@ -91,7 +91,8 @@ page. * A feed can carry the same strings unchanged, as plain text. * The generator refuses a text the page could not show as written: one that holds a control character (a line break among them), a line or paragraph -separator (U+2028 or U+2029, where a browser breaks the line), a run of two or +separator (U+2028 or U+2029, where a browser breaks the line), a bidirectional +formatting control (such as U+202E, which reorders what is shown), a run of two or more spaces (HTML shows a run as one), or a space at its start or end. A no-break space is shown as written, and is allowed. diff --git a/scripts/repo/files.mjs b/scripts/repo/files.mjs index 675277c1..c63edeae 100644 --- a/scripts/repo/files.mjs +++ b/scripts/repo/files.mjs @@ -16,15 +16,23 @@ // The generated views are the one exception: a generator writes them before git // tracks them, so `local` reads and checks a path with the same link rule but // without asking git. -import {readFileSync, realpathSync, statSync, lstatSync, existsSync} from 'node:fs'; +import {readFileSync, realpathSync, statSync, lstatSync, accessSync, constants} from 'node:fs'; import {spawnSync} from 'node:child_process'; import path from 'node:path'; // Find a program in the absolute directories of PATH, and run it by that absolute -// path, so no relative PATH entry (such as ".") can pick the program. +// path, so no relative PATH entry (such as ".") can pick the program. As a shell +// does, it passes over anything there by that name that is not a regular file +// it may run (a directory, a plain file without the execute bit). +const runnable = f => { + try { + accessSync(f, constants.X_OK); + return statSync(f).isFile(); + } catch { return false; } +}; export function findProgram(name, env = process.env) { for (const d of (env.PATH || '').split(path.delimiter)) { - if (path.isAbsolute(d) && existsSync(path.join(d, name))) return path.join(d, name); + if (path.isAbsolute(d) && runnable(path.join(d, name))) return path.join(d, name); } throw new Error(`${name} not found in an absolute directory of PATH`); } @@ -43,6 +51,14 @@ function trackedPaths(base) { return new Set(ls.stdout.split('\0').filter(Boolean)); } +// Repository text is UTF-8, decoded strictly: a malformed byte is an error, never +// a silent U+FFFD, so what a generator reads is exactly what is committed. A byte +// order mark is kept as a character, so a check sees it. +const UTF8 = new TextDecoder('utf-8', {fatal: true, ignoreBOM: true}); +const decode = (buf, p) => { + try { return UTF8.decode(buf); } catch { throw new Error(`${p} is not valid UTF-8`); } +}; + export function repoFiles(root) { const base = realpathSync(root); // git is asked once, when a check first needs the answer. @@ -83,7 +99,7 @@ export function repoFiles(root) { // A file or a directory: a ref may name either. exists: p => isFile(p) || isDir(p), bytes, - read: p => bytes(p).toString('utf8'), + read: p => decode(bytes(p), p), // The tracked paths under a directory, in the order git lists them (sorted). under: dir => [...trackedSet()].filter(t => t.startsWith(`${dir}/`)), local: { @@ -98,7 +114,7 @@ export function repoFiles(root) { }, read: p => { if (!localFile(p)) throw new Error(`${p} is not a plain file inside the repository`); - return readFileSync(path.join(base, p), 'utf8'); + return decode(readFileSync(path.join(base, p)), p); }, }, }; diff --git a/scripts/ultraplan/ultraplan.mjs b/scripts/ultraplan/ultraplan.mjs index 4ccd29c8..6d685877 100644 --- a/scripts/ultraplan/ultraplan.mjs +++ b/scripts/ultraplan/ultraplan.mjs @@ -99,11 +99,16 @@ export function wellFormed(v) { // - A control character: a line break among them would let a text start a line // of the page, where AsciiDoc reads block syntax. // - A line or paragraph separator (U+2028, U+2029): a browser breaks the line there. +// - A bidirectional formatting control (U+061C, U+200E, U+200F, U+202A to U+202E, +// U+2066 to U+2069): it reorders what is shown, so text could look other than +// it is. // - A run of two or more spaces, or a space at the start or end: HTML shows a run // of spaces as one, and drops a space at the edge of a cell. const TEXT_FAULTS = [ [/[\u0000-\u001f\u007f-\u009f]/, 'a control character'], [/[\u2028\u2029]/, 'a line or paragraph separator (U+2028 or U+2029)'], + // A bidirectional control reorders the text around it as it is shown. + [/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/, 'a bidirectional formatting control'], [/ {2}/, 'a run of spaces'], [/^ | $/, 'a space at the start or end of a text'], ]; diff --git a/tests/repo/files.test.mjs b/tests/repo/files.test.mjs index c502d75c..bd385313 100644 --- a/tests/repo/files.test.mjs +++ b/tests/repo/files.test.mjs @@ -156,4 +156,28 @@ test('a program is found only in an absolute directory of PATH', () => { // The same directory named relatively is passed over. expect(() => findProgram('prog', {PATH: path.relative(process.cwd(), bin)})).toThrow(/^prog not found in an absolute directory of PATH$/); expect(() => findProgram('prog', {})).toThrow(/not found/); + // As a shell does, it passes over a plain file without the execute bit and a + // directory by that name, and runs the next one that is a program. + const plain = temp('repo-files-plain-'), dir = temp('repo-files-dir-'); + writeFileSync(path.join(plain, 'prog'), 'not a program\n'); + chmodSync(path.join(plain, 'prog'), 0o644); + mkdirSync(path.join(dir, 'prog')); + expect(findProgram('prog', {PATH: [plain, dir, bin].join(path.delimiter)})).toBe(path.join(bin, 'prog')); + expect(() => findProgram('prog', {PATH: [plain, dir].join(path.delimiter)})).toThrow(/not found/); +}); + +// Repository text is decoded strictly: a malformed byte is an error, never a +// silent U+FFFD, and a byte order mark is kept as a character. +test('repository text is valid UTF-8, read exactly', () => { + const root = checkout(); + writeFileSync(path.join(root, 'bad.txt'), Buffer.from([0x61, 0xff, 0x62, 0x0a])); + writeFileSync(path.join(root, 'bom.txt'), Buffer.from([0xef, 0xbb, 0xbf, 0x61, 0x0a])); + writeFileSync(path.join(root, 'ok.txt'), 'caf\u00e9 \u2203\n'); + git(root, 'add', '-A'); + const files = repoFiles(root); + expect(() => files.read('bad.txt')).toThrow(/^bad\.txt is not valid UTF-8$/); + expect(() => files.local.read('bad.txt')).toThrow(/^bad\.txt is not valid UTF-8$/); + expect(files.read('bom.txt')).toBe('\uFEFFa\n'); + expect(files.read('ok.txt')).toBe('caf\u00e9 \u2203\n'); + expect(files.bytes('bad.txt')).toEqual(Buffer.from([0x61, 0xff, 0x62, 0x0a])); }); diff --git a/tests/ultraplan/ultraplan.test.mjs b/tests/ultraplan/ultraplan.test.mjs index 01f99a27..36f2d3e4 100644 --- a/tests/ultraplan/ultraplan.test.mjs +++ b/tests/ultraplan/ultraplan.test.mjs @@ -334,6 +334,11 @@ test('closed schema, blocked reasons and canonical lines', () => { // U+2029, and HTML shows a run of spaces as one and drops a space at a cell's edge. const faulty = (extra, re) => refuses({raw: {nodes: [jcs({...BASE[0], ...extra}), ...BASE.slice(1).map(n => jcs(n))].join('\n') + '\n'}}, re); for (const sep of ['\u2028', '\u2029']) faulty({summary: `one${sep}two`}, /line 1 holds a line or paragraph separator \(U\+2028 or U\+2029\)/); + // A bidirectional control reorders what is shown, so text could look other than it is. + for (const c of ['\u061C', '\u200E', '\u200F', '\u202A', '\u202E', '\u2066', '\u2069']) + faulty({summary: `abc${c}def`}, /line 1 holds a bidirectional formatting control/); + // A malformed byte is refused, never read as U+FFFD. + refuses({raw: {nodes: Buffer.concat([Buffer.from(BASE.map(n => jcs(n)).join('\n').slice(0, 20)), Buffer.from([0xff]), Buffer.from(BASE.map(n => jcs(n)).join('\n').slice(20) + '\n')])}}, /docs\/ultraplan\/tree\.jsonl is not valid UTF-8/); faulty({summary: 'two spaces'}, /line 1 holds a run of spaces; each text in the plan is one line of plain text, shown as written/); faulty({counsel: {maths: 'a wide gap'}}, /line 1 holds a run of spaces/); faulty({refs: [{at: 'a b', path: 'README.adoc'}]}, /line 1 holds a run of spaces/); From 0d20d1a083e8733c6642413e77d13ff5a38c5f2d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Nov 2026 14:27:35 +0000 Subject: [PATCH 41/41] adr-status: the Status word ends at a Unicode word boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex, on 04aecce (probed): the Status section's opening word was matched with \b, which knows only ASCII word characters, so a prose opening such as "Acceptedรฉ", "Acceptedฮฒ" or "Accepted" with a combining accent read as ACCEPTED and could stand as done-node evidence. The word now ends only where no letter, number, combining mark or "_" of any script follows. "Accepted.", "*Accepted*" and "Accepted (ratified)" still read as ACCEPTED. Tests for each; 4 of 4 mutants killed. Pushed with git, unsigned (see d86947c for the labelled departure from the signing ruling). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01J4QvDfdGcZ6qgY7JabLsEi --- docs/decisions/README.adoc | 3 ++- scripts/decisions/adr-status.mjs | 7 ++++++- tests/decisions/adr-status.test.mjs | 11 +++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/decisions/README.adoc b/docs/decisions/README.adoc index 4de219c6..5a7118c6 100644 --- a/docs/decisions/README.adoc +++ b/docs/decisions/README.adoc @@ -55,7 +55,8 @@ counter turns ACCEPTED into ACCEPTEE. * In the Status section, every line that could be a heading titled Status counts, inside a block or not. The section is read only when exactly one does, and that one is a plain section heading (`==` to `======`, then `Status`) whose first -paragraph opens with the word. +paragraph opens with the word, ending where no letter, number or combining mark +of any script follows (so "Acceptedรฉ" is not "Accepted"). Only a record whose header says ACCEPTED, with a Status section that agrees, can stand as evidence in the ultraplan. diff --git a/scripts/decisions/adr-status.mjs b/scripts/decisions/adr-status.mjs index a84b1fbc..77731e89 100644 --- a/scripts/decisions/adr-status.mjs +++ b/scripts/decisions/adr-status.mjs @@ -97,6 +97,11 @@ function startsSection(lines, kinds, i) { return j < 0 || !ATTACHES.test(lines[j]); } const linesOf = text => text.split('\n').map(l => l.trimEnd()); +// The opening word of the Status section: ASCII letters after any "*", ending +// where no letter, number, combining mark or "_" of any script follows, so +// "Acceptedรฉ" or "Accepted" with a combining accent is not the word "Accepted". +// (\b alone knows only ASCII word characters.) +const OPENING_WORD = /^\**([A-Za-z]+)(?![\p{L}\p{N}\p{M}_])/u; export function sectionStatus(text) { const lines = linesOf(text); if (lines.some(l => PREPROCESSOR.test(l))) return null; @@ -109,7 +114,7 @@ export function sectionStatus(text) { // The heading is text, so the line after it is text too, unless it opens a // block, and no delimiter that opens one begins with a letter. const n = lines.findIndex((l, i) => i > h && l !== '' && kinds[i] !== 'comment'); - const word = n > h && !LIST_MARKER.test(lines[n]) ? /^\**([A-Za-z]+)\b/.exec(lines[n]) : null; + const word = n > h && !LIST_MARKER.test(lines[n]) ? OPENING_WORD.exec(lines[n]) : null; return word ? word[1].toUpperCase() : null; } diff --git a/tests/decisions/adr-status.test.mjs b/tests/decisions/adr-status.test.mjs index 2f145762..b42d3ecc 100644 --- a/tests/decisions/adr-status.test.mjs +++ b/tests/decisions/adr-status.test.mjs @@ -116,6 +116,17 @@ test('the Status section opens with a paragraph that says Accepted', () => { expect(sectionAccepted(adr('----\nfoo\n----\n\n=== Status\n\nAccepted'))).toBe(true); }); +// The opening word ends where no letter, number, mark or "_" of any script +// follows: "Acceptedรฉ" is not "Accepted", though \b would say it is. +test('the opening word of the Status section ends at a Unicode word boundary', () => { + const doc = w => `= A\n:status: ACCEPTED\n\n=== Status\n\n${w} by the owner.\n`; + for (const w of ['Accepted\u00e9', 'Accepted\u03b2', 'Accepted\u0301', 'Accepted\u0663', 'Accepted_x', 'Accepted2']) { + expect(sectionStatus(doc(w))).toBe(null); + expect(adrAccepted(doc(w))).toBe(false); + } + for (const w of ['Accepted', '*Accepted*', 'Accepted.', 'Accepted\u2014', 'Accepted (ratified)']) expect(sectionStatus(doc(w))).toBe('ACCEPTED'); +}); + test('the Status section names its opening word, whatever the status', () => { const adr = body => `= ADR\n\n=== Status\n\n${body}\n`; for (const [opening, word] of [['Accepted', 'ACCEPTED'], ['*Proposed. Not yet.*', 'PROPOSED'], ['Superseded by 0007.', 'SUPERSEDED'], ['Deprecated', 'DEPRECATED']])