Skip to content

GitHub Pages site, written as a checkable proof - #18

Open
orda-aska wants to merge 9 commits into
mainfrom
site/proof-pages
Open

orda-aska wants to merge 9 commits into
mainfrom
site/proof-pages

Conversation

@orda-aska

@orda-aska orda-aska commented Nov 22, 2026 •

Copy link
Copy Markdown

Adds a GitHub Pages site for mcproof, written as a formal derivation. Every claim on the page is one record in docs/data/claims.json with a kind, a certainty tier, its dependencies, and its evidence.

Two checkers that share no code recompute every tier: tools/verify.py in CI, and docs/assets/proof-core.js under Node and again in the visitor's browser. Theorem T0, the end-to-end claim from the blueprint in siliconcordat/mde#4, computes to CONJECTURE while obligations O1 to O5 are open. The checkers cap it there, so the page cannot upgrade its own headline.

How the site embodies the repo

  • The publish workflow is a proof gate. The verify job always runs; upload and deploy run on main only when the repository variable PAGES_ENABLED is true, so a broken claim graph cannot reach Pages and main stays green while Pages is still disabled.
  • The browser rehashes claims.json, reruns the checker, and compares its verdict with docs/data/certificate.json. The Q.E.D. seal at the top is that live result.
  • A tamper button adds a dependency cycle in memory and the verdict turns red. The same corruption is one of the planted bugs in tools/run_mutations.py.
  • The hero figure is the claim graph itself, laid out by dependency depth. Colour is the computed tier.
  • Style follows Eido, the design language of ML Weft: one OKLCH palette turned by a single hue, a draggable simplex that blends three presets with circular hue averaging, and a condense switch that shortens plain prose and refuses every proof block (hazard H7, data-eido-skip).
  • Nothing visual uses the clock. The weave, the figure, and the first position of the style point derive from the graph SHA-256.
  • Record discipline follows Foundation0: every claim carries sources, stats come from the data file, the page works with JavaScript off, and sections state what is not proved and what a reader must trust.

Validation

Gate Result
tools/verify.py under -I -B, -I -O -B, -I -B -W error pass, 26 claims, 5 open obligations
Certificate rebuilt from scratch byte-identical (git diff clean); cert sha256 cc7dd155a5f6f0248f35c74de3ba39c68c8f2c17228e600596f42581d529177a
tools/run_mutations.py 25 of 25 corruptions rejected
node --test "test/*.test.mjs" 465 of 465 pass (R-Text whitespace matrix in test/checker-parity.test.mjs)
tools/build.py --verify twice byte-identical docs/index.html and certificate; workflow git diff clean
Headless Chrome, live page not run (this pass)
GitHub Pages deploy on main not run (requires PAGES_ENABLED=true and Pages enabled in repo settings)

To publish after merge

  1. Set Settings → Pages → Source to GitHub Actions.
  2. Create repository variable PAGES_ENABLED = true (Settings → Secrets and variables → Actions → Variables).
  3. Push to main; the workflow publishes docs/ when all gates pass.

The site URL in the page metadata assumes https://proven-commons.github.io/mcproof/.

orda-aska added 2 commits November 22, 2026 16:02
The site is a formal derivation: 26 claims in docs/data/claims.json,
tiers recomputed by two checkers that share no code (tools/verify.py
and docs/assets/proof-core.js), 12 planted corruptions rejected, and a
byte-identical deterministic build. The Pages deploy job needs the
verify job, so a broken claim graph cannot publish.

Signed-off-by: orda-aska <ci@example.invalid>
Prototype-safe tier checks, id/title/statement/section validation,
evidence shape and URL scheme allowlist, duplicate JSON key rejection,
fail-closed browser paths, textContent for condensed prose, SHA-pinned
Pages actions, 17 mutation cases, and O1-O3 now record the open stack
PRs and their negative verdict instead of reading as pure future work.

Signed-off-by: orda-aska <ci@example.invalid>

@abu-aska abu-aska left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean-room security, workflow, and Claim-to-Witness review on 6ddcc70d (17 files, +2,175/-2):

What verified clean:

  • Exemplary workflow privilege model: .github/workflows/pages.yml sets top-level permissions: {}, scopes verify to contents: read with persist-credentials: false, scopes deploy to pages: write + id-token: write, and pins all 4/4 actions by valid full commit SHAs (actions/checkout@11d5960a, actions/setup-node@49933ea5, actions/upload-pages-artifact@7b1f4a76, actions/deploy-pages@d6db9016 — all verified via GitHub API).
  • Deterministic execution & Claim-to-Witness parity: tools/verify.py exits 0 bit-identically across -I -B, -I -O -B, and -I -B -W error (OK claims=26 open_obligations=5, CERTIFICATE sha256:cc7dd155...); tools/run_mutations.py rejects 17/17 corruptions; node --test test/proof-core.test.mjs passes 10/10; aletheia audit-check --safety-scan PASS. Verified live against GitHub that Foundation-0/proven-commons pins leanprover/lean4:v4.35.0 with exactly 18 packages in audit.json, all 4 siliconcordat commits in L2–L5 (mde@52ce0178, exo@9d52aa1f, warp@28f56549, weft@3d66f07e) exist on public repos (private: false), and T0 stays CONJECTURE while O1–O5 remain OPEN.

Two blocking issues to fix before merge:

  1. MC18-01 [HIGH] Live Python vs. JavaScript checker divergence + R2 URL/evidence bypasses (tools/verify.py:33,61,63,71,86-97 vs. docs/assets/proof-core.js:8,32-46):

    • Direct Python/JS disagreement (violating docs/data/RULES.md and T1): In tools/verify.py:90-91, Python's all(ch.isalnum() or ch in "_./-" for ch in url) is vacuously True when url == "". Appending {"label": "empty", "url": ""} to L1.evidence passes tools/verify.py (rc=0, OK claims=26), whereas docs/assets/proof-core.js:8 (/^[A-Za-z0-9_./-]+$/) rejects it (ok: false, L1: evidence must be {label, https-or-relative url} (R2))!
    • Unhashable-type divergence / raw crashes (tools/verify.py:33,61,63,71): Setting "kind": ["axiom"] (or list asserted_tier/section) crashes tools/verify.py with an uncaught TypeError: unhashable type: 'list', whereas proof-core.js returns structured ok: false. Passing a missing file or directory to --claims likewise raises an uncaught FileNotFoundError/IsADirectoryError at verify.py:33 instead of exiting cleanly through fail(...).
    • Shared R2 validation bypasses in BOTH checkers:
      • Setting "evidence": "fake" (non-list) on OPEN obligation O1 (or KNOWN claim A1) is silently coerced to [] (verify.py:86, proof-core.js:32) and passes both checkers (rc=0 / ok: true).
      • Bare "https://" (empty host) and path-traversal relative URLs ("../../../../etc/passwd") pass both checkers (rc=0 / ok: true).
    • Minimal fix: Require bool(url) in verify.py:90-91; require a non-empty host without whitespace/quotes after https:// and reject .. path segments in relative URLs in both checkers; reject non-list evidence (when present) in both checkers; verify isinstance(..., str) before set lookup in verify.py:61,63,71; catch OSError in verify.py:33; and add parity regressions in both tools/run_mutations.py and test/proof-core.test.mjs.
  2. MC18-02 [MED] Stale CI step label and fixed /tmp paths (.github/workflows/pages.yml:39, 46-50):

    • Line 39 reads Planted-bug suite (12 corruptions, all must be rejected) while tools/run_mutations.py actually runs 17 corruptions (note: the PR description table also still cites the earlier 12 of 12, 8 of 8, and f78d6770 instead of 17/17, 10/10, and cc7dd155).
    • Lines 46-50 write to hardcoded /tmp/index.first.html and /tmp/certificate.first.json instead of $RUNNER_TEMP/....

Two non-blocking notes:

  • gh api repos/Proven-Commons/mcproof/pages currently returns 404; remember to enable Settings -> Pages -> Source: GitHub Actions before expecting deploy to succeed after merge (already noted in the PR body).
  • docs/404.html uses relative links (assets/favicon.svg, ./, data/claims.json) without <base href="/mcproof/">, which breaks on deep unknown subpaths.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@ahrazzle ahrazzle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content review by grk-proof, posted unchanged by grk-ship.

Proven-Commons/mcproof #18 at 86ccd8d — grk-proof review

Scope: the whole PR (6ddcc70 Pages/proof site plus 86ccd8d og/twitter card), medium effort. Head was rechecked at report time and is unchanged (OPEN). Checks were run by cloud agent bc-1ddddd2a (Composer 2.5) at the exact head. I re-read the key lines from the head blobs myself (marked "proof-checked").

What passes

  • tools/verify.py exit 0 under -I -B, -O and -W error: OK claims=26 open_obligations=5, cert sha256 cc7dd155a5f6f0248f35c74de3ba39c68c8f2c17228e600596f42581d529177a.
  • tools/run_mutations.py: 17/17 corruptions rejected. node --test test/*.test.mjs: 10/10 pass.
  • build.py --verify twice is byte-identical; committed docs/index.html and certificate.json have a clean git diff after build. A one-byte <title> tamper is caught by the workflow's git diff --exit-code step.
  • docs/assets/og.png: valid PNG, 1200x630, 41568 B, sha256 9451a756…7079. og:image / og:url / canonical point at https://proven-commons.github.io/mcproof/ which matches a project site built from docs/.
  • pages.yml: top-level permissions {}, verify has contents: read only, deploy has pages: write + id-token: write; all four actions pinned to full SHAs; PRs run verify only.
  • Labels: no claim asserts PROVEN; T0 is CONJECTURE with O1–O5 OPEN, matching the page copy; "Q.E.D." is the certificate check, not a T0 proof claim.

Findings

High — H1: Python and JS checkers disagree (abu-aska MC18-01, still open)

proof-checked: tools/verify.py:90-91 accepts an empty evidence URL, because all(...) over "" is True and "" doesn't start with //. docs/assets/proof-core.js:8 URL_OK uses /^[A-Za-z0-9_./-]+$/, which needs at least one character, so JS rejects it. Agent reproduced: Python rc 0, JS ok: false (R2).
proof-checked: verify.py:20 KINDS is a set, and line 61 does c.get("kind") not in KINDS, so kind: ["axiom"] raises TypeError (traceback) where JS returns a structured error.
Agent also reproduced the other MC18-01 gaps (bare https://, .. paths, non-list evidence) as still divergent.
This breaks the PR's central claim in docs/data/RULES.md (T1: two checkers, same verdict). Fix: one shared URL/field rule in both checkers, plus mutations and Node tests for each divergent case.

Medium — M1: stale counts (MC18-02, still open)

proof-checked: .github/workflows/pages.yml:39 says "12 corruptions"; the suite has 17. The PR body table says 12/12 mutations, 8/8 Node tests and an old cert hash; head is 17/17, 10/10, cc7dd155….

Medium — M2: main goes red after merge while Pages is off

On push to main, upload-pages-artifact and deploy run (if: … refs/heads/main), but the repo has has_pages: false, so deploy-pages is expected to fail until the owner enables Pages. Not run live (inferred from the workflow and repo settings). Fix: gate upload/deploy on a repo variable until the owner approves Pages.

Low

  • L1: build.py --verify alone doesn't catch edits outside the prerender regions (og meta included); only the workflow's git diff step does. Fine in CI, but the docs shouldn't call --verify a tamper check by itself.
  • L2: #18 appends to the minimal README; open #3 replaces README wholesale, so whichever lands second has a conflict to merge by hand.
  • L3: docs/404.html uses relative asset paths without <base href="/mcproof/">, so deep 404s lose styling.
  • L4: verify.py on a missing path or directory gives a traceback, not a FAIL: line.
  • L5: og/twitter text differs from <title> / meta description (likely intentional).

Not run

Headless Chrome live-page checks from the PR body; aletheia audit-check; GitHub Actions on head (status pending, 0 statuses); a real deploy-pages run.

Verdict: REQUEST CHANGES

  • H1: the Python/JS parity bug from MC18-01 is unchanged since 6ddcc70 and contradicts T1 (evidence above).
  • M1: the workflow step name and PR body give stale counts and an old cert hash.
  • M2: merging as-is should turn main's workflow red until Pages is enabled; gate deploy.
    The og card commit (86ccd8d) is correct on its own and needs no changes.

cursoragent and others added 5 commits November 23, 2026 23:38
Document R2-URL in RULES.md and implement the same url_ok / urlOk rule
in tools/verify.py and docs/assets/proof-core.js. Reject empty relative
URLs, bare https://, .. path segments, and non-list evidence. Type-check
kind, tier, and section before lookup so malformed input yields FAIL with
rule ids, never a traceback; load() catches missing paths (L4).

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
Add test/checker-parity.test.mjs with malformed graph cases (empty URL,
kind list, bare https, dotdot paths, non-list evidence, wrong types per
field) run through both checkers. Extend run_mutations.py with the same
five planted bugs.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
Rename mutation step to avoid stale counts; gate upload-pages-artifact
and deploy-pages on vars.PAGES_ENABLED == true. Document the variable and
build.py --verify scope in README. Add base href on docs/404.html.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
Tighten R2-URL in RULES.md: authority matches ^[A-Za-z0-9.-]+(:[0-9]+)?$
(ASCII), optional tail pattern for path/query/fragment, relative URLs
use fullmatch. Python and JS share the same regex text. Type-check claim
ids before dict/map lookup; tag missing-id errors with (R1).

Expand checker-parity with fuzz table (controls, NBSP, U+2028, BOM,
fullwidth solidus) and add url/id mutations.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>

@ahrazzle ahrazzle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content review by grk-proof, posted unchanged by grk-ship.

Proven-Commons/mcproof #18 at 24c682d — grk-proof review

Delta review of five commits on 86ccd8d (my REQUEST CHANGES, CR 6031246238), plus abu-aska MC18-01 (CR 6015675372). I rechecked the head at report time and it hasn't moved. I ran everything below myself on a tarball of the head (Python 3.12, Node 24). CI: verify passes, deploy is skipped as intended, and the combined status is still pending.

What's fixed (proof-ran)

  • tools/verify.py in all three modes prints OK claims=26 open_obligations=5. The cert sha256 is unchanged at cc7dd155…177a, and the file on disk matches it.
  • run_mutations.py: 25/25 corruptions rejected. node --test "test/*.test.mjs": 277/277 pass. build.py --verify gives a byte-identical docs/index.html.
  • URL rule: verify.py:24-53 and proof-core.js:9-31 are now the same algorithm. Both reject an empty URL, //, and .. segments, and both check the host against ^[A-Za-z0-9.-]+(:[0-9]+)?$. Python uses re.ASCII and fullmatch. My edge cases all agree between the two: https://:443, https://., https://a.b/../x, ., a relative URL with a newline, and a bool kind.
  • Parity harness controls: making the JS host rule accept anything fails 35 tests, and dropping the JS .. rule fails 1. The harness bites.
  • M1: pages.yml no longer hard-codes the count. The PR body says 25/25, 277/277 and cc7dd155, which matches what I measured.
  • M2: upload-pages-artifact and deploy are gated on vars.PAGES_ENABLED == 'true', verify always runs, and CI on this head shows deploy skipped.

Finding

Medium — M1: the "non-empty" text check still differs between the checkers

RULES.md:3-6 says both checkers "implement exactly these rules", and R1/R2 require a non-empty title, statement and label. Python tests that with str.strip() (verify.py:103, 105, 135). JS uses String.prototype.trim() (proof-core.js:45, 46, 61). The two strip different whitespace sets. proof-ran, live claims.json with one evidence label replaced:

  • label "\ufeff" (BOM): Python accepts (exit 0), JS rejects. This is a divergence.
  • label "\x1c" (file separator): Python rejects, JS accepts. This is a divergence.
  • label "\u00a0" and "\u200b": both agree.
    title and statement use the same pair of calls, so they diverge the same way. This is a direct counterexample to T1, and smith's fuzz (0 divergences) didn't cover it. The CI gate is Python, so nothing unsafe gets deployed. But a graph with a BOM label would pass CI and then show as failing in the browser. Fix: one explicit whitespace definition in both checkers (for example, ASCII whitespace or a shared regex such as /^[\s\uFEFF]*$/, written so Python and JS treat the same characters as blank), plus parity cases for \ufeff and \x1c.

Low (carried, non-blocking)

  • L1: Python rejects duplicate JSON keys (verify.py:76 no_dupes), but the browser's JSON.parse silently keeps the last value. CI rejects first, so this fails safe. It's worth one sentence in RULES.md.
  • L2–L4 from my 86ccd8d report (404 base href, the verify.py traceback on a bad path, the README conflict with #3): not rechecked in depth, and none blocks.

Not run

GitHub Actions to completion (the status is still pending). A real Pages deploy (gated off). Headless browser checks. smith's /tmp/fz*.mjs fuzzers, which aren't in the repo.

Verdict: REQUEST CHANGES

  • MC18-01 is fixed for URLs and typed fields, and my M1 and M2 are fixed. I verified all of it, including planted controls against the new parity harness.
  • One parity counterexample remains (M1): Python strip() and JS trim() disagree on \ufeff and \x1c, so the two checkers give opposite verdicts on the same claims.json. That contradicts RULES.md's "exactly these rules". It's a one-line fix in each checker plus two parity cases.

Replace str.strip() and trim() with identical is_blank_text / isBlankText
using only \t\n\v\f\r and space. Document R-Text and duplicate-key
CI-first behavior in RULES.md. Add parity cases for BOM, FS, and a full
whitespace character matrix on title, statement, and label.

Co-authored-by: ahraz <ahrazzle@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants