From 0dbd5fd5c3cca7e520aa48f5e67c5d30aa001cb9 Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Sat, 3 Oct 2026 11:36:45 -0700 Subject: [PATCH] Add honest clipboard control for pinned reproduction commands --- docs/site/app.js | 6 +++--- docs/site/brand.css | 2 +- docs/site/cite.html | 4 ++-- docs/site/cite.mjs | 2 +- docs/site/conditionals.mjs | 2 +- docs/site/dependencies.html | 10 +++++----- docs/site/dependencies.mjs | 2 +- docs/site/explore-models.mjs | 2 +- docs/site/explore.html | 10 +++++----- docs/site/explore.mjs | 2 +- docs/site/formal.html | 6 +++--- docs/site/index.html | 4 ++-- docs/site/measure.html | 10 +++++----- docs/site/measure.mjs | 2 +- docs/site/museum.html | 6 +++--- docs/site/museum.mjs | 6 +++--- docs/site/reproduce-copy.mjs | 25 +++++++++++++++++++++++ docs/site/reproduce.html | 9 +++++---- docs/site/research.html | 2 +- docs/site/workspace.html | 6 +++--- tests/test_source_reference.mjs | 32 ++++++++++++++++++++++++++++++ tools/public_shop_browser_check.py | 19 ++++++++++++++++++ 22 files changed, 123 insertions(+), 46 deletions(-) create mode 100644 docs/site/reproduce-copy.mjs diff --git a/docs/site/app.js b/docs/site/app.js index e0ca9b8ea..3924a2e83 100644 --- a/docs/site/app.js +++ b/docs/site/app.js @@ -1,6 +1,6 @@ -import {verifiedJSON, verifiedBytes, validateStatus, validateCoefficient, safeSourceURL, hex40, hex64} from './core.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; -import {connectCatalogQuery} from './catalog-query.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; -import {prepareWorkspaceFragment} from './workspace-fragment.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; +import {verifiedJSON, verifiedBytes, validateStatus, validateCoefficient, safeSourceURL, hex40, hex64} from './core.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; +import {connectCatalogQuery} from './catalog-query.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; +import {prepareWorkspaceFragment} from './workspace-fragment.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; const finishFragment=prepareWorkspaceFragment(); const el=id=>document.getElementById(id); const node=(tag,text,cls)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;if(cls)n.className=cls;return n;}; diff --git a/docs/site/brand.css b/docs/site/brand.css index f71e05644..a275e235e 100644 --- a/docs/site/brand.css +++ b/docs/site/brand.css @@ -58,7 +58,7 @@ body > header { color: var(--ul-text); font-weight: 750; letter-spacing: .13em; position: relative; padding-left: 57px; min-height: 44px; line-height: 1.65; } -.brand::before { content: ""; position: absolute; left: 0; top: 1px; width: 42px; height: 42px; background: url("brand/mark.svg?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b") center/contain no-repeat; } +.brand::before { content: ""; position: absolute; left: 0; top: 1px; width: 42px; height: 42px; background: url("brand/mark.svg?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10") center/contain no-repeat; } .brand span { color: var(--ul-muted); font-size: 10px; letter-spacing: .18em; } nav { gap: 12px 24px; flex-wrap: wrap; } nav a { color: var(--ul-text); min-height: 36px; display: inline-flex; align-items: center; font-size: 13px; } diff --git a/docs/site/cite.html b/docs/site/cite.html index 38a305527..70800c14e 100644 --- a/docs/site/cite.html +++ b/docs/site/cite.html @@ -4,8 +4,8 @@ Cite · Universal Law - - + +
UNIVERSAL LAW MATHEMATICS IN THE OPEN
diff --git a/docs/site/cite.mjs b/docs/site/cite.mjs index fa8163180..81333ba07 100644 --- a/docs/site/cite.mjs +++ b/docs/site/cite.mjs @@ -1,4 +1,4 @@ -import {wireReferenceForm} from './source-reference.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; +import {wireReferenceForm} from './source-reference.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; const byId = id => document.getElementById(id); wireReferenceForm({form:byId('reference-form'), repository:byId('reference-repository'), commit:byId('reference-commit'), path:byId('reference-path'), output:byId('reference-output'), link:byId('reference-link'), status:byId('reference-status')}); byId('reference-builder').hidden = false; diff --git a/docs/site/conditionals.mjs b/docs/site/conditionals.mjs index 71b3b4517..0d787c2d2 100644 --- a/docs/site/conditionals.mjs +++ b/docs/site/conditionals.mjs @@ -93,7 +93,7 @@ export function renderProjection(document,host,data,source){ el(document,'p','Generated from verified source bytes. This graph is not formal verification, a proof review, or a scientific-status register.')); host.replaceChildren(article); } -const services=()=>import('./museum.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'); +const services=()=>import('./museum.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'); // The museum module already verifies config → manifest → index/status once per // page fetch and caches every pinned byte request. This route consumes that same // verified startup, so it adds only the audited-descriptor check and projection. diff --git a/docs/site/dependencies.html b/docs/site/dependencies.html index 008a8c483..c20d5fe07 100644 --- a/docs/site/dependencies.html +++ b/docs/site/dependencies.html @@ -7,11 +7,11 @@ Claim dependency viewer · Universal Law - - - - - + + + + + diff --git a/docs/site/dependencies.mjs b/docs/site/dependencies.mjs index dd4f1a891..0babbacc6 100644 --- a/docs/site/dependencies.mjs +++ b/docs/site/dependencies.mjs @@ -10,7 +10,7 @@ import { normalizeSelection, parsePinnedGraph, unresolvedTargets, -} from './dependency-model.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; +} from './dependency-model.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; const byId = id => document.getElementById(id); diff --git a/docs/site/explore-models.mjs b/docs/site/explore-models.mjs index 16fce5d6f..302da32a8 100644 --- a/docs/site/explore-models.mjs +++ b/docs/site/explore-models.mjs @@ -1,6 +1,6 @@ // NON-CERTIFYING educational arithmetic. These functions illustrate source // definitions; they do not simulate a field or estimate a theorem's constants. -import { annulusModel, p15Model, remoteModel } from './geometry.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; +import { annulusModel, p15Model, remoteModel } from './geometry.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; function finite(value, name) { if (!Number.isFinite(value)) throw new RangeError(`${name} must be finite`); diff --git a/docs/site/explore.html b/docs/site/explore.html index da3c0fed4..e52ec3c1e 100644 --- a/docs/site/explore.html +++ b/docs/site/explore.html @@ -7,11 +7,11 @@ Explore the mathematics · Universal Law - - - - - + + + + + diff --git a/docs/site/explore.mjs b/docs/site/explore.mjs index a9a6f4400..2b6fbd8ed 100644 --- a/docs/site/explore.mjs +++ b/docs/site/explore.mjs @@ -1,4 +1,4 @@ -import { coneModel, pinModel, paletteModel } from './explore-models.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; +import { coneModel, pinModel, paletteModel } from './explore-models.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; const ns = 'http://www.w3.org/2000/svg'; const byId = id => document.getElementById(id); diff --git a/docs/site/formal.html b/docs/site/formal.html index 1594a2d23..cf1b0d94e 100644 --- a/docs/site/formal.html +++ b/docs/site/formal.html @@ -4,9 +4,9 @@ Formal verification · Universal Law - - - + + + diff --git a/docs/site/index.html b/docs/site/index.html index 3f139b402..c7a365e37 100644 --- a/docs/site/index.html +++ b/docs/site/index.html @@ -4,8 +4,8 @@ Universal Law · The shape of randomness - - + +
UNIVERSAL LAW MATHEMATICS IN THE OPEN
diff --git a/docs/site/measure.html b/docs/site/measure.html index 65ac18a34..2c4ecf57a 100644 --- a/docs/site/measure.html +++ b/docs/site/measure.html @@ -7,11 +7,11 @@ From counts to density · Universal Law - - - - - + + + + + diff --git a/docs/site/measure.mjs b/docs/site/measure.mjs index 7c2898a81..a3f6927f5 100644 --- a/docs/site/measure.mjs +++ b/docs/site/measure.mjs @@ -1,4 +1,4 @@ -import { measurementModel, parseMeasurementInputs } from './measurement-model.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; +import { measurementModel, parseMeasurementInputs } from './measurement-model.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; const byId = id => document.getElementById(id); const fields = Object.fromEntries(['count', 'realizations', 'lower', 'upper'].map(name => [name, byId(`measure-${name}`)])); diff --git a/docs/site/museum.html b/docs/site/museum.html index 35152f137..41f153ef4 100644 --- a/docs/site/museum.html +++ b/docs/site/museum.html @@ -4,11 +4,11 @@ Source records & exhibits · Universal Law - + - - + + diff --git a/docs/site/museum.mjs b/docs/site/museum.mjs index 4d143221f..f254a0df8 100644 --- a/docs/site/museum.mjs +++ b/docs/site/museum.mjs @@ -1,5 +1,5 @@ -import {renderSourceQuote} from './source-quote.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; -import {verifiedBytes, hex40, hex64} from './core.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'; +import {renderSourceQuote} from './source-quote.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; +import {verifiedBytes, hex40, hex64} from './core.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'; export const DISCLAIMER='This canvas explains the pinned source. It is not a proof and does not change status.'; const REVIEWED_IDS=['d2-lifetime-remainder','d3-side24-coefficient','d4-fixed-remote-rn','d5-all-height-annulus','d5-height-window-annulus','d5-two-scale','d5-inner-belt-density','d5-fixed-transverse','cumulative-transfer-correction','p15-demand-one-counterexample','d6-p15-full-price']; @@ -247,7 +247,7 @@ function prepareClaimFragment(document,window,currentHash) { return true; }; } -export async function startMuseum({document=globalThis.document,window=globalThis.window,fetcher=globalThis.fetch,search=globalThis.location?.search||'',geometryLoader=()=>import('./geometry.mjs?site-release=6c905b8133e26b3a9feb1ec74bbcc429c3146ea712b475f8f4b119376e22ec8b'),currentHash=()=>globalThis.location?.hash||''}={}){ +export async function startMuseum({document=globalThis.document,window=globalThis.window,fetcher=globalThis.fetch,search=globalThis.location?.search||'',geometryLoader=()=>import('./geometry.mjs?site-release=8b15350e744dac57c6fab662a1ce7e5bb6ea730f009649479e49a4786b240b10'),currentHash=()=>globalThis.location?.hash||''}={}){ const ids=['museum-state','claim-cards','lifetime-fixture','packet-cards','active-exhibit']; const containers=Object.fromEntries(ids.map(id=>{const node=document.getElementById(id);if(!node)throw Error(`Missing museum container: ${id}`);return [id,node];})); const finishFragment=prepareClaimFragment(document,window,currentHash); diff --git a/docs/site/reproduce-copy.mjs b/docs/site/reproduce-copy.mjs new file mode 100644 index 000000000..feb9fefb8 --- /dev/null +++ b/docs/site/reproduce-copy.mjs @@ -0,0 +1,25 @@ +// Copies visible source-pinned commands only. It never executes a calculation. +export function wireCommandCopy({button, block, status, clipboard}) { + const fallback = 'Select the command block above and copy it manually. No commands have been run.'; + if (typeof clipboard?.writeText !== 'function') { + status.textContent = fallback; + return; + } + button.addEventListener('click', async () => { + button.disabled = true; + status.textContent = 'Copying commands…'; + try { + await clipboard.writeText(block.textContent); + status.textContent = 'Copied all commands. They have not run; paste them into your own terminal when ready.'; + } catch { + status.textContent = fallback; + } finally { + button.disabled = false; + } + }); + button.disabled = false; +} + +if (typeof document !== 'undefined') { + wireCommandCopy({button:document.getElementById('copy-commands'), block:document.getElementById('reproduction-commands'), status:document.getElementById('copy-commands-status'), clipboard:globalThis.navigator?.clipboard}); +} diff --git a/docs/site/reproduce.html b/docs/site/reproduce.html index e3a46a0c7..97798535b 100644 --- a/docs/site/reproduce.html +++ b/docs/site/reproduce.html @@ -2,21 +2,22 @@ - + Reproduce · Universal Law - + +
UNIVERSAL LAW MATHEMATICS IN THE OPEN

ONE CALCULATION, FROM SOURCE TO RESULT

Run the numbers.
See the bounds.

Start with an exact calculation in two and three dimensions. It produces a narrow interval for each coefficient, using rational arithmetic with controlled rounding.

-

THE SIDE24 COEFFICIENT EXAMPLE

One repository. No packages to install.

You need Git and Python 3.10 or later, and internet access for the source download. The calculation and its tests then run offline using Python’s standard library. Choose a new directory named side24-replay.

This shallow checkout avoids downloading the repository’s full Git history. The explicit commit below fixes the example even when the default branch advances.

git clone --depth 1 https://github.com/d6g8k5htny-coder/Math-.git side24-replay
+

THE SIDE24 COEFFICIENT EXAMPLE

One repository. No packages to install.

You need Git and Python 3.10 or later, and internet access for the source download. The calculation and its tests then run offline using Python’s standard library. Choose a new directory named side24-replay.

This shallow checkout avoids downloading the repository’s full Git history. The explicit commit below fixes the example even when the default branch advances.

git clone --depth 1 https://github.com/d6g8k5htny-coder/Math-.git side24-replay
 cd side24-replay
 git fetch --depth 1 origin f430fdecbb1d8802d8af40419b701f12af87c039
 git checkout --detach f430fdecbb1d8802d8af40419b701f12af87c039
 python3 -B -S -m unittest discover -s coefficients/side24_v1 -p "test_*.py" -v
-python3 -B -S coefficients/side24_v1/coefficient.py

On Windows, use py -3 in place of python3. No GPU, API key, account, or numerical package is needed.

Source identity and what ran

Repository: Math- at f430fdecbb1d8802d8af40419b701f12af87c039. The entry point is coefficient.py; its 30 tests passed in a fresh checkout with Python 3.11.16 on 30 September 2026. Download time depends on the connection.

Read the mathematical derivation and its assumptions.

+python3 -B -S coefficients/side24_v1/coefficient.py

Select the command block above to copy manually. This page does not run commands.

On Windows, use py -3 in place of python3. No GPU, API key, account, or numerical package is needed.

Source identity and what ran

Repository: Math- at f430fdecbb1d8802d8af40419b701f12af87c039. The entry point is coefficient.py; its 30 tests passed in a fresh checkout with Python 3.11.16 on 30 September 2026. Download time depends on the connection.

Read the mathematical derivation and its assumptions.

WHAT YOU SHOULD SEE

Bounds you can inspect.

The test command ends with Ran 30 tests and OK. The calculation prints JSON containing these exact decimal endpoints:

Coefficient enclosures at the pinned source
DimensionLower endpointUpper endpoint
20.073406919306034271030.07340691930603427104
30.041775931840598343340.04177593184059834335

The output also retains scientific_acceptance: false and its original parent theorem unreviewed scope. That is part of the historical calculation’s output; later reviews have their own source and scope.

This replay checks this coefficient calculation. It does not establish the parent lifetime theorem, identify an elder-pairing event, verify every mathematical result, or run the separate Lean package. The coefficient’s recorded review explains its scientific boundary.

GO FURTHER WHEN YOU WANT TO

Choose the next layer.

Reproduce more

The full execution guide covers other mathematical packages, deliberate error controls, source lookup and historical research branches.

Formal checks have a separate introduction and pinned Lean environment and build instructions.

diff --git a/docs/site/research.html b/docs/site/research.html index 847e9bd8e..e81e54a91 100644 --- a/docs/site/research.html +++ b/docs/site/research.html @@ -4,7 +4,7 @@ Research · Universal Law - +
UNIVERSAL LAW THE RESEARCH
diff --git a/docs/site/workspace.html b/docs/site/workspace.html index b0665623b..b27e1ccde 100644 --- a/docs/site/workspace.html +++ b/docs/site/workspace.html @@ -4,9 +4,9 @@ Research workspace · Universal Law - - - + + + diff --git a/tests/test_source_reference.mjs b/tests/test_source_reference.mjs index 1ab5188cc..0613dcb91 100644 --- a/tests/test_source_reference.mjs +++ b/tests/test_source_reference.mjs @@ -33,3 +33,35 @@ test('real form wiring clears stale output and announces a corrected reference', e.commit.value=sha;listeners.submit({preventDefault(){}});assert.equal(e.link.hidden,false); assert.match(e.status.textContent,/not checked/i); }); + +import {readFile} from 'node:fs/promises'; + +const copyModule = await import('../docs/site/reproduce-copy.mjs').catch(()=>({})); +const copyCommands = 'git checkout --detach f430fdecbb1d8802d8af40419b701f12af87c039\npython3 -B -S coefficients/side24_v1/coefficient.py'; +function copyControls() { + let click; + return {block:{textContent:copyCommands},status:{textContent:''},button:{disabled:true,addEventListener(name,handler){assert.equal(name,'click');click=handler;}},click:()=>click()}; +} +test('copy sends exactly the displayed pinned commands and never executes them',async()=>{ + assert.equal(typeof copyModule.wireCommandCopy,'function'); + const c=copyControls();let copied; + copyModule.wireCommandCopy({...c,clipboard:{async writeText(text){copied=text;}}}); + assert.equal(c.button.disabled,false);await c.click();assert.equal(copied,copyCommands); + assert.match(c.status.textContent,/Copied/);assert.match(c.status.textContent,/not run/); +}); +test('clipboard refusal provides manual fallback without success',async()=>{ + assert.equal(typeof copyModule.wireCommandCopy,'function'); + const c=copyControls();copyModule.wireCommandCopy({...c,clipboard:{async writeText(){throw Error('denied');}}}); + await c.click();assert.match(c.status.textContent,/Select/);assert.doesNotMatch(c.status.textContent,/Copied/);assert.equal(c.button.disabled,false); +}); +test('unsupported clipboard leaves the command block readable and gives fallback',()=>{ + assert.equal(typeof copyModule.wireCommandCopy,'function'); + const c=copyControls();copyModule.wireCommandCopy({...c,clipboard:undefined}); + assert.equal(c.button.disabled,true);assert.equal(c.block.textContent,copyCommands);assert.match(c.status.textContent,/Select/); +}); +test('reproduction controls have static fallback and an explicit live announcement',async()=>{ + const html=await readFile(new URL('../docs/site/reproduce.html',import.meta.url),'utf8'); + assert.match(html,/id="reproduction-commands"/);assert.match(html,/id="copy-commands"[^>]*disabled/); + assert.match(html,/id="copy-commands-status"[^>]*role="status"/); + assert.match(html,/script-src 'self'/);assert.match(html,/src="reproduce-copy.mjs/); +}); diff --git a/tools/public_shop_browser_check.py b/tools/public_shop_browser_check.py index 2939cc273..12264b8a6 100644 --- a/tools/public_shop_browser_check.py +++ b/tools/public_shop_browser_check.py @@ -231,6 +231,25 @@ def check_source_card_flow(page, origin, expect, result, output): for entry in ["index","explore","cite","reproduce","formal"]: page.goto(origin+entry+".html") expect(page.locator("h1")).to_have_count(1) + if entry == "reproduce": + commands=page.locator("#reproduction-commands").inner_text() + page.context.grant_permissions(["clipboard-read","clipboard-write"],origin=origin.rstrip("/")) + copy=page.get_by_role("button",name="Copy all commands",exact=True) + expect(copy).to_be_enabled();copy.focus();page.keyboard.press("Enter") + expect(page.locator("#copy-commands-status")).to_contain_text("Copied all commands") + require(page.evaluate("navigator.clipboard.readText()") == commands,"Clipboard differs from visible pinned commands") + expect(page.locator("#copy-commands-status")).to_contain_text("not run") + page.add_init_script("const mode=sessionStorage.getItem('clipboard-test');if(mode)Object.defineProperty(navigator,'clipboard',{configurable:true,value:mode==='deny'?{writeText:async()=>{throw new Error('denied')}}:undefined})") + page.evaluate("sessionStorage.setItem('clipboard-test','deny')") + page.reload();copy.click() + expect(page.locator("#copy-commands-status")).to_contain_text("Select the command block") + expect(copy).to_be_enabled() + page.evaluate("sessionStorage.setItem('clipboard-test','unsupported')") + page.reload();expect(copy).to_be_disabled() + expect(page.locator("#reproduction-commands")).to_have_text(commands) + expect(page.locator("#copy-commands-status")).to_contain_text("Select the command block") + page.evaluate("sessionStorage.removeItem('clipboard-test')") + result["steps"].append("Reproduction keyboard copy matches exact visible commands; clipboard refusal and unsupported API preserve manual fallback without execution") require(page.evaluate("document.documentElement.scrollWidth <= innerWidth"),f"Reader entry overflow: {entry}") shot=output/f'{result["case"]}-{entry}.png' page.screenshot(path=str(shot))