Skip to content

docs(genetics): pattern-recognition hand-off + integration plan + headstone (for a domain expert new to the stack)#501

Merged
AdaWorldAPI merged 2 commits into
mainfrom
claude/genetic-research-substrate-v1
Jun 16, 2026
Merged

docs(genetics): pattern-recognition hand-off + integration plan + headstone (for a domain expert new to the stack)#501
AdaWorldAPI merged 2 commits into
mainfrom
claude/genetic-research-substrate-v1

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Three artifacts for a genetics-domain researcher who knows their domain cold but has not seen this stack.

Pure docs. No code touched. No new substrate primitives. +743 / -0 over 3 files.

The three artifacts compose

File Role For
docs/GENETIC_RESEARCH_VIA_STACK.md The WHY — pattern-recognition hand-off; "wow that's potential" A geneticist who knows bioinformatics but hasn't seen this stack
.claude/plans/genetic-research-substrate-integration-v1.md The HOW — 10 deliverables (D-GEN-1..10) + 3 gating probes + 5-phase sequencing A session picking up the work
.claude/handovers/2026-06-16-genetic-research-headstone-exploration.md The WHAT-COMPLETE-LOOKS-LIKE — destination-state synthesis Anyone needing the architectural pin before details scatter

The pattern recognition the epiphany doc surfaces

Eight shapes the geneticist knows ↔ eight primitives the substrate already ships, each grounded in file:line:

Domain shape Substrate primitive Status
Sequence sketches (MinHash / Mash / ntHash) CAM-PQ 48-bit fingerprint (94% of Jina 1024-D, SimLex-999 validated) shipped: cam_pq/storage.rs:9 + linguistic-epiphanies-2026-04-19.md:299-312
Genomic coordinates HHTL nibble-trie addressing shipped: lance-graph-contract::hhtl::NiblePath
chromosome→arm→band→gene CLAM 3-level 16-way tree (HEEL/HIP/TWIG) shipped: ndarray::hpc::clam ~1600 lines
Novel-variant detection (CADD / REVEL) CHAODA anomaly on LFD distribution (Ishaq et al. 2021) shipped: ndarray/src/hpc/clam.rs:1493-1560
minimap2 minimizers bgz17 11/17 X-Trans stride (provable anti-moiré bound) shipped: crates/bgz17/src/lib.rs:53-60 + BGZ17_ELEVEN_SEVENTEEN_RATIONALE.md
Bayesian variant evidence Friston entropy × energy substrate-state plane (ρ(entropy, accuracy) = −0.78 measured) shipped: PR #491/#494; measured in ndarray PR #218
Cancer cascade simulation MailboxSoA + CounterfactualMailbox (counterfactual lanes preserved) shipped: mailbox_soa.rs + counterfactual.rs:232
do-calculus on driver mutations Pearl-2³ mask in CausalEdge64 + pearl_junction classifier shipped: high_heel.rs:202 + crate::pearl_junction

What the dynamics axis (the unique substrate contribution) gives

Cancer-pathway propagation simulation with counterfactual lanes preserved.

Standard tools (GATK / DeepVariant / Reactome / SCENIC / nf-core) each give part of the picture. None preserve the counterfactual branch as a persistent, query-visible substrate lane. The substrate does: CounterfactualMailbox is the storage; revise_if_minority_wins is the update rule; InferenceType::Counterfactual (mantissa = -6) is the mechanical guarantee that counterfactual edges never leak into observed SPO.

For a cancer cohort: every patient's tumor carries both its actual driver-mutation history AND the counterfactual alternatives the substrate's Friston-FEP active inference deemed worth tracking. The §14 oracle compares counterfactual lanes across patients — "this counterfactual branch was rejected in 9/10 tumors but accepted in tumor X — what's structurally different about X?" That's clinical-research signal nobody else can address natively.

Sequencing (from the implementation plan)

Phase Deliverables Cumulative time Milestone
P1 D-GEN-1 (adapter scaffold), D-GEN-2 (FASTA/VCF), D-GEN-3 (k-mer fingerprint), D-GEN-4 (class mint) ~2 weeks Shape-locked hand-off
P2 D-GEN-5 (GO/Reactome/ClinVar hydrators), PROBE-CHAODA-1000G ~3 weeks Unsupervised novel-variant detection green
P3 D-GEN-6 (§14 oracle for variant callers), D-GEN-7 (KRAS G12D counterfactual fan-out), PROBE-KRAS-COUNTERFACTUAL-DET ~6 weeks Flagship: dynamics axis proven
P4 D-GEN-8 (DeepNSM genetic language), D-GEN-9 (histology splat extension), PROBE-CAM-PQ-VS-BLAST ~8 weeks Cross-scale + cross-modal
P5 D-GEN-10 (GIAB benchmark) ~9 weeks Caller comparison vs published F1

Minimum viable hand-off: end of P1 (~2 weeks). Flagship: D-GEN-7 (KRAS counterfactual fan-out simulation; the differentiator from every standard bioinformatics tool).

Iron rules (from §0 of the plan)

  1. No new ValueSchema enum variant — genetic-research rows ride Full / Compressed presets via classid → ClassView mint (per PR docs(plans)+test: rebaseline #497 OCR plans to #498 + gating probes (5-specialist framing) #500's contract test).
  2. No new EdgeCodecFlavor enum variant.
  3. No C++ source vendored into adapter crates — htslib stays upstream; route through ruff_cpp_spo if harvested.
  4. Counterfactuals stay in their own lane (InferenceType::Counterfactual mantissa = -6; never written as observed SPO).
  5. No new substrate primitives — every deliverable is wiring.
  6. Closed-vocab discipline for new genetic predicates (predicate_count_locked_at_N per ruff PR Claude/setup adaworld repos 4k pex #5).

What this PR does NOT do

  • No code touched.
  • No new substrate types, traits, columns, or enum variants.
  • No edits to lance-graph-contract / ndarray::hpc::* / lance-graph-ontology / rubicon.
  • No PR for crates/adapter-genetics-experimental — the plan exists; the crate is proposed, not built.
  • No medical/diagnostic claims (boundary inherited from the predecessor 3DGS-genetics-4x4-fanout-plan.md).

Predecessor + related work

Test plan

Anchors

  • docs/GENETIC_RESEARCH_VIA_STACK.md — the pattern-recognition hand-off (file:line-grounded throughout).
  • .claude/plans/genetic-research-substrate-integration-v1.md — 10 deliverables + 3 probes + 5-phase sequencing.
  • .claude/handovers/2026-06-16-genetic-research-headstone-exploration.md — destination-state synthesis.
  • bardioc/SUBSTRATE_STATE_FRAMINGS.md — entropy × energy framing (cross-repo durable).
  • OGAR/docs/CASCADE-SYNERGIES-EPIPHANY.md — Morton-cascade × palette256 × golden-helix synthesis (foundational).

https://claude.ai/code/session_01VysoWJ6vsyg3wEGc5v7T5v


Generated by Claude Code

…dstone

Three artifacts for a genetics-domain researcher who knows their domain cold
but has not seen this stack:

1. docs/GENETIC_RESEARCH_VIA_STACK.md (237 lines)
   The "wow that's potential" doc. Eight pattern matches from genetics domain
   to shipped substrate primitives, each grounded in file:line:
     - Sequence sketches (MinHash) ↔ CAM-PQ 48-bit fingerprint (PR #210; 94%
       of Jina 1024-D on SimLex-999)
     - Genomic coordinates ↔ HHTL nibble-trie (lance-graph-contract::hhtl)
     - chromosome→arm→band→gene ↔ CLAM 3-level 16-way tree (ndarray::hpc::clam)
     - Novel-variant detection ↔ CHAODA anomaly score on LFD distribution
       (ndarray::hpc::clam.rs:1493-1560; Ishaq et al. 2021)
     - minimap2 minimizers ↔ bgz17 11/17 X-Trans stride (BGZ17_ELEVEN_SEVENTEEN
       _RATIONALE.md; provable anti-moiré bound)
     - Bayesian variant evidence ↔ Friston entropy×energy plane (PR #491/#494;
       ρ(entropy, accuracy) = −0.78 measured in ndarray #218)
     - Cancer cascade simulation ↔ MailboxSoA + CounterfactualMailbox
       (mailbox_soa.rs + counterfactual.rs; SPAWN_DISSONANCE_THRESHOLD = 0.55)
     - do-calculus on driver mutations ↔ Pearl-2³ mask in CausalEdge64
       (high_heel.rs:202; pearl_junction)
   Plus the architecture diagram, the shipped-vs-proposed table, the dynamics
   axis as the unique substrate contribution (counterfactual lanes preserved),
   the first cargo command that proves it (CHAODA tests on main), and the
   one-paragraph pitch.

2. .claude/plans/genetic-research-substrate-integration-v1.md (213 lines)
   The HOW. Ten deliverables (D-GEN-1..10) + three gating probes:
     - D-GEN-1: adapter-genetics-experimental crate scaffold (~1 day)
     - D-GEN-2: FASTA/VCF parsers via noodles-* (~3 days)
     - D-GEN-3: k-mer → CAM-PQ fingerprint (~half-day)
     - D-GEN-4: reference genome NodeGuid addressing mint (~1 day)
     - D-GEN-5: GO/Reactome/ClinVar TtlHydrators (~1 week)
     - D-GEN-6: §14 oracle adapter for variant caller comparison (~3 days)
     - D-GEN-7: KRAS G12D 1024-cell counterfactual fan-out (~2 weeks, FLAGSHIP)
     - D-GEN-8: DeepNSM genetic-language reader probe (~1 week)
     - D-GEN-9: Histology splat extension with genomic profile (~3 days)
     - D-GEN-10: §14 oracle benchmark against GIAB truth set (~1 week)
     - Probes: PROBE-CHAODA-1000G, PROBE-KRAS-COUNTERFACTUAL-DET, PROBE-CAM-
       PQ-VS-BLAST
   5-phase sequencing; minimum viable hand-off at end of P1; flagship at D-GEN-7.
   §0 anti-invention guardrail + no-new-enum-variant contract test (#500)
   enforced throughout.

3. .claude/handovers/2026-06-16-genetic-research-headstone-exploration.md
   (293 lines) — the WHAT-COMPLETE-LOOKS-LIKE doc.
   Headstone shape mirroring 3DGS-Cesium-BindSpace4-headstone-exploration.md:
     - Purpose: preserve the architectural synthesis
     - Capstone thesis: one block of prose (bioinformatics ships pipelines;
       the substrate ships a SHAPE)
     - Four-layer architecture from a geneticist's vantage
     - Why bioinformatics pipelines alone are not enough
     - Why building genomics tooling from scratch is not enough
     - 8 invariants the adapter inherits from the substrate
     - 9 conditions for "complete"
     - Era closes (per-tool pipeline silos; no counterfactual preservation;
       trained-classifier-only outlier detection) vs. era opens (one SPO
       graph; counterfactual lanes; CHAODA unsupervised; Pearl-2³ native;
       Friston entropy×energy calibration; same-math-at-all-scales splat
       extension; §14 oracle cross-pipeline equivalence)

The three artifacts compose: epiphany doc tells the geneticist WHY; plan
tells them HOW; headstone tells them WHAT COMPLETE LOOKS LIKE.

Predecessor: .claude/plans/3DGS-genetics-4x4-fanout-plan.md (static
representation; this PR extends with dynamics + counterfactual lanes).

https://claude.ai/code/session_01VysoWJ6vsyg3wEGc5v7T5v
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@AdaWorldAPI, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 57 minutes and 15 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0284c911-4562-41a5-b656-bfdc6d8a32e9

📥 Commits

Reviewing files that changed from the base of the PR and between adbcbdc and cd53ab5.

📒 Files selected for processing (3)
  • .claude/handovers/2026-06-16-genetic-research-headstone-exploration.md
  • .claude/plans/genetic-research-substrate-integration-v1.md
  • docs/GENETIC_RESEARCH_VIA_STACK.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 867503ff58

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Per the substrate's §0 anti-invention guardrail (lance-graph #496) and the no-new-variant contract test (#500):

1. **No new `ValueSchema` enum variant.** Genetic-research rows ride `Full` or `Compressed` presets; specialisation is via `classid → ClassView` mint.
2. **No new `EdgeCodecFlavor` enum variant.** Use `CoarseResidue` for genomic edges (the 1-byte palette + signed-4-bit residue is sufficient for sequence-similarity edges; ICC 0.97–0.99 measured on ndarray #218).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don’t lock genetics onto CoarseResidue yet

This plan explicitly selects EdgeCodecFlavor::CoarseResidue, but the repo already records TD-COARSERESIDUE-NO-VALUE-TENANT in .claude/board/TECH_DEBT.md: CoarseResidue needs a per-dimension residue in the value slab and currently has no ValueTenant, so pairing it with the Full/Compressed presets leaves the residue unaddressable or colliding with another tenant. Following this “locked” decision would make the genetics adapter pick an unresolved storage shape before the documented operator decision is made; mark this as blocked or use a flavor with an existing storage path until that debt is resolved.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both real bugs; addressed in cd53ab5.

On the CoarseResidue lock: confirmed TD-COARSERESIDUE-NO-VALUE-TENANT at .claude/board/TECH_DEBT.md:40 ("the EdgeCodecFlavor enum rode #495 / 920671d (entropy-ladder D-EL-1); #496 only adds the ValueSchema/FULL-default on top. The #495 AGENT_LOG claim that 'signed-CoarseResidue is a first-class tenant' was aspirational — no such tenant exists in VALUE_TENANTS"). Pairing CoarseResidue with Full/Compressed would have left the signed-4-bit residue unaddressable.

§0 rule 2 now reads:

Genomic edges ride Pq32x4 (TurbovecResidue tenant has shipped storage) or CoarseOnly (1-byte palette, no separate residue slab). CoarseResidue is BLOCKED until the operator mints its dedicated ValueTenant (TD-COARSERESIDUE-NO-VALUE-TENANT, .claude/board/TECH_DEBT.md:40) — pairing it with Full or Compressed today leaves the signed-4-bit residue unaddressable.

D-GEN deliverables route through Pq32x4 (TurbovecResidue tenant has shipped storage) or CoarseOnly (palette only) until the tech-debt entry is resolved by an operator-minted tenant. Commit: cd53ab5.


### D-GEN-5: GO / Reactome / ClinVar `TtlHydrator`s

**What:** add three `TtlHydrator` implementations to `lance-graph-ontology::OntologyRegistry`:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the shipped ontology hydrator API

There is no TtlHydrator type or trait in crates/lance-graph-ontology; the shipped pattern is MetaStructureHydrator/OwlHydrator plus exported hydrate_*() glue functions in hydrators/mod.rs. Because this line asks future work to add three TtlHydrator implementations, it sends D-GEN-5 down a non-existent API path and risks inventing a new substrate abstraction despite the plan’s no-new-primitives guardrail.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed — TtlHydrator does not exist; addressed in cd53ab5.

The shipped API per crates/lance-graph-ontology/src/hydrators/mod.rs:1-57 is Pattern D — Meta-Structure Hydration: OwlHydrator + MetaStructureHydrator types plus hydrate_*() glue functions (hydrate_dolce / hydrate_owltime / hydrate_provo / hydrate_qudt / hydrate_schemaorg / hydrate_skos / hydrate_fibo_fnd / hydrate_fibo_be / hydrate_odoo / hydrate_zugferd / hydrate_skr03 / hydrate_skr04). Per the mod.rs preamble: "Each per-ontology hydrator is data + ~50 LOC of glue, never a bespoke crate."

D-GEN-5 now proposes hydrate_go() / hydrate_reactome() / hydrate_clinvar() glue over the shipped OwlHydrator / MetaStructureHydrator, mirroring the proven shape of hydrate_dolce / hydrate_provo / hydrate_skos. No new trait, no new bespoke crate.

The companion mentions in docs/GENETIC_RESEARCH_VIA_STACK.md §3 and .claude/handovers/2026-06-16-genetic-research-headstone-exploration.md (Layer 0 / 1, "Why building from scratch is not enough", "What complete looks like") have been brought into line with this shape. Commit: cd53ab5.

Two corrections per Codex review on the genetic-research artifacts:

(1) EdgeCodecFlavor::CoarseResidue is blocked, not usable.

Plan §0 rule 2 previously locked genomic edges onto CoarseResidue. Per
TD-COARSERESIDUE-NO-VALUE-TENANT (.claude/board/TECH_DEBT.md:40), the
enum variant exists but no ValueTenant in VALUE_TENANTS addresses its
signed-4-bit residue slab; pairing it with Full or Compressed today
leaves the residue bytes unaddressable. Rule 2 now routes genomic edges
through Pq32x4 (TurbovecResidue tenant has shipped storage) or
CoarseOnly (1-byte palette, no separate residue slab), and explicitly
flags CoarseResidue as BLOCKED pending the operator-minted tenant.

(2) TtlHydrator does not exist; shipped API is Pattern D.

D-GEN-5 previously proposed three new "TtlHydrator" implementations.
The shipped API per crates/lance-graph-ontology/src/hydrators/mod.rs:1-57
is Pattern D - Meta-Structure Hydration: OwlHydrator + MetaStructureHydrator
types plus hydrate_*() glue functions (hydrate_dolce / hydrate_owltime /
hydrate_provo / hydrate_qudt / hydrate_schemaorg / hydrate_skos /
hydrate_fibo_fnd / hydrate_fibo_be / hydrate_odoo / hydrate_zugferd /
hydrate_skr03 / hydrate_skr04). Each per-ontology hydrator is "data +
~50 LOC of glue, never a bespoke crate" per the mod.rs preamble.
D-GEN-5 now proposes hydrate_go() / hydrate_reactome() / hydrate_clinvar()
glue over the shipped types, mirroring the proven shape of hydrate_dolce
/ hydrate_provo / hydrate_skos. No new trait, no new bespoke crate.

Both findings were the exact failure mode the operator has been catching
me on: naming an existing primitive incorrectly OR proposing a
non-existent substrate abstraction despite the plan's own
no-new-primitives guardrail.

Files touched:
- .claude/plans/genetic-research-substrate-integration-v1.md (3 edits)
- docs/GENETIC_RESEARCH_VIA_STACK.md (2 edits)
- .claude/handovers/2026-06-16-genetic-research-headstone-exploration.md (4 edits)

https://claude.ai/code/session_01VysoWJ6vsyg3wEGc5v7T5v
@AdaWorldAPI AdaWorldAPI merged commit e192266 into main Jun 16, 2026
1 check passed
AdaWorldAPI pushed a commit that referenced this pull request Jun 16, 2026
…oaOwner cherry-pick + LanceVersionScheduler + SurrealMailboxView (D-PG-6)

Lands four tasks from the shortest-unblocking-path list surfaced after
PR #497-#501 + the AdaWorldAPI/surrealdb fork bump (lance/lance-index =7.0.0,
lancedb =0.30.0, ndarray exact-rev). All four meet at the single contract
trait `MailboxSoaView`, closing the cascade in one commit (E-UNBLOCK-CASCADE-1).

## Task 3 — `NiblePath::{from_guid_prefix, prefix}` (zero-dep, foundational)

Ontology-side keystone follow-up of PR #498's `classid → ReadMode` LE contract.
The 20-nibble `classid(8) | HEEL(4) | HIP(4) | TWIG(4)` prefix overflows the
16-nibble MAX_DEPTH: the deterministic fold drops the canon-reserved high u16
of classid (root-first pack: `classid_lo(4) | HEEL(4) | HIP(4) | TWIG(4)`),
returning None when the fold would be lossy. `prefix(d)` is the O(1) ancestor
view; `prefix(d).is_ancestor_of(self)` holds for every d ≤ self.depth (the
routing-cache view of a deeper class path).

  +7 tests in `hhtl::tests`; contract lib 619 → 632 green.

## Task 2 — `impl MailboxSoaView + MailboxSoaOwner for MailboxSoA<N>`

Cherry-pick of jolly-cori-clnf9 commit 463d71b (integrated-cognitive-planner-v1
§2 Seam #3, +149 LOC). Adds `pub phase: KanbanColumn` field + zero-copy
repr(transparent) slice impls (edges_raw, meta_raw) + the in-RAM Rubicon
driving-loop test (`test_in_ram_driving_loop_walks_rubicon_to_commit`). The
contract spine (#437/#439) now drives an actual loop end-to-end — no surreal,
no ractor bus needed for the in-process case.

  +1 driving-loop test; cognitive-shader-driver lib 85 → 86 green.

## Task 1 — `LanceVersionScheduler` over `VersionedGraph::versions()`

D-MBX-9-IN core impl (the CI-gated twin of the contract slice shipped 2026-05-31).
Lives in `crates/lance-graph/src/graph/scheduler.rs`. Wraps a `VersionedGraph` +
inner `VersionScheduler<S = NextPhaseScheduler>` and exposes:

- `drive_once(view, exec)`           — read current Lance version, lower to a move
- `drive_at_latest(view, exec)`      — fold `versions().last()` into a move
- `current_dataset_version()`        — typed `DatasetVersion` over nodes head

Closes `E-SUBSTRATE-IS-THE-SCHEDULER`'s OUT-direction end-to-end. The OUT
direction stays propose-not-dispose (R1): returned `KanbanMove` is for the
caller's `MailboxSoaOwner::try_advance_phase` to apply.

  +5 tests with real on-disk tempdir Lance (no mocks).

## Task 4 — `SurrealMailboxView<'a>` (D-PG-6 contract slice)

Read-only `MailboxSoaView` adapter the SurrealQL projection populates via
`from_columns(...)` — pure zero-copy borrow over the kv-lance scan's byte
buffers. Imports `MailboxSoaView` but NOT `MailboxSoaOwner` (compile-time
enforcement of `kanban.rs:1-21` "surreal=project-read-only, callcenter=commit").

`read_via_kv_lance()` returns the new typed `SurrealContainerError::BlockedColdBuild`
until the surrealdb fork dep in `Cargo.toml` is uncommented — kept off by default
to avoid the ~10 min cold surrealdb build for contributors who don't need it.
The contract surface is available today; the integration is one Cargo.toml edit
+ a SurrealQL projection body in `view.rs`.

  +4 tests; new `lance-graph-contract` dep in surreal_container/Cargo.toml;
  BLOCKED(C) marker flipped to RESOLVED.

## What this unblocks

- **D-MBX-9-IN-impl** — SHIPPED (the contract trait now has a Lance-backed implementor).
- **D-MBX-A6-P3** — still queued, BUT Seam #3 (the in-RAM loop) is now in-tree;
  a downstream session can wire the emit-side without depending on the unmerged
  jolly branch.
- **D-PG-6 (Rubicon kanban VIEW)** — contract slice SHIPPED; impl-side gated on
  `BlockedColdBuild` flip-on (one Cargo.toml uncomment + projection body).
- **Identity-architecture v1 §3 P-SCOPE-CLASSIFY** — solved (the bijection-width
  fix is deterministic + ancestor-preserving + falsifiable by tests).

## Tests + clippy

- lance-graph-contract:   **632** (+7 hhtl)
- cognitive-shader-driver: **86** (+1 driving-loop)
- lance-graph::scheduler:  **5** (new module, real Lance tempdir)
- surreal_container::view: **4** (new module)

All clippy `-D warnings` clean on the new files. Pre-existing lints in
lance-graph-ontology / lance-graph-planner / ndarray_bridge.rs are out of
session scope.

## Board hygiene (mandatory rule)

- LATEST_STATE.md — Contract Inventory PREPEND for the new types.
- EPIPHANIES.md — E-UNBLOCK-CASCADE-1: three independent landings converge on
  one trait surface, closing four queued deliverables in one commit.
- AGENT_LOG.md — task-by-task summary with test counts.

https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx
AdaWorldAPI pushed a commit that referenced this pull request Jun 16, 2026
…oaOwner cherry-pick + LanceVersionScheduler + SurrealMailboxView (D-PG-6)

Lands four tasks from the shortest-unblocking-path list surfaced after
PR #497-#501 + the AdaWorldAPI/surrealdb fork bump (lance/lance-index =7.0.0,
lancedb =0.30.0, ndarray exact-rev). All four meet at the single contract
trait `MailboxSoaView`, closing the cascade in one commit (E-UNBLOCK-CASCADE-1).

## Task 3 — `NiblePath::{from_guid_prefix, prefix}` (zero-dep, foundational)

Ontology-side keystone follow-up of PR #498's `classid → ReadMode` LE contract.
The 20-nibble `classid(8) | HEEL(4) | HIP(4) | TWIG(4)` prefix overflows the
16-nibble MAX_DEPTH: the deterministic fold drops the canon-reserved high u16
of classid (root-first pack: `classid_lo(4) | HEEL(4) | HIP(4) | TWIG(4)`),
returning None when the fold would be lossy. `prefix(d)` is the O(1) ancestor
view; `prefix(d).is_ancestor_of(self)` holds for every d ≤ self.depth (the
routing-cache view of a deeper class path).

  +7 tests in `hhtl::tests`; contract lib 619 → 632 green.

## Task 2 — `impl MailboxSoaView + MailboxSoaOwner for MailboxSoA<N>`

Cherry-pick of jolly-cori-clnf9 commit 463d71b (integrated-cognitive-planner-v1
§2 Seam #3, +149 LOC). Adds `pub phase: KanbanColumn` field + zero-copy
repr(transparent) slice impls (edges_raw, meta_raw) + the in-RAM Rubicon
driving-loop test (`test_in_ram_driving_loop_walks_rubicon_to_commit`). The
contract spine (#437/#439) now drives an actual loop end-to-end — no surreal,
no ractor bus needed for the in-process case.

  +1 driving-loop test; cognitive-shader-driver lib 85 → 86 green.

## Task 1 — `LanceVersionScheduler` over `VersionedGraph::versions()`

D-MBX-9-IN core impl (the CI-gated twin of the contract slice shipped 2026-05-31).
Lives in `crates/lance-graph/src/graph/scheduler.rs`. Wraps a `VersionedGraph` +
inner `VersionScheduler<S = NextPhaseScheduler>` and exposes:

- `drive_once(view, exec)`           — read current Lance version, lower to a move
- `drive_at_latest(view, exec)`      — fold `versions().last()` into a move
- `current_dataset_version()`        — typed `DatasetVersion` over nodes head

Closes `E-SUBSTRATE-IS-THE-SCHEDULER`'s OUT-direction end-to-end. The OUT
direction stays propose-not-dispose (R1): returned `KanbanMove` is for the
caller's `MailboxSoaOwner::try_advance_phase` to apply.

  +5 tests with real on-disk tempdir Lance (no mocks).

## Task 4 — `SurrealMailboxView<'a>` (D-PG-6 contract slice)

Read-only `MailboxSoaView` adapter the SurrealQL projection populates via
`from_columns(...)` — pure zero-copy borrow over the kv-lance scan's byte
buffers. Imports `MailboxSoaView` but NOT `MailboxSoaOwner` (compile-time
enforcement of `kanban.rs:1-21` "surreal=project-read-only, callcenter=commit").

`read_via_kv_lance()` returns the new typed `SurrealContainerError::BlockedColdBuild`
until the surrealdb fork dep in `Cargo.toml` is uncommented — kept off by default
to avoid the ~10 min cold surrealdb build for contributors who don't need it.
The contract surface is available today; the integration is one Cargo.toml edit
+ a SurrealQL projection body in `view.rs`.

  +4 tests; new `lance-graph-contract` dep in surreal_container/Cargo.toml;
  BLOCKED(C) marker flipped to RESOLVED.

## What this unblocks

- **D-MBX-9-IN-impl** — SHIPPED (the contract trait now has a Lance-backed implementor).
- **D-MBX-A6-P3** — still queued, BUT Seam #3 (the in-RAM loop) is now in-tree;
  a downstream session can wire the emit-side without depending on the unmerged
  jolly branch.
- **D-PG-6 (Rubicon kanban VIEW)** — contract slice SHIPPED; impl-side gated on
  `BlockedColdBuild` flip-on (one Cargo.toml uncomment + projection body).
- **Identity-architecture v1 §3 P-SCOPE-CLASSIFY** — solved (the bijection-width
  fix is deterministic + ancestor-preserving + falsifiable by tests).

## Tests + clippy

- lance-graph-contract:   **632** (+7 hhtl)
- cognitive-shader-driver: **86** (+1 driving-loop)
- lance-graph::scheduler:  **5** (new module, real Lance tempdir)
- surreal_container::view: **4** (new module)

All clippy `-D warnings` clean on the new files. Pre-existing lints in
lance-graph-ontology / lance-graph-planner / ndarray_bridge.rs are out of
session scope.

## Board hygiene (mandatory rule)

- LATEST_STATE.md — Contract Inventory PREPEND for the new types.
- EPIPHANIES.md — E-UNBLOCK-CASCADE-1: three independent landings converge on
  one trait surface, closing four queued deliverables in one commit.
- AGENT_LOG.md — task-by-task summary with test counts.

https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants