Dashboard › craft › Distillation
aec64e6b-c03e-4e73-aac7-9e49b6e21bc9["lore_tm_v1_X7T2B7cwsSMDIf__JXYQcBvbbVInpYpcULBft_ETIpc","lore_tm_v1_5kk_ImMm2Z5vAL4RDKRcKbkdTXDX65KtZGvmWjlQkEo","lore_tm_v1_yavo5XwMprAKmVMAWWHXdFFNNUodFGwckTcOPcBRQaY","lore_tm_v1_2xHxq4db_uvaF8oLCTdJ4uJz6t2SaeQhpJY9UyT6Ka0"]
Date: Sep 8, 2026
packages/cli/test/lib/scan/walker.test.ts:1-878: Vitest unit suite creates isolated tmpdir() sandboxes and compares sorted yielded WalkEntry.relativePath sets. It verifies basic traversal of all depths; nonexistent cwd and empty directories yield []; relative cwd: "./relative" throws an error matching /absolute/.walker.test.ts:98-197: Walker filtering tests establish that extensions: new Set([".ts", ".js"]) yields only matching suffixes; alwaysSkipDirs: ["node_modules"] removes matching subtrees at any nesting; hidden: false skips dotfiles/dotdirs while default hidden: true yields dotfiles; and maxFileSize: 1000 skips a 2,000-byte file. maxDepth: 2 enters cwd (0), src (1), and deep (2), yielding files within entered directories through depth 3 but not descendants of unentered depth-3 directories.walker.test.ts:199-243,574-628: Default respectGitignore: true honors root .gitignore patterns; respectGitignore: false does not apply root rules, so ignored files yield. Nested .gitignore rules are cumulative and child negations can unignore parent-ignored files; nested rules affect only their subtree and sibling trees lacking .gitignore are unaffected. nestedGitignore: false prevents reading nested .gitignore files, so otherwise ignored nested files yield.walker.test.ts:246-312: Known text extensions (.ts, .json) produce isBinary: false without opening files. An unknown-extension blob.bin containing a NUL byte is binary by default. classifyBinary: false skips the 8-KB head read entirely and still yields the NUL-containing blob with isBinary: false.walker.test.ts:315-435: Default recordMtimes: false emits mtime = 0; recordMtimes: true emits nonzero mtime. With timeBudgetMs: 0, files through minDepth still yield despite an advancing injected clock, while descent beyond it stops. Aborting after 2 yields causes the next iterator advance to throw DOMException named "AbortError".walker.test.ts:438-571: Default depth is linearβpackages/foo/src/deep/a.ts has depth 5. A custom descentHook resetting at packages/<package> makes that file depth 3 and root.ts depth 1; maxDepth is applied to this post-hook depth, allowing files within directories entered at capped depth. onDirectoryVisit fires once per actually visited directory with an integer positive floored mtime; without the hook, the normal walker uses no hook code path/extra directory stat.walker.test.ts:631-713: Default followSymlinks: false skips both file and directory symlinks. With followSymlinks: true, symlinked files yield, symlinked directories are followed unless their target inode was already claimed, circular links are bounded by inode detection, broken symlinks are silently skipped, and the scan root inode is seeded so a sub/root-link -> cwd does not relist the tree.walker.test.ts:716-821: Parallel walkFiles({ concurrency: 4 }) must yield the same sorted file set as serial concurrency: 1, honor root and nested .gitignore rules across concurrent descents, honor a depth-resetting descentHook, and reject with an abort error when signaled mid-walk.checkAborted threw outside the worker try/catch, so producerError was never set and the consumer parked on consumerAwake forever. Regression test races a pre-aborted walkFiles({ cwd, concurrency: 4, signal }) against a 2,000-ms watchdog; fixed behavior propagates the abort in approximately 10 ms.concurrency: NaN passed through Math.max(1, NaN) = NaN; dispatch selected the parallel walker, its i < NaN worker loop spawned zero workers, and the consumer remained parked on consumerAwake forever. normalizeConcurrency now clamps every non-finite or sub-1 value to the default; regression coverage tests Number.NaN, Number.POSITIVE_INFINITY, -1, 0, and 0.5, each yielding ["a.ts", "b/c.ts"].packages/cli/test/lib/scan/glob.test.ts:1-263: collectGlob uses picomatch semantics: slashless *.ts matches basename anywhere; src/*.ts matches only direct children of src; **/*.ts matches all depths; brace grammar *.{ts,js} works; multiple patterns and multiple excludes have OR semantics; empty pattern arrays and no matches return []; exclude suppresses matches; maxResults: 3 caps output and sets truncated: true; path: "src" narrows traversal but returned paths remain relative to cwd; root .gitignore is respected by default; and hidden: false excludes .env.packages/cli/test/lib/scan/ignore.test.ts:1-205: IgnoreStack.create() loads root .gitignore; supports file patterns and dir-only patterns (build/ ignores build only when checked as a directory); alwaysSkipDirs uses basename-anywhere matching, including packages/foo/node_modules; nested .gitignore layers root-to-leaf, child negations override parent patterns, and absent nested files are no-ops while loading cwd is idempotent. Optional includeGitInfoExclude: true reads .git/info/exclude; false does not. isIgnored() throws on absolute paths and never ignores empty string or ".".packages/cli/test/lib/scan/walker.property.test.ts:1-132: fast-check property tests generate 0β20 ASCII-alphanumeric/underscore .ts paths of 1β5 segments, with runs Math.min(DEFAULT_NUM_RUNS, 20). Invariant 1: walkFiles({ cwd, maxDepth }) never yields entry.depth > maxDepth + 1, because maxDepth caps directory descent and files inside the last-entered directory remain eligible. Invariant 2: with an advancing clock and timeBudgetMs: 0, every generated file whose depth is <= minDepth still yields.