Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project are documented in this file.

## [Unreleased]

### Fixed

- **M83 Windows validate**:`walkFiles` 返回绝对路径,测试用 `root + "/"` 剥前缀在 Windows 上匹配失败(收到 `C:\\...\\src\\app.ts`)。改为 `normalizePath(relative(root, absPath))`,与 `walkScannableFiles` 一致。

## [1.18.3] - 2026-09-13

### Performance
Expand Down
14 changes: 10 additions & 4 deletions tests/m83-index-scan-budget.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execFileSync } from "node:child_process";
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { join, relative } from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import {
buildBatchReferenceEdges,
Expand All @@ -10,6 +10,7 @@ import {
} from "../src/graph/file-indexer-edges";
import {
isGeneratedOrLockFile,
normalizePath,
walkFiles,
walkScannableFiles,
} from "../src/graph/file-indexer-walker";
Expand All @@ -33,6 +34,11 @@ function makeTempDir(prefix: string): string {
return dir;
}

/** walkFiles returns absolute paths; compare repo-relative POSIX like walkScannableFiles. */
function repoRel(root: string, absPath: string): string {
return normalizePath(relative(root, absPath));
}

afterEach(() => {
for (const dir of tempRoots.splice(0)) {
try {
Expand Down Expand Up @@ -146,7 +152,7 @@ describe("M83 walker skip rules", () => {
writeFileSync(join(root, "package-lock.json"), "{}\n");
writeFileSync(join(root, "app.min.js"), "var a=1;\n");

const found = walkFiles(root, [".ts", ".js", ".json"]).map((p) => p.replace(root + "/", ""));
const found = walkFiles(root, [".ts", ".js", ".json"]).map((p) => repoRel(root, p));

expect(found).toEqual(["src/app.ts"]);
});
Expand All @@ -165,11 +171,11 @@ describe("M83 walker skip rules", () => {
writeFileSync(join(root, "src", "secrets.local.ts"), "export const s = 1;\n");
writeFileSync(join(root, "generated", "client.ts"), "export const c = 1;\n");

const respected = walkFiles(root, [".ts"]).map((p) => p.replace(root + "/", ""));
const respected = walkFiles(root, [".ts"]).map((p) => repoRel(root, p));
expect(respected).toEqual(["src/app.ts"]);

const disabled = walkFiles(root, [".ts"], { respectGitIgnore: false })
.map((p) => p.replace(root + "/", ""))
.map((p) => repoRel(root, p))
.sort();
expect(disabled).toEqual(["generated/client.ts", "src/app.ts", "src/secrets.local.ts"]);

Expand Down