docs(docs): R0 owner decisions, A1-A15 table, R3 SQL checkpoint proposal

This commit is contained in:
bchanot committed 2026-11-09 16:27:46 +01:00
1 parent 95009069ca
commit 84aba41b7d
5 files changed
+196 -32

No files matched your search

+23 -11
View File
@@ -1,6 +1,9 @@
# Dedicated manual trial stack: technical plan
Status: PROPOSAL, 2026-11-09 (owner brief « V1-2.6 UX — Arbitrages du premier essai propriétaire », §5). Plan
Status: PROPOSAL, 2026-11-09 (owner brief « V1-2.6 UX — Arbitrages du premier essai propriétaire », §5), with the
decisions of the brief « R0 — Décisions propriétaire et dernière validation graphique » (2026-11-09, BDR-108): name
`pnpm db:trial`, two trial accounts, `db:sandbox trial*` kept for now, isolation from the suites, volumes preserved,
resources capped, secrets renewable. Plan
only: no stack is created, started, reset or removed, no script changes, existing data untouched. Implementation
needs its own owner authorisation. Companion of `V1-2-6_U1_CORRECTIONS.md`.
@@ -61,7 +64,10 @@ gateway does (:422-423).
never argv. Generated once at creation; `start` never regenerates them (the database keeps the role passwords set at
its first initialisation). Keys valid one year instead of 30 days, with a `rotate-keys` command that re-signs both
keys with the same secret and restarts the services: a persistent stack with the sandbox's 30-day keys would lock
itself out after a month. Since every secret differs from the sandbox's, a suite that reached a trial port by mistake
itself out after a month. Full renewal (owner 2026-11-09) is `rotate-secrets`: a new JWT secret and new keys, new role
passwords set in the database (`alter role … password`, values through psql variables, never argv), env files
rewritten (600), services restarted in order, the previous secrets file kept as `secrets.prev.sh` (600) until the
stack answers; account passwords are untouched. Both commands print no secret. Since every secret differs from the sandbox's, a suite that reached a trial port by mistake
would be refused by GoTrue, PostgREST and Postgres instead of writing.
### 3.4 Persistence and lifecycle
@@ -83,10 +89,16 @@ would be refused by GoTrue, PostgREST and Postgres instead of writing.
- Migrations of the branch, then `equine_draft.sql` only. Not `seed.sql`: its three accounts carry the public DEV
password (`seed.sql:5`).
- Trial accounts: `account <email>` creates a confirmed account through GoTrue's admin API, password at a hidden
prompt (12 characters minimum), as `cmd_trial_account` does (`db-sandbox.sh:457-472`); `grant <email> <right>` as
`cmd_trial_grant` (:476-496), plus the platform role `owner` if the owner wants the rights screen (arbitration A13).
Administration then asks for a TOTP factor, enrolled in Mon compte.
- Trial accounts (owner 2026-11-09: two distinct accounts): `account <email>` creates a confirmed account through
GoTrue's admin API, password at a hidden prompt (12 characters minimum), as `cmd_trial_account` does
(`db-sandbox.sh:457-472`); `grant <email> <right>` as `cmd_trial_grant` (:476-496).
1. Owner/admin account, for the administration trials: platform roles `owner` and `admin`, catalogue rights
`sheet_editor`, `sheet_reviewer`, `sheet_publisher`.
2. Practitioner account, for the normal journey: `sheet_editor` only, no `owner`, no reviewer or publisher right.
Fact to weigh: today a `sheet_editor` right is active only for a platform admin (rule O1,
`supabase/migrations/20261028100000_sheet_access_hardening.sql:199`), so this account also needs the `admin`
role; without it, it can read the catalogue (`catalog_reader`) but not edit. Changing O1 is out of scope.
Editing and Administration require a TOTP factor (aal2, same file :321-341), enrolled in Mon compte by each account.
- The equine sheet: the seed gives the historical sheet its fixed id and `private.historical_sheet_id()` flags it
(`20261102100000_sheet_admin_reads.sql:56`); it is the only official sheet at creation.
- Its drawings: the existing tool `pnpm assets:upload supabase/seed/anatomical-sheets/equine/draft` (R5.5), through
@@ -113,7 +125,7 @@ sandbox up, about 2 GiB of 14.7 GiB. DEV shares no name, port, network, volume o
## 4. Commands (proposal, arbitration A11)
`pnpm db:trial create | start | stop | status | migrate | backup | rotate-keys | app | account <email> |
`pnpm db:trial create | start | stop | status | migrate | backup | rotate-keys | rotate-secrets | app | account <email> |
grant <email> <right> | assets | destroy`, in a new `scripts/db-trial.sh` built on the sandbox script's functions
(shared helpers extracted to one sourced file rather than copied).
@@ -131,8 +143,8 @@ they created; `shellcheck` on both scripts.
| # | Question | Recommendation |
|---|---|---|
| A11 | Command name, prefix, ports | `pnpm db:trial`, `faunosteo_trial_`, 58xxx and 5194 as in 3.2. |
| A12 | Fate of `pnpm db:sandbox trial`, `trial-account`, `trial-grant` | Removed once the trial stack is validated: one trial path. |
| A13 | Platform roles of the owner's trial account | `admin` with the catalogue rights, plus `owner` only if the rights screen is part of the trial. |
| A14 | Key lifetime | One year, with `rotate-keys`. |
| A11 | Command name, prefix, ports | `pnpm db:trial` (RATIFIED), `faunosteo_trial_`, 58xxx and 5194 as in 3.2 (open). |
| A12 | Fate of `pnpm db:sandbox trial`, `trial-account`, `trial-grant` | DECIDED: kept for now, neither removed nor silently redirected. |
| A13 | Trial accounts | DECIDED: two accounts (3.5). Open: confirm the practitioner account takes `admin` because of O1. |
| A14 | Key lifetime and renewal | Renewal DECIDED (`rotate-keys`, `rotate-secrets`); one-year lifetime open. |
| A15 | Backup before every `migrate` | Automatic, kept in the state folder, never pruned without the owner. |