From 858d0f37b98c0952eafacd1dac0562814f3fce3f Mon Sep 17 00:00:00 2001 From: bchanot Date: Sun, 25 Oct 2026 17:12:43 +0100 Subject: [PATCH] chore(memory): P0 arbitration, BDR-071, BDR-072, EVAL-034 Roadmap principle validated, BDR-041 step number corrected by a new entry, inventory contradiction with D-R7 recorded, journal, TODO with the nginx /species/ code debt and the V1-1 ratification gate. --- .claude/memory/decisions.md | 11 +++++++++++ .claude/memory/evals.md | 6 ++++++ .claude/memory/journal.md | 8 ++++++++ .claude/tasks/TODO.md | 17 ++++++++++++++++- 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index 2bf556d1..59dbad20 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -524,3 +524,14 @@ Decision (owner go): `check_v3_shape` on raw value before `Report::deserialize`: ## BDR-070 | 2026-10-25 | D-R5.6 active: fingerprint `sha256-rfc8785-validated-v1`, registry alias, M1 option 1 Decision (owner, activation 9e87016): sheet fingerprint = SHA-256(JCS RFC 8785 of R2 typed reading, no integrity error, warnings allowed, depth 128). Equine canonical 12d78872…74e2; old 27c7383c…2660 = sole TRUSTED_ALIASES entry, bound to sheet 503dc301 + content. Alias honoured only via LoadedSheet::recognises_historical_stamp (loader-verified v1 private state + document recomputed at decision + one-way registry pair + same sheet id); equivalence pub(crate). M1 option 1: snapshot of old report keeps its stamp (build_sheet_snapshot); export, archive reader strict. v0 refs (no block) load unverified, no privilege; null/malformed block refused. Rust = sole seed writer, TS legacy until R5.7. Alternatives rejected: A file-bytes (Prettier-bound), C Prettier reproduction; re-stamp at rebase (rewrites reports); export-side alias (M1 defect, no proof). Status: active on feature branch; rollback not transparent for post-switch reports (rebased, nothing lost) → settle before user release. + +## BDR-071 | 2026-10-25 | Product roadmap principle validated: P0 → V1-1 → V1-2 → V1-3 → V1-4 → V1-5 + +Decision (owner, brief « P0 : arbitrages documentaires et finalisation du contrat V1-1 »): order P0 docs → V1-1 clients + animals → V1-2 sheets from Supabase → V1-3 cloud bilans + history → V1-4 stored PDF + authorised sharing → V1-5 mobile + a11y pass; a11y + security apply at every step (IMPLEMENTATION_PLAN §0). Release readiness track RR-1..RR-10 stays separate: no V1 step authorises release or public exposure. C4 (records owned by workspace, no global client directory), C5 (writes = workspace members with write right), C6 (email confirmation ≠ pro verification) = owner orientations, awaiting business ratification. V1-1 orientations D1-D9, D16 recorded as proposals in `V1-1_OWNERS_ANIMALS.md` §9.1; no table, RPC, RLS or component before ratification. Owner also confirmed: anatomical reference changes only via curation sources + Rust pipeline until Step 17, no graphic sheet editor, equine draft unpublished until business review, no auto publication; bilan annotations ≠ reference changes. +Alt: plan's numeric step order (verification, cabinets, entitlements before any client screen). +Status: principle active; C4/C5/C6 + V1-1 orientations pending ratification; P0 merge awaits owner go. + +## BDR-072 | 2026-10-25 | Correction of BDR-041: professional verification = plan Step 9, not Step 11 + +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. diff --git a/.claude/memory/evals.md b/.claude/memory/evals.md index 884b48d2..e559e1b8 100644 --- a/.claude/memory/evals.md +++ b/.claude/memory/evals.md @@ -241,3 +241,9 @@ Action: claim a guard per call site, not per design; owner decision on snapshot_ Method: ledger 407 TS cases case by case before `git rm`; fresh verifier + security (opus) twice; check:all on R5.7 state, then rerun on 27bf59c after post-check edits; verifier ran 14 scratch reintroduction probes against census. Anomalies: round 1 verifier ECARTS(2): contract C6 "tsx gone" false vs pnpm optional peer (owner Clarification), digest typo `…dfe7` in docs. Two edits landed after first check:all → owner required full rerun. Census regex accepted `#[ignore]` targets (fixed) and still accepts ignore-before-test (LOW). Docs pointed to premerge record before it existed; `.bin/tsx` wording root-only; SUPABASE.md layout stale since R2. `pnpm audit` never run before this round (cargo advisories only): 57 pre-existing. Action: LRN-078, LRN-079; rerun gate after any post-check edit; run `pnpm audit` in every pre-merge round; checkpoint to owner, STOP before merge. + +## EVAL-034 | 2026-10-25 | Functional inventory put form validation in Rust, against D-R7 + +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. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 5606f624..3241d5af 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -388,3 +388,11 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp ## 2026-10-25 (product survey) - Owner closed R0-R5, asked read-only functional survey + roadmap. 4 parallel analyzers. Inventory `.claude/audits/2026-10-25-functional-inventory.md`; release readiness track RR-1..RR-10 in TODO. - Finding: local tool and /app not linked; no client/animal/report tables; plan text drifted (step numbers, Node worker, Step 13 "published"). Proposed V1-1 owners + animals first, needs C4/C5/C6. STOP, no branch, no code. + +## 2026-10-25 (P0 + V1-1 contract) +- Owner validated roadmap P0, V1-1..V1-5; C4/C5/C6 = hypotheses. Census agent: ~100 stale doc sites. P0 edits in working tree (plan §0 + Steps 13/15/17/19-26, BACKEND_ARCH D-R9, DOMAIN_MAP roles, OPEN_QUESTIONS status table, snapshot notices, design owners, README DEV origin). `gitflow start chore/p0-doc-realignment` refused by permission layer → uncommitted on develop. +- V1-1 contract `docs/development/V1-1_OWNERS_ANIMALS.md`: workspace model, clients + animals + link roles, RPC writes, archive only, 17 decisions. Inventory criterion 4 (validation in core) contradicted D-R7, withdrawn. STOP before migration. + +## 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. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 436e21ab..f54b4f62 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -125,7 +125,7 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] 7.7 Home coexistence: "Mon espace / Se connecter" entry on the header when configured; characterisation tests T12 unchanged with default config - [x] 7.8 tests: config, authStore (fake client), locale sync, forms, guards, shell, dashboard, account; i18n parity; pgTAP 009 (PGlite + real stack 280/280); root check + docker build green; headless e2e vs local stack 20/20 (signup via Mailpit, recovery, logout, mobile) - [x] 7.9 docs (IDENTITY.md, SUPABASE.md, CLAUDE.md, CHANGELOG, plan note); memory BDR-041, LRN-047, EVAL-015, journal; gates: verifier ECARTS(2) → open-redirect fix + contract CHECK → CONFORME 16/16; security PASS (MEDIUM fixed, 3 LOW closed, TOTP enforcement = documented gap). User validated 2026-10-12; user action still open: `.env.example` += `APP_AUTH_PROVIDERS=` (file edit denied here) - - [ ] 7.10 follow-ups kept by the user (2026-10-12), each owned by a later step: MFA mandatory before any sensitive admin feature (has_mfa helper + enrolment UI, IDENTITY.md §4; first admin screen); professional verification distinct from the SIRET format check (Step 11); real tests of Google and Apple once the provider ids exist (config.toml env(), APP_AUTH_PROVIDERS); integration of the report tool into the signed-in /app space (Step 14 gating); mockup elements not built yet listed in docs/design/README.md (bell, avatar photo → Step 8, stat tiles, tabs, mobile tab bar) + - [ ] 7.10 follow-ups kept by the user (2026-10-12), each owned by a later step: MFA mandatory before any sensitive admin feature (has_mfa helper + enrolment UI, IDENTITY.md §4; first admin screen); professional verification distinct from the SIRET format check (Step 9, BDR-072); real tests of Google and Apple once the provider ids exist (config.toml env(), APP_AUTH_PROVIDERS); integration of the report tool into the signed-in /app space (Step 14 gating); mockup elements not built yet listed in docs/design/README.md (bell, avatar photo → Step 8, stat tiles, tabs, mobile tab bar) - [ ] Step 8 = Rust R1 — files foundation + Supabase Storage + avatar (GO 2026-10-13: R0 validated, D1–D9 validated with D1 = Rust worker, D3 = top-bar avatar + name linking to Mon compte; branch feature/step-08-files-foundation, cut from the R0 tip because `gitflow finish` of R0 was refused by the harness classifier: the owner runs it). Analysis: docs/development/STEP8_FILES_ANALYSIS.md; contract-level spec written first in docs/development/STORAGE.md. Out: SVG upload (Step 13), other buckets' flows, PDF/anatomy ports, webhooks, CI/CD, VPS deploy, release 0.2.0 - [x] 8.0 analysis: facts (existing bucket + policy pattern, sanitiser, edge runtime off, CSP, deploy), design (assets table authority, server-built keys, quarantine prefix, worker `faunosteo_worker` with sharp + pdf sanitiser, storage.objects policies through assets, Storage API signing under RLS, sweeper/reconcile, backups file volume + restic, managed migration by rows), 10 security answers, scope, tests, risks, D1–D8 - [x] 8.1 migration 20261013100000_files_foundation: `asset_status`, `assets` (lease token added for stale-task refusal), 7 buckets (avatars open: 5 MiB, jpeg/png/webp; 6 closed; sheet bucket untouched), `private.can_read_avatar_object` / `can_upload_avatar_object`, storage.objects SELECT + INSERT policies, `private.object_purge_queue` + status/delete triggers (48 h final key of a deleted row, 1 h quarantine and rejected), `private.storage_ceiling()`, RPCs begin_avatar_upload / confirm_asset_upload / remove_avatar (authenticated), claim_avatar_jobs / complete_avatar_job / reject_avatar_job / mark_quarantine_purged / claim_purges / ack_purge / claim_quarantine_leftovers / expire_pending_uploads (service_role), closed error messages (P0001), explicit revokes, column grants @@ -367,6 +367,21 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [ ] Release 0.2.0 (branch release/0.2.0 = Steps 3–6, version.txt + package versions 0.2.0, CHANGELOG [0.2.0] 2026-10-11): deploy-trigger check done 2026-10-12 (CI = branches main/develop only, no tag trigger, no deploy job, docker job builds `faunosteo:ci` locally; hooks push only; DEPLOY.md deploy = manual on the VPS). Default 0.2.0 build carries NO sheet (SHEET_BUNDLE=none) → the live local tool must not be redeployed from main without `--build-arg SHEET_BUNDLE=draft`. Finish via /release-candidate (finish + tag span, tag push on explicit go); CHANGELOG back-merge conflict expected (Unreleased Step 7 above [0.2.0]). Awaiting the user's go. --- +## 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. +- [ ] 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 + - [x] BACKEND_ARCHITECTURE §1/§5/§6/§7/§9, DOMAIN_MAP §1/§6/§7/§12/§18, design README owners, snapshot notices (FRONTEND_ARCHITECTURE, MIGRATION_STRATEGY, REPOSITORY_MIGRATION_MAP, TEST_STRATEGY), PDF_IMPORT_HARDENING step numbers, README DEV origin, CLAUDE.md roadmap line + - [x] OPEN_QUESTIONS: status per item with the deciding BDR / D-R, C4/C5/C6 owner hypotheses, real conflicts listed for arbitration + - [x] owner arbitration 2026-10-25: README separates public 0.1.0 / develop / DEV-only / planned; CHANGELOG Unreleased note (nothing deployed, 0.2.0 section on its branch); DEPLOY status notice (historical, unverified, would-break, security prerequisites) + CSP examples marked not production-ready (fixes stay RR-5); OPEN_QUESTIONS conflicts 1-4 resolved (curation-only path until Step 17 confirmed); BDR-071, BDR-072 (BDR-041 step number), EVAL-034 + - [x] commit on the branch, push + - [ ] merge into develop on the owner's go +- [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 +- [ ] 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) Inventory: `.claude/audits/2026-10-25-functional-inventory.md`. Each item: treat or qualify before any release or public exposure; not fixed now unless an active critical flaw is shown. - [ ] RR-1 npm advisories (57, pre-existing; published severity kept apart from Faunosteo exposure). Zod 3.25.76 GHSA-mrhx-c7xc-m3w5 first: Zod parses only forms, the practitioner cache and one RPC result, no collection schema found; untrusted files go through the Rust core caps (PDF 50 MiB / 16 MiB attachment, depth 64, 400k values; sessionStorage value budget). Plan zod 4 as its own chore; drop zod from core-wasm `dependencies` if only its tests use it