mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-27 22:15:33 +00:00
fix(sources): audit walker inverted pruneDir — nested sources scanned 0 files (#2678)
The audit walk in `gbrain sources audit` used `if (pruneDir(entry, dir)) continue;` but pruneDir() returns true = descend, false = prune (core/sync.ts). The inversion made the walker skip every legitimate subdirectory (any source with nested content reports 'Files scanned: 0 markdown files') while descending into exactly the trees it should skip (node_modules/, .git/, vendor/, .raw/). The walker's own comment says 'Mirror gbrain sync's descent rules' — this makes it actually do so. Repro on a real brain (v0.42.56/57): a comms source with per-contact subdirectories audits 0 files; a flat source audits correctly. Co-authored-by: Idrees Kamal <idreeskamal@MacBook-Air.local> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Idrees Kamal
Claude Fable 5
parent
c4ff8b63a8
commit
ad1fe25e61
@@ -1147,7 +1147,8 @@ async function runAudit(engine: BrainEngine, args: string[]): Promise<void> {
|
||||
continue;
|
||||
}
|
||||
if (stat.isDirectory()) {
|
||||
if (pruneDir(entry, dir)) continue;
|
||||
// pruneDir returns true = descend, false = prune (see core/sync.ts).
|
||||
if (!pruneDir(entry, dir)) continue;
|
||||
walk(full);
|
||||
} else if (entry.endsWith('.md')) {
|
||||
files.push(full);
|
||||
|
||||
Reference in New Issue
Block a user