From 2429c5fcd2eed458824a5cba71d09d7ef7be0e0f Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Sun, 8 Nov 2026 19:38:34 -0600 Subject: [PATCH 1/2] cbz: exercise exact Atlas source bridge --- .github/workflows/public-shop.yml | 9 +- docs/site/atlas-formal-source-bridge-data.mjs | 25 ++ .../side24-main-3b39/source-bridge-8d43.json | 151 ++++++++ .../8d43-README.md.txt | 135 +++++++ .../8d43-REVIEW_LANE.md.txt | 89 +++++ .../8d43-manifest.json | 365 ++++++++++++++++++ .../atlas_formal_bridge_profiles/README.md | 6 +- tests/test_atlas_formal_source_bridge.mjs | 14 + tests/test_atlas_formal_source_bridge.py | 50 ++- tests/test_atlas_source_bridge_mutations.py | 65 ++++ tests/test_atlas_source_bridge_runner.py | 147 +++++++ ...t_atlas_source_bridge_browser_reference.py | 46 +++ tools/atlas_formal_evidence_build.py | 3 +- tools/atlas_formal_source_bridge.py | 55 ++- tools/atlas_source_bridge_browser_check.py | 42 +- 15 files changed, 1165 insertions(+), 37 deletions(-) create mode 100644 docs/site/evidence/side24-main-3b39/source-bridge-8d43.json create mode 100644 tests/fixtures/atlas_formal_bridge_profiles/8d43-README.md.txt create mode 100644 tests/fixtures/atlas_formal_bridge_profiles/8d43-REVIEW_LANE.md.txt create mode 100644 tests/fixtures/atlas_formal_bridge_profiles/8d43-manifest.json create mode 100644 tests/test_atlas_source_bridge_mutations.py create mode 100644 tests/test_atlas_source_bridge_runner.py create mode 100644 tests/test_g11_current_atlas_source_bridge_browser_reference.py diff --git a/.github/workflows/public-shop.yml b/.github/workflows/public-shop.yml index 35b5fbddc..9890cc6c6 100644 --- a/.github/workflows/public-shop.yml +++ b/.github/workflows/public-shop.yml @@ -83,10 +83,15 @@ jobs: python -B tools/atlas_accessible_list_browser_check.py --site docs/site --output browser-evidence/atlas-accessible-list + - name: Atlas exact historical source bridge + run: >- + python -B tools/atlas_source_bridge_browser_check.py + --site docs/site + --output browser-evidence/atlas-source-bridge - name: Exact Atlas browser runner controls run: | - python -B -S -m unittest tests.test_atlas_browser_regressions_runner tests.test_atlas_accessibility_regression_runner tests.test_atlas_accessibility_regression_mutations tests.test_g11_current_atlas_accessibility_regression_reference tests.test_atlas_accessible_list_runner tests.test_atlas_accessible_list_mutations tests.test_g11_current_atlas_accessible_list_reference -v - python -B -O -S -m unittest tests.test_atlas_browser_regressions_runner tests.test_atlas_accessibility_regression_runner tests.test_atlas_accessibility_regression_mutations tests.test_g11_current_atlas_accessibility_regression_reference tests.test_atlas_accessible_list_runner tests.test_atlas_accessible_list_mutations tests.test_g11_current_atlas_accessible_list_reference -v + python -B -S -m unittest tests.test_atlas_browser_regressions_runner tests.test_atlas_accessibility_regression_runner tests.test_atlas_accessibility_regression_mutations tests.test_g11_current_atlas_accessibility_regression_reference tests.test_atlas_accessible_list_runner tests.test_atlas_accessible_list_mutations tests.test_g11_current_atlas_accessible_list_reference tests.test_atlas_source_bridge_runner tests.test_atlas_source_bridge_mutations tests.test_g11_current_atlas_source_bridge_browser_reference -v + python -B -O -S -m unittest tests.test_atlas_browser_regressions_runner tests.test_atlas_accessibility_regression_runner tests.test_atlas_accessibility_regression_mutations tests.test_g11_current_atlas_accessibility_regression_reference tests.test_atlas_accessible_list_runner tests.test_atlas_accessible_list_mutations tests.test_g11_current_atlas_accessible_list_reference tests.test_atlas_source_bridge_runner tests.test_atlas_source_bridge_mutations tests.test_g11_current_atlas_source_bridge_browser_reference -v - name: Atlas focus and reader regressions in both modes run: | set -euo pipefail diff --git a/docs/site/atlas-formal-source-bridge-data.mjs b/docs/site/atlas-formal-source-bridge-data.mjs index d652ee077..987865e62 100644 --- a/docs/site/atlas-formal-source-bridge-data.mjs +++ b/docs/site/atlas-formal-source-bridge-data.mjs @@ -23,6 +23,31 @@ export const SOURCE_BRIDGES = [ "record_path": "evidence/side24-main-3b39/source-bridge-8228.json", "record_sha256": "cdb075de1dd63b4313135c166078b71d827d04c882222accc415d8ddf97fa414" }, + { + "schema_version": 1, + "claim_id": "math.side24-coefficient", + "projection_manifest": { + "repository": "d6g8k5htny-coder/main", + "commit": "b7deb198722582df191006e4f47238f92e6e543d", + "path": "formal/manifest.json", + "blob": "8d43188691c695f66e233727322484da22662a58", + "bytes": 17411, + "sha256": "1c86e1eed110df3ef283f3a6e402194f82f682ba06e55e3ad8fe2010f152df7e" + }, + "historical_artifact": { + "commit": "3b39c42d6edcc98ae165270be346f0e31c57f81d", + "manifest_sha256": "8dfcfe4e9296bca47eede517f37b546ea420ec6b51944b7c16164a906b40e090", + "evidence_sha256": "441babc5f605492b361822c26d59ebee4126e45b90695915195bf951c3c943ef", + "receipt_sha256": "1ae8341c86a043ba917ec1fe68bf7e66ec528cd94b15170528487009f090c7e0" + }, + "scientific_effect": "NONE", + "identical_formal_file_count": 15, + "changed_control_file_count": 0, + "record_path": "evidence/side24-main-3b39/source-bridge-8d43.json", + "record_sha256": "8cd6d4bcb48874aa40a3aa1d7e36d113487a43a1608e24fd4023cbb9e0f64299", + "changed_documentation_file_count": 2, + "changed_manifest_metadata_count": 1 + }, { "schema_version": 1, "claim_id": "math.side24-coefficient", diff --git a/docs/site/evidence/side24-main-3b39/source-bridge-8d43.json b/docs/site/evidence/side24-main-3b39/source-bridge-8d43.json new file mode 100644 index 000000000..5cb0014fc --- /dev/null +++ b/docs/site/evidence/side24-main-3b39/source-bridge-8d43.json @@ -0,0 +1,151 @@ +{ + "schema_version": 1, + "kind": "explicit source-identity bridge to a historical arithmetic artifact", + "claim_id": "math.side24-coefficient", + "projection_manifest": { + "repository": "d6g8k5htny-coder/main", + "commit": "b7deb198722582df191006e4f47238f92e6e543d", + "path": "formal/manifest.json", + "blob": "8d43188691c695f66e233727322484da22662a58", + "bytes": 17411, + "sha256": "1c86e1eed110df3ef283f3a6e402194f82f682ba06e55e3ad8fe2010f152df7e" + }, + "historical_artifact": { + "commit": "3b39c42d6edcc98ae165270be346f0e31c57f81d", + "manifest_sha256": "8dfcfe4e9296bca47eede517f37b546ea420ec6b51944b7c16164a906b40e090", + "evidence_sha256": "441babc5f605492b361822c26d59ebee4126e45b90695915195bf951c3c943ef", + "receipt_sha256": "1ae8341c86a043ba917ec1fe68bf7e66ec528cd94b15170528487009f090c7e0" + }, + "input_graph_identity": { + "blob": "220b56867f24c5ef6f55a3cce70490e9777cf3af", + "bytes": 38753, + "commit": "b29c4b769cac85437b409d152651d5cce4140015", + "path": "frontiers/downstream_gate_20260925/GRAPH.json", + "repository": "d6g8k5htny-coder/Math-", + "sha256": "8822e9618678321a342d69cd0b8ae6552de1b5d578c331de5072b2892ee9dd09" + }, + "input_document_identity": { + "blob": "44b66f04f89fcd87383b3603fa69f1feb64cdddd", + "bytes": 10272, + "commit": "b29c4b769cac85437b409d152651d5cce4140015", + "path": "coefficients/side24_v1/PROOF.md", + "repository": "d6g8k5htny-coder/Math-", + "sha256": "c06daccc4ba4b9168522b9888b76a7d599934fc3b91bd753ee5d492262917769", + "manifest_source": { + "id": "side24-proof", + "repository": "d6g8k5htny-coder/Math-", + "commit": "9d7b6802424fb4715b31999066aafca8ee2f3cca", + "path": "coefficients/side24_v1/PROOF.md", + "bytes": 10272, + "sha256": "c06daccc4ba4b9168522b9888b76a7d599934fc3b91bd753ee5d492262917769", + "local_copy": "formal/sources/side24_v1/PROOF.md" + } + }, + "historical_evidence_reproduced_exactly": true, + "identical_formal_files": { + "formal/lean-toolchain": { + "bytes": 25, + "sha256": "d5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b", + "blob": "ba8ebf2dbaf6a668cd2a0e086186d6d569b69ff5" + }, + "formal/lakefile.toml": { + "bytes": 464, + "sha256": "58f0fa6864cc03e9bcbef2d8c0404e9f3385a30a6124000454319367906cbe4a", + "blob": "d986aa8d776636f3f47deaa6d17d41e79eb5b0d3" + }, + "formal/lake-manifest.json": { + "bytes": 144, + "sha256": "562d38ad95598486b2b592e6d072d5d3212735bfeb1cb6d8eb8ec04492522ba2", + "blob": "fc7655fad5ede55ad51ac99d0801a13a21f78dd7" + }, + "formal/UniversalLaw.lean": { + "bytes": 586, + "sha256": "cb94ad3490a00bc35b420a53a42ff65b6fc66a46b8a26ef1b87035d7bb15587e", + "blob": "ff12fa0ebf0ea9cce23d86c529fdd999c77304d5" + }, + "formal/UniversalLaw/Side24/Ledger.lean": { + "bytes": 7025, + "sha256": "ae4a14f3db8cf26668e55e2d2f80e0dcecb0703826b40396d91fb6e0d266d3f7", + "blob": "c76f2ea2e40026105a45dfded7ac1e499bbe4bbb" + }, + "formal/UniversalLaw/Side24/ConeMoments.lean": { + "bytes": 4409, + "sha256": "2bcd4a83683188856bce010c3dcdec6904e45a6d73b50b9f3891e632ff58985c", + "blob": "e18e69b08120299211f6412570e979afc3c8b896" + }, + "formal/UniversalLaw/Side24/Endpoints.lean": { + "bytes": 1940, + "sha256": "095102245297707316cfd7e244d5509f9b102fe5aa638b7acdbbcf9d3c9d52bd", + "blob": "adccc6c2d5dd987c785198b292c0ab2da6602c26" + }, + "formal/sources/side24_v1/PROOF.md": { + "bytes": 10272, + "sha256": "c06daccc4ba4b9168522b9888b76a7d599934fc3b91bd753ee5d492262917769", + "blob": "44b66f04f89fcd87383b3603fa69f1feb64cdddd" + }, + "formal/sources/side24_v1/ENCLOSURE.json": { + "bytes": 1090, + "sha256": "72b6cd92d31394cdaf5da8919a5d548e902228af1f095cc184158a71d8287811", + "blob": "57af39a05e14ed0ba8ebc00a9b4aca4dffb067c7" + }, + "formal/SCOPE.md": { + "bytes": 6279, + "sha256": "fd06700628b1fbc81c5cfe3786aaa455032375bcb879914f068a66b726802a17", + "blob": "dea7de288b4daffb0efc4e0975af4f5e9cb37827" + }, + "formal/GLOSSARY.md": { + "bytes": 10035, + "sha256": "342d4efb374fea31c39e51f8f6bcdbc50d7fb5fea1fd393eda21afff92c62fb8", + "blob": "c5736cd83ddd5ec352f57805b542f4895b3730c7" + }, + "formal/reviews/TEMPLATE_alignment_review.json": { + "bytes": 1061, + "sha256": "e722e928ca43c16981e063d8eb1c91e9bf8c683241d9dcf156400a419e72feb3", + "blob": "ba5a1b4c2582309658f52df47f9a01060b4f20f8" + }, + "formal/reviews/README.md": { + "bytes": 906, + "sha256": "333ca71e7c676cee89e5d01cd61999c21bb0584e41d6bdacb18afa410109f95d", + "blob": "67c3520befa391a0379b8edda2f356c2c99ef5f5" + }, + "tools/formal_gate_check.py": { + "bytes": 23284, + "sha256": "21c355e02ac6e01337d10465a3105b34b93f832586ee60aa2430f662a90cd8b7", + "blob": "b057225d33a3d29b181acdb16bda9244f4c83be0" + }, + "tests/test_formal_gate.py": { + "bytes": 17792, + "sha256": "4286136d8b24eca9b26d1e7b12933bed5b0961809b362a60c3af7bf46e6ed4b6", + "blob": "0b36e51395a821958af622cc7399e2b89426321f" + } + }, + "changed_control_files": {}, + "source_validators": "Existing source_check on both projections; original build_connection and receipt/log binding.", + "historical_inputs": { + "source_revision": "336b6f8927f37e2a8d727c6bea845f874c52d8f5", + "directory": "tests/fixtures/atlas_formal_build_3b39", + "manifest_sha256": "8dfcfe4e9296bca47eede517f37b546ea420ec6b51944b7c16164a906b40e090", + "projection_sha256": "7b36e2376f4010444108e81f316293ef3b3834d767e0900f68d684c760af2db1", + "handling": "Literal data only; no historical code imported or executed." + }, + "execution_boundary": "Only original3b39/run40246431034/attempt1 execution. No current execution inferred.", + "alignment_boundary": "Original manifest alignment PENDING; submitted31-target review REJECTED(AMEND). No alignment transferred to the current manifest.", + "coverage_boundary": "Closed Nat arithmetic pairingSum6=76 only; no derivative bound, coefficient enclosure or parent theorem.", + "scientific_effect": "NONE", + "changed_documentation_files": { + "formal/README.md": { + "before_sha256": "54436dfd808547d9da9ce0a2ad64b0e5935bb755844fef99b298281c49044aaa", + "after_sha256": "1398c3c6d15476afe9d4ef01fc98fb199976907123b438ae1743f4e87e31e007" + }, + "formal/REVIEW_LANE.md": { + "before_sha256": "887f56209471fc0194d601a4f8a0c82eb75852e1c97da0400c16d447669e6340", + "after_sha256": "6a0dcdd93f1aec16ede829820b913116a5c60c2bbbd78630690599dbc5d8be41" + } + }, + "changed_manifest_metadata": { + "meaning": { + "before": "Evidence sidecar for the main-side Lean package, following the Math- formal lane contract (docs/FORMAL_VERIFICATION.md; historical formal-ladder work item #95, retained in coordination.work_item as provenance rather than current pickup routing). `proved` here means proof text supplied and bound by hash; `kernel-checked` is reported only by the receipt of a trusted --run-lean execution at an exact commit. Alignment is a separate pending/accepted/stale dimension. Nothing in this file is a scientific register entry or changes any ACCEPT/AMEND disposition.", + "after": "Evidence sidecar for the main-side Lean package, following the Math- formal lane contract (docs/FORMAL_VERIFICATION.md, work item #95). `proved` here means proof text supplied and bound by hash; `kernel-checked` is reported only by the receipt of a trusted --run-lean execution at an exact commit. Alignment is a separate pending/accepted/stale dimension. Nothing in this file is a scientific register entry or changes any ACCEPT/AMEND disposition." + } + } +} diff --git a/tests/fixtures/atlas_formal_bridge_profiles/8d43-README.md.txt b/tests/fixtures/atlas_formal_bridge_profiles/8d43-README.md.txt new file mode 100644 index 000000000..f4dfa173f --- /dev/null +++ b/tests/fixtures/atlas_formal_bridge_profiles/8d43-README.md.txt @@ -0,0 +1,135 @@ +# Formal package: SIDE24 arithmetic skeleton (Lean 4, core only) + +Scientific effect: **NONE**. This directory is the second package in the +repository's formal-verification lane. The lane's contract is the +[formal-verification guide](../docs/FORMAL_VERIFICATION.md); the lane is +coordinated in [work item #95](https://github.com/d6g8k5htny-coder/main/issues/95); +the first package is the +[Math- pilot](https://github.com/d6g8k5htny-coder/Math-/tree/cc2989c1280f4f227d0c6aa30c8841d6ba01e46e/formal) +(13 GP-FOR-192 scalar companions, Lean 4 + Mathlib). This package follows the same +manifest, status, gate and alignment contract and adds nothing to the +scientific-status vocabulary. + +What it covers: the exact integer and rational identities and inequalities that +sections 1–4 of the [SIDE24 coefficient note](sources/side24_v1/PROOF.md) +(`Math-@9d7b6802…`, SHA-256 `c06dacc…`) rely on — 31 theorems, stated in core +Lean as cross-multiplied integer facts and proved by `decide`. What it does not +cover is listed target by target in [SCOPE.md](SCOPE.md): not the coefficient +bound `0.07340691930603427103 < c_{2,24} < 0.07340691930603427104`, not the +definition of the coefficient, not any Gaussian, Kac–Rice, cone-integral, +Stirling or interval-arithmetic step, not `coefficient.py`. Relative to the +guide's work-offer table this is the **first step only** of the "Numerical +formalizer" offer; the exact coefficient definition and the proof-producing +enclosure pipeline are not supplied. + +## Layout + +| Path | Role | +|---|---| +| `lean-toolchain`, `lakefile.toml`, `lake-manifest.json` | Pinned toolchain `leanprover/lean4:v4.34.1`; Lake package `UniversalLaw` with **no** dependencies (`dependency_revisions` is empty and the gate checks the lock agrees) | +| `UniversalLaw.lean` | Root module; imports exactly the three registered modules | +| `UniversalLaw/Side24/Ledger.lean` | 17 targets: pairing count, image constant, `60E < 10^-108`, Taylor partial sum of `exp(288/125)`, odd-block minors, section-4 exponent bounds, density-comparison order of magnitude | +| `UniversalLaw/Side24/ConeMoments.lean` | 10 targets: conditional variances, transverse covariance thirds, `D_1 = 4/3`, `D_2 = 29/6 − √6` algebra, cube-root simplification, Hessian block eigenvalues | +| `UniversalLaw/Side24/Endpoints.lean` | 4 targets: the published 20-digit endpoints as integers — adjacency, ordering, magnitude. **Not an enclosure of the coefficient.** | +| `sources/side24_v1/` | Byte copies of the two pinned Layer 0 sources (`PROOF.md`, `ENCLOSURE.json`) | +| `manifest.json` | Evidence sidecar: package identity, toolchain, allowed axioms, SHA-256 of every bound file, pinned sources, 31 targets with verbatim informal anchors and `does_not_claim`, executable negative controls | +| `SCOPE.md` | Exact coverage and "not established" per target; the review contract | +| `ALIGNMENT.md` | Generated from the manifest (`--write-alignment`); never hand-edited | +| `GLOSSARY.md` | Descriptive mapping of project terms to standard objects and Lean availability | +| `REVIEW_LANE.md`, `reviews/` | Independent statement-alignment review procedure, JSON record template, validator | + +## Status vocabulary (same as the Math- lane) + +- `formalization_status` in `manifest.json` is **`proved`**: proof text is + supplied and bound by hash. The manifest cannot say `kernel-checked`; the gate + refuses a manifest that self-awards execution. +- **`kernel-checked`** appears only in the receipt written by a trusted + `--run-lean` execution (`formal/.lake/formal-evidence/receipt.json`), which + records the checked Git commit, Lean version, manifest digest, per-target + transitive axioms (all `[]` here), log hashes, and negative-control outcomes. + A receipt supplied by a caller is untrusted until matched to the actual + workflow run and commit. +- `alignment_status` is **`PENDING_INDEPENDENT_REVIEW`**. The author is + Anthropic / Claude via a Cursor cloud agent (2026-09-27); an alignment record + from the same provider, family or agent is refused by the validator. The + manifest cannot say `ACCEPTED`. +- In the ladder of [#95](https://github.com/d6g8k5htny-coder/main/issues/95) + (L0 prose … L5 proof-assistant-checked, `verification_level` separate from + scientific status) a target with a trusted `kernel-checked` receipt is L5 + evidence for exactly that target. +- None of these labels is a Layer 0 ACCEPT/AMEND verdict or moves one. + +## Run it + +Toolchain (once, ~200 MB, no Mathlib cache needed): + +```sh +curl -sSf https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | sh -s -- -y --default-toolchain none +export PATH="$HOME/.elan/bin:$PATH" +``` + +From the repository root: + +```sh +python3 tools/formal_gate_check.py # source-only: hashes, inventory, anchors, no Lean run +python3 tools/formal_gate_check.py --run-lean # fresh build, leanchecker, axiom audit, controls, receipt +python3 -B -S -m unittest tests.test_formal_gate -v +``` + +The source-only gate prints `SOURCE_IDENTITY_PASS (not a Lean build or +scientific acceptance): `. `--run-lean` removes `.lake/build`, +runs `lake build`, `leanchecker` on every module, a transitive `#print axioms` +audit restricted to `propext` / `Classical.choice` / `Quot.sound`, an +elaborated-type capture, and the executable negative controls: seven +tightened-or-wrong statements written into a scratch copy of the Lean text +(each must be rejected by Lean), plus `sorry`, an indirectly imported custom +axiom, and `native_decide` (each must be rejected by the axiom gate). It then +re-runs the source check to confirm the manifest digest did not move, and only +then writes the receipt. Locally the whole run takes about five seconds. + +Maintenance (these write): `--refresh-hashes` after editing any bound file, +then `--write-alignment` after editing targets, then the gate again. + +The gate fails closed on: hash mismatch; an unregistered `.lean` file or any +unbound file inside `formal/`; a bound file that does not exist; a control or +scope file missing from the bound set; toolchain or dependency-lock drift; +`sorry`, `native_decide` or an `axiom` declaration outside comments; a root +module that imports anything but the registered modules; a target inventory +that differs from the theorem names actually declared (in module order); a +pinned source whose local bytes changed or whose repository is not one of the +project's public repositories; an anchor that is not a verbatim substring; a +missing `does_not_claim`; a stale `ALIGNMENT.md`; a manifest with duplicate JSON +keys. + +## Why core Lean and not Mathlib here + +Everything the arithmetic skeleton needs is `Nat`/`Int` and `decide`, which the +kernel evaluates with GMP-backed literals in well under a second. That keeps +this package's CI cost at seconds with no multi-gigabyte cache. The Math- pilot +already carries the Mathlib dependency (revision +`d13f23b723b8a846827a245b89c10fc7d3f11612`, same Lean `v4.34.1`); any statement +here that needs `ℝ`, `Real.Gamma`, `Real.exp`, `Real.pi`, Gaussian measures or +matrices — the coefficient definition `c_{d,ref}`, the enclosure itself, the +P15 constant `ρ*` — belongs in that Mathlib lane, not in a second dependency +tree. See the rollout record for the coordination items. + +## Coordination + +- [docs/FORMAL_VERIFICATION.md](../docs/FORMAL_VERIFICATION.md) — lane contract + and work offers. +- [docs/FORMAL_VERIFICATION_ROLLOUT_20260927.md](../docs/FORMAL_VERIFICATION_ROLLOUT_20260927.md) + — what this package adds, how it converged onto the Math- contract, what is + asked of other repositories and agents, and this session's capability limits. +- [Work item #95](https://github.com/d6g8k5htny-coder/main/issues/95) — record + actual pickup of alignment review or of the remaining "Numerical formalizer" + steps there. + +## What this package does not do + +It does not change `STATUS.md`, `PROOF_INDEX.md`, `LANDING_CLAIMS` or any +ACCEPT/AMEND outcome. It does not turn a hash match, a green build or a +kernel-checked lemma into acceptance of the theorem built on it. It does not +verify `coefficient.py`. It does not make AI-authored Lean text independent; +the author label stays until a distinct reviewer's record validates. It is not +a second scientific-status database and adds no status vocabulary beyond the +lane's. diff --git a/tests/fixtures/atlas_formal_bridge_profiles/8d43-REVIEW_LANE.md.txt b/tests/fixtures/atlas_formal_bridge_profiles/8d43-REVIEW_LANE.md.txt new file mode 100644 index 000000000..16eeb6d91 --- /dev/null +++ b/tests/fixtures/atlas_formal_bridge_profiles/8d43-REVIEW_LANE.md.txt @@ -0,0 +1,89 @@ +# Independent statement-alignment review (this package) + +The Lean kernel checks that a proof establishes its statement. It cannot check +that the statement is the one the informal text makes. That is an independent +review task with its own lane, distinct from Layer 0 analytic review and from +the author-side act of writing the Lean text. The contract is the lane's +([formal-verification guide](../docs/FORMAL_VERIFICATION.md), "Gate and trust +boundary") and is restated for this package in +[SCOPE.md § Review contract](SCOPE.md#review-contract). + +## Who may review + +Anyone whose provider, family **and** agent all differ from the author's +(`Anthropic` / `Claude` / Cursor cloud agent, 2026-09-27). The validator refuses +a record where any of the three coincides, case-insensitively. Same-provider +reviewers earn zero organizational-independence credit whatever they write; +this is the repository's existing rule and it applies to Lean text as to prose. + +## What the reviewer does + +Read the exact current head first; a changed source, scope, toolchain or +manifest stales any earlier record. Then, for each of the 31 targets in +`manifest.json`: + +1. Locate the `informal_anchor` in the pinned local source copy under + `sources/side24_v1/` and read its context. +2. Read the Lean **statement** (not the proof) and its docstring. Decide + whether it is the informal statement at the scope stated in `SCOPE.md`: + same constants, same quantifiers, same direction of inequality, same + scaling. Most targets are cross-multiplied integer forms of rational + identities; check the cross-multiplication. +3. Read `does_not_claim` and the "Not established" column of `SCOPE.md`. + Confirm the Lean statement does not silently claim more than the anchor and + that what it omits is named. +4. Record a per-target verdict: `ALIGNED`, `ALIGNED AT NARROWER SCOPE` (say + what is narrower) or `MISALIGNED` (say exactly how). Do not grade the proof + (the kernel did) and do not grade the Layer 0 mathematics (different lane). + +The reviewer need not run Lean, but should quote the gate output at the +reviewed commit (`SOURCE_IDENTITY_PASS … ` and, if available, +the workflow run that produced the receipt). + +## What the reviewer records + +Two files under `reviews/`, named `_.md` and `.json`: + +- **Markdown**: reviewer identity and provider; **source exposure** (whether the + Lean proof text or docstrings were read before forming a view of each + statement — reading the proof first is the weakest form and must be stated); + the reviewed commit, manifest digest and scope digest; one row per target + with the verdict. +- **JSON**: copy [`reviews/TEMPLATE_alignment_review.json`](reviews/TEMPLATE_alignment_review.json) + and fill it in. `disposition` is `ACCEPTED` only if **every** target is + `ALIGNED` or `ALIGNED AT NARROWER SCOPE` with the narrowing recorded; + otherwise leave the record unaccepted — the validator refuses it, which is + the intended outcome. `manifest_sha256` is the SHA-256 of + `formal/manifest.json` at the reviewed commit; `scope_sha256` is the hash of + `formal/SCOPE.md` recorded in the manifest's `files`. `targets` is exactly + the 31 manifest target names. `evidence` points to the committed Markdown + record by repository, 40-character commit, path and SHA-256. + +Validate: `python3 tools/formal_gate_check.py --alignment formal/reviews/.json`. +The validator checks structure, digests, coverage and lineage independence. It +does not authenticate that the review happened; a controller has to retrieve +the referenced evidence at the referenced commit. + +A `MISALIGNED` verdict is corrected at the source: fix the Lean statement (new +hash, new `--run-lean` receipt) or fix the anchor, then re-review. + +## What this lane cannot do + +- Promote a Layer 0 status. `STATUS.md` and `PROOF_INDEX.md` move only through + their own source-bound review. +- Make an author-side proof independent by relabelling; independence is + recorded from the reviewer's actual identity and lineage. +- Substitute for formalising the analytic content. An aligned arithmetic lemma + remains an arithmetic lemma. +- Flip `alignment_status` in `manifest.json`. That field stays + `PENDING_INDEPENDENT_REVIEW`; the accepted record is the evidence, and a + controller consumes it. + +## Current state + +All 31 targets: authored by Anthropic / Claude via a Cursor cloud agent on +2026-09-27; `proved` at source; `kernel-checked` only in the receipt of a +trusted run; alignment `PENDING_INDEPENDENT_REVIEW`. No record other than the +template exists. Record actual pickup in +[work item #95](https://github.com/d6g8k5htny-coder/main/issues/95) so two +reviewers do not duplicate the work. diff --git a/tests/fixtures/atlas_formal_bridge_profiles/8d43-manifest.json b/tests/fixtures/atlas_formal_bridge_profiles/8d43-manifest.json new file mode 100644 index 000000000..8d4318869 --- /dev/null +++ b/tests/fixtures/atlas_formal_bridge_profiles/8d43-manifest.json @@ -0,0 +1,365 @@ +{ + "schema_version": 1, + "scientific_effect": "NONE", + "scientific_status_authority": false, + "package": "side24-arithmetic-skeleton", + "package_root": "formal", + "root_module": "UniversalLaw", + "formalization_status": "proved", + "alignment_status": "PENDING_INDEPENDENT_REVIEW", + "meaning": "Evidence sidecar for the main-side Lean package, following the Math- formal lane contract (docs/FORMAL_VERIFICATION.md, work item #95). `proved` here means proof text supplied and bound by hash; `kernel-checked` is reported only by the receipt of a trusted --run-lean execution at an exact commit. Alignment is a separate pending/accepted/stale dimension. Nothing in this file is a scientific register entry or changes any ACCEPT/AMEND disposition.", + "coordination": { + "guide": "docs/FORMAL_VERIFICATION.md", + "work_item": "https://github.com/d6g8k5htny-coder/main/issues/95", + "math_pilot": "https://github.com/d6g8k5htny-coder/Math-/tree/cc2989c1280f4f227d0c6aa30c8841d6ba01e46e/formal", + "rollout_record": "docs/FORMAL_VERIFICATION_ROLLOUT_20260927.md", + "work_offer_addressed": "Numerical formalizer, first step only: the exact arithmetic skeleton of the SIDE24 note. The coefficient definition and the proof-producing enclosure pipeline are NOT supplied." + }, + "author": { + "provider": "Anthropic", + "family": "Claude", + "agent": "Cursor cloud agent, 2026-09-27" + }, + "lean_toolchain": "leanprover/lean4:v4.34.1", + "dependency_revisions": {}, + "allowed_axioms": [ + "propext", + "Classical.choice", + "Quot.sound" + ], + "files": { + "formal/lean-toolchain": "d5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b", + "formal/lakefile.toml": "58f0fa6864cc03e9bcbef2d8c0404e9f3385a30a6124000454319367906cbe4a", + "formal/lake-manifest.json": "562d38ad95598486b2b592e6d072d5d3212735bfeb1cb6d8eb8ec04492522ba2", + "formal/UniversalLaw.lean": "cb94ad3490a00bc35b420a53a42ff65b6fc66a46b8a26ef1b87035d7bb15587e", + "formal/UniversalLaw/Side24/Ledger.lean": "ae4a14f3db8cf26668e55e2d2f80e0dcecb0703826b40396d91fb6e0d266d3f7", + "formal/UniversalLaw/Side24/ConeMoments.lean": "2bcd4a83683188856bce010c3dcdec6904e45a6d73b50b9f3891e632ff58985c", + "formal/UniversalLaw/Side24/Endpoints.lean": "095102245297707316cfd7e244d5509f9b102fe5aa638b7acdbbcf9d3c9d52bd", + "formal/sources/side24_v1/PROOF.md": "c06daccc4ba4b9168522b9888b76a7d599934fc3b91bd753ee5d492262917769", + "formal/sources/side24_v1/ENCLOSURE.json": "72b6cd92d31394cdaf5da8919a5d548e902228af1f095cc184158a71d8287811", + "formal/SCOPE.md": "fd06700628b1fbc81c5cfe3786aaa455032375bcb879914f068a66b726802a17", + "formal/GLOSSARY.md": "342d4efb374fea31c39e51f8f6bcdbc50d7fb5fea1fd393eda21afff92c62fb8", + "formal/README.md": "1398c3c6d15476afe9d4ef01fc98fb199976907123b438ae1743f4e87e31e007", + "formal/REVIEW_LANE.md": "6a0dcdd93f1aec16ede829820b913116a5c60c2bbbd78630690599dbc5d8be41", + "formal/reviews/TEMPLATE_alignment_review.json": "e722e928ca43c16981e063d8eb1c91e9bf8c683241d9dcf156400a419e72feb3", + "formal/reviews/README.md": "333ca71e7c676cee89e5d01cd61999c21bb0584e41d6bdacb18afa410109f95d", + "tools/formal_gate_check.py": "21c355e02ac6e01337d10465a3105b34b93f832586ee60aa2430f662a90cd8b7", + "tests/test_formal_gate.py": "4286136d8b24eca9b26d1e7b12933bed5b0961809b362a60c3af7bf46e6ed4b6" + }, + "unbound_files": [ + "formal/manifest.json", + "formal/ALIGNMENT.md" + ], + "sources": [ + { + "id": "side24-proof", + "repository": "d6g8k5htny-coder/Math-", + "commit": "9d7b6802424fb4715b31999066aafca8ee2f3cca", + "path": "coefficients/side24_v1/PROOF.md", + "bytes": 10272, + "sha256": "c06daccc4ba4b9168522b9888b76a7d599934fc3b91bd753ee5d492262917769", + "local_copy": "formal/sources/side24_v1/PROOF.md" + }, + { + "id": "side24-enclosure", + "repository": "d6g8k5htny-coder/Math-", + "commit": "9d7b6802424fb4715b31999066aafca8ee2f3cca", + "path": "coefficients/side24_v1/ENCLOSURE.json", + "bytes": 1090, + "sha256": "72b6cd92d31394cdaf5da8919a5d548e902228af1f095cc184158a71d8287811", + "local_copy": "formal/sources/side24_v1/ENCLOSURE.json" + } + ], + "source_modules": [ + "UniversalLaw/Side24/Ledger.lean", + "UniversalLaw/Side24/ConeMoments.lean", + "UniversalLaw/Side24/Endpoints.lean" + ], + "targets": [ + { + "name": "UniversalLaw.Side24.pairing_sum_six", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Product-rule pairing count at q=6 equals 76", + "source": "side24-proof", + "informal_anchor": "The coefficient sum for q=6 is\n1+15+45+15=76", + "does_not_claim": "the derivative bound 76|x|^6 e^(-|x|^2/2) itself" + }, + { + "name": "UniversalLaw.Side24.pairing_sum_le_six", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Pairing counts for q<=6 are at most 76", + "source": "side24-proof", + "informal_anchor": "it bounds the smaller orders as well", + "does_not_claim": "the analytic statement the arithmetic is attached to; the coefficient bound; the parent theorem" + }, + { + "name": "UniversalLaw.Side24.pairing_terms_six", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Individual pairing terms 1, 15, 45, 15", + "source": "side24-proof", + "informal_anchor": "1+15+45+15=76", + "does_not_claim": "the analytic statement the arithmetic is attached to; the coefficient bound; the parent theorem" + }, + { + "name": "UniversalLaw.Side24.sixth_moment_double_factorial", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Double factorial 5!! = 15", + "source": "side24-proof", + "informal_anchor": "At zero, every such\ncontraction has absolute value at most15.", + "does_not_claim": "that Gaussian derivative contractions at zero are bounded by 15" + }, + { + "name": "UniversalLaw.Side24.lattice_shell_constant", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Shell constants 27·27 = 729 and 729·2 = 1458", + "source": "side24-proof", + "informal_anchor": "<=729 sum_{j>=1} j^9 e^(-288j^2)\n <=1458 e^(-288).", + "does_not_claim": "the lattice-point count or the geometric tail sum" + }, + { + "name": "UniversalLaw.Side24.geometric_ratio_constants", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Ratio constants 2^9 = 512 and 288·3 = 864", + "source": "side24-proof", + "informal_anchor": "successive terms have ratio at most512e^(-864)<1/2", + "does_not_claim": "that the ratio is below 1/2" + }, + { + "name": "UniversalLaw.Side24.period_exponent", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Period-24 exponent 24^2/2 = 288", + "source": "side24-proof", + "informal_anchor": "sum_{n!=0} |n|^6 e^(-288|n|^2)", + "does_not_claim": "the analytic statement the arithmetic is attached to; the coefficient bound; the parent theorem" + }, + { + "name": "UniversalLaw.Side24.image_constant_value", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Image constant 1458·(76·24^6+15) = 21175738586478", + "source": "side24-proof", + "informal_anchor": "E := 1458*(76*24^6+15)*10^(-125)\n = 21175738586478 *10^(-125).", + "does_not_claim": "the inequality |D^q K_24(0)-D^q K_infty(0)| < E" + }, + { + "name": "UniversalLaw.Side24.exp_taylor_partial_sum_gt_ten", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Degree-20 Taylor partial sum of exp(288/125) exceeds 10", + "source": "side24-proof", + "informal_anchor": "The code proves e^(288/125)>10 using the positive rational Taylor sum through20", + "does_not_claim": "that the partial sum is below exp(288/125) (positivity of the omitted terms is analysis)" + }, + { + "name": "UniversalLaw.Side24.covariance_relative_bound", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "60E < 10^(-108) as the integer inequality 60·21175738586478 < 10^17", + "source": "side24-proof", + "informal_anchor": "epsilon=10^(-108), since60E= I/3" + }, + { + "name": "UniversalLaw.Side24.odd_block_eigenvalues", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Odd block trace 16 and determinant 6 = 8^2 - 58", + "source": "side24-proof", + "informal_anchor": "[[1,-3],[-3,15]], whose eigenvalues are8 +/- sqrt(58)", + "does_not_claim": "the analytic statement the arithmetic is attached to; the coefficient bound; the parent theorem" + }, + { + "name": "UniversalLaw.Side24.odd_block_shifted_minors", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Shifted odd block minors 2/3 and 7/9 (scaled by 3: 2 and 7)", + "source": "side24-proof", + "informal_anchor": "subtract I/3 and use first principal minor2/3 and determinant7/9", + "does_not_claim": "Sylvester's criterion" + }, + { + "name": "UniversalLaw.Side24.smaller_eigenvalue_exceeds_third", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "8 - sqrt(58) > 1/3 via 23^2 > 58·9", + "source": "side24-proof", + "informal_anchor": "Its smaller eigenvalue exceeds\n1/3", + "does_not_claim": "monotonicity of the square root" + }, + { + "name": "UniversalLaw.Side24.exponent_bounds", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Exponent inequalities a+2b<14 and 2a+b<13 for d=2,3 (in sixths)", + "source": "side24-proof", + "informal_anchor": "For d=2,3, a+2b<14 and2a+b<13.", + "does_not_claim": "the log/exp estimates that follow" + }, + { + "name": "UniversalLaw.Side24.exponent_values", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "Exact a, b values for d=2,3", + "source": "side24-proof", + "informal_anchor": "a=m+2/3+n/2, b=d+n/2.", + "does_not_claim": "the analytic statement the arithmetic is attached to; the coefficient bound; the parent theorem" + }, + { + "name": "UniversalLaw.Side24.ratio_constant_ordering", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "13 <= 32 and 28 <= 32", + "source": "side24-proof", + "informal_anchor": "ratio between1-13epsilon and\n1+28epsilon, hence safely between1-32epsilon and1+32epsilon", + "does_not_claim": "the elementary log/exp bounds" + }, + { + "name": "UniversalLaw.Side24.density_comparison_below_reported", + "module": "UniversalLaw/Side24/Ledger.lean", + "title": "32·10^(-108) < 10^(-106)", + "source": "side24-proof", + "informal_anchor": "|c_d,24/c_d,ref -1| < 10^(-106), d=2,3.", + "does_not_claim": "the multiplicative density comparison" + }, + { + "name": "UniversalLaw.Side24.conditional_third_derivative_variance", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "Conditional variance tau^2 = 15 - 9 = 6", + "source": "side24-proof", + "informal_anchor": "Var(t)=15, Cov(t,G)=(-3,0,...,0)", + "does_not_claim": "the Gaussian conditioning formula or the covariance derivatives" + }, + { + "name": "UniversalLaw.Side24.transverse_covariance_entries_thirds", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "Transverse covariance entries 8/3, 1, 2/3 from the delta formula", + "source": "side24-proof", + "informal_anchor": "Cov(A_ij,A_kl | V=0)\n = (2/3)delta_ij delta_kl + delta_ik delta_jl + delta_il delta_jk.", + "does_not_claim": "the delta formula itself" + }, + { + "name": "UniversalLaw.Side24.cone_moment_m1_thirds", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "D_1 = 4/3 is half of 8/3", + "source": "side24-proof", + "informal_anchor": "D_1=E[A^2 1{A<0}]=4/3.", + "does_not_claim": "centred Gaussian symmetry" + }, + { + "name": "UniversalLaw.Side24.trace_and_traceless_variances", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "Var(s) = 5/3, Var(x) = Var(y) = 1, Cov(s,x) = 0 from the 2x2 covariance entries", + "source": "side24-proof", + "informal_anchor": "Var(s)=5/3 and Var(x)=Var(y)=1.", + "does_not_claim": "independence beyond zero covariance, which is Gaussian" + }, + { + "name": "UniversalLaw.Side24.fourth_moment_of_trace", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "E s^4 = 3·(5/3)^2 = 25/3", + "source": "side24-proof", + "informal_anchor": "E s^2=5/3, E s^4=25/3", + "does_not_claim": "the Gaussian fourth-moment identity" + }, + { + "name": "UniversalLaw.Side24.exponential_moment_of_trace", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "1 + 5/3 = 8/3 behind E exp(-s^2/2) = sqrt(3/8)", + "source": "side24-proof", + "informal_anchor": "E exp(-s^2/2)=sqrt(3/8)", + "does_not_claim": "the Gaussian exponential-moment identity" + }, + { + "name": "UniversalLaw.Side24.cone_moment_m2_algebra", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "D_2 algebra: rational part 29/6 and 4·sqrt(3/8) = sqrt(6)", + "source": "side24-proof", + "informal_anchor": "D_2 = (1/2)[25/3-20/3+8-8sqrt(3/8)]\n = 29/6-sqrt(6).", + "does_not_claim": "the integral identity or the Rayleigh cone integration" + }, + { + "name": "UniversalLaw.Side24.cube_root_simplification", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "6^2·2 = 3·24 behind 6^(2/3)/24^(1/3) = (3/2)^(1/3)", + "source": "side24-proof", + "informal_anchor": "simplifying 6^(2/3)/24^(1/3)=(3/2)^(1/3)", + "does_not_claim": "the analytic statement the arithmetic is attached to; the coefficient bound; the parent theorem" + }, + { + "name": "UniversalLaw.Side24.pin_determinant_and_joint_dimension", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "det diag(3,1,..,1) = 3 and joint dimensions 6, 10", + "source": "side24-proof", + "informal_anchor": "Its dimension is at most10.", + "does_not_claim": "the analytic statement the arithmetic is attached to; the coefficient bound; the parent theorem" + }, + { + "name": "UniversalLaw.Side24.hessian_block_eigenvalues", + "module": "UniversalLaw/Side24/ConeMoments.lean", + "title": "Hessian block eigenvalues 4, 5, 2 exceed 1/3", + "source": "side24-proof", + "informal_anchor": "The reference Hessian block has eigenvalues d+2 on trace and2 on traceless matrices", + "does_not_claim": "the spectral decomposition" + }, + { + "name": "UniversalLaw.Side24.d2_endpoints_adjacent", + "module": "UniversalLaw/Side24/Endpoints.lean", + "title": "Published d=2 endpoints are adjacent 20-digit decimals", + "source": "side24-enclosure", + "informal_anchor": "\"2\": {\n \"lower\": \"0.07340691930603427103\",\n \"upper\": \"0.07340691930603427104\"", + "does_not_claim": "that c_2,24 lies between them" + }, + { + "name": "UniversalLaw.Side24.d3_endpoints_adjacent", + "module": "UniversalLaw/Side24/Endpoints.lean", + "title": "Published d=3 endpoints are adjacent 20-digit decimals", + "source": "side24-enclosure", + "informal_anchor": "\"3\": {\n \"lower\": \"0.04177593184059834334\",\n \"upper\": \"0.04177593184059834335\"", + "does_not_claim": "that c_3,24 lies between them" + }, + { + "name": "UniversalLaw.Side24.d3_below_d2", + "module": "UniversalLaw/Side24/Endpoints.lean", + "title": "Published d=3 interval lies below the d=2 interval", + "source": "side24-enclosure", + "informal_anchor": "\"scientific_acceptance\": false", + "does_not_claim": "anything about the true coefficients" + }, + { + "name": "UniversalLaw.Side24.endpoints_in_unit_tenth", + "module": "UniversalLaw/Side24/Endpoints.lean", + "title": "Published endpoints lie in (0, 1/10)", + "source": "side24-enclosure", + "informal_anchor": "\"relative_periodization_bound\": \"1e-106\"", + "does_not_claim": "anything about the true coefficients" + } + ], + "negative_controls": { + "false_exponent_bound_d3": { + "module": "UniversalLaw/Side24/Ledger.lean", + "replace": "sixB d < 78", + "with": "sixB d < 77" + }, + "false_covariance_bound": { + "module": "UniversalLaw/Side24/Ledger.lean", + "replace": "60 * imageConstant < 10 ^ 17", + "with": "60 * imageConstant < 10 ^ 15" + }, + "false_exp_partial_sum": { + "module": "UniversalLaw/Side24/Ledger.lean", + "replace": "10 * (125 ^ 20 * fact 20) < expTaylorNumerator", + "with": "11 * (125 ^ 20 * fact 20) < expTaylorNumerator" + }, + "wrong_image_constant": { + "module": "UniversalLaw/Side24/Ledger.lean", + "replace": "= 21175738586478", + "with": "= 21175738586479" + }, + "false_eigenvalue_third": { + "module": "UniversalLaw/Side24/Ledger.lean", + "replace": "58 * 9 < 23 ^ 2", + "with": "58 * 9 < 22 ^ 2" + }, + "false_trace_variance": { + "module": "UniversalLaw/Side24/ConeMoments.lean", + "replace": "20 * 3 = 5 * 12", + "with": "20 * 3 = 6 * 12" + }, + "false_endpoint_adjacency": { + "module": "UniversalLaw/Side24/Endpoints.lean", + "replace": "d2Upper = d2Lower + 1", + "with": "d2Upper = d2Lower + 2" + } + } +} diff --git a/tests/fixtures/atlas_formal_bridge_profiles/README.md b/tests/fixtures/atlas_formal_bridge_profiles/README.md index 730017769..bab3f1b67 100644 --- a/tests/fixtures/atlas_formal_bridge_profiles/README.md +++ b/tests/fixtures/atlas_formal_bridge_profiles/README.md @@ -2,13 +2,17 @@ These are literal data for offline source-bridge tests, never imported or executed. Manifest8228 is from93869215a82da60f014093e2ac28503865ed0aa3; -manifesta22f and its two documentation files are from +manifest8d43 and its two documentation files are from +b7deb198722582df191006e4f47238f92e6e543d; manifesta22f and its two documentation files are from a30e336982ff4a9400182961ae1f8a241ceff927, unchanged at55961773. Their source paths are formal/manifest.json, formal/README.md and formal/REVIEW_LANE.md. The8228documentation bytes are already retained in tests/fixtures/atlas_formal_build_3b39 and are reused without alteration. SHA256:8228manifest1a09020f0706abd506824f54fca76df9daa533749350b9ab6b818e0bbe9ed744; +8d43manifest1c86e1eed110df3ef283f3a6e402194f82f682ba06e55e3ad8fe2010f152df7e; +8d43README1398c3c6d15476afe9d4ef01fc98fb199976907123b438ae1743f4e87e31e007; +8d43REVIEW_LANE6a0dcdd93f1aec16ede829820b913116a5c60c2bbbd78630690599dbc5d8be41; a22fmanifest38eefbfdd84658cd0f6e18bd7d714458a7522b1021f73b1075e7972a63b9bcb0; README137e7c7ed44d732042d803eb4a0ee75f9ddc6475950a2bb6226a7711a44be14b; REVIEW_LANE54d32104aa012e917ef40b73fa3a40228d023249b339cf30fe4bdb7dcbfed414. diff --git a/tests/test_atlas_formal_source_bridge.mjs b/tests/test_atlas_formal_source_bridge.mjs index 24301882a..a76ecde9f 100644 --- a/tests/test_atlas_formal_source_bridge.mjs +++ b/tests/test_atlas_formal_source_bridge.mjs @@ -63,9 +63,23 @@ test('The separately pinned corrected manifest links only to historical executio assert.equal(connection.alignment.record.manifest_sha256,'8dfcfe4e9296bca47eede517f37b546ea420ec6b51944b7c16164a906b40e090'); }); +test('The exact public-site manifest has an explicit historical bridge without inferred execution or review',()=>{ + const data=JSON.parse(fs.readFileSync(new URL('../docs/site/current.json',import.meta.url))); + const connection=formalConnection(data,id); + assert.ok(connection,'The published site snapshot must use an exact admitted source bridge'); + assert.equal(connection.source_bridge.projection_manifest.commit,'b7deb198722582df191006e4f47238f92e6e543d'); + assert.equal(connection.source_bridge.projection_manifest.blob,'8d43188691c695f66e233727322484da22662a58'); + assert.equal(connection.source_bridge.changed_control_file_count,0); + assert.equal(connection.source_bridge.changed_documentation_file_count,2); + assert.equal(connection.source_bridge.changed_manifest_metadata_count,1); + assert.equal(connection.execution.checked_commit,'3b39c42d6edcc98ae165270be346f0e31c57f81d'); + assert.equal(connection.alignment.record.disposition,'REJECTED'); +}); + for(const [profile,blob,bytes] of [ ['original',EVIDENCE.formal.manifest_blob,EVIDENCE.formal.manifest_bytes], ['8228','8228e896c728d95ab94391899320e9d44ab7cdfc',17521], + ['8d43','8d43188691c695f66e233727322484da22662a58',17411], ['a22f','a22f06a3a7b9ab451e9e344d7b2345d2e2ab0553',18104], ])for(const conflicting of [false,true])test(profile+' refuses '+(conflicting?'conflicting':'identical')+' duplicate proof-source entries',()=>{ const data=fixture(); diff --git a/tests/test_atlas_formal_source_bridge.py b/tests/test_atlas_formal_source_bridge.py index df3aad79a..2dd1a061d 100644 --- a/tests/test_atlas_formal_source_bridge.py +++ b/tests/test_atlas_formal_source_bridge.py @@ -13,9 +13,16 @@ PROFILES={ '8228':('8228e896c728d95ab94391899320e9d44ab7cdfc',17521, '1a09020f0706abd506824f54fca76df9daa533749350b9ab6b818e0bbe9ed744',15), + '8d43':('8d43188691c695f66e233727322484da22662a58',17411, + '1c86e1eed110df3ef283f3a6e402194f82f682ba06e55e3ad8fe2010f152df7e',15), 'a22f':('a22f06a3a7b9ab451e9e344d7b2345d2e2ab0553',18104, '38eefbfdd84658cd0f6e18bd7d714458a7522b1021f73b1075e7972a63b9bcb0',13), } +PROFILE_RECORDS={ + '8228':'cdb075de1dd63b4313135c166078b71d827d04c882222accc415d8ddf97fa414', + '8d43':'8cd6d4bcb48874aa40a3aa1d7e36d113487a43a1608e24fd4023cbb9e0f64299', + 'a22f':'8eb071103516848b6368ba8c387bb89198dd0002b0a09373030763f8acf4065f', +} class SourceBridgeCLI(unittest.TestCase): profile='8228' @@ -31,13 +38,17 @@ def setUp(self): paths += [str(p.relative_to(ROOT)) for folder in [ ROOT/'tests/fixtures/atlas_formal_build_3b39'] for p in folder.iterdir() if p.is_file()] paths += ['docs/site/evidence/side24-main-3b39/'+name for name in ['receipt.json','elaborated-types.log','review.json','review.md','verified-execution.zip']] - if self.profile=='a22f':paths += ['docs/site/evidence/side24-main-3b39/source-bridge-8228.json'] + if self.profile in {'8d43','a22f'}: + paths += ['docs/site/evidence/side24-main-3b39/source-bridge-8228.json'] + if self.profile=='a22f': + paths += ['docs/site/evidence/side24-main-3b39/source-bridge-8d43.json'] for relative in set(paths): target=self.root/relative;target.parent.mkdir(parents=True,exist_ok=True) if relative in {'tools/formal_gate_check.py','tests/test_formal_gate.py'}: # Frozen profiles retain their exact old controls as literal data; # the current validator runs, never these historical Python bytes. - source=profile_root/(Path(relative).name+'.txt') + source=((ROOT/'tests/fixtures/atlas_formal_build_3b39') + if self.profile=='8d43' else profile_root)/(Path(relative).name+'.txt') self.assertEqual(hashlib.sha256(source.read_bytes()).hexdigest(),manifest['files'][relative]) elif relative in {'formal/UniversalLaw.lean','formal/SCOPE.md','formal/reviews/TEMPLATE_alignment_review.json'}: # Historical bytes frozen when the live package grew its P15 modules (main#740); @@ -50,12 +61,19 @@ def setUp(self): (self.root/'formal/manifest.json').write_bytes(manifest_raw) for name in ['README.md','REVIEW_LANE.md']: source=(ROOT/'tests/fixtures/atlas_formal_build_3b39'/(name+'.txt') - if self.profile=='8228' else profile_root/('a22f-'+name+'.txt')) + if self.profile=='8228' else profile_root/(self.profile+'-'+name+'.txt')) (self.root/'formal'/name).write_bytes(source.read_bytes()) self.snapshot=json.loads((ROOT/'tests/fixtures/atlas_formal_projection.json').read_text()) + observation={'8228':'7d63d08f6cfadfd9c2ef28039a370d741126f9a0', + '8d43':'b29c4b769cac85437b409d152651d5cce4140015', + 'a22f':'4a0d51bbd06f0d9ac731a1d1df38f25999797135'}[self.profile] + self.snapshot['graph']['identity']['commit']=observation + for source in self.snapshot['sources']: + if source['repository']=='d6g8k5htny-coder/Math-':source['commit']=observation formal=next(s for s in self.snapshot['sources'] if s['repository']=='d6g8k5htny-coder/main' and s['path']=='formal/manifest.json') - formal.update(commit=('93869215a82da60f014093e2ac28503865ed0aa3' if self.profile=='8228' - else '55961773d31a7b2b9906d8be73a26ad44c364dd6'), + formal.update(commit=({'8228':'93869215a82da60f014093e2ac28503865ed0aa3', + '8d43':'b7deb198722582df191006e4f47238f92e6e543d', + 'a22f':'55961773d31a7b2b9906d8be73a26ad44c364dd6'}[self.profile]), blob=PROFILES[self.profile][0],bytes=PROFILES[self.profile][1]) self.input=self.root/'current-projection.json' @@ -70,18 +88,28 @@ def run_cli(self,*extra): return subprocess.run([sys.executable]+flags+[str(TOOL),'--root',str(self.root), '--snapshot',str(self.input),*extra],capture_output=True,text=True) - def test_current_bridge_reproduces_original_evidence_and_records_only_two_control_changes(self): + def test_exact_bridge_reproduces_original_evidence_and_records_profile_deltas(self): result=self.run_cli();self.assertEqual(result.returncode,0,result.stderr) record=json.loads((self.root/('docs/site/evidence/side24-main-3b39/source-bridge-'+self.profile+'.json')).read_text()) + summary=json.loads(result.stdout) + self.assertEqual(hashlib.sha256((json.dumps(record,ensure_ascii=False,indent=2)+'\n').encode()).hexdigest(), + PROFILE_RECORDS[self.profile]) self.assertEqual(record['projection_manifest']['sha256'],PROFILES[self.profile][2]) self.assertEqual(record['historical_artifact']['manifest_sha256'],'8dfcfe4e9296bca47eede517f37b546ea420ec6b51944b7c16164a906b40e090') self.assertEqual(record['historical_artifact']['receipt_sha256'],'1ae8341c86a043ba917ec1fe68bf7e66ec528cd94b15170528487009f090c7e0') - self.assertEqual(set(record['changed_control_files']),{'tools/formal_gate_check.py','tests/test_formal_gate.py'}) + self.assertEqual(set(record['changed_control_files']), + set() if self.profile=='8d43' + else {'tools/formal_gate_check.py','tests/test_formal_gate.py'}) + self.assertEqual(summary['changed_controls'],len(record['changed_control_files'])) self.assertEqual(len(record['identical_formal_files']),PROFILES[self.profile][3]) if self.profile=='a22f': self.assertEqual(set(record['changed_documentation_files']),{'formal/README.md','formal/REVIEW_LANE.md'}) self.assertEqual(set(record['changed_target_annotations']),{'UniversalLaw.Side24.d3_below_d2','UniversalLaw.Side24.endpoints_in_unit_tenth'}) self.assertNotIn('UniversalLaw.Side24.pairing_sum_six',record['changed_target_annotations']) + elif self.profile=='8d43': + self.assertEqual(set(record['changed_documentation_files']),{'formal/README.md','formal/REVIEW_LANE.md'}) + self.assertEqual(set(record['changed_manifest_metadata']),{'meaning'}) + self.assertNotIn('changed_target_annotations',record) self.assertTrue(record['historical_evidence_reproduced_exactly']) self.assertEqual(record['scientific_effect'],'NONE') before=(self.root/'docs/site/atlas-formal-source-bridge-data.mjs').read_bytes() @@ -162,4 +190,12 @@ def test_changed_graph_scope_does_not_reuse_a_document_fingerprint(self): class CorrectedManifestBridgeCLI(SourceBridgeCLI): profile='a22f' + def test_complete_generated_module_matches_checked_in_whitelist(self): + result=self.run_cli();self.assertEqual(result.returncode,0,result.stderr) + self.assertEqual((self.root/'docs/site/atlas-formal-source-bridge-data.mjs').read_bytes(), + (ROOT/'docs/site/atlas-formal-source-bridge-data.mjs').read_bytes()) + +class SiteSnapshotManifestBridgeCLI(SourceBridgeCLI): + profile='8d43' + if __name__=='__main__':unittest.main() diff --git a/tests/test_atlas_source_bridge_mutations.py b/tests/test_atlas_source_bridge_mutations.py new file mode 100644 index 000000000..d38a2dc4d --- /dev/null +++ b/tests/test_atlas_source_bridge_mutations.py @@ -0,0 +1,65 @@ +"""Adverse controls for the source-bridge browser admission and launch policy.""" + +import os +from pathlib import Path +import subprocess +import sys +import tempfile +import unittest + + +ROOT = Path(__file__).resolve().parents[1] +RUNNER = ROOT / "tools" / "atlas_source_bridge_browser_check.py" +TARGET = "tests.test_atlas_source_bridge_runner" + + +class AtlasSourceBridgeMutationTests(unittest.TestCase): + def assert_mutation_killed(self, before, after, expected_test): + source = RUNNER.read_text() + self.assertEqual(source.count(before), 1) + mutated = source.replace(before, after) + with tempfile.TemporaryDirectory() as raw: + mutant = Path(raw) / RUNNER.name + mutant.write_text(mutated) + env = dict(os.environ) + env["ATLAS_SOURCE_BRIDGE_RUNNER"] = str(mutant) + command = [sys.executable, "-B"] + if sys.flags.optimize: + command.append("-O") + command.extend(["-S", "-m", "unittest", TARGET, "-v"]) + result = subprocess.run( + command, + cwd=ROOT, + env=env, + capture_output=True, + text=True, + check=False, + ) + combined = result.stdout + result.stderr + self.assertNotEqual(result.returncode, 0, combined) + self.assertIn(expected_test, combined) + + def test_wrong_default_browser_channel_is_killed(self): + self.assert_mutation_killed( + "else:launch['channel']='chrome'", + "else:launch['channel']='chromium'", + "test_current_site_reaches_sandboxed_default_chrome_launch", + ) + + def test_disabled_chromium_sandbox_is_killed(self): + self.assert_mutation_killed( + "launch={'chromium_sandbox':True,", + "launch={'chromium_sandbox':False,", + "test_current_site_reaches_sandboxed_default_chrome_launch", + ) + + def test_missing_exact_site_manifest_profile_is_killed(self): + self.assert_mutation_killed( + "'8d43188691c695f66e233727322484da22662a58':{", + "'f8d43188691c695f66e233727322484da22662a5':{", + "test_current_site_reaches_sandboxed_default_chrome_launch", + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_atlas_source_bridge_runner.py b/tests/test_atlas_source_bridge_runner.py new file mode 100644 index 000000000..32e185350 --- /dev/null +++ b/tests/test_atlas_source_bridge_runner.py @@ -0,0 +1,147 @@ +"""Process-level controls for the Atlas source-bridge browser check.""" + +import json +import os +from pathlib import Path +import subprocess +import sys +import tempfile +import textwrap +import unittest + + +ROOT = Path(__file__).resolve().parents[1] +RUNNER = Path( + os.environ.get( + "ATLAS_SOURCE_BRIDGE_RUNNER", + ROOT / "tools" / "atlas_source_bridge_browser_check.py", + ) +) + + +class AtlasSourceBridgeRunnerTests(unittest.TestCase): + def run_until_browser_launch(self, *, explicit_browser=False): + with tempfile.TemporaryDirectory() as raw: + work = Path(raw) + package = work / "python" / "playwright" + package.mkdir(parents=True) + metadata = work / "python" / "playwright-99.0.dist-info" + metadata.mkdir() + (metadata / "METADATA").write_text( + "Metadata-Version: 2.1\nName: playwright\nVersion: 99.0\n" + ) + browser = work / "browser" + browser.write_text("#!/bin/sh\nexit 0\n") + browser.chmod(0o755) + capture = work / "launch.json" + (package / "__init__.py").write_text("") + (package / "sync_api.py").write_text( + textwrap.dedent( + f""" + from pathlib import Path + + def expect(*_args, **_kwargs): + raise AssertionError("expect should not run before launch") + + class Chromium: + def launch(self, **kwargs): + import json + Path({str(capture)!r}).write_text(json.dumps(kwargs, sort_keys=True)) + raise SystemExit(73) + + class Playwright: + chromium = Chromium() + + class Context: + def __enter__(self): + return Playwright() + def __exit__(self, *_args): + return False + + def sync_playwright(): + return Context() + """ + ) + ) + output = work / "output" + env = dict(os.environ) + env["PYTHONPATH"] = os.pathsep.join( + [str(work / "python"), str(ROOT / "tools")] + ) + command = [sys.executable] + if sys.flags.optimize: + command.append("-O") + command.extend( + [ + str(RUNNER), + "--site", + str(ROOT / "docs" / "site"), + "--output", + str(output), + ] + ) + if explicit_browser: + command.extend(["--browser", str(browser)]) + result = subprocess.run( + command, + cwd=ROOT, + env=env, + capture_output=True, + text=True, + check=False, + ) + launch = json.loads(capture.read_text()) if capture.exists() else None + report_path = output / "source-bridge-browser.json" + report = json.loads(report_path.read_text()) if report_path.exists() else None + return result, launch, browser, report + + def test_current_site_reaches_sandboxed_default_chrome_launch(self): + result, launch, _browser, _report = self.run_until_browser_launch() + self.assertEqual(result.returncode, 73, result.stderr) + self.assertEqual( + launch, + { + "args": [ + "--enable-unsafe-swiftshader", + "--disable-background-networking", + ], + "channel": "chrome", + "chromium_sandbox": True, + }, + ) + + def test_explicit_browser_uses_requested_executable(self): + result, launch, browser, _report = self.run_until_browser_launch( + explicit_browser=True + ) + self.assertEqual(result.returncode, 73, result.stderr) + self.assertEqual( + launch, + { + "args": [ + "--enable-unsafe-swiftshader", + "--disable-background-networking", + ], + "chromium_sandbox": True, + "executable_path": str(browser), + }, + ) + + def test_report_records_launch_boundary_before_browser_work(self): + result, _launch, _browser, report = self.run_until_browser_launch() + self.assertEqual(result.returncode, 73, result.stderr) + self.assertEqual( + report["browser_launch"], + { + "args": [ + "--enable-unsafe-swiftshader", + "--disable-background-networking", + ], + "channel": "chrome", + "chromium_sandbox": True, + }, + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_g11_current_atlas_source_bridge_browser_reference.py b/tests/test_g11_current_atlas_source_bridge_browser_reference.py new file mode 100644 index 000000000..b49ad42d7 --- /dev/null +++ b/tests/test_g11_current_atlas_source_bridge_browser_reference.py @@ -0,0 +1,46 @@ +"""Repository integration control for the Atlas source-bridge browser CLI.""" + +import sys +import unittest +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / "tools" / "cbz")) +import g11_census as g11 # noqa: E402 + + +class CurrentAtlasSourceBridgeBrowserReference(unittest.TestCase): + paths = ( + "tools/atlas_source_bridge_browser_check.py", + ".github/workflows/public-shop.yml", + ) + + def census(self, replacements=None): + replacements = replacements or {} + files = { + path: replacements.get(path, (ROOT / path).read_bytes()) + for path in self.paths + } + return g11.census(files, sorted(files))["tools"] + + def test_source_bridge_browser_check_has_static_execution_reference(self): + report = self.census() + self.assertTrue( + report["tools/atlas_source_bridge_browser_check.py"]["referenced"] + ) + + def test_removing_workflow_invocation_is_detected(self): + workflow = (ROOT / self.paths[1]).read_bytes() + command = b"python -B tools/atlas_source_bridge_browser_check.py" + self.assertEqual(workflow.count(command), 1) + report = self.census( + {self.paths[1]: workflow.replace(command, b"python -B")} + ) + self.assertFalse( + report["tools/atlas_source_bridge_browser_check.py"]["referenced"] + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/atlas_formal_evidence_build.py b/tools/atlas_formal_evidence_build.py index f850912db..340df60b7 100644 --- a/tools/atlas_formal_evidence_build.py +++ b/tools/atlas_formal_evidence_build.py @@ -69,13 +69,14 @@ def bind_historical_receipt(receipt, manifest, artifact): def historical_source_identity(root, expected_digest=MANIFEST): """Check exact frozen bytes only; never certify or execute historical code. - The three fixed profiles were already retained as historical evidence. This + The four fixed profiles were already retained as historical evidence. This intentionally cannot accept a freshly refreshed manifest or a current gate contract in place of the historical one. """ require(expected_digest in { MANIFEST, '1a09020f0706abd506824f54fca76df9daa533749350b9ab6b818e0bbe9ed744', + '1c86e1eed110df3ef283f3a6e402194f82f682ba06e55e3ad8fe2010f152df7e', '38eefbfdd84658cd0f6e18bd7d714458a7522b1021f73b1075e7972a63b9bcb0', }, 'unsupported historical manifest profile') root = Path(root).resolve() diff --git a/tools/atlas_formal_source_bridge.py b/tools/atlas_formal_source_bridge.py index a3e56945f..87b3f02bb 100644 --- a/tools/atlas_formal_source_bridge.py +++ b/tools/atlas_formal_source_bridge.py @@ -23,10 +23,14 @@ CURRENT_MANIFEST='1a09020f0706abd506824f54fca76df9daa533749350b9ab6b818e0bbe9ed744' CURRENT_BLOB='8228e896c728d95ab94391899320e9d44ab7cdfc' CURRENT_SOURCE='c1678a556ab487954abbdc2456686bb64ddc7114' +SITE_MANIFEST='1c86e1eed110df3ef283f3a6e402194f82f682ba06e55e3ad8fe2010f152df7e' +SITE_BLOB='8d43188691c695f66e233727322484da22662a58' +SITE_SOURCE='b7deb198722582df191006e4f47238f92e6e543d' CORRECTED_MANIFEST='38eefbfdd84658cd0f6e18bd7d714458a7522b1021f73b1075e7972a63b9bcb0' CORRECTED_BLOB='a22f06a3a7b9ab451e9e344d7b2345d2e2ab0553' CORRECTED_SOURCE='a30e336982ff4a9400182961ae1f8a241ceff927' OLD_BRIDGE='cdb075de1dd63b4313135c166078b71d827d04c882222accc415d8ddf97fa414' +SITE_BRIDGE='8cd6d4bcb48874aa40a3aa1d7e36d113487a43a1608e24fd4023cbb9e0f64299' OLD_MANIFEST='8dfcfe4e9296bca47eede517f37b546ea420ec6b51944b7c16164a906b40e090' OLD_EVIDENCE='441babc5f605492b361822c26d59ebee4126e45b90695915195bf951c3c943ef' OLD_PROJECTION='7b36e2376f4010444108e81f316293ef3b3834d767e0900f68d684c760af2db1' @@ -40,6 +44,7 @@ CONTROLS={'tools/formal_gate_check.py','tests/test_formal_gate.py'} DOCUMENTATION={'formal/README.md','formal/REVIEW_LANE.md'} ANNOTATED_TARGETS={'UniversalLaw.Side24.d3_below_d2','UniversalLaw.Side24.endpoints_in_unit_tenth'} +SITE_METADATA={'meaning'} EVIDENCE_DIR='docs/site/evidence/side24-main-3b39' RECORD='evidence/side24-main-3b39/source-bridge-8228.json' MODULE='atlas-formal-source-bridge-data.mjs' @@ -57,10 +62,15 @@ def evidence_data(raw): def build_bridge(root,snapshot): root=Path(root).resolve() raw=read(root,'formal/manifest.json') - corrected=digest(raw)==CORRECTED_MANIFEST - manifest_sha,manifest_blob,manifest_bytes,source_revision=( - (CORRECTED_MANIFEST,CORRECTED_BLOB,18104,CORRECTED_SOURCE) if corrected else - (CURRENT_MANIFEST,CURRENT_BLOB,17521,CURRENT_SOURCE)) + manifest_sha=digest(raw) + corrected=manifest_sha==CORRECTED_MANIFEST + site=manifest_sha==SITE_MANIFEST + profiles={ + CURRENT_MANIFEST:(CURRENT_BLOB,17521,CURRENT_SOURCE), + SITE_MANIFEST:(SITE_BLOB,17411,SITE_SOURCE), + CORRECTED_MANIFEST:(CORRECTED_BLOB,18104,CORRECTED_SOURCE), + } + manifest_blob,manifest_bytes,source_revision=profiles.get(manifest_sha,(None,None,None)) require(digest(raw)==manifest_sha and blob(raw)==manifest_blob and len(raw)==manifest_bytes, 'unrecognized projection manifest; no bridge inferred') current,_,_=historical_source_identity(root, manifest_sha) @@ -75,10 +85,16 @@ def build_bridge(root,snapshot): require(set(old['files'])==set(current['files']),'formal file inventory changed') changed={path:{'before_sha256':old['files'][path],'after_sha256':current['files'][path]} for path in old['files'] if old['files'][path]!=current['files'][path]} - allowed_changes=CONTROLS|DOCUMENTATION if corrected else CONTROLS + allowed_changes=(CONTROLS|DOCUMENTATION if corrected else + DOCUMENTATION if site else CONTROLS) require(set(changed)==allowed_changes,'unexpected formal source or control delta') normalized={**old,'files':current['files']} annotations={} + metadata={} + if site: + metadata={key:{'before':old[key],'after':current[key]} for key in SITE_METADATA} + for key in SITE_METADATA:normalized[key]=current[key] + require(set(metadata)==SITE_METADATA,'unexpected manifest metadata delta') if corrected: normalized['targets']=[dict(target) for target in old['targets']] for before,after in zip(normalized['targets'],current['targets']): @@ -146,11 +162,15 @@ def build_bridge(root,snapshot): if corrected: result['changed_documentation_files']={path:change for path,change in changed.items() if path in DOCUMENTATION} result['changed_target_annotations']=annotations + elif site: + result['changed_documentation_files']={path:change for path,change in changed.items() if path in DOCUMENTATION} + result['changed_manifest_metadata']=metadata return result def bridge_path(record): - return 'evidence/side24-main-3b39/source-bridge-'+('a22f' if record['projection_manifest']['blob']==CORRECTED_BLOB else '8228')+'.json' + profile={CURRENT_BLOB:'8228',SITE_BLOB:'8d43',CORRECTED_BLOB:'a22f'}[record['projection_manifest']['blob']] + return 'evidence/side24-main-3b39/source-bridge-'+profile+'.json' def whitelist_entry(record,detailed): @@ -160,17 +180,21 @@ def whitelist_entry(record,detailed): record_path=bridge_path(record),record_sha256=digest(detailed.encode())) if 'changed_documentation_files' in record: entry['changed_documentation_file_count']=len(record['changed_documentation_files']) + if 'changed_target_annotations' in record: entry['changed_target_annotation_count']=len(record['changed_target_annotations']) + if 'changed_manifest_metadata' in record: + entry['changed_manifest_metadata_count']=len(record['changed_manifest_metadata']) return entry -def render_bridge(record,previous=None): +def render_bridge(record,previous=()): detailed=json.dumps(record,ensure_ascii=False,indent=2)+'\n' entries=[whitelist_entry(record,detailed)] - if previous is not None: - require(digest(previous)==OLD_BRIDGE,'historical bridge identity differs') - historical=strict_json(previous.decode()) - entries.insert(0,whitelist_entry(historical,previous.decode())) + expected=[OLD_BRIDGE,SITE_BRIDGE] + for index,raw in reversed(list(enumerate(previous))): + require(digest(raw)==expected[index],'historical bridge identity differs') + historical=strict_json(raw.decode()) + entries.insert(0,whitelist_entry(historical,raw.decode())) module=('// Generated by tools/atlas_formal_source_bridge.py; historical execution and alignment remain unchanged.\n' 'export const SOURCE_BRIDGES = '+json.dumps(entries,ensure_ascii=False,indent=2)+';\n') return detailed,module @@ -183,7 +207,11 @@ def main(): parser.add_argument('--check',action='store_true') args=parser.parse_args();root=args.root.resolve() record=build_bridge(root,strict_json(args.snapshot.read_text())) - previous=read(root,'docs/site/'+RECORD) if record['projection_manifest']['blob']==CORRECTED_BLOB else None + previous=[] + if record['projection_manifest']['blob'] in {SITE_BLOB,CORRECTED_BLOB}: + previous.append(read(root,'docs/site/'+RECORD)) + if record['projection_manifest']['blob']==CORRECTED_BLOB: + previous.append(read(root,'docs/site/evidence/side24-main-3b39/source-bridge-8d43.json')) detailed,module=render_bridge(record,previous) for relative,value in [(bridge_path(record),detailed),(MODULE,module)]: target=root/'docs/site'/relative @@ -197,7 +225,8 @@ def main(): print(json.dumps({'source_bridge':record['claim_id'],'current_manifest':record['projection_manifest']['blob'], 'historical_artifact':record['historical_artifact']['commit'], 'identical_formal_files':len(record['identical_formal_files']), - 'changed_controls':2,'scientific_effect':'NONE'})) + 'changed_controls':len(record['changed_control_files']), + 'scientific_effect':'NONE'})) if __name__=='__main__':main() diff --git a/tools/atlas_source_bridge_browser_check.py b/tools/atlas_source_bridge_browser_check.py index bdbfd5871..e415ad25c 100644 --- a/tools/atlas_source_bridge_browser_check.py +++ b/tools/atlas_source_bridge_browser_check.py @@ -19,8 +19,18 @@ NODE='math.side24-coefficient' PROFILES={ - '8228e896c728d95ab94391899320e9d44ab7cdfc':('8228',15,0,0), - 'a22f06a3a7b9ab451e9e344d7b2345d2e2ab0553':('a22f',13,2,2), + '8228e896c728d95ab94391899320e9d44ab7cdfc':{ + 'name':'8228','identical':15,'documentation':0,'annotations':0, + 'controls':2,'metadata':0, + }, + '8d43188691c695f66e233727322484da22662a58':{ + 'name':'8d43','identical':15,'documentation':2,'annotations':0, + 'controls':0,'metadata':1, + }, + 'a22f06a3a7b9ab451e9e344d7b2345d2e2ab0553':{ + 'name':'a22f','identical':13,'documentation':2,'annotations':2, + 'controls':2,'metadata':0, + }, } @@ -28,7 +38,7 @@ def main(): parser=argparse.ArgumentParser(description=__doc__) parser.add_argument('--site',type=Path,required=True) parser.add_argument('--output',type=Path,required=True) - parser.add_argument('--browser',default='/usr/bin/chromium') + parser.add_argument('--browser') parser.add_argument('--base-url',help='Verified public origin; no assertion changes') args=parser.parse_args();site=args.site.resolve();out=args.output.resolve() out.mkdir(parents=True,exist_ok=False) @@ -38,7 +48,7 @@ def main(): mainpin=next(r['commit'] for r in data['repositories'] if r['repository'].endswith('/main')) mathpin=data['graph']['identity']['commit'] manifest=next(s for s in data['sources'] if s['repository']=='d6g8k5htny-coder/main' and s['path']=='formal/manifest.json') - profile,identical_count,documentation_count,annotation_count=PROFILES[manifest['blob']] + profile=PROFILES[manifest['blob']] requests=[] class Handler(SimpleHTTPRequestHandler): def log_message(self,fmt,*values):requests.append({'path':self.path,'message':fmt%values}) @@ -53,11 +63,16 @@ def log_message(self,fmt,*values):requests.append({'path':self.path,'message':fm 'sandbox':True,'webgl':'SwiftShader; real rendering, not physical GPU qualification', 'served_files':{p.relative_to(site).as_posix():identity(p) for p in sorted(site.rglob('*')) if p.is_file()}, 'cases':[]} + launch={'chromium_sandbox':True, + 'args':['--enable-unsafe-swiftshader','--disable-background-networking']} + if args.browser:launch['executable_path']=args.browser + else:launch['channel']='chrome' + if args.base_url:launch['proxy']={'server':'http://proxy:8080'} + report['browser_launch']=launch + (out/'source-bridge-browser.json').write_text(json.dumps(report,indent=2)+'\n') try: with sync_playwright() as pw: - browser=pw.chromium.launch(executable_path=args.browser,chromium_sandbox=True, - proxy={'server':'http://proxy:8080'} if args.base_url else None, - args=['--enable-unsafe-swiftshader','--disable-background-networking']) + browser=pw.chromium.launch(**launch) report['browser']=browser.version for width,scheme in [(1200,'light'),(1200,'dark'),(390,'light'),(390,'dark')]: row={'case':f'{width}-{scheme}','failures':[]};report['cases'].append(row) @@ -79,15 +94,16 @@ def log_message(self,fmt,*values):requests.append({'path':self.path,'message':fm bridge.locator(':scope > summary').focus();page.keyboard.press('Enter') expect(bridge).to_have_attribute('open','') expect(bridge).to_contain_text('historical') - expect(bridge).to_contain_text(str(identical_count)) + expect(bridge).to_contain_text(str(profile['identical'])) bridge_link=bridge.get_by_role('link',name='Verified source bridge (JSON)',exact=True) response=context.request.get(bridge_link.get_attribute('href'));assert response.ok - original=(site/('evidence/side24-main-3b39/source-bridge-'+profile+'.json')).read_bytes() + original=(site/('evidence/side24-main-3b39/source-bridge-'+profile['name']+'.json')).read_bytes() assert response.body()==original - record=json.loads(original);assert len(record['identical_formal_files'])==identical_count - assert len(record.get('changed_documentation_files',{}))==documentation_count - assert len(record.get('changed_target_annotations',{}))==annotation_count - assert set(record['changed_control_files'])=={'tools/formal_gate_check.py','tests/test_formal_gate.py'} + record=json.loads(original);assert len(record['identical_formal_files'])==profile['identical'] + assert len(record.get('changed_documentation_files',{}))==profile['documentation'] + assert len(record.get('changed_target_annotations',{}))==profile['annotations'] + assert len(record['changed_control_files'])==profile['controls'] + assert len(record.get('changed_manifest_metadata',{}))==profile['metadata'] assert record['historical_artifact']['commit']=='3b39c42d6edcc98ae165270be346f0e31c57f81d' row['bridge_record_sha256']=digest(original) receipt=formal.get_by_role('link',name='Original execution receipt (JSON)',exact=True) From 1cc79287cd6455f8f4b3a6aade19d081609b8f2d Mon Sep 17 00:00:00 2001 From: Dylan Roy <249851642+d6g8k5htny-coder@users.noreply.github.com> Date: Sun, 8 Nov 2026 19:42:29 -0600 Subject: [PATCH 2/2] cbz: refresh Atlas asset release pins --- docs/site/atlas-claim-summary.mjs | 2 +- docs/site/atlas-formal-evidence-model.mjs | 2 +- docs/site/atlas-formal-evidence.mjs | 2 +- docs/site/atlas.mjs | 2 +- docs/site/dependencies.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/site/atlas-claim-summary.mjs b/docs/site/atlas-claim-summary.mjs index 738626dd1..e91def495 100644 --- a/docs/site/atlas-claim-summary.mjs +++ b/docs/site/atlas-claim-summary.mjs @@ -1,7 +1,7 @@ import {element,anchor} from './current.mjs?site-release=27f990a4758c48ff2f4aa58b47a842bf61eebc3e0f7449f0dc68f63bc3c502f5'; import {sourceForNode,sourceURL} from './current-model.mjs?site-release=a30d68465e3acda48eedce64854afebc7af5c84903a4e6b0c649e08007b08999'; -import {createFormalEvidence} from './atlas-formal-evidence.mjs?site-release=d02ab2d01c12124f6cf4b5998bb21617c9278fee4c26ff1d0ff1ba784c949171'; +import {createFormalEvidence} from './atlas-formal-evidence.mjs?site-release=9bf2e10b22f60f303372036a18ad38ec7944f30f1e7f0b2fa2f8e7ce6572771c'; // Presentation over the controller's admitted record. No acquisition, source // adoption, proof coverage inference, or scientific-status authority lives here. diff --git a/docs/site/atlas-formal-evidence-model.mjs b/docs/site/atlas-formal-evidence-model.mjs index 37b4ef2a4..cadeb24e1 100644 --- a/docs/site/atlas-formal-evidence-model.mjs +++ b/docs/site/atlas-formal-evidence-model.mjs @@ -1,6 +1,6 @@ import {sourceForNode,sourceURL} from './current-model.mjs?site-release=a30d68465e3acda48eedce64854afebc7af5c84903a4e6b0c649e08007b08999'; import {EVIDENCE} from './atlas-formal-evidence-data.mjs?site-release=1ef5a9f4aa04b860ad8debf6b1981d0485b7bc1d8f0d970095e29ac2fe895d73'; -import {SOURCE_BRIDGES} from './atlas-formal-source-bridge-data.mjs?site-release=5fd9e11803a6233c0cd8142b67d59bbc8f067d0869ff8b3fa499081336a4d20d'; +import {SOURCE_BRIDGES} from './atlas-formal-source-bridge-data.mjs?site-release=3037e2fa64c97d7582432753937782fc2d96fe7f5b325c7feab24266fd4f3c3e'; const canonical=value=>JSON.stringify(value&&typeof value==='object'&&!Array.isArray(value) ?Object.fromEntries(Object.keys(value).sort().map(key=>[key,JSON.parse(canonical(value[key]))])) diff --git a/docs/site/atlas-formal-evidence.mjs b/docs/site/atlas-formal-evidence.mjs index 3e622aac3..255765bb7 100644 --- a/docs/site/atlas-formal-evidence.mjs +++ b/docs/site/atlas-formal-evidence.mjs @@ -1,6 +1,6 @@ import {element,anchor} from './current.mjs?site-release=27f990a4758c48ff2f4aa58b47a842bf61eebc3e0f7449f0dc68f63bc3c502f5'; import {sourceURL} from './current-model.mjs?site-release=a30d68465e3acda48eedce64854afebc7af5c84903a4e6b0c649e08007b08999'; -import {formalConnection} from './atlas-formal-evidence-model.mjs?site-release=7ee50cffa9f23e6772748a65a2d097c6bef2c58c7be92bbd5fd7d4ac4ed5a66d'; +import {formalConnection} from './atlas-formal-evidence-model.mjs?site-release=4efd1b0fdd15b6eeaa5eacaa8f5ed1d9216f387478fc679ef9a12f529d1d7c9f'; const receiptURL=new URL('./evidence/side24-main-3b39/receipt.json',import.meta.url).href; const typesURL=new URL('./evidence/side24-main-3b39/elaborated-types.log',import.meta.url).href; diff --git a/docs/site/atlas.mjs b/docs/site/atlas.mjs index c087f7d52..f5e044c5c 100644 --- a/docs/site/atlas.mjs +++ b/docs/site/atlas.mjs @@ -1,7 +1,7 @@ import {currentSnapshot,element,anchor} from './current.mjs?site-release=27f990a4758c48ff2f4aa58b47a842bf61eebc3e0f7449f0dc68f63bc3c502f5'; 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=4a5f1960262915bbd1bffc9c1d86b2c606c47268cb1fd75c5fc74fc43d5621ca'; -import {createClaimSummary} from './atlas-claim-summary.mjs?site-release=ac837d92886a5837be6e7b5844d02b1471e50e58c185d5fe399f539d9c7e0ad5'; +import {createClaimSummary} from './atlas-claim-summary.mjs?site-release=8e2b2c12d0156d176efffead2fc23556ade761de187f58a65ffa9945fa29b945'; import {createRelationshipSections} from './atlas-relationships.mjs?site-release=a45607775d5c82c86420d6a93b1af9142a2e26ce385e14f298ce873e58d4d835'; import {enableAtlasView,reconcileEquationOptions,createEquationAnnouncement} from './atlas-controls.mjs?site-release=58e7dd9a4fcfc326effc240080bbfac0cadd584908f84047b480fd9dcba522c7'; const byId=id=>document.getElementById(id); diff --git a/docs/site/dependencies.html b/docs/site/dependencies.html index 06ea94ec8..215138c1a 100644 --- a/docs/site/dependencies.html +++ b/docs/site/dependencies.html @@ -16,7 +16,7 @@ - +