feat(blast-radius): PR 1 — symbol schema, Python resolver, blast-radius computation#2
Open
ni5h4nt wants to merge 8 commits into
Open
Conversation
Phase 1/8 of blast-radius PR 1a. Pure data types -- no FalkorDB, chunker, or workflow imports. Every later module in this feature depends on this one; this depends on nothing. - EdgeConfidence enum with EXTRACTED/INFERRED/AMBIGUOUS tiers and default_score() mapping. - Symbol, ChangedSymbol, CallEdge, ImpactedUnchangedFile, BlastRadius dataclasses.
When a caller reached a changed symbol via multiple CALLS paths (e.g. one EXTRACTED + one AMBIGUOUS), the previous first-row-wins loop kept only the first row's confs and skipped the rest. Since FalkorDB row order is not guaranteed, the AMBIGUOUS count in the high-fanout why_risky summary was silently order-dependent and could understate ambiguity. Aggregate per caller across all rows: OR the is_ambiguous flag and has_tests flag, then count distinct callers. Added regression test that fails under the old logic when the EXTRACTED row sorts first.
6 tasks
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
PR 1 of the blast-radius pre-filter initiative. Adds the symbol-level FalkorDB schema, Python call-edge resolver, and the
compute_blast_radius()library entry point. No workflow integration in this PR — that's PR 2. Everything here is library-level and gated by future consumers.Spec:
docs/superpowers/specs/2026-05-02-blast-radius-pre-filter-design.mdPlan:
docs/superpowers/plans/2026-05-02-blast-radius-pr1-schema-and-resolver.mdWhat lands
app/services/blast_radius_types.py—Symbol,ChangedSymbol,CallEdge,ImpactedUnchangedFile,BlastRadiusdataclasses +EdgeConfidenceenum (EXTRACTED / INFERRED / AMBIGUOUS).app/services/code_chunker.py—extract_symbols()andextract_changed_symbols()for Python (other languages stub to[]and ship in PR 2).app/services/python_call_resolver.py—PythonCallResolverresolving cross-file calls per spec D2 confidence rules, includinggetattr(x, "literal")()as AMBIGUOUS-per-candidate.app/services/dependency_analyzer.py— symbol/edge write methods,derive_tested_by_edges(BFS with per-test cap and best-path dedup),compute_is_hub(P95 of incoming CALLS), andcompute_blast_radiuswith risk score + why_risky aggregates.What doesn't land (deferred to later PRs)
COMPUTING_BLAST_RADIUSworkflow phase + SSE event, flag-gated.impact_context; flip flag default to on.app/services/impact_analyzer.py+ its test + README mention.Design highlights
max_files_hop2plus(default 100), file-level dedup with best-evidence policy.Test plan
uv run --extra indexing pytest tests/unit/test_blast_radius_types.py -v— 6/6uv run --extra indexing pytest tests/unit/test_code_chunker_symbols.py -v— 8/8uv run --extra indexing pytest tests/unit/test_code_chunker.py -v— 12/12 (no regression)uv run --extra indexing pytest tests/unit/test_python_call_resolver.py -v— 8/8uv run --extra indexing pytest tests/unit/test_dependency_analyzer.py -v— 17/17 (no regression)uv run --extra indexing pytest tests/unit/test_dependency_analyzer_blast_radius.py -v— 8/8uv run ruff check— clean on all 8 touched files