orstrum_analyze_impact

Blast-radius analysis: walks the caller graph outward from a change and reasons over affected files' Purposes with an LLM.

Input

change required
string
Natural-language description of the proposed change (e.g. "rename TransactionRequestDto field amount to value"). Drives seed selection and the LLM reasoning.
files
string[]
Optional seed list — the files the change directly modifies. When omitted, seeds are chosen by deterministic keyword overlap against change.
path
string
Convenience shorthand for a single seed file — equivalent to files: [path]. Merged with files when both are given.
depth
number
Caller-graph traversal depth in hops (1–6). Default: 2. Higher values surface more transitive dependents.
repo
string
Restrict seed selection and traversal to one repo (matches repo.name).

Output


  seedFiles: ["api-service/src/lib/jwt"],
  directlyAffected: [
    
      note:   "api-service/src/api/auth",
      reason: "imports verifyJwt directly; will break if the signature changes"
    
  ],
  transitivelyAffected: [
    
      note:   "api-service/src/middleware/guard",
      hops:   2,
      reason: "reached via auth.ts; guards every authenticated route"
    
  ],
  riskAreas: ["session handling", "route protection"],
  summary: "The JWT shape is consumed by the auth entry point and, transitively, the route guard. Changing it requires updates across both."

Structural facts come from the graph: directlyAffected is every file at hop 1 (direct importers of a seed), transitivelyAffected is hop ≥ 2 with the minimum hops distance. Only the per-file reason, riskAreas, and summary come from the LLM. If the model call fails, the deterministic hop data is still returned with default reasons.

This is the highest-signal tool for pre-refactor research. Use it before touching shared utilities or widely-imported modules. Workflow: orstrum_search to locate the seed → orstrum_analyze_impact to fan out.