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:
@@ -64,6 +64,14 @@ func UpdateNote(brainDir string, opts UpdateNoteOptions) (relPath, contentHash,
|
||||
return "", "", "", fmt.Errorf("content is required")
|
||||
}
|
||||
|
||||
// Same reason as WriteNote: the strip belongs in the primitive so every
|
||||
// door inherits it.
|
||||
clean, _, err := brain.StripUnresolvedLinks(brainDir, opts.Content)
|
||||
if err != nil {
|
||||
return "", "", "", err
|
||||
}
|
||||
opts.Content = clean
|
||||
|
||||
var rel string
|
||||
if opts.Path != "" {
|
||||
rel = opts.Path
|
||||
|
||||
Reference in New Issue
Block a user