Research-Stack/0-Core-Formalism/lean/Semantics/lakefile.toml
allaun 9cf0c77e4e feat(lean,infra): SilverSight-first offline PIST trace classifier
Moves all classification authority from Python into Lean:

- Adds `0-Core-Formalism/lean/Semantics/PistClassifyTrace.lean` executable.
  Reads a raw trace JSON and emits spectral radius, RRC shape, and tactic
  family using `Semantics.PIST.Spectral` and `Semantics.PIST.Classify`.
- Registers `pist-classify-trace` in `lakefile.toml`.
- Fixes `Semantics.PIST.Spectral` power iteration to handle directed
  transition matrices:
  - `symmetrize` now preserves half-integer weights as Q16_16 raw values.
  - `matVecMul` uses saturated Q16_16 arithmetic to prevent overflow.
- Rewrites `4-Infrastructure/shim/pist_trace_classify_offline.py` as a pure
  I/O wrapper: reads JSON, calls the Lean classifier, optionally calls
  `rrc-watchdog`, and emits the combined JSON. Removes Python-side spectral
  computation, shape thresholds, tactic heuristic, and KNN.
- Updates `AGENTS.md` and `4-Infrastructure/AGENTS.md` with the new build
  baseline and shim contract.

Verification:
- `lake build` → 8604 jobs, 0 errors
- Canary trace outputs match previous Python outputs to within Q16_16 rounding
  (e.g., apply_chain λ_q16 = 59044 vs 59045).
- `python3 -m py_compile` on the rewritten shim passes.
2026-06-22 01:11:17 -05:00

110 lines
3 KiB
TOML

name = "Semantics"
version = "0.1.0"
srcDir = "."
# Compiler is the narrow fast-verification target for CI: only the blessed
# RRC + AVMIsa + ReceiptCore surface. Semantics is the full workspace build.
defaultTargets = ["Compiler", "Semantics"]
[[require]]
name = "sparkle"
git = "https://github.com/Verilean/sparkle.git"
rev = "252341078dba3c2612719746e6a459dada2248ea"
[[require]]
name = "mathlib"
git = "https://github.com/leanprover-community/mathlib4"
rev = "v4.30.0-rc2"
[[lean_lib]]
name = "Semantics"
# ── Compiler: blessed RRC compiler surface ────────────────────────────────────
# Fast CI target. Only these modules form the "functional Rainbow Raccoon
# Compiler" proof-of-life:
# Semantics.RRC.Emit — fixture corpus → alignment gate → JSON (Goal A+)
# Semantics.AVMIsa.Emit — AVM canaries → RRC → JSON (Goal A); sole output boundary
# also stamps Semantics.RRC.Corpus250 (250-equation corpus)
# Semantics.RRC.Corpus250 — raw 250-equation features (Python-supplied, Lean-gated)
# Libraries (imported by roots, not roots themselves):
# Semantics.AVMIsa.* — ISA, types, step, run
# Semantics.ReceiptCore — receipt ledger, promotion gates
# Semantics.RRCLogogramProjection — projection/merge/lane theorems
# Semantics.FixedPoint — Q16_16, Q0_16 (no Float in compute paths)
[[lean_lib]]
name = "Compiler"
roots = ["Semantics.RRC.Emit", "Semantics.AVMIsa.Emit", "Semantics.RRC.Corpus250"]
[[lean_lib]]
name = "PIST"
srcDir = "../../../2-Search-Space/PIST"
# HybridTSMPISTTorus removed from roots: pre-existing sorry/#eval failures,
# no module imports it, quarantined pending Lean 4.30 port.
roots = ["PIST", "PistBridge", "PistSimulation", "TorsionalPIST", "Trace"]
[[lean_lib]]
name = "FAMM"
srcDir = "../../../2-Search-Space/FAMM"
roots = ["FAMM"]
[[lean_lib]]
name = "ExtensionScaffold"
[[lean_lib]]
name = "Biology"
# OTOM external proofs — uncomment when resolving sorries.
# Build: lake build OTOMProofs
# Buildable: DiffusionSNRBias, Constitution
# Others have structural errors beyond sorries.
# [[lean_lib]]
# name = "OTOMProofs"
# srcDir = "../external/OTOM"
# roots = ["DiffusionSNRBias", "Constitution"]
[[lean_exe]]
name = "bindserver"
root = "BindServer"
[[lean_exe]]
name = "searchserver"
root = "SearchServer"
[[lean_exe]]
name = "SemanticsCli"
root = "Main"
[[lean_exe]]
name = "openworm_benchmark"
root = "OpenWormBenchmark"
[[lean_exe]]
name = "ExtremeParameterTestEval"
root = "ExtremeParameterTestEval"
[[lean_exe]]
name = "NominalParameterTestEval"
root = "NominalParameterTestEval"
[[lean_exe]]
name = "moim_benchmark"
root = "MOIMBenchmarkMain"
[[lean_exe]]
name = "generate_sparkle_phi_s3c"
root = "GenerateSparklePhiS3C"
[[lean_exe]]
name = "tangnano9k_emitter"
root = "TangNano9KEmitter"
[[lean_exe]]
name = "sabotage_prevention_cli"
root = "SabotagePreventionCli"
[[lean_exe]]
name = "rrc-watchdog"
root = "RrcWatchdog"
[[lean_exe]]
name = "pist-classify-trace"
root = "PistClassifyTrace"