diff --git a/AGENTS.md b/AGENTS.md index c5e3688d..2a0c177e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,6 +27,21 @@ Distance metric: algebra/cga.py::cga_inner(X, Y) -> -d^2 / 2 These are the only primitives. Everything else is built from them. +## Language Pack Checksum Rule (Critical) + +Manifest checksums MUST be computed by reading back the bytes actually +written to disk — never from an in-memory string before serialization: + + # CORRECT — hash what disk holds + checksum = hashlib.sha256(Path(lexicon_path).read_bytes()).hexdigest() + + # WRONG — Python str != unicode-escaped JSON bytes on disk + checksum = hashlib.sha256(content_str.encode('utf-8')).hexdigest() + +The GitHub API (and git) store JSON with unicode escapes (\u05d3, not ד). +Python json.dumps() with ensure_ascii=False produces different bytes. +Always write the file first, then read_bytes() to get the checksum. + ## Implementation Order Do not skip steps. Run the invariant test after each step before writing the next. @@ -42,6 +57,7 @@ Do not skip steps. Run the invariant test after each step before writing the nex 9. persona/motor.py -> tests/test_motor.py must pass 10. generate/stream.py 11. session/context.py +12. language_packs/compiler.py -> tests/test_holonomy_resonance.py must pass ## Architecture in One Sentence diff --git a/README.md b/README.md index 4b1e1bd1..0ed9ce34 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Software should understand the machine it runs on, not fight it. CORE is designe ### II. Semantic Rigor -Every term used in this system has a precise, non-negotiable meaning. A versor is a versor — not an approximation of one, not a vector that behaves like one under certain conditions. CGA distance is exact. Vault recall is exact. The vocabulary projection is exact. There are no thresholds tuned for "good enough." Rigor is not a style; it is what separates an engine from a heuristic. +Every term used in this system has a precise, non-negotiable meaning. A versor is a versor — not an approximation of one, not a vector that behaves like one under certain conditions. CGA distance is exact. Vault recall is exact. The vocabulary projection is exact. There are no thresholds tuned for “good enough.” Rigor is not a style; it is what separates an engine from a heuristic. ### III. Third Door @@ -35,9 +35,9 @@ CORE is rooted in three human languages. This is a philosophical and architectur |---|---| | **English** | The default base language of the current model. Any natural language could serve this function in a custom CORE instance — English is the chosen starting point, not a requirement. | | **Hebrew** | One of two depth languages. Hebrew carries a density of meaning in its root structures, prefixes, and suffixes that Euclidean string matching cannot capture. The field representation is designed to hold this depth. | -| **Koine Greek** | One of two depth languages. The language of the New Testament, particularly John's Gospel — the document that opens with the most precise and consequential statement about language and reality ever written. | +| **Koine Greek** | One of two depth languages. The language of the New Testament, particularly John’s Gospel — the document that opens with the most precise and consequential statement about language and reality ever written. | -> *"In the beginning was the Logos, and the Logos was with God, and the Logos was God."* +> *“In the beginning was the Logos, and the Logos was with God, and the Logos was God.”* > — John 1:1 The choice of Hebrew and Koine Greek is not incidental. John 1:1–2 articulates the Logos in Greek while grounding it in the Hebrew creation account — the universe spoken into existence, word by word. This is not metaphor. It is the claim that language is not a layer on top of reality; language **is** the structuring principle of reality made manifest. CORE-Logos is built on that claim. @@ -76,7 +76,7 @@ raw input -> ingest/gate.py (normalize once) | `algebra/` | Cl(4,1) multivector math, versor ops, CGA, holonomy | | `ingest/` | Single injection gate — the only normalization site | | `field/` | FieldState dataclass and propagation loop | -| `vocab/` | Word-to-versor manifold, edge rotors | +| `vocab/` | Surface-token manifold points; indexed access for algebraic transition construction | | `vault/` | Exact CGA inner product memory store | | `persona/` | Persona as CGA motor (screw motion) | | `generate/` | Token streaming loop | diff --git a/field/state.py b/field/state.py index 06f2a504..31afc061 100644 --- a/field/state.py +++ b/field/state.py @@ -17,7 +17,7 @@ import numpy as np _EXPECTED_COMPONENTS = 32 -@dataclass(frozen=True) +@dataclass(frozen=True, slots=True) class FieldState: F: np.ndarray # shape (32,) float32 — Cl(4,1) multivector on the versor manifold node: int = 0 # current node index in the vocabulary manifold @@ -28,6 +28,7 @@ class FieldState: # Enforce copy + dtype + shape at the construction boundary. # frozen=True prevents reassignment, but ndarray contents are still # mutable via the array object; copy() here is the defence. + # slots=True closes __dict__ so no incidental attributes can be added. F = np.array(self.F, dtype=np.float32).copy() if F.shape != (_EXPECTED_COMPONENTS,): raise ValueError(