Skip to content

fix(query): CLI query output carries the learning sidecar's lesson annotations - #13

Merged
Azeem1985 merged 1 commit into
v8from
fix/query-learning-overlay
Aug 25, 2026
Merged

Azeem1985 merged 1 commit into
v8from
fix/query-learning-overlay

Conversation

@Azeem1985

Copy link
Copy Markdown

Defect

The work-memory overlay renders as learning=<status>[:stale] inside NODE lines — but only when the loaded graph object carries G.graph["_learning_overlay"]. serve._load_graph (the MCP loader) attaches it, and graphify explain merges the sidecar itself — the CLI query handler builds its graph straight from graph.json (cli.py, the node_link_graph load in the query branch) and never attaches the overlay. Result, verified on the live deployment: the same question answered over MCP shows the lessons; the CLI answer silently drops them.

Maker-docs check

The maker documents the intended behavior explicitly — twice:

  • Upstream CHANGELOG 0.9.3 (work-memory overlay feature): "graphify explain / query / GRAPH_REPORT.md / the HTML viewer surface them where you look (a Lesson: hint, a colored node ring)."
  • Upstream README (reflect section, line ~678): "graphify explain / query then show a 'Lesson:' hint, flagged 'code changed — re-verify' when the source moved on."

So query surfacing lessons is documented shipped behavior; the CLI loader just never got the attach. This is a documented-behavior-vs-implementation gap, not a feature request.

Community check

gh search issues/prs on Graphify-Labs/graphify for "learning overlay", "lesson query", "learning sidecar": zero reports. Nearest neighbors are Graphify-Labs#2821 / Graphify-Labs#3026 (other node attributes un-rendered by query) — different fields, same family of gap.

Fix

Attach the overlay in the CLI query path exactly like serve._load_graph does: G.graph["_learning_overlay"] = load_learning_overlay(gp), display-only, fail-safe to {} on any error. The renderer (_subgraph_to_text) already sanitizes the status and counts the suffix against the token budget, so both surfaces now emit the identical learning=<status>[:stale] form. Without a sidecar the output stays byte-identical.

Tests

  • sidecar entry → learning=preferred] on the annotated node only
  • vanished cited file → learning=tentative:stale] (the "code changed — re-verify" marker)
  • no sidecar → no learning= anywhere (output unchanged)
  • query/serve/serve_http/reflect families: 252 passed; ruff + py_compile clean

🤖 Generated with Claude Code

…esson annotations

The subgraph renderer has supported learning=<status>[:stale] NODE
annotations since the work-memory overlay shipped, and both explain and
the MCP server attach the .graphify_learning.json sidecar at load time.
The CLI query loader builds its graph directly from graph.json and never
attached the overlay, so the same question answered over MCP showed the
lessons while the CLI answer silently dropped them — despite the docs
promising query surfaces a Lesson hint.

Attach the overlay in the CLI query path exactly like serve._load_graph:
display-only, fail-safe to an empty overlay, byte-identical output when
no sidecar exists. The :stale marker renders too.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Azeem1985
Azeem1985 merged commit 21117d9 into v8 Aug 25, 2026
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.

1 participant