chore(memory): BDR-073 V1-1 ratification, EVAL-035, V1-1 plan in TODO
This commit is contained in:
1 parent
a6346105f1
commit
5d734be512
4 files changed
+76
-2
No files matched your search
@@ -535,3 +535,10 @@ Status: principle active; C4/C5/C6 + V1-1 orientations pending ratification; P0
|
||||
|
||||
BDR-041 point (2) names Professional Verification "Step 11"; IMPLEMENTATION_PLAN numbers it Step 9 (Step 10 cabinets, Step 11 entitlement skeleton). Plan numbering kept. BDR-041 left as written (append-only); this entry supersedes its step number only, rest of BDR-041 unchanged. Docs cite Step 9: plan Step 7 note, V1-1 contract §5.2, OPEN_QUESTIONS C6.
|
||||
Status: active.
|
||||
|
||||
## BDR-073 | 2026-10-25 | V1-1 business decisions ratified by owner (BDR-071 proposals → approved)
|
||||
|
||||
Decision (owner brief « V1-1 : ratification des décisions métier et préparation de l'implémentation »): D1 UI term « Clients », client = natural person or structure, Propriétaire/Détenteur/Contact = relation roles ≠ identity, no platform role reused as animal owner. D2/C4 `workspaces` + `workspace_members`, one personal workspace per practitioner, cabinet workspaces later w/o destructive transfer, no global directory, no cross-practitioner visibility, no sharing/invitations/cabinet perms in V1-1. D3 person | structure. D4 required = display name (person) / dénomination (structure), rest optional, no silent default country, no forced email/phone. D4a optional first/last names allowed, display name stays required reference, contract sets priority rule. D5 exactly 9 contract species + « Autre » w/ required detail; species ≠ sheet; equine draft never auto-published. D6 required name, species, sex w/ explicit unknown; optional breed, full birth date when known, year alone; D6a extras (neutering, identification, colour, notes, death date) + weight, photo deferred; no full vet record. D6b year never becomes date, precision kept, CHECK + tests. D7 many-to-many w/ explicit role, co-ownership, animal w/o owner OK, always in valid workspace, no fake client, never cross-workspace. D7a history: start date when known + nullable `ended_at`; no incoherent current duplicates, successive allowed; owner/keeper change never deletes history silently. D8 archive read-only reversible, relations kept, no cascade client→animals, archive ≠ erasure, no retention invented. D9/D9a temporary DEV guard vs account deletion leaving incoherent data, never permanent ban; lifecycle later. C5 V1-1 writes = practitioner in own personal workspace; finished bilans never changed silently. C6 email confirmed ≠ pro verified ≠ platform role; verification = Step 9. D16 staff no ordinary access, no admin screen, no impersonation/support access in V1-1; exceptional access = separate audited policy before publication. D15 technical caps ≠ commercial quotas; thresholds proposed before RPCs. Naming: explicit nomenclature, no generic `owner_id`.
|
||||
Still open: D10-D14, D17 (UI); technical design (SQL/RLS/RPC, N1-N9, D15 thresholds, U1-U3) awaits owner validation at V1-1 preparation checkpoint; no migration before. Contract restructured: verification now §6.2 (BDR-072 cites old §5.2).
|
||||
Alt: keep proposals open; global client record (2026-10-08 plan Step 12); `owner_user_id` column instead of workspaces.
|
||||
Status: active. Branch `feature/v1-1-clients-animals` off develop 5502617. Contract `docs/development/V1-1_OWNERS_ANIMALS.md` §13.1.
|
||||
@@ -247,3 +247,9 @@ Action: LRN-078, LRN-079; rerun gate after any post-check edit; run `pnpm audit`
|
||||
Method: P0 doc census + V1-1 contract drafting; inventory `.claude/audits/2026-10-25-functional-inventory.md` cross-checked with RUST_ARCHITECTURE_REVIEW Annex A.
|
||||
Anomaly: inventory criterion 4 placed validation rules (formats, lengths, required fields) in `crates/core` behind wasm facade. D-R7: form constraints stay TypeScript (Zod, i18n keys), SQL CHECK = integrity boundary, constants module + PGlite parity test against `pg_constraint`. Contradiction caught and corrected before V1-1 implementation contract; no code written on it.
|
||||
Action: V1-1 contract §1 + §8.3 follow D-R7. Check every proposal against Annex A D-R rows before writing it.
|
||||
|
||||
## EVAL-035 | 2026-10-25 | V1-1 design draft: 3 fresh challengers found 3 false security claims
|
||||
|
||||
Method: plan-challenger ×3 (correctness, robustness, simplicity) on `V1-1_OWNERS_ANIMALS.md` before owner checkpoint; evidence read from migrations, harness, worker config, react-router dist.
|
||||
Anomaly: draft claimed (1) N7 service_role revoke → "D16 holds at key level" (false: service key = GoTrue admin key → magic link / set password → user session); (2) identical 42501 while reusing `require_actor()` (two messages); (3) audit growth bounded (false: `log_event` stores attacker-sized `x-correlation-id`). Also phone search vs E.164 broken, OR search unindexable, backfill untestable, multi-call create duplicates, relation RPCs race, useBlocker needs data router.
|
||||
Action: all integrated into contract §6.3, §8-§12, §14 + TODO. Claims about key/role reach need proof via the auth admin API too, not only PostgREST grants.
|
||||
@@ -396,3 +396,7 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
|
||||
## 2026-10-25 (P0 arbitration, branch chore/p0-doc-realignment)
|
||||
- Owner created `chore/p0-doc-realignment` off develop by hand, P0 edits carried over; finalised on it. Owner orientations D1-D9, D16, C4-C6 into V1-1 contract as proposals (§9.1), sub-choices D4a/D6a/D6b/D7a/D9a, open D10-D15/D17. Contract fixes vs brief: no owner required on animal (was last-owner rule), birth year + optional date (was date + precision), display name sole required client field, staff access = no mechanism (was impersonation pointer).
|
||||
- README split public 0.1.0 / develop / DEV-only / planned; CHANGELOG Unreleased note; DEPLOY status notice + CSP "not production-ready" markers (RR-5 keeps fixes). BDR-071, BDR-072 (BDR-041 step fix), EVAL-034. nginx `/species/` = code debt, untouched. No migration, code, manifest. STOP at checkpoint, merge on owner go.
|
||||
|
||||
## 2026-10-25 (V1-1 ratification + preparation, branch feature/v1-1-clients-animals)
|
||||
- Owner ratified V1-1 business decisions (BDR-073). Branch via gitflow lib off develop 5502617, pushed. Contract rewritten: approved §13.1, nomenclature §3, SQL M1-M3, RLS/helpers/RPCs §9, D15 thresholds §10, UI §11, tests §12, N1-N9 + D10-D14/D17/U1-U3 open, 6 steps in TODO.
|
||||
- 3 challengers: CONCERNS, findings integrated (EVAL-035). Stop at checkpoint: no migration, no dependency, no Supabase DEV change.
|
||||
+59
-2
@@ -368,7 +368,7 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo
|
||||
---
|
||||
|
||||
## Product roadmap V1 (owner 2026-10-25 « Validation de l'inventaire et cadrage P0 / V1-1 »)
|
||||
Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheets served from Supabase → V1-3 cloud bilans + history → V1-4 stored PDF + authorised sharing → V1-5 cross-cutting mobile + a11y pass (a11y and security apply at every step). C4/C5/C6 and the V1-1 orientations (owner brief « P0 : arbitrages documentaires et finalisation du contrat V1-1 ») = proposed, awaiting ratification. No migration, component, API or table before the owner ratifies the V1-1 contract; no merge into main, no release/0.2.0 change, no deploy, no Supabase DEV change; equine draft stays unpublished.
|
||||
Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheets served from Supabase → V1-3 cloud bilans + history → V1-4 stored PDF + authorised sharing → V1-5 cross-cutting mobile + a11y pass (a11y and security apply at every step). C4/C5/C6 and the V1-1 business decisions ratified 2026-10-25 (BDR-073). No migration, component, API, dependency or table before the owner validates the V1-1 technical design at the preparation checkpoint; no merge into main or develop without the owner's go, no release/0.2.0 change, no deploy, no Supabase DEV change; equine draft stays unpublished.
|
||||
- [x] P0 docs realignment (docs only; branch `chore/p0-doc-realignment` created by the owner off develop, the working-tree edits carried over; merge into develop on the owner's go only)
|
||||
- [x] census of stale text in active docs (worker Node / Edge Functions, step numbers, roles, Step 13 "published", deleted tools, OPEN_QUESTIONS statuses)
|
||||
- [x] IMPLEMENTATION_PLAN: roadmap V1 section, step statuses, D-R9 in Steps 8/15/19/21/23/24/26, Step 13 DoD draft-only, deleted tools, Step 22 D-R8
|
||||
@@ -379,7 +379,64 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
|
||||
- [x] merged into develop 2026-10-25 (no-ff dae74e0, owner go); V1-1 waits for ratification of contract §9
|
||||
- [x] V1-1 functional contract `docs/development/V1-1_OWNERS_ANIMALS.md` (no code); correction: inventory criterion 4 (validation in crates/core) contradicted D-R7 → form constraints TS + SQL CHECK + parity test (EVAL-034)
|
||||
- [x] owner orientations D1-D9, D16, C4-C6 integrated as proposals (§9.1, SQL / permission impact marked); sub-choices D4a, D6a, D6b, D7a, D9a (§9.2); D10-D15, D17 kept open (§9.3); legal basis, client information, retention framed before public exposure (§9.4)
|
||||
- [ ] owner ratification of §9.1, answers to §9.2 and D15 → first migration on a `feature/` branch
|
||||
- [x] owner ratification 2026-10-25 (brief « V1-1 : ratification des décisions métier et préparation de l'implémentation », BDR-073): D1-D9a, C4-C6, D16, D15 principle, naming
|
||||
- [ ] V1-1 clients and animals: branch `feature/v1-1-clients-animals` (gitflow start off develop 5502617, pushed); contract `docs/development/V1-1_OWNERS_ANIMALS.md` (§3 nomenclature, §8 SQL, §9 RLS/RPC, §10 D15, §11 UI, §12 tests, §13 decisions). Each step = commits on this branch; owner validates after V1-1.1 and after the first UI step; merge into develop only on the owner's go. Gates every step: `pnpm typecheck && pnpm test:run && pnpm lint`; SQL steps also `pnpm db:reset && pnpm db:test`, `pnpm db:types:check`; UI steps through the design toolchain (Build UI) following `docs/design/`.
|
||||
- [x] V1-1.0 preparation (docs only): branch checks (develop = origin/develop 5502617, tree clean, P0 merged dae74e0; two stale R5.6 rehearsal worktrees in an old session scratchpad hold edits, left untouched); contract statuses approved; nomenclature; SQL schema M1-M4; helpers, RLS, RPCs, failures, definer statement; D15 thresholds; journeys, forms, a11y; pgTAP/e2e/Playwright plan; decisions N1-N9, D10-D14, D17, U1-U3; BDR-073; OPEN_QUESTIONS C4/C5/C6/Q6; plan Step 10/12 notes; DOMAIN_MAP, CLAUDE.md, README, TEST_STRATEGY citations; 3 fresh plan challengers (correctness, robustness, simplicity: CONCERNS, findings integrated: search keys, phone search, GoTrue admin path, correlation header cap, idempotent creates, locks, identical errors, backfill function, behavioural parity, Chromium-only V1-1, beforeunload guard, derived values, 6 steps / 3 migrations)
|
||||
- [ ] CHECKPOINT: owner validates the technical design (§8-§10) + N1-N9 + D10-D14, D17, U1-U3 → STOP until then (no migration, no dependency)
|
||||
- [ ] V1-1.1 Workspaces foundation
|
||||
- Objective: every account has exactly one personal workspace, readable by itself only, with the helpers every later table uses; audit rows no longer sized by the caller
|
||||
- Depends: checkpoint
|
||||
- Files: `supabase/migrations/<ts>_workspaces.sql`; `supabase/tests/012_workspaces.sql`; `supabase/tests/001_schema.sql` (tables, RLS, privileges, helper census); `packages/supabase/src/database.types.ts` (regenerated); `packages/supabase/src/workspaces.ts` (`fetchPersonalWorkspace`) + `src/index.ts`; `packages/supabase/tests/db/schema-types.test.ts`; config test (`enable_confirmations = true`); `docs/development/SUPABASE.md`
|
||||
- Migration M1: enums `workspace_kind`, `workspace_member_role`; `workspaces`, `workspace_members`; `private.caller_workspace_ids`, `private.writable_workspace_ids`, trigger `private.create_personal_workspace` after insert on profiles, `private.backfill_personal_workspaces()` called once; `private.log_event` redefined (same signature, `x-correlation-id` kept only if `^[A-Za-z0-9-]{1,64}$`) + NOT VALID CHECK; revoke all (public, anon, authenticated, service_role) + column grants; RLS
|
||||
- Tests: trigger; backfill function on a profile inserted with the trigger disabled (idempotent); one personal workspace per account; A/B isolation; unconfirmed, deactivated, platform staff, anon, service_role see nothing; empty account deletion removes its workspace; oversized/malformed correlation header stored null; helper census (prosecdef, search_path, ACL); PGlite + real stack
|
||||
- Acceptance: gates green; every account of `seed.sql` has one workspace + holder row after `pnpm db:reset`
|
||||
- Security: no platform-role branch; no `using (true)`; helpers `search_path = ''`, EXECUTE only where evaluated; email confirmation checked in SQL; `log_event` callers unchanged
|
||||
- Stop if: `auth.users` join behaves differently on PGlite and the real stack; the profiles trigger interferes with `handle_new_auth_user` or sign-up; an existing policy would need editing beyond the `log_event` redefinition
|
||||
- [ ] V1-1.2 Clients data
|
||||
- Objective: clients created, edited, archived, restored and searched through RPCs with the D15 guards, isolated per workspace, proven on the real stack
|
||||
- Depends: V1-1.1; N2, N3, N6, N9 decided
|
||||
- Files: `supabase/migrations/<ts>_clients.sql`; `supabase/tests/013_clients.sql`; `packages/supabase/tests/db/harness.ts` (load `unaccent`); `packages/supabase/src/field-limits.ts` + `tests/db/field-limits.test.ts` (behavioural parity, code points); `packages/supabase/src/clients.ts` (accessors, closed failure kinds) + unit tests; `packages/supabase/tests/e2e/clients-animals.e2e.ts` (seed and teardown through the existing psql helper), `scripts/clients-animals-e2e.sh`, root script (name to confirm); types regenerated
|
||||
- Migration M2: `unaccent` in `extensions`; `private.fold_text`; `private.require_write_budget` (1 000/h, 5 000/day); enum `client_kind`; `clients` (`name_key`, `search_key`, `phone_digits`, `create_request_id`); `create_client`, `update_client`, `set_client_archived`, `search_clients`; N9 condition on `audit_logs_select_admin`; grants; RLS
|
||||
- Tests: contract §12.1 rows for clients (whole-error identity, no lock outside the workspace, archived before conflict, replayed request id, caps, budgets, audit without values, search accents/case/backslash/phone formats/keyset); parity test; e2e cross-account + service key refused + GoTrue admin delete; search time on 20 000 clients recorded
|
||||
- Acceptance: gates green; e2e green on the local stack; measurement written in the contract
|
||||
- Security: constraint and parse errors caught inside RPCs; text parameters parsed in the body; search through POST; definer census
|
||||
- Stop if: `unaccent` cannot load on PGlite or the CLI stack; the measurement is above 100 ms p95 (index decision for the owner); a CHECK cannot be mirrored in TypeScript
|
||||
- [ ] V1-1.3 UI foundations
|
||||
- Objective: real-browser harness and accessible dialogs before the first screens
|
||||
- Depends: D13, D14 approved
|
||||
- Files: `apps/app/package.json` + `pnpm-lock.yaml` (`@playwright/test`, `@axe-core/playwright`, dev only); `apps/app/playwright.config.ts` (Chromium desktop + 375×667); `apps/app/e2e/` (fixtures: users through the admin API, DEV origin, service key from env never committed); `apps/app/src/components/ui/Dialog.tsx` (`inert` + restore to opener) + tests; root script (name to confirm)
|
||||
- Migration: none
|
||||
- Tests: Dialog containment, Escape, focus restore; editor dialogs unchanged; Playwright smoke (login → dashboard) with axe and the request-URL check
|
||||
- Acceptance: smoke green; axe 0 serious/critical on the smoke screens, or pre-existing violations listed under RR-7
|
||||
- Security: dependencies named with purpose; lockfile reviewed; no secret in fixtures or reports
|
||||
- Stop if: the Chromium download is refused or fails (owner decides); a fix outside V1-1 scope would be needed for axe
|
||||
- [ ] V1-1.4 Animals and relations data
|
||||
- Objective: animals with the ten species rows and the D6b birth model, relations with history, never across workspaces
|
||||
- Depends: V1-1.2; N1, N4, N5, N8 decided
|
||||
- Files: `supabase/migrations/<ts>_animals_relations.sql`; `supabase/tests/014_animals_relations.sql`; `field-limits.ts` + parity test; `packages/supabase/src/{animals,relations}.ts`; e2e extended; types regenerated
|
||||
- Migration M3: species rows (9 + `other`), table comment; enums `animal_sex`, `animal_relation_role`; `animals`, `animal_client_relations` (composite FKs, partial unique index, request ids); `create_animal` (optional initial relation), `update_animal`, `set_animal_archived`, `search_animals`, relation create/end/update/(delete if N4); `list_client_animals`, `client_archive_preview`; grants; RLS
|
||||
- Tests: five birth states; `species_detail` iff `other`; inactive species; dates incl. 31 December UTC; cross-workspace refused by RPC (42501) and by FK; duplicates and the concurrent race; successive relations; archived interactions (§7.1) under locks; caps per animal and per workspace; derived values; D9a (account with records cannot be deleted, empty one is); report, sheet and editor species ids unaffected
|
||||
- Acceptance: gates green; e2e green; local tool and PDF unchanged
|
||||
- Security: same whole error for every foreign id; FK proof independent of the RPC; animal-then-client lock order
|
||||
- Stop if: N1, N4, N5 or N8 undecided; any change needed in report, sheet or editor code; the D9a guard blocks a flow the owner did not foresee
|
||||
- [ ] V1-1.5 Clients UI
|
||||
- Objective: list and search, create, edit, detail, archive and restore clients, FR/EN, phone and computer, keyboard
|
||||
- Depends: V1-1.2, V1-1.3, V1-1.4 (client page lists animals); D11, U1, U2
|
||||
- Files: `apps/app/src/app/App.tsx` (routes); `apps/app/src/app/routes/app/clients/*`; `apps/app/src/clients/{validation,useClientForm}.ts`; `apps/app/src/components/clients/*`; `SidebarNav.tsx`, `MobileDrawer.tsx`; `apps/app/src/i18n/{fr,en}.ts`; tests; `apps/app/e2e/clients.spec.ts`
|
||||
- Migration: none
|
||||
- Tests: schemas per rule (i18n keys, code points, email pattern, phone conversion); country select from `Intl.DisplayNames`; list states; archive with preview and dialog; conflict keeping typed values; beforeunload + cancel guard; not-found for unknown and forbidden ids; Playwright client journeys + keyboard-only + cross-account + request URLs + axe
|
||||
- Acceptance: gates + Playwright green; owner check on phone and computer over the LAN
|
||||
- Security: only `packages/supabase` reaches the API; explicit column lists; no text filter in GET URLs; failures phrased by closed kinds
|
||||
- Stop if: the mockup lacks a pattern the screens need (propose, ask, never invent a direction); a visible choice not covered by §11
|
||||
- [ ] V1-1.6 Animals and relations UI, navigation and closure
|
||||
- Objective: animal screens, relation panels on both pages, journeys 1 to 7, D11 navigation, D12 tiles, Definition of Done (contract §12.6)
|
||||
- Depends: V1-1.5; U3, D11, D12
|
||||
- Files: `apps/app/src/app/routes/app/animals/*`; `apps/app/src/animals/*`; `apps/app/src/components/{animals,relations}/*`; `AppLayout.tsx`, `DashboardRoute.tsx`; i18n; tests; `apps/app/e2e/{animals,relations}.spec.ts`; `docs/design/README.md`, `CLAUDE.md`, contract "as built", `SUPABASE.md`, CHANGELOG Unreleased
|
||||
- Migration: none
|
||||
- Tests: birth input states; « Autre »; « Propriétaire non renseigné »; two-call creation resumed after a failure; end, correct, remove a relation; archived animal frozen; tiles from live counts; Playwright journeys 1-7 + axe; full suites
|
||||
- Acceptance: `pnpm check:all`; `pnpm db:reset && pnpm db:test`; fresh verifier + security gates; owner LAN check → merge only on the owner's go
|
||||
- Security: as V1-1.5; final RPC surface census for RR-4; guardrails on the new tables
|
||||
- Stop if: any gate red; any finding HIGH/CRITICAL; as V1-1.5
|
||||
- [ ] Code debt (not P0, no change on the doc branch): `docker/nginx.conf` still has `location /species/` (public/species deleted at Step 5); remove with its own `chore/` or `bugfix/` branch
|
||||
|
||||
## Release readiness track (owner 2026-10-25, distinct from the functional roadmap; nothing here authorises a release or exposure)
|
||||
|
||||
Reference in new issue
Block a user