Skip to content

bug: impact_analysis traverses by leaf name instead of unique_id #454

@suryaiyer95

Description

@suryaiyer95

Description

In impact-analysis.ts, the findDownstream function matches dependencies by splitting on . and comparing the last segment (leaf name):

const deps = model.depends_on.map((d) => d.split(".").pop())
if (deps.includes(name)) {

depends_on entries are fully qualified like project.stg_orders. Using .split(".").pop() takes only the last segment, which:

  1. Breaks with duplicate leaf names across packages — if two packages have models with the same name, the wrong one may match
  2. Misses fully-qualified matches — passing a fully-qualified name like project.stg_orders will never match the leaf-only comparison

Impact

  • Incorrect downstream dependency graph — blast radius may be over/under-reported
  • False positives/negatives in impact analysis results

Suggested Fix

Match against both the full depends_on entry and the leaf name, or normalize both sides consistently:

const deps = model.depends_on
if (deps.some(d => d === name || d.endsWith(`.${name}`) || d.split('.').pop() === name)) {

Source

Flagged by Codex and MiMo in multi-model code review of PR #429.

Files

  • packages/opencode/src/altimate/tools/impact-analysis.ts — lines 58, 81, 172

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions