docs(docs): V1-1.6 as built, D11 drawer only, closure inventory, DEV steps

Contract §11.8 and §15; D11 and U3 decided, D12 open; SUPABASE.md §3.3 gains
the rehearsed restore check and the owner's browser acceptance on DEV; browser,
test and frontend docs, design README, CLAUDE.md map.
This commit is contained in:
bchanot committed 2026-10-26 17:24:19 +01:00
1 parent 3e968eeeab
commit e215e9b2cb
7 files changed
+201 -28

No files matched your search

+57 -9
View File
@@ -242,6 +242,19 @@ docker exec supabase_db_faunosteo sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" pg_dump
docker exec -i supabase_db_faunosteo pg_restore --list < ~/faunosteo-backups/dev-before-v1-1.dump \
| grep -E "TABLE DATA (auth users|public profiles|supabase_migrations schema_migrations)" # three lines expected
# 3b. The dump restores: into a scratch database of the same server, counts compared, then dropped.
# The scratch name is the only database created or dropped here; never type another one.
docker exec supabase_db_faunosteo sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" createdb -h 127.0.0.1 -U postgres restore_check_v1_1'
docker exec -i supabase_db_faunosteo sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" pg_restore -h 127.0.0.1 -U postgres \
-d restore_check_v1_1 --no-owner' < ~/faunosteo-backups/dev-before-v1-1.dump 2> ~/faunosteo-backups/restore-check.log
grep -c "error:" ~/faunosteo-backups/restore-check.log # only privilege errors on Supabase-managed objects (see below)
for db in postgres restore_check_v1_1; do
docker exec supabase_db_faunosteo sh -c "PGPASSWORD=\"\$POSTGRES_PASSWORD\" psql -h 127.0.0.1 -U postgres -d $db -t -A -c \
\"select '$db: ' || (select count(*) from auth.users) || ' users, ' || (select count(*) from public.profiles)
|| ' profiles, ' || (select count(*) from supabase_migrations.schema_migrations) || ' migrations'\""
done # the two lines must give the same counts
docker exec supabase_db_faunosteo sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" dropdb -h 127.0.0.1 -U postgres restore_check_v1_1'
# 4. Apply without reset (M1's backfill runs inside the migration). `migration up` applies every
# pending migration of the checkout, in order (a shorter path: run it from the checkouts named in step 1).
pnpm supabase migration up --local # "Applying migration 20261025100000_workspaces.sql", then
@@ -262,19 +275,28 @@ docker exec supabase_db_faunosteo sh -c 'PGPASSWORD="$POSTGRES_PASSWORD" psql -h
|| (select count(*) from public.animals) || '"'"' animals'"'"'"'
# expected: N profiles, N workspaces, N members, 0 profiles without exactly one workspace,
# 10 active species, 0 animals
pnpm db:test # pgTAP 001-014 (grants, policies, reads); every file runs in
# begin ... rollback: rows unchanged (checked on the sandbox)
pnpm db:test # pgTAP 001-014: the privilege census (001: grants of every role,
# definer functions, RLS on every table), the policies and the
# RPC refusals; every file runs in begin ... rollback: rows
# unchanged (checked on the sandbox)
pnpm db:types:check # no diff
pnpm e2e:avatar # avatar flow and worker on the DEV stack (fictitious seed accounts)
```
Stop and report instead of continuing when: `migration list` shows another
pending migration or a remote-only one; `db:types:check` before step 4 shows
anything beyond the objects listed in step 1; the dump check misses a line; `migration up`
anything beyond the objects listed in step 1; the dump check misses a line; the
restore check gives other counts or an error that is not one of the expected
privilege errors; `migration up`
applies anything else than the expected V1-1 migrations; any count after it differs from
the expectation. The backup restores into a scratch database (rehearsed:
every row back; `pg_restore --no-owner` prints privilege errors on
Supabase-managed objects, which do not affect the data). Storage file bytes
the expectation. Step 3b was rehearsed on 2026-10-26 against the M3 sandbox
(container `faunosteo_dbsandbox_db`, 119 MB dump of fictitious load-test
data): users, profiles, workspaces, animals and the migration history came back
with the same counts; `pg_restore --no-owner` printed 26 errors, all privilege
refusals on Supabase-managed objects (18 « permission denied to change default
privileges », 5 « grant options cannot be granted back to your own grantor »,
`vault.secrets`, `pg_stat_statements_reset`, `pg_reload_conf`), none on a
table of the application. Storage file bytes
(avatars) live in the storage container's volume, not in the dump; M1 does not
touch them. No down migration exists: going back means restoring the step 3
dump, an owner procedure of its own that is not rehearsed here.
@@ -316,9 +338,35 @@ either (D9a): in DEV, delete its relations, animals and clients first from a
privileged SQL session, in that order.
The browser reaches these tables through `packages/supabase/src/{workspaces,clients,species,records}.ts`
since V1-1.5 (contract §11.7). The client screens run against DEV only once
the owner has applied M1 to M3 with §3.3; until then they are developed and
tested on the isolated stack, and no DEV acceptance is recorded.
since V1-1.5 (contract §11.7) and `{animals,relations}.ts` since V1-1.6
(§11.8). The client and animal screens run against DEV only once the owner has
applied M1 to M3 with §3.3; until then they are developed and tested on the
isolated stack, and no DEV acceptance is recorded.
#### Browser acceptance on DEV (owner, after §3.3)
A checkpoint of its own: the Playwright suites never run against DEV, so this
is the owner's check, from a phone and a computer of the private network, on
`pnpm dev` (DEV origin), with fictitious accounts only (never a real profile
changed for a test). Each line is done in French and in English:
1. sign in; Clients and Animaux open from the sidebar and the drawer;
2. journey 1: new client, « Ajouter un premier animal » from its page, owner
chosen, back on the client page with the animal;
3. journey 2: find the animal from the phone, open it, call the owner through
the `tel:` link;
4. journey 3: add the new owner, end the former owner's relation with a date,
the former owner's page shows « Ancien propriétaire »;
5. journey 4: an animal with no client shows « Propriétaire non renseigné »;
6. journey 5: archive a client (the confirmation lists its sole-owned
animals), find it under « Afficher les archivés », restore it;
7. journey 6: a structure linked as keeper; journey 7: « Autre » with « Furet »;
8. a relation entered by mistake removed with « Erreur de saisie », gone from
both pages;
9. a second account sees none of it (list, search, a copied record URL).
Results are recorded per line, device and language; a line not done is
reported as not done.
## 4. Writing a migration