fix(serve): show community name in get_community MCP output#1448
Closed
rmart1308 wants to merge 2 commits into
Closed
fix(serve): show community name in get_community MCP output#1448rmart1308 wants to merge 2 commits into
rmart1308 wants to merge 2 commits into
Conversation
get_community was the only graph query tool still returning a bare numeric community id. get_node and the query-traversal output already read the community_name node attribute that to_json writes onto every node, so an agent that located a community by name elsewhere (the report, get_node, or query output) had no way to confirm it here. Read the name from the community's member nodes (they all share it) and format it into the header, e.g. "Community 12 — Auth & Sessions (8 nodes)". Falls back to the bare id for graphs built before community_name was persisted, and routes the value through sanitize_label like every other LLM-derived field. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
safishamsi
pushed a commit
that referenced
this pull request
Jun 24, 2026
get_community was the only graph tool still returning a bare numeric id, while
get_node and the query-traversal output already render the community_name
attribute to_json writes onto every node. Read the name from the community's
member nodes and put it in the header ("Community 12 — Auth & Sessions"),
sanitised like every other LLM-derived field.
Ported from PR #1448 by @rmart1308 onto current v8, with two additions: the name
is skipped when it is just the "Community N" placeholder (written for unnamed
communities) so the header never doubles to "Community 12 — Community 12", and
the formatting is extracted to a module-level _community_header() with focused
tests (named / placeholder / empty / sanitised). Full suite 2397 passed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
|
Landed on |
safishamsi
added a commit
that referenced
this pull request
Jun 25, 2026
get_community shows the community name (#1448); starlette floored >=1.3.1 for CVE-2026-48818 / CVE-2026-54283 (#1391, #1396); begin per-language extractor split into graphify/extractors/ (#1212); parallel community labeling via --max-concurrency / --batch-size (#1390); reflect dedups dead-ends/corrections; and the work-memory loop no longer depends on the git hook (reflect --if-stale). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
berezinan
added a commit
to berezinan/graphity
that referenced
this pull request
Jun 25, 2026
…cadeDB fork Brings the latest upstream graphify (trigram query prefilter, PDF/text slicing Graphify-Labs#1369/Graphify-Labs#1386, extractor plugin layer, build-from-json hardening, F-010 sanitization, dependency pins) on top of our 1C/BSL + ArcadeDB-backend branch and the four feature commits (tiered file caps, viz scaling, global ignore, graphity alias). Conflict resolutions: - detect.py: union CODE_EXTENSIONS — keep upstream .cu/.cuh + our 1C exts. - llm.py: keep upstream Path-normalization line + our _TEXT_SLICE_CHARS (our tiered-cap rename of _FILE_CHAR_CAP). - serve.py: keep our query_backend abstraction (JSON/ArcadeDB selection, render_* delegation) and graft upstream's trigram prefilter into the in-memory scan via _score_terms; eager trigram index built only on the JSON path; community render keeps our render_community. - query_backend.py: restore upstream's Graphify-Labs#1448 community-name display ("Community N — Name") inside our render_community / CommunityRecord, which the serve.py block-4 resolution would otherwise have dropped. F-010 sanitization stays centralized here. - pyproject.toml: keep our arcadedb extra + requests in `all`; take upstream pins (pypdf>=6.12.0, starlette, yt-dlp). - README.md: our 1C/ArcadeDB preamble (typo ArkadaDB->ArcadeDB) above the full upstream README. - .gitignore: union (our spike/fixtures ignores + upstream .DS_Store). - test_build.py: keep both test sets. uv.lock regenerated from merged pyproject. - Dropped upstream's committed .DS_Store files (now gitignored). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
get_communitywas the only MCP graph query tool still returning a bare numericcommunity id.
get_node(and the query-traversal output in_subgraph_to_text)already read the
community_namenode attribute thatto_jsonwrites onto everynode, so an agent that had located a community by name — via
GRAPH_REPORT.md,get_node, or query output — had no way to confirm it throughget_community.This makes
get_communityconsistent with the rest of the serve layer: it readsthe name from the community's member nodes (they all share it) and formats it into
the header, e.g.
It falls back to the bare id for graphs built before
community_namewaspersisted, and routes the value through
sanitize_labellike every otherLLM-derived field (F-010).
Why
Small consistency/UX gap. Once you can see community names everywhere else, the
one tool whose whole job is "show me this community" shouldn't be the one that
hides them behind a number.
Notes
get_nodeprecedent (inline read ofcommunity_name), sono new test was added — the tool closures aren't unit-tested directly in
tests/test_serve.py, and thecommunity_nameattribute itself is produced andtested in the
to_json/ export path. Happy to extract a small module-levelformatter and add a focused test if you'd prefer the change be directly covered.
Unreleasedentry uses a(#XXXX)placeholder — replace with the PRnumber on merge.
🤖 Generated with Claude Code