Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .claude/board/AGENT_LOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
## 2026-06-16 — PR #507 review pass: 5+3 agent fleet (5 specialists + PP-13/15/16 hardeners) → 1 P0 + 2 P1 + P2 docs fixed

**Main thread (Opus 4.7) spawned an 8-agent review fleet against PR #507** (the 4-task unblock-cascade below): 5 specialists (sentinel-qa, dto-soa-savant, iron-rule-savant, scenario-world, container-architect) + the 3 brutal hardeners (PP-13 brutally-honest-tester, PP-15 baton-handoff-auditor, PP-16 preflight-drift-auditor). Verdicts: dto-soa **LAND**, iron-rule **YIELDS-ALL**, container-architect **EXACT**, sentinel-qa **SOUND+P1**, scenario-world **CORRECT+P1**, PP-15 **CATCH-LATENT**, PP-16 **HOLD(P0)**, PP-13 **HOLD(P1×2)**. Consensus: mergeable after mechanical fixes; **zero REJECT, zero architectural rework** — "high-quality work" (PP-13), tests verified not-theater.

**The fleet earned its keep — two real defects all four green test suites missed:**

- **P0 (PP-16, root cause) — incomplete cherry-pick.** Task 2 cherry-picked `463d71b`'s `mailbox_soa.rs` half (+149) but **dropped its `causal-edge/src/edge.rs` half** (+6: the `#[repr(transparent)]` on `CausalEdge64` that is the layout enabler the `&[CausalEdge64]→&[u64]` reinterpret depends on). The SAFETY comment cited a `repr(transparent)` the type didn't carry — sound on today's rustc by newtype-layout coincidence, unsound by the letter, invisible to CI (borrow-checker ignores `repr`). Confirmed via `git show 463d71b --stat`. **Process lesson → EPIPHANIES E-CHERRYPICK-SPANS-CRATES-1.**
- **P1 (PP-13) — `fmt --check` overclaim.** The prior AGENT_LOG entry below said "clippy/fmt clean" but only clippy had been run; `cargo fmt --check` actually FAILED on PR-added lines (`hhtl.rs`, `scheduler.rs`, `view.rs`). Honest correction.

**Fixes applied (new commit on the same branch — preserves review history):**
- **FIX-A (P0):** restored the dropped enabler — `#[repr(transparent)]` + doc on `CausalEdge64` (`causal-edge/src/edge.rs:148-156`); added `const _` size/align guards at the `edges_raw`/`meta_raw` cast sites (compile-error on any layout regression); corrected both SAFETY comments.
- **FIX-B (P1):** ran `cargo fmt` on all 5 touched crates; `fmt --check` now exits 0.
- **FIX-C (P1, PP-15):** `SurrealMailboxView::from_columns` `debug_assert_eq!` → `assert_eq!` (the column-length invariant now fails loudly in ALL profiles — closes a release-build OOB where a ragged kv-lance projection → `n_rows() > entity_type().len()` → `SoaWavePrimer::project` indexes out of bounds). + `from_columns_rejects_ragged_projection` panic test.
- **FIX-D (P1, 4 agents):** `pub fn base_path()` on `VersionedGraph`; deleted the `format!("{:?}")` Debug-scrape in `scheduler.rs` (embedded-quote truncation hazard).
- **FIX-E (PP-13):** `test_edges_raw_meta_raw_reinterpret_round_trips` — the unsafe cast had ZERO coverage; now bit-exact round-trip + pointer-identity asserted.
- **FIX-F/H (P2 docs):** `hhtl` bijection doc `0..=16` → `1..=16` (prefix(0)=EMPTY is ancestor of nothing); `drive_at_latest` scope note (version-agnostic policies only) + `versions().last()` upstream-pagination caveat tying the ascending-sort assumption to the lance =7.0.0 pin.

**Disk verification this turn:** `git diff` confirms FIX-A landed (`#[repr(transparent)]` on `CausalEdge64` at `edge.rs:156`, `const _:` size/align guards at both cast sites in `mailbox_soa.rs`, `test_edges_raw_meta_raw_reinterpret_round_trips` at `mailbox_soa.rs:716`, `from_columns_rejects_ragged_projection` at `surreal_container/src/view.rs:257`). 34 files modified, +2841/-1100 — all uncommitted, awaits operator decision.
Comment on lines +10 to +18

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify the commit/status wording.

This section says the fixes were applied in a new commit, but the disk-verification note then says the branch is “all uncommitted.” Those states conflict; please distinguish committed fixes from any remaining unstaged drift so the log reflects the actual repo state.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/board/AGENT_LOG.md around lines 10 - 18, The AGENT_LOG.md file
contains conflicting statements about the repository state: the "Fixes applied"
section header claims the fixes are in a new commit, but the "Disk verification
this turn" note states all changes are uncommitted. Clarify the wording to
accurately reflect the actual state — either update the "Fixes applied" header
and descriptions to indicate these are staged/uncommitted changes awaiting
decision, or update the "Disk verification" note to confirm committed status.
Ensure both sections describe the same repository state consistently so readers
understand whether the 34 modified files with +2841/-1100 changes are committed
to the branch or still in the working directory.


**Discipline note:** this entry prepended BEFORE commit, per board-hygiene rule (board update must land in same commit, not as retroactive cleanup).

---

## 2026-06-16 — 4-task unblock-cascade landing: NiblePath::from_guid_prefix + MailboxSoaOwner cherry-pick + LanceVersionScheduler + SurrealMailboxView (D-PG-6 contract slice)

**Main thread (Opus 4.7) — single agent**, four ordered tasks responding to the user's "1 2 3 and 4" go-ahead on the shortest-unblocking-path list surfaced after #497-#501 + the surrealdb fork bump (`AdaWorldAPI/surrealdb` PR #34/#35/#36/#37 → main at `3aa6ab9` with `lance=7.0.0`/`lancedb=0.30.0`). All four committed together on `claude/odoo-savant-reasoners`, branch fast-forwarded through `cb14704`.

**Tasks shipped (in dep order, smaller → larger):**

1. **(3) `lance_graph_contract::hhtl::NiblePath::{from_guid_prefix, prefix}`** — the ontology-side keystone follow-up of #498 (`classid → ReadMode`). Deterministic 20→16 nibble fold of `classid_lo(4) | HEEL(4) | HIP(4) | TWIG(4)` (root-first), returns `None` when the canon-reserved high `u16` of classid is in use (refuses the lossy fold). `prefix(d)` is the O(1) single-shot ancestor view that satisfies `prefix(d).is_ancestor_of(self)` for every `d ≤ self.depth`. Zero-dep. +7 tests in `hhtl::tests` (612 → 619 → 632 contract lib green; clippy/fmt clean).

2. **(2) `impl MailboxSoaView + MailboxSoaOwner for MailboxSoA<N>`** — cherry-pick of commit `463d71b` (jolly-cori-clnf9, the +149 LOC the integrated-cognitive-planner-v1 §2 named as Seam #3). Adds `pub phase: KanbanColumn` field + zero-copy `repr(transparent)` slice impls (`edges_raw` / `meta_raw`) + the in-RAM Rubicon driving loop. The contract spine (#437/#439) now drives an actual loop — no surreal, no ractor bus needed for the in-process case. +1 driving-loop test (`test_in_ram_driving_loop_walks_rubicon_to_commit`, walks Planning → CognitiveWork → Evaluation → Commit with the −550 µs Libet anchor). 86 driver lib tests green.

3. **(1) `lance_graph::graph::scheduler::LanceVersionScheduler`** — D-MBX-9-IN core impl (the CI-gated twin of the contract slice D-MBX-9-IN shipped 2026-05-31). Wraps a `VersionedGraph` + inner `VersionScheduler<S = NextPhaseScheduler>` and lowers a Lance `versions()` tick into the next legal `KanbanMove` via `drive_once` / `drive_at_latest` / `current_dataset_version`. Closes `E-SUBSTRATE-IS-THE-SCHEDULER`'s OUT-direction end-to-end. +5 tests, real on-disk tempdir Lance (no mocks). New module wired in `crates/lance-graph/src/graph/mod.rs`.

4. **(4) `surreal_container::view::SurrealMailboxView`** — D-PG-6 contract slice (polyglot-container-query-membrane-v1 §D-PG-6). Read-only `MailboxSoaView` adapter that a SurrealQL projection over kv-lance populates via `from_columns(...)` — pure zero-copy borrow, no SurrealQL types cross the cognitive-side seam. Module imports `MailboxSoaView` but NOT `MailboxSoaOwner` (compile-time enforcement of the "surreal=project-read-only" ruling, `kanban.rs:1-21`). `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 cold-build cost on contributors who don't need it). +4 tests. New `lance-graph-contract` dep added to `surreal_container/Cargo.toml`; `BLOCKED(C)` note updated to RESOLVED.

**Test summary (this session):** lance-graph-contract **632** (+7) · cognitive-shader-driver **86** (+1) · lance-graph::graph::scheduler **5** (new) · surreal_container::view **4** (new). All clippy `-D warnings` clean on my files (pre-existing lints in `lance-graph-ontology`/`lance-graph-planner`/`ndarray_bridge.rs` ignored — out of session scope).

**Cross-PR unblocks closed by this commit:**
- D-MBX-9-IN-impl → SHIPPED (the contract trait now has a real Lance-backed implementor).
- D-MBX-A6-P3 (planner emit KanbanMove) → still queued, BUT Seams #3 (the loop) is now in-tree, so a downstream session can wire the emit-side without depending on the unmerged jolly branch.
- D-PG-6 (Rubicon kanban VIEW over surrealdb) → contract slice SHIPPED (typed `MailboxSoaView` impl); impl-side gated on `BlockedColdBuild` flip-on.
- Identity-architecture v1 §3 P-SCOPE-CLASSIFY blocker → solved (`from_guid_prefix` is deterministic + bijective + ancestor-preserving).

**Discipline:** PR_ARC entry deferred until merge commit; board hygiene (LATEST_STATE Contract Inventory + EPIPHANIES E-UNBLOCK-CASCADE-1) landed in the SAME commit per the mandatory rule.

## 2026-06-16 — 5-specialist framing of #497 OCR-transcode plans → plans rebaselined to #498 + probes spec'd

**Main thread (Opus 4.8 1M) + 5 Opus specialists in parallel** (cascade-architect / family-codec-smith / palette-engineer / dto-soa-savant / truth-architect), each read the 7 merged #497 plans + post-#498 source in full (Rule 7 — read, don't grep-judge). Operator: *"review the plans against your awareness of the new architecture incl. the last 15 PR arc (Morton Cascade + Helix 48 + turbovec residue) — send 5 specialist framing it."* See `EPIPHANIES.md` E-OCR-PLAN-DRIFT-1 for the consolidated framing.
Expand Down
28 changes: 28 additions & 0 deletions .claude/board/EPIPHANIES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## 2026-06-16 — E-UNBLOCK-CASCADE-1 — three independent fork/contract landings collapsed onto the same `MailboxSoaView` seam, closing four queued deliverables in one commit

**Status:** FINDING.
**Confidence:** High — every claim is grounded in shipped code (`hhtl::from_guid_prefix`, `MailboxSoaOwner for MailboxSoA<N>`, `LanceVersionScheduler`, `SurrealMailboxView`) and a single-pass `cargo test` sweep (632 + 86 + 5 + 4 green).

**Context.** Three landings hit the workspace within ~24 h:
- PR #498 (`feat(contract): GUID decode→read-mode keystone + helix Signed360 right-size + OCR→NodeRow transcode`) — surfaced `NodeGuid::decode() → GuidParts` + `classid_read_mode`.
- `AdaWorldAPI/surrealdb` PR #34/#35/#36/#37 → main at `3aa6ab9` (lance/lancedb/object_store pins reconciled) — closed the `BLOCKED(C)` on `surreal_container`.
- The cherry-pick of `jolly-cori-clnf9` commit `463d71b` (the +149 LOC `MailboxSoaOwner` impl for `MailboxSoA<N>`) had been the integrated-cognitive-planner-v1 Seam #3.

**The find.** All three meet at exactly **one trait surface**: `lance_graph_contract::soa_view::MailboxSoaView`. Each landing made a DIFFERENT impl viable on the same boundary:
- **`MailboxSoA<N>` (cognitive)** — the in-process owner+view, so the Rubicon loop runs in-RAM (was only on `jolly`).
- **`SurrealMailboxView<'a>` (surreal-side view)** — D-PG-6's read glove, now buildable end-to-end via the fork's `kv-lance` backend.
- **`NiblePath::from_guid_prefix`** — the ontology-side keystone follow-up of #498's `classid → ReadMode` LazyLock: a deterministic 20→16 nibble fold that satisfies the routing-prefix `is_ancestor_of` invariant the LE contract names.

`LanceVersionScheduler` (D-MBX-9-IN core impl) sits one layer up and consumes ANY `V: MailboxSoaView` — so a single OUT-direction wrapper drives all three impls without case-splitting. The trait's read-only-by-design (`MailboxSoaView` has no mutator method) is the structural enforcement of `kanban.rs:1-21`'s "surreal=project-read-only, callcenter=commit" ruling; the SurrealQL adapter NOT importing `MailboxSoaOwner` is the compile-time tripwire if a future drift tries to mutate through the projection.

**Why this matters.** Four "still BLOCKED" rows from the most recent unblock-list synthesis (last sync turn) all collapse onto a SINGLE commit, because the substrate already had the shape — only three independent dep/code landings had to converge. The pattern:
- Substrate trait designed once + multiple implementors (no `Box<dyn>` in hot paths — generic `V: MailboxSoaView` everywhere).
- Read-only-by-trait-design = compile-time enforcement of the architectural ruling (no need for a runtime "you can't write through this" guard).
- A typed `BlockedColdBuild` error variant lets a heavy dep wire-up (surrealdb cold build) be deferred without breaking the contract-side adapter — the surface ships, the integrator flips it on in their branch.

**Lesson.** When three plans cite the same trait surface as their unblock dependency, the first session that lands ANY one of the implementors should ALSO ship the trait-impl shape for the others (even as a stub returning a typed error). This collapses N independent post-unblock follow-ups into 1 commit's worth of trait engineering. The cost is ~50 LOC of stub + a typed error variant; the benefit is N − 1 fewer post-merge commits per queued plan.
Comment on lines +11 to +23

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Separate the NiblePath work from the mailbox seam.

NiblePath::from_guid_prefix is not part of the MailboxSoaView/MailboxSoaOwner seam, so the current "one trait surface" framing overstates the coupling. As written, it reads like Task 3 collapses into the mailbox-view commit, which is not what the diff shows.

Suggested rewording
- **The find.** All three meet at exactly **one trait surface**: `lance_graph_contract::soa_view::MailboxSoaView`.
+ **The find.** The mailbox/view work converges on `lance_graph_contract::soa_view::MailboxSoaView`; `NiblePath::from_guid_prefix` is an adjacent routing follow-up, not part of that seam.

Based on learnings: Task 3 adds NiblePath::{from_guid_prefix, prefix}, while Task 2 adds MailboxSoaView/MailboxSoaOwner and Task 4 adds SurrealMailboxView.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/board/EPIPHANIES.md around lines 11 - 23, The current wording in the
"The find" section conflates NiblePath::from_guid_prefix with the MailboxSoaView
trait surface, overstating their coupling. NiblePath is not an implementation of
MailboxSoaView and is actually part of separate work. Reword the section to
clarify that the actual trait surface convergence point involves only
MailboxSoA<N> and SurrealMailboxView as implementations of
MailboxSoaView/MailboxSoaOwner, while NiblePath::{from_guid_prefix, prefix} is
separate work that should be called out as Task 3 independently adding that
ontology-side keystone. Restructure the bullet points so the three items listed
correspond to distinct task boundaries rather than all appearing to converge on
the single trait surface.


**Cross-ref.** Identity-architecture v1 §3 (the bijection-width problem); polyglot-container-query-membrane-v1 §D-PG-6 (the Rubicon kanban VIEW); integrated-cognitive-planner-v1 §2 (Seams #1–#6, the additive-only convergence); `E-SUBSTRATE-IS-THE-SCHEDULER` (the bidirectional kanban subscription); `kanban.rs:1-21` (the read-only ruling the trait shape enforces).

---

## 2026-06-16 — E-OCR-PLAN-DRIFT-1 — the #497 OCR-transcode plans drifted from the substrate in 6 ways; 2 were showstoppers

**Status:** FINDING (5-specialist framing — cascade-architect / family-codec-smith / palette-engineer / dto-soa-savant / truth-architect, each read the merged plans + source in full).
Expand Down
2 changes: 2 additions & 0 deletions .claude/board/LATEST_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@

## Current Contract Inventory (lance-graph-contract)

> **2026-06-16 — ADDED (4-task unblock-cascade)**: `lance_graph_contract::hhtl::NiblePath::{from_guid_prefix(&NodeGuid) -> Option<NiblePath>, prefix(depth: u8) -> Option<NiblePath>}` — the ontology-side keystone follow-up of #498's `classid → ReadMode` LE contract. The 20-nibble `classid · HEEL · HIP · TWIG` prefix is deterministically folded to 16 (the canon-reserved high `u16` of classid drops); returns `None` when the fold would be lossy (callers don't get silent collisions). `prefix(d)` is the O(1) single-shot ancestor view that satisfies `prefix(d).is_ancestor_of(self)` for every `d ≤ self.depth` — the routing-cache view of a deeper class path. **One layer up** in `cognitive-shader-driver::MailboxSoA<N>`: `impl MailboxSoaView + MailboxSoaOwner` (cherry-pick of `jolly-cori-clnf9::463d71b`) + the `pub phase: KanbanColumn` field — the in-RAM Rubicon owner the contract's `MailboxSoaOwner` had no real implementor for (integrated-cognitive-planner-v1 §2 Seam #3 closed). In `lance_graph::graph::scheduler`: `LanceVersionScheduler<S = NextPhaseScheduler>` — D-MBX-9-IN core impl over `VersionedGraph::versions()`, generic over the inner `VersionScheduler` policy (closes `E-SUBSTRATE-IS-THE-SCHEDULER`'s OUT-direction). In `surreal_container::view`: `SurrealMailboxView<'a>` + `read_via_kv_lance()` (D-PG-6 contract slice) — the SurrealQL read-glove the integrator wires once the cold-build of the surrealdb fork is taken; the contract surface is available today. Plus `SurrealContainerError::BlockedColdBuild` — typed signal for callers to pattern-match the cold-build gate (distinct from the pre-existing `Blocked` variant which signals coordinate/API gaps). Zero-dep contract additions (+7 hhtl tests, 632 lib green); cognitive-shader-driver +1 driving-loop test (86 lib green); lance-graph::scheduler new module (+5 tests, real tempdir Lance); surreal_container::view new module (+4 tests). All four green; clippy `-D warnings` clean on the new files. EPIPHANIES `E-UNBLOCK-CASCADE-1` records the convergence of three independent landings onto the single `MailboxSoaView` trait surface.

> **2026-06-09 — ADDED (D-IDENTITY-1, Phase A of identity-architecture)**: `lance_graph_contract::identity::{NodeGuid([u8;16]), IDENTITY_LAYOUT_VERSION}` — the workspace's first **stable binary instance identity**: a structured 128-bit UUIDv8 (RFC 9562) = the HHTL nibble-address **formalized + namespaced**. **Composed from existing committed scalars, never re-invented** (Agent A sweep confirmed the 128-bit id space was empty): octets carry `namespace:u8 | entity_type:u16 | kind:u8` (the `SchemaPtr.packed` convention) ⊕ a truncated `NiblePath` routing prefix (`PREFIX_NIBBLES=4`) ⊕ a 22-bit `shape_hash` (truncated `StructuralSignature`) ⊕ a 24-bit `local`, with UUIDv8 version(=8)/variant(=0b10) at their RFC-fixed positions + an `IDENTITY_LAYOUT_VERSION` stamp. **Eineindeutigkeit**: `entity_type` is the canonical exact class identity; the `NiblePath` prefix is the bijective DERIVED view (a *truncated* prefix can't be the identity — deep classes collide past it; the prefix `is_ancestor_of` the full path). Five readings: resolve (`entity_type`) / route (`niblepath`) / witness (frozen bytes + merkle) / ground-truth (`shape_hash` drift) / dispatch-to-store (`as_bytes` → `EntityKey`). Also added `hhtl::NiblePath::from_packed` (inverse of `packed`). Zero-dep; 599 contract lib tests (+15: field-isolation matrix, UUIDv8 gates, ancestor-prefix invariant, Display=canonical-UUID); clippy `-D warnings` clean; fmt clean. Plans: `identity-architecture-exists-vs-needs-v1.md` (exists-vs-needs map + phases A→H), `cognitive-write-roundtrip-substrate-v1.md`. Epiphany: E-IDENTITY-WHITEBOX-1.

> **2026-05-31 — ADDED (D-EW64-1 + D-VIEW-1, episodic-RISC-spine)**: `episodic_edges::{EpisodicEdges64(u64), EdgeRef{family:u8,local:u16}}` — AriGraph episodic edges, 4x[4-bit family | 12-bit local]: family 0 = intra-basin (inherited, ~98.6% per #444), 1..=15 = cross-family index into the OGIT-class-inherited palette (~1.4%; identities inherited, never on the edge — I-VSA-IDENTITIES). Plus `view_angle::ViewAngle` (4-bit view-schema selector; presence bitmask doubles as attention mask, inherited). Zero-dep; 527 contract lib tests; clippy pedantic+nursery clean. Plan: episodic-risc-spine-v1.md.
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading