os.Root follows an intermediate directory symlink that stays inside the brain. A dir symlink inside wiki/ pointing elsewhere in the brain let brain_update and brain_tunnel rewrite an existing .md there (e.g. under raw/), and session_log followed a symlinked sessions dir. - WriteRegular, ReadRegular and ReadRegularMax require every directory above the file to be a real directory (realDir). Reads too: brain_tunnel read the redirected target, then rewrote the source before the target's write was refused; and brain_read/brain_get could read another part of the brain through such a path. - session.Append refuses a sessions dir that is not a real directory. - A directory swapped in after the check remains the #167 residual. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>