test: cover top high-fanin untested helpers (84 Python + 13 Node tests)#3
Merged
Conversation
…rams, return_type)
3 tasks
smochan
added a commit
that referenced
this pull request
May 30, 2026
FastAPI Pydantic request-body models were being flagged dead because the only reference to them came through a handler's parameter type annotation, which the Python parser didn't trace. The parser now walks each function's parameter `type` strings and the return-type string, regex-extracts capitalized identifiers, drops typing-scaffolding (`Optional`, `Annotated`, `Union`, ...) and FastAPI dependency markers (`Body`, `Depends`, ...), and emits one `CALLS` edge with `dst="unresolved::<TypeName>"` and `metadata.via == "annotation"` per surviving name. The existing resolver rewrites these to real `CLASS` ids when the type is in-repo, which closes the loop for dead-code detection. Framework-agnostic: every function with type annotations benefits, not just route handlers. The change reuses `EdgeKind.CALLS` (rather than introducing a new `REFERENCES` kind) because `CALLS` already flows through the resolver and the reference-kind whitelist used by dead-code, and Pydantic-body validation IS effectively a runtime call into the model class. v0.1.2 backlog item #3.
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
Direct unit tests for ~16 high-fanin helpers across viz/_style, roles, parsers/typescript, mcp_server, embed/store, viz/diagrams, viz/hld, plus JS helpers.
Tests added
Notes