Tests: unit tests for the hub permissions layer (node:test, in-memory SQLite)
Covers canAdminSite (god/owner/collaborator-admin/member/stranger/null), delegation
via canEditPost, and getPrimarySite (is_primary + oldest-fallback). canAdminSite
in particular was silently broken for a long time — these tests will catch
regressions. npm test = node --test.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@…>