feat(api): brain_promote and brain_reject act on notes parked in raw/needs-review/ (#208)

brain_pending lists a parked note under its bare filename, but promote/reject
only read raw/<name>, so the documented approval path did not exist. They now
fall back to raw/needs-review/ (top level wins on a name clash; a symlinked
directory is refused) and promote drops the resolver's proposal keys.
Mutation-checked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 20:14:47 +02:00
co-authored by Claude Sonnet 5.5
parent 750dc93bdb
commit 409b85096b
3 changed files with 120 additions and 10 deletions
+12
View File
@@ -83,6 +83,18 @@ func (f *frontmatter) get(key string) string {
return ""
}
// drop removes every `key: value` line for key (nothing else), so a
// machine-written key does not travel with a note into the wiki.
func (f *frontmatter) drop(key string) {
kept := f.lines[:0]
for _, l := range f.lines {
if l.key != key {
kept = append(kept, l)
}
}
f.lines = kept
}
// set overrides the value for an existing key in place, or appends a new
// `key: value` line when the key is absent.
func (f *frontmatter) set(key, value string) {