Sync walked wiki/ and knowledge/ with filepath.WalkDir and read each .md
with os.ReadFile. A symlinked note (Syncthing syncs symlinks) had its
target embedded into pgvector and served by semantic search; a FIFO
stalled the sync. The walk and read now go through brainfs: regular
files only, type checked on the opened handle.
- Chunks already embedded from a symlinked note are deleted on the next
sync, because the note is no longer seen.
- A walk error still aborts Sync before the delete pass, so an unreadable
subdir does not delete chunks of files that exist. A missing scan dir
is skipped as before.
- brainfs gains Lstat, used for the mtime staleness check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
readExcerpt, ReadNote and ReadScoped now read through brainfs (os.Root, regular files only, type checked on the opened handle), so a symlink swapped in after a check is not followed and a FIFO does not hang the reader. ReadRegularMax bounds the read itself with io.LimitReader(max+1). notes.Target carries the brain root.
Refs #157. Adversarial review round 2: PASS (round 1 BLOCKED: unbounded read, rule-9 test names).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Mathias <mthbqv@gmail.com>