PR L: persistent participant registry (plans_participants + API) #16
Reference in New Issue
Block a user
Delete Branch "devin/1776881508-pr-l-participants"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes gap-analysis v2 §4 + §10.9 (Participant Registry marked "missing").
What
plans_participants(plan_id, participant_id, role, lei, did, created_at)with compositeUNIQUE(plan_id, role, participant_id)and CHECK on the role vocabulary matchingtypes/plan.ts.add()/bulkAdd()/listForPlan()/listByRole()/remove(). The SoD layer resolves the authorised actor set for a transition by callinglistByRole().GET /api/plans/:planId/participantsPOST /api/plans/:planId/participants→ emitsparticipants.authorizedDELETE /api/plans/:planId/participants/:role/:participantIdWhy
The Participant Registry is one of the canonical data objects in arch §4 and the source of truth for segregation-of-duties decisions (arch §13). Until this PR participants lived only on the in-flight Plan object and were discarded on restart.
Verification
npx tsc --noEmitclean.npx jest87/87 green.Closes gap-analysis v2 §4 + §10.9. - Migration 005 adds plans_participants (plan_id, participant_id, role, lei, did, created_at) with a composite UNIQUE(plan_id, role, participant_id) and CHECK on role vocabulary matching types/plan.ts. - services/participants.ts: idempotent add() / bulkAdd() / listForPlan() / listByRole() / remove() — the SoD layer reads listByRole() to resolve the authorised actor set for a transition. - api/participants.ts + wiring in index.ts: GET /api/plans/:planId/participants POST /api/plans/:planId/participants -> participants.authorized DELETE /api/plans/:planId/participants/:role/:participantId - 7 unit tests against a Map-backed query stub; full suite 87/87 green.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.