diff --git a/.claude/agents/theorem-checker.md b/.claude/agents/theorem-checker.md index 4fda87c..29ab40d 100644 --- a/.claude/agents/theorem-checker.md +++ b/.claude/agents/theorem-checker.md @@ -10,6 +10,16 @@ Your single job: separate what is **proven** from what is **asserted**, and chec the arithmetic. ## Method +0. **Pin the UNIT SYSTEM first.** When the operator or a doc gives a numeric + layout (e.g. `8/4/4/4/6/6`), test every plausible unit — bits, hex + digits/nibbles, bytes — against the famous formats in play (UUID + `8-4-4-4-12`, IPv6, MAC, the workspace's own 16-ary nibble tree) BEFORE + interpreting. Prefer the reading with EXACT shipped-code matches over the + reading with poetic codebook rhymes: in a substrate built on 16/256/4096, + numerology confirms anything. (Born from a real failure, 2026-06-10: an + operator layout counted in HEX — the GUID's own dash-groups — was read as + bits for two full passes, and the wrong reading survived a 5+3 review + because every lens audited arithmetic and populations, none audited units.) 1. Restate the claim as a precise mathematical proposition. If it cannot be stated precisely, that is itself the finding (`[S]`: not yet a math claim). 2. Decide its standing: diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..4762fa8 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,195 @@ +# CLAUDE.md — OGAR (Open Graph of Active Record) + +> Auto-loaded session preamble. The canon pins live here; the detail +> lives in `docs/`. Read `docs/DISCOVERY-MAP.md` (what was found) and +> `docs/INTEGRATION-MAP.md` (how it composes) before proposing anything. + +## P0 — THE CANONICAL GUID (operator-pinned; counted in HEX, not bits) + +``` +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +classid HEEL HIP TWIG family-basin-leaf(6) + identity(6) +8 hex 4 hex 4 hex 4 hex 12 hex +``` + +32 hex = 128 bit = the GUID itself. **The UUID's own dash-groups ARE the +semantic delimiters** — every printed GUID is self-describing at sight. +1 hex digit = 1 nibble = 1 level of the 16-ary tree (`FAN_OUT=16`). +Widths are codebook cardinalities; **scale = the next cascade level, +never field-widening.** Wrappers (e.g. lance-graph `NodeGuid`, #480) are +audited against this canon group-by-group — never the reverse. + +**3×4 PATH — UNIFORM, RFC-WAIVED** (reversed 2026-06-10; the operator's +word arrived — the brief v8-native pin broke the uniform Morton stride): +HEEL/HIP/TWIG are each **4 full nibbles** — 3 tiers × 4 nibbles = 12 +path levels, uniform. **Tier-of-level = `level >> 2` — a shift, never a +branch.** The cascade's shift/mask arithmetic is canon. The GUID is NOT +RFC-stamped: **RFC 9562 is a WRAPPER format, and wrappers adapt to the +canon, never the reverse** — any boundary that genuinely requires +RFC-valid UUIDs owns that adaptation at its membrane and pays it +explicitly; the canon does not pre-pay it in every key. Native/foreign +discrimination lives where semantics live: in `classid` (foreign keys +get a foreign family), not in a format constant. Wikidata-HHTL is the +same canon either way — depth beyond 12 native levels was always the +hierarchy's job (registry resolve + ref-escape). (The v8-native episode ++ reversal reasoning: INTEGRATION-MAP §9.10. The 4/3/3 carving was +never codebook-motivated — it fell out of RFC mark positions — but it +traded concrete hot-path uniformity for mostly-hypothetical interop: +the key's real consumers — Lance, SurrealDB, `EntityKey` — are +byte-agnostic.) + +## P0 — THE GUID IS THE KEY OF KEY-VALUE (operator-pinned, 2026-06-10) + +The substrate is a key-value store whose **key is the canonical GUID**: + +- **The key prerenders nodes — in any way — with zero value decode.** + classid → the class template (`ClassView`); HEEL/HIP/TWIG → the + cascade position; basin+leaf → the family neighborhood; identity → + the instance. A renderer/router/planner can lay out, group, route, + and skeleton-render nodes from keys alone, before (or without ever) + fetching a value. +- **A node is 4096 bits: `key(128/GUID) + value(3968)`** — a 512-byte + block, 16-byte key, 496-byte value; the value is simply everything + the key isn't. The beauty: Lance is free to compress the value bits + arbitrarily — columnar encodings, dictionary, PQ, anything — and the + store **still has a transparent view and address**, because the key + is never compressed and never needs the value decoded to be useful. + Compression never costs addressability. + +## Tier interpretation — 256×256 CENTROID TILE (operator, 2026-06-10; [H] + named test) + +Each tier's 64k space (4 nibbles = 16 bits) is read as a **256×256 +centroid tile**: two axes, each a byte-index into a 256-entry centroid +codebook, nibble-interleaved. Receipts: path = HEEL+HIP+TWIG = 6 bytes += exactly the CAM-PQ **6×256** code (3 tiers × 2 axes = 6 subspaces); +the 256×256 LUT is the stack's recurring structure (bgz17 palette +distance/compose tables, helix DistanceLut, bgz-tensor attention-as- +lookup) → **path distance = 3 tier-table lookups, O(1)**; the HHTL +legend already says HIP = palette. **Condition that keeps prefix +routing rigorous: 256 = 4⁴ — each codebook is built as a 4-level 4-ary +centroid HIERARCHY**, so a byte's nibbles are the centroid's ancestry +(coarse→fine) and `is_ancestor_of` = centroid-tree containment; the +x/y nibble-interleave = alternating-axis refinement (Morton in centroid +space). Flat k-means-256 breaks this; hierarchical 4⁴ preserves it. +**Named test (F11-adjacent):** hierarchical-4⁴ vs flat-256 fidelity ρ +against the 0.9973/0.965 anchors. Consequence: D-BOTHCASC collapses — +spatial mipmap and semantic centroid cascade are ONE address; domains +bind the axes (OSM: literal x/y; semantic: PQ subspace pairs); the +algebra is identical and domain-agnostic. + +**Codebook scoping = the class routing prefix** (operator, 2026-06-10): +the classid group sits in front of the path bytes, so the centroid +codebooks are **selected by the key's own prefix** — longest-prefix +binding, a radix lookup on the key being resolved. Every class gets its +own 256⁶ ≈ 2.8×10¹⁴-cell semantic space for free (capacity through +hierarchy, never widening); the axis binding (x/y vs PQ pairs) is a +class-record property resolved by the same `resolve` read; codebooks +mint with the class in the registry (next to ClassView / +StructuralSignature — Phase B's shelf), trained once, amortized over +all instances (D-AMORT). Finer scopes (a HEEL-subtree codebook) follow +the same longest-prefix-wins rule — one rule, every level. + +## Perturbation encoding — DETERMINISTIC PHASE (operator, 2026-06-10) + +The stacked-pyramid perturbation decomposes as **(exponent, location, +phase, magnitude)** — and three of the four are already in the key: +exponent = the pyramid level (tier nibbles, `>>2`); location = the +implied sub-tile mantissa (√u / golden sub-placement, never stored); +**phase = deterministic recurrence from the address** (never stored — +phase is convention, not data); **magnitude = the ONLY stored bits** +(palette-quantized envelope, coarser granularity than the phase +varies). Cost scales with magnitude smoothness, not perturbation +bandwidth. Fences: (a) lossless FOR SYNTHESIS by construction; for +analysis, the unaligned remainder overflows to the next level or +full-residual escalation, decided by the quorum certificate — never +assumed; (b) **D-QUANTGATE**: in quantized layers the phase generator +must be the coprime-integer walk (helix `CurveRuler` stride-4-over-17, +bit-exact integer), golden recurrence only as build-time muscle-memory; +the deterministic phase doubles as the anti-moiré dither. Receipts: +helix = the shipped place/residue split (PLACE deterministic, RESIDUE +stored). Full treatment: ndarray `guid-prefix-shape-routing.md` §4. + +## Bipolar-phase pyramid — Walsh-Hadamard on VSA (operator, 2026-06-10) + +When the deterministic phase is **signed** (±1, one bit per address×level), +the perturbation pyramid becomes the Walsh-Hadamard transform of the +address tree, carried on the workspace's existing VSA-bipolar algebra: +- **Sign composition across levels = XOR = `vsa_bind`** (multiply of ±1 = XOR of sign bits; one SIMD shift+xor). +- **Magnitude bundling = `vsa_bundle`** (sum-and-threshold; Markov-respecting per `I-SUBSTRATE-MARKOV`). +- **Each cell = ⊕_L sign(addr, L) ·_VSA M(addr, L)** — a resonance field, not combinatorial selection; Parseval gives "top gaussian preserved" level-to-level. + +**Quantum-shaped, fully deterministic:** superposition (cells hold many +bundled contributions; unbind with a role key to extract one), +Heisenberg-shaped capacity bound (`I-VSA-IDENTITIES` Test 1: N ≤ √d/4 ≈ 32 +distinct readouts; this IS the uncertainty principle for the substrate), +roundtrip bit-exact (phase generated, not stored — same address ⟹ same +sign sequence forever; Walsh-Hadamard is self-inverse up to scale). +The "Schrödinger's cat" is in a glass box: superposition is real, +identity recoverable by key, no measurement randomness. + +**D-MANTISSA finishes in coprime form:** the bipolar phase IS the implied +mantissa as 1 sign-bit/level; the CurveRuler stride-4-over-17 walk +(integer, bit-exact, coprime ⟹ full permutation) is the generator — +**D-QUANTGATE-compliant by construction**. + +**The TWO-ALGEBRA rule (load-bearing):** **sign side = XOR** +(write-back I1 allows it for single-target deltas), **magnitude side = +`vsa_bundle` NEVER `MergeMode::Xor`** (raw-XOR-on-magnitudes breaks the +Markov semigroup, `I-SUBSTRATE-MARKOV`). Two operators, two algebras, +one pyramid. Fences: "quantum-like" is the bundling algebra, NOT +measurement randomness (no headline drift); bipolar = 1-bit phase; +multi-bit phases stack above it only when measured to be needed. Full +treatment + probes in ndarray `guid-prefix-shape-routing.md` §4b. + +## Standing watch — 3×4 vs 4×3 (operator mandate, 2026-06-10) + +**"Correct me at any time":** if evidence ever shows 3 tiers × 4 nibbles +to be more expensive, lower-synergy, or higher-entropy than 4 tiers × 3 +nibbles, say so immediately — standing permission and obligation. + +Operator's rationale (recorded so it doesn't dilute): *3×4 is a modesty +in levels that buys radix-tree cheapness and less horizontal difference, +but a wider spread.* Calculation ledger (2026-06-10) confirms it in +mechanism: tier-of-nibble = `n >> 2` (shift) vs `n/3`; tiers are +u16-aligned vs 1.5-byte-straddling; dash-groups = tiers (self-describing +print) vs dashes lying; Morton de-interleave = one byte per axis per +tier vs sub-byte masking; 3 hops vs 4 (wide-radix cheapness); sibling +XOR localizes to one aligned group. The one 4×3 synergy (tier index = +one 4096-codebook slot) is recoverable inside 3×4 for free — codebooks +attach at any nibble depth, so a 3-nibble prefix indexes a 4096 +sub-table whenever wanted; the reverse recovery is impossible. +**Flip condition (falsifiable):** a measured workload where 4-tier +granularity beats 3-tier on the radix/de-interleave benches despite the +alignment costs. Until measured: 3×4 stands. + +## Doc family (read in this order) + +1. `docs/DISCOVERY-MAP.md` — the discovery ledger (D-* entries, graded + `[G]`/`[H]`/`[S]`, append-only). +2. `docs/INTEGRATION-MAP.md` — layers, seams (each with its contract + TYPE), the phase DAG, falsification gates F1–F14. +3. `docs/INTEGRATION-TEST-PLAN.md` — the probe-first execution + companion: wave-ordered probes (Wave 0 runs entirely against + shipped code), the three falsification joints J1–J3 with explicit + KILL conditions, and the operating rule that no integration brick + lands before its probe is green. +4. `docs/OGAR-AST-CONTRACT.md` — the IR type surface (THINK arm `Class` + / DO arm `ActionDef`+`ActionInvocation` / membrane `KausalSpec`). +4. `docs/ARCHITECTURAL-DECISIONS-2026-06-04.md` — ADR-001..025 + (ADR-026 pending). +5. `.claude/agents/` — the 5+3 hardening pattern (5 research savants + + 3 brutally-honest reviewers). Run it before any claim enters the + canon. Theorem-checker rule 0: **pin the unit system first** (bits + vs hex vs bytes — born from a real failure). + +## Non-negotiables + +- **The Firewall (ADR-022/023):** no serialization in the hot path; + the IR is wire-truth; inter-mailbox state is Batons. +- **PII:** never emit German PII labels (medcare-rs leaf-rename at the + adapter is the guarantee). Word-boundary abort-guard before commit. +- **No model identifier** in any committed artifact (chat only). +- **Shell discipline:** `grep`/`sed`/`tail`/`head`/`awk` via Bash are + prohibited — use the Grep/Read/Glob tools. +- **Append-only canon:** never delete a ledger entry; regrade in place; + corrections cite their pass (savant / G-pass / canon-pass). diff --git a/docs/DISCOVERY-MAP.md b/docs/DISCOVERY-MAP.md index 5b5ab58..06a548b 100644 --- a/docs/DISCOVERY-MAP.md +++ b/docs/DISCOVERY-MAP.md @@ -35,6 +35,10 @@ > D‑EXCITON revert). "Reverted/graded by the 5+3 review" = the receipts are > those agents' findings; the apparatus is in this repo, the per‑run > transcripts are session‑local. +> - **`INTEGRATION-MAP.md`** = the composition companion (2026‑06‑09): this +> map indexes *what was found*; that one maps *how it composes* — layers, +> seams (each with its contract TYPE), the merged phase DAG, and the +> falsification gates F1–F9. Discovery → there; sequencing → here. > > **Status: LIVING INDEX** (2026‑06‑08). Update entry *status* on > materialization; never delete (append‑only). One entry per discovery; @@ -57,7 +61,7 @@ reprioritizes the queue. | AriGraph (arXiv 2407.04363, Anokhin et al. 2024 — semantic + episodic KG world‑model with associative retrieval, for LLM‑agent planning) | Substrate realization | Grade | |---|---|---| | **semantic memory** (the world model) | **META = `MetaWord`** (the §4.1 layer — structural awareness) | mapping H | -| **episodic memory** (event sequence) | **EPISODIC = delta frames** = `DatasetVersion(v)→(v+1)` + per‑row `cycle` stamp (D‑DELTA) | H | +| **episodic memory** (event sequence) | **EPISODIC = delta frames** = `DatasetVersion(v)→(v+1)` + per‑row `cycle` stamp (D‑DELTA; label fold 2026‑06‑10: version = self‑contained snapshot, cycle = RECENCY stamp — watermark‑filter, never diff‑reconstruct) | H | | **associative retrieval of interconnected concepts** | **basins + supporters**: basins = palette256/CAM centroids + Semantik volumetric centroids + Morton‑prefix subtrees (D‑PAL256, D‑CAM, D‑AMORT‑AXES; the intra‑basin locality probe); supporters = the neighbor‑XOR retrieval (D‑NEIGH) | H | | **the encoded concepts** | **meaning vectors** = DeepNSM 4096‑dim (63 primes) → CAM‑PQ 6×256 (D‑NSM, D‑CAM) — *shipping* in lance‑graph `nsm/` | G (DeepNSM), G (AriGraph public) | @@ -157,7 +161,7 @@ two halves of a cell. ADR‑026 names the cascade that ties them. | D‑BGZ17 | the **discrete/immutable** counterpart to D‑MANTISSA: not "irrational" but **coprime‑aperiodic** — Base17 (`SpoBase17 = [i16;17]×3`, prime 17 ⊥ base‑16 Morton) ⟹ beat period `LCM(16,17)=272` (longest → lowest‑freq moiré). **Anti‑moiré upgrades `[H]`‑unmeasured → `[H]` with a *provable bound*** (number theory, not spectral) — still "longest‑period beat," not "no beat" (§2 caveat persists). `HighHeelBGZ` (basin + ≤240 edges) **realizes §0 AriGraph basin+supporters**; the "quorum" = the L1‑threshold basin‑merge consensus set. **Resolves the §4.1 unwired gap** (route the HEEL/HIP/TWIG/LEAF container by the `hhtl.rs` NiblePath; Base17=TWIG is the anti‑moiré layer). ρ=0.965 (TWIG) joins ρ=0.9973 (HIP) as measured anchors. For *immutable*, prefer this over D‑MANTISSA (exact/hashable vs float). | H | EPIPHANY | SYN §2 + §4.1 + §0 | D‑MANTISSA, D‑CAM, `[per rt]` `bgz17`/`HighHeelBGZ`/`SpoBase17` | | D‑QUANTGATE | **the quantization principle** (operator, 2026‑06‑08): **whenever there is quantization, the irrational does not have the Morton tile cascade guarantee.** Continuous irrationals (golden mantissa / D‑MANTISSA) lose their aperiodicity when quantized onto a lattice — the rounded value re‑acquires the period of the grid. So at every quantized layer, the substrate must use the **discrete coprime route** (D‑BGZ17, Base17×Morton) to preserve aperiodicity. The continuous irrational only survives as a *muscle‑memory* mantissa quorum: pre‑computed at codebook build time and **never re‑quantized in the hot path** (consistent with the amortization gate D‑AMORT). This **promotes ADR‑026's no‑collapse precondition (D‑NOCOLLAPSE) into a layered rule**: discrete‑coprime at every quantized boundary; muscle‑memory irrationals only at build‑time / continuous layers. **Reframes the §2 anti‑moiré caveat as architectural, not just unmeasured.** | G (the principle is structural) | EPIPHANY → ADR‑026 §2 | SYN §2 | D‑MANTISSA, D‑BGZ17, D‑AMORT, D‑NOCOLLAPSE | | D‑EXCITON | OLED exciton ↔ anti‑moiré: **REVERTED `[H]→[S]`** by the 5+3 agent review (2026‑06‑09; apparatus `.claude/agents/`, provenance §7). The `[H]` "OLEDs ship the same coprime aperiodicity as D‑BGZ17" was a **category error + a number mis‑label**: (a) the 1:3 S:T ratio is **exactly rational** — the SU(2) microstate count (1 vs 3), a *definitional identity, not a measurement* (`[G]` definitional), so *not* irrational; (b) **a scalar has no period to be aperiodic about** — aperiodicity is a property of an infinite tiling/sequence, and a bias‑shifted ratio or two energy scalars are points, not lattices; (c) the "~1.5 eV triplet *binding* energy" was the **T1 excited‑state energy mis‑labelled** — literature triplet E_b is sub‑eV (≈0.3–0.6 eV, arXiv 2311.03927), so the ratio is order ~1 **not** 3, and the *specific 1:3‑energy coincidence* that motivated the link does not survive. **Kept (`[G]`‑real legs, held apart from the dead analogy):** rational 1:3 (above); and the *harvest‑the‑dark physics* — phosphorescence (heavy‑metal SOC) + TADF (small ΔE_ST RISC) reach ~100% IQE (Baldo/Adachi; Uoyama 2012). Bias‑dependence (PMC4614446) is a **real but material‑specific** observation (`[G]` in its own literature) that carries **no aperiodicity and no substrate test** → its *link* value is `[S]`. **A `[G]` mechanism does not lend its grade to the `[S]` rhyme.** **Rejected re‑links (logged so they're not re‑proposed):** A = anti‑moiré ladder (no lattice/beat); B = amortization gate (no reuse axis — 1‑use recovery ≠ 1/N reuse). **Surviving reframe → `D‑LOSSCHAN` (§2.7), `[S]` do‑not‑build.** | S | EPIPHANY (reverted) | `.claude/agents/` 5+3 review; SYN §3 = also revert | — (anti‑moiré deps removed) | -| **D‑MONOTILE** | **the *third* anti‑moiré route — strongest, by theorem.** An **aperiodic monotile** (the "hat," Smith‑Myers‑Kaplan‑Goodman‑Strauss 2023; arXiv **2509.12216** Kaplan) is a *single shape that tiles the plane only non‑periodically* → it has **no translational period → no moiré beat, by a tiling theorem**, not by placement (D‑MANTISSA, `[H]` continuous) or by base‑coprimality (D‑BGZ17, `[H]`‑bounded). **The anti‑moiré is `[G]` (proven), and it survives quantization (a fixed discrete shape, immutable)** — so it satisfies D‑QUANTGATE *intrinsically*. **Cost / open question (`[H]`):** the hat is a **polykite on a hexagon+triangle lattice**, not the square Morton quadtree; adopting it changes the cascade geometry. Its **substitution (inflation) hierarchy** *is* a cascade — the open test is whether that hierarchy is **generalized‑Morton/Hilbert‑addressable** (arXiv 2309.15199, Walker — non‑power‑of‑2 + 3D Morton/Hilbert). If yes: anti‑moiré‑by‑theorem **+** cascade addressing. Hexagonal substrate ties to the `m²−mn+n²` (Eisenstein) covering norm of arXiv 2203.09323 (Richter). | anti‑moiré **G**; cascade‑addressability **H** | EPIPHANY | §7 papers | D‑BGZ17, D‑QUANTGATE, D‑CASCADE | +| **D‑MONOTILE** | **the *third* anti‑moiré route — strongest, by theorem.** An **aperiodic monotile** (the "hat," Smith‑Myers‑Kaplan‑Goodman‑Strauss 2023; arXiv **2509.12216** Kaplan) is a *single shape that tiles the plane only non‑periodically* → it has **no translational period → no moiré beat, by a tiling theorem**, not by placement (D‑MANTISSA, `[H]` continuous) or by base‑coprimality (D‑BGZ17, `[H]`‑bounded). **The anti‑moiré is `[G]` (proven), and it survives quantization (a fixed discrete shape, immutable)** — so it satisfies D‑QUANTGATE *intrinsically*. **Cost / open question (`[H]`):** the hat is a **polykite on a hexagon+triangle lattice**, not the square Morton quadtree; adopting it changes the cascade geometry. Its **substitution (inflation) hierarchy** *is* a cascade — the open test is whether that hierarchy is **generalized‑Morton/Hilbert‑addressable** (arXiv 2309.15199, Walker — non‑power‑of‑2 + 3D Morton/Hilbert). If yes: anti‑moiré‑by‑theorem **+** cascade addressing. Hexagonal substrate ties to the `m²−mn+n²` (Eisenstein) covering norm of arXiv 2203.09323 (Richter). | anti‑moiré **G**; cascade‑addressability **H** — **promotion condition tightened (2026‑06‑10):** `[H]→[G]` ONLY if the substitution hierarchy is shown generalized‑Morton/Hilbert‑addressable (the Walker leg) AND the tiling is hat‑equivalent (or the addressing provably generalizes) — a 5+3 pass alone does NOT promote (F2 bridge condition) | EPIPHANY | §7 papers; `quasicryth-research` (arXiv 2603.14999) is the purpose‑described crate — F2 reads it | D‑BGZ17, D‑QUANTGATE, D‑CASCADE | ### 2.5 Amortization gate @@ -176,7 +180,7 @@ two halves of a cell. ADR‑026 names the cascade that ties them. | D‑COLUMNAR | Morton‑keyed columnar rows + prefix pushdown = tile fetch (Delta `ZORDER`/Iceberg/BigQuery — deployed) | G | EPIPHANY | SYN §7.5 | D‑IMMAT | | D‑LANCE | "parquet‑shaped" = the columnar family; **Lance** is the instance (random tile access > Parquet row‑group scan) | G | EPIPHANY | SYN §7.5 | D‑COLUMNAR | | D‑PYRAMID | the unifying shape: columnar (parquet) + Morton rows (grid) + level cascade (pyramid) + closed‑form cell (shader) | H | EPIPHANY | SYN §7.5 | D‑COLUMNAR, D‑CASCADE | -| D‑DELTA | delta frames = version‑diff = changed Morton cells = codec P‑frame (I/P map; B does not, append‑only log) | H | EPIPHANY | SYN §7.5,§1 | D‑LANCE | +| D‑DELTA | delta frames = version‑diff = changed Morton cells = codec P‑frame (I/P map; B does not, append‑only log). **Label fold (2026‑06‑10, 5+3):** a Lance `DatasetVersion` is a **self‑contained snapshot** and `last_active_cycle` is a per‑row **RECENCY stamp** (WHEN, not WHAT) — consumers watermark‑filter, never diff‑reconstruct; the *mechanism* stays `[G]`, only the "changed‑cell delta" label is corrected | H→G (mechanism) | EPIPHANY | SYN §7.5,§1; INTEGRATION‑MAP L6 | D‑LANCE | ### 2.7 Cross‑domain synergy catalog @@ -215,6 +219,20 @@ two halves of a cell. ADR‑026 names the cascade that ties them. | D‑LITMUS‑FMA | FMA bones‑rendering = compile‑time HHTL litmus (~75K static classes) | H | doc | `RDF-OWL-ALIGNMENT.md §6` | | D‑LITMUS‑GEO | OSM = geographic litmus; "Femur is_a LongBone AND Marienplatz is_in Munich" sub‑µs | H | doc | `DOMAIN-INSTANCES.md §2.6` | +### 2.10 The GUID canon pins (operator, 2026‑06‑10) — canon = `CLAUDE.md` P0; this table indexes, never re‑derives + +| ID | Shape | Grade | Status | Home | Deps | +|---|---|:--:|:--:|---|---| +| **D‑CANON‑GUID** | the canonical identity is **HEX‑counted — it IS the GUID**: dash‑groups `8‑4‑4‑4‑12` = `classid‑HEEL‑HIP‑TWIG‑[basin·leaf(6)+identity(6)]`; 1 hex = 1 nibble = 1 tree level; self‑describing at sight; wrappers (NodeGuid #480) audited against it group‑by‑group, never the reverse | G (operator‑pinned) | **CANON** | `CLAUDE.md` P0; INTEGRATION‑MAP L0 | — | +| D‑KEYKV | **the GUID is the key of key‑value**: node = `key(128) + value(3968)` = 4096 bits; the key routes/resolves/compares/scopes/names with **zero value decode**; Lance compresses the value freely — compression never costs addressability | G (operator‑pinned) | CANON | `CLAUDE.md` P0 | D‑CANON‑GUID | +| D‑3X4 | **3 tiers × 4 nibbles, uniform**; `tier = nibble >> 2` (shift, never branch/divide); tiers u16‑aligned; dashes = tiers; RFC 9562 = **wrapper concern** (v8‑native was pinned then REVERSED — the 4/3/3 carving broke Morton stride uniformity); **standing watch** vs 4×3 with falsifiable flip condition | G (pinned) + watch | CANON | `CLAUDE.md` P0 + standing‑watch §; INTEGRATION‑MAP §9.10–11 | D‑CANON‑GUID | +| D‑TILE256 | each tier's 64k = a **256×256 centroid tile** (two byte‑axes, nibble‑interleaved); path = 6 bytes = **CAM‑PQ 6×256** → path distance = 3 tier‑LUT lookups O(1); rigor condition: codebooks built as **4⁴ hierarchies** so nibble prefixes = centroid ancestry | H + named test (PROBE‑CODEBOOK‑44 / F11‑adjacent) | EPIPHANY→CANON‑pin | `CLAUDE.md` P0 | D‑CANON‑GUID, D‑CAM, D‑PAL256 | +| D‑PREFIXBOOK | **codebook scoping = the class routing prefix** — longest‑prefix binding on the key's own hierarchy; per‑class 256⁶ semantic spaces for free; axis binding (x/y vs PQ pairs) is a class‑record property; codebooks mint with the class (Phase B shelf, D‑AMORT) | G (mechanism) / H (mint) | CANON‑pin | `CLAUDE.md` P0 | D‑TILE256, D‑AMORT | +| D‑PHASE | **perturbation = deterministic phase**: (exponent, location, phase, magnitude) — three terms derive from the KEY; **only the magnitude envelope is stored**; lossless for synthesis by construction; analysis remainder escalates per the quorum certificate; **D‑QUANTGATE picks the generator** (coprime‑integer `CurveRuler` in quantized layers); doubles as the anti‑moiré dither; cost scales with magnitude smoothness, not bandwidth | H + probes (PHASE‑1, PERT‑RHO, PYR‑1) | CANON‑pin | `CLAUDE.md` P0; ndarray `guid-prefix-shape-routing.md` §4 | D‑MANTISSA, D‑QUANTGATE, D‑IMMAT | +| D‑WHP | **bipolar phase = Walsh‑Hadamard on VSA**: signed (±1) phase makes the cascade the WH transform of the address tree; **sign = XOR (`vsa_bind`), magnitude = `vsa_bundle`** — the TWO‑ALGEBRA rule (raw‑XOR on magnitudes breaks Markov, I‑SUBSTRATE‑MARKOV); superposition + unbind‑by‑role‑key; N ≤ √d/4 IS the substrate's uncertainty principle; roundtrip bit‑exact; "quantum‑like" = the bundling algebra, NOT measurement randomness | H + probes (WHP‑1..4) | CANON‑pin | `CLAUDE.md` P0; ndarray §4b; lance‑graph §7 + E‑WHP‑BIPOLAR‑1 | D‑PHASE, D‑MANTISSA | +| D‑DELEG‑INHERIT (né D‑OTP‑INHERIT) | DO‑axis behavior resolution = **prototype‑chain delegation** (Self, Lieberman 1986) carried ON the supervision topology — **NOT an OTP behavior** (supervisors restart, they don't dispatch); diamonds have NO prefix encoding (tree relation) → ordered `mixins` traversal is the absent second mechanism; Odoo = C3 over `LastOrderedSet` install order, not naive source C3 | H + gate F1 (chain + diamond fixture) | EPIPHANY | INTEGRATION‑MAP §3 + F1 | D‑CANON‑GUID, `[per rt]` state_machine | +| D‑IDENTITY‑PIN | lance‑graph `NodeGuid` (#480) = the **wrapper carving** of the canon — groups 1–2 + 24‑bit `local` already match exactly; Phase B audits groups 3–4 yielding all eight nibbles to HIP/TWIG; `IDENTITY_LAYOUT_VERSION` stamp = the version gate | G (wrapper) / H (group 3–4 audit) | CODED (wrapper) | lance‑graph `identity.rs`; INTEGRATION‑MAP S1 | D‑CANON‑GUID | + --- ## 3. The materialization pipeline — what's ready, what's blocked @@ -282,7 +300,7 @@ on both sides** (the next materialization). | **D‑MORTON, D‑CASCADE, D‑XOR2 (containment)** | `lance-graph-contract/src/hhtl.rs`: `NiblePath { path:u64, depth:u8 }`, `FAN_OUT=16`, `MAX_DEPTH=16` (16 nibbles = 64 bits), `parent()=path>>4`, `child(n)=(path<<4)\|n`, `is_ancestor_of` = a single prefix‑shift kernel, `common_ancestor` = LCA. (q4‑hhtl‑audit) | **the runtime SHIPS the nibble address algebra** — these are CODED runtime‑side, not just EPIPHANY | | **D‑IMMAT, D‑COLUMNAR, ADR‑022** | `soa-three-tier-model.md` invariant: *"zero‑copy from creation to Lance tombstone … no bytes leave the backing store … even then the in‑memory store is unchanged, not serialized and freed."* `MailboxSoA::emit()` + `CollapseGateEmission` **scheduled for removal** | the "immaterialized, never serialized" finding IS the runtime's ONE invariant; the serialization path is being **deleted** | | **D‑COLUMNAR, D‑LANCE (column projection)** | `soa_envelope.rs`: `SoaEnvelope` trait — `columns()->&[ColumnDescriptor]`, `ColumnDescriptor{name_id,kind,elems_per_row,row_offset}` (`repr(C)`), zero‑copy `row_le`/`column_le` views, `as_le_bytes()`, `verify_layout()` gate | the "Morton‑keyed columnar + projection" framing is the `SoaEnvelope` ABI, line‑for‑line | -| **D‑DELTA (delta frames = version‑diff)** | `cycle()->u32` stamp; *"a Lance version IS a coherent LE envelope"* (soa_envelope L16); `last_active_cycle [u32;N]` = per‑row same‑cycle write guard; `DatasetVersion(v)→(v+1)` | a Lance version = a frame; the per‑row cycle stamp = the changed‑cell delta → **D‑DELTA promotes [H]→[G]** | +| **D‑DELTA (delta frames = version‑diff)** | `cycle()->u32` stamp; *"a Lance version IS a coherent LE envelope"* (soa_envelope L16); `last_active_cycle [u32;N]` = per‑row same‑cycle write guard; `DatasetVersion(v)→(v+1)` | a Lance version = a **self‑contained snapshot** ("frame"); the per‑row cycle stamp = a **RECENCY stamp** (WHEN last changed — watermark‑filter, never diff‑reconstruct; label corrected 2026‑06‑10) → **D‑DELTA promotes [H]→[G]** on the mechanism | | **D‑AMORT (amortize‑or‑don't‑spend)** | PR #478 mechanical test: *never‑mutated → const codebook, **keep**; mutated‑after‑init → SoA snapshot, **nudge**.* Read‑only codebooks (role keys, UDFs, `simd_caps`) stay const | the gate's storage instance, **operationalized** — const codebooks = the amortized build‑once structures; SoA = per‑cycle mutable | ### Revision — runtime evidence corrects a finding ⚠ diff --git a/docs/INTEGRATION-MAP.md b/docs/INTEGRATION-MAP.md new file mode 100644 index 0000000..7469aa4 --- /dev/null +++ b/docs/INTEGRATION-MAP.md @@ -0,0 +1,464 @@ +# INTEGRATION MAP — how the substrate composes across repos + +> **Status: LIVING MAP v1.1** (2026‑06‑09; v1.1 = hardened by the 5+3 +> savant pass — capacity table L0b, delegation lineage corrected, gates +> F10–F14, Track O7 promoted — **plus the G-pass logic audit** (B joined +> the critical path, diamond ≠ prefix-tree, shape_hash risk-model fixed, +> F2 bridge condition, F14 run-gate) — **plus the canon-pass (operator, +> 2026‑06‑10): the pinned canonical is HEX-counted — it IS the GUID, +> whose `8-4-4-4-12` dash-groups carry the semantics +> `classid-HEEL-HIP-TWIG-[basin6+id6]` (32 hex = 128 bit); hierarchy is +> the overflow; wrappers are audited against the canon group-by-group +> and never the reverse**). Companion to `DISCOVERY-MAP.md` — +> the discovery map indexes *what was found*; **this maps *how it +> composes*: layers, seams, phases, gates.** Implementation follows this +> map; the map precedes the code (the "document before it dilutes" +> mandate). +> +> **How to read.** Same grading as the discovery map: `[G]` grounded +> (theorem / shipped code / measurement), `[H]` hypothesis **with a named +> test**, `[S]` speculative (catalog only). Code-existence uses the +> runtime‑archaeologist scale: **CODED** (file:line), **CLAIMED** (prose +> or module-doc only), **ABSENT** (a valid finding). Provenance marks: +> `[per rt]` = runtime-session-owned receipt; `[per xs]` = verified by +> the parallel session's first-hand read (CCA2A feedback), not re-read +> here. +> +> **Cross‑PR caveat** (same as the map's `SYN` legend): rows citing +> lance‑graph plans/boards reference `/home/user/lance-graph` state at +> main `62bca5e` (post **#480**); OGAR rows reference this branch. + +--- + +## 0. The one picture + +``` +SOURCES Odoo 17 (Python) OpenProject (Ruby/Rails) SurrealQL DDL TTL/RDF ClickHouse DDL Elixir/HIRO + │ ogar-python [ABSENT] │ ruff_openproject [G per xs] │ parse walk [H] │ [G] │ [G] │ scaffold [G] + ▼ (Track O3) ▼ SPO → op-codegen-projection ▼ (Track O2) ▼ ▼ ▼ +PRODUCERS ─────────────────────────────────────────────────────────────────────────────────────────────────────────────── + ╔════════════════════ OGAR IR (the spine) ════════════════════╗ +THINK arm Class { attributes, associations (4× AR kinds), enums, scopes, mixins, + methods, callbacks, validations, computed_fields, + parent — SHIPPED: Option (ogar-vocab lib.rs:95) · CONTRACT-SPEC: + Option ("subClassOf == supervision edge"); the String→Identity + lift is Track O7 — ★CRITICAL PATH, gates R2/R4 } +DO arm ActionDef (separate SPO node, object_class → Class) + ActionInvocation (state: ActionState) +MEMBRANE KausalSpec { StateGuard | LifecycleTrigger | Depends{paths} } ← the only place domain + workflow survives IR flattening (OGAR-AST-CONTRACT §3) +IDENTITY THE CANONICAL GUID (operator-pinned; counted in HEX DIGITS, 32 hex = 128 bit): + xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + classid HEEL HIP TWIG family-basin-leaf(6)+identity(6) + 8 hex 4 4 4 12 hex + The UUID's own dash-groups ARE the semantic delimiters — every printed GUID + is self-describing at sight. The cascade tiers are literal hex groups; the + path nibbles ARE the tree (FAN_OUT=16, 4-bit nibble = 1 hex digit). + Shipped-code agreement: group1 (8 hex = 32b) = SchemaPtr.packed u32 · + group2 = PREFIX_NIBBLES=4 · the 6+6 tail = EdgeRef-24b / LOCAL_BITS=24. + NodeGuid (#480) = the lance-graph carving of this GUID — Phase B audits it + GROUP BY GROUP against the canon (see L0 apex row for the one collision). + ╚═════════════════════════════════════════════════════════════╝ +ADAPTERS emit_surrealql_ddl [G] · ogar-adapter-ttl [G] · ogar-adapter-clickhouse-ddl [G] + · ogar-knowable-from (vart-backend) [G] · parse_surrealql_ddl walk [H scaffold] +CONTRACT lance-graph-contract: TripletProjection · SoaEnvelope · ClassView/FieldMask · kanban + (KanbanColumn/KanbanMove/ExecTarget) · NodeGuid · CollapseGateEmission (Batons) +RUNTIME ractor: generic state_machine (OGAR-agnostic) + OGAR/Rubicon binding [R1 unverified] + · MailboxSoA columns (edges/meta/qualia/entity_type) · supervision routing by NiblePath + prefix (is_ancestor_of = one bit-shift) · commit_event sole-writer membrane +STORAGE Lance (DatasetVersion = self-contained snapshot, the "frame" of other docs; + last_active_cycle = per-row RECENCY stamp, not a delta) · SurrealDB + (TableDefinition::new_for_ddl → ToSql; kv-lance) · consumer stores via EntityKey(&[u8]) +CONSUMERS openproject-nexgen-rs · woa-rs (Odoo) · MedCare-rs (HIPAA, label-free) · smb-office-rs · q2 +``` + +The Firewall (ADR‑022/023) holds at every layer crossing: **no +serialization in the hot path** — inter‑mailbox state is Batons +(`(u16 target, CausalEdge64)`); the IR is wire‑truth; strings never +enter the SoA (§4). + +--- + +## 1. Layer inventory — what exists, with receipts + +### L0 — Identity & addressing + +| Piece | Where | Status | +|---|---|---| +| **THE CANONICAL ADDRESS — counted in HEX, it IS the GUID**: `classid(8 hex)‑HEEL(4)‑HIP(4)‑TWIG(4)‑[family‑basin‑leaf(6)+identity(6)]` = the UUID text format's own `8‑4‑4‑4‑12` dash-groups carrying the semantics. 32 hex = 128 bit. Path nibbles = the 16-ary tree (1 hex = 1 level); 12 path nibbles across HEEL/HIP/TWIG + leaf addressing inside the basin group ≈ hhtl.rs MAX_DEPTH=16. Shipped agreement: group1 = `SchemaPtr.packed` u32 (exact) · group2 = `PREFIX_NIBBLES=4` (exact) · tail 6+6 = `EdgeRef` 24 b / `LOCAL_BITS=24` (exact). **RFC question — RESOLVED: 3×4 UNIFORM, RFC-WAIVED (operator, 2026‑06‑10):** HEEL/HIP/TWIG keep all 4 nibbles each — uniform Morton stride, tier-of-level = `level >> 2` (shift, never branch); RFC 9562 is a WRAPPER format and wrappers adapt to the canon, never the reverse — RFC-needing boundaries adapt at their membrane; native/foreign discrimination via `classid`, not a format constant (§9.10 carries the full episode). **And the GUID is the KEY of key-value** (CLAUDE.md P0): node = 4096 bits = key(128) + value(3968) — the value is everything the key isn't; the key prerenders nodes with zero value decode; Lance may compress the value bits arbitrarily — **compression never costs addressability** | substrate canon (operator-pinned, 2026‑06‑10) | **CANONICAL** — everything below implements or WRAPS it; wrappers are audited against IT, never the reverse | +| `Identity` (NiblePath segments, class-side; 27‑bit segs, dict-encoded) | OGAR `ogar-ontology` (#31), `OGAR-AST-CONTRACT.md §1` | **[G] CODED** — the "27‑bit segments" doc note reconciles TO the canonical (§9.9) | +| `NiblePath{path:u64,depth:u8}`, `FAN_OUT=16`, `MAX_DEPTH=16`, `parent()`, `child()`, `is_ancestor_of` (prefix shift), LCA | lance-graph `contract/src/hhtl.rs` | **[G] CODED** `[per rt]` | +| `NodeGuid([u8;16])` UUIDv8 — octets: ns(1)·entity_type(2)·kind(1)·niblepath_prefix(2)·ver/depth(1)·shape_hash(22b)·local(24b)·layout_version(1)·spare(2) | lance-graph `contract/src/identity.rs:66-121` (#480, Phase A, 599 tests) | **[G] CODED — a CARVING of the canonical GUID**, group-by-group: groups 1–2 and the 24-bit local MATCH the canon exactly; groups 3–4 (canon: HIP/TWIG path nibbles) currently hold ver/depth + shape_hash + variant instead — **the Phase B audit question is whether shape_hash/layout_version yield those groups back to path nibbles or the canon accepts the RFC-carved variant** | +| The five register-reads of one GUID: **resolve** (entity_type→ClassView) / **route** (niblepath prefix `is_ancestor_of`) / **witness** (frozen bytes + merkle) / **ground‑truth** (shape_hash drift) / **dispatch‑to‑store** (`as_bytes()`→EntityKey) | `identity.rs:31-37` | **[G] CODED** | +| Bijection law: `entity_type:u16` canonical/exact; `NiblePath` the derived view; GUID prefix = 4‑nibble routing cache; **registry mints `(entity_type, NiblePath)` unique pairs** | `identity-architecture-exists-vs-needs-v1.md` (ratified 2026‑06‑09) | **[G] law / [H] mint** — mint + build-time round-trip = lance-graph **Phase B** | +| `SchemaPtr.packed:u32=[ns:8\|entity_type:16\|kind:8]`, `ClassId=u16` ("never a content hash"), `EntityTypeId=u16`, `EdgeRef{family:u8,local:u16}`, `StructuralSignature` | namespace.rs:119 · class_view.rs:53 · ontology.rs:81 · episodic_edges.rs:34 · odoo_blueprint | **[G] CODED** (StructuralSignature: [G] type / [H] live-wire → Phase B) | +| `class_id` **aliases** the `entity_type` slot on the SoA row — no new column | soa_view.rs:47 `[per xs]` | **[G] CODED** | +| Cold-path identity TODAY: `node_id:u32` + String labels (MetadataStore), `u64` content `dn_hash` (SpoStore), `CogRecord` id-less | metadata.rs:60,86 · spo/store.rs:38 · cogrecord.rs:56 | **[G] CODED but the gap NodeGuid fills** → Phase F migration | + +### L0b — bounded-by-design vocabularies + wrapper-field policies (canon-pass reframe) + +> **Canon-pass correction (operator, 2026‑06‑10):** bounded widths are the +> DESIGN — the escape for scale is **the next cascade level**, never wider +> integers. The rows below are **lance-graph WRAPPER field policies** +> (they constrain #480's GUID carving, not the substrate canon) — except +> the FieldMask row, which is an empirical finding with a canonical +> answer. Volume rows are estimates with stated assumptions. + +| Field | Width | Ceiling | First-consumer impact | Escape | +|---|---|---|---|---| +| `entity_type` | u16 | 65,536 classes | Odoo ~3.1k ✓; SNOMED ~350k / planet-scale ✗ | TD‑WIKI‑SCALE family; widen at the registry mint when a >64k ontology lands | +| `shape_hash` | 22 b | **G-pass risk-model correction:** comparisons are SAME-CLASS, temporal only (stored vs current hash of one class) — cross-class hashes are never compared (`entity_type` discriminates). Relevant miss = h(old)=h(new) per schema change ≈ 2⁻²² (~2.4e‑7), **negligible** | the birthday-over-all-classes figure (50% @ ~2,411) answered the wrong population | keep 22 b; PIN the use-invariant "never compare cross-class" — if that is ever violated, the birthday math applies and 22 b is too small (§9.6) | +| `local` | 24 b | 16,777,216 per minting scope — **the scope itself is UNSPECIFIED** (global per (ns, entity_type)? per tenant? per prefix?) | IF global per (ns, entity_type): `account.move.line` exceeds in ~10 tenant-years (assumes ~1.7M lines/tenant-yr vs 2²⁴ ≈ 16.8M — an estimate, not a theorem) | §9.7 = first PIN the minting scope, THEN pick the escape (prefix-shard / widen / per-tenant ns) | +| `FieldMask` | u64 | **64 fields**; positions ≥64 silently IGNORED (#441 N3, class_view.rs:76) | **BLOCKER: `account.move` carries 109 field declarations (counted first-hand, account_move.py Odoo 17 — auditor-measured) → THINK render silently drops 45+** | **canonical answer: page via the hierarchy** (a wide class = a basin of field-pages — the cascade IS the overflow mechanism); multi-word mask is merely a wrapper option — **Track X7 + gate F14** | +| `niblepath_prefix` | 16 b / 4 nibbles | depth >4 → prefix-only routing | none — falls back to `entity_type` resolve (documented in identity.rs) | ✓ | + +### L1 — The OGAR IR (the two arms + the membrane) + +| Piece | Shape | Status | +|---|---|---| +| **THINK arm** `Class` | contract §1: `{identity, name, parent: Option ("subClassOf == supervision edge"), language, mixins, store_accessors, associations, enums, scopes, callbacks, computed_fields, methods, validations, attributes}`. **Shipped `ogar-vocab::Class.parent` is `Option` (lib.rs:95)** — the typed edge is SPEC, not shipped (the contract's "mirrors the RecordBatch schemas 1:1" claim holds *except* this parent type — that exception IS the O7 divergence) | **[G] CODED (vocab) / [H] typed-edge** — the supervision-edge binding is real only after Track O7 | +| **DO arm — static** `ActionDef` | separate SPO node: `{identity, predicate, object_class → Class, default_subject/temporal/modal, kausal: KausalSpec, method_body, results_in: StateTransition, on_enter: EnterEffect, guard_failure_policy, state_timeout_millis}` | **[G] CODED** (§1; statem terms landed OGAR PR #10) | +| **DO arm — dynamic** `ActionInvocation` | `{identity, realizes → ActionDef, state: ActionState (Pending→Committed/Failed/Cancelled), subject, object_instance, lokal, idempotency_key, trace_id, parent_invocation, emitted_at_millis, failure_reason}` | **[G] CODED** (§1) | +| **The membrane** `KausalSpec` | `StateGuard{field,value} \| LifecycleTrigger \| DependsPath \| None` — *"the only place a domain workflow survives the IR flattening"*; lifecycle (machine) ≠ workflow (data) | **[G] CODED + doctrine** (§3: *"Lifecycle formalized; workflow as data"*) | +| **The four AR primitives** `AssociationKind` | `BelongsTo / HasOne / HasMany / HasAndBelongsToMany` — cross‑ORM: Rails verbatim; Odoo `Many2one/One2many/Many2many` (has_one = One2many constrained to 1) | **[G] CODED** `ogar-vocab/src/lib.rs:655-664` | +| `Association` full option set | `class_name, foreign_key, polymorphic, through, source, as_target, dependent` (app-level) **separate from** `ondelete` (DB-level), `optional, inverse_of, before/after_add/remove, scope_source, auto_join, context_source, check_company, delegate` | **[G] CODED** `lib.rs:672-732` | +| **Traversal vocabulary** `::includes / ::memberof() / ::members() / ::groups::members()` | methods on `Class` (`member_of(name)`, `members(name)`, `group_members(name)`, `includes()`, `associations_of(kind)`, `members_through(name)`) — per The Click: methods on the carrier, never free functions | **ABSENT** — the data is there, the API isn't. **Track O1**, ~50 LOC | +| **Two `Class` shapes** | producer-side `ogar-vocab::Class.parent: Option` (**verified first-hand, lib.rs:95**) vs canonical contract §1 `Option` — the String→Identity lift | **[G] divergence** → **Track O7, ★PROMOTED to critical path**: until it lands, the IR carries no typed edge — R2/R4 would lean on mint-side name resolution; land O7 or name that coupling (pairs with the registry mint + D-ODOO-BP-1c/d/e) | + +### L2 — Producers (source → IR) + +| Producer | Source | Status | +|---|---|---| +| `ogar-python` | Odoo 17.0 core (`@api.depends/@api.onchange/@api.constrains` → `ActionDef` per `ADAPTERS-AND-ACTORS §3.4.1`; `_inherits` → mixins; mapping locked `ODOO-TRANSCODING.md §3,§5`) | **ABSENT** (queued) → **Track O3** | +| `ruff_openproject` / `ruff_ruby_spo` | Rails AR source → SPO triples; vendored in openproject‑nexgen‑rs; test extracts `[TimeEntry, WorkPackage]` from a Rails fixture | **[G] CODED** `[per xs]` | +| `parse_surrealql_ddl` walk | SurrealQL DDL → `Vec`: DEFINE TABLE→Class; `record`→BelongsTo; `option>`→BelongsTo+optional; `option`→Attribute(required=false). NOT yet: `ASSERT IN`→EnumDecl, DEFINE EVENT→ActionDef, non-owning-side post-pass | **[H] scaffold** — feature `surrealdb-parser` wired (OGAR #23 rust 1.95), walk partial (`ogar-adapter-surrealql/src/lib.rs:143-165, 219-299`) → **Track O2** | +| `ogar-from-elixir` (HIRO `gen_statem` → Rubicon) | Elixir | **[G] scaffold** | +| `ogar-from-ruby` (generic Rails) | — | **ABSENT**; decision: build vs reuse the nexgen ruff path → **Track O4** | + +### L3 — Adapters (IR → target forms) + +| Adapter | Direction | Status | +|---|---|---| +| `emit_surrealql_ddl(&[Class]) → String` | IR → SurrealQL DDL | **[G] CODED** (hand formatter; signature durable — body swaps to `TableDefinition::new_for_ddl().with_*() + ToSql::to_sql()` when convergence lands, `lib.rs:68-77`) | +| `ogar-adapter-ttl` (Turtle round-trip), `ogar-adapter-clickhouse-ddl` (dotted-name round-trip) | bidirectional | **[G] CODED** (#37, #38/#40) | +| `ogar-knowable-from` — `KnowableFromWriter` trait + `register_class_knowable_from`; `surrealql-hint` (self-describing via emit); `vart-backend` (`Tree`, NULL-terminated keys) | IR → registry | **[G] CODED** (#25/#33/#43); Lance writer impl = `lance-bind` boundary **[H]** | +| `TripleEmitter` (129 RDF predicates, SPO + TeKaMoLo) | IR → triples | **[G] CODED** | + +### L4 — The contract spine (lance-graph-contract, zero-dep) + +| Piece | Status | +|---|---| +| `TripletProjection` + `roundtrip_eq → RoundTripFailure` (codegen_spine.rs:107) | **[G] trait** — impls: `op-codegen-projection` **[G per xs]**; odoo blueprint **CLAIMED**; cognitive-write **ABSENT → Phase D** | +| `SoaEnvelope` + `ColumnDescriptor` (byte-geometry ONLY; "width only — no domain meaning"; `name_id` is an ordinal, NOT a string) | **[G] trait / [H] zero PRODUCTION impls** (only `#[cfg(test)] TestEnvelope`, soa_envelope.rs:266) → **Phase C is the keystone gate** | +| `ClassView` (resolve-late from OGIT cache) + `FieldMask(u64)` presence + `FieldMask::inherit(delta)` = the HHTL `subClassOf` walk as bitwise parent-OR-delta | **[G] CODED** (#441) | +| Rubicon kanban: `KanbanColumn`(6: Planning/CognitiveWork/Evaluation/Commit/Plan/Prune), `KanbanMove ≤16B`, `ExecTarget`(Native/Jit/SurrealQl/Elixir), `MailboxSoaOwner::try_advance_phase()` (checked DAG), Libet −550 ms anchor | **[G] CODED** (#437) | +| 34 `Tactic` kernels over `ThoughtCtx` (the executable bodies DO dispatches into) | **[G] CODED** (#411) | +| Batons: `CollapseGateEmission` `(u16, CausalEdge64)`; `wire_cost_bytes()=13+10·n` — header 13 B = `source_mailbox u32 + chain_position u32 + merge_mode u8 + 4 B reserved` (**verified** collapse_gate.rs:114-124); 10 B/baton = u16+u64 | **[G] CODED + arithmetic verified** — the Firewall's hot-path carrier | + +### L5 — Runtime (ractor + mailbox + membrane) + +| Piece | Status | +|---|---| +| Generic `state_machine` crate (ractor_actors) — OGAR-agnostic; `Context` opaque; `on_enter` → `CommitHook` | **CLAIMED** (contract §0; runtime-session-owned) → **Track R1: verify first-hand** | +| OGAR/Rubicon binding (fills Context/Event/State; the callcenter codegen lands here; "the class IS the actor spec — the actor is *generated from* the `Class`") | **CLAIMED** → **R2** | +| Routing-on-miss up the parent edge by NiblePath prefix (`route` reading of NodeGuid; one bit-shift) — **prototype-chain DELEGATION semantics (Self/Smalltalk lineage), NOT OTP message routing**: OTP supervisors restart on failure, they do not dispatch | **[G] mechanism** (identity.rs + hhtl.rs) / **[H] wiring** → R2/R4 must wire delegation explicitly; restart coverage ≠ dispatch coverage | +| `MailboxSoA` columns `edges[CausalEdge64;N]` / `meta[MetaWord;N]` / `qualia` / `entity_type` — edges and meta SEPARATE (**that fact is [G]**; D‑META64's bit-budget reconciliation to `MetaWord` is **still [H]/REVISE** — this row does not close it) | **[G] CODED** `[per rt]` (#477) | +| `commit_event` sole-writer + `ExternalMembrane::project` + `CommitFilter`/`MembraneGate`; today emits scalar `CognitiveEventRow` | **[G] CODED** (lance_membrane.rs:315) — node/edge `project_graph` **ABSENT → Phase E** | +| HEEL/HIP/TWIG/LEAF cascade legend in `high_heel.rs` | **CLAIMED only** — "no code routes by prefix" (q4‑hhtl‑audit) → **Track X4** (also resolves D‑BGZ17's §4.1 unwired gap) | + +### L6 — Storage + +| Piece | Status | +|---|---| +| Lance: `DatasetVersion(v)→(v+1)` = **self-contained immutable snapshot** (the "frame" of other docs; no delta chain — any version readable alone); `last_active_cycle[u32;N]` = **per-row RECENCY stamp** (WHEN last changed, not WHAT — consumers watermark-filter `WHERE cycle > watermark`, never diff-reconstruct; Phase E depends on this reading) (**D‑DELTA's mechanism stays [G]** — only the "changed-cell delta" *label* is corrected; fold owed, H2) | **[G] CODED** `[per rt]` | +| SurrealDB fork (local `/home/user/surrealdb`): `surrealdb/{ast,parser,core}`; `TableType::{Normal,Relation,Any}` (table_type.rs:8); `TableDefinition::new_for_ddl` (catalog/table.rs:161) | **[G] CODED** upstream | +| `kv-lance` pins `lance =6.0.0` vs workspace `=7.0.0` | **[G] debt** TD‑SURREALDB‑KVLANCE‑LANCE7 — blocks the kv-lance storage engine resolving; companion fork PR owed | +| Consumer stores via `EntityKey<'a>(&'a [u8])` — length-agnostic; smb `key_to_filter` branches on length (12→ObjectId, else Binary); a 16-byte GUID is "just another length" | **[G] CODED** (repository.rs:12; smb mongo.rs:79/lance.rs:92; MedCare dms.rs:14) → **Phase G** wiring | + +### L7 — Consumers + +| Consumer | Integration shape | Status | +|---|---|---| +| **openproject-nexgen-rs** (local; 298 tests) | vendors ruff extractors + lance-graph-contract; `op-codegen-projection impl TripletProjection`; owns `op-surreal-ast` (mirror of surrealdb-core::catalog). Convergence: *"op-codegen-projection is a special case of the general OGAR `Class` → `TableDefinition::new_for_ddl()`"* (OPENPROJECT‑TRANSCODING §10.2) | **[G] sibling on the same spine** `[per xs]` — not yet an `ogar-vocab` dependent | +| **woa-rs / Odoo** | consumes via the blueprint (`OdooEntity` typed, 12 TIER-1 addons extracted #426) + the queued `ogar-python` | **[G] blueprint / ABSENT producer** | +| **MedCare-rs** | label-free contract IS the PII guarantee (HHTL leaf-rename at adapter, D‑PII); `column_mask_bridge`; `EntityKey` import | **[G] CODED** | +| **q2 cockpit** | `graph_render` contract surface | **[G] types** (stubs-dedup debt TD‑Q2‑STUBS‑DEDUP‑1) | + +--- + +## 2. The seams — every cross-boundary contract + +| # | Seam | Producer side | Consumer side | Contract type | Status | +|---|---|---|---|---|---| +| S1 | **class identity ↔ instance identity** | OGAR `Identity` (NiblePath) | lance-graph `NodeGuid` | registry mint `(entity_type ↔ NiblePath)` bijection | **[G] type / [H] mint** (Phase B) — **canon-pass correction**: the canonical nibble layout is PINNED (HEEL/HIP/TWIG are address nibbles; lance hhtl.rs 4-bit nibbles AGREE with it); what reconciles is the OGAR contract §1 "27-bit segments" doc note — fix the note TO the canon, not vice versa (§9.9). Phase B additionally audits NodeGuid's embedding of the canonical u32 | +| S2 | **IR → SurrealQL DDL** | `emit_surrealql_ddl` | SurrealDB `DEFINE TABLE/FIELD` | DDL string; future body = `TableDefinition::new_for_ddl` | **[G] wired** | +| S3 | **SurrealQL DDL → IR** | surrealdb-parser AST | `walk_query → Vec` | `Parser::enter_parse::` (depth 1000) | **[H] partial walk** (O2) | +| S4 | **knowable_from** (the four-clock pin) | `ogar-adapter-surrealql` stamps at DDL registration | `lance-graph-planner::temporal::classify` deinterlaces (lance version / schema / awareness / thinking) | `LanceVersion` via `KnowableFromWriter` | **[G] pin (ADR‑010) / [H] Lance writer impl**; consumer `temporal.rs` landed #479 | +| S5 | **AR source → SPO → DDL** | `ruff_openproject` | `op-codegen-projection` | `lance_graph_contract::codegen_spine::TripletProjection` | **[G] CODED first-hand** — `impl TripletProjection for OpSurrealProjection`, op-codegen-projection/src/lib.rs:213 | +| S6 | **ActionDef → runtime** | OGAR DO arm | `ractor_actors::state_machine` via the OGAR/Rubicon binding (`CommitHook`; Context opaque) — delegation-on-miss is OGAR's own dispatch design, **not** an OTP behavior; R1 verifies the binding wires it explicitly | the §0 two-layer contract | **CLAIMED → R1/R2** | +| S7 | **mailbox bytes ↔ cold bytes** | `MailboxSoA` | Lance columnar | `SoaEnvelope` (`as_le_bytes().as_ptr()==backing`; `verify_layout()`) | **[H] ZERO impls → Phase C (keystone)** | +| S8 | **cycle → graph** | committed cycle | queryable `NodeGuid` nodes + edge ids (**`EdgeGuid` itself ABSENT** — only `NodeGuid` shipped; EdgeGuid is Phase‑E design surface, not code) | `project_graph` through `commit_event`+gate | **ABSENT → Phase E** | +| S9 | **GUID → consumer store** | any | smb/MedCare/Lance | `EntityKey(guid.as_bytes())` | **[G] transport / [H] 16-byte wiring** (Phase G) | +| S10 | **content display** | SoA refs | rendered strings | `ClassView::render_rows` + tier dispatch (§4) | **[G] render / [H] tier byte** (O5) | +| S11 | **kind-generic codegen** | non-Odoo targets | `RouteBucketTyped` | blanket impl preserves `RouteBucket` | **ABSENT on main @ `62bca5e`** — the +228 working-tree WIP did not land (superseded or dropped); re-confirm with its session before planning on it | +| S12 | **PII boundary** | OGAR/OGIT labels | MedCare | label-free leaf-rename at adapter (D‑PII) | **[G] CODED** | + +--- + +## 3. DO vs THINK — the resolved architecture (the session's central correction) + +**THINK (Semantik / structural).** Resolution = a *graph walk*: +aggregate `{attributes, associations, computed_fields, enums, scopes}` +over `parent` + `mixins` edges; child shadows parent by identity slot +(Odoo `_inherit` semantics); presence at the row = `FieldMask`, and +`FieldMask::inherit(delta)` IS the subClassOf walk done as bitwise +parent-OR-delta — **structural presence only** (monotone union; a child +cannot structurally remove a parent field, and view-layer hiding like +Odoo `invisible=` is a display-side concern NOT representable in the +mask). Pre-computable per class at OGIT-classification time. Capacity +caveat: the mask is u64 — see **L0b / gate F14** for the >64-field +blocker on wide Odoo models. +Labels resolve LATE from the OGIT cache (`ClassView`); **zero labels in +the SoA bytes**. + +**DO (Pragmatik / behavioral).** NOT inherited as aggregated +`action_defs` — that model is **dead** (corrected from source). +`ActionDef`s are independent SPO nodes keyed `object_class → Class`. +Resolution = *runtime routing*: lookup `WHERE object_class = me`; on +miss, **walk the `parent` edge upward** — mechanically a NiblePath-prefix +`is_ancestor_of` bit-shift (NodeGuid's `route` reading). **Lineage +correction (5+3 pass): this is prototype-chain DELEGATION (Self, +Lieberman 1986; JS `__proto__`; Smalltalk's `doesNotUnderstand:` as the +class-chain cousin) carried +ON the supervision topology — it is NOT an OTP behavior.** OTP +supervisors restart on failure; they do not route unhandled messages. +One tree serves two orthogonal semantics (fault containment AND +delegation); R2/R4 must wire delegation explicitly — restart coverage +does not grant dispatch coverage. **Two G-pass invariants:** (1) prefix +ancestry is a TREE relation — the `is_ancestor_of` bit-shift covers only +the single-`parent` spine; **diamonds (multi-`_inherit`) have no prefix +encoding** and require an ORDERED `mixins` traversal — a second +mechanism, currently ABSENT, and precisely what F1(b) gates (the +bit-shift alone cannot pass it). (2) A delegated fire makes +`ActionDef.object_class` an ANCESTOR of the instance's class — +invocation validity must check `object_class is_ancestor_of +instance.class`, not equality, or every inherited fire is rejected. +Effects land as `CausalEdge64` +batons; lifecycle = `ActionState` on `ActionInvocation`; domain workflow += guarded `on_enter` effect at the `Pending→Committed` crossing. + +**The membrane = `KausalSpec`.** `Depends{paths}` references THINK +attribute-paths from inside DO triggers — the §0 endgame's "AST-named- +fact extraction" as a concrete typed predicate. One type ties the arms. + +**The instance pin = `NodeGuid`.** resolve / route / witness / +ground-truth / dispatch-to-store — five register reads of one frozen +key; write-once; drift repair = new immutable Lance version. + +**Open falsification (the architecture's make-or-break):** does +delegation routing reproduce Odoo `_inherit` resolution? `[H]` — gate F1. +Two grounded sharpenings (5+3 pass): **(1) Odoo is NOT naive C3 over the +source hierarchy** — `_build_model` assembles bases in `LastOrderedSet` +declaration/install order, then Python's C3 runs over THAT tuple; F1 must +replicate the assembly, not assume source-order C3. **(2) The fixture +needs a diamond**: D(B,C), B(A), C(A), method on A and C only — C3 order +`[D,B,C,A]` picks **C**; naive parent-first `[D,B,A,C]` picks **A**. A +single-chain `mail.thread` test cannot falsify. Named failure mode: if +the orders diverge, the fix is `Class.mixins` **ordering** carrying the +linearization — not the delegation walk itself. + +--- + +## 4. Content — strings become as cheap as CAM-PQ (the tier ROUTING table) + +**Framing correction (5+3 pass): T0–T5 are routing buckets by value +POPULATION, not fidelity tiers of one object.** A T4 dict entry is not a +lossy T5; there is no early-exit certificate. The codec cascade +(Full→…→Scent) downsamples the SAME object; this table PARTITIONS the +value space — related in spirit, different in mechanism. The SoA row +never carries a string; it carries a **ref-cell** +`{class_id:u16, field_id:u16, tier:u8, value_ref:u64}` — **13 B packed / +16 B `repr(C)`** (state the layout attribute explicitly; "12 B" was an +arithmetic error caught by the pass). Resolution happens only at the +display edge (`render_rows`, O(window)). + +| Tier | Stores | Ref | Backend | Status | +|---|---|---|---|---| +| T0 | schema labels (class/field/relation/enum) | 4 B | `OgitFamilyTable` (sparse `HashMap`) | **[G]** #364 | +| T1 | common English tokens | 12 b/word | deepnsm 4096-COCA (98.4% coverage) | **[G]** | +| T2 | top-256 values per `(class, field)` | 1 B | `bgz17::palette` per-pair codebooks | **[G] infra / [H] per-class palettes undeclared** | +| T3 | semantic text (meaning-bearing) | 48 b | CAM-PQ 6×256 (`contract::cam::CodecParams`) | **[G] codec / [H] text-encoder pre-pass** | +| T4 | unique-but-recurrent strings (names) | 4 B | Arrow `DictionaryArray` in a Lance pool dataset | **[H]** — upstream-free, contract surface unwritten | +| T5 | long-tail blobs | 8 B (content hash) | Lance blob, content-addressed | **[H]** contract unwritten | + +**The binding** (Track O5): `Attribute.content_tier: Tier` on the THINK +arm + a `contract::content_store::{ContentRef, Tier, ContentResolver}` +slice (~300 LOC) + one round-trip test across all six tiers (gate F7). +Iron rule throughout: **bundle identities, never content** +(I‑VSA‑IDENTITIES); the GUID/refs point, the stores hold. + +--- + +## 5. The phased dependency DAG (one merged sequence) + +``` + ┌── Q1 quasicryth vs D-MONOTILE (leaf; the crate self-identifies as the + │ Quasicryth transcode, arXiv 2603.14999 — substitution hierarchy + + │ deep-position, purpose-built for F2) ──→ feeds O6 +THEORY ├── Q2 spectral anti-moiré (jc P3 + hpc::fft) [per rt] + └── Q3 helix fidelity ≥0.9980 (TD-HELIX-OVERLAP-1) [per rt] + +IDENTITY A NodeGuid ✅(#480) ──→ B SchemaSig→ClassView live ─┐ +(lance- │ ├─→ D cognitive-write TripletProjection + graph └────────── C impl SoaEnvelope for MailboxSoA ──────┘ + roundtrip_eq (the account.move + N-arc) (KEYSTONE — leaf, unblocks D) fixture = gate F1+F5) + │ + G GUID-as-EntityKey (parallel off A) ▼ + E project_graph through commit_event + │ + ▼ + F MetadataStore string→identity + H SurrealQL read glove ─ BLOCKED(C) fork coords (only blocked phase) + +OGAR O1 Class traversal API (leaf, ~50 LOC) ──→ O2's non-owning post-pass + (G-pass: the real dependent — producers BUILD, consumers NAVIGATE; + O3/O4 benefit from O1 but are not gated by it) + O2 parse walk completion (EnumDecl lift · DEFINE EVENT→ActionDef · non-owning post-pass) + O3 ogar-python (Odoo) · O4 ruby producer decision (build vs reuse nexgen ruff) + O5 content_tier + ContentResolver (needs T-backends: all exist) + O6 ADR-026 draft (ready bucket; enriched by Q1's verdict) + O7 String→Identity lift — ★PROMOTED TO CRITICAL PATH: shipped parent is + Option (lib.rs:95); until O7, the IR carries no typed edge — + routing would lean on mint-side name resolution (Phase B); land O7 + or name that coupling explicitly + +DO-AXIS R1 verify state_machine + Rubicon binding (other session has the ball) + R2 ActionDef → state_machine lowering codegen (needs R1) + R3 account.move MRO falsification (needs C, D, R2) ← THE make-or-break + R4 supervision routing wired by prefix (with R2) + +RECONV X1 rename thinking_engine::CausalEdge64 → CascadeEvent64 (feature-gated) +(lance- X2 LE byte contract on canonical CausalEdge64 + SoaEnvelope tie-in + graph X3 D-MBX-2 ResonanceDto fold into MailboxSoA columns + debt) X4 HEEL/HIP/TWIG/LEAF route-by-prefix (closes q4 audit + D-BGZ17 §4.1 gap) + X5 TD-UNBUNDLE-FROM-1 raw-sum+count fix + X6 TD-ARIGRAPH-EPISODIC-FIDELITY-1 (Option B = W-slot convergence, D-CSV-6/7) + X7 FieldMask widening — multi-word / paged presence (the >64-field + BLOCKER, L0b; gates F14 and real Odoo THINK rendering) + +HYGIENE H1 SYN §3 co-revert on OGAR #47 (D-EXCITON mirror — outstanding) + H2 DISCOVERY-MAP folds: D-IDENTITY-PIN [G] · §4.1 wording → delegation-on- + supervision-topology (5+3 lineage fix) · D-META64 split note (separate + columns [G]; bit-budget reconciliation still [H]) · D-DELTA rewording + (recency stamp, not delta — enumerate ALL its sites in the map, 4+) · + D-MONOTILE promotion-condition tightening (Walker-addressable leg + required; a 5+3 pass alone does not promote — mirror of F2) · + birth D-DELEG-INHERIT (né D-OTP-INHERIT) · birth D-CANON-GUID (the + operator-pinned canonical: HEX-counted, the GUID's own 8-4-4-4-12 + dash-groups = classid-HEEL-HIP-TWIG-[basin6+id6]; 32 hex = 128 bit; + hierarchy = the overflow) · this map's cross-link + H3 lance-graph board prepends #477-480 (CLAUDE.md mandate; formally incomplete until done) + H4 merge order: #47 before #48 (SYN links) +``` + +**Critical path to the falsification that matters (G-pass corrected):** +`(C → D)` ∥ `((R1 ∥ O7 ∥ B) → R2)` → **R3**. Two fixes over v1.1: **B +(the registry mint) joins the path** — O7 types OGAR's edge, but B is +what makes the lance-side GUID prefix agree (S1); without B, R2's +routing and the instance GUIDs can disagree silently. And **R1 is a +parallel read, not downstream of O7**. Coordination risk: R1/R2 are the +only critical-path items owned by no present session (§7). Everything +else is parallel or feeds ADR-026. (Upstream nit, keeper-found: the +identity plan's prose path `A→(B,C)→D` conflicts with its own Phase-D +dep row `A, C` — this map follows the dep rows; B gates F, S1, and now +R2 — not D.) +**Leaf bricks available today:** Q1, O1, C, X1, X7-spec, H1–H4. + +--- + +## 6. Falsification gates — every load-bearing `[H]` with its named test + +| # | Gate | Test | Promotes / falsifies | +|---|---|---|---| +| F1 | **Delegation ≡ Odoo `_inherit`** | fixture MUST include **(a)** the single chain (`mail.thread`→`account.move`: `message_post` escalates and fires on the parent; `action_post` fires locally, `on_enter` writes `state→posted`, `results_in` lands as a baton) **AND (b) a diamond** D(B,C),B(A),C(A) with the method on A and C — C3-over-`LastOrderedSet` picks C, naive parent-first picks A; replicate Odoo's declaration-order base assembly, not source-order C3 | D‑DELEG‑INHERIT (né D‑OTP‑INHERIT — lineage corrected) `[H]→[G]`, or names the mixins-ordering fix | +| F2 | **Monotile addressability** | read `quasicryth-research/{tiling,hierarchy}.rs` + run `tests/paper_theorems.rs` (crate self-identifies, lib.rs:1-42, as the Quasicryth transcode, arXiv 2603.14999 — substitution hierarchy + deep-position, purpose-described for exactly this); cross-examine vs Kaplan/Walker/Richter | promotes `[H]→[G]` **only if the substitution hierarchy is shown generalized-Morton/Hilbert-addressable (the Walker leg) AND the crate's tiling is the hat / hat-equivalent class (or the addressing provably generalizes)** — otherwise the pass is vacuous for D‑MONOTILE (G-pass bridge condition); a 5+3 pass alone does NOT promote; failure = a concrete shape | +| F3 | **Spectral anti-moiré** | jc P3 (φ-Weyl) + `hpc::fft`: golden-tile spectrum pre/post quantization vs Base17 | D‑MOIRE/D‑MANTISSA `[H]→[G]` or falsified; D‑QUANTGATE contrast demo | +| F4 | **Eineindeutigkeit** | registry mint uniqueness + build-time `(entity_type ↔ NiblePath)` round-trip (Phase B); GUID prefix-consistency already green (Phase A) | S1 `[H] mint → [G]` | +| F5 | **Round-trip integrity** | `roundtrip_eq` over the identity graph; corrupt-pack must FAIL; NARS `(f,c)` within 1/1023 (Phase D DoD) | S8 path trustworthy | +| F6 | **Zero-copy geometry** | `SoaEnvelope::verify_layout()` green + `as_le_bytes().as_ptr()==backing` on `MailboxSoA` (Phase C DoD) | S7 `[H]→[G]` | +| F7 | **Content cascade round-trip** | build row → ref in SoA → `render_rows` → decode across T0–T5 → byte-equal | O5 ships or tier table revises | +| F8 | **Helix fidelity** | naive-u8 floor ≥0.9980 Pearson vs ground truth (CONJECTURE — NOT RUN) | helix graduates clean-room | +| F9 | **kv-lance resolution** | fork PR bumps the three `=6.0.0` pins → workspace `=7.0.0` resolves | unblocks the Surreal storage leg (and de-risks N8) | +| F10 | **Probe-free depth law** | jc P5 (Jirak) + `hpc::cascade`/`reductions`: `r* = ⌈log₄(C/τ)⌉`, inclusive ≤τ acceptance | D‑RSTAR / D‑PROBEFREE `[H]→[G]` (ADR‑025 demonstrated) | +| F11 | **Palette/CAM fidelity floor** | jc P10 (Pflug) + `hpc::quantized`/`fingerprint`: re-measure the ρ anchors | ρ ≥ 0.99 against 0.9973 (HIP) / 0.965 (TWIG) — D‑PAL256/D‑CAM/D‑RHO stop being *cited*, become *re-measured* | +| F12 | **θ conditioning window** | jc P5b (Pearl 2³) + `hpc::quantized` θ-sweep | θ ∈ [1.45, 1.6] with ρ envelope [0.93..0.9973] — D‑THETA/D‑RHOENV `[H]→[G]` | +| F13 | **Backend parity** | `hpc::simd_dispatch` W1c: AVX‑512 vs NEON vs scalar | identical within **1 ULP** — the correctness floor under every gate above | +| F14 | **Wide-model render** | render `account.move` through `ClassView` with full presence (**>64 is the load-bearing bound; 109 declarations counted** in account_move.py, Odoo 17) | **gated: cannot RUN until Phase B** wires the field-enum into `RegistryClassView`; once runnable, fails by construction (FieldMask u64, L0b) until presence exceeds u64 — **Track X7 is the named path** | + +(F3 already carries the D‑QUANTGATE pre/post-quantization contrast. +F10–F13 restore the DISCOVERY-MAP §4.2 jc×hpc floor that v1.0 omitted — +the doctrine-keeper's reverse-miss finding: v1.0 gated the identity arc +but left the codec/no-collapse chain ungated.) + +**Discipline** (the lance-graph probe rule, adopted): *if the relevant +probe is NOT RUN, the next deliverable is the probe, not more synthesis.* + +--- + +## 7. Ownership & work-shape + +| Track | Owner | Shape | +|---|---|---| +| Q1, O1–O7, H1–H2, H4 | **this session (OGAR)** | docs + small additive contract slices; 5+3-hardened regrades | +| A–H (identity arc), X1–X6, H3 | **lance-graph sessions** | phased landable PRs per the N-plan; board hygiene per CLAUDE.md | +| R1–R2 (state_machine + binding) | **runtime / other session** (has the ball) | first-hand verify, then the lowering codegen | +| F9 (kv-lance pins) | **surrealdb fork session** | one Cargo.toml PR | +| N8 / fork-coords, ADR-026 go, O4 build-vs-reuse | **operator decisions** | the only human gates | + +**Not read first-hand yet (honest fence):** `quasicryth-research` beyond +its crate-doc (lib.rs:1-42 now read; the F2 deep-read of +tiling/hierarchy/tests is still owed); `ractor_actors::state_machine` +internals; #480's `mul.rs` / `recipes.rs` / `savants.rs` bodies (diffstat +only); nexgen's `INTEGRATION_PLAN.md` (other session read it); AriGraph +eq.1's exact formula (PDF fetch 403 — carried `[per lance-graph TD]`). +Nothing in this map *depends* on their contents; F2/R1 read them before +any regrade. + +--- + +## 8. Intersecting debt (blocks or is blocked by this map) + +| Debt | Intersects | Why it matters here | +|---|---|---| +| TD‑SURREALDB‑KVLANCE‑LANCE7 | S2/S4/N8 | kv-lance can't resolve against the workspace until pins move | +| TD‑UNBUNDLE‑FROM‑1 | runtime gestalt | silent ~1 bit/epoch corruption under the same SoA this map lands on | +| TD‑ARIGRAPH‑EPISODIC‑FIDELITY‑1 | §0 endgame | episodic retrieval currently the RAG baseline, not eq.1 structural — the THINK memory the DO axis consults (eq.1 cited per that TD entry; not re-verified first-hand, PDF 403) | +| TD‑RESONANCEDTO‑DUP‑1 | X3 | stranded DTO vs column doctrine | +| TD‑HELIX‑OVERLAP‑1 | Q3/F8 | fidelity probe owed before promotion | +| TD‑WIKI‑SCALE | S1/identity | `StructuralSignature` u32 birthday (~77k) + NiblePath depth-16 ceiling — both bite at load scale; widen/escape paths named (home: lance-graph `TECH_DEBT.md`; joined by this map's L0b ceilings) | +| TYPE_DUPLICATION §13 (CausalEdge64 ×2) | X1/X2 | same name, two semantics — rename + byte contract | + +--- + +## 9. Blocked & open decisions (the complete list) + +1. **N8 fork coords** — BLOCKED(C), human gate (lance-graph P0 "STOP and ask"). +2. **ADR-026 go** — ready bucket complete; recommend after F2 (Q1) so the monotile verdict pins with it. +3. **O4** — build `ogar-from-ruby` vs reuse nexgen's ruff path (recommend: reuse; it's CODED and on the same spine). +4. **S11 status** — `RouteBucketTyped` did NOT land on main (`62bca5e`); confirm with its session whether superseded or dropped before any consumer planning. +5. **#47 → #48 merge order** — operator action; H1 must land on #47 first. +6. *(wrapper-field policy, not canon)* **shape_hash use-invariant** — PIN "same-class temporal comparison only, never cross-class"; then the 2⁻²² per-change residual is acceptable as-is (L0b, G-pass risk-model correction). +7. *(wrapper-field policy, not canon)* **`local` minting scope** — PIN the scope (currently unspecified); the canonical overflow is hierarchical (next cascade level), wrapper-side widening is a lance-graph implementation choice (L0b). +8. **X7 / F14 resolution shape** — canonical answer = page via the hierarchy (wide class = basin of field-pages); multi-word mask = wrapper option. Pick which lands (L0b BLOCKER, 109 fields measured). +9. **Reconcile the doc note to the canon** — OGAR-AST-CONTRACT §1's "27-bit segments" wording vs the pinned canonical GUID (lance hhtl nibbles already agree: 1 hex = 1 level). Fix the NOTE; the canon stands. Phase B audits NodeGuid against the canon **group-by-group** (groups 1–2 + the 24-bit local already match exactly; groups 3–4 are the open carving question — the RFC version/variant nibble collision, L0 apex row). Supersedes both the earlier "two-structures" framing AND the first canon-pass "u32" misread — the canonical counts HEX, and it IS the GUID. +10. **RFC 9562 nibble decision — PINNED: v8-native** (autoresolved under the standing full-authority mandate after a 3× repeated ask; one operator word reverses it). Accept the version hex + variant bits as the substrate's *signature*: UUIDv8 is the RFC's bring-your-own-layout version, so the canon and the spec are the same philosophy; the version hex `8` doubles as a free native/foreign key discriminator at every membrane (S9); cost = HEEL 4 + HIP 3 + TWIG 3 = 10 native path levels (16¹⁰ ≈ 10¹², still overkill — deep chains were always the overflow story's job: registry resolve + try_child ref-escape, which is also why Wikidata-HHTL is NOT a different scheme, just the canon's heaviest consumer). Entropy argument: one skip-rule beats per-tool interop friction paid forever; 6 constant bits are zero-entropy structure. If ratified: pin in CLAUDE.md P0 + L0 apex; Phase B's remaining audit question reduces to whether #480's shape_hash/layout_version yield groups 3–4's free nibbles back to HIP/TWIG path. **REVERSED (operator word, 2026‑06‑10): final = 3×4 UNIFORM, RFC-WAIVED.** The 4/3/3 carving broke the uniform Morton stride — tier-of-level must stay `level >> 2` (shift, not branch) in a substrate whose cascade is shift/mask by doctrine; the interop benefit was mostly hypothetical (Lance/Surreal/`EntityKey` are byte-agnostic; few tools validate version nibbles); and the pin violated this map's own apex rule — **RFC 9562 is a WRAPPER concern, and wrappers adapt to the canon, never the reverse**. RFC-needing boundaries adapt at their membrane; discrimination via `classid`. (Answer to the operator's question: the 4/3/3 was never 4096-codebook-motivated — it fell out of RFC mark positions — but the reversal restores the Morton-tile alignment regardless.) Phase B audit consequence: #480's ver/variant/shape_hash carving of groups 3–4 must yield ALL eight nibbles back to HIP/TWIG path. +11. **STANDING WATCH — 3×4 vs 4×3** (operator mandate: "correct me at any time"): 3×4 stands on the 2026‑06‑10 ledger — shift vs divide, u16-aligned vs byte-straddling tiers, dashes=tiers, byte-per-axis Morton, 3 hops, XOR locality; 4×3's lone synergy (tier index = 4096 slot) is recoverable as a 3-nibble-prefix sub-table inside 3×4. Flip condition: a measured radix/de-interleave workload where 4-tier granularity wins despite alignment costs. CLAUDE.md carries the full ledger. + +--- + +## 10. Maintenance + +Same five rules as `DISCOVERY-MAP.md §6` (append-only; terse; grade +honestly — `[S]` stays `[S]` until a measurement; this map points, never +re-derives; the map mirrors the substrate). Plus one of its own: +**every seam row must name its contract TYPE** — a seam described only +in prose is a seam that will fork. diff --git a/docs/INTEGRATION-TEST-PLAN.md b/docs/INTEGRATION-TEST-PLAN.md new file mode 100644 index 0000000..f153156 --- /dev/null +++ b/docs/INTEGRATION-TEST-PLAN.md @@ -0,0 +1,138 @@ +# INTEGRATION & TEST PLAN — the probe-first execution companion + +> **Status: EXECUTION PLAN v1** (2026-06-10). Companion to +> `DISCOVERY-MAP.md` (what was found) and `INTEGRATION-MAP.md` (how it +> composes). **This doc orders the work: no integration brick lands +> before its probe is green.** It exists because the session's own +> audit found six turns of synthesis and zero probes run — the +> workspace rule applies verbatim: *if the probe is NOT RUN, the next +> deliverable is the probe, not more synthesis.* +> +> Grading as everywhere: `[G]`/`[H]`/`[S]`; every probe row names what +> a PASS grounds and — equally load-bearing — **what a FAIL kills**. +> A probe without a kill-condition is theater. + +--- + +## 0. The three shaky joints (self-audit, 2026-06-10) — first-class falsification targets + +The canon floor (operator-pinned GUID, key-of-key-value, 3×4) is +ground truth by definition. The conjecture tower above it has three +joints that were never checked; each gets a named probe and a kill: + +| # | Joint | The unexamined step | Resolving probe | Kill condition | +|---|---|---|---|---| +| J1 | **TILE256 ↔ PREFIXBOOK circularity** | the address picks the codebook that picks the address — does the recursion bottom out? | **PROBE-BOOT-1** (+ CODEBOOK-44): mint a class codebook from a corpus at BUILD time, assign addresses, re-derive — show fixpoint or document one-shot non-recursive build | no stable bootstrap → D-TILE256 demoted `[S]`; tier = spatial Morton only; CAM-PQ distance stays value-side | +| J2 | **"lossless for synthesis" scope drift** | dither-grade reconstruction ≠ content reconstruction; prose drifts toward implying the latter | **PROBE-PERT-RHO** with the *escalation rate reported* | ρ < anchor on representative tiles → D-PHASE stays dither/anti-moiré only; all codec-savings claims struck | +| J3 | **Parseval ≠ gaussian-preservation** | WH orthogonality conserves L2 *of the transform*; says nothing about the **quantized** magnitude envelope | **PROBE-WHP-1a** (transform, should pass — math) split from **WHP-1b** (L2 drift through `RollingFloor` quantization — the real question) | WHP-1b outside the Pflug band → strike "top gaussian preserved"; keep WH as sign-algebra only | + +--- + +## 1. Wave 0 — ground in 48 hours (runs against SHIPPED code; zero new impl) + +Every row here is executable today; total new code ≈ 170 LOC of tests. + +| Probe | Where (proposal) | LOC | Pass | Fail kills | Grounds | +|---|---|---|---|---|---| +| **PROBE-PHASE-1** | `lance-graph/crates/helix/tests/phase_determinism.rs` | ~40 | `CurveRuler` walk bit-identical across runs/platforms; full 17-permutation verified | the deterministic-phase generator claim → D-PHASE loses its `[G]`-mechanism leg | the generator leg of D-PHASE | +| **PROBE-WHP-1a** | `helix` or `jc` example (scalar) | ~30 | `Σ\|cell\|² = Σ\|M_L\|²` exact for ±1 fields (orthogonality) | the WH framing itself (unlikely — math) | D-WHP transform leg | +| **PROBE-WHP-1b** | same file | ~30 | L2 drift through `RollingFloor` ≤ Pflug band | **"top gaussian preserved" wording (J3)** | the only part of D-WHP that was actually in doubt | +| **PROBE-PHI-1** | `jc` (companion to its `weyl` module) | ~40 | φ-stride probe sets beat uniform-random on star-discrepancy at equal n | the φ leg of the quorum (quorum survives on uniform probes) | quorum placement | +| **F2 (read+run)** | `lance-graph/crates/quasicryth-research` — `cargo test` | 0 | `paper_theorems.rs` green + hierarchy read confirms/refutes generalized-Morton addressability of a hat-equivalent tiling | nothing (red = D-MONOTILE stays `[H]` with a concrete failure shape — still progress) | possibly the biggest single promotion available (D-MONOTILE) | +| **F13 (verify)** | run the existing `simd_dispatch` W1c parity suite | 0 | 1-ULP across AVX-512/NEON/scalar (contract says mandatory — may already be green) | the correctness floor under every other probe | the floor | +| **F8** | helix fidelity probe (owed since #459: "CONJECTURE — NOT RUN") | ~60 | naive-u8 floor ≥ 0.9980 Pearson vs ground truth | helix's clean-room promotion | closes lance-graph's own oldest owed probe | + +**Wave-0 exit (Codex-corrected on #50):** **F13 green is MANDATORY** — +it is the correctness floor under every other probe; a red F13 HALTS +all waves until fixed and never counts as an acceptable quorum +casualty. Of the remaining six, ≥4 green → proceed. **General rule: a +probe that is a PREREQUISITE of later bricks is a mandatory pass, never +a quorum member.** J3 resolved either way. Any red is a *result* — +recorded in DISCOVERY-MAP, grade moved, prose corrected (the D-EXCITON +pattern: revert with reasons, keep the `[G]`-real legs). + +**First receipt already in (2026-06-10):** the HILBERT-L4 question was +run first-hand while triaging Codex on the ndarray PR — **13/13 green** +incl. `level4_all_indices_unique` (bijective onto [0,4096) — exactly +what cascade addressing needs) and `level4_curve_is_connected`. PP-13 +P0-4's "expected 4095" was an orientation assumption, not the contract. +One claim flipped by execution before Wave 0 formally opened. + +## 2. Wave 1 — first implementation bricks (each gated by its probe) + +| Brick | Repo | LOC est | Gate | Depends on | +|---|---|---|---|---| +| **C: `impl SoaEnvelope for MailboxSoA`** (the keystone; zero production impls today) | lance-graph shader-driver | ~150 | **F6**: `verify_layout()` green; `as_le_bytes().as_ptr() == backing` (zero-copy proven) | — (leaf) | +| **O1: `Class` traversal API** (`member_of`/`members`/`group_members`/`includes`/`associations_of`) — methods on the carrier per The Click | OGAR `ogar-vocab` | ~50 + tests | unit tests incl. `through`/`inverse_of` resolution | — (leaf) | +| **PrefixShapeTable** (layout-only sibling of `MultiLaneColumn`) | ndarray `simd_soa` layer | ~150 | **PROBE-ROUTE-1**: batch ≡ scalar on 10⁶ keys; ≥4× at N=1024 | — (leaf; consumer registration comes later) | +| **WHP-3 + WHP-4** against shipped `vsa_bind`/`vsa_bundle` | lance-graph contract tests | ~130 | WHP-3: unbind margin holds to N ≤ √d/4, fails cleanly past; WHP-4: raw-XOR-on-magnitudes FAILS Chapman-Kolmogorov (a deliberately-failing guard) | — | +| ~~HILBERT-L4 fix~~ → **CLOSED: VERIFIED GREEN, no fix needed** (run 2026-06-10: 13/13 incl. L4 bijectivity + connectivity; PP-13 P0-4's "expected 4095" was orientation, not contract) | ndarray `linalg/hilbert.rs` | 0 | the exhaustive suite stays as the **standing gate** for any future table change | — | + +**Wave-1 exit:** C green unlocks the critical path; the two-algebra +guard (WHP-4) is permanently in CI. + +## 3. Wave 2 — the conjecture tower gets its numbers + +| Brick | Gate(s) | Depends | Kill | +|---|---|---|---| +| **4⁴ hierarchical codebook builder** (4-level 4-ary k-means, 256 leaves) | **CODEBOOK-44**: fidelity within Pflug band of flat-256; **PROBE-BOOT-1**: bootstrap fixpoint (J1) | corpus (synthetic v0 OK) | J1 kill above — D-TILE256 → `[S]` | +| **Perturbation encoder v0** (magnitude-plane + CurveRuler phase; coarse-granularity M) | **PERT-RHO** (J2; escalation rate REPORTED) + **PYR-1** (escalation tier byte-exact) + **WHP-2** (cross-backend roundtrip) | PHASE-1 green | J2 kill above | +| **Spectral anti-moiré** (jc P3 + `hpc::fft`: golden vs Base17, pre/post quantization) | **F3** — promotes D-MOIRE/D-MANTISSA or falsifies; demonstrates D-QUANTGATE's contrast | runtime session owns jc — coordinate | D-MOIRE `[H]`→dead if FFT peak appears | +| **ρ anchors re-measured** | **F10/F11/F12** (depth law; 0.9973/0.965 anchors; θ window) | runtime session | anchors drift → every τ recalibrates | + +## 4. Wave 3 — identity-arc integration (the lance-graph N-phases, now gated) + +Critical path `(C → D) ∥ ((R1 ∥ O7 ∥ B) → R2) → R3`, all gates already +defined in INTEGRATION-MAP §5–6: + +| Phase | Gate | Note | +|---|---|---| +| D: cognitive-write `TripletProjection` + `roundtrip_eq` | **F5** (corrupt-pack must FAIL; NARS (f,c) within 1/1023) | needs C ✅(W1) | +| B: registry mint `(entity_type ↔ NiblePath)` + live `StructuralSignature` | **F4** bijection round-trip at build time | ontology side; also gates F14 | +| O7: `String → Identity` lift in ogar-vocab | unit: parent resolution via registry | the IR's typed-edge prerequisite for R2 | +| **Phase-B addendum (new):** NodeGuid group-3/4 audit | groups 3–4 yield all 8 nibbles to HIP/TWIG (canon-pass consequence) | one layout change + field-isolation matrix per I-LEGACY-API | +| R1/R2/R3: state_machine verify → ActionDef lowering → **F1** (chain + DIAMOND fixture, C3-over-`LastOrderedSet`) | F1 | **externally owned** — the only critical-path leg owned by no present session; coordination risk stays flagged | +| E/F/G: project_graph → MetadataStore migration → EntityKey wiring | per-phase DoD (INTEGRATION-MAP) | after D; F needs B | + +## 5. Wave 4 — consumers & the long tail + +O2 parse-walk completion (EnumDecl lift · DEFINE EVENT→ActionDef · +non-owning post-pass — O1 unblocks the post-pass) → O3 `ogar-python` +(Odoo 17) → quorum certificate type (the #411 `contract::quorum` +scaffold) + **QUORUM-1** → O5 content tiers + **F7** → F9 kv-lance pins +→ X-track debt (X1 rename, X3 ResonanceDto fold, X4 HHTL +route-by-prefix, X5/X6) → F14/X7 wide-model render after B. + +## 6. The standing rules this plan operates under + +1. **Probe before synthesis** (workspace P0, now enforced by wave + structure: a wave does not open until the prior wave's exit + condition is met or its reds are *recorded as results*). +2. **Every red is a ledger event** — grade moves in DISCOVERY-MAP the + same day (the D-EXCITON revert is the template: keep `[G]`-real + legs, strike the dead analogy, name the survivor). +3. **Thresholds are measured, never optimism** (PP-13 P0-2/P0-3: + placeholder thresholds must not gate; relative tolerances for + spectral claims). +4. **Two-algebra guard is permanent CI** (WHP-4 ships as a + deliberately-failing-if-violated test). +5. **Standing watches stay armed**: 3×4-vs-4×3 flip condition; + "correct the operator at any time" mandate (CLAUDE.md). + +## 7. Ownership & coordination + +| Who | Owns | +|---|---| +| this session (OGAR + docs) | Wave 0 helix/jc probes, O1, O2-prep, ledger folds on every result | +| lance-graph session(s) | C, D, B, WHP-3/4, F5/F6, X-track | +| ndarray session(s) | PrefixShapeTable + ROUTE-1, perturbation encoder, CODEBOOK-44 (HILBERT-L4: CLOSED — verified green) | +| runtime/jc session | F3, F10–F12, R1/R2 (state_machine + binding) | +| operator | merge order #47→#48; PRs for the two crystallization branches; the J1/J2/J3 verdict calls if a kill fires | + +--- + +*Cross-refs: `DISCOVERY-MAP.md` §2.10 (the canon pins this plan +tests) · `INTEGRATION-MAP.md` §5–6 (the DAG + gates F1–F14) · +ndarray `guid-prefix-shape-routing.md` §3–5 · lance-graph +`guid-canon-and-prefix-routing.md` §2–7 · PP-13 verdict (the theater +casebook every threshold rule traces to).*