Problem
The schema allows isAnonymous: true together with authorHandle; the handle is stored and rowToPost returns it without checking isAnonymous (only UI cards mask it). Direct API callers can store and read a handle on an "anonymous" case.
Where
app/api/posts/route.ts + lib/db/posts.ts (rowToPost) vs UI masking.
Acceptance
Add a failing test first submitting isAnonymous: true with a handle, expecting the write to strip it or the read to omit it. Then fix.
Problem
The schema allows
isAnonymous: truetogether withauthorHandle; the handle is stored androwToPostreturns it without checkingisAnonymous(only UI cards mask it). Direct API callers can store and read a handle on an "anonymous" case.Where
app/api/posts/route.ts+lib/db/posts.ts(rowToPost) vs UI masking.Acceptance
Add a failing test first submitting
isAnonymous: truewith a handle, expecting the write to strip it or the read to omit it. Then fix.