BioSight/python/phi/AGENTS.md
allaun e0b2283972 feat(phi): full docstring + verification hardening pass
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
2026-06-24 03:57:50 -05:00

2.2 KiB
Raw Blame History

BioSight Agent Rules

Goal

Establish an unimpeachable base layer for the BioSight project by refining its Φ encoding pipeline through mathematical audit, autonomous bug elimination, and structural upgrades.

Constraints & Preferences

  • Autonomous execution (agents work independently with minimal context).
  • Math-level correctness over simple syntax fixes.
  • Terse bullets preferred over prose.

Progress

Done

  • Initial directory structure exploration of the BioSight project.
  • 100-loop autonomous bug attack on phi modules (reached stability at loop 13).
  • Mathematical audit of Φ encoding claims (Information Density, Topology, \Delta_7 Sufficiency, Consistency Rules, Adleman Mapping).
  • Upgraded character classification from \Delta_7 to \Delta_{12} in charclass.py to include Symmetry, Periodicity, Continuity, and Meta-math classes.
  • Implemented depth-weighted distributions (\omega) for both \tau(E) and \delta(E) in ast_parse.py.
  • Added Rule 7 (Closure Constraint) to consistency.py for mathematical completeness.
  • Integrated Depth Coefficient (\lambda) and Recurrence Vector (R) into the Φ embedding using compute_lambda_and_r.
  • Verified encoding logic via test_phi.py, confirming successful DNA mapping for arithmetic and trigonometric expressions (e.g., sin(x) + cos(y)).

In Progress

  • Finalizing the 30-base sequence layout by slicing \tau and \delta vectors to exactly 8 elements each, ensuring a strict fixed length across different expressions.

Key Decisions

  • Upgrade F(E) to \Delta_{12} to include Symmetry, Periodicity, Continuity, and Meta-math classes.
  • Add Depth Coefficient (\lambda) and Recurrence Vector (R) to the Φ embedding to handle structural nuances like nesting and operation flow.
  • Implement Rule 7 (Closure Constraint) in consistency for mathematical completeness.

Next Steps

  • Update embed.py to slice \tau and \delta vectors to exactly 8 bases each, ensuring a consistent 30-base DNA sequence (Bases 07: F\_dna, 815: \tau\_dna, 1623: \delta\_dna, 2429: Consistency).

Critical Context

  • BioSight is a Python shim for SilverSight's Lean logic; it handles I/O and encoding while Lean handles formal admissibility.