Skip to content

feat(arigraph): D-GR-1 DocGraphQuery + D-GR-3b PPR/Leiden/BM25 + G0 harness#716

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/happy-hamilton-0azlw4
Jul 17, 2026
Merged

feat(arigraph): D-GR-1 DocGraphQuery + D-GR-3b PPR/Leiden/BM25 + G0 harness#716
AdaWorldAPI merged 1 commit into
mainfrom
claude/happy-hamilton-0azlw4

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

What

Ships the buildable, ungated deliverables of the graphrag-doc-retrieval plan (graphrag-doc-retrieval-soa-integration-v1 §5), on fresh main after #714 (D-GR-3a). Everything here is pure / reversible / no-write-path, so it lands ahead of the G0 gate exactly as D-GR-3a did; the D-GR-2 retrieval wiring stays gated on the G0 real-corpus verdict.

D-GR-1 — lance-graph-contract (zero-dep)

  • doc_graph::{DocGraphQuery, ScoredId} — a rung-aware document-graph read surface. DocGraphQuery exposes community_of / community_ids / community_members / neighbours / similar_by_ranking, plus 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) so both readers agree on the mapping by construction; the stateful RungElevator stays out of the contract. ScoredId {id, score, depth}. The D-GR-2 design (AriGraph OsintRetriever ↔ the P3: wire the rung ascent loop + dedup RungLevel (D-TRI-6) #708 RungElevator) lives in the module-doc. 9 tests.

D-GR-3b — lance-graph core (AriGraph)

  • arigraph::pprTripletGraph::personalized_pagerank(seeds, damping, iters), HippoRAG spread-activation over the confidence-weighted fact graph; deterministic, unit-sum, dangling-mass redistribution. 6 tests.
  • arigraph::community — Leiden connectivity refinement (refine_connected): splits any internally-disconnected Louvain community into its connected components (Leiden's guarantee over plain Louvain), deterministic BFS over intra-community edges. labels is now the refined coarsest partition; levels.last() is the raw Louvain. +2 tests (5 existing stay green).
  • arigraph::bm25 — Okapi BM25 lexical leg (Bm25Index, k1=1.2/b=0.75), the rung-0/1 baseline beside CAM-PQ ranking. 5 tests.

G0 — the gate's measurement harness

  • examples/g0_graph_loadbearing.rs — P-GRAPH-LOADBEARING: vector-only (BM25) vs vector+PPR+community over a synthetic multi-hop fixture where the gold answer is lexically absent from the query but graph-reachable from the seed. It prints the with-vs-without delta (turbines: vector-only rank 8/8 @ 0.0 vs graph rank 6 @ 0.146) and deliberately does not assert a PASS/FAIL — the real KILL/PASS verdict needs a labeled corpus + jc::reliability. cargo run -p lance-graph --example g0_graph_loadbearing.

Plan sharpenings (operator, folded into §3a/§3b)

  • Distance = the existing cosine-replacement, not popcount. The Fisher-Z arctanh cosine-replacement already exists, certified: bgz-tensor::fisher_z::{FamilyGamma, Base17Fz} (ρ≥0.999) + clean-room helix. The stacked-6×256 distance retires the blasgraph hamming_*/popcount_* dead-code. This is a wiring deliverable (route the certified primitive into the graph/PPR path), P-PQ-RANK-gated — not a new kernel.
  • part_of:is_a category ≡ Leiden community ≡ episodic-witness basin — one concept. "Part of" presupposes a category to be part of; that category IS the community = the basin = the HHTL family identity. Community detection is constitutive of the is_a category. P-COMMUNITY-BASIN-AGREE tests this as an identity (agreement → 1.0), the disagreements being the discovered bridges / revision candidates.

Verification

  • cargo test -p lance-graph --lib945 lib + 18 D-GR module tests, 0 failed.
  • cargo test -p lance-graph-contract → 10 tests, 0 failed.
  • cargo clippy -D warnings clean on all new files (the 8 pre-existing warnings are unrelated blasgraph/ndarray_bridge.rs SIMD dead-code).
  • cargo fmt clean.

Board

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

Not in this PR (gated / deferred)

  • D-GR-2 retrieval wiring — design done (module-doc); impl gated on the G0 real-corpus verdict.
  • D-GR-4/5/6 — deferred by the plan (W3-coupled summaries / mint-gated OGAR seam / doc-W4-council witness-KV split).

🤖 Generated with Claude Code

https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1


Generated by Claude Code

…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
@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_5ed8ec80-8e82-428c-8a19-8889b408c235)

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 13 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: 95fbd323-5e48-4414-952e-d3c688866473

📥 Commits

Reviewing files that changed from the base of the PR and between e9e00be and 4ea1f21.

📒 Files selected for processing (12)
  • .claude/board/AGENT_LOG.md
  • .claude/board/EPIPHANIES.md
  • .claude/board/LATEST_STATE.md
  • .claude/board/STATUS_BOARD.md
  • .claude/plans/graphrag-doc-retrieval-soa-integration-v1.md
  • crates/lance-graph-contract/src/doc_graph.rs
  • crates/lance-graph-contract/src/lib.rs
  • crates/lance-graph/examples/g0_graph_loadbearing.rs
  • crates/lance-graph/src/graph/arigraph/bm25.rs
  • crates/lance-graph/src/graph/arigraph/community.rs
  • crates/lance-graph/src/graph/arigraph/mod.rs
  • crates/lance-graph/src/graph/arigraph/ppr.rs

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 16:28
@AdaWorldAPI
AdaWorldAPI merged commit 70b8991 into main Jul 17, 2026
7 checks passed
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