diff --git a/.github/workflows/public-shop.yml b/.github/workflows/public-shop.yml index 7ca473d3e..0aabb76b1 100644 --- a/.github/workflows/public-shop.yml +++ b/.github/workflows/public-shop.yml @@ -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") diff --git a/docs/site/atlas.mjs b/docs/site/atlas.mjs index be7ad0e15..59a323ae5 100644 --- a/docs/site/atlas.mjs +++ b/docs/site/atlas.mjs @@ -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;}; @@ -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.')); diff --git a/docs/site/cite.html b/docs/site/cite.html index 723f801d3..6e9eee6fa 100644 --- a/docs/site/cite.html +++ b/docs/site/cite.html @@ -7,7 +7,7 @@ - +
UNIVERSAL LAW MATHEMATICS IN THE OPEN
diff --git a/docs/site/current-model.mjs b/docs/site/current-model.mjs index 6b916140d..e053a8ae3 100644 --- a/docs/site/current-model.mjs +++ b/docs/site/current-model.mjs @@ -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.'); diff --git a/docs/site/current.mjs b/docs/site/current.mjs index 2911fb04f..86d1b7b23 100644 --- a/docs/site/current.mjs +++ b/docs/site/current.mjs @@ -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; } diff --git a/docs/site/dependencies.html b/docs/site/dependencies.html index ed9a3b7d4..527a123a9 100644 --- a/docs/site/dependencies.html +++ b/docs/site/dependencies.html @@ -13,8 +13,8 @@ - - + + diff --git a/docs/site/explore.html b/docs/site/explore.html index cef1c2441..38753933a 100644 --- a/docs/site/explore.html +++ b/docs/site/explore.html @@ -13,7 +13,7 @@ - + diff --git a/docs/site/index.html b/docs/site/index.html index 1ef6e3787..35605a5e9 100644 --- a/docs/site/index.html +++ b/docs/site/index.html @@ -7,7 +7,7 @@ - +
UNIVERSAL LAW MATHEMATICS IN THE OPEN
diff --git a/docs/site/measure.html b/docs/site/measure.html index 5d40050ea..3ec7eacec 100644 --- a/docs/site/measure.html +++ b/docs/site/measure.html @@ -13,7 +13,7 @@ - + diff --git a/docs/site/museum.html b/docs/site/museum.html index 30780958a..d5081131a 100644 --- a/docs/site/museum.html +++ b/docs/site/museum.html @@ -12,7 +12,7 @@ - + diff --git a/docs/site/reproduce.html b/docs/site/reproduce.html index 90097d69a..d38b8e25c 100644 --- a/docs/site/reproduce.html +++ b/docs/site/reproduce.html @@ -8,7 +8,7 @@ - +
UNIVERSAL LAW MATHEMATICS IN THE OPEN
diff --git a/docs/site/workspace.html b/docs/site/workspace.html index 4b5b0e0a5..4165f3aa3 100644 --- a/docs/site/workspace.html +++ b/docs/site/workspace.html @@ -10,7 +10,7 @@ - + diff --git a/tests/test_current_site.mjs b/tests/test_current_site.mjs index db248d1d0..916ca0a63 100644 --- a/tests/test_current_site.mjs +++ b/tests/test_current_site.mjs @@ -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}); +}); diff --git a/tools/current_site_browser_check.py b/tools/current_site_browser_check.py index daa0cdc91..a15cce9e6 100644 --- a/tools/current_site_browser_check.py +++ b/tools/current_site_browser_check.py @@ -302,6 +302,130 @@ def respond(route): except Exception:case['error']=traceback.format_exc() finally:context.close() +def exercise_static_reading_destinations(browser,origin,report,data,expect): + """Activate real inspector links with independently served static generations. + + The admitted atlas and material archive use the existing tracked fixture. + Only the mutable static response receives controlled older/newer date and + pin substitutions. These fixtures say nothing about a public cache layer. + """ + from urllib.parse import quote,urlencode + html=(ROOT/'docs/site/dependencies.html').read_text() + section=re.search(r'(]*\bid="current-research"[^>]*>)(.*?)()',html,re.S) + require(section is not None,'Static reading fixture has no generated current section') + hrefs=re.findall(r'\bhref="([^"]*)"',section.group(2)) + archives={match.group(1) for href in hrefs if (match:=re.fullmatch(r'snapshots/([0-9a-f]{64})/nodes/index\.html',href))} + require(len(archives)==1,'Static reading fixture has no unique advertised material archive') + archive=next(iter(archives));material_root=ROOT/'docs/site/snapshots'/archive + material_raw=(material_root/'current.json').read_bytes();material=json.loads(material_raw) + node='math.uniform-matrix-cap-lifetime';encoded=quote(node,safe='') + require(node in data['graph']['data']['nodes'] and node in material['graph']['data']['nodes'],'Selected static fixture node is missing') + edge=next(e for e in data['graph']['data']['edges'] if e['from']==node) + current_path='nodes/'+encoded+'.html';preserved_path='snapshots/'+archive+'/nodes/'+encoded+'.html' + current_body=(ROOT/'docs/site'/current_path).read_text() + preserved_body=(ROOT/'docs/site'/preserved_path).read_bytes() + def identity(snapshot): + return {'observed_at':snapshot['observed_at'],'pins':{r['repository']:r['commit'] for r in snapshot['repositories']}} + atlas_identity=identity(data);material_identity=identity(material) + def static_reading(page): + # Read the actual visible source fields, not the synthetic response plan. + header=page.locator('#current-research');time_node=header.locator('.current-state time') + expect(time_node).to_be_visible();pins={};pin_links={} + for repository in ['d6g8k5htny-coder/main','d6g8k5htny-coder/Math-']: + link=header.locator('a[href^="https://github.com/'+repository+'/tree/"]') + expect(link).to_have_count(1);expect(link).to_be_visible() + pins[repository]=link.locator('code').inner_text();pin_links[repository]=link.get_attribute('href') + require(pin_links[repository]=='https://github.com/'+repository+'/tree/'+pins[repository],'Visible static pin disagrees with its source URL') + return {'url':page.url,'node':page.locator('main > h1').inner_text(),'observed_at':time_node.inner_text(),'datetime':time_node.get_attribute('datetime'),'pins':pins,'pin_links':pin_links,'script_count':page.locator('script').count(),'content_security_policy':page.locator('meta[http-equiv="Content-Security-Policy"]').get_attribute('content')} + def check_reading(reading,want,path,selected_node=node): + require(reading['url']==origin+path,'Activated static destination changed its route') + require(reading['node']==selected_node,'Activated static destination changed the selected node') + require(reading['observed_at']==want['observed_at'] and reading['datetime']==want['observed_at'],'Activated static destination changed its visible capture date') + require(reading['pins']==want['pins'],'Activated static destination changed its visible repository pins') + require(reading['script_count']==0 and "script-src 'none'" in reading['content_security_policy'],'Static reading destination is not script-free') + def announced(page): + expect(page.locator('#atlas-inspector h3')).to_have_text(node) + preserved=page.locator('#atlas-inspector').get_by_role('link',name='Read the preserved mathematical record',exact=True) + current=page.locator('#atlas-inspector').get_by_role('link',name='Read the static node record',exact=True) + expect(preserved).to_be_visible();expect(current).to_be_visible() + expect(preserved.locator('..')).to_contain_text('Opens the preserved mathematical record with its original source revisions and capture date.') + expect(current.locator('..')).to_contain_text('The capture date and source revisions on that page may differ from this view.') + require(preserved.get_attribute('href')==preserved_path and current.get_attribute('href')==current_path,'Inspector reading routes do not match the advertised archive and selected node') + return {'url':page.url,'node':node,**atlas_identity,'preserved_href':preserved.get_attribute('href'),'current_href':current.get_attribute('href'),'preserved_explanation':preserved.locator('..').inner_text(),'current_explanation':current.locator('..').inner_text()} + atlas_url=origin+'dependencies.html?'+urlencode({'atlas-node':node,'atlas-view':'list','atlas-panel':'evidence'}) + for generation,date,main_pin,math_pin in [('older','2000-01-01T00:00:00Z','1'*40,'2'*40),('newer','2099-01-01T00:00:00Z','3'*40,'4'*40)]: + wanted={'observed_at':date,'pins':{'d6g8k5htny-coder/main':main_pin,'d6g8k5htny-coder/Math-':math_pin}} + def current_generation(source): + body=source.replace(data['observed_at'],date) + for repository,pin in wanted['pins'].items():body=body.replace(atlas_identity['pins'][repository],pin) + return body + body=current_generation(current_body) + case={'case':'static-reading-material-and-current-mixed-generations','current_static_generation':generation,'passed':False,'page_errors':[], + 'scope':'Controlled local fixture with actual inspector-link activation; historical tracked fixture is not live project Source; no public cache or AT inference', + 'advertised_material_archive':archive,'atlas_identity':atlas_identity,'material_identity':material_identity,'current_static_identity':wanted, + 'fixture_bodies':{'atlas_html':{'bytes':len(html.encode()),'sha256':sha256(html.encode()).hexdigest()},'material_payload':{'bytes':len(material_raw),'sha256':sha256(material_raw).hexdigest()},'material_node':{'bytes':len(preserved_body),'sha256':sha256(preserved_body).hexdigest()},'current_node':{'bytes':len(body.encode()),'sha256':sha256(body.encode()).hexdigest()}},'requests':[]} + report['cases'].append(case);context=browser.new_context(viewport={'width':1200,'height':900},reduced_motion='reduce');page=context.new_page();page.set_default_timeout(15000);page.on('pageerror',lambda e:case['page_errors'].append(str(e))) + def serve_atlas(route): + case['requests'].append(route.request.url);route.fulfill(status=200,content_type='text/html',body=html) + def serve_material(route): + case['requests'].append(route.request.url);route.fulfill(status=200,content_type='text/html',body=preserved_body) + def serve_current(route): + case['requests'].append(route.request.url) + paths={origin+'nodes/'+quote(key,safe='')+'.html':ROOT/'docs/site/nodes'/(quote(key,safe='')+'.html') for key in data['graph']['data']['nodes']} + source=paths.get(route.request.url) + if source is None:route.continue_();return + response=current_generation(source.read_text()) + case.setdefault('served_current_nodes',[]).append({'url':route.request.url,'bytes':len(response.encode()),'sha256':sha256(response.encode()).hexdigest()}) + route.fulfill(status=200,content_type='text/html',body=response) + try: + require((date< data['observed_at']) if generation=='older' else (date>data['observed_at']),'Mixed-generation fixture is not older/newer than the admitted atlas') + require(wanted['pins']!=atlas_identity['pins'],'Mixed-generation static fixture did not change repository pins') + page.route(origin+'dependencies.html*',serve_atlas);page.route(origin+preserved_path,serve_material);page.route(origin+'nodes/*.html',serve_current) + page.goto(atlas_url);case['before_preserved_activation']=announced(page) + preserved=page.locator('#atlas-inspector').get_by_role('link',name='Read the preserved mathematical record',exact=True) + preserved.focus();page.keyboard.press('Enter');expect(page.locator('main > h1')).to_have_text(node) + case['preserved_destination']=static_reading(page);check_reading(case['preserved_destination'],material_identity,preserved_path) + neighbor=edge['to'];neighbor_name=quote(neighbor,safe='')+'.html' + page.locator('main a[href="'+neighbor_name+'"]').first.click();expect(page.locator('main > h1')).to_have_text(neighbor) + case['preserved_neighbor']=static_reading(page);check_reading(case['preserved_neighbor'],material_identity,'snapshots/'+archive+'/nodes/'+neighbor_name,neighbor) + page.goto(atlas_url);case['before_current_activation']=announced(page) + page.locator('#atlas-inspector').get_by_role('link',name='Read the static node record',exact=True).click();expect(page.locator('main > h1')).to_have_text(node) + case['current_destination']=static_reading(page);check_reading(case['current_destination'],wanted,current_path) + # Retain the existing generated relative-neighbor behavior at the + # actual activated alias, without replacing the destination by goto. + neighbor=edge['to'];page.locator('main a[href="'+quote(neighbor,safe='')+'.html"]').first.click() + expect(page.locator('main > h1')).to_have_text(neighbor) + case['static_neighbor']=static_reading(page);check_reading(case['static_neighbor'],wanted,'nodes/'+quote(neighbor,safe='')+'.html',neighbor) + require(not case['page_errors'],'Mixed-generation reading emitted page errors');case['passed']=True + except Exception:case['error']=traceback.format_exc() + finally:context.close() + for pointer_state in ['missing','ambiguous']: + contents=section.group(2) + if pointer_state=='missing': + for href in hrefs: + if re.fullmatch(r'snapshots/[0-9a-f]{64}/nodes/index\.html',href):contents=contents.replace('href="'+href+'"','href="#unavailable-fixture"') + else: + other='b'*64 if archive!='b'*64 else 'c'*64 + contents+='Controlled second material pointer' + unavailable_html=html[:section.start(2)]+contents+html[section.end(2):] + case={'case':'static-reading-preserved-unavailable','pointer_state':pointer_state,'passed':False,'page_errors':[], + 'scope':'Controlled generated-page pointer fixture; no inferred archive replacement','fixture_html_sha256':sha256(unavailable_html.encode()).hexdigest()} + report['cases'].append(case);context=browser.new_context(viewport={'width':1200,'height':900},reduced_motion='reduce');page=context.new_page();page.set_default_timeout(15000);page.on('pageerror',lambda e:case['page_errors'].append(str(e))) + try: + page.route(origin+'dependencies.html*',lambda route:route.fulfill(status=200,content_type='text/html',body=unavailable_html));page.goto(atlas_url) + expect(page.locator('#atlas-inspector h3')).to_have_text(node) + expect(page.locator('#atlas-inspector').get_by_role('link',name='Read the preserved mathematical record',exact=True)).to_have_count(0) + expect(page.locator('#atlas-inspector')).to_contain_text('Preserved mathematical record unavailable from this observation.') + current=page.locator('#atlas-inspector').get_by_role('link',name='Read the static node record',exact=True) + expect(current).to_be_visible();expect(current.locator('..')).to_contain_text('The capture date and source revisions on that page may differ from this view.') + require(current.get_attribute('href')==current_path,'Unavailable archive changed the current static destination') + case['before_activation']={'url':page.url,'node':node,'current_href':current.get_attribute('href'),'explanation':current.locator('..').inner_text()} + current.focus();page.keyboard.press('Enter');expect(page.locator('main > h1')).to_have_text(node) + case['current_destination']=static_reading(page);check_reading(case['current_destination'],atlas_identity,current_path) + require(not case['page_errors'],'Unavailable-preserved reading emitted page errors');case['passed']=True + except Exception:case['error']=traceback.format_exc() + finally:context.close() + def main(): parser=argparse.ArgumentParser(description=__doc__);parser.add_argument('--output',type=Path,required=True);args=parser.parse_args();args.output.mkdir(parents=True,exist_ok=True) report={'scientific_effect':'NONE','checked_commit':None,'source_payload_sha256':None,'source_repositories':[],'cases':[],'limitations':['Local rendered Chromium evidence; physical mobile and complete screen-reader certification not established.']} @@ -315,6 +439,7 @@ def main(): exercise_atlas_shell(browser,origin,args.output,report,data,expect) exercise_hosted_amendments(browser,origin,args.output,report,data,expect) exercise_resume_parity(browser,origin,report,data,expect) + exercise_static_reading_destinations(browser,origin,report,data,expect) for width in [1200,320]: for scheme in ['light','dark']: case={'width':width,'color_scheme':scheme,'passed':False};report['cases'].append(case)