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
30 changes: 30 additions & 0 deletions .github/workflows/public-shop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,33 @@ jobs:
node --test tests/test_museum_geometry.mjs
- name: Pinned public source readback and interaction harness
run: python3 -B tools/public_shop_check.py
browser-smoke:
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Record setup identity
run: |
mkdir -p browser-evidence
git rev-parse HEAD > browser-evidence/commit.txt
echo 'Setup record only; report.json establishes whether a browser ran.' > browser-evidence/setup.txt
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: '3.12'
- name: Install pinned optional browser tooling
run: |
python -m pip install -r tests/browser-requirements.txt
- name: Check Library in headless Chromium
env:
BROWSER_PR_HEAD: ${{ github.event.pull_request.head.sha }}
run: python -B tools/public_shop_browser_check.py --output browser-evidence
- name: Preserve browser results including failures
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: public-shop-browser-${{ github.run_id }}
path: browser-evidence
if-no-files-found: error
retention-days: 30
39 changes: 39 additions & 0 deletions docs/site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,45 @@ python3 -B -S -m unittest discover -s tests -p test_reader_links.py -v

Check real desktop/mobile layouts, keyboard operation, light/dark appearance and source-unavailable behavior separately. The pure-model tests are not browser or scientific verification.

## Keep or share a Library search

The Library's search, repository and path filters are saved in the current URL
without adding a browser-history entry for every keystroke. Refreshing or
returning with Back/Forward restores the filters. **Link to this search** gives a
bookmarkable link directly to the catalog; **Clear filters** restores its initial
50-row view. Filtering never changes source identities or recorded review scope.

Search links use `q`, `repository` (`main` or `Math-`) and `path`. Empty values are
omitted; the first repeated value is used, and an unknown repository is treated
as all repositories. Unrelated parameters and section bookmarks are preserved in
the current address but omitted from the explicit search link. Filters are visible
in URLs and browser history. Links use the catalog’s pinned source records, not a
live proof index; the search URL does not freeze future catalog updates. If history updates are unavailable, filtering and the explicit
link still work; if source verification fails, controls stay unavailable.

## Browser evidence in CI

The existing `public-shop` workflow also runs a separate read-only `browser-smoke`
job. Its optional [pinned Playwright dependencies](../../tests/browser-requirements.txt)
use the [official Python package](https://pypi.org/project/playwright/1.62.0/)
with the Ubuntu 24.04 runner’s packaged stable Chrome and its enabled sandbox.
The browser version/executable hash and runner-image identity are recorded; the
browser is runner-bound rather than a fixed Playwright download. The runner serves
only `docs` on an ephemeral
loopback port. It does not publish a preview or use account credentials.

The `public-shop-browser-<run-id>` artifact contains a JSON report and screenshots
for 1200×900 and 390×844 in light and dark mode, plus an explicitly refused
inventory request. It tests URL round-trips, actual Back/Forward navigation,
keyboard reset/focus and document overflow against the real app and pinned public
sources. The report binds the actual tested checkout separately from the PR head.
A setup artifact without a successful report is not a completed browser run.

Inspect the screenshots before accepting visual quality. This is headless Chromium
with mobile-sized viewports, not physical touch-device, all-browser, full
accessibility or deployed-Pages certification. The original source validation and
required hosted checks remain separate and unchanged.

## Run locally

From the repository root:
Expand Down
8 changes: 6 additions & 2 deletions docs/site/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {verifiedJSON, verifiedBytes, validateStatus, validateCoefficient, safeSourceURL, hex40, hex64} from './core.mjs';
import {connectCatalogQuery} from './catalog-query.mjs';
import {prepareWorkspaceFragment} from './workspace-fragment.mjs';
const finishFragment=prepareWorkspaceFragment();
const el=id=>document.getElementById(id);
Expand Down Expand Up @@ -85,9 +86,12 @@ async function inventory(config) {
const render=()=>{const query=el('search').value.trim().toLowerCase(),repository=el('repository-filter').value,path=el('path-filter').value.trim().toLowerCase();
const matches=rows.filter(row=>(!repository||row.repository===repository)&&row.path.toLowerCase().includes(path)&&[row.repository,row.path,row.commit,row.sha256].some(s=>s.toLowerCase().includes(query)));el('catalog').replaceChildren();
matches.slice(0,limit).forEach(row=>{const tr=node('tr'),name=node('td'),commit=node('td'),hash=node('td');name.append(node('small',row.repository),link(row.path,safeSourceURL(row)));commit.append(node('code',row.commit));hash.append(node('code',row.sha256));tr.append(name,commit,hash);el('catalog').append(tr);});
el('inventory-state').textContent=`${matches.length.toLocaleString()} matches · ${Math.min(limit,matches.length)} shown · all 2,138 source records loaded from the original hash-verified shards.`;el('more').hidden=matches.length<=limit;};
el('inventory-state').textContent=`${matches.length.toLocaleString()} matches · ${Math.min(limit,matches.length)} shown · all 2,138 source records loaded from the original hash-verified shards.`;if(!matches.length)el('inventory-state').append(' Try a broader search or clear filters.');el('more').hidden=matches.length<=limit;};
const syncQuery=connectCatalogQuery(typeof window==='undefined'?null:window,{search:el('search'),repository:el('repository-filter'),path:el('path-filter'),link:el('catalog-link'),note:el('catalog-query-note')},()=>{limit=50;render();});
el('catalog-clear').disabled=false;
el('catalog-clear').addEventListener('click',()=>{for(const id of ['search','repository-filter','path-filter'])el(id).value='';limit=50;render();syncQuery();el('search').focus();});
for(const [id,event] of [['search','input'],['repository-filter','change'],['path-filter','input']]) {
el(id).disabled=false;el(id).addEventListener(event,()=>{limit=50;render();});
el(id).disabled=false;el(id).addEventListener(event,()=>{limit=50;render();syncQuery();});
}
el('more').addEventListener('click',()=>{limit+=50;render();});render();
}
Expand Down
41 changes: 41 additions & 0 deletions docs/site/catalog-query.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// URL state is a reader convenience, never a source or scientific-status input.
// URLSearchParams.get deliberately uses the first occurrence of each filter.
export function readCatalogQuery(search) {
const params=new URLSearchParams(search);
const repository=params.get('repository');
return {query:(params.get('q')||'').trim(),repository:['main','Math-'].includes(repository)?repository:'',path:(params.get('path')||'').trim()};
}
export function catalogQueryURL(href,filters,share=false) {
const url=new URL(href);
if(share){url.search='';url.hash='inventory';}
for(const [key,value] of [['q',filters.query],['repository',filters.repository],['path',filters.path]]) {
if(value.trim())url.searchParams.set(key,value.trim());else url.searchParams.delete(key);
}
return url;
}
export function connectCatalogQuery(win,controls,onRestore) {
const current=()=>{try{return new URL(win.location.href);}catch{return null;}};
const values=()=>({query:controls.search.value,repository:controls.repository.value,path:controls.path.value});
const note='Filters appear in the address, shared links, and browser history. Search links use the catalog’s pinned source records, not a live research index.';
const link=()=>{
const url=current();if(!url)return;
controls.link.href=catalogQueryURL(url,values(),true).href;
controls.link.setAttribute('aria-disabled','false');
controls.note.textContent=note;
};
const restore=()=>{
const url=current();if(!url)return;
const filters=readCatalogQuery(url.search);
controls.search.value=filters.query;controls.repository.value=filters.repository;controls.path.value=filters.path;
link();
};
// Read at verified-catalog readiness so newer navigation wins over startup.
restore();
if(current())win.addEventListener('popstate',()=>{restore();onRestore();});
return ()=>{
link();const url=current();if(!url)return;
const next=catalogQueryURL(url,values());if(next.href===url.href)return;
try {win.history.replaceState(win.history.state,'',next.href);}
catch {controls.note.textContent='The address could not be updated. Use Link to this search to preserve these filters. Shared links include the filters and use the catalog’s pinned source records.';}
};
}
3 changes: 3 additions & 0 deletions docs/site/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/site/workspace.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<section id="inventory"><div class="section-heading"><div><p class="eyebrow">03 / THE EXISTING CATALOG</p><h2>Find the full argument.</h2></div><a href="https://github.com/d6g8k5htny-coder/main/blob/main/docs/PUBLIC_MATHEMATICS.md">Reading guide ↗</a></div>
<p>The existing 2,138-file inventory includes proofs, partial arguments, reviews, and historical reading copies. It counts files, not accepted theorems. New imports and proposals have separate public links.</p>
<div class="catalog-filters"><div><label for="repository-filter">Repository</label><select id="repository-filter" disabled><option value="">All repositories</option><option value="main">main</option><option value="Math-">Math-</option></select></div><div><label for="path-filter">Path contains</label><input id="path-filter" type="search" placeholder="For example coefficients/side24_v1/" disabled></div></div>
<label for="search">Search by path, repository, commit, or SHA-256</label><input id="search" type="search" placeholder="Try EC-014, SIDE24, or lifetime" disabled><p id="inventory-state" role="status">Verifying the original inventory and its shards…</p><div class="table-wrap"><table><thead><tr><th>Repository / full text</th><th>Commit</th><th>SHA-256</th></tr></thead><tbody id="catalog"></tbody></table></div><button id="more" type="button" hidden>Show 50 more</button></section>
<label for="search">Search by path, repository, commit, or SHA-256</label><input id="search" type="search" placeholder="Try EC-014, SIDE24, or lifetime" disabled><div class="actions"><button id="catalog-clear" type="button" disabled>Clear filters</button><a id="catalog-link" class="button secondary" aria-disabled="true">Link to this search</a></div><p id="catalog-query-note">Search links become available after catalog verification.</p><p id="inventory-state" role="status">Verifying the original inventory and its shards…</p><div class="table-wrap"><table><thead><tr><th>Repository / full text</th><th>Commit</th><th>SHA-256</th></tr></thead><tbody id="catalog"></tbody></table></div><button id="more" type="button" hidden>Show 50 more</button></section>
<section id="contribute"><p class="eyebrow">04 / JOIN THE WORK</p><h2>Bring a result. Keep its evidence.</h2><div class="cards contribute"><article><h3>1. Claim a bounded task</h3><p>Replay a pinned calculation, chart public data, document an import, or leave a source-bound review comment. Comment <code>/claim</code>; wait for assignment and keep one active claim.</p><a href="https://github.com/d6g8k5htny-coder/main/blob/main/docs/RESEARCH_INDEX.md#open-work">Browse public tasks ↗</a></article><article><h3>2. Submit a result PR</h3><p>Fork main. Add an <code>incoming/&lt;id&gt;/</code> package with your result, outputs, and source/file identities. Do not edit scientific status rows.</p><a href="https://github.com/d6g8k5htny-coder/main/blob/main/CONTRIBUTING.md">Contribution instructions ↗</a></article><article><h3>3. Review before integration</h3><p>A designated reviewer checks the sources, scope, and limitations. Intake checks validate packaging; accepted intake is not an accepted theorem.</p><a href="https://github.com/d6g8k5htny-coder/main/pulls">Public review queue ↗</a></article></div></section>
</main><footer><p>One front door. Full proofs in <a href="https://github.com/d6g8k5htny-coder/Math-">Math-</a> · Exact lookup in <a href="https://github.com/d6g8k5htny-coder/query-">query-</a> · Repository map in <a href="https://github.com/d6g8k5htny-coder/Universal-Law-Workspace">Universal-Law-Workspace</a>.</p><p>This static viewer has no account, upload service, execution backend, or status-write capability.</p></footer>
</body></html>
6 changes: 6 additions & 0 deletions tests/browser-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Optional CI browser tests only; no runtime dependency for the static site.
# The runner’s packaged stable Chrome retains its existing supported sandbox.
playwright==1.62.0
pyee==13.0.1
greenlet==3.5.5
typing_extensions==4.16.0
Loading
Loading