Skip to content

Fix #3026: expose node.description and community_name on query surfaces - #3245

Open
akshitj11 wants to merge 3 commits into
Graphify-Labs:v8from
akshitj11:fix/3026-query-descriptions
Open

Fix #3026: expose node.description and community_name on query surfaces#3245
akshitj11 wants to merge 3 commits into
Graphify-Labs:v8from
akshitj11:fix/3026-query-descriptions

Conversation

@akshitj11

Copy link
Copy Markdown
Contributor

Fix #3026: expose node.description and community_name on query surfaces

Problem
After the describe pipeline, graph.json nodes carry description and
community_name. Wiki and Obsidian exports render them, but graphify query,
graphify explain, and most serve MCP tools omit description. Community
names are inconsistent outside get_node.

Change

  • Add shared formatters in serve.py for resolved community labels and
    sanitized description suffixes.
  • _subgraph_to_text: include description on NODE lines when present.
  • MCP get_node, get_neighbors, get_community: use shared formatters.
  • cli explain: use the same detail block as get_node.

No extraction or graph build changes. Read path only.

Tests
test_serve.py: description in subgraph text, budget accounting, MCP get_node.
test_explain_cli.py: CLI explain output includes description.

Closes #3026

Share community and description formatting between serve and explain CLI.

@graphify-labs graphify-labs 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.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 2 advisory finding(s) below merit a look before merge.


Graphify review — findings

Surfaces node description fields and cleaner community labels across all node-rendering paths: _subgraph_to_text, the get_node/get_neighbors/get_community MCP tools, and the explain CLI now show a desc=/Description: line when present. Adds _resolved_community_label, which prefers a real community_name but falls back to the numeric community id when the name is missing or just a Community N placeholder, and consolidates node-detail formatting into the shared _format_node_detail_lines helper used by both the CLI and the get_node tool. All new fields go through sanitize_label and count against the existing token budgets.

Worth a look

  • Named communities matching the default placeholder are now reported as the numeric idgraphify/serve.py:1502 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
  • get_node tool output shape changed (indentation of fields)graphify/serve.py:1806 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 647 functions depend on the 412 functions this change touches.

Health — this change adds coupling hotspots:

  • new: dispatch_command() — 2 callers, 118 callees
  • new: _query_graph_text() — 20 callers, 9 callees
  • new: _subgraph_to_text() — 23 callers, 4 callees
  • new: _score_query() — 15 callers, 5 callees
  • new: _query_terms() — 20 callers, 3 callees
  • new: run_benchmark() — 16 callers, 3 callees
  • new: _stale_graph_sources() — 7 callers, 6 callees
  • new: _build_server() — 2 callers, 16 callees
  • …and 12 more — each is listed as a finding

Verification — 647 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 618 function(s) in the blast radius were not formally verified this run

· 1 grounded finding(s) anchored inline below; 19 more finding(s) on lines outside this diff (see the check run).

Comment thread graphify/serve.py
Return stored community_name without placeholder stripping.
Use compact field layout for MCP get_node to match pre-change spacing.
@akshitj11

Copy link
Copy Markdown
Contributor Author

Addressed advisories:

  • _resolved_community_label now returns community_name when set (no placeholder stripping)
  • get_node uses compact=True to preserve pre-change MCP field spacing; explain CLI keeps padded layout
  • Description line is additive only

The get_neighbors coupling-delta note is acknowledged: one shared _node_description_suffix call for consistent sanitization, no new tools or branches.

@graphify-labs graphify-labs 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.

Graphify reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).


Graphify review — findings

Surfaces node description across every node-detail output: _subgraph_to_text, the MCP get_node/get_neighbors/find_node tools, and the explain CLI now append a desc=…/Description: line when a node carries one, all sanitized against F-010. Consolidates the previously duplicated node-detail formatting into shared _format_node_detail_lines and _resolved_community_label helpers, with a compact flag to preserve the MCP tool's single-space layout versus the CLI's padded columns. Also adds community labels to find_node results and descriptions to neighbor lines, so both reflect the stored community_name (falling back to the numeric community id) rather than dropping it.

No blocking issues surfaced. 2 lower-confidence candidates did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 649 functions depend on the 414 functions this change touches.

Health — this change adds coupling hotspots:

  • new: dispatch_command() — 2 callers, 118 callees
  • new: _query_graph_text() — 20 callers, 9 callees
  • new: _subgraph_to_text() — 23 callers, 4 callees
  • new: _score_query() — 15 callers, 5 callees
  • new: _query_terms() — 20 callers, 3 callees
  • new: run_benchmark() — 16 callers, 3 callees
  • new: _stale_graph_sources() — 7 callers, 6 callees
  • new: _build_server() — 2 callers, 16 callees
  • …and 13 more — each is listed as a finding

Verification — 649 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 620 function(s) in the blast radius were not formally verified this run

· 2 grounded finding(s) anchored inline below; 19 more finding(s) on lines outside this diff (see the check run).

Comment thread graphify/serve.py
return f" {label}:{padding.get(label, ' ')}{value}"


def _format_node_detail_lines(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Health regression_format_node_detail_lines()

6 callers depend on it (afferent coupling).

Grounded coupling-delta finding (deterministic), not an LLM guess.

Comment thread graphify/serve.py
Keep upstream definition_file in _format_node_detail_lines and
_resolve_single_node for get_node. MCP compact layout unchanged.
@akshitj11

Copy link
Copy Markdown
Contributor Author

Rebased on latest v8. Merged upstream _resolve_single_node + definition_file
with _format_node_detail_lines(compact=True). Bot coupling notes acknowledged.

@graphify-labs graphify-labs 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.

Graphify reviewed this change.

Worth a look — the grounded gate found no coupling regressions or blocking issues, but 1 advisory finding(s) below merit a look before merge.

Formal verification. 1 change(s) tested, no difference found (not proven).


Graphify review — findings

Surfaces node description throughout serve output — _subgraph_to_text, neighbor lines, and community/query listings now append a desc= suffix via _node_description_suffix, and both the CLI explain/get_node detail view and the MCP get_node tool render Description and a resolved Community label through the shared _format_node_detail_lines/_resolved_community_label helpers. Consolidates the previously duplicated node-detail formatting in dispatch_command and _tool_get_node into one helper with a compact flag controlling padding. Community labels now fall back to the stored community id (as a string) only when community_name is absent, and description text counts against the token budget.

Worth a look

  • Subgraph text NODE schema now adds desc fieldgraphify/serve.py:1051 · Escalate · medium
    • agreed by 2 of 2 members but NOT verified (no proof, no reproducing execution) — consensus is not a verdict; needs human review
Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 694 functions depend on the 428 functions this change touches.

Health — this change adds coupling hotspots:

  • new: dispatch_command() — 2 callers, 124 callees
  • new: _query_graph_text() — 20 callers, 9 callees
  • new: _subgraph_to_text() — 23 callers, 4 callees
  • new: _score_query() — 15 callers, 5 callees
  • new: _query_terms() — 20 callers, 3 callees
  • new: run_benchmark() — 16 callers, 3 callees
  • new: _stale_graph_sources() — 7 callers, 6 callees
  • new: _build_server() — 2 callers, 16 callees
  • …and 13 more — each is listed as a finding

Verification — 694 functions in the blast radius were not formally verified this run (proofs are advisory here).

Gate & verification

graphify gate

PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.

Advisory (not blocking):

  • verification_scope: 654 function(s) in the blast radius were not formally verified this run

Formal verification

Could not verify: Could not verify dispatch\_command.

The verifier did not have enough to check dispatch\_command, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 23 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly SystemExit — names the real obstacle, not a sampling gap)

Could not verify: Could not verify \_build\_server.

The verifier did not have enough to check \_build\_server, so it is saying so rather than guessing. No false assurance is the whole point.

Guarantee: No guarantee either way, this is an honest abstention, not a pass.

Note: Reason: not verifiable: all 23 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous

No difference found (not proven): No behavior difference found in \_subgraph\_to\_text (not a proof).

The verifier ran both versions of \_subgraph\_to\_text on many inputs and saw identical behavior every time. Strong evidence the change is safe, but evidence, not a proof.

Guarantee: Empirical: differential testing (both versions run on many generated inputs). A divergence on an untested input remains possible, so this is 'no counterexample found', not 'proven equivalent'.

Note: An input the sampler did not try could still differ.

· 2 grounded finding(s) anchored inline below; 19 more finding(s) on lines outside this diff (see the check run).

Comment thread graphify/serve.py
Comment thread graphify/serve.py
@akshitj11

Copy link
Copy Markdown
Contributor Author

Post-rebase bot note acknowledged: the desc= suffix on NODE lines in _subgraph_to_text is intentional for #3026 — it surfaces node.description on query output when present, matching wiki/Obsidian behavior. Coupling-delta inline comments on _format_node_detail_lines and _tool_get_neighbors are expected from consolidating shared formatters; no further code changes planned.

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.

query/explain and the serve MCP tools don't surface node.description / community_name from graph.json

1 participant