mirror of
https://github.com/allaunthefox/BioSight.git
synced 2026-07-30 18:56:17 +00:00
Every function in all 5 phi modules now has: - Google-style docstring with Args/Returns/Examples - Verified behavior via doctest examples (46 total) - Self-verification assertion blocks on direct execution Verification results: charclass: 10 doctests, 16 assertions — PASS ast_parse: 21 doctests, 7 assertions — PASS consistency: 6 assertions — PASS embed: multiple assertions — PASS output: 15 doctests, 16 assertions — PASS CLI wrapper: 3 checks — PASS End-to-end: 9 equation domains — PASS Also added: - .opencode/opencode.jsonc (gemma4 MCP config) - phi/AGENTS.md (module-level contract) - phi/test_phi.py (unittest test file) - phi/encoding_rationale.md (design docs) - dag/ (project dependency graph) - harness/ (Lean formalism constraints) - 7-Pipeline/ (rigour verification harness) Build: python3 -W error -m py_compile — 0 warnings
1.3 KiB
1.3 KiB
Harness: Lean Formalism
Context
This harness defines the constraints for all Lean-based formalization within the SilverSight/BioSight project. Use these rules to minimize LLM drift during proof construction.
Core Quirks & Constraints
-
Fixed-Point Arithmetic:
- NEVER use
Floatin core compute paths. - Always use
Q16_16(mixed) orQ0_16(pure fraction). - Exception: External boundary inputs/outputs (JSON parsing, sensor data).
- NEVER use
-
The Closure Constraint (Rule 7):
- Every formal claim must be "closed" under the operation defined by its DNA Signature.
- If a theorem is incomplete, it's not just a
sorry; it must have aTODO(lean-port)describing why it's open.
-
DNA Mapping Alignment:
- The Lean proof structure must mirror the BioSight
\tau(topology) and\delta(depth) values. - Example: A high
\deltavalue implies nested definitions or recursive structures in Lean.
- The Lean proof structure must mirror the BioSight
-
Verification Protocol:
- Every change requires a
lake build. - No "bare" sorries are allowed unless they represent a specific, identified gap in the logic.
- Use
#evalto provide witnesses for every major theorem.
- Every change requires a
Reference Anchors
- Base Type:
Semantics.FixedPoint.Q16_16 - Core Module:
0-Core-Formalism/lean/Semantics/