Review of PR #133 found a serious bug: the file watcher's processDir
walks brain/raw/ with filepath.WalkDir (recurses by default) and only
skipped processed/ and failed/ by name. brain_reject moves a declined
note to raw/rejected/, which the watcher had no reason to know about --
so on its next tick (30s default), it picked the note back up, ran it
through the full LLM extraction pipeline, and published it into the
wiki. A human's explicit "not worth promoting" decision was silently
reversed by a background job 30 seconds later. Reproduced directly:
flip-testing the fix back out shows the watcher's own log line, "file
processed file=declined-file.md", proving this wasn't hypothetical.
Fixed by adding "rejected" to the same subdirectory skip-list
processed/failed already use. Checked the other two consumers of raw/
content for the same class of bug and found neither is affected:
graphsync.BackfillFromBrainDir only walks wiki/ and knowledge/; search's
resolveRoots only ever returns knowledge/ and wiki/. Neither touches
raw/ at all, rejected or not.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hyperguild#81. brain_pending lists brain/raw/ notes awaiting review;
brain_promote moves one into the wiki. There was no way to say "reviewed,
not worth promoting" — the only options were promote it or let it sit
forever. Live consequence, confirmed this session: the pending queue has
grown to 11 items, the oldest 152 days old, several of which are generic
web scrapes nobody is ever going to promote but nobody could clear either
except an un-audited rm bypassing the tool surface entirely.
RejectNote (internal/api/promote.go) mirrors PromoteNote's exact safety
shape: same basename-only filename validation, same write-then-delete
ordering (the source survives any write failure), same collision check
(never silently overwrite an existing rejected note under the same
name). Stamps rejected_at (+ reject_reason if given) into frontmatter,
moves brain/raw/<filename> -> brain/raw/rejected/<filename>. No index
rebuild or auto-tunnel -- a rejected note never entered the wiki, so
there's nothing to index. raw/rejected/ is a subdirectory ListPending's
non-recursive os.ReadDir never walks into, so a rejected note is never
re-surfaced as pending -- the human decision, once made, stays made.
brain_reject wired into the MCP tool list and dispatch, mirroring
brain_promote's schema shape (filename required, reason optional).
Human-invoked only, same as promote -- never called automatically.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>