feat(ks): a Rose project for every K&S matter, kept in sync

↗ view on GitHub · Peter Dombkins · 2026-07-31 · da4f4775

ks.matter_projects maps matter -> project, many-to-many because NexaCare is
worked by all six groups and already has six per-group Rose projects holding
real student work. Triggers on ks.matters (insert/rename/delete) and
ks.matter_groups keep projects and project_group_grants aligned.

Access needs nothing new: project_group_grants already gives a user_group
'editor' on a project and groupAccess.ts resolves it by email, so a student
reaches exactly the projects for the matters they are on.

group_id pins a project to its group. The first version of the grant query
cross-joined every mapped project with every group on the matter, which gave
all six groups access to each other's NexaCare workspace - caught in
verification and fixed before it reached anyone.

Deleting a matter deletes only auto_created projects; the six pre-existing
NexaCare projects are mapped auto_created=false so no trigger can discard the
cohort's chats and tabular reviews.

Verified live: create -> project + one correct grant; rename -> project
renamed; delete -> project and grants gone, no residue.
Repository pdombkins/rose_lawyer
Author Peter Dombkins <pdombkins@gmail.com>
Authored
Parents c42049e3
Stats 1 file changed , +244
Part of K&S matter-management integration: embed and sync

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-da4f4775.md from inside the repo you want the change in.

⬇ Download capture-commit-da4f4775.md