Skip to content

fix(explore): dedup deps + clarify codedb_find description (v0.2.5812, #445)#446

Merged
justrach merged 2 commits intomainfrom
fix/issue-445-deps-dedup-and-find-desc
May 7, 2026
Merged

fix(explore): dedup deps + clarify codedb_find description (v0.2.5812, #445)#446
justrach merged 2 commits intomainfrom
fix/issue-445-deps-dedup-and-find-desc

Conversation

@justrach
Copy link
Copy Markdown
Owner

@justrach justrach commented May 7, 2026

Summary

  • Dedupes forward edges in rebuildDepsFor so a file aliasing the same dep across multiple @import sites doesn't show up multiple times in codedb_deps depends_on.
  • Tightens the codedb_find description to make it explicit that it's filename-only fuzzy search, not content/symbol — and routes to the right tool for symbol lookups.
  • Bumps to v0.2.5812.

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 fix
  • Manually reproduced before/after on src/main.zig: was 24 entries with index.zig 5x + mcp.zig 2x → expected 19 unique entries

🤖 Generated with Claude Code

justrach and others added 2 commits May 7, 2026 11:33
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>
@justrach justrach merged commit 59071f8 into main May 7, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

explore: codedb_deps depends_on lists multi-aliased imports multiple times

1 participant