You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #462 (#381) shipped the actor-identity substrate: users plus the role_assignments table — but the role table is schema-only. The query/REST/MCP layer was deliberately split out because src/db/index.ts sits against its 400-line ESLint cap; ADR-052 D7 records the measured rationale. Without this surface, roles cannot be granted or consulted, so the #382 consistency-review divert logic and the phased enforcement points (#381 round 4) have nothing to key on.
What
src/db/queries/role-assignments.ts: grant/revoke/list by scope (project_id | library_id XOR, per migration 045), barrel-exported (may require the planned src/db/index.ts split to stay under the line cap — do that here, not around it).
REST /role-assignments resource (create/delete/list, scope-filtered), Zod-validated, documented in openapi.yaml in the same PR.
MCP tools mirroring the REST surface, contract-mapped + tier-gated (write for grant/revoke, read for list) per ADR-044/045.
Why
PR #462 (#381) shipped the actor-identity substrate:
usersplus therole_assignmentstable — but the role table is schema-only. The query/REST/MCP layer was deliberately split out becausesrc/db/index.tssits against its 400-line ESLint cap; ADR-052 D7 records the measured rationale. Without this surface, roles cannot be granted or consulted, so the #382 consistency-review divert logic and the phased enforcement points (#381 round 4) have nothing to key on.What
src/db/queries/role-assignments.ts: grant/revoke/list by scope (project_id|library_idXOR, per migration 045), barrel-exported (may require the plannedsrc/db/index.tssplit to stay under the line cap — do that here, not around it)./role-assignmentsresource (create/delete/list, scope-filtered), Zod-validated, documented inopenapi.yamlin the same PR.writefor grant/revoke,readfor list) per ADR-044/045.src/lib/roles.ts:hasAtLeastRole(user, scope, role)resolution helper — the enforcement point that the edit gate and feat: consistency-review mode — enforced role-scoped spec lockout with per-user suggestion branches (git-like, ADR required) #382 will consult (viewer < editor < spec-editor < admin).Prior art
users+role_assignments, XOR CHECK scope FKs) — merged with PR feat(db,api,mcp): add users identity substrate — ADR-052 D6 (#381) #462.Acceptance
Sequenced after PR #462 merges. Blocks #382; feeds #380/#377 enforcement points.
🤖 Filed by Claude Fable 5 · #381 scope-split follow-up (ADR-052 D7)