Repository navigation
fix: entry_function is a real AST filter, not an LLM-enrichment hint (#312) - #317
Merged
Merged
Conversation
locate_library_root() searched Path(search_from).parent for claude-global-library, treating the plugin root's parent as the workspace root. It is actually the engine repo root, one level short of the real sibling relationship, so auto-discovery silently reported NO_LIBRARY instead of STALE on a dev machine with both checkouts present -- exactly the scenario this check exists to catch (verified: pinned 29.73.0 vs live 29.97.4, 21 agents missing from the snapshot). Fixed to ascend two levels, matching the already-correct scripts/build_library_snapshot.py, and added a regression test that exercises the auto-discovery path with a directory layout mirroring the real repo instead of always passing library_root explicitly. Fixes #315 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012xm5ALQHK3gnBQq4dMfPFD
…et built README.md said register-mcp reports the version-push-gate capability as unavailable because it is "catalogued but not yet built." That has been false since src/mcp/push_gate/server.py landed (ADR-006, commit 0900fff) -- both capabilities are registered and REACHABLE today, verified via `python scripts/mcp_registration.py status`. Fixes #316 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012xm5ALQHK3gnBQq4dMfPFD
…312) generate_sequence_diagram(call_chains=None, context="") passed its context parameter straight into _llm_enrich() whenever non-empty, silently replacing the deterministic AST rendering with LLM output. mcp-uml-diagram/server.py's generate_sequence_diagram tool passed its entry_function parameter ("Optional function name to trace the call chain from") into that same context= argument - so any caller who supplied entry_function to what is documented and labelled a Tier 2 AST tool got an LLM-authored diagram instead, with the response's own "source": "derived" field claiming otherwise. There was no actual entry-function tracing implemented anywhere in the method; passing a non-empty entry_function did nothing but trigger LLM enrichment. Fix: renamed the parameter to entry_function and gave it real meaning - a BFS filter on caller->callee reachability from the named function, via a new _filter_chains_from_entry() helper - and removed the context-triggered LLM enrichment path entirely from both generate_sequence_diagram and _sequence_from_fqn_chains (confirmed via grep: nothing else in the class called _llm_enrich, so nothing else relied on this path). Updated the mcp-uml-diagram tool call site to pass entry_function=entry_function instead of context=entry_function, and corrected its docstring. Not touched, disclosed rather than silently decided either way: _llm_enrich() itself is now unreferenced by any production code path in this file, but tests/test_udm_generate_from_data.py monkeypatches it defensively (asserting the deterministic UDM path never reaches it), so deleting it risks breaking that test's setup, and auditing whether other Tier-2-hybrid methods in this class still need it is out of this issue's scope. Adds 4 regression tests in TestSequenceDiagramEntryFunctionFilter: entry_function never reaches an LLM call (explicit explosion-on-call guard), filters to only reachable calls, an unmatched entry_function gets its own explicit message distinct from "no call chains found", and the empty/default case remains unfiltered. Full relevant suite: 106/106 pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01477SY6G5x6ft5PGe3C5xPh
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.
Summary
generate_sequence_diagram(call_chains=None, context="")passed itscontextparameter straight into_llm_enrich()whenever non-empty, silently replacing the deterministic AST rendering with LLM output.mcp-uml-diagram/server.py'sgenerate_sequence_diagramtool passed itsentry_functionparameter ("Optional function name to trace the call chain from") into that samecontext=argument — so any caller who suppliedentry_functionto what is documented and labelled a Tier 2 AST tool got an LLM-authored diagram instead, with the response's own"source": "derived"field claiming otherwise. There was no actual entry-function tracing implemented anywhere in the method.Fix
entry_functionand gave it real meaning: a BFS filter on caller→callee reachability from the named function, via a new_filter_chains_from_entry()helper.generate_sequence_diagramand_sequence_from_fqn_chains(confirmed via grep: nothing else in the class called_llm_enrich, so nothing else relied on this path).mcp-uml-diagramtool call site (separate PR, that repo) to passentry_function=entry_functioninstead ofcontext=entry_function.Deliberately not touched, disclosed rather than silently decided
_llm_enrich()itself is now unreferenced by any production code path in this file, buttests/test_udm_generate_from_data.pymonkeypatches it defensively (asserting the deterministic UDM path never reaches it). Deleting it risks breaking that test's setup, and auditing whether other Tier-2-hybrid methods in this class still need it is out of this issue's scope.Test plan
TestSequenceDiagramEntryFunctionFilter(4 tests): entry_function never reaches an LLM call (explicit explosion-on-call guard), filters to only reachable calls, an unmatched entry_function gets its own explicit message distinct from "no call chains found", and the empty/default case remains unfilteredpytest tests/test_uml_generators.py tests/test_udm_generate_from_data.py— 106/106 passCloses #312.
🤖 Generated with Claude Code
https://claude.ai/code/session_01477SY6G5x6ft5PGe3C5xPh