feat(probe): P-COMMUNITY-BASIN-AGREE (S1) — empirical community≡basin agreement via jc#720
Conversation
… 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
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a Rust example that compares Leiden-style graph communities with taxonomic connected components using ChangesCommunity-basin agreement probe
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
Suggested reviewers: Poem
✨ Finishing Touches📝 Generate docstrings
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. Comment |
Bugbot couldn't run - usage limit reachedBugbot 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) |
Bugbot couldn't run - usage limit reachedBugbot 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) |
There was a problem hiding this comment.
💡 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") |
There was a problem hiding this comment.
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 👍 / 👎.
…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
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_acategory ≡ Leiden community ≡ episodic-witness basin (plan §3b.1).The layer boundary (operator, this session)
jcis 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:TripletGraph::communities()(Louvain + Leiden refinement) over the whole relational field.is_a/part_ofedges (the plan's basin rail), via a deterministic union-find.jc::reliability::pearsonof 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)
robotis_a pet, structurally in the tree cluster)robotnamed as the single bridgeMechanism 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 theis_arail, no tenant minted; distinct (φ<1) ⇒ community-id earns the batched D-TRI-1 mint.Verification
cargo run -p lance-graph --example p_community_basin_agreeruns clean (output above).cargo fmtclean;cargo clippyclean on the example.lance-graph-contract+ optionalsigker); 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
is_acorpus) — 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
Documentation