fix(parsers/python): surface top-level callGraph/reverseCallGraph in analyzer_output#99
Open
gadievron wants to merge 1 commit into
Conversation
…analyzer_output
generate_analyzer_output() emitted only {"functions": ...}, dropping the top-level callGraph /
reverseCallGraph that the analyzer_output schema carries. They were already computed in
call_graph_result (CallGraphBuilder.export() returns call_graph / reverse_call_graph) but were
never passed in, so the python parser's analyzer_output.json was schema-inconsistent with the
documented format.
The analyzer_output schema uses camelCase top-level keys: PARSER_UPGRADE_PLAN documents
"callGraph", and the JS pipeline emits/asserts camelCase callGraph / reverseCallGraph
(funcId -> [funcIds]). Pass call_graph_result into generate_analyzer_output (optional arg,
back-compatible) and emit those two keys from its snake_case source keys.
Scope: filePath is intentionally NOT a per-function field -- consumers (RepositoryIndex,
dependency_resolver) derive it from the func_id key via funcId.split(':')[0]. The original
filing's indirect_calls field is phantom (grep finds no such data produced anywhere) and is
excluded. The classes/imports top-level keys are a related but separately-scoped schema item.
Tests: tests/test_parse_repository_analyzer_schema.py (2 cases). RED 1 failed -> GREEN 2 passed
(venv py3.11). ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
generate_analyzer_output() emitted only {"functions": ...}, dropping the top-level callGraph /
reverseCallGraph that the analyzer_output schema carries. They were already computed in
call_graph_result (CallGraphBuilder.export() returns call_graph / reverse_call_graph) but were
never passed in, so the python parser's analyzer_output.json was schema-inconsistent with the
documented format.
The analyzer_output schema uses camelCase top-level keys: PARSER_UPGRADE_PLAN documents
"callGraph", and the JS pipeline emits/asserts camelCase callGraph / reverseCallGraph
(funcId -> [funcIds]). Pass call_graph_result into generate_analyzer_output (optional arg,
back-compatible) and emit those two keys from its snake_case source keys.
Scope: filePath is intentionally NOT a per-function field -- consumers (RepositoryIndex,
dependency_resolver) derive it from the func_id key via funcId.split(':')[0]. The original
filing's indirect_calls field is phantom (grep finds no such data produced anywhere) and is
excluded. The classes/imports top-level keys are a related but separately-scoped schema item.
Tests: tests/test_parse_repository_analyzer_schema.py (2 cases). RED 1 failed -> GREEN 2 passed
(venv py3.11). ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com