fix(claudewatcher): tag session-dump notes source_type: internal
CI / Lint / Test / Vet (push) Successful in 12s
CI / Mirror to GitHub (push) Successful in 3s

brain-gardener#5: the audit's unsourced check was flagging 59 raw
claudewatcher session dumps as high-severity hallucination risk,
because it can't distinguish a first-party observation (a session
transcript) from an external claim needing citation.

Adds WriteNoteOptions.SourceType, emitted as source_type: <value> in
the wing/hall frontmatter route. claudeSink (the claudewatcher sink)
now always sets source_type: internal on the notes it writes.
This commit is contained in:
2026-07-04 13:53:08 +02:00
parent 0785f14220
commit 6d58336ce2
4 changed files with 95 additions and 13 deletions
+7 -6
View File
@@ -68,12 +68,13 @@ func (s *claudeSink) Ingest(ctx context.Context, b claudewatcher.Batch) error {
}
slug := "session-" + b.Host + "-" + b.SessionID
if _, err := api.WriteNote(s.brainDir, api.WriteNoteOptions{
Filename: slug,
Wing: "claude-sessions",
Hall: "facts",
Type: "source",
Domain: b.ProjectID,
Content: sb.String(),
Filename: slug,
Wing: "claude-sessions",
Hall: "facts",
Type: "source",
Domain: b.ProjectID,
Content: sb.String(),
SourceType: "internal", // raw session transcript, not an external claim (brain-gardener#5)
}); err != nil {
return fmt.Errorf("write claude session note: %w", err)
}