mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-30 18:56:16 +00:00
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. |
||
|---|---|---|
| .. | ||
| core | ||
| lean | ||
| otom | ||
| receipts | ||
| rust/ftdi_gimbal | ||
| scripts | ||
| README.md | ||
0-Core-Formalism
Purpose: Formal foundations for the entire Research Stack — Lean modules, bind primitive, Triumvirate consensus, core source.
No external dependencies. All other layers depend on this.
Contents (Target)
| Source | Destination |
|---|---|
0-Core-Formalism/lean/Semantics/ |
0-Core-Formalism/lean/Semantics/ |
core/ |
0-Core-Formalism/core/ |
Concepts
- bind — State → (State → Action) → State
- TriumvirateClock — ternary consensus (ADD/PAUSE/SUBTRACT)
- Builder/Judge/Warden — roles mapped to hardware registers
- OTOM — Ordered Transformation & Orchestration Model
Build
cd "0-Core-Formalism/lean/Semantics"
lake build
Current baseline: lake build reports 3314 jobs, 0 errors.
Recent Additions
Recently added/blessed Lean/Semantics modules:
Semantics.SDPVerifySemantics.GoormaghtighCertSemantics.HachimojiManifoldAxiom/Semantics.HachimojiSubstitutionSemantics.GeneticBraidBridgeSemantics.SieveLemmasSemantics.InteractionGraphSidon
Fixed-Point Constraint
Core compute paths use Q16_16 fixed-point arithmetic. Float is not allowed in compute paths; ofFloat is only permitted at the external boundary (JSON parsing, sensor input) and must be immediately bracketed to Q16_16.
Dependency Graph / Mathblob Insight
The dependency graph and Gremlin mathblob work serve as documentation and insight tooling for surfacing module relationships and formal-structure context within the Semantics surface.