Skip to content

ARIA: filter newsletter senders from active-threads prompt section#349

Open
holoduke wants to merge 1 commit into
mainfrom
aria/filter-newsletter-active-threads
Open

ARIA: filter newsletter senders from active-threads prompt section#349
holoduke wants to merge 1 commit into
mainfrom
aria/filter-newsletter-active-threads

Conversation

@holoduke
Copy link
Copy Markdown
Owner

Summary

  • The drift audit on 2026-05-20 flagged that the Active threads section of the working-memory prompt was being polluted by promotional/automated streams. Tonight's snapshot showed one active thread — and it was the AutoScout24 saved-search newsletter. Real signal-to-noise: 0%.
  • This change filters newsletter/automation senders out of Active threads: both at write time (so they never get promoted to thread status in the first place) and at render time (defense in depth, also sweeps any senders that slipped in during prior ticks).

Changes

  • backend/memory/working-memory.ts
    • New isNewsletterParticipant() helper, exported for reuse.
    • updateConversationThreads() skips creating a new thread when sender/chatName/chatJid matches the newsletter pattern.
    • Sweep pass each tick removes any pre-existing newsletter threads (catches the currently-stuck AutoScout24 entry).
  • backend/brain-prompt.ts
    • formatWorkingMemory() filters active threads through isNewsletterParticipant() before rendering.

Patterns matched

Substrings: noreply, no-reply, notifications., newsletter, savedsearches, mailings., updates@, bounce.
One-way domains: autoscout24, schoolkassa, rdw, anwb.nl/notifications.

Test plan

  • npx tsc --noEmit passes
  • After deploy, next reflect tick: AutoScout24 thread no longer appears under Active threads: in the brain prompt
  • Real DM threads (Gillis ↔ Ilse, family group, etc.) still appear normally

🤖 Generated with Claude Code

Drift audit 2026-05-20 flagged that the "Active threads" section of the
working-memory prompt was being polluted by promotional/automated streams
(currently the AutoScout24 "Nieuwe matches voor je Zoekopdracht" newsletter
was the *only* active thread shown). Real signal-to-noise on that section
had dropped to 0%.

Defense in depth:
- working-memory.ts: introduce isNewsletterParticipant() and reject new
  threads whose sender/chat matches noreply / no-reply / notifications. /
  newsletter / savedsearches / mailings. / updates@ / bounce, or known
  one-way notification domains (autoscout24, schoolkassa, rdw, anwb
  notifications). Also sweep any pre-existing newsletter threads on every
  update tick — fixes the currently-stuck AutoScout24 entry.
- brain-prompt.ts: filter active threads at render time using the same
  helper, so even if a newsletter slips past the write-time guard via
  another path, the prompt stays clean.

Intent-summary: Newsletter and automation senders were being promoted to "active conversation threads" in the working-memory prompt, crowding out real conversations Gillis is in.
Intent-tokens: newsletter, noise, active-threads, prompt-pollution, working-memory, automation-sender, filter

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant