Skip to content

P3: wire the rung ascent loop + dedup RungLevel (D-TRI-6)#708

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/review-claude-board-files-nhqgx1
Jul 17, 2026
Merged

P3: wire the rung ascent loop + dedup RungLevel (D-TRI-6)#708
AdaWorldAPI merged 3 commits into
mainfrom
claude/review-claude-board-files-nhqgx1

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 17, 2026

Copy link
Copy Markdown
Owner

What

Executes the §3a Maslow-pyramid wiring that E-MASLOW-PYRAMID-OF-COGNITION-1 named as "the missing wiring" — the first code plateau of the rung/ancestry arc. Four deliverables, all verified green.

(D) The rung ascent loop (centerpiece). The driver already held a per-driver RungElevator and called on_gate() once per dispatch, but the rung never reached projection selection — stage [3] cascade used req.layer_mask verbatim. Now the elevator's current level (advanced by the previous cycle's gate) selects this cycle's cascade breadth via rung_widened_layer_mask, closing the loop across cycles.

The one real correctness gate was an axis mismatch, not the ladder: p64 CognitiveShader::cascade's layer_mask is an 8-bit predicate-plane mask (CAUSES..BECOMES), NOT the 3-bit SPO projection mask RungLevel::causal_mask_bits() returns. Feeding causal_mask_bits() raw would be a category error and would collapse base-Surface to plane 0. Fix: the rung's Pearl level selects a predicate-plane widen-set (mirrors p64_bridge::edge_to_layer_mask), applied as a UNION gated on elevation-above-base → identity at base (zero regression), superset-monotone above. The D-TRI-6 settlement probe (sustained BLOCK ascends → sustained FLOW relaxes to base; mask widens then returns to identity) is green.

(A) RungLevel dedup + dead-path removal. thinking-engine's RungLevel was variant-identical to the contract's; collapsed to pub use lance_graph_contract::cognitive_shader::RungLevel (added as_u8() to the contract; a discriminant-parity test is the "measure" step — a repr(u8) variant-identical enum needs no jc battery). Deleted the dead should_elevate, LayerId (zero consumers), and Agent.current_rung (write-once Surface, never mutated — the loop lives on the driver's elevator, not the orphaned Agent).

(B) scenario.rs Pearl-numbering doc wobble fixed (interventions = rung 2, not 3). (C) nars_engine deprecation silenced with a justified #[allow(deprecated)] (v2 inference_type() already routes through from_mantissa internally; temporal() inert under v2) — planner clippy -D warnings exit 0.

Verification

Crate build clippy -D warnings tests
lance-graph-contract ✓ exit 0 905 ✓ (parity by name ✓)
lance-graph-planner ✓ exit 0 (C fix) 215 ✓
cognitive-shader-driver driver.rs 0 findings† 103 ✓ (both D-TRI-6 probes)
thinking-engine ✓ lib pre-existing debt only‡ pre-existing debt only‡

-p cognitive-shader-driver -- -D warnings is blocked only by pre-existing lance-graph-ontology dep debt (TD-ONTOLOGY-CLIPPY-DEBT-1); the driver's own code has zero findings.
‡ thinking-engine is a workspace-excluded (non-CI) crate carrying ~40 pre-existing clippy lints + a stale test-compile break, all outside P3's diff (TD-THINKING-ENGINE-EXCLUDED-DEBT-1). Its lib builds clean.

The System-1 arm (apply_delta(rung_delta())) is left test-only — the driver hot path has no emergence/coherence scalar to feed it, and fabricating one is forbidden.

Board hygiene (same commit)

STATUS_BOARD D-TRI-6 (ascent loop WIRED), EPIPHANIES E-RUNG-ASCENT-WIRED-1, TECH_DEBT TD-THINKING-ENGINE-EXCLUDED-DEBT-1 + TD-ONTOLOGY-CLIPPY-DEBT-1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Shader-driver ascent now progressively widens predicate coverage during sustained blocking conditions.
    • Coverage returns to the requested base level during sustained flow conditions.
    • Added safeguards for base-level identity and maximum coverage saturation.
  • Documentation

    • Updated delivery status and recorded related technical debt.
    • Corrected Pearl rung references in scenario documentation.
  • Refactor

    • Unified rung-level handling across components and removed obsolete rung and layer state.

Executes the §3a Maslow-pyramid wiring that E-MASLOW-PYRAMID-OF-COGNITION-1
named as the missing piece. Four deliverables, all verified green.

(D) Rung ascent loop — the driver already held a per-driver RungElevator
and called on_gate() once per dispatch, but the rung never reached
projection selection (stage [3] cascade used req.layer_mask verbatim).
Now the elevator's current level (advanced by the previous cycle's gate)
selects this cycle's cascade breadth via rung_widened_layer_mask, closing
the loop across cycles. CORRECTNESS GATE resolved: p64 cascade's layer_mask
is an 8-bit PREDICATE-PLANE mask (CAUSES..BECOMES), NOT the 3-bit SPO
projection mask causal_mask_bits() returns — so the rung's Pearl level
selects a predicate-plane widen-set applied as a UNION gated on
elevation-above-base: identity at base (zero regression), superset-monotone
above. D-TRI-6 settlement probe green (BLOCK ascends, FLOW relaxes to base,
mask widens then returns to identity).

(A) Dedup — thinking-engine's variant-identical RungLevel collapsed to a
re-export of the contract type (added as_u8() to the contract; a
discriminant-parity test is the measure step). Removed dead should_elevate,
LayerId (zero consumers), and Agent.current_rung (write-once Surface, never
mutated — the loop lives on the driver's elevator).

(B) scenario.rs Pearl-numbering doc fix (interventions = rung 2, not 3).
(C) nars_engine deprecation silenced with justified #[allow(deprecated)]
(v2 inference_type() already routes through from_mantissa; temporal() inert)
— planner clippy -D warnings exit 0.

Verified: contract 905 tests + parity green + clippy exit 0; planner 215 +
clippy exit 0; driver 103 + both D-TRI-6 probes green; thinking-engine lib
builds. System-1 apply_delta arm left test-only (no emergence/coherence
scalar in the driver hot path; fabricating one is forbidden).

Board: STATUS_BOARD D-TRI-6 (ascent loop wired), EPIPHANIES
E-RUNG-ASCENT-WIRED-1, TECH_DEBT TD-THINKING-ENGINE-EXCLUDED-DEBT-1 +
TD-ONTOLOGY-CLIPPY-DEBT-1 (pre-existing debts surfaced, out of P3 scope).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD
@cursor

cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_88b8ec0e-6c79-45eb-94d8-50e1389acca4)

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e73253b-0a8e-4200-aae0-d98ca67a0308

📥 Commits

Reviewing files that changed from the base of the PR and between 184efcc and 17368ea.

📒 Files selected for processing (2)
  • crates/cognitive-shader-driver/src/driver.rs
  • crates/lance-graph-planner/src/cache/nars_engine.rs
📝 Walkthrough

Walkthrough

The PR wires persistent RungElevator state into shader cascade mask selection, centralizes RungLevel in the contract crate, removes obsolete thinking-engine rung state and heuristics, and updates related documentation, lint suppressions, tests, and project records.

Changes

Rung ascent contracts and integration

Layer / File(s) Summary
Shared RungLevel contract
crates/lance-graph-contract/src/cognitive_shader.rs
Adds RungLevel::as_u8() and tests ordinal parity and round trips.
Persistent rung widening in ShaderDriver
crates/cognitive-shader-driver/src/driver.rs, .claude/board/EPIPHANIES.md
Computes an effective predicate-plane mask from RungElevator, applies it to cascade queries, advances the elevator after gates, and tests ascent, relaxation, identity, and saturation.
Thinking-engine rung state alignment
crates/thinking-engine/src/cognitive_stack.rs, crates/thinking-engine/src/persona.rs, crates/thinking-engine/src/world_model.rs
Re-exports the contract RungLevel, removes obsolete rung APIs and Agent.current_rung, and emits surface-level rung values in DTOs.
Supporting contract records and lint alignment
crates/lance-graph-contract/src/scenario.rs, crates/lance-graph-planner/src/cache/nars_engine.rs, .claude/board/*
Corrects Pearl rung documentation, suppresses justified deprecation warnings, and records status and technical debt updates.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ShaderDriver
  participant RungElevator
  participant CognitiveShader
  ShaderDriver->>RungElevator: Align to requested base rung
  RungElevator-->>ShaderDriver: Return current rung level
  ShaderDriver->>CognitiveShader: Cascade with effective layer mask
  ShaderDriver->>RungElevator: Advance on gate result
Loading

Possibly related PRs

Suggested reviewers: claude

Poem

I hop through rungs where bright masks grow,
The shader follows currents below.
Old layers sleep, one contract sings,
Gates lift pearls on widening wings.
Base stays true, then upward springs.

🚥 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 captures the main change: wiring the rung ascent loop and deduplicating RungLevel for D-TRI-6.
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.

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.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review July 17, 2026 12:06

@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: 184efcc153

ℹ️ 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".

Comment on lines +604 to +606
// base; sustained-FLOW relaxes back to it). The base-reset already ran
// at the top of `run()` where the level was read for the cascade, so
// `elevator.base == req.rung` holds here. The resulting level is what the

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 Re-validate the elevator base before applying the gate

When the same ShaderDriver handles concurrent dispatches with different ShaderDispatch::rung values, the base reset done at the top of run() is not protected until this later update. Another dispatch(&self) can acquire the rung_elevator write lock in between and reset base, so the assumption that elevator.base == req.rung no longer holds; this dispatch’s gate is then counted against the other request’s base and can make the next cascade use the wrong widened mask. Keeping the reset in the same critical section as on_gate avoids cross-request rung leakage.

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.

Correct — fixed in c793556. The per-driver RungElevator is a &self RwLock singleton, so the split I introduced (read level at the top of run(), on_gate at the bottom, in two separate critical sections) opened exactly the window you describe: a concurrent dispatch with a different req.rung could reset base in between, and this cycle's gate would then count against the wrong base. Restored the if elevator.base != req.rung { reset } inside the same critical section as on_gate (as the pre-PR code had it), keeping reset+advance atomic. Parity with the original atomicity; a genuinely per-request elevator is the triangle-arc mailbox-SoA design, out of scope here. Driver rebuilt: 103 tests pass, both D-TRI-6 probes green.


Generated by Claude Code

Codex correctly flagged a concurrency window I introduced. The
per-driver RungElevator is a &self singleton behind a RwLock, so
concurrent dispatches share it. My change read the elevator's level at
the top of run() (for the cascade mask) and advanced it via on_gate at
the bottom, in TWO separate critical sections — dropping the base-reset
from the bottom block on the assumption elevator.base == req.rung still
held. Under concurrency a sibling dispatch with a different req.rung can
reset base in the window between, so on_gate then counts this cycle's
gate against the wrong base and the next cascade widens with the wrong
mask. Fix: restore the reset-if-mismatch inside the on_gate critical
section (as the original code had it), keeping reset+advance atomic.
Parity with the pre-PR atomicity; the deeper per-request elevator is the
triangle-arc mailbox-SoA design, not this PR.

Driver rebuilt: 103 tests pass, both D-TRI-6 probes green.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD

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

Actionable comments posted: 6

🤖 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.

Inline comments:
In @.claude/board/EPIPHANIES.md:
- Around line 1-11: Move the new dated section in EPIPHANIES.md from the
beginning to the end of the existing entries, preserving all prior content and
ordering unchanged. Treat the file as an append-only audit ledger and append
this update rather than rewriting or prepending it.

In @.claude/board/STATUS_BOARD.md:
- Line 12: Preserve the original D-TRI-6 row in .claude/board/STATUS_BOARD.md
and append a dated status update instead of editing it in place. Move the new
debt entries in .claude/board/TECH_DEBT.md from lines 3-10 to the ledger’s
append point. Treat all .claude/board/*.md files as append-only audit ledgers.

In @.claude/board/TECH_DEBT.md:
- Around line 3-10: Move the new TD-THINKING-ENGINE-EXCLUDED-DEBT-1 and
TD-ONTOLOGY-CLIPPY-DEBT-1 records from the top of TECH_DEBT.md to the file’s
append point after the existing ledger history. Preserve their content and
ordering, ensuring .claude/board/*.md remains append-only.

In `@crates/cognitive-shader-driver/src/driver.rs`:
- Around line 240-249: Update the dispatch-state handling in run() around
rung_elevator so reading the current rung, computing the widened layer mask,
applying the gate, and updating the elevator occur within one serialized
transaction. Prevent concurrent dispatches from resetting or advancing another
request’s base, while releasing the lock before any sink callbacks to avoid
holding it across reentrant callback execution.
- Around line 602-614: Move the `rung_elevator` write-lock and
`elevator.on_gate(gate)` transition from the current post-sink block to
immediately after `gate` is decided, before either sink callback or its early
returns. Ensure both `BLOCK` and `FLOW` outcomes advance the persistent elevator
even when sink processing terminates the dispatch, while preserving the
resulting rung used by subsequent dispatch logic.

In `@crates/lance-graph-planner/src/cache/nars_engine.rs`:
- Around line 503-511: The v2 SpoHead round-trip must not copy reclaimed bits
from CausalEdge64::temporal() into SpoHead.temporal. Update the round-trip
conversion around the #[allow(deprecated)] site to preserve temporal only for
the v1 layout, or use the documented v2 sentinel, while retaining current v1
behavior; add a field-isolation test covering the v2 path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b23ff902-36f8-4971-afab-ba7625a0b391

📥 Commits

Reviewing files that changed from the base of the PR and between efd21d2 and 184efcc.

📒 Files selected for processing (10)
  • .claude/board/EPIPHANIES.md
  • .claude/board/STATUS_BOARD.md
  • .claude/board/TECH_DEBT.md
  • crates/cognitive-shader-driver/src/driver.rs
  • crates/lance-graph-contract/src/cognitive_shader.rs
  • crates/lance-graph-contract/src/scenario.rs
  • crates/lance-graph-planner/src/cache/nars_engine.rs
  • crates/thinking-engine/src/cognitive_stack.rs
  • crates/thinking-engine/src/persona.rs
  • crates/thinking-engine/src/world_model.rs

Comment thread .claude/board/EPIPHANIES.md
Comment thread .claude/board/STATUS_BOARD.md
Comment thread .claude/board/TECH_DEBT.md
Comment thread crates/cognitive-shader-driver/src/driver.rs
Comment thread crates/cognitive-shader-driver/src/driver.rs Outdated
Comment thread crates/lance-graph-planner/src/cache/nars_engine.rs Outdated
…2 temporal sentinel

Two valid review findings fixed:

1. (CodeRabbit, driver.rs) The sink early-returns (on_resonance/on_bus
   returning false, lines 556/579) bypassed the on_gate block at the
   bottom of run(), so a sink that stops processing would freeze the
   rung ascent ladder — now that the elevator drives the cascade this is
   observable. Moved the on_gate transition to immediately after gate is
   decided, BEFORE the sink callbacks, so every dispatch that reaches a
   gate advances the elevator. Verified no early return exists between
   gate-decision (l.454) and the sinks. The base-reset stays inside the
   same critical section (the codex atomicity fix, c793556).

2. (CodeRabbit, nars_engine.rs) from_causal_edge copied edge.temporal()
   into SpoHead.temporal. causal-edge defaults to causal-edge-v2-layout,
   where bits 52-63 are reclaimed (W-slot/lens/spare) and temporal()
   returns GARBAGE (edge.rs:551 doc). Per I-LEGACY-API-FEATURE-GATED,
   temporal is now the documented 0 sentinel (temporal is structural:
   SpoWitnessChain / AriGraph). inference_type() keeps #[allow(deprecated)]
   — it returns the CORRECT value under v2 (routes through from_mantissa),
   deprecated only as an API nudge. Added field-isolation test
   from_causal_edge_temporal_is_v2_sentinel_not_reclaimed_bits (raw
   reclaim-zone bits -> temporal() garbage -> SpoHead.temporal == 0).

Verified: driver 103 tests + both D-TRI-6 probes green; planner 215 +
the new isolation test green; planner clippy --all-targets exit 0.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Awg6TXocHcwTtc6eGsHcdD
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
Evaluation + wave plan for feeding a new query-side crates/graphrag and OGAR's
ogar-doc from the existing SoA + CausalEdge64 + (queued) EpisodicWitness64
substrate, aligned to #708 / D-TRI-6 (the rung-ascent loop) and the v3 waves.

Key rulings the plan encodes:
- Direction reframe (assembler-vs-storage boundary): OGAR owns doc ingestion +
  the document 0x080B mint (ogar-from-docv1 -> ogar-doc-ir -> ogar-doc, built);
  lance-graph provides contract types OGAR consumes + query. graphrag is
  query-side ONLY, reads the calcified substrate, never ingests. A lance-graph
  doc-transcode crate is REJECTED (duplicates ogar-from-docv1, inverts the dep).
- REUSE the substrate, BUILD only 3 gaps: hierarchical Leiden, HippoRAG-PPR
  reset-distribution, BM25. Extraction/SPO/fact-store/vector-CAM-PQ already
  exist; causal_edge::CausalEdge64 is the SPO edge (not the thinking-engine
  variant); EpisodicWitness64 is a queued column (today WitnessTable +
  EpisodicEdges64). graphrag-rs = REUSE-AS-REFERENCE (E-V3-GRAPHRAG-INV-1).
- Retrieval = rung ascent (#708): dispatches through RungElevator + canonical
  RungLevel; BLOCK ascends and widens the CAUSES..BECOMES predicate-plane mask,
  FLOW relaxes to base. The graph is load-bearing because surprise ascends the
  elevator. Maps onto the triangle-tenants Maslow pyramid (D-TRI).
- Probe-first: G0 P-GRAPH-LOADBEARING (graph vs vector-only) gates all
  Leiden/PPR code. Composes atop oxigraph-arigraph-cognitive-shader-soa-merge-v1.

No bytes land; D-GR-5 (OGAR seam) mint-gated + baton-audited. Board hygiene:
INTEGRATION_PLANS prepend in the same commit.

Co-Authored-By: Claude <noreply@anthropic.com>
@AdaWorldAPI
AdaWorldAPI merged commit 8d3209c into main Jul 17, 2026
6 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
Evaluation + wave plan for feeding a new query-side crates/graphrag and OGAR's
ogar-doc from the existing SoA + CausalEdge64 + (queued) EpisodicWitness64
substrate, aligned to #708 / D-TRI-6 (the rung-ascent loop) and the v3 waves.

Key rulings the plan encodes:
- Direction reframe (assembler-vs-storage boundary): OGAR owns doc ingestion +
  the document 0x080B mint (ogar-from-docv1 -> ogar-doc-ir -> ogar-doc, built);
  lance-graph provides contract types OGAR consumes + query. graphrag is
  query-side ONLY, reads the calcified substrate, never ingests. A lance-graph
  doc-transcode crate is REJECTED (duplicates ogar-from-docv1, inverts the dep).
- REUSE the substrate, BUILD only 3 gaps: hierarchical Leiden, HippoRAG-PPR
  reset-distribution, BM25. Extraction/SPO/fact-store/vector-CAM-PQ already
  exist; causal_edge::CausalEdge64 is the SPO edge (not the thinking-engine
  variant); EpisodicWitness64 is a queued column (today WitnessTable +
  EpisodicEdges64). graphrag-rs = REUSE-AS-REFERENCE (E-V3-GRAPHRAG-INV-1).
- Retrieval = rung ascent (#708): dispatches through RungElevator + canonical
  RungLevel; BLOCK ascends and widens the CAUSES..BECOMES predicate-plane mask,
  FLOW relaxes to base. The graph is load-bearing because surprise ascends the
  elevator. Maps onto the triangle-tenants Maslow pyramid (D-TRI).
- Probe-first: G0 P-GRAPH-LOADBEARING (graph vs vector-only) gates all
  Leiden/PPR code. Composes atop oxigraph-arigraph-cognitive-shader-soa-merge-v1.

No bytes land; D-GR-5 (OGAR seam) mint-gated + baton-audited. Board hygiene:
INTEGRATION_PLANS prepend in the same commit.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…ate (§10)

Verified every reuse/build assumption against the tree at 8d3209c (#708 merged).
Verdict: FEASIBLE, two small non-blocking caveats, no circular deps.

Confirmed reachable (pub): RungElevator (pub struct/fields + new + on_gate) and
RungLevel/GateDecision/MailboxSoaView + CausalEdge64 all from ZERO-DEP crates;
TripletGraph exposes the exact walk (get_associated multi-hop, intervene_on
Pearl-2 apex, detect_contradictions = the BLOCK trigger, revise_with_evidence),
spo_bridge::promote_to_spo pub, hdr_pagerank + ScentCsr::spmv pub, cam_pq pub.
The rung loop maps 1:1 onto existing methods.

Caveat 1 (drives a feature gate): the graph legs live in lance-graph core =
drags datafusion/lance/arrow (19 heavy-dep lines); the rung-ascent core is
zero-dep. => default graphrag = LIGHT (rung ascent + BM25 + in-memory PPR + G0
probe); feature graphrag-lance = HEAVY graph legs. §4 crate topology updated.

Caveat 2: rung_widened_layer_mask is private (driver.rs:701) => make pub / move
to contract, or replicate the pure fn (secondary leg; ascent works without it).

Genuine BUILD confirmed: hierarchical Leiden (jc louvain is example-only),
HippoRAG-PPR reset-distribution atop hdr_pagerank, BM25. Next step needs no
upstream change: scaffold the light crate + cargo-check compile-proof, then G0.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
Evaluation + wave plan for feeding a new query-side crates/graphrag and OGAR's
ogar-doc from the existing SoA + CausalEdge64 + (queued) EpisodicWitness64
substrate, aligned to #708 / D-TRI-6 (the rung-ascent loop) and the v3 waves.

Key rulings the plan encodes:
- Direction reframe (assembler-vs-storage boundary): OGAR owns doc ingestion +
  the document 0x080B mint (ogar-from-docv1 -> ogar-doc-ir -> ogar-doc, built);
  lance-graph provides contract types OGAR consumes + query. graphrag is
  query-side ONLY, reads the calcified substrate, never ingests. A lance-graph
  doc-transcode crate is REJECTED (duplicates ogar-from-docv1, inverts the dep).
- REUSE the substrate, BUILD only 3 gaps: hierarchical Leiden, HippoRAG-PPR
  reset-distribution, BM25. Extraction/SPO/fact-store/vector-CAM-PQ already
  exist; causal_edge::CausalEdge64 is the SPO edge (not the thinking-engine
  variant); EpisodicWitness64 is a queued column (today WitnessTable +
  EpisodicEdges64). graphrag-rs = REUSE-AS-REFERENCE (E-V3-GRAPHRAG-INV-1).
- Retrieval = rung ascent (#708): dispatches through RungElevator + canonical
  RungLevel; BLOCK ascends and widens the CAUSES..BECOMES predicate-plane mask,
  FLOW relaxes to base. The graph is load-bearing because surprise ascends the
  elevator. Maps onto the triangle-tenants Maslow pyramid (D-TRI).
- Probe-first: G0 P-GRAPH-LOADBEARING (graph vs vector-only) gates all
  Leiden/PPR code. Composes atop oxigraph-arigraph-cognitive-shader-soa-merge-v1.

No bytes land; D-GR-5 (OGAR seam) mint-gated + baton-audited. Board hygiene:
INTEGRATION_PLANS prepend in the same commit.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…ate (§10)

Verified every reuse/build assumption against the tree at 8d3209c (#708 merged).
Verdict: FEASIBLE, two small non-blocking caveats, no circular deps.

Confirmed reachable (pub): RungElevator (pub struct/fields + new + on_gate) and
RungLevel/GateDecision/MailboxSoaView + CausalEdge64 all from ZERO-DEP crates;
TripletGraph exposes the exact walk (get_associated multi-hop, intervene_on
Pearl-2 apex, detect_contradictions = the BLOCK trigger, revise_with_evidence),
spo_bridge::promote_to_spo pub, hdr_pagerank + ScentCsr::spmv pub, cam_pq pub.
The rung loop maps 1:1 onto existing methods.

Caveat 1 (drives a feature gate): the graph legs live in lance-graph core =
drags datafusion/lance/arrow (19 heavy-dep lines); the rung-ascent core is
zero-dep. => default graphrag = LIGHT (rung ascent + BM25 + in-memory PPR + G0
probe); feature graphrag-lance = HEAVY graph legs. §4 crate topology updated.

Caveat 2: rung_widened_layer_mask is private (driver.rs:701) => make pub / move
to contract, or replicate the pure fn (secondary leg; ascent works without it).

Genuine BUILD confirmed: hierarchical Leiden (jc louvain is example-only),
HippoRAG-PPR reset-distribution atop hdr_pagerank, BM25. Next step needs no
upstream change: scaffold the light crate + cargo-check compile-proof, then G0.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…lone crate

Operator-directed architecture correction. Instead of a query-side crates/graphrag,
expand AriGraph, which already owns the retrieval brain + episodic-witness basins.

Grounding (verified against the tree): AriGraph already has retrieval.rs
(OsintRetriever = BFS+episodic fusion), witness_corpus.rs, episodic.rs,
spo_bridge.rs, markov_soa.rs — and has NO community/basin/cluster/Leiden/partition
type (grep-confirmed). So Leiden fills the one structural-partition gap that
COMPLEMENTS the episodic-witness partition AriGraph owns; it does not clutter or
duplicate. A separate crate is a free-function-on-carrier's-state (the CLAUDE.md
litmus reject) and a parallel retrieval layer beside an existing one.

v1.1 topology:
- arigraph/community.rs (NEW): hierarchical Leiden over the TripletGraph adjacency
  (triplets + entity_index; backed by in-core blasgraph CSR).
- arigraph/retrieval.rs (EXTEND): + PPR/HippoRAG atop blasgraph::hdr_pagerank;
  community becomes a THIRD fusion signal beside BFS + episodic; driven by the
  #708 RungElevator (detect_contradictions -> BLOCK -> wider community/PPR walk).
- DocGraphQuery trait stays in lance-graph-contract (impl = AriGraph methods).
- BM25/lexical stays OUT of AriGraph (text-index, not a fact graph).
- NO new crate.

This dissolves the §10 dep-weight feature-gate (the graph capabilities live where
the graph lives — core). New design constraint: no-singleton + write-on-behalf —
community detection reads the graph the mailbox owns; a persisted membership is a
born-stamped value-tenant lane. The #708 rung-ascent alignment, the reuse census,
the OGAR boundary, and the probes all carry over unchanged.

Board hygiene: INTEGRATION_PLANS entry annotated with the v1.1 scope.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
Evaluation + wave plan for feeding a new query-side crates/graphrag and OGAR's
ogar-doc from the existing SoA + CausalEdge64 + (queued) EpisodicWitness64
substrate, aligned to #708 / D-TRI-6 (the rung-ascent loop) and the v3 waves.

Key rulings the plan encodes:
- Direction reframe (assembler-vs-storage boundary): OGAR owns doc ingestion +
  the document 0x080B mint (ogar-from-docv1 -> ogar-doc-ir -> ogar-doc, built);
  lance-graph provides contract types OGAR consumes + query. graphrag is
  query-side ONLY, reads the calcified substrate, never ingests. A lance-graph
  doc-transcode crate is REJECTED (duplicates ogar-from-docv1, inverts the dep).
- REUSE the substrate, BUILD only 3 gaps: hierarchical Leiden, HippoRAG-PPR
  reset-distribution, BM25. Extraction/SPO/fact-store/vector-CAM-PQ already
  exist; causal_edge::CausalEdge64 is the SPO edge (not the thinking-engine
  variant); EpisodicWitness64 is a queued column (today WitnessTable +
  EpisodicEdges64). graphrag-rs = REUSE-AS-REFERENCE (E-V3-GRAPHRAG-INV-1).
- Retrieval = rung ascent (#708): dispatches through RungElevator + canonical
  RungLevel; BLOCK ascends and widens the CAUSES..BECOMES predicate-plane mask,
  FLOW relaxes to base. The graph is load-bearing because surprise ascends the
  elevator. Maps onto the triangle-tenants Maslow pyramid (D-TRI).
- Probe-first: G0 P-GRAPH-LOADBEARING (graph vs vector-only) gates all
  Leiden/PPR code. Composes atop oxigraph-arigraph-cognitive-shader-soa-merge-v1.

No bytes land; D-GR-5 (OGAR seam) mint-gated + baton-audited. Board hygiene:
INTEGRATION_PLANS prepend in the same commit.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…ate (§10)

Verified every reuse/build assumption against the tree at 8d3209c (#708 merged).
Verdict: FEASIBLE, two small non-blocking caveats, no circular deps.

Confirmed reachable (pub): RungElevator (pub struct/fields + new + on_gate) and
RungLevel/GateDecision/MailboxSoaView + CausalEdge64 all from ZERO-DEP crates;
TripletGraph exposes the exact walk (get_associated multi-hop, intervene_on
Pearl-2 apex, detect_contradictions = the BLOCK trigger, revise_with_evidence),
spo_bridge::promote_to_spo pub, hdr_pagerank + ScentCsr::spmv pub, cam_pq pub.
The rung loop maps 1:1 onto existing methods.

Caveat 1 (drives a feature gate): the graph legs live in lance-graph core =
drags datafusion/lance/arrow (19 heavy-dep lines); the rung-ascent core is
zero-dep. => default graphrag = LIGHT (rung ascent + BM25 + in-memory PPR + G0
probe); feature graphrag-lance = HEAVY graph legs. §4 crate topology updated.

Caveat 2: rung_widened_layer_mask is private (driver.rs:701) => make pub / move
to contract, or replicate the pure fn (secondary leg; ascent works without it).

Genuine BUILD confirmed: hierarchical Leiden (jc louvain is example-only),
HippoRAG-PPR reset-distribution atop hdr_pagerank, BM25. Next step needs no
upstream change: scaffold the light crate + cargo-check compile-proof, then G0.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…lone crate

Operator-directed architecture correction. Instead of a query-side crates/graphrag,
expand AriGraph, which already owns the retrieval brain + episodic-witness basins.

Grounding (verified against the tree): AriGraph already has retrieval.rs
(OsintRetriever = BFS+episodic fusion), witness_corpus.rs, episodic.rs,
spo_bridge.rs, markov_soa.rs — and has NO community/basin/cluster/Leiden/partition
type (grep-confirmed). So Leiden fills the one structural-partition gap that
COMPLEMENTS the episodic-witness partition AriGraph owns; it does not clutter or
duplicate. A separate crate is a free-function-on-carrier's-state (the CLAUDE.md
litmus reject) and a parallel retrieval layer beside an existing one.

v1.1 topology:
- arigraph/community.rs (NEW): hierarchical Leiden over the TripletGraph adjacency
  (triplets + entity_index; backed by in-core blasgraph CSR).
- arigraph/retrieval.rs (EXTEND): + PPR/HippoRAG atop blasgraph::hdr_pagerank;
  community becomes a THIRD fusion signal beside BFS + episodic; driven by the
  #708 RungElevator (detect_contradictions -> BLOCK -> wider community/PPR walk).
- DocGraphQuery trait stays in lance-graph-contract (impl = AriGraph methods).
- BM25/lexical stays OUT of AriGraph (text-index, not a fact graph).
- NO new crate.

This dissolves the §10 dep-weight feature-gate (the graph capabilities live where
the graph lives — core). New design constraint: no-singleton + write-on-behalf —
community detection reads the graph the mailbox owns; a persisted membership is a
born-stamped value-tenant lane. The #708 rung-ascent alignment, the reuse census,
the OGAR boundary, and the probes all carry over unchanged.

Board hygiene: INTEGRATION_PLANS entry annotated with the v1.1 scope.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
Evaluation + wave plan for feeding a new query-side crates/graphrag and OGAR's
ogar-doc from the existing SoA + CausalEdge64 + (queued) EpisodicWitness64
substrate, aligned to #708 / D-TRI-6 (the rung-ascent loop) and the v3 waves.

Key rulings the plan encodes:
- Direction reframe (assembler-vs-storage boundary): OGAR owns doc ingestion +
  the document 0x080B mint (ogar-from-docv1 -> ogar-doc-ir -> ogar-doc, built);
  lance-graph provides contract types OGAR consumes + query. graphrag is
  query-side ONLY, reads the calcified substrate, never ingests. A lance-graph
  doc-transcode crate is REJECTED (duplicates ogar-from-docv1, inverts the dep).
- REUSE the substrate, BUILD only 3 gaps: hierarchical Leiden, HippoRAG-PPR
  reset-distribution, BM25. Extraction/SPO/fact-store/vector-CAM-PQ already
  exist; causal_edge::CausalEdge64 is the SPO edge (not the thinking-engine
  variant); EpisodicWitness64 is a queued column (today WitnessTable +
  EpisodicEdges64). graphrag-rs = REUSE-AS-REFERENCE (E-V3-GRAPHRAG-INV-1).
- Retrieval = rung ascent (#708): dispatches through RungElevator + canonical
  RungLevel; BLOCK ascends and widens the CAUSES..BECOMES predicate-plane mask,
  FLOW relaxes to base. The graph is load-bearing because surprise ascends the
  elevator. Maps onto the triangle-tenants Maslow pyramid (D-TRI).
- Probe-first: G0 P-GRAPH-LOADBEARING (graph vs vector-only) gates all
  Leiden/PPR code. Composes atop oxigraph-arigraph-cognitive-shader-soa-merge-v1.

No bytes land; D-GR-5 (OGAR seam) mint-gated + baton-audited. Board hygiene:
INTEGRATION_PLANS prepend in the same commit.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…ate (§10)

Verified every reuse/build assumption against the tree at 8d3209c (#708 merged).
Verdict: FEASIBLE, two small non-blocking caveats, no circular deps.

Confirmed reachable (pub): RungElevator (pub struct/fields + new + on_gate) and
RungLevel/GateDecision/MailboxSoaView + CausalEdge64 all from ZERO-DEP crates;
TripletGraph exposes the exact walk (get_associated multi-hop, intervene_on
Pearl-2 apex, detect_contradictions = the BLOCK trigger, revise_with_evidence),
spo_bridge::promote_to_spo pub, hdr_pagerank + ScentCsr::spmv pub, cam_pq pub.
The rung loop maps 1:1 onto existing methods.

Caveat 1 (drives a feature gate): the graph legs live in lance-graph core =
drags datafusion/lance/arrow (19 heavy-dep lines); the rung-ascent core is
zero-dep. => default graphrag = LIGHT (rung ascent + BM25 + in-memory PPR + G0
probe); feature graphrag-lance = HEAVY graph legs. §4 crate topology updated.

Caveat 2: rung_widened_layer_mask is private (driver.rs:701) => make pub / move
to contract, or replicate the pure fn (secondary leg; ascent works without it).

Genuine BUILD confirmed: hierarchical Leiden (jc louvain is example-only),
HippoRAG-PPR reset-distribution atop hdr_pagerank, BM25. Next step needs no
upstream change: scaffold the light crate + cargo-check compile-proof, then G0.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…lone crate

Operator-directed architecture correction. Instead of a query-side crates/graphrag,
expand AriGraph, which already owns the retrieval brain + episodic-witness basins.

Grounding (verified against the tree): AriGraph already has retrieval.rs
(OsintRetriever = BFS+episodic fusion), witness_corpus.rs, episodic.rs,
spo_bridge.rs, markov_soa.rs — and has NO community/basin/cluster/Leiden/partition
type (grep-confirmed). So Leiden fills the one structural-partition gap that
COMPLEMENTS the episodic-witness partition AriGraph owns; it does not clutter or
duplicate. A separate crate is a free-function-on-carrier's-state (the CLAUDE.md
litmus reject) and a parallel retrieval layer beside an existing one.

v1.1 topology:
- arigraph/community.rs (NEW): hierarchical Leiden over the TripletGraph adjacency
  (triplets + entity_index; backed by in-core blasgraph CSR).
- arigraph/retrieval.rs (EXTEND): + PPR/HippoRAG atop blasgraph::hdr_pagerank;
  community becomes a THIRD fusion signal beside BFS + episodic; driven by the
  #708 RungElevator (detect_contradictions -> BLOCK -> wider community/PPR walk).
- DocGraphQuery trait stays in lance-graph-contract (impl = AriGraph methods).
- BM25/lexical stays OUT of AriGraph (text-index, not a fact graph).
- NO new crate.

This dissolves the §10 dep-weight feature-gate (the graph capabilities live where
the graph lives — core). New design constraint: no-singleton + write-on-behalf —
community detection reads the graph the mailbox owns; a persisted membership is a
born-stamped value-tenant lane. The #708 rung-ascent alignment, the reuse census,
the OGAR boundary, and the probes all carry over unchanged.

Board hygiene: INTEGRATION_PLANS entry annotated with the v1.1 scope.

Co-Authored-By: Claude <noreply@anthropic.com>
AdaWorldAPI pushed a commit that referenced this pull request Jul 17, 2026
…arness

Ship the buildable, ungated graphrag deliverables (plan
graphrag-doc-retrieval-soa-integration-v1 §5). All pure / reversible /
no-write-path capabilities land ahead of G0 exactly as D-GR-3a (#714);
the D-GR-2 retrieval wiring stays gated on the G0 real-corpus verdict.

D-GR-1 (contract, zero-dep):
- doc_graph::{DocGraphQuery, ScoredId} - rung-aware document-graph read
  surface with a provided retrieve(seeds, RungLevel, top_k) default
  carrying the rung->walk dispatch (0-1 ranking / 2 SPO-G hop / 3+ wider
  community-scoped walk); the D-GR-2 design (OsintRetriever <-> #708
  RungElevator) lives in the module-doc. 9 tests.

D-GR-3b (lance-graph core, AriGraph):
- arigraph::ppr - TripletGraph::personalized_pagerank (HippoRAG spread,
  confidence-weighted, deterministic, unit-sum). 6 tests.
- arigraph::community - Leiden refine_connected (splits internally-
  disconnected Louvain communities into connected components). +2 tests.
- arigraph::bm25 - Okapi BM25 lexical leg (Bm25Index, k1=1.2/b=0.75). 5 tests.

G0:
- examples/g0_graph_loadbearing.rs - the P-GRAPH-LOADBEARING harness:
  vector-only (BM25) vs vector+PPR+community over a synthetic multi-hop
  fixture, prints the with-vs-without delta. Scaffold, not the verdict -
  the real KILL/PASS needs a labeled corpus + jc::reliability.

Plan sharpened per operator (§3a/§3b): (a) the cosine-replacement distance
ALREADY EXISTS (certified bgz-tensor::fisher_z::{FamilyGamma, Base17Fz}
rho>=0.999, clean-room helix) - wire it, retire the blasgraph popcount
dead-code; do not rebuild. (b) part_of:is_a category = Leiden community =
episodic-witness basin - one concept; P-COMMUNITY-BASIN-AGREE tests the
identity.

Verified: lance-graph 945 lib + 18 D-GR module tests; lance-graph-contract
10 tests; clippy -D warnings clean on new files; fmt clean.

Board: EPIPHANIES E-GRAPHRAG-DGR3B-1, STATUS_BOARD graphrag section,
LATEST_STATE contract inventory, AGENT_LOG, plan v1.2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1
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