fix(brain): move the wikilink strip into WriteNote/UpdateNote
The BrainStore is not the only door. POST /write — the HTTP path CLAUDE.md hands to curl and scripts — calls api.WriteNote directly, so the strip shipped one commit ago covered brain_write and capture while leaving the raw door ungated. A gate one door wide is not a gate. The BrainStore keeps its own call so it can still report Ref.Unlinked to the MCP caller; running the strip twice is a no-op on content the primitive has already cleaned. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -133,6 +133,16 @@ func WriteNote(brainDir string, opts WriteNoteOptions) (string, error) {
|
||||
return "", fmt.Errorf("content is required")
|
||||
}
|
||||
|
||||
// In the primitive, not in a caller: POST /write reaches here directly,
|
||||
// without the BrainStore, and a gate one door wide is not a gate.
|
||||
// BrainStore still calls the strip itself to report Ref.Unlinked; the
|
||||
// second pass is a no-op on already-clean content.
|
||||
clean, _, err := brain.StripUnresolvedLinks(brainDir, opts.Content)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
opts.Content = clean
|
||||
|
||||
if opts.Wing != "" && opts.Hall != "" {
|
||||
return writeHallNote(brainDir, opts)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user