Skip to content
This repository was archived by the owner on Oct 14, 2026. It is now read-only.
Closed
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
85 changes: 85 additions & 0 deletions .github/workflows/formal-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Layer 1 formal gate (Lean kernel replay)
'on':
pull_request:
paths: ['formal/**', '.github/workflows/formal-gate.yml']
push:
branches: [main]
paths: ['formal/**', '.github/workflows/formal-gate.yml']
workflow_dispatch:
permissions:
contents: read
jobs:
gate-controls:
name: gate tests, mutants, pins (no Lean)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.11'
- name: Pins, tests in both modes, gate replay
env:
PYTHONDONTWRITEBYTECODE: '1'
run: |
set -euo pipefail
python -B -S formal/pin_sources.py --check
python -B -S formal/run_validation.py --output "$RUNNER_TEMP/formal-gate-run"
python -B -S - <<'PY'
import json, os, pathlib
report = json.loads((pathlib.Path(os.environ['RUNNER_TEMP']) / 'formal-gate-run' / 'REPORT.json').read_text())
if not report['passed'] or report['distinct_tests'] != 27 or report['distinct_semantic_mutants'] != 33:
raise SystemExit('unexpected gate-control scope')
if report['mathematical_acceptance'] is not False or report['lemma_closed'] is not False or report['scientific_effect'] != 'NONE':
raise SystemExit('forbidden scientific promotion')
print('FORMAL_GATE_CONTROLS_PASSED')
PY
- name: Preserve evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: formal-gate-controls-${{ github.run_id }}
path: ${{ runner.temp }}/formal-gate-run
if-no-files-found: error
retention-days: 30

lean-kernel:
name: lake build + #print axioms evidence replay
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
with:
python-version: '3.11'
- name: Build the pinned Lean project (Mathlib cache)
uses: leanprover/lean-action@50fcf42d2e460296f1a34b402e990d1b24f8b596
with:
lake-package-directory: formal/lean
use-mathlib-cache: true
build: true
test: false
lint: false
auto-config: false
- name: Regenerate kernel evidence and compare with committed bytes
env:
PYTHONDONTWRITEBYTECODE: '1'
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/formal-kernel"
python -B -S formal/lean_build_evidence.py --check | tee "$RUNNER_TEMP/formal-kernel/evidence_check.log"
python -B -S formal/formal_gate.py --json | tee "$RUNNER_TEMP/formal-kernel/gate_report.txt"
python -B -S formal/blueprint_check.py | tee "$RUNNER_TEMP/formal-kernel/blueprint_check.txt"
git diff --exit-code
- name: Preserve evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: formal-kernel-${{ github.run_id }}
path: ${{ runner.temp }}/formal-kernel
if-no-files-found: error
retention-days: 30
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
*.pyc
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,21 @@ Private exploratory workspace. Eng-only pointers; **no** research-status flips.
- Treat a green local probe as theorem discharge or claim closure.
- Ask Dylan for re-approval of work already covered by owner autonomy.

## Layer 1 — formal verification (Lean 4 + Mathlib)

Owner instruction 2026-09-27 (pre-approved, no re-approval): extend the verification stack
with a formal lane. It lives in [`formal/`](formal/README.md) until ported to Math-
([`handoff/`](handoff/README.md) has per-repository patches and the hard-gate extension spec).

- Ladders: `formalization_status ∈ none < specified < proved < kernel-checked`,
`formalization_review ∈ none | author-side | nonauthor-aligned`. Declared ≤ verifiable, enforced by `formal_gate.py`.
- Every formal token is **non-discharge** except `KERNEL_CHECKED_NONAUTHOR_ALIGNED`, which satisfies the formal lane only.
- Any `.lean` edit regenerates `SOURCE_FILES.json` + `BUILD_EVIDENCE.json` and updates `lean_statement`/blueprint/glossary in the same commit. No `sorry`; parents parametrized or registered `axiom`s with scope notes.
- Kernel acceptance ≠ statement alignment ≠ analytic acceptance. `lemma_closed` stays false.

## Start here

1. This [README](README.md)
2. [`governance-` working contract](https://github.com/d6g8k5htny-coder/governance-)
3. [`trial` multi-agent access](https://github.com/d6g8k5htny-coder/trial/blob/main/docs/MULTI_AGENT_ACCESS.md) — add **sandbox** to every App install; Cloud Agent env deps / `repositoryDependencies` are declared on trial only
4. [`formal/README.md`](formal/README.md) then [`handoff/README.md`](handoff/README.md) — the formal lane and what each repository does next
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,18 @@ scientific-status register.
| `governance-` | Cross-repository working contract |
| `sandbox` | experiments only — automatic public export |

copy sandbox files, outputs, paths, or hashes into public catalogs,
public workflow artifacts, or Drive replicas.
Do not copy sandbox files, outputs, paths, or hashes into public catalogs,
public workflow artifacts, or Drive replicas.

## Layer 1 — formal verification (Lean 4 + Mathlib)

[`formal/`](formal/README.md) holds the formal-verification lane: a Lean 4 + Mathlib
project kernel-checking components of the Math- SIDE24 coefficient note, a fail-closed
`formalization_status` gate (`none < specified < proved < kernel-checked`), byte-bound
kernel evidence, a Lean Blueprint, a terminology glossary and an alignment-review lane.
[`handoff/`](handoff/README.md) carries the per-repository patches and the Math- hard-gate
extension spec so every agent on `main`, `Math-`, `trial` and `governance-` can take it up.
Kernel acceptance is not statement alignment and not analytic acceptance.

Scientific effect from this README: **NONE**. Never flip `lemma_closed`, prizes,
or premises. Agent entry: [AGENTS.md](AGENTS.md).
199 changes: 199 additions & 0 deletions formal/BUILD_EVIDENCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
{
"build": {
"command": "lake build",
"exit_code": 0
},
"declarations": {
"Side24.D2_algebra": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.D2_bounds": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.D2_lt_untruncated": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.cone_integral_identity": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.covariance_relative_lt_eps": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.density_comparison_lt_reported": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.enclosure_of_reference": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.enclosure_statement": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.exp_neg_288_lt": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.exp_partial_sum_gt_ten": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.exponent_budget_d2": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.exponent_budget_d3": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.gaussian_exp_moment": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.gaussian_fourth_moment": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.geometric_ratio_lt_half": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.image_constant_eq": {
"axioms": [
"propext"
]
},
"Side24.periodization_statement": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.perturbed_bounds": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.ratio_bound_statement": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.referenceCoefficient": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.reference_enclosure_statement": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
},
"Side24.ten_lt_exp_288_div_125": {
"axioms": [
"Classical.choice",
"Quot.sound",
"propext"
]
}
},
"lean_version": "Lean (version 4.34.1, x86_64-unknown-linux-gnu, commit 5045d0056413266e57c625dcd7c365b10e377c52, Release)",
"lemma_closed": false,
"mathlib_rev": "d13f23b723b8a846827a245b89c10fc7d3f11612",
"meaning": "kernel acceptance of the encoded statements at these exact bytes; not translation fidelity, not theorem acceptance",
"object": "FORMAL-LAYER-BUILD-EVIDENCE-v1",
"schema_version": 1,
"scientific_effect": "NONE",
"sorry_free": true,
"sources": {
"Side24Formal.lean": {
"bytes": 88,
"sha256": "75307dcf6471d6201557fd610013e2a5ef5a47b27b2011f88fa3eb34ee7d06d5"
},
"Side24Formal/ConeMoment.lean": {
"bytes": 8182,
"sha256": "b34affce872a8ffdbd9e738e8e8c3ad6b02f89422f12b9bf65c45b6c6b9288c5"
},
"Side24Formal/Ledger.lean": {
"bytes": 4189,
"sha256": "d3be23f13130614b3858f9a1262c4141c87a1a1d8dbcb77879ffd6a62b85716b"
},
"Side24Formal/Reference.lean": {
"bytes": 6206,
"sha256": "0281d652a01997964ec72facda9ea76bcb660f332dbacfd8bf45ee59b8782cec"
},
"lake-manifest.json": {
"bytes": 3146,
"sha256": "b6bf071a38d455614c7628855312ec82d1045afaf0a561e4124c173de203fa40"
},
"lakefile.toml": {
"bytes": 169,
"sha256": "a7dd307f3c5dbbfb0ed6b7e43f2149332a1770834de69214c9c02504a1eb3dac"
},
"lean-toolchain": {
"bytes": 25,
"sha256": "d5edba4e4b8faad9c1baeadb265716d20d03be4d1a2647dc5e35b0c0325bea7b"
}
},
"toolchain": "leanprover/lean4:v4.34.1"
}
Loading
Loading