Skip to content

query resolves graphify-out/ against CWD and never echoes which graph it opened — answers silently come from another project's graph #2789

Description

@cdtatarevich

Environment

  • graphifyy 0.9.39, macOS 15 (Darwin 25.6.0), pipx install, Claude Code host
  • Two graphs on one machine: a parent project at ~/Proj/ and a vendored subproject at ~/Proj/Sub/, each with its own graphify-out/ built by the skill's step-by-step flow.

What happens

graphify query resolves graphify-out/graph.json against the current working directory with no indication of which graph it opened. Running it from the parent while intending to ask about the subproject returns a confident, well-formed answer from the wrong corpus.

$ cd ~/Proj                      # parent project's graph
$ graphify query "Which code enforces the safe-by-default install gate?"
Traversal: BFS depth=2 | Start: ['Safe-by-default install (--system opt-in)', ...] | 33 nodes found
NODE Safe-by-default install (--system opt-in) [src=Sub/README.md ...]
NODE Migration Notes — ...                     [src=MIGRATION-NOTES.md ...]   <- parent project
NODE Stop-Breach Poll                          [src=skills/daily-exit-check.md ...]  <- parent project

The parent graph happened to contain Sub/README.md as a corpus file, so the seed terms matched and the traversal produced plausible output built almost entirely from unrelated documents. Nothing in the output names the graph file, the scan root, or the node count of the graph being queried. I only caught it because the community labels were ones I had not assigned in that project.

Same command from ~/Proj/Sub returns the correct 355-node result.

Why it is easy to hit

graphify-out/ is CWD-relative by design (noted in #2603 for the hook path), but query is the interactive surface where the user is least likely to be thinking about CWD — you ask a question about a subproject you were just reading, from wherever your shell happens to be. Unlike a build, there is no node-count or file-count output that would look wrong.

Suggestions, cheapest first

  1. Echo the resolved source. One line before the traversal: graph: /abs/path/graphify-out/graph.json (1272 nodes, root=/abs/scan/root). This alone makes the failure self-evident, and helps for path/explain too.
  2. Accept --graph <path>, which path, explain and diagnose multigraph already take, so query is the odd one out.
  3. Consider walking up to the nearest ancestor graphify-out/ (git-style discovery) and/or honoring .graphify_root, so an intended subproject query from a child directory resolves the way users expect.

Related: #2603 (same CWD/scan-root coupling, hook surface), #2672 (empty results reading as "absent from the codebase" rather than "absent from the graph" — the same class of "the answer does not say what it is an answer about").

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