brain_write created a new note with os.MkdirAll + os.WriteFile by path,
so a symlinked wing or hall directory redirected the note elsewhere in
the brain or outside it.
New brainfs primitives for creating writes:
- PutRegular: create or replace. Missing parents are created one
component at a time through the root and every existing component
must be a real directory; an existing file is replaced only via
WriteRegular's checks; a new one is created with O_EXCL and confirmed
(Lstat + SameFile) before writing.
- AppendRegular: create-or-append with the same parent rule, writing
only after confirming the path is the regular file it opened.
- RealParent: the clean-path + real-directory check, for writers that do
their own atomic rename.
writeHallNote now uses PutRegular.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>