2026-07-17 — XP-135 auth hot-path perf
What shipped
Section titled “What shipped”packages/auth/src/rbac.ts—resolvePermissionsfolded the loneusers.superuserawait into the existingPromise.all, so the three userId-keyed queries (user, perm rows, role rows) now fire as ONE parallel wave instead of 2 sequential waves. Hit on every authenticated request viawithWhoami.packages/service/src/roles/get-role.ts— two sequential selects (rolesthenrole_permissions) collapsed to a single RQBfindFirstwith therole_permissionsnested relation.
Key decisions
Section titled “Key decisions”- Behavior-preserving refactor, no new tests: identical output guarded by the existing rbac + roles integration suites (red-green TDD is for new behavior, not roundtrip reductions).
!userguard relocated to after the parallel wave; perm/role queries now also fire for a non-existent user, returning empty sets — accepted ceiling, the point is parallelism, error path unchanged.
Gotchas / lessons
Section titled “Gotchas / lessons”- The ticket text loosely called the RQB relation
permissions; the real relation name isrole_permissions(packages/db/src/relations.ts:43). Integration suite against real Postgres is the only gate that catches a wrong relation name — it passed.
Reference changes
Section titled “Reference changes”None. No canonical doc (plans/ARCHITECTURE.md, plans/scope/*.md, .claude/rules/*.md) changed.