Skip to content

affected silently returns nothing when the path is spelled differently (./ or absolute) #2706

Description

@phudayyy

What happens

affected resolves a file only when the path is spelled exactly as the graph stores it. Any other spelling of the same file returns an empty list with exit code 0 and no warning:

$ graphify affected src/brain/retrieve/query.py
… 16 results

$ graphify affected ./src/brain/retrieve/query.py
(nothing)                       # exit 0

$ graphify affected /abs/repo/src/brain/retrieve/query.py
(nothing)                       # exit 0

$ graphify affected does-not-exist.py
(nothing)                       # exit 0

Same file, sixteen dependents, three of the four spellings say nothing depends on it.

Why it matters

The empty result is indistinguishable from a genuine zero and from a typo — same output, same exit code, nothing on stderr. affected is the blast-radius question, so "nothing depends on this" is an answer people act on before changing a file.

./ is what shell tab-completion produces, and an absolute path is what any script or editor integration passes.

How it was found

Measuring affected against an independently built import graph (Python ast, no tree-sitter). The probe passed absolute paths and measured recall 0.000 for every module — the same failure one layer up, and it took a while to realise the probe was measuring itself.

Cause

resolve_seed (graphify/affected.py) compares the query to the stored source_file with normalised string equality. The graph stores repo-relative paths, so ./x and /abs/repo/x match nothing while naming the same file.

Environment

graphify 0.9.41 · Python 3.12 · macOS · corpus is a Python project (~1,400 nodes)

A patch is on phudayyy:fix/affected-path-forms with a test that is red without it, and the full suite run both ways (identical failures, all tests/test_ollama_retry_cap.py, no ollama in this environment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions