chore(memory): BDR-112 db:trial one-factor owner grant, contract and plan

This commit is contained in:
bchanot committed 2026-11-11 22:37:57 +01:00
1 parent 45d74536f5
commit 3189a1917d
4 files changed
+113

No files matched your search

+8
View File
@@ -910,3 +910,11 @@ Owner brief « R0 — Autorisation des trois dernières corrections graphiques
**Why coherent**: trial GoTrue SITE_URL / API_EXTERNAL_URL / redirect allowlist already = http://192.168.1.100:5194 (set at create and rotation from trial_host); a 127.0.0.1 app origin mismatches GoTrue links.
**Trade-off**: app proxies signed-in sessions to the trial gateway; reachable by every device of the private network. Firewall not changed (ENVIRONMENTS.md §3 owner action). Playwright LAN tests still gated by arbitration 2 (environment check before any LAN test): this decision covers manual use of the app only.
**Apply**: every later trial session starts the app on 192.168.1.100 unless owner says otherwise; same for `pnpm dev` (already LAN by scripts/dev-env.sh).
## BDR-112 — db:trial owner grant needs one verified TOTP factor (narrows BDR-083 to non-trial stacks) (2026-11-11)
**Decision** (owner 2026-11-11 « Modification de la règle MFA »): db:trial stack only, one verified TOTP factor suffices for owner grant, as for admin and practitioner; second factor optional backup.
**Narrows** BDR-083 Shape "first owner: enrol 2 factors first, role assigned last by operator" → db:trial carve-out only. Every other stack (production included), V1-2 §5.6/§5.7.1/§5.7.7 procedure text, IDENTITY.md recommendation: unchanged until distinct study + owner authorisation.
**Kept**: verified TOTP before owner/admin (count before typed confirmation + recount `>= :need` inside grant tx, `\gset` zero rows → rollback); catalogue rights need has_verified_totp (+ admin for editor/publisher); aal2 in RPCs/policies; SQL untouched; no bypass.
**Where**: scripts/db-trial.sh grant_platform_role `local need=1` (owner branch need=2 dropped), harness 375/0 (0 factors refused, 1 granted, 2 granted, tx recount 0 refused); SUPABASE.md §5.2; V1-2 §5.7.1 step 2 dated note + §5.6 pointer. Commit 45d7453; contract .claude/tasks/contracts/2026-11-11-trial-owner-one-factor-2050.md; verifier CONFORME 7/7, security PASS, 3-lens challenge folded.
**Alternatives**: keep 2 for owner (rejected by owner: trial friction); change SQL/production rule (forbidden without study).
**Trade-off**: one-factor owner losing device → no second path; recovery = V1-2 §5.7.7 by hand at trial db, or new account via `grant` (SUPABASE.md §5.2).
+1
View File
@@ -549,3 +549,4 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
- db:trial closure: code review + 2 fresh re-reviews fixed (d3bdbbe f2cbf68 953ae41). Strict absent match broke on real docker: inspect -f prints '\n' on stdout before stderr error; fresh re-review caught it, stub now splits streams. GATE 0 MET, harness 372/0, plan read-only: create would proceed. Stopped before create, owner go pending.
- db:trial first create 2026-11-11 at 255dd67 (owner go): 6 containers, net, 2 volumes as planned, loopback ports only, DEV and sandbox unchanged, 17 migrations, equine draft equal. Interrupted at check 3: TR_PW in db container log, image migrate.sh ALTER USER logged during init. LRN-123..126 written. Owner decision pending.
- db:trial TR_PW leak 2026-11-11: owner-ordered one-off rotation (5 roles, auth/storage/rest recreated, old pw refused, services ok, DEV/sandbox unchanged); fix 5f63d22 -c log_statement=none on server cmdline (harness 373/0, control 372/1, verifier CONFORME, security PASS); LRN-127. Real proof pending: create on fresh volume.
- db:trial MFA rule 2026-11-11 (owner): owner grant with 1 verified TOTP on trial only (45d7453, harness 375/0, verifier CONFORME, security PASS), BDR-112 narrows BDR-083; production rule unchanged. App on LAN 192.168.1.100:5194 (BDR-111). Accounts owner@trial.local, praticien@trial.local created by owner, 1 verified factor each, no role yet.