Skip to content

feat(blast-radius): PR 1 — symbol schema, Python resolver, blast-radius computation#2

Open
ni5h4nt wants to merge 8 commits into
feature/blast-radius-pre-filterfrom
feature/blast-radius-pr1-schema
Open

feat(blast-radius): PR 1 — symbol schema, Python resolver, blast-radius computation#2
ni5h4nt wants to merge 8 commits into
feature/blast-radius-pre-filterfrom
feature/blast-radius-pr1-schema

Conversation

@ni5h4nt
Copy link
Copy Markdown
Owner

@ni5h4nt ni5h4nt commented May 3, 2026

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.md
Plan: docs/superpowers/plans/2026-05-02-blast-radius-pr1-schema-and-resolver.md

What lands

  • app/services/blast_radius_types.pySymbol, ChangedSymbol, CallEdge, ImpactedUnchangedFile, BlastRadius dataclasses + EdgeConfidence enum (EXTRACTED / INFERRED / AMBIGUOUS).
  • app/services/code_chunker.pyextract_symbols() and extract_changed_symbols() for Python (other languages stub to [] and ship in PR 2).
  • app/services/python_call_resolver.pyPythonCallResolver resolving cross-file calls per spec D2 confidence rules, including getattr(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), and compute_blast_radius with risk score + why_risky aggregates.

What doesn't land (deferred to later PRs)

  • PR 2: indexing-workflow integration (build symbol graph for all 5 chunker languages).
  • PR 3: COMPUTING_BLAST_RADIUS workflow phase + SSE event, flag-gated.
  • PR 4: specialists consume impact_context; flip flag default to on.
  • PR 5: delete legacy app/services/impact_analyzer.py + its test + README mention.

Design highlights

  • Recall = 1.0: every AMBIGUOUS call site emits all candidate edges rather than picking one and being wrong.
  • Hop-1 callers never capped; hop-2+ capped at max_files_hop2plus (default 100), file-level dedup with best-evidence policy.
  • Aggregate why_risky entries per changed symbol with > 20 callers, regardless of cap, so the model always sees structural scale.

Test plan

  • uv run --extra indexing pytest tests/unit/test_blast_radius_types.py -v — 6/6
  • uv run --extra indexing pytest tests/unit/test_code_chunker_symbols.py -v — 8/8
  • uv 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/8
  • uv 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/8
  • uv run ruff check — clean on all 8 touched files

ni5h4nt added 8 commits May 2, 2026 23:19
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant