From 86d3f42cf5e230324854f7da7ffad6718a1a965c Mon Sep 17 00:00:00 2001 From: MrScripty Date: Thu, 19 Nov 2026 16:00:43 -0700 Subject: [PATCH] ci: remove the remaining per-file source hash pins The owner's rule is no per-file source hash maps or custody files. Lean proofs: drop proofs/source-inventory.json and source-inventory-pr24.json. check_sources.py now checks only the Lean toolchain and mathlib dependency pins; native_sequence.py, build.py and verify_site.py no longer compare proof files or the inventory against recorded digests, and native-sequence.json drops the current inventory digest. lake build, the axiom audit and the audit rejection tests in lean-rheon.yml are unchanged. CG profile: profile_baselines no longer refuses on experiment source or historical result file hashes. The runtime check, the iteration-count check and the full numerical comparison remain. Tests that only asserted the pins are deleted; docs that described the pins are reworded. Historical reports and evidence are left as they were. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/lean-rheon.yml | 2 +- docs/education/ENGINEERING_PLAN.md | 2 +- docs/education/PRESSURE_GAUGE_PLAN.md | 2 +- docs/education/README.md | 2 +- docs/education/TIME_MODE_MILESTONE.md | 2 +- docs/education/build.py | 6 +-- docs/education/native-sequence.json | 2 - docs/education/native_sequence.py | 12 +----- docs/education/test_native_sequence.py | 37 +++---------------- docs/education/verify_site.py | 12 ++---- .../appendices/B-reproduction.md | 2 +- .../chapters/09-liquid-surfaces.md | 2 +- .../chapters/16-formal-contracts.md | 4 +- docs/research-book/companion/README.md | 13 +++---- .../companion/test_verify_results.py | 25 +------------ .../research-book/companion/verify_results.py | 19 +++------- .../cg-reproduction/verify_diagnosis.py | 2 +- .../material-preview-contracts.md | 2 +- docs/validation/cloud-acceptance.md | 2 +- experiments/proofs/check_acceptance.py | 2 - proofs/README.md | 16 ++++---- proofs/scripts/check_sources.py | 11 ++---- proofs/scripts/test_check_sources.py | 17 ++++----- proofs/source-inventory-pr24.json | 12 ------ proofs/source-inventory.json | 24 ------------ 25 files changed, 56 insertions(+), 176 deletions(-) delete mode 100644 proofs/source-inventory-pr24.json delete mode 100644 proofs/source-inventory.json diff --git a/.github/workflows/lean-rheon.yml b/.github/workflows/lean-rheon.yml index e414fa77..e463cf35 100644 --- a/.github/workflows/lean-rheon.yml +++ b/.github/workflows/lean-rheon.yml @@ -39,7 +39,7 @@ jobs: tar -xzf "$RUNNER_TEMP/elan.tar.gz" -C "$RUNNER_TEMP" "$RUNNER_TEMP/elan-init" -y --no-modify-path --default-toolchain none echo "$HOME/.elan/bin" >> "$GITHUB_PATH" - - name: Verify pins and source policy + - name: Verify toolchain and dependency pins run: | python3 scripts/check_sources.py python3 -m unittest discover -s scripts -p 'test_check_sources.py' -v diff --git a/docs/education/ENGINEERING_PLAN.md b/docs/education/ENGINEERING_PLAN.md index 25b901e7..6b388f9d 100644 --- a/docs/education/ENGINEERING_PLAN.md +++ b/docs/education/ENGINEERING_PLAN.md @@ -24,7 +24,7 @@ velocity fields embedded in a unit cube. State the reduced dimension explicitly. geometry, desktop and 390/320px controls, deep links and collapsed proofs. 3. Add exact-real Lean statements for shared incidence cancellation, two-cell boundary work, the periodic checkerboard witness and affine strain power. - Review assumptions, extend the explicit audit and source inventory; require + Review assumptions, extend the explicit audit; require a fresh pinned kernel build. Prior proof receipts stay historical. 4. Update chapters 4/8/22, a research dossier and the coverage ledger. Run book, math/link/PDF, reference, source-policy and hosted UI/Lean checks. Review the diff --git a/docs/education/PRESSURE_GAUGE_PLAN.md b/docs/education/PRESSURE_GAUGE_PLAN.md index 2513fe3a..e4b6e59c 100644 --- a/docs/education/PRESSURE_GAUGE_PLAN.md +++ b/docs/education/PRESSURE_GAUGE_PLAN.md @@ -26,7 +26,7 @@ mesh reader, main merge or deployment changes belong to this slice. 3. Prove finite exact-real component cancellation, gauge invariance, compatibility, fixed-cell residual counterexamples and pressure-work shift identities in Lean. State positive/nonzero assumptions and geometric limits. Extend the explicit - axiom audit and proof inventory; preserve prior qualification as historical. + axiom audit; preserve prior qualification as historical. 4. Validate all finite controls with an independent rational oracle, mutation counterexamples, desktop/390px/320px actual rendering, scroll/deep-link presets, controls and collapsed proof checks. Run book/PDF/links and pinned Lean CI. diff --git a/docs/education/README.md b/docs/education/README.md index 91e1af7c..d087e844 100644 --- a/docs/education/README.md +++ b/docs/education/README.md @@ -218,7 +218,7 @@ The illustrated `Rheon-expanded-markdown.zip` includes companion figures, implem ## Proof and implementation boundaries -`proofs/source-inventory-pr24.json` preserves the accepted PR24 kernel proof bytes: 57 public theorems and 77 audited declarations. The historical reconstruction at `f75cd66` included AlignedStrain. Its fresh pinned normal `lake build`, allowed-axiom audit and rejection/source-policy probes checked 106 public theorem statements, 144 explicitly expected declarations and 161 audited declarations. `native-sequence.json` binds the immutable reconstruction source and local qualification receipt, and links the associated hosted Lean run without asserting its checkout identity. Earlier source qualifications and recorded native packet identities remain historical. The book builder checks current bytes; it does not rerun Lean or prove assembly, IEEE arithmetic, transient reference evaluation or global solver convergence. +The accepted PR24 kernel proof bytes (57 public theorems and 77 audited declarations) remain in Git history. The historical reconstruction at `f75cd66` included AlignedStrain. Its fresh pinned normal `lake build`, allowed-axiom audit and rejection/source-policy probes checked 106 public theorem statements, 144 explicitly expected declarations and 161 audited declarations. `native-sequence.json` binds the immutable reconstruction source and local qualification receipt, and links the associated hosted Lean run without asserting its checkout identity. Earlier source qualifications and recorded native packet identities remain historical. The book builder checks the recorded proof status and counts, not Lean source hashes; it does not rerun Lean or prove assembly, IEEE arithmetic, transient reference evaluation or global solver convergence. The expansion's older 42-public/60-audit receipt remains explicitly historical. Its exact-real finite-strain and planar-contact contracts retain their assumptions. The original Python reference source/data receipts are checked before building. Source-only/data-only changes, stale PDF/browser inputs, missing assets, broken controls and page errors reject publication. diff --git a/docs/education/TIME_MODE_MILESTONE.md b/docs/education/TIME_MODE_MILESTONE.md index 953f9021..548977af 100644 --- a/docs/education/TIME_MODE_MILESTONE.md +++ b/docs/education/TIME_MODE_MILESTONE.md @@ -29,7 +29,7 @@ The analytic shear ansatz removes advection and spatial discretization from the comparison. Lean proves only exact scalar amplification contracts, not the PDE, trigonometric integration, continuum convergence, execution or floating point. -Current source inventory status is in `native-sequence.json`. Updating hashes +Current proof status is in `native-sequence.json`. Editing that record never promotes a pending kernel check. PR44's exact-source receipt is historical. The new source changes no Cargo.lock/native admission binding and uses no absent native packet as substitute data. Local Lean bootstrap and sandboxed Chromium diff --git a/docs/education/build.py b/docs/education/build.py index 96ec934d..e855c816 100644 --- a/docs/education/build.py +++ b/docs/education/build.py @@ -162,10 +162,10 @@ def shell(title,body,prefix='',extra='',reader=False): (OUT/'flow-lab.html').write_text(shell('Computed 3D flow',teaching.flow_tour(),extra=teaching.scripts(),reader=True)) (OUT/'timestep-lab.html').write_text(shell('One Rust timestep',teaching.timestep_tour(),extra=teaching.scripts(),reader=True)) receipt=json.loads(qualification.read_text()) if qualification.exists() else {'status':'pending','reason':'Pinned project build and axiom audit must complete.'} - proofs='

CHECK THE HYPOTHESES

Proofs & evidence

Finite exact algebra, local numerical references and production implementation are distinct evidence levels. The proof inventory does not verify mesh assembly, a liquid solver or floating-point behavior.

Historical expansion qualification receipt
'+html.escape(json.dumps(receipt,indent=2))+'

Full contract map and primary sources →

' + proofs='

CHECK THE HYPOTHESES

Proofs & evidence

Finite exact algebra, local numerical references and production implementation are distinct evidence levels. The proofs do not verify mesh assembly, a liquid solver or floating-point behavior.

Historical expansion qualification receipt
'+html.escape(json.dumps(receipt,indent=2))+'

Full contract map and primary sources →

' historical = sequence['current_reconstruction_proof'] current = sequence['current_reviewed_proof'] - proofs+=f'

Reviewed proof source

The current inventory contains {sequence["public_theorems"]} public theorem statements and {sequence["explicit_expected_declarations"]} explicitly expected declarations. Current bytes match that reviewed inventory. Qualification status: {html.escape(current["status"])}. This build checks source bindings; it does not rerun Lean or prove Rust assembly, IEEE arithmetic, approximate pressure solves, global convergence, scheduling fairness or performance.

' + proofs+=f'

Reviewed proof source

The current proofs contain {sequence["public_theorems"]} public theorem statements and {sequence["explicit_expected_declarations"]} explicitly expected declarations. Qualification status: {html.escape(current["status"])}. The Lean workflow builds and audits the proofs; this book build does not rerun Lean or prove Rust assembly, IEEE arithmetic, approximate pressure solves, global convergence, scheduling fairness or performance.

' if current.get('lean_ci'): proofs+=f'

Current source Lean qualification

' proofs+=f'
Historical reconstruction: {historical["public_theorems"]} public theorems, {historical["audited_declarations"]} audited declarations

The pinned reconstruction passed its normal lake build, allowed-axiom audit and rejection/source-policy probes. Those counts and receipts apply to its recorded source. Earlier PR24 57/77 qualification and recorded native lab identities remain historical.

Associated reconstruction Lean CI · Source identities, receipts and historical bindings

' @@ -209,7 +209,7 @@ def root_link(match): contents=cover+'
'+toc+'
'+''.join(f'
{print_body(p)}
' for p in reading) (OUT/'print.html').write_text(f'Rheon — Expanded research edition{contents}') if OUT==HERE/'_site' and (HERE/'downloads/Rheon-expanded-book.pdf').exists():shutil.copy2(HERE/'downloads/Rheon-expanded-book.pdf',OUT/'downloads/Rheon-expanded-book.pdf') - build_receipt={'schema':'rheon-education-build-v1','chapters':len(chapter_files),'implementation_guides':len(files)-len(chapter_files),'native_bundles_included':NATIVE_LABS is not None,'obstacle_records_included':OBSTACLE_RECORDS is not None,'obstacle_flow_records_included':FLOW_RECORDS is not None,'aligned_strain_packet_included':STRAIN_RECORDS is not None,'compressible_records_included':COMPRESSIBLE_RECORDS is not None,'solver_packet_included':SOLVER_PACKET is not None,'proof_inventory_sha256':sequence['proof_inventory_sha256'],'rendered_math_expressions':rendered['count'],'sources':manifest,'linked_source_files':linked_sources,'reference_data_sha256':hashlib.sha256((OUT/'reference-data.json').read_bytes()).hexdigest(),'pandoc':command(['pandoc','--version']).splitlines()[0],'source_base':source_base,'historical_proof_status':receipt.get('status'),'current_proof_status':'reviewed-current-source-inventory-matched'} + build_receipt={'schema':'rheon-education-build-v1','chapters':len(chapter_files),'implementation_guides':len(files)-len(chapter_files),'native_bundles_included':NATIVE_LABS is not None,'obstacle_records_included':OBSTACLE_RECORDS is not None,'obstacle_flow_records_included':FLOW_RECORDS is not None,'aligned_strain_packet_included':STRAIN_RECORDS is not None,'compressible_records_included':COMPRESSIBLE_RECORDS is not None,'solver_packet_included':SOLVER_PACKET is not None,'rendered_math_expressions':rendered['count'],'sources':manifest,'linked_source_files':linked_sources,'reference_data_sha256':hashlib.sha256((OUT/'reference-data.json').read_bytes()).hexdigest(),'pandoc':command(['pandoc','--version']).splitlines()[0],'source_base':source_base,'historical_proof_status':receipt.get('status'),'current_proof_status':sequence['current_reviewed_proof']['status']} if input_hashes(ROOT)!=pdf_inputs:raise RuntimeError('PDF inputs changed during HTML build; rebuild.') build_receipt['pdf_inputs']=pdf_inputs (OUT/'build-receipt.json').write_text(json.dumps(build_receipt,indent=2)+'\n');print(json.dumps({k:v for k,v in build_receipt.items() if k not in ['sources','pdf_inputs']},indent=2)) diff --git a/docs/education/native-sequence.json b/docs/education/native-sequence.json index 956a1980..657f889a 100644 --- a/docs/education/native-sequence.json +++ b/docs/education/native-sequence.json @@ -2,7 +2,6 @@ "schema": "rheon-native-sequence-source-v2", "scope": "Recorded native fixed-slab progression; no automatic integration or general fluid claim", "qualified_lean_source": "1be45f33d52c5e354fccb4080413c1d57f8502be; proof tree identical to checked merge d427059b16848adbf7e00f30e0e76ac24c021e50", - "proof_inventory_sha256": "4eaa150ae0513844e95da153535b7d23befc048bb6e07adec3ed26eee6bc8a1d", "public_theorems": 224, "audited_declarations": 355, "lean_ci": "https://github.com/MrScripty/Rheon/actions/runs/38493519897", @@ -131,7 +130,6 @@ "scope": "Fixed finite-row real matrices, nonnegative weights, positive masses and the stated exact Euler/projection premises. Geometry assembly, IEEE refinement, approximate pressure solves and global/continuum convergence remain outside the proofs." }, "current_reviewed_proof": { - "proof_inventory_sha256": "4eaa150ae0513844e95da153535b7d23befc048bb6e07adec3ed26eee6bc8a1d", "public_theorems": 224, "explicit_expected_declarations": 295, "audited_declarations": 355, diff --git a/docs/education/native_sequence.py b/docs/education/native_sequence.py index 3ef81910..87af6fae 100644 --- a/docs/education/native_sequence.py +++ b/docs/education/native_sequence.py @@ -8,19 +8,13 @@ def metadata(repo): repo = Path(repo) data = json.loads((repo/'docs/education/native-sequence.json').read_text()) - pins = repo/'proofs/source-inventory.json' - if hashlib.sha256(pins.read_bytes()).hexdigest() != data['proof_inventory_sha256']: - raise ValueError('Current Lean inventory differs from reviewed current source; requalify.') - for name, digest in json.loads(pins.read_text()).items(): - if hashlib.sha256((repo/'proofs'/name).read_bytes()).hexdigest() != digest: - raise ValueError('Current Lean source differs from its inventory: '+name) if data.get('schema') != 'rheon-native-sequence-source-v2': raise ValueError('Unsupported proof metadata schema; current status required') if data.get('schema') == 'rheon-native-sequence-source-v2': current = data.get('current_reviewed_proof') if not isinstance(current, dict): raise ValueError('Missing current reviewed proof status') - for key in ('proof_inventory_sha256', 'public_theorems', + for key in ('public_theorems', 'explicit_expected_declarations', 'audited_declarations', 'lean_ci'): if key not in current or current[key] != data.get(key): raise ValueError('Current reviewed proof metadata mismatch: '+key) @@ -35,10 +29,6 @@ def metadata(repo): raise ValueError('Passed proof status requires explicit qualification evidence') else: raise ValueError('Unknown current reviewed proof status') - if 'historical_native_proof' in data: - historical=repo/'proofs/source-inventory-pr24.json' - if hashlib.sha256(historical.read_bytes()).hexdigest()!=data['historical_native_proof']['proof_inventory_sha256']: - raise ValueError('Historical PR24 source inventory changed') return data def validate_labs(data, directory): diff --git a/docs/education/test_native_sequence.py b/docs/education/test_native_sequence.py index e1f0aafa..a42fbb37 100644 --- a/docs/education/test_native_sequence.py +++ b/docs/education/test_native_sequence.py @@ -4,12 +4,6 @@ from native_sequence import metadata,publish,validate_labs from unittest.mock import patch -def pending_metadata(digest): - current={'proof_inventory_sha256':digest,'public_theorems':0, - 'explicit_expected_declarations':0,'audited_declarations':None,'lean_ci':None, - 'status':'reviewed-pending-kernel-qualification'} - return dict(current,schema='rheon-native-sequence-source-v2',current_reviewed_proof=current) - class NativeSequence(unittest.TestCase): def setUp(self): self.tmp=tempfile.TemporaryDirectory();self.addCleanup(self.tmp.cleanup) @@ -37,41 +31,22 @@ def test_derived_playback_notice_preserves_original_records(self): self.assertIn('Snapshot playback',(self.output/'native-labs/wall-friction/index.html').read_text()) self.assertEqual((self.output/'native-labs/wall-friction/case.csv').read_bytes(),before['case.csv']) self.assertEqual({p.name:p.read_bytes() for p in (self.input/'wall-friction').iterdir()},before) - def test_stale_lean_bytes_cannot_reuse_accepted_inventory(self): - repo=self.root/'repo';proof=repo/'proofs';proof.mkdir(parents=True);src=proof/'A.lean';src.write_text('checked source') - pins=proof/'source-inventory.json';pins.write_text(json.dumps({'A.lean':hashlib.sha256(src.read_bytes()).hexdigest()})) - here=repo/'docs/education';here.mkdir(parents=True);(here/'native-sequence.json').write_text(json.dumps(pending_metadata(hashlib.sha256(pins.read_bytes()).hexdigest()))) - metadata(repo);src.write_text('unreviewed source') - with self.assertRaisesRegex(ValueError,'Lean source'):metadata(repo) - def test_changed_inventory_bytes_require_requalification(self): - repo=self.root/'repo';proof=repo/'proofs';proof.mkdir(parents=True) - src=proof/'A.lean';src.write_text('checked source') - inventory={'A.lean':hashlib.sha256(src.read_bytes()).hexdigest()} - pins=proof/'source-inventory.json';pins.write_text(json.dumps(inventory)) - here=repo/'docs/education';here.mkdir(parents=True) - (here/'native-sequence.json').write_text(json.dumps(pending_metadata(hashlib.sha256(pins.read_bytes()).hexdigest()))) - metadata(repo) - # Identical entries with different inventory bytes still need review. - pins.write_text(json.dumps(inventory,indent=2)+'\n') - with self.assertRaisesRegex(ValueError,'Current Lean inventory differs'): - metadata(repo) def test_repository_metadata_admits_current_reviewed_proofs(self): repo=Path(__file__).resolve().parents[2] data=metadata(repo) current=data.get('current_reviewed_proof',data['current_reconstruction_proof']) - for key in ('proof_inventory_sha256','public_theorems', + for key in ('public_theorems', 'audited_declarations','explicit_expected_declarations','lean_ci'): self.assertEqual(data[key],current[key]) - pins=json.loads((repo/'proofs/source-inventory.json').read_text()) - self.assertIn('Rheon/AlignedStrain.lean',pins) - theorem_count=sum(len(re.findall(r'^theorem ', - (repo/'proofs'/name).read_text(),re.M)) - for name in pins if name.startswith('Rheon/')) + sources=sorted((repo/'proofs/Rheon').rglob('*.lean')) + self.assertIn(repo/'proofs/Rheon/AlignedStrain.lean',sources) + theorem_count=sum(len(re.findall(r'^theorem ',path.read_text(),re.M)) + for path in sources) self.assertEqual(data['public_theorems'],theorem_count) audit=(repo/'proofs/AxiomAudit.lean').read_text() expected=re.search(r'let expected : Array Name := #\[(.*?)\]',audit,re.S).group(1) self.assertEqual(data['explicit_expected_declarations'],len(re.findall(r'`Rheon\.',expected))) - # A source inventory cannot itself turn a pending kernel check into a pass. + # Recorded metadata cannot itself turn a pending kernel check into a pass. self.assertIn(current['status'], ('reviewed-pending-kernel-qualification', 'passed')) if current['status'] == 'passed': self.assertIsInstance(current['audited_declarations'], int) diff --git a/docs/education/verify_site.py b/docs/education/verify_site.py index c0f16973..1f0e745d 100644 --- a/docs/education/verify_site.py +++ b/docs/education/verify_site.py @@ -70,14 +70,10 @@ def links(node): print('PASS',receipt['chapters'],'sections,',receipt['rendered_math_expressions'],'math expressions,',count,'local asset/link targets') assert receipt["historical_proof_status"]=="checked" -assert receipt["current_proof_status"]=="reviewed-current-source-inventory-matched" -proof=json.loads((ROOT/"proof-qualification.json").read_text()) -repo=Path(__file__).resolve().parents[2] -pins=json.loads((repo/"proofs/source-inventory.json").read_text()) sequence=json.loads((ROOT/"native-sequence.json").read_text()) -assert hashlib.sha256((repo/"proofs/source-inventory.json").read_bytes()).hexdigest()==sequence["proof_inventory_sha256"] -for name,digest in pins.items(): - assert hashlib.sha256((repo/"proofs"/name).read_bytes()).hexdigest()==digest,name +# Earlier archived editions recorded the removed source-inventory status string. +assert receipt["current_proof_status"] in (sequence["current_reviewed_proof"]["status"],"reviewed-current-source-inventory-matched") +proof=json.loads((ROOT/"proof-qualification.json").read_text()) for name,digest in receipt['linked_source_files'].items(): assert hashlib.sha256((ROOT/'source-files'/name).read_bytes()).hexdigest()==digest,name -print("PASS current proof bytes match the reviewed source inventory; historical kernel receipt remains separate") +print("PASS current proof status and linked source files match the build receipt; historical kernel receipt remains separate") diff --git a/docs/research-book/appendices/B-reproduction.md b/docs/research-book/appendices/B-reproduction.md index 60217b94..69046a9d 100644 --- a/docs/research-book/appendices/B-reproduction.md +++ b/docs/research-book/appendices/B-reproduction.md @@ -44,7 +44,7 @@ lake env lean AxiomAudit.lean python3 scripts/test_audit.py ~~~ -Inventory digests are reviewed, not regenerated in CI. Changed statements require mathematical review, inventory updates and full qualification. A digest establishes source identity, not truth. +`check_sources.py` checks the toolchain and dependency pins; Lean source files are not pinned by hash. Changed statements require mathematical review and a fresh build and audit. The first successful qualification is [workflow run 37141752646](https://github.com/MrScripty/Rheon/actions/runs/37141752646), associated with source head ecf97d3a943ebe30d20acc1cf01b94dc08ff96a2. The runner checked the pull-request merge ref against then-current main. The retained log records actual checkout and all proof/audit stages. Later proof changes require new qualification. diff --git a/docs/research-book/chapters/09-liquid-surfaces.md b/docs/research-book/chapters/09-liquid-surfaces.md index 01621ec9..a12cb5af 100644 --- a/docs/research-book/chapters/09-liquid-surfaces.md +++ b/docs/research-book/chapters/09-liquid-surfaces.md @@ -153,7 +153,7 @@ show clamping's 0.2 m³ volume creation. These statements do not prove that JavaScript implements the geometry, that IEEE arithmetic is exact, or that the native liquid algorithm converges. The -source inventory and kernel qualification status are recorded separately in +kernel qualification status is recorded separately in the [coverage ledger](../../education/COVERAGE.md); numerical comparisons and browser control checks supply different evidence. Proof text is collapsed by default in the interactive chapter. diff --git a/docs/research-book/chapters/16-formal-contracts.md b/docs/research-book/chapters/16-formal-contracts.md index 1e29b342..dcfb849c 100644 --- a/docs/research-book/chapters/16-formal-contracts.md +++ b/docs/research-book/chapters/16-formal-contracts.md @@ -2,7 +2,7 @@ The foundation has 20 public theorems in three modules; the expanded edition adds thirteen in Physics.lean and nine in BoundedPhysics.lean, for 42 public theorems in five modules. The bounded module also defines six helpers; its fifteen audited declarations are not fifteen theorems. Lean 4.19.0 and mathlib revision c44e0c8ee63ca166450922a373c7409c5d26b00b are pinned, with locked transitive revisions. Hosted qualification at source head ecf97d3a943ebe30d20acc1cf01b94dc08ff96a2 compiled all modules and audited 31 declarations including generated equation and proof declarations. -Only propext, Classical.choice and Quot.sound are allowed transitive axioms. Custom assumptions, admitted proofs and native-evaluation assumptions are rejected. Negative tests inject a custom axiom and an admitted theorem and verify rejection. An exact reviewed source inventory requires review when the file surface changes. It is change control; Lean's kernel does the proof check. +Only propext, Classical.choice and Quot.sound are allowed transitive axioms. Custom assumptions, admitted proofs and native-evaluation assumptions are rejected. Negative tests inject a custom axiom and an admitted theorem and verify rejection. Changed proof files go through ordinary code review; Lean's kernel does the proof check. ## Discrete operator inventory @@ -41,7 +41,7 @@ The expansion qualification and all new assumptions are recorded separately in A The counts and revision identities above describe retained historical qualifications. They do not automatically include modules added for the current material preview or adaptive CPU scheduler. Each extension needs its -own reviewed source inventory, normal pinned Lean build and allowed-axiom +own review, normal pinned Lean build and allowed-axiom audit. A linked theorem statement, a native regression test and a fresh qualification receipt answer different questions. diff --git a/docs/research-book/companion/README.md b/docs/research-book/companion/README.md index bb82d50f..689e7945 100644 --- a/docs/research-book/companion/README.md +++ b/docs/research-book/companion/README.md @@ -46,13 +46,12 @@ threadpoolctl 3.6.0 dependency verifies the loaded libraries rather than trustin the environment variable alone. Different or missing runtime identities fail. The archived `reproduction/haswell-openblas-0.3.30.json` contains a separately recorded CG -history, not a replacement for `results.json`. Before using it, the comparator -requires exact SHA256 matches for both preserved historical files and both -experiment sources. Only `projection.histories.cg` selects the qualified replay -history; the iteration count, every other numerical field, shapes and keys keep -their original checks and tolerances. Changed sources or historical evidence -require explicit profile review and requalification. There is no automatic -fallback to whichever profile happens to pass, and CI never regenerates profiles. +history, not a replacement for `results.json`. Only `projection.histories.cg` +selects the qualified replay history; the iteration count, every other numerical +field, shapes and keys keep their original checks and tolerances, so a changed +experiment fails on the numbers it produces. The comparator does not pin the +experiment source files by hash. There is no automatic fallback to whichever +profile happens to pass, and CI never regenerates profiles. See [the diagnosis and retained experiments](../evidence/cg-reproduction/README.md) for the exact failed CI value, CPU-kernel isolation, direct-solve comparison, diff --git a/docs/research-book/companion/test_verify_results.py b/docs/research-book/companion/test_verify_results.py index 2bc402f5..5c8eac06 100644 --- a/docs/research-book/companion/test_verify_results.py +++ b/docs/research-book/companion/test_verify_results.py @@ -3,11 +3,8 @@ import unittest import copy import json -from pathlib import Path -import shutil -import tempfile from unittest import mock -from verify_results import compare, profile_baselines, check_profile_runtime, COMPANION, CG_PROFILE +from verify_results import compare, profile_baselines, check_profile_runtime, CG_PROFILE from historical_baselines import historical_baselines @@ -67,26 +64,6 @@ def test_profile_still_rejects_changed_history_and_other_numerical_fields(self): else: actual['projection']['energy_after']*=1.01 with self.assertRaises(ValueError): compare(expected,actual) - def test_changed_historical_fixture_is_rejected_before_profile_substitution(self): - with tempfile.TemporaryDirectory() as root: - root=Path(root) - for name in ('results.json','depth-results.json'): - shutil.copyfile(self.baseline/name,root/name) - # Even whitespace changes require explicit historical-evidence review. - with (root/'results.json').open('a',encoding='utf-8') as f: f.write('\n') - with self.assertRaisesRegex(ValueError,'historical evidence changed'): - profile_baselines(root,self.profile) - - def test_changed_experiment_requires_requalification(self): - with tempfile.TemporaryDirectory() as root: - root=Path(root) - for name in self.profile['source_sha256']: - shutil.copyfile(COMPANION/name,root/name) - with (root/'experiments.py').open('a',encoding='utf-8') as f: f.write('\n') - with mock.patch('verify_results.COMPANION',root): - with self.assertRaisesRegex(ValueError,'source changed'): - profile_baselines(self.baseline,self.profile) - def test_changed_profile_iteration_count_is_rejected(self): self.profile['cg_history'].pop() with self.assertRaisesRegex(ValueError,'iteration count'): diff --git a/docs/research-book/companion/verify_results.py b/docs/research-book/companion/verify_results.py index a39d338e..d5d86976 100644 --- a/docs/research-book/companion/verify_results.py +++ b/docs/research-book/companion/verify_results.py @@ -6,11 +6,10 @@ 1e-8 and absolute 1e-12 error; these are evidence-reproduction tolerances, not solver stopping thresholds or permissions to relax fixture assertions. An explicitly selected backend profile supplies only a separately qualified CG -history after checking historical fixture/source hashes and the loaded runtime. +history after checking the loaded runtime and the historical iteration count. """ from __future__ import annotations import argparse -import hashlib import json import math import sys @@ -20,7 +19,6 @@ RELATIVE_TOLERANCE = 1e-8 ABSOLUTE_TOLERANCE = 1e-12 RESULT_FILES = ("results.json", "depth-results.json") -COMPANION = Path(__file__).resolve().parent CG_PROFILE = "haswell-openblas-0.3.30" @@ -45,16 +43,9 @@ def check_profile_runtime(runtime: dict) -> None: def profile_baselines(baseline_dir: Path, profile: dict) -> dict: - """Keep historical evidence immutable; replace only the qualified CG trace.""" - for name, digest in profile["source_sha256"].items(): - if hashlib.sha256((COMPANION / name).read_bytes()).hexdigest() != digest: - raise ValueError(f"{name}: source changed; CG profile requires requalification") - baselines = {} - for name in RESULT_FILES: - raw = (baseline_dir / name).read_bytes() - if hashlib.sha256(raw).hexdigest() != profile["historical_sha256"][name]: - raise ValueError(f"{name}: historical evidence changed; CG profile requires review") - baselines[name] = json.loads(raw) + """Load the historical results and replace only the qualified CG trace.""" + baselines = {name: json.loads((baseline_dir / name).read_text(encoding="utf-8")) + for name in RESULT_FILES} projection = baselines["results.json"]["projection"] history = profile["cg_history"] if len(history) != len(projection["histories"]["cg"]) or len(history) != projection["cg_iterations"]: @@ -93,7 +84,7 @@ def main() -> None: parser.add_argument("--baseline-dir", required=True, type=Path) parser.add_argument("--actual-dir", type=Path, default=Path(__file__).resolve().parent) parser.add_argument("--cg-profile", choices=[CG_PROFILE], - help="Explicit backend-qualified CG history; historical fixtures stay hash-locked") + help="Explicit backend-qualified CG history; every other field is compared unchanged") args = parser.parse_args() baselines = None if args.cg_profile: diff --git a/docs/research-book/evidence/cg-reproduction/verify_diagnosis.py b/docs/research-book/evidence/cg-reproduction/verify_diagnosis.py index 7c397b93..89d05c1b 100644 --- a/docs/research-book/evidence/cg-reproduction/verify_diagnosis.py +++ b/docs/research-book/evidence/cg-reproduction/verify_diagnosis.py @@ -39,4 +39,4 @@ assert oracle['corrected_divergence_l2'] < 1e-7 assert oracle['pressure_relative_l2_difference_from_direct'] < 1e-11 print(f'PASS {kernel}: exact input identity, thread-repeat bytes, original non-history tolerances, direct-solve and residual diagnostics') -print('PASS historical fixture/source hashes, original SkylakeX replay and explicit Haswell profile') +print('PASS original SkylakeX replay and explicit Haswell profile') diff --git a/docs/research-book/implementation/material-preview-contracts.md b/docs/research-book/implementation/material-preview-contracts.md index 2427d571..efbcd45f 100644 --- a/docs/research-book/implementation/material-preview-contracts.md +++ b/docs/research-book/implementation/material-preview-contracts.md @@ -228,7 +228,7 @@ at distances below \(10^{-10}h\). Those hypotheses must remain visible when interpreting a successful finite-difference comparison. Source statements are not a proof-run receipt. Publication must bind these -modules to the current reviewed source inventory, pinned normal Lean build and +modules to a reviewed source commit, pinned normal Lean build and allowed-axiom audit. Native execution tests separately connect the code to independent equations and exercise ownership failures. Neither evidence layer establishes a physically calibrated multiphase solver, full-scene convergence, diff --git a/docs/validation/cloud-acceptance.md b/docs/validation/cloud-acceptance.md index afbd74b1..be27d3e5 100644 --- a/docs/validation/cloud-acceptance.md +++ b/docs/validation/cloud-acceptance.md @@ -67,7 +67,7 @@ fields, nonfinite metrics, incomplete trajectories, excessive divergence and inc Replay fingerprint is a regression diagnostic (64-bit collision risk), not a mathematical proof; native contract tests provide separate field/report assertions. -`proofs/scripts/check_sources.py` verifies exact reviewed Lean source inventory and pins only. This run +`proofs/scripts/check_sources.py` verifies the Lean toolchain and dependency pins only. This run does not rebuild Lean or rerun the kernel axiom audit. Existing exact finite-real theorems do not certify Rust/IEEE refinement, geometry assembly, solver convergence, continuum correctness or performance. See `proofs/README.md` for the actual theorem hypotheses and historical source-bound qualification. diff --git a/experiments/proofs/check_acceptance.py b/experiments/proofs/check_acceptance.py index bc87b52e..a62993e9 100644 --- a/experiments/proofs/check_acceptance.py +++ b/experiments/proofs/check_acceptance.py @@ -213,8 +213,6 @@ def main(): "allowed_axioms": ["propext", "Classical.choice", "Quot.sound"], "sha256": {path.name: hashlib.sha256(path.read_bytes()).hexdigest() for path in [SOURCE, AUDIT, Path(__file__).resolve()]}, - "original_inventory_sha256": hashlib.sha256( - (PROOFS / "source-inventory.json").read_bytes()).hexdigest(), "python_optimization": sys.flags.optimize, "negative_kernel_probes_passed": len(probes), "scope": "conditional exact-real contracts; enclosure containment is a premise", diff --git a/proofs/README.md b/proofs/README.md index 99a43cda..43a864eb 100644 --- a/proofs/README.md +++ b/proofs/README.md @@ -12,7 +12,7 @@ Use the exact lean-toolchain and lake-manifest.json. From this directory run: lake env lean AxiomAudit.lean python3 scripts/test_audit.py -The source inventory records reviewed bytes. Do not regenerate it in CI. Review changed statements and the audit inventory before updating digests. The kernel audit allows only propext, Classical.choice and Quot.sound. It rejects admitted and custom assumptions; negative fixtures verify both rejection paths. Native-evaluation axioms are outside the allowlist. +`check_sources.py` checks only the Lean toolchain and mathlib dependency pins; Lean source files are not pinned by hash. Review changed statements and the expected-declaration list in `AxiomAudit.lean`, then rerun the build and audit. The kernel audit allows only propext, Classical.choice and Quot.sound. It rejects admitted and custom assumptions; negative fixtures verify both rejection paths. Native-evaluation axioms are outside the allowlist. ## Qualified evidence @@ -44,9 +44,8 @@ for overlap, volume complement, shared incidence, component-constant jumps and residual/divergence scaling. The complete geometry-stage source locally compiled with pinned Lean 4.19.0: 64 public theorems, 87 audited declarations and the unchanged allowlist. Three actual negative audit probes reject custom axioms, sorry and a -missing expected declaration. `source-inventory.json` records current reviewed -bytes; `source-inventory-pr24.json` preserves the earlier accepted 57/77 source. -The PR24 CI receipt does not qualify this new module. Rust mesh admission, +missing expected declaration. The earlier accepted 57/77 PR24 source remains in +Git history. The PR24 CI receipt does not qualify this new module. Rust mesh admission, binary64 arithmetic, component construction and obstacle solver refinement remain outside these statements. @@ -63,8 +62,9 @@ missing expected declaration in both normal and optimized Python. The four source/pin-gate tests also pass in both modes. No `sorry`, custom axioms or native-evaluation axioms are accepted. -The current reviewed `source-inventory.json` SHA256 is -`d33f1ee1614084b5fce8d6d4a93ed7f539b07c9bea2e14c563618f3720064c61`. +At that time the reviewed source-inventory SHA256 was +`d33f1ee1614084b5fce8d6d4a93ed7f539b07c9bea2e14c563618f3720064c61`; the +inventory file has since been removed. This qualification used the pinned compiler directly with a private artifact search path: existing pinned dependency artifacts were read-only, 205 missing imports were compiled from their pinned sources, and all current Rheon modules @@ -182,8 +182,8 @@ All statements concern finite exact real arithmetic. Mesh and face assembly, Riemann solvers, reconstruction and limiters, floating-point refinement, entropy stability, shock solutions, viscous/thermal boundaries, reacting or multiphase equations of state and continuum convergence remain outside these -proofs. The root import, twenty-name expected audit extension and current -reviewed source inventory keep the existing axiom allowlist and source gate. +proofs. The root import and twenty-name expected audit extension keep the +existing axiom allowlist. The following local receipt belongs to PR68's earlier 116-statement inventory, not the combined inventory. The combined source retains all PR67 modules and diff --git a/proofs/scripts/check_sources.py b/proofs/scripts/check_sources.py index a33a982f..a0480ba8 100644 --- a/proofs/scripts/check_sources.py +++ b/proofs/scripts/check_sources.py @@ -1,15 +1,10 @@ -"""Pin and exact-source inventory gate. Kernel/axiom audit is separate.""" +"""Lean toolchain and dependency pin gate. Kernel/axiom audit is separate.""" from pathlib import Path -import hashlib,json,re,tomllib +import json,re,tomllib ROOT=Path(__file__).resolve().parents[1] def require(condition,message): if not condition: raise ValueError(message) def check(): - pins=json.loads((ROOT/'source-inventory.json').read_text()) - actual={str(p.relative_to(ROOT)) for p in ROOT.rglob('*.lean') if '.lake' not in p.parts} - require(actual==set(pins), 'unreviewed or missing Lean file') - for name,digest in pins.items(): - require(hashlib.sha256((ROOT/name).read_bytes()).hexdigest()==digest, name) require((ROOT/'lean-toolchain').read_text().strip()=='leanprover/lean4:v4.19.0', 'Lean toolchain pin differs') cfg=tomllib.loads((ROOT/'lakefile.toml').read_text()) rev='c44e0c8ee63ca166450922a373c7409c5d26b00b' @@ -28,5 +23,5 @@ def check(): require(field in entries[0] and type(entries[0][field]) is type(value) and entries[0][field]==value, 'mathlib manifest identity differs: '+field) require(all(re.fullmatch('[0-9a-f]{40}',p['rev']) for p in manifest['packages']), 'dependency revision is not a full commit SHA') - print('PASS exact reviewed Lean source inventory and dependency pins') + print('PASS Lean toolchain and dependency pins') if __name__=='__main__':check() diff --git a/proofs/scripts/test_check_sources.py b/proofs/scripts/test_check_sources.py index 3316e310..80fac9e3 100644 --- a/proofs/scripts/test_check_sources.py +++ b/proofs/scripts/test_check_sources.py @@ -1,4 +1,4 @@ -"""Source/pin gate rejection tests, including actual optimized subprocesses.""" +"""Toolchain/dependency pin gate rejection tests, including actual optimized subprocesses.""" import json from pathlib import Path import shutil @@ -16,14 +16,14 @@ def run_gate(self, root, optimized): str(root / 'scripts/check_sources.py')], text=True, capture_output=True, timeout=10) - def test_reviewed_sources_pass_in_both_modes(self): + def test_pinned_dependencies_pass_in_both_modes(self): for optimized in (False, True): with self.subTest(optimized=optimized): result = self.run_gate(ROOT, optimized) self.assertEqual(result.returncode, 0, result.stderr) - self.assertIn('PASS exact reviewed', result.stdout) + self.assertIn('PASS Lean toolchain', result.stdout) - def test_changed_sources_and_pins_fail_in_both_modes(self): + def test_changed_pins_fail_in_both_modes(self): def replace(root, name, before, after): path = root / name path.write_text(path.read_text().replace(before, after)) @@ -33,9 +33,6 @@ def change_transitive(root): next(p for p in data['packages'] if p['name'] != 'mathlib')['rev'] = 'branch-name' path.write_text(json.dumps(data)) changes = ( - lambda root: (root / 'Rheon/Discrete.lean').write_text('-- changed\n'), - lambda root: (root / 'Rheon/New.lean').write_text('-- extra\n'), - lambda root: (root / 'Rheon/Indexing.lean').unlink(), lambda root: (root / 'lean-toolchain').write_text('leanprover/lean4:v4.20.0\n'), lambda root: replace(root, 'lakefile.toml', 'c44e0c8ee63ca166450922a373c7409c5d26b00b', '0' * 40), lambda root: replace(root, 'lake-manifest.json', 'c44e0c8ee63ca166450922a373c7409c5d26b00b', '1' * 40), @@ -51,7 +48,7 @@ def change_transitive(root): with self.subTest(change=index, optimized=optimized): result = self.run_gate(root, optimized) self.assertNotEqual(result.returncode, 0) - self.assertNotIn('PASS exact reviewed', result.stdout) + self.assertNotIn('PASS Lean toolchain', result.stdout) def test_manifest_origin_and_adjacent_identity_fail_in_both_modes(self): changes = ( @@ -79,7 +76,7 @@ def test_manifest_origin_and_adjacent_identity_fail_in_both_modes(self): result = self.run_gate(root, optimized) self.assertNotEqual(result.returncode, 0) self.assertIn(f'mathlib manifest identity differs: {field}', result.stderr) - self.assertNotIn('PASS exact reviewed', result.stdout) + self.assertNotIn('PASS Lean toolchain', result.stdout) def test_manifest_mathlib_entry_is_unique_and_complete(self): for alteration in ('missing', 'duplicate', 'missing_url'): @@ -101,7 +98,7 @@ def test_manifest_mathlib_entry_is_unique_and_complete(self): result = self.run_gate(root, optimized) self.assertNotEqual(result.returncode, 0) self.assertIn(expected_diagnostic, result.stderr) - self.assertNotIn('PASS exact reviewed', result.stdout) + self.assertNotIn('PASS Lean toolchain', result.stdout) if __name__ == '__main__': diff --git a/proofs/source-inventory-pr24.json b/proofs/source-inventory-pr24.json deleted file mode 100644 index c9943819..00000000 --- a/proofs/source-inventory-pr24.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "AxiomAudit.lean": "17c7c9d20648c432bba988fc004f736fe0ad4d23cee952334bded20b3d1bba0d", - "Rheon/BoundedPhysics.lean": "20dd53b1b137a01f8b04de47ffbe8474561696940e17ab1ed4d3bfde388b03af", - "Rheon/ColumnForcing.lean": "9199bd6d06f254e1cf31d8c7cd5e8cee951d53a5325db8bc78ef5cb449226211", - "Rheon/Discrete.lean": "70a2ca5d2c5cbefacbbb8742954375fdfe8cc25c3c5b8afd05738941cfc5ee0a", - "Rheon/Indexing.lean": "862c33164e75daccd43603c9b5a61473fd825885d9106b766a35204e578f60bf", - "Rheon/NoSlip.lean": "615283345c18331b5c19fba94cf738a55f089978df68d2ff67f109ae219b4e3c", - "Rheon/Physics.lean": "26cbb4f75076c7e70a90da126f96622b75044befce26a4c17a50066c76e96050", - "Rheon/Transport.lean": "f967e593db1df0ec945ea6830e67b991e56da168e9f6e3f2d42c4c5866c5cf06", - "Rheon/WallFriction.lean": "3aa15f9e4b5881181cdf438c88774a5eec29feb1a849b0329f0f95c34fa551e7", - "Rheon.lean": "844e4629dd4a4174af9c48598e3996bbfe1aea16b8e71560bf1ca4cb2e464f43" -} diff --git a/proofs/source-inventory.json b/proofs/source-inventory.json deleted file mode 100644 index 94431b71..00000000 --- a/proofs/source-inventory.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "AxiomAudit.lean": "afe91662265ac2bd2ca79755872c396679d7a02f99e1435055aeb58a026053d6", - "Rheon.lean": "7270cbaa05a3ec984867d89fa35a7e4ffefe3a94a5959163fbe03737690154eb", - "Rheon/AlignedStrain.lean": "4a76bacb1a49b2c395c1718ce45e2ed134217b78697766c099e666d09001ae32", - "Rheon/BoundedPhysics.lean": "20dd53b1b137a01f8b04de47ffbe8474561696940e17ab1ed4d3bfde388b03af", - "Rheon/ColumnForcing.lean": "9199bd6d06f254e1cf31d8c7cd5e8cee951d53a5325db8bc78ef5cb449226211", - "Rheon/Compressible.lean": "c396825f47b53981b0e4882bf3fcb581ddec3fb449578236ec4f5f5450be0d85", - "Rheon/CouplingStudy.lean": "67b27256aa37289ae3b5885c53b37a0a3d2bc42fc2c7a4415b0ad2d8d326caf5", - "Rheon/CpuScheduling.lean": "76e427ae8d5ba32ba3ee5c67a8e25ba09246dd5fa3445968f72fe7e34bff1375", - "Rheon/Discrete.lean": "70a2ca5d2c5cbefacbbb8742954375fdfe8cc25c3c5b8afd05738941cfc5ee0a", - "Rheon/EngineeringFlux.lean": "2b07020a8a8059e2eeaa12920217b254f57072ed3ebac319f3c7dcc5690aa5d7", - "Rheon/Indexing.lean": "862c33164e75daccd43603c9b5a61473fd825885d9106b766a35204e578f60bf", - "Rheon/MaterialPreview.lean": "a7e7668b6a364b2388e2362d44366fbe8e7104656eebde0964fd11f454a0e95e", - "Rheon/ModalDecay.lean": "69c643dfd3a523b8146eedbe918e68f848310d29349bc98ba21a7e71c1a83f2b", - "Rheon/NoSlip.lean": "615283345c18331b5c19fba94cf738a55f089978df68d2ff67f109ae219b4e3c", - "Rheon/ObstacleOperators.lean": "514cb760f16dd55d6bbad78b30953fcf3b90f3247b2185c1719b8463b6531680", - "Rheon/Physics.lean": "26cbb4f75076c7e70a90da126f96622b75044befce26a4c17a50066c76e96050", - "Rheon/PracticalStudy.lean": "20be05cb0916c5b2fa679ae20b060d5329050ce67507e628ccf4f1ac8897f49d", - "Rheon/PressureGauge.lean": "c004131c86f4b49a9b24759297c70731acd6c8ae15da5672b54d33f562477fe0", - "Rheon/StaticObstacle.lean": "b93a60d832775dd2177980806d149cbe0a42fef03bc3993f10ed44aa8451c4bb", - "Rheon/Transport.lean": "f967e593db1df0ec945ea6830e67b991e56da168e9f6e3f2d42c4c5866c5cf06", - "Rheon/VolumeFlux.lean": "1125200cd92c396c0d07dab7a159c08a8a76c822f2f88e2cdc841ea9e36d7364", - "Rheon/WallFriction.lean": "3aa15f9e4b5881181cdf438c88774a5eec29feb1a849b0329f0f95c34fa551e7" -}