Follow-up from PR #60 (review finding M5).
Coverage of provision_workspace_membership() currently rests on a single manual happy-path check at apply time. Write a scripted / documented 6-scenario verification checklist. The two branches most likely to be missed by a click-through:
- UPDATE-after-INSERT firing — the real auth-gateway path (
company_id set in a 2nd step, not at insert).
is_default guard — user who already holds a default elsewhere must not get a 2nd default (partial-unique-index guard).
Other scenarios: fresh insert with company_id present; company_id set to a company with no hal workspace (expect RAISE WARNING, no row, no abort — M3); idempotent re-run (membership already exists, silent); routine last_sign_in_at update (trigger must NOT fire).
Priority: P3.
Follow-up from PR #60 (review finding M5).
Coverage of
provision_workspace_membership()currently rests on a single manual happy-path check at apply time. Write a scripted / documented 6-scenario verification checklist. The two branches most likely to be missed by a click-through:company_idset in a 2nd step, not at insert).is_defaultguard — user who already holds a default elsewhere must not get a 2nd default (partial-unique-index guard).Other scenarios: fresh insert with company_id present; company_id set to a company with no hal workspace (expect
RAISE WARNING, no row, no abort — M3); idempotent re-run (membership already exists, silent); routinelast_sign_in_atupdate (trigger must NOT fire).Priority: P3.