BioSight/python/phi/encoding_rationale.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

30 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Φ Encoding Rationale: The 30-Base DNA Sequence
This document explains the logic behind every position in the 30-base DNA sequence generated by the BioSight Φ encoding pipeline.
## Layout Overview
The sequence is divided into four functional blocks, each representing a different mathematical dimension of the expression $E$.
### Block 1: Surface Identity ($F\_dna$) | Bases 07 (8 bases)
**What it represents:** The primary character classification ($\Delta_{12}$).
- **Rationale:** These bases capture the "what" of the expression. By using $\Delta_{12}$, we move beyond simple types to include Symmetry, Periodicity, and Continuity. It provides the immediate visual/structural signature of the components.
### Block 2: Topology & Connectivity ($\tau\_dna$) | Bases 815 (8 bases)
**What it represents:** The structural "shape" or connectivity map.
- **Rationale:** These bases capture how components are linked. It distinguishes between a linear chain, a nested structure, and a branching tree. Even for simple expressions, this ensures the relative "pathway" of operations is preserved.
### Block 3: Depth & Weight Distribution ($\delta\_dna$) | Bases 1623 (8 bases)
**What it represents:** The recursive depth weight ($\omega$).
- **Rationale:** These bases quantify how much "weight" each sub-component carries relative to the whole. It handles the nuances of nesting—identifying which parts are deep in the tree and which are at the surface, allowing for a multi-dimensional view of complexity.
### Block 4: Closure & Consistency | Bases 2429 (6 bases)
**What it represents:** The Rule 7 closure constraint.
- **Rationale:** These final bases act as the "mathematical seal." They verify that the expression is consistent within the Φ system's rules. It confirms whether the sequence of operations "closes" correctly, providing a binary or multi-state check for mathematical completeness.
## Summary Table
| Range | Component | Dimension | Key Property |
|-------|----------|-----------|--------------|
| 07 | $F\_dna$ | Surface | Identity / Type |
| 815 | $\tau\_dna$| Topology | Connectivity |
| 1623 | $\delta\_dna$| Distribution | Depth / Weight |
| 2429 | Consistency| Closure | Completeness |