Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/review/rag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const SKIP_FILE_RE =
const BINARY_EXT_RE =
/\.(png|jpe?g|gif|webp|avif|bmp|tiff?|heic|psd|svg|ico|pdf|zip|gz|tgz|tar|bz2|xz|zst|7z|rar|wasm|woff2?|otf|ttf|eot|mp4|mov|webm|mkv|mp3|wav|flac|ogg|opus|bin|exe|dll|so|dylib|node|class|jar|pyc|sqlite|db|parquet|onnx|gguf|safetensors|pt|pth|ckpt|npy|npz)$/i;
const CODE_EXT_RE =
/\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|kt|kts|rb|php|c|h|cc|cpp|hpp|cs|swift|scala|sh|bash|zsh|sql|graphql|proto|toml|yaml|yml|json|jsonc|css|scss|less|vue|svelte|astro|tf|hcl|dart|lua|ex|exs|clj|cljs|cljc|hs|jl|nim|zig|groovy)$/i;
/\.(ts|tsx|mts|cts|js|jsx|mjs|cjs|py|go|rs|java|kt|kts|rb|php|c|h|cc|cpp|hpp|cs|swift|scala|sh|bash|zsh|sql|graphql|proto|toml|yaml|yml|json|jsonc|css|scss|less|vue|svelte|astro|tf|hcl|dart|lua|ex|exs|clj|cljs|cljc|hs|jl|nim|zig|groovy)$/i;
// Doc extensions mirror the canonical DOCS_EXTENSIONS set in signals/path-matchers.ts
// (md, mdx, markdown, rst, adoc, asciidoc); the long-form `markdown`/`asciidoc`
// spellings were missing here, so e.g. NOTES.markdown / guide.asciidoc were
Expand Down
5 changes: 5 additions & 0 deletions test/unit/rag.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ describe("rag: code-not-content filtering (free-tier cost guard)", () => {
it("indexes source code + docs, skips content/data/deps/binaries", () => {
expect(classifyRepoFile("src/core/runtime.ts")).toBe("code");
expect(classifyRepoFile("scripts/build.mjs")).toBe("code");
// TypeScript module extensions (parity with signals/local-branch isCodeFile)
expect(classifyRepoFile("src/loader.mts")).toBe("code");
expect(classifyRepoFile("src/setup.cts")).toBe("code");
expect(filePriority("src/loader.mts")).toBe(0);
expect(isIndexablePath("src/setup.cts")).toBe(true);
// additional source languages (parity with the changed-file source classifiers)
for (const p of [
"lib/widget.dart",
Expand Down
Loading