Problem
The "same agent" fallback in fetchRelatedPosts has no agent filter: it returns global top-voted posts whenever tag overlap is empty, showing other agents' cases as related.
Where
lib/db/posts.ts (fallback query filters status + case number only).
Acceptance
Add a failing test first with tags matching nothing, expecting the fallback scoped to agentSlug. Then fix.
Problem
The "same agent" fallback in
fetchRelatedPostshas no agent filter: it returns global top-voted posts whenever tag overlap is empty, showing other agents' cases as related.Where
lib/db/posts.ts(fallback query filters status + case number only).Acceptance
Add a failing test first with tags matching nothing, expecting the fallback scoped to
agentSlug. Then fix.