brain_write loses the learning when any subdirectory under knowledge/ or wiki/ is unreadable #178

Closed
opened 2026-10-05 05:21:20 +00:00 by mathias · 0 comments
Owner

Source: PR #175 review rounds 1–2, 2026-10-05. This was already true on main; it is not a regression.

brain.StripUnresolvedLinks runs before every brain_write and brain_update (brainstore.Write/Update, api.WriteNote/UpdateNote). It builds its index by walking knowledge/ and wiki/, and any walk error below the root aborts it. The write then returns an error before anything reaches disk. So a single unreadable subdirectory (for example a permission change by a sync peer) refuses every learning the agents try to write, and the function's own doc says a refused write is a lost learning.

PR #175 made a linked-tree root that isn't a real directory get skipped with a warning. Below-root errors still abort, and nothing pins that either way (the reviewer's "skip any walk error" flip stays green).

Options

  • Skip unreadable subtrees with a warning, and resolve links against what is readable. The cost: a link into the unreadable part would be unwrapped wrongly.
  • Keep aborting the link strip, but still write the note with its links untouched, so the learning is kept and the link check is skipped.

The second keeps the "never invent a resolution" property and doesn't lose the write. I recommend it.

Related, also not pinned: BuildAllWingIndexes stops at the first failing wing.


Created via git-mcp on behalf of @mathias

**Source:** PR #175 review rounds 1–2, 2026-10-05. This was already true on main; it is not a regression. `brain.StripUnresolvedLinks` runs before every brain_write and brain_update (`brainstore.Write`/`Update`, `api.WriteNote`/`UpdateNote`). It builds its index by walking `knowledge/` and `wiki/`, and **any walk error below the root aborts it**. The write then returns an error before anything reaches disk. So a single unreadable subdirectory (for example a permission change by a sync peer) refuses every learning the agents try to write, and the function's own doc says a refused write is a lost learning. PR #175 made a linked-tree root that isn't a real directory get skipped with a warning. Below-root errors still abort, and nothing pins that either way (the reviewer's "skip any walk error" flip stays green). ## Options - Skip unreadable subtrees with a warning, and resolve links against what *is* readable. The cost: a link into the unreadable part would be unwrapped wrongly. - Keep aborting the link strip, but still write the note with its links untouched, so the learning is kept and the link check is skipped. The second keeps the "never invent a resolution" property and doesn't lose the write. I recommend it. Related, also not pinned: `BuildAllWingIndexes` stops at the first failing wing. --- _Created via git-mcp on behalf of @mathias_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/hyperguild#178