Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
TypeScript antigravity-skillsbusiness-knowledgeclaude-codeclaude-skillscodebase-analysiscodexcodex-skillsdeveloper-tools-ai-agentgemini-cli-skillskarpathy-llm-wikiknowledge-baseknowledge-graphmemoryopencode-skillspi-agentunderstandcodevibe-coding
fix: address code review — remove bin/ from defaults, fix negation override flow
Lum1104d3de6dc1fd2b
diff --git a/understand-anything-plugin/agents/project-scanner.md b/understand-anything-plugin/agents/project-scanner.mdindex 090c2812..2ccc2fec 100644--- a/understand-anything-plugin/agents/project-scanner.md+++ b/understand-anything-plugin/agents/project-scanner.md@@ -39,7 +39,7 @@ Discover all tracked files. In order of preference:Remove ALL files matching these patterns:- **Dependency directories:** paths containing `node_modules/`, `.git/`, `vendor/`, `venv/`, `.venv/`, `__pycache__/`-- **Build output:** paths with a directory segment matching `dist/`, `build/`, `out/`, `coverage/`, `.next/`, `.cache/`, `.turbo/`, `target/` (Rust), `bin/` (.NET), `obj/` (.NET) — match full directory segments only, not substrings (e.g., `buildSrc/` should NOT be excluded)+- **Build output:** paths with a directory segment matching `dist/`, `build/`, `out/`, `coverage/`, `.next/`, `.cache/`, `.turbo/`, `target/` (Rust), `obj/` (.NET) — match full directory segments only, not substrings (e.g., `buildSrc/` should NOT be excluded). Note: `bin/` is NOT excluded by default because Node.js and Ruby projects use `bin/` for CLI launchers; .NET users can add `bin/` to `.understandignore`.- **Lock files:** `*.lock`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`- **Binary/asset files:** `.png`, `.jpg`, `.jpeg`, `.gif`, `.svg`, `.ico`, `.woff`, `.woff2`, `.ttf`, `.eot`, `.mp3`, `.mp4`, `.pdf`, `.zip`, `.tar`, `.gz`- **Generated files:** `*.min.js`, `*.min.css`, `*.map`, `*.generated.*` (note: do NOT exclude `*.d.ts` — many projects have hand-written declaration files)@@ -60,16 +60,15 @@ Remove ALL files matching these patterns:**Step 2.5 -- User-Configured Filtering (.understandignore)**-After applying the hardcoded exclusion filters above, apply user-configured patterns from `.understandignore`:+When `.understandignore` files exist, **replace** Step 2's hardcoded filtering with a unified filter that combines defaults and user patterns in a single pass. This ensures `!` negation patterns can override defaults.1. Check if `$PROJECT_ROOT/.understand-anything/.understandignore` exists. If so, read it.2. Check if `$PROJECT_ROOT/.understandignore` exists. If so, read it.-3. Parse both files using `.gitignore` syntax (glob patterns, `#` comments, blank lines ignored, `!` prefix for negation, trailing `/` for directories, `**/` for recursive matching).-4. Filter the remaining file list through these patterns. Files matching any pattern are excluded.-5. `!` negation patterns override the hardcoded exclusions from Step 2 (e.g., `!dist/` force-includes files from dist/).-6. Track the count of files removed by this step as `filteredByIgnore`.+3. If neither file exists, skip this step entirely — Step 2's hardcoded filtering is sufficient.+4. If at least one file exists, re-filter the **original file list from Step 1** (not the Step 2 output) using the `createIgnoreFilter` function from `@understand-anything/core`, which merges hardcoded defaults and user patterns into a single `.gitignore`-compatible matcher. This ensures `!` negation in user files can override hardcoded defaults (e.g., `!dist/` force-includes dist/ files).+5. Track the count of additional files removed beyond Step 2's baseline as `filteredByIgnore`.-This filtering must be deterministic (not LLM-based). Use a Node.js script with the `ignore` npm package from `@understand-anything/core`, or apply the patterns manually if the file list is small.+This filtering must be deterministic (not LLM-based). Use a Node.js script with the `ignore` npm package from `@understand-anything/core`.**Step 3 -- Language Detection**diff --git a/understand-anything-plugin/packages/core/src/__tests__/ignore-filter.test.ts b/understand-anything-plugin/packages/core/src/__tests__/ignore-filter.test.tsindex 28c8c7e1..d7f96266 100644--- a/understand-anything-plugin/packages/core/src/__tests__/ignore-filter.test.ts+++ b/understand-anything-plugin/packages/core/src/__tests__/ignore-filter.test.ts@@ -26,11 +26,14 @@ describe("IgnoreFilter", () => {expect(DEFAULT_IGNORE_PATTERNS).toContain(".git/");});- it("contains bin and obj for .NET", () => {- expect(DEFAULT_IGNORE_PATTERNS).toContain("bin/");+ it("contains obj for .NET", () => {expect(DEFAULT_IGNORE_PATTERNS).toContain("obj/");});+ it("does not contain bin (used by Node/Ruby CLI launchers)", () => {+ expect(DEFAULT_IGNORE_PATTERNS).not.toContain("bin/");+ });+it("contains build output directories", () => {expect(DEFAULT_IGNORE_PATTERNS).toContain("dist/");expect(DEFAULT_IGNORE_PATTERNS).toContain("build/");@@ -45,7 +48,6 @@ describe("IgnoreFilter", () => {expect(filter.isIgnored("node_modules/foo/bar.js")).toBe(true);expect(filter.isIgnored("dist/index.js")).toBe(true);expect(filter.isIgnored(".git/config")).toBe(true);- expect(filter.isIgnored("bin/Debug/app.dll")).toBe(true);expect(filter.isIgnored("obj/Release/net8.0/app.dll")).toBe(true);});diff --git a/understand-anything-plugin/packages/core/src/ignore-filter.ts b/understand-anything-plugin/packages/core/src/ignore-filter.tsindex 88a65b9e..a56d2e3f 100644--- a/understand-anything-plugin/packages/core/src/ignore-filter.ts+++ b/understand-anything-plugin/packages/core/src/ignore-filter.ts@@ -24,7 +24,6 @@ export const DEFAULT_IGNORE_PATTERNS: string[] = [".cache/",".turbo/","target/",- "bin/","obj/",// Lock files