feat(entities): entity-connectivity report — hubs and orphans#452
Open
boskodev790 wants to merge 1 commit into
Open
feat(entities): entity-connectivity report — hubs and orphans#452boskodev790 wants to merge 1 commit into
boskodev790 wants to merge 1 commit into
Conversation
`health.status` counts entities and `vouch neighbors` walks the edges around one node; neither says, in one pass over the whole graph, which entities are load-bearing and which anchor nothing. `vouch entities` reports the most-connected hubs and the orphan entities that no claim mentions, no relation joins, and no page references — proposed once, then never used, so a curator can prune or merge them. connectivity sums claim.entities mentions, relation endpoints (a self-loop counts once), and page.entities references. strictly a viewport: composes store.list_entities / list_claims / list_relations / list_pages, writes nothing, logs no audit event. cli-only, no kb.* method surface. adds src/vouch/entity_graph.py and tests/test_entity_graph.py (11 tests).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
vouch entities— a read-only entity-connectivity report over the whole graph.vouch's model note says entities "anchor relations and aggregate the claims
that mention them."
health.statuscounts entities andvouch neighborswalksthe edges around one node, but nothing says, in a single pass, which entities
are load-bearing and which are dead. this reports:
with the breakdown that produced it
page references them; proposed once and never used, so a curator can prune or
merge them
connectivity sums three things that point at an entity:
claim.entitiesmentions (deduped per claim), relation endpoints (a self-loop counts once, and
a non-entity endpoint like a claim or page id is ignored), and
page.entitiesreferences. every entity is therefore either connected or orphaned —
connected_total + orphan_total == entities_total.why
the entity graph is where knowledge concentrates; this shows where. orphan
entities are the graph's dead weight (a
propose-entitythat no later claimever cited); hubs are where a rename or merge has the most blast radius. safe
from cron via
--format json.surface
strictly a viewport. composes
store.list_entities,list_claims,list_relations,list_pages; writes nothing, logs no audit event, nevertouches a proposal. cli-only, so no new
kb.*method (the four-site methodsurface and
test_capabilitiesare untouched). no storage, model, migration,or on-disk-layout change. named to match the existing
vouch pages/list-pagessplit — a rich view alongside the rawlist-entitiesdump.src/vouch/entity_graph.py— new module: purebuild()plus text / markdown/ json renderers with a stable
to_dict()json contractsrc/vouch/cli.py—vouch entities, next tovouch digesttests/test_entity_graph.py— 11 tests (hub sum, self-loop-once, bothendpoints, non-entity endpoint ignored, per-claim dedup, orphan detection,
ordering + non-silent truncation, and the cli)
CHANGELOG.md—[Unreleased]example
validation
python -m pytest tests/ -q --ignore=tests/embeddings→ 1099 passed, 37 skippedpython -m mypy src→ cleanpython -m ruff check src tests→ cleanno linked issue — a self-contained read-only viewport that changes neither the
object model, the
kb.*surface, the on-disk layout, the bundle format, northe audit shape, so per contributing it doesn't need a vep. happy to file one
if you'd rather track it.