Skip to content

EW64 cold-tier read surface + DemotionSink seam (D-EW64-3, D-EW64-4)#448

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/jolly-cori-clnf9
Jun 1, 2026
Merged

EW64 cold-tier read surface + DemotionSink seam (D-EW64-3, D-EW64-4)#448
AdaWorldAPI merged 3 commits into
mainfrom
claude/jolly-cori-clnf9

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 1, 2026

Copy link
Copy Markdown
Owner

What

Plan-agent-sequenced unblocked slices toward the white-matter EW64 connectome (follow-on to #447's promote/MRU).

D-EW64-3 — cold-tier read surface (episodic_edges.rs):

  • coldest() -> Option<EdgeRef> — the least-immediate present edge (last occupied slot under the MRU invariant) = exactly the edge promote evicts; symmetric to strongest(). A test ties the two APIs (coldest() == promote() eviction victim).
  • contains(e) -> bool — family-discriminating membership (cross(3,3)intra(3)), matching promote's dedup.

D-EW64-4 — the hot→cold exit seam (episodic_edges.rs):

  • DemotionSink trait + promote_into(e, sink)promote routing the evicted (coldest) edge to the cold connectome. Zero-dep seam; impls deferred. The surreal/LanceDB-LIVE "wingman" (E-SUBSTRATE-IS-THE-SCHEDULER) implements DemotionSinkgated on OQ-11.6 — the same dependency-inversion idiom as MailboxSoaOwner. Tested with a fake VecSink: non-full → empty; full+fresh → exactly the coldest; chain → age order; refire-present → untouched.

Honesty correction (board)

Prepends a factual fix: E-EW64-STRENGTH's "W15 0..3 plasticity" is high_heel::Heel (a 128-byte container field), not the 64-bit CausalEdge64 (whose plasticity is the 3-bit-per-plane PlasticityState). The plasticity-write co-fire stays GATED (model mismatch needs a design decision + causal-edge doesn't build offline + I-LEGACY v1/v2 minefield); the MRU slot-order strength (D-EW64-2) is unaffected.

Tests / clippy

cargo test -p lance-graph-contract --lib545 green (+10). Default clippy -D warnings clean; episodic_edges.rs clean at pedantic+nursery.

Flagged for @jan (design input, NOT built unattended)

  • Plasticity-write co-fire — needs the Heel-scalar vs PlasticityState-per-plane decision (above).
  • comprehension.rs → arcuate ±5 disambiguationSentenceStructure carries no ambiguity/candidate signal; the sense-candidate source (vocabulary neighbors? similarity top-k?) is net-new + firewall-sensitive.

Scope

Hot-tier read surface + the demotion seam only. NOT included (gated): the surreal/LanceDB-LIVE DemotionSink impl (OQ-11.6), the EpisodicWitness64 SoA column (needs cognitive-shader-driver, offline-gated).

https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Edge eviction identification, family-aware membership checks, and configurable routing for demoted edges during eviction.
  • Tests
    • Extended unit tests validating eviction behavior, membership semantics, and demotion routing scenarios.
  • Documentation
    • Updated project notes and status board entries describing the new episodic-edge behaviors and rollout plans.

claude added 2 commits June 1, 2026 00:49
…64-3, D-EW64-4)

Plan-agent-sequenced unblocked slices toward the white-matter connectome.

D-EW64-3: EpisodicEdges64::coldest() (the eviction victim, symmetric to
strongest) + contains() (family-discriminating membership). Pure zero-dep
bit-reads; coldest() == the edge promote() evicts (test ties the APIs).

D-EW64-4: DemotionSink trait + promote_into(e, sink) — the hot->cold exit seam.
promote routing the evicted (coldest) edge to the cold connectome; impls
(surreal/LanceDB-LIVE wingman, E-SUBSTRATE-IS-THE-SCHEDULER) deferred + GATED on
OQ-11.6 (same dependency-inversion idiom as MailboxSoaOwner). Tested with a fake
VecSink: non-full -> empty; full+fresh -> exactly coldest; chain -> age order;
refire-present -> untouched.

Also prepends a factual CORRECTION: E-EW64-STRENGTH's "W15 0..3 plasticity" is
high_heel::Heel (container field), NOT the 64-bit CausalEdge64 (3-bit-per-plane
PlasticityState). The plasticity-WRITE co-fire stays GATED (model mismatch needs
user decision + causal-edge offline + I-LEGACY v1/v2 minefield); the MRU
slot-order strength (D-EW64-2) is unaffected.

contract lib 545 green (+10); default clippy clean; episodic_edges.rs clean at
pedantic+nursery. Board: EPIPHANIES correction + AGENT_LOG + STATUS_BOARD +
LATEST_STATE.

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

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 63ddf0f5-fcba-4228-9c8a-57da0110b184

📥 Commits

Reviewing files that changed from the base of the PR and between 05ae893 and e886dc2.

📒 Files selected for processing (2)
  • .claude/board/AGENT_LOG.md
  • crates/lance-graph-contract/src/episodic_edges.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • .claude/board/AGENT_LOG.md
  • crates/lance-graph-contract/src/episodic_edges.rs

📝 Walkthrough

Walkthrough

This PR extends EpisodicEdges64 with three new public APIs and a trait to support MRU eviction handling and cold-tier queries: coldest() identifies the eviction victim, contains() tests membership, and promote_into() routes evictions through a pluggable DemotionSink for hot→cold connectome exits. Comprehensive tests validate all behaviors, and planning documentation records the deliverable status.

Changes

EpisodicEdges64 Demotion and Cold-Tier Query Surface

Layer / File(s) Summary
DemotionSink trait contract
crates/lance-graph-contract/src/episodic_edges.rs
New public trait DemotionSink with a demote(&mut self, evicted: EdgeRef) method to consume evicted edges routed from promotion.
EpisodicEdges64 promotion and query methods
crates/lance-graph-contract/src/episodic_edges.rs
EpisodicEdges64 adds promote_into(e, sink) to wrap existing promote and route any eviction into the sink, coldest() to return the last occupied slot's edge (the eviction victim), and contains(e) to check exact EdgeRef presence with family-discriminating dedup semantics.
Test coverage for demotion and query behavior
crates/lance-graph-contract/src/episodic_edges.rs
Tests validate coldest on empty/single/full words and confirm it matches the promote eviction victim; validate contains for present/absent edges and family discrimination; assert promote_into routes no demotion on non-full promotion, exactly the coldest edge on full promotion, accumulated ordering across chained promotions, and no demotion on refire.
Planning and deliverable documentation
.claude/board/AGENT_LOG.md, .claude/board/EPIPHANIES.md, .claude/board/LATEST_STATE.md, .claude/board/STATUS_BOARD.md
Status board, planning log, and state documentation updated with new deliverable entries (D-EW64-3 and D-EW64-4), epiphany correction clarifying W15 byte-3 high_heel::Heel vs. CausalEdge64 plasticity representation, and agent log recording newly shipped APIs and implementation deferment gating.

Possibly related PRs

  • AdaWorldAPI/lance-graph#447: Both PRs modify crates/lance-graph-contract/src/episodic_edges.rs around EpisodicEdges64::promote's MRU/eviction behavior—main PR builds coldest, contains, and promote_into/DemotionSink directly on top of the promote semantics implemented by PR #447.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 I nibble at edges both hot and cold,
I mark the coldest, the tales they hold.
If promotion spills an old friend loose,
a DemotionSink will catch the truce.
Happy hops for tests that folded gold.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically identifies the main changes: EW64 cold-tier read surface (coldest/contains APIs) and DemotionSink seam, with explicit reference to deliverables D-EW64-3 and D-EW64-4.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/jolly-cori-clnf9

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

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
crates/lance-graph-contract/src/episodic_edges.rs (1)

234-246: 💤 Low value

Consider reusing the existing iter() method.

The implementation is correct, but could be more concise by leveraging the existing iterator:

pub fn contains(self, e: EdgeRef) -> bool {
    self.iter().any(|x| x == e)
}

This would reuse the iter() logic and be slightly more idiomatic. However, the current explicit implementation is also clear and correct.

🤖 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 `@crates/lance-graph-contract/src/episodic_edges.rs` around lines 234 - 246,
The contains method manually loops over Self::CAPACITY and calls self.edge(i) to
check for equality with the EdgeRef argument; replace that manual loop by
delegating to the existing iterator: use self.iter().any to test whether any
yielded EdgeRef equals the provided e, keeping the method signature (pub fn
contains(self, e: EdgeRef) -> bool) and its #[must_use] attribute intact and
removing the explicit index loop and edge(i) calls.
🤖 Prompt for all review comments with 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.

Nitpick comments:
In `@crates/lance-graph-contract/src/episodic_edges.rs`:
- Around line 234-246: The contains method manually loops over Self::CAPACITY
and calls self.edge(i) to check for equality with the EdgeRef argument; replace
that manual loop by delegating to the existing iterator: use self.iter().any to
test whether any yielded EdgeRef equals the provided e, keeping the method
signature (pub fn contains(self, e: EdgeRef) -> bool) and its #[must_use]
attribute intact and removing the explicit index loop and edge(i) calls.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fdfdf68-9c85-46a8-8253-ababb1ff757c

📥 Commits

Reviewing files that changed from the base of the PR and between 4e06aeb and 05ae893.

📒 Files selected for processing (5)
  • .claude/board/AGENT_LOG.md
  • .claude/board/EPIPHANIES.md
  • .claude/board/LATEST_STATE.md
  • .claude/board/STATUS_BOARD.md
  • crates/lance-graph-contract/src/episodic_edges.rs

… review LAND

CodeRabbit nit (low value, sound): EpisodicEdges64::contains reuses the existing
iter() — self.iter().any(|x| x == e) — instead of a manual index loop. Equivalent
semantics (iter yields present edges in slot order; family-discriminating via
EdgeRef PartialEq), more idiomatic. Opus review verdict was LAND (no P0/P1); the
two optional editorial P2s are not applied.

episodic_edges tests green; default clippy -D warnings clean.

https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7
@AdaWorldAPI AdaWorldAPI merged commit 78005c6 into main Jun 1, 2026
6 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Jun 1, 2026
…+ gated phases + 3 decisions

Consolidates the EW64<->CE64 white-matter prefetch connectome after #447/#448
merged the hot tier (D-EW64-2/3/4). Phase A SHIPPED; B (plasticity-write
co-fire) GATED, C (surreal/LanceDB-LIVE wingman) GATED on OQ-11.6, D
(EpisodicWitness64 SoA column) GATED offline, E (comprehension<->arcuate ±5
wire) needs-design. Frames the three decisions that unblock further code:
plasticity model (Heel scalar vs PlasticityState per-plane), RawEdge mantissa
scope, and the comprehension-wire sense-candidate source. The morning handover.

https://claude.ai/code/session_012SorR8UbtEvYmbX8cXftj7
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