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
239 changes: 239 additions & 0 deletions .github/workflows/current-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
name: Current research site

'on':
push:
branches: [main]
pull_request:
branches: [main]
paths:
- 'docs/site/**'
- 'tools/current_site_data.py'
- 'tools/current_site_build.py'
- 'tools/current_site_history.py'
- 'tools/current_site_publication.py'
- 'tests/test_current_site*'
- '.github/workflows/current-site.yml'
schedule:
- cron: '*/30 * * * *'
workflow_dispatch:

permissions:
contents: read

# A refresh failure never reaches deployment. Do not interrupt a live publish.
concurrency:
group: current-research-pages-${{ github.event_name == 'pull_request' && github.event.pull_request.number || 'publish' }}
cancel-in-progress: false

jobs:
controls:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Offline source and reader admission controls
run: |
python3 -B -S -m unittest discover -s tests -p 'test_current_site*.py' -v
python3 -B -O -S -m unittest discover -s tests -p 'test_current_site*.py' -v
node --test tests/test_current_site.mjs

build:
needs: controls
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.repository == 'd6g8k5htny-coder/main'
runs-on: ubuntu-24.04
timeout-minutes: 20
permissions:
contents: read
outputs:
publication-metadata-id: ${{ steps.publication-metadata.outputs.artifact-id }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.sha }}
persist-credentials: false
- name: Restore and admit all previously published public history
env:
GITHUB_TOKEN: ${{ github.token }}
run: python3 -B -S tools/current_site_publication.py restore --site docs/site --allow-bootstrap
- name: Verify the checkout and acquire one immutable public source observation
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
python3 -B -S tools/current_site_data.py --main-commit "$GITHUB_SHA" --output "$RUNNER_TEMP/current.json"
- name: First offline render and asset identity
run: |
python3 -B -S tools/current_site_build.py --payload "$RUNNER_TEMP/current.json" --site docs/site
python3 -B -S tools/current_site_history.py publish --site docs/site
rm -f docs/site/.current-site-restored-history.json
git add -A -- docs/site docs/public-math
python3 -B -S tools/site_asset_release.py
python3 -B -S tools/current_site_history.py publish --site docs/site
python3 -B -S tools/site_asset_release.py --check
cp -a docs "$RUNNER_TEMP/current-site-first"
- name: Second offline render must equal the first complete docs artifact
run: |
python3 -B -S tools/current_site_build.py --payload "$RUNNER_TEMP/current.json" --site docs/site
python3 -B -S tools/current_site_history.py publish --site docs/site
git add -A -- docs/site docs/public-math
python3 -B -S tools/site_asset_release.py
python3 -B -S tools/current_site_history.py publish --site docs/site
python3 -B -S tools/site_asset_release.py --check
diff -qr "$RUNNER_TEMP/current-site-first" docs
- name: Verify the generated reader routes and existing evidence controls
run: |
python3 -B -S -m unittest discover -s tests -p test_reader_links.py -v
python3 -B -S -m unittest discover -s tests -p test_public_shop_data.py -v
node --test tests/test_current_site.mjs tests/test_public_shop_frontend.mjs tests/test_reader_navigation.mjs tests/test_dependency_viewer.mjs tests/test_source_reference.mjs tests/test_workspace_navigation.mjs
- name: Assemble the verified artifact with the complete legacy docs namespace
run: |
python3 -B -S - <<'PY'
from pathlib import Path
root = Path('docs')
if any(path.is_symlink() for path in root.rglob('*')):
raise SystemExit('Pages artifact refused: symlinked public content')
if sum(path.stat().st_size for path in root.rglob('*') if path.is_file()) > 1024 * 1024 * 1024:
raise SystemExit('Pages artifact refused: complete docs exceeds 1 GiB capacity')
if (root / 'site/.current-site-restored-history.json').exists():
raise SystemExit('Pages artifact refused: operational restored-history ledger')
PY
cp -a docs "$RUNNER_TEMP/current-site-pages"
diff -qr "$RUNNER_TEMP/current-site-first" "$RUNNER_TEMP/current-site-pages"
- name: Record the assembled browser input before optional setup
run: |
python3 -B -S - <<'PY'
import hashlib, json, os, subprocess
from pathlib import Path
artifact = Path(os.environ['RUNNER_TEMP']) / 'current-site-pages'
output = Path(os.environ['RUNNER_TEMP']) / 'current-site-browser'
output.mkdir(parents=True, exist_ok=True)
pending = {'scientific_effect': 'NONE', 'cases': [],
'error': 'Generated-artifact Chromium check has not completed; inspect setup and run logs.'}
(output / 'report.json').write_text(json.dumps(pending, indent=2) + '\n')
raw = (artifact / 'site/current.json').read_bytes()
if raw != Path('docs/site/current.json').read_bytes():
raise SystemExit('Browser input differs from the assembled Pages payload')
files = sorted((p for p in artifact.rglob('*') if p.is_file()),
key=lambda p: p.relative_to(artifact).as_posix())
tree = hashlib.sha256(b'current-site-generated-browser-input-v1\0')
total = 0
for path in files:
name = path.relative_to(artifact).as_posix().encode('utf-8')
size = path.stat().st_size
tree.update(len(name).to_bytes(8, 'big')); tree.update(name)
tree.update(size.to_bytes(8, 'big')); total += size
with path.open('rb') as source:
while chunk := source.read(1024 * 1024):
tree.update(chunk)
record = {'scientific_effect': 'NONE',
'checked_commit': subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip(),
'source_payload_sha256': hashlib.sha256(raw).hexdigest(),
'source_repositories': json.loads(raw)['repositories'],
'assembled_docs_sha256': tree.hexdigest(),
'assembled_docs_files': len(files), 'assembled_docs_bytes': total}
(output / 'artifact-input.json').write_text(json.dumps(record, indent=2) + '\n')
(output / 'report.json').write_text(json.dumps({**record, **pending}, indent=2) + '\n')
PY
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: '3.12'
- name: Install pinned optional browser tooling
run: >-
python -m pip install --require-hashes --only-binary=:all: -r tests/browser-requirements.txt
- name: Admit the generated Pages artifact in packaged Chromium
run: |
diff -qr docs "$RUNNER_TEMP/current-site-pages"
python -B tools/current_site_browser_check.py --output "$RUNNER_TEMP/current-site-browser"
diff -qr docs "$RUNNER_TEMP/current-site-pages"
- name: Preserve generated-artifact browser evidence including failures
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: current-site-generated-browser-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/current-site-browser
if-no-files-found: error
retention-days: 30
- name: Bind exact qualified metadata to the browser-tested Pages artifact
run: |
diff -qr docs "$RUNNER_TEMP/current-site-pages"
python3 -B -S tools/current_site_publication.py package --site "$RUNNER_TEMP/current-site-pages/site" --artifact-input "$RUNNER_TEMP/current-site-browser/artifact-input.json" --browser-report "$RUNNER_TEMP/current-site-browser/report.json" --output "$RUNNER_TEMP/current-site-publication-metadata"
- name: Hand off the exact qualified publication metadata
id: publication-metadata
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: current-site-publication-metadata-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/current-site-publication-metadata
if-no-files-found: error
retention-days: 30
# Official action refs resolved and interfaces read on 2026-10-13.
- name: Upload the verified Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: ${{ runner.temp }}/current-site-pages
include-hidden-files: true

deploy:
needs: build
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.repository == 'd6g8k5htny-coder/main'
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
# The stdlib emitter permits only latest.json on the fixed receipt branch.
# GitHub's token is repository-scoped; source/main/force writes are refused.
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check out only the tested source commit for the stdlib receipt tool
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: ${{ github.sha }}
persist-credentials: false
- name: Receive the exact qualified publication metadata
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
artifact-ids: ${{ needs.build.outputs.publication-metadata-id }}
path: ${{ runner.temp }}/current-site-publication-metadata
Comment thread
d6g8k5htny-coder marked this conversation as resolved.
Resolved
# A distinct integrator verifies Actions source before enabling publication.
- name: Read the existing Pages configuration
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
with:
enablement: false
- name: Persist the prepared publication anchor before any Pages side effect
id: preparation
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
python3 -B -S tools/current_site_publication.py prepare --metadata "$RUNNER_TEMP/current-site-publication-metadata" --prepared "$RUNNER_TEMP/current-site-prepared.json" --allow-bootstrap
python3 -B -S - <<'PY'
import json, os
from pathlib import Path
phase = json.loads((Path(os.environ['RUNNER_TEMP']) / 'current-site-prepared.json').read_bytes())['receipt']['phase']
if phase not in ('prepared', 'observed'):
raise SystemExit('Unadmitted publication phase')
with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
output.write('phase=' + phase + '\n')
PY
- name: Deploy the verified artifact
if: steps.preparation.outputs.phase == 'prepared'
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
- name: Observe exact public bytes before appending the observed receipt
env:
GITHUB_TOKEN: ${{ github.token }}
run: python3 -B -S tools/current_site_publication.py observe --metadata "$RUNNER_TEMP/current-site-publication-metadata" --prepared "$RUNNER_TEMP/current-site-prepared.json"
- name: Preserve prepared state for diagnosis even after a publish or readback failure
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: current-site-publication-state-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/current-site-prepared.json
if-no-files-found: warn
retention-days: 30
8 changes: 7 additions & 1 deletion .github/workflows/public-shop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
run: |
python3 -B tools/site_asset_release.py --check
python3 -B -m unittest tests.test_site_asset_release
- name: Current source and publication controls
run: |
python3 -B -S -m unittest tests.test_current_site_data tests.test_current_site_build
node --test tests/test_current_site.mjs
- name: Browser data-validation controls
run: node --test tests/test_public_shop_frontend.mjs tests/test_explore_models.mjs tests/test_curvature_export.mjs tests/test_teaching_export.mjs tests/test_pin_export.mjs tests/test_palette_export.mjs tests/test_reader_navigation.mjs tests/test_source_reference.mjs tests/test_measurement_model.mjs tests/test_dependency_viewer.mjs tests/test_museum_frontend.mjs tests/test_workspace_navigation.mjs
- name: Reader navigation and local asset routes
Expand Down Expand Up @@ -55,11 +59,13 @@ jobs:
python-version: '3.12'
- name: Install pinned optional browser tooling
run: |
python -m pip install -r tests/browser-requirements.txt
python -m pip install --require-hashes --only-binary=:all: -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: Current mathematical atlas and static reading parity
run: python -B tools/current_site_browser_check.py --output browser-evidence/current-atlas
- name: Preserve browser results including failures
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
Expand Down
14 changes: 11 additions & 3 deletions docs/site/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@

**Live:** [Universal Law](https://d6g8k5htny-coder.github.io/main/site/).

The public home introduces the mathematics before its implementation. All pages share Home, Explore, Research and Library navigation. Contribution options remain available from every page's footer site map, from Home's About section, and from the workspace's Join the work section.
The public home introduces the mathematics before its implementation. All pages share Home, Explore, Research, Library and Mathematics navigation. Contribution options remain available from every page's footer site map, from Home's About section, and from the workspace's Join the work section.

- **Home (`index.html`):** a short introduction to random landscapes, thresholds and persistence; no source catalog is downloaded on this page.
- **Home (`index.html`):** a short introduction to random landscapes, thresholds and persistence; the separate current-source panel loads a hash-verified local public source observation.
- **Explore (`explore.html`):** three deterministic teaching models—negative-definite curvature, cubic gap scaling and a finite capacity example. Controls work locally with no remote data service. These illustrate their defined examples and do not certify a continuum result.
- **Research (`research.html`):** dated public reading cuts, newest first (Home and the Research hero link the newest), followed by the established question-to-proof paths. Pinned source citations, scoped formal packets and issue-only proofs retain distinct scope; separately labeled mutable upstream links reach newer work.
- **Library and workspace (`workspace.html`):** the existing exact coefficient viewer, dated status snapshot, hash-verified source inventory and contributor instructions. Old `index.html#board`, `#coefficient`, `#inventory` and `#contribute` bookmarks route here; without JavaScript the home still offers the workspace link.
- **Reproduce (`reproduce.html`):** a single pinned coefficient replay, prerequisites, actual expected output and the boundary of the check.
- **Cite (`cite.html`):** object-specific citation guidance and a local immutable-reference builder. It checks input syntax, not source existence or scientific status.
- **Source records (`museum.html`):** the preserved historical source-bound exhibits, review cards and conditional routes. It names its separate snapshot; later proof-index results are not silently imported into old cards.
- **Formal (`formal.html`):** what the original 27 September 2026 Lean lane's 13 scalar companions establish and what stays outside them; an explanation at that source snapshot, not a current formalization inventory or live acceptance register. Its dated "Since this snapshot" section points to later formal packages.
- **Dependencies (`dependencies.html`):** a dated, read-only claim-dependency snapshot derived from frozen source bytes; it does not update claim status or replace the live proof index.
- **Mathematics (`dependencies.html`):** current equation excerpts, a progressively expanded graph, Graph/List views, a loaded-neighborhood minimap, five separate evidence metadata axes, exact sources and static node pages, followed by the preserved dated dependency snapshot. It does not update scientific classifications or replace the proof index.
- **Measure (`measure.html`):** a synthetic counts-to-density teaching example with invented inputs; it generates no random field and validates no theorem.

The front and technical layers use the same existing evidence. No second scientific register or server backend is added. Source identities are available in expandable disclosures, while object/class labels and unavailable states remain visible. The original coefficient artifact’s `scientific_acceptance: false` is retained; later scoped review remains separate.

## Current source publication

`tools/current_site_data.py` resolves public main and Math- commits once, verifies their complete Git trees and the seven acquired source files, and extracts exact indented proof displays. Other inventory rows bind paths and Git blobs; their document bytes are not downloaded. The page calls equation blocks excerpts and keeps their surrounding proof scope available by pinned line links. `tools/current_site_build.py` renders one payload offline into marked current sections and static node pages; Research and Formal stay script-free. Current observations and original dated reading cuts have separate identities.

The proposed `current-site.yml` builds on main pushes and a 30-minute schedule and deploys the complete tested docs artifact through Pages Actions. Deployment needs verified Pages source configuration and actual hosted success before it can be called active. A failed source refresh cannot reach deployment. Source observations are not mathematical revalidation. Existing diagrams on Explore keep their defined teaching scope; the new source panel links the advancing work.

Local current-view controls: `python3 -B -S -m unittest tests.test_current_site_data tests.test_current_site_build`; `node --test tests/test_current_site.mjs`; and, with the pinned browser packages and packaged Chrome, `python3 -B tools/current_site_browser_check.py --output browser-evidence/current-atlas`.

## Verify the reader experience

```sh
Expand Down
Loading
Loading