Conversation
DependencyGraph stores forward edges as a raw ArrayList of import strings. When a file imports the same dep under multiple aliases, e.g.: const idx = @import("index.zig"); const Index = @import("index.zig").Foo; const reset = @import("index.zig").resetFrequencyTable; outline.imports.items contains "index.zig" three times, and rebuildDepsFor appends each verbatim. getForwardDeps then returns "index.zig" three times — visible to agents as cosmetic noise in codedb_deps depends_on output. Real-world: src/main.zig in this repo shows index.zig 5x and mcp.zig 2x. Test asserts forward edges are unique by path. Fails on main; will pass after dedup is added in rebuildDepsFor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…— v0.2.5812 (#445) Two papercuts surfaced verifying v0.2.5811: 1. codedb_deps src/main.zig depends_on listed index.zig 5x and mcp.zig 2x. Multi-aliased @import sites added one forward edge each. rebuildDepsFor now dedupes via StringHashMap(void) before handing off to setDeps. getImportedBy was already correct. 2. codedb_find description didn't make it clear it's filename-only; agents kept reaching for it on symbol lookups. Tightened wording to explicitly say NOT content/symbol search and route to codedb_word/codedb_symbol/codedb_search instead. Closes #445. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rebuildDepsForso a file aliasing the same dep across multiple@importsites doesn't show up multiple times incodedb_deps depends_on.codedb_finddescription to make it explicit that it's filename-only fuzzy search, not content/symbol — and routes to the right tool for symbol lookups.Closes #445.
Test plan
zig build test— 518/518 pass (one new test for issue-445)test "issue-445: dep-graph dedupes multi-aliased forward imports"— fails on main, passes after fixsrc/main.zig: was 24 entries with index.zig 5x + mcp.zig 2x → expected 19 unique entries🤖 Generated with Claude Code