feat(dataflow): DF3 URL stitcher with placeholder normalisation#6
Merged
Conversation
Implements match_route(graph, fetch_url, fetch_method, body_keys=None) →
(handler_qualname, confidence) | None.
Confidence rubric:
1.0 exact literal-segment match
0.9 placeholders normalised to same shape
(covers {id}, ${id}, :id, and pure-numeric segments)
+0.05 body-key overlap bonus when fetch body keys match handler params
(clamped at 0.95 / 1.0 ceilings)
0.5 prefix-only fuzzy match (last-resort)
Strips ?query and #fragment, normalises trailing slash, case-insensitive
method comparison. Tiebreaker: more specific path (more literal segments)
wins.
17 new tests covering exact match, placeholders (3 styles), method mismatch,
multi-method same path, specificity tiebreaker, body-key bonus, multiple
placeholders, trailing slash, query string, fragment, prefix fuzzy, case
sensitivity. Self-graph: 443 tests pass.
2 tasks
smochan
added a commit
that referenced
this pull request
May 30, 2026
`codegraph serve` generated a pyvis HTML page per explored function and never pruned them. Long-lived projects could grow `.codegraph/explore/` to hundreds of MB. New module `codegraph/cache_prune.py` implements LRU eviction by mtime (oldest first). `codegraph clean --max-size-mb 50` (default) prunes until under the cap; `--all` wipes everything. `codegraph serve` runs the prune on startup and prints the current cache size as a dim line so users notice if it's still growing. v0.1.2 backlog item #6.
smochan
added a commit
that referenced
this pull request
May 30, 2026
`codegraph serve` generated a pyvis HTML page per explored function and never pruned them. Long-lived projects could grow `.codegraph/explore/` to hundreds of MB. New module `codegraph/cache_prune.py` implements LRU eviction by mtime (oldest first). `codegraph clean --max-size-mb 50` (default) prunes until under the cap; `--all` wipes everything. `codegraph serve` runs the prune on startup and prints the current cache size as a dim line so users notice if it's still growing. v0.1.2 backlog item #6.
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.
Implements match_route() — the half of v0.2 dataflow that stitches frontend FETCH_CALL URLs to backend ROUTE handlers. 17 new tests, 443 total pass.