Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/public-shop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
MAX_CONTEXT = 16384
CHUNK = 3072
DEADLINE_SECONDS = 20
EXPECTED_CASES = 35
EXPECTED_CASES = 39
HEX40 = re.compile(r"[0-9a-f]{40}\Z")
HEX64 = re.compile(r"[0-9a-f]{64}\Z")

Expand Down
11 changes: 8 additions & 3 deletions docs/site/atlas.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {currentSnapshot,element,anchor} from './current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2';
import {hasNode,readState,neighborhood,searchGraph,downstreamReach,requiredDependencyPaths,REQUIRED_ROUTE_SEMANTICS,evidenceAxes,sourceURL,sourceForNode,nodePage,resumeProjection,RESUME_NOT_RECORDED,resumeFieldHref} from './current-model.mjs?site-release=c74b06de2c8a80615e70df68d7a5eb122731d3a9030311f275503fd9a0f4bdf7';
import {currentSnapshot,element,anchor} from './current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142';
import {hasNode,readState,neighborhood,searchGraph,downstreamReach,requiredDependencyPaths,REQUIRED_ROUTE_SEMANTICS,evidenceAxes,sourceURL,sourceForNode,staticNodeLinks,resumeProjection,RESUME_NOT_RECORDED,resumeFieldHref} from './current-model.mjs?site-release=a30d68465e3acda48eedce64854afebc7af5c84903a4e6b0c649e08007b08999';
import {createAtlasShell,viewForViewport} from './atlas-shell.mjs?site-release=9fce5f707e3486ef152ffdaa1cf1e4adf7cd9cf9dac116407a69b6528b4c656c';
const byId=id=>document.getElementById(id);
const svgElement=(tag,attrs)=>{const n=document.createElementNS('http://www.w3.org/2000/svg',tag);for(const [k,v]of Object.entries(attrs))n.setAttribute(k,String(v));return n;};
Expand Down Expand Up @@ -39,7 +39,12 @@ async function start() {
const r=reach(selected),reachText=`Downstream nodes · all edges: ${r.allEdge}. Downstream nodes · required edges: ${r.requiredOnly}.`;
const reachPanel=element('p',reachText);reachPanel.id='atlas-reach';panel.append(reachPanel,element('p',`Complete indexed snapshot query at ${data.graph.identity.commit}. Each count excludes the selected node and counts distinct downstream nodes. All edges includes context; required edges uses required edges at every step. These counts do not identify blocked theorems or prove completeness.`));byId('atlas-diagnostic-selection').textContent=`Selected ${selected}: ${reachText} No scientific disposition is inferred.`;
panel.append(element('p',n.scope||n.notes||'Statement and scope extraction not recorded. Inspect the source reference.'));
panel.append(anchor('Read this node without JavaScript',nodePage(selected)));
const readingLinks=staticNodeLinks(selected,[...(byId('current-research')?.querySelectorAll('a[href]')||[])].map(link=>link.getAttribute('href')),location.href);
const preservedReading=element('p');
if(readingLinks.preserved)preservedReading.append(anchor('Read the preserved mathematical record',readingLinks.preserved),' — Opens the preserved mathematical record with its original source revisions and capture date.');
else preservedReading.textContent='Preserved mathematical record unavailable from this observation.';
panel.append(preservedReading);
if(readingLinks.current){const currentReading=element('p');currentReading.append(anchor('Read the static node record',readingLinks.current),' — The capture date and source revisions on that page may differ from this view.');panel.append(currentReading);}
panel.append(resumeSection(resumeProjection(data,selected,Date.now(),nodeStatus)));
const dl=element('dl',undefined,'atlas-axes');for(const a of evidenceAxes(n)){dl.append(element('dt',a.axis),element('dd',`${a.axis[0].toUpperCase()+a.axis.slice(1)} metadata ${a.state==='recorded'?'recorded':'not recorded'} · ${a.state}`));}panel.append(dl,element('p','These labels describe metadata in this graph snapshot. Evidence values, applicability and custody are separate. No explicit graph-to-artifact binding · Artifact roles: unknown · Custody: unknown.'));
const source=sourceForNode(data,n);if(source){panel.append(anchor('Immutable source reference (document bytes not acquired by this graph view)',sourceURL(source)));panel.append(element('p',`Git blob ${source.blob} · ${source.bytes} bytes in the pinned tree. Reference presence is not mathematical verification.`));}else panel.append(element('p',n.source?`Unresolved source reference: ${n.source}. No matched public file in this pinned source inventory.`:'Source reference not recorded.'));
Expand Down
2 changes: 1 addition & 1 deletion docs/site/cite.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="style.css?site-release=6eb56e5c80ebf5811a77d0cb8583bf77dd8be44f170bebc9ae10721b2e6e9ab1"><link rel="stylesheet" href="brand.css?site-release=3e01852d8990ec3e9bbb351abc10e1a60e9e085041b7a7b1de95a1033089b751"><link rel="stylesheet" href="home.css?site-release=3745da1d9ea12f78ef0e350eb982d603d5e476db0b4cbf36746104a13fbf663e"><link rel="stylesheet" href="reference.css?site-release=f8709329ef33be5c92a2a53d27e906f2433836bc0a78324bfb8a15ecd2ffee48"><link rel="icon" type="image/svg+xml" href="brand/mark.svg?site-release=ef97bd43ea3d8999dbf26e5707d467987a745bf961cac2b3163f94062d087ba7"><meta name="color-scheme" content="dark light"><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f6f8fc"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#07111f">
<script type="module" src="cite.mjs?site-release=d069bacebd8467fb69c0ae1de0abb85e6ac8b9b80ba152fc1c8d56fafa10e9bf"></script>
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
</head><body class="reader-home"><a class="skip-link" href="#main-content">Skip to content</a>
<header><a class="brand" href="index.html">UNIVERSAL LAW <span>MATHEMATICS IN THE OPEN</span></a><nav aria-label="Primary"><a href="index.html">Home</a><a href="explore.html">Explore</a><a href="research.html">Research</a><a href="workspace.html#inventory">Library</a><a href="dependencies.html#current-atlas">Mathematics</a></nav></header>
<nav class="reader-tools" aria-label="Research tools"><span class="reader-tools-label" aria-hidden="true">Research tools</span><a href="reproduce.html">Reproduce</a><a href="cite.html" aria-current="page">Cite</a></nav>
Expand Down
23 changes: 23 additions & 0 deletions docs/site/current-model.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ export function sourceForNode(snapshot,node) {
return snapshot.sources.find(s=>s.repository===snapshot.graph.identity.repository && s.path===node?.source) || null;
}
export function nodePage(id) { return typeof id==='string' && id ? `nodes/${encodeURIComponent(id)}.html` : null; }
// A generated page advertises material history; this projection constrains its
// address, not the archive's independent authenticity or association to the graph.
// The caller supplies a selected own key from the admitted graph.
export function staticNodeLinks(id,hrefs,pageURL) {
let current;try{current=nodePage(id);}catch{return {current:null,preserved:null};}
const result={current,preserved:null};
if(!current||!Array.isArray(hrefs)||typeof pageURL!=='string')return result;
let base;
try{const page=new URL(pageURL);if(!['http:','https:'].includes(page.protocol)||page.username||page.password)return result;base=new URL('.',page);}
catch{return result;}
const archives=new Set();
for(const href of hrefs){
// Empty query/fragment markers also refuse. Do not let URL normalization
// turn a malformed, encoded or traversing address into a canonical witness.
if(typeof href!=='string'||!href||/[?#\\%\u0000-\u0020\u007f]/.test(href)||/(?:^|\/)\.\.?(?:\/|$)/.test(href))continue;
let url;try{url=new URL(href,base);}catch{continue;}
if(url.origin!==base.origin||url.username||url.password||!url.pathname.startsWith(base.pathname))continue;
const match=/^snapshots\/([0-9a-f]{64})\/nodes\/index\.html$/.exec(url.pathname.slice(base.pathname.length));
if(match)archives.add(match[1]);
}
if(archives.size===1)result.preserved=`snapshots/${[...archives][0]}/${current}`;
return result;
}
export function validateSnapshot(data) {
if(data?.schema_version!==1||data.scientific_effect!=='NONE'||!/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ$/.test(data.observed_at)||!Number.isFinite(Date.parse(data.observed_at))) throw Error('Invalid current source snapshot.');
if(!Array.isArray(data.repositories)||data.repositories.length!==2) throw Error('Invalid repository inventory.');
Expand Down
2 changes: 1 addition & 1 deletion docs/site/current.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {fetchVerifiedSnapshot,freshness,filterSources,sourceURL,projectCurrentAcquisitions,ACQUISITION_LABELS,ACQUISITION_UNAVAILABLE} from './current-model.mjs?site-release=c74b06de2c8a80615e70df68d7a5eb122731d3a9030311f275503fd9a0f4bdf7';
import {fetchVerifiedSnapshot,freshness,filterSources,sourceURL,projectCurrentAcquisitions,ACQUISITION_LABELS,ACQUISITION_UNAVAILABLE} from './current-model.mjs?site-release=a30d68465e3acda48eedce64854afebc7af5c84903a4e6b0c649e08007b08999';
export function element(tag,text,className) {
const e=document.createElement(tag);if(text!==undefined)e.textContent=text;if(className)e.className=className;return e;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/site/dependencies.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<link rel="icon" type="image/svg+xml" href="brand/mark.svg?site-release=ef97bd43ea3d8999dbf26e5707d467987a745bf961cac2b3163f94062d087ba7">
<script type="module" src="dependencies.mjs?site-release=d82de31c97db5296160a3c715627c118eefa1057b34452f1678f1acf331e0e79"></script>
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="atlas.mjs?site-release=7cdce8ca9e02082c55df0e9d5c7887c557787833ae1e6184f57374b051470508"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
<script type="module" src="atlas.mjs?site-release=91a527cfab5036f7f9b9e73efe8ea2d803bb0330f94169888772c330a2f1a43a"></script>
</head>
<body class="dependency-page">
<a class="skip-link" href="#main-content">Skip to content</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="icon" type="image/svg+xml" href="brand/mark.svg?site-release=ef97bd43ea3d8999dbf26e5707d467987a745bf961cac2b3163f94062d087ba7">
<script type="module" src="explore.mjs?site-release=346eff1bf7568d672c36b0312a83a46fd5ffc562a4f78b9420cbdf6a8aec016b"></script>
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<link rel="stylesheet" href="style.css?site-release=6eb56e5c80ebf5811a77d0cb8583bf77dd8be44f170bebc9ae10721b2e6e9ab1"><link rel="stylesheet" href="brand.css?site-release=3e01852d8990ec3e9bbb351abc10e1a60e9e085041b7a7b1de95a1033089b751"><link rel="stylesheet" href="home.css?site-release=3745da1d9ea12f78ef0e350eb982d603d5e476db0b4cbf36746104a13fbf663e">
<link rel="icon" type="image/svg+xml" href="brand/mark.svg?site-release=ef97bd43ea3d8999dbf26e5707d467987a745bf961cac2b3163f94062d087ba7"><meta name="color-scheme" content="dark light"><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f6f8fc"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#07111f"><script type="module" src="home.mjs?site-release=8814c4ac7fe50a5950641070d19f858f8424f470bd316e952c94d9c75d493af7"></script>
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
</head><body class="reader-home">
<a class="skip-link" href="#main-content">Skip to content</a>
<header><a class="brand" href="index.html">UNIVERSAL LAW <span>MATHEMATICS IN THE OPEN</span></a><nav aria-label="Primary"><a href="index.html" aria-current="page">Home</a><a href="explore.html">Explore</a><a href="research.html">Research</a><a href="workspace.html#inventory">Library</a><a href="dependencies.html#current-atlas">Mathematics</a></nav></header>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/measure.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel="icon" type="image/svg+xml" href="brand/mark.svg?site-release=ef97bd43ea3d8999dbf26e5707d467987a745bf961cac2b3163f94062d087ba7">
<script type="module" src="measure.mjs?site-release=587b8a8ca2ebb5f73c3acddfe352e49ef20ba3c7ae7c521b0f876e1616f4f81b"></script>
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/museum.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<link rel="icon" type="image/svg+xml" href="brand/mark.svg?site-release=ef97bd43ea3d8999dbf26e5707d467987a745bf961cac2b3163f94062d087ba7">
<meta name="color-scheme" content="dark light"><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f6f8fc"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#07111f">
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/reproduce.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<script type="module" src="reproduce-copy.mjs?site-release=d13c59017e24387b1926f37c27f33a9ce9e79e7e8fc46664080112fddfae9361"></script>
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
</head><body class="reader-home"><a class="skip-link" href="#main-content">Skip to content</a>
<header><a class="brand" href="index.html">UNIVERSAL LAW <span>MATHEMATICS IN THE OPEN</span></a><nav aria-label="Primary"><a href="index.html">Home</a><a href="explore.html">Explore</a><a href="research.html">Research</a><a href="workspace.html#inventory">Library</a><a href="dependencies.html#current-atlas">Mathematics</a></nav></header>
<nav class="reader-tools" aria-label="Research tools"><span class="reader-tools-label" aria-hidden="true">Research tools</span><a href="reproduce.html" aria-current="page">Reproduce</a><a href="cite.html">Cite</a></nav>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/workspace.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<link rel="icon" type="image/svg+xml" href="brand/mark.svg?site-release=ef97bd43ea3d8999dbf26e5707d467987a745bf961cac2b3163f94062d087ba7">
<meta name="color-scheme" content="dark light"><meta name="theme-color" media="(prefers-color-scheme: light)" content="#f6f8fc"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#07111f">
<link rel="stylesheet" href="current.css?site-release=9b70fee7f54345912905f33f4d15af39748b09c456bd88527b534cc9ceaae207">
<script type="module" src="current.mjs?site-release=9d297c66edf81157e25abdfc83bc49a0ddc5b9b1c1953233d0c95a7a54adb7a2"></script>
<script type="module" src="current.mjs?site-release=fc7e8a98c1e23f476962c4c83e95ed3ce817490007987112d9b2cf6d3d90b142"></script>
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
Expand Down
51 changes: 51 additions & 0 deletions tests/test_current_site.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,54 @@ test('node identifiers and recorded source paths require own literal string fiel
assert.equal(m.sourceForNode(f,{source:['proof/PROOF.md']}),null);
assert.equal(m.nodePage({toString:()=> 'a'}),null);
});

// Contract breaks caught here: losing the advertised immutable destination,
// treating ordinary source anchors as ambiguity, or letting untrusted URL parts
// choose a path outside the current page's site directory.
test('static reading links retain one advertised material archive among source links',()=>{
const page='https://example.test/main/site/dependencies.html';
const node='math.lifetime-remainder', archive='a'.repeat(64);
const href=`snapshots/${archive}/nodes/index.html`;
const links=Object.freeze(['https://github.com/example/research/blob/main/PROOF.md',href,href,'nodes/index.html','#current-research']);
assert.equal(typeof m.staticNodeLinks,'function');
assert.deepEqual(m.staticNodeLinks(node,links,page),{
current:'nodes/math.lifetime-remainder.html',
preserved:`snapshots/${archive}/nodes/math.lifetime-remainder.html`
});
assert.deepEqual([...links],['https://github.com/example/research/blob/main/PROOF.md',href,href,'nodes/index.html','#current-research']);
for(const advertised of [href,`/main/site/${href}`,`https://example.test/main/site/${href}`]){
assert.deepEqual(m.staticNodeLinks('math.node /?#é',[advertised],page),{
current:'nodes/math.node%20%2F%3F%23%C3%A9.html',
preserved:`snapshots/${archive}/nodes/math.node%20%2F%3F%23%C3%A9.html`
});
}
// A sole well-formed generated pointer is trusted by producer/history admission;
// this URL projection makes no independent archive-association claim.
assert.equal(m.staticNodeLinks(node,[`snapshots/${'b'.repeat(64)}/nodes/index.html`],page).preserved,`snapshots/${'b'.repeat(64)}/nodes/math.lifetime-remainder.html`);
});
test('static reading links refuse missing ambiguous and unsafe archive addresses',()=>{
const page='https://example.test/main/site/dependencies.html', node='math.lifetime-remainder';
const archive='a'.repeat(64), href=`snapshots/${archive}/nodes/index.html`;
assert.equal(typeof m.staticNodeLinks,'function');
const unsafe=[
[],['https://github.com/example/research/blob/main/PROOF.md'],
[href,`snapshots/${'b'.repeat(64)}/nodes/index.html`],
[`snapshots/${'b'.repeat(64)}/nodes/index.html`,href],
[`https://elsewhere.test/main/site/${href}`],
[`https://user:pass@example.test/main/site/${href}`],
[`https://example.test:444/main/site/${href}`],
[`https://example.test/elsewhere/site/${href}`],
[`/main/site-other/${href}`],
[`${href}?`],[`${href}?capture=wrong`],[`${href}#`],[`${href}#wrong`],
[`snapshots/${archive.toUpperCase()}/nodes/index.html`],
[`snapshots/${archive.slice(1)}/nodes/index.html`],
[`snapshots/${archive}/nodes/not-index.html`],
[`snapshots/${archive}/nodes/index.html/extra`],
[`snapshots/%61${archive.slice(1)}/nodes/index.html`],
[null,undefined,42,{},true],
];
for(const hrefs of unsafe)assert.deepEqual(m.staticNodeLinks(node,hrefs,page),{current:'nodes/math.lifetime-remainder.html',preserved:null},JSON.stringify(hrefs));
for(const invalid of [null,undefined,'',42,{},true])assert.deepEqual(m.staticNodeLinks(invalid,[href],page),{current:null,preserved:null});
for(const badPage of ['not a URL','javascript:alert(1)',`https://user:pass@example.test/main/site/dependencies.html`])assert.deepEqual(m.staticNodeLinks(node,[href],badPage),{current:'nodes/math.lifetime-remainder.html',preserved:null});
assert.deepEqual(m.staticNodeLinks(node,null,page),{current:'nodes/math.lifetime-remainder.html',preserved:null});
});
Loading
Loading