Conversation
Distilled from #1245 by Andrew Hundt (a slice of 0370d52). detect_url_in_args in the parallel resolver runs for every resolved call with no callee gating. A first argument like "/new/file.txt" clears normalize_url_arg (it has a second slash and no whitespace) and then reaches cbm_service_pattern_is_http_route_literal, whose filesystem extension list knew about config, key and socket files but not about documents or logs. So open_file("/new/file.txt") read_file("/docs/guide.md") write_file("/data/app.log") each minted a Route node and an HTTP_CALLS edge -- the graph reported a web endpoint where the program opens a file. Five extensions join the list: .log .md .pdf .rst .txt, alphabetical order preserved. Two things the tests are careful about, because the obvious fixture would not have been RED. A bare Python builtin open(...) never resolves to an indexed target, so it never reaches the URL detector at all; the bug shows only for calls that resolve to a project symbol, which is what the fixture defines. And /var/... is already rejected by the filesystem ROOT list, so the fixture paths start with segments that list does not know, leaving the extension guard as the only thing that can reject them. RED before the fix: infrascan_http_route_literal_guard_rejects_document_extensions FAIL tests/test_infrascan.c:44: ASSERT(!(cbm_service_pattern_is_http_route_literal("/new/file.txt", "open"))) pipeline_arg_url_rejects_document_file_paths FAIL tests/test_pipeline.c:6652: count_nodes_named(s, project, "/new/file.txt") == 1, expected 0 == 0 The pipeline test keeps a positive control above that line -- a genuine requests.get("/api/items") still yields its Route node and HTTP_CALLS edge -- so the guard cannot pass by rejecting everything. GREEN after: infrascan 4 passed; pipeline 282 passed; extraction edge_types_probe route_canon 420 passed. Co-authored-by: Andrew Hundt <ATHundt@gmail.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This branch has not been deployed
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.
Distilled from #1245 by @ahundt (a slice of 0370d52), carried with
Co-authored-by. #1245 stays open until its distills land.The bug
detect_url_in_argsruns for every resolved call with no callee gating."/new/file.txt"clearsnormalize_url_arg(second slash, no whitespace) and reaches the route-literal check, whose filesystem-extension list knew about config, key and socket files but not documents or logs. Soopen_file("/new/file.txt")minted a Route node and an HTTP_CALLS edge — the graph reported a web endpoint where the program opens a file.The fix
Five extensions join
hard_file_exts:.log .md .pdf .rst .txt. Alphabetical order preserved; formatted with a range-limited clang-format, not a whole-file run.Why the fixture looks the way it does
The obvious test would not have been RED, and the worker caught both reasons:
open(...)never resolves to an indexed target, so it never reaches the URL detector — the bug only shows for calls that resolve to a project symbol. The fixture definesopen_file/read_file/write_file./var/...is already rejected by the filesystem root list, so the fixture uses/data/app.logand paths whose first segment that list does not know — leaving the extension guard as the only thing that can reject them.RED → GREEN
Before:
The pipeline test keeps a positive control above that line — a real
requests.get("/api/items")still yields its Route and HTTP_CALLS edge — so the guard cannot pass by rejecting everything.After:
infrascan4 passed ·pipeline282 passed ·extraction edge_types_probe route_canon420 passed.Not taken from the same upstream function: its whitespace and first-segment-colon guards — separate defects, separate PRs.