Skip to content

feat(probe): P-COMMUNITY-BASIN-AGREE (S1) — empirical community≡basin agreement via jc#720

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

feat(probe): P-COMMUNITY-BASIN-AGREE (S1) — empirical community≡basin agreement via jc#720
AdaWorldAPI merged 1 commit into
mainfrom
claude/happy-hamilton-0azlw4

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 17, 2026

Copy link
Copy Markdown
Owner

What

The S1 gate the #719 D-TRI-1 classid-half mint explicitly hands off ("the other session runs S1; the council mints"). An empirical probe that measures whether the operator's identity ruling holds — is_a category ≡ Leiden community ≡ episodic-witness basin (plan §3b.1).

The layer boundary (operator, this session)

"JC is a scientific crate. Yours are empirical."

jc is the certified scientific surface (reliability::{pearson, spearman, cronbach_alpha, icc}, weyl, jirak, …) — this probe consumes it, never extends it. The empirical construction (two partitions → pairwise co-membership vectors) is the probe's; the statistic is jc's. A partition metric jc lacks (Rand/ARI/NMI) is an observation reported to the scientific track, not a bolt-on from the empirical side. So the probe lives on the empirical side (lance-graph/examples/) and dev-depends jc (lib untouched).

The probe

crates/lance-graph/examples/p_community_basin_agree.rs:

  • Community partition — TripletGraph::communities() (Louvain + Leiden refinement) over the whole relational field.
  • Basin partition — connected components under only the is_a/part_of edges (the plan's basin rail), via a deterministic union-find.
  • Agreement — φ = jc::reliability::pearson of the two partitions' pairwise co-membership vectors (φ=1 iff identical up to relabeling); names the bridges (a community that crosses a basin = revision candidate).

Result (synthetic mechanism)

Scenario φ (jc::pearson) reading
aligned 1.0000 IDENTITY — community ≡ basin, no bridges
one cross-basin entity (robot is_a pet, structurally in the tree cluster) 0.5500 DISTINCT — robot named as the single bridge

Mechanism proven; the S1 verdict needs a real is_a-annotated corpus (like G0's KILL/PASS). That verdict decides the mint: identity (φ→1) ⇒ community-id collapses into the is_a rail, no tenant minted; distinct (φ<1) ⇒ community-id earns the batched D-TRI-1 mint.

Verification

  • cargo run -p lance-graph --example p_community_basin_agree runs clean (output above).
  • cargo fmt clean; cargo clippy clean on the example.
  • jc added as a dev-dependency only (light: lance-graph-contract + optional sigker); the lance-graph lib and its 945 tests are untouched. Cargo.lock updated for the dev-dep.

Board

EPIPHANIES E-EMPIRICAL-VS-SCIENTIFIC-JC-1 (the boundary + the S1 result); STATUS_BOARD graphrag §6 S1 row; stale (this PR) labels on the merged D-GR rows corrected to #716.

Not in this PR

  • The S1 verdict (needs a real is_a corpus) — and therefore the community-id mint decision — stay open, as designed.

🤖 Generated with Claude Code

https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added an analysis probe that compares graph communities with taxonomy-based connected groups.
    • Reports Pearson and Spearman agreement scores, raw matching rates, and cross-group bridge diagnostics across synthetic scenarios.
  • Documentation

    • Recorded the probe’s shipped status, results, and gating criteria.
    • Updated delivery tracking with current evidence and the new community-agreement milestone.

… agreement via jc

The S1 gate the D-TRI-1 classid-half mint waits on (#719 handoff). An
EMPIRICAL probe (not scientific — it consumes jc, never extends it):
measures whether the operator's identity ruling holds — is_a category ≡
Leiden community ≡ episodic basin (plan §3b.1).

- crates/lance-graph/examples/p_community_basin_agree.rs — two partitions of
  one entity set: Leiden communities() over all edges vs basin = connected
  components under only is_a/part_of edges; agreement = phi = jc::pearson of
  their pairwise co-membership vectors (phi=1 iff identical up to relabeling).
  Names the bridges (a community that crosses a basin = revision candidate).
- jc added as a dev-dependency (light: contract + optional sigker) so the
  empirical example consumes the certified scientific statistic. Lib untouched
  (dev-only).

Result (synthetic mechanism): aligned -> phi=1.0000 (identity); one cross-basin
entity (robot is_a pet, structurally in the tree cluster) -> phi=0.5500, robot
named as the single bridge. Mechanism proven; the S1 VERDICT needs a real
is_a-annotated corpus (identity => community-id collapses into the is_a rail,
no mint; distinct => community-id earns the batched D-TRI-1 mint).

Layer boundary (operator): jc is the scientific crate, consumed not extended;
a missing partition metric (Rand/ARI/NMI) is an observation for the scientific
track, not a bolt-on.

fmt + clippy clean.

Board: EPIPHANIES E-EMPIRICAL-VS-SCIENTIFIC-JC-1; STATUS_BOARD S1 row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016b33swuXE23hKtqxsHu9p1
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e3fe30d8-97ed-4d80-b1f7-d945c4d79b76

📥 Commits

Reviewing files that changed from the base of the PR and between 4fece8a and 8f49095.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .claude/board/EPIPHANIES.md
  • .claude/board/STATUS_BOARD.md
  • crates/lance-graph/Cargo.toml
  • crates/lance-graph/examples/p_community_basin_agree.rs

📝 Walkthrough

Walkthrough

Adds a Rust example that compares Leiden-style graph communities with taxonomic connected components using jc correlation metrics, reports bridge diagnostics across two synthetic scenarios, wires the local dependency, and records the probe’s shipped status and gating relationship.

Changes

Community-basin agreement probe

Layer / File(s) Summary
Probe graph and basin construction
crates/lance-graph/Cargo.toml, crates/lance-graph/examples/p_community_basin_agree.rs
Adds the local jc dependency, constructs TripletGraph data from static facts, filters taxonomic relations, and computes deterministic basin labels.
Agreement measurement and scenarios
crates/lance-graph/examples/p_community_basin_agree.rs
Computes co-membership correlations, pairwise agreement, majority-basin bridges, and reports aligned and cross-basin synthetic scenarios.
Probe status and handoff records
.claude/board/EPIPHANIES.md, .claude/board/STATUS_BOARD.md
Records the shipped probe, observed agreement results, updated deliverable evidence, and gating of community-id minting on the real-corpus verdict.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Facts
  participant TripletGraph
  participant BasinLabels
  participant JC
  Facts->>TripletGraph: Load static facts
  TripletGraph->>TripletGraph: Compute community labels
  Facts->>BasinLabels: Select is_a and part_of relations
  BasinLabels->>BasinLabels: Compute basin components
  TripletGraph->>JC: Send community co-membership vector
  BasinLabels->>JC: Send basin co-membership vector
  JC->>TripletGraph: Return Pearson and Spearman metrics
Loading

Suggested reviewers: claude

Poem

I’m a rabbit with graphs in my burrow tonight,
Communities hop while basins unite.
jc counts the pairs, correlations gleam,
Bridges reveal where the labels diverge.
Two tiny scenarios complete the scheme!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@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_e84473ec-eaa3-4e9b-9a12-ef2c6800b270)

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review July 18, 2026 07:27
@cursor

cursor Bot commented Jul 18, 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_240cc1f5-e37a-4aca-ab29-d7dc39982bea)

@AdaWorldAPI
AdaWorldAPI merged commit 1f03b3b into main Jul 18, 2026
6 of 7 checks passed

@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: 8f49095a72

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

/// Relations that define the **basin** rail (the inherited/taxonomic grouping).
fn is_taxonomic(relation: &str) -> bool {
let r = relation.to_lowercase();
r.contains("is_a") || r.contains("is a") || r.contains("part_of") || r.contains("part of")

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 Include subclass predicates in the basin rail

When the real-corpus S1 run uses the ontology triples already emitted in this repo, inheritance is represented as rdfs:subClassOf / http://www.w3.org/2000/01/rdf-schema#subClassOf rather than a relation containing is_a (for example crates/lance-graph-ontology/src/ttl_parse.rs:55 and the Odoo hydrator whitelist at crates/lance-graph-ontology/src/hydrators/odoo.rs:61-64). Those edges are therefore ignored here, so subclass-only taxonomies are split into singleton basins and φ can be driven down enough to incorrectly conclude that community-id is distinct; normalize these is-a predicate names or make the required pre-normalization explicit before using the gate on the real corpus.

Useful? React with 👍 / 👎.

AdaWorldAPI pushed a commit that referenced this pull request Jul 18, 2026
…es, every domain

Capture of the operator ruling (2026-07-17): part_of:is_a IS context:role —
one classview-selected reading of the polymorphic 6x(8:8) register
(le-contract §3), with two orientations: VERTICAL (six pairs = a 6-level
radix path, progressive exactness — HHTL family identity, q2 FMA helix
attested) and HORIZONTAL (six parallel basin:role contexts — the
episodic-witness frame, eventual). Together with classid (concept-high) +
appid (render-low) + ClassView/WideFieldMask it is the connecting-tissue
traversal reused across screens, documents, time series, and AriGraph.

- .claude/knowledge/context-role-traversal-tissue.md (NEW) — the lens-stack
  inventory (all shipped anchors, file:line), the one walk shape
  ((classid->ClassView reading) x mask x axis x rung x pov), the per-domain
  instantiation table (menu_address IS the vertical is_a walk for screens;
  screens_reachable_from -> WideFieldMask IS the horizontal frame; NiblePath
  = the descent primitive; Communities.levels = the AriGraph vertical stack;
  TemporalPov+rung = the time window), 6 reuse rules — headline: unify at
  the REGISTER, never the API (no unifying Traversal trait; carrier methods
  stay native), u8:u8 never widened, classview-selects-never-inspect.
- Probe pair (both pre-named in graphrag §6): vertical =
  P-HIER-LEIDEN-HHTL [CONJECTURE, not run]; horizontal = the shipped S1
  harness (#720) re-fed from the 6-slot basin:role frame [EVENTUAL].
- graphrag plan §3b.1: S1-shipped annotation + orientation pointer.

No code — the finding is precisely that the anchors already exist; the doc
is the reuse map that stops the next walk from being reinvented.

Board: EPIPHANIES E-CONTEXT-ROLE-TISSUE-1; AGENT_LOG.

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