Skip to content

deps: renderImportedBy keeps the unconditional basename fallback — ambiguous bare imports still attributed to every same-basename file via codedb_deps #588

@justrach

Description

@justrach

Problem

The #572 bundle added the basename-ambiguity guard to getImportedBy (via getImportedByFiltered), so the query-pipeline deps op no longer attributes a bare import conf to every indexed conf.py. But renderImportedBy — the function backing the main MCP codedb_deps reverse listing — still performs the unconditional basename fallback (explore.zig:3914), so the false attribution persists through the primary tool. Found by a focused review of the freshly-merged bundle.

Failing Test

src/test_parser.zig (named after this issue once assigned): with a/conf.py, b/conf.py, and importer.py (import conf), renderImportedBy must not list importer.py for BOTH; with a single conf.py the fallback must still list it. Verified failing on the merged HEAD: 64/65 (attributed to both).

Fix

Mirror getImportedBy: count same-basename outlines and gate the fallback block on basename_count <= 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:p2Medium priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions