feat(dataflow): DF4 — trace() + CLI + MCP for end-to-end data flow#7
Merged
Conversation
trace(graph, entry, max_depth=6) walks the call graph + cross-layer edges and returns a DataFlow with ordered hops. Entry can be a function qualname or "METHOD /path" (for fetch-shape entry — uses match_route() from DF3). Hop construction: - args/kwargs come from incoming CALLS edge metadata (DF0) - layer = frontend (.tsx/.jsx or COMPONENT role) | db (REPO role) | backend - role propagated from node metadata - READS_FROM/WRITES_TO emitted as terminal db hops - FETCH_CALL → match_route → cross-layer transition - Cycle-safe: visited set drops back-edges - Confidence = min across hops New CLI: codegraph dataflow trace <entry> [--depth N] [--format markdown|json] New MCP tool: dataflow_trace (15 tools registered now, was 14) 15 new tests covering simple chains, cycles, max depth, layer assignment, role propagation, fetch→route transition, db hops, confidence, CLI smoke (markdown + json), MCP tool. Suite: 458 passed (was 443; +15). Stack: ruff + mypy --strict clean.
2 tasks
smochan
added a commit
that referenced
this pull request
May 30, 2026
The `mcp:` field in `.codegraph.yml` was never read by any code path.
Sitting next to the active `register_mcp: true`, it confused users into
thinking it had to be flipped on manually.
Removed from `CodegraphConfig`. `model_config = {"extra": "ignore"}`
keeps forward-compat: existing 0.1.x configs that still carry the
field load without error.
v0.1.2 backlog item #7.
smochan
added a commit
that referenced
this pull request
May 30, 2026
The `mcp:` field in `.codegraph.yml` was never read by any code path.
Sitting next to the active `register_mcp: true`, it confused users into
thinking it had to be flipped on manually.
Removed from `CodegraphConfig`. `model_config = {"extra": "ignore"}`
keeps forward-compat: existing 0.1.x configs that still carry the
field load without error.
v0.1.2 backlog item #7.
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.
Walks call graph + cross-layer edges. Entry can be qualname or 'METHOD /path'. New CLI subcommand and MCP tool. 15 new tests, 458 total.