Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lean-rheon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/education/ENGINEERING_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/education/PRESSURE_GAUGE_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/education/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/education/TIME_MODE_MILESTONE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/education/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='<p class="eyebrow">CHECK THE HYPOTHESES</p><h1>Proofs & evidence</h1><p>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.</p><details><summary>Historical expansion qualification receipt</summary><pre>'+html.escape(json.dumps(receipt,indent=2))+'</pre></details><p><a href="chapters/F-expansion-contracts-and-sources.html">Full contract map and primary sources →</a></p>'
proofs='<p class="eyebrow">CHECK THE HYPOTHESES</p><h1>Proofs & evidence</h1><p>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.</p><details><summary>Historical expansion qualification receipt</summary><pre>'+html.escape(json.dumps(receipt,indent=2))+'</pre></details><p><a href="chapters/F-expansion-contracts-and-sources.html">Full contract map and primary sources →</a></p>'
historical = sequence['current_reconstruction_proof']
current = sequence['current_reviewed_proof']
proofs+=f'<h2>Reviewed proof source</h2><p>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: <strong>{html.escape(current["status"])}</strong>. 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.</p>'
proofs+=f'<h2>Reviewed proof source</h2><p>The current proofs contain {sequence["public_theorems"]} public theorem statements and {sequence["explicit_expected_declarations"]} explicitly expected declarations. Qualification status: <strong>{html.escape(current["status"])}</strong>. 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.</p>'
if current.get('lean_ci'):
proofs+=f'<p><a href="{html.escape(current["lean_ci"])}">Current source Lean qualification</a></p>'
proofs+=f'<details><summary>Historical reconstruction: {historical["public_theorems"]} public theorems, {historical["audited_declarations"]} audited declarations</summary><p>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.</p><p><a href="{historical["lean_ci"]}">Associated reconstruction Lean CI</a> · <a href="native-sequence.json">Source identities, receipts and historical bindings</a></p></details>'
Expand Down Expand Up @@ -209,7 +209,7 @@ def root_link(match):
contents=cover+'<section class="toc">'+toc+'</section>'+''.join(f'<section class="book-chapter" id="{p["slug"]}">{print_body(p)}</section>' for p in reading)
(OUT/'print.html').write_text(f'<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Rheon — Expanded research edition</title><link rel="stylesheet" href="style.css"><link rel="stylesheet" href="vendor/katex/katex.min.css"></head><body class="print-book">{contents}</body></html>')
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))
Expand Down
2 changes: 0 additions & 2 deletions docs/education/native-sequence.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down
12 changes: 1 addition & 11 deletions docs/education/native_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down
37 changes: 6 additions & 31 deletions docs/education/test_native_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
12 changes: 4 additions & 8 deletions docs/education/verify_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Loading
Loading