-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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:
- Breaks with duplicate leaf names across packages — if two packages have models with the same name, the wrong one may match
- Misses fully-qualified matches — passing a fully-qualified name like
project.stg_orderswill 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working