From a43145a03f847fcf933c2f32c0753f84508ec6ef Mon Sep 17 00:00:00 2001 From: bchanot Date: Fri, 6 Nov 2026 14:56:50 +0100 Subject: [PATCH] chore(memory): BDR-103, LRN-119, U2b decisions contract and TODO --- .claude/memory/decisions.md | 17 ++ .claude/memory/journal.md | 1 + .claude/memory/learnings.md | 10 ++ .claude/tasks/TODO.md | 2 +- ...026-11-06-v1-2-6-findings-nav-decisions.md | 154 ++++++++++++++++++ 5 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 .claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-decisions.md diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index aa4a5668..d4ab6133 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -818,3 +818,20 @@ Effect: U1 relocates existing level-1 regions editor into Annotations as that fa **Rationale**: board 09 path needs role; working copy and pre-U6 drafts have none; one place to edit regions avoids divergence. **Alternatives**: regions only from category (blocks equine copy until V1-2.8, rejected); permanent separate tab (duplicate, rejected by four-tab shell). **Open**: none on T17. Recorded in DECISIONS T17, contract §17.12, PLAN U6, TESTS U6, TODO. + +## BDR-103 — V1-2.6 U2b principle approved: F1, F2, F6, F8, F22 decided, F7 term Famille, F3/F4 partial, F5 + F9-F21 open (2026-11-06) +- **Status**: accepted +**Decision**: owner brief « Validation de principe U2b et préparation des checkpoints » (2026-11-06) approves principle of bidirectional annotations ↔ findings navigation. Owner decisions only (recommendations not recorded as decided): +- F1: sub-step U2b « Annotations et constats » after U2, before U3; own contract, tests, checkpoint. Not started; needs own authorisation. +- F2: counters = real findings at any depth, families not counted, a zone named by several annotations counted once. Open: intermediate groups counted or not (study 7.1; boards count them: grasset 29 nodes vs 25 leaves; draft 730 vs 627). +- F3 partial: instant search, accent- and case-insensitive. Field list, word rule, language rule to ratify (study 7.2). +- F4 partial: text ∩ drawing; several picked zones = union, no duplicate. View semantics to ratify (study 7.3: model A facets, recommended; model B picks only). +- F6: below 1 024 px consultation + list filters, no graphical editing. +- F7 (term only): « Famille » = finding families, distinct from annotation categories. Other labels of F7 stay C44 proposals. +- F8: annotation without zone gets one through one atomic, core-validated, undoable operation, no silent duplicate (`commitBatch`, one undo entry; duplicate-name notice = proposed reading, confirm in U2b contract). +- F22: finding added from a selected annotation takes that annotation's zone; no second zone choice (board 18 A). +Not decided: F5, F9-F21. U1 plan at 2e46c14 untouched: integration points re-checked, enough. +**Rationale**: U2 rewrites selection/pointer/keyboard model of same canvas + `PropertiesPanel` → U2b after it; U3-U6 never touch zone link or findings tree. No core op, no document change (request C: `finding_zone_id` already links annotation → zone). +**Alternatives**: U2b after U6 (less `AnnotationFields` rework, later delivery); inside U2 (too large). « Catégorie de constats » kept (clashes with annotation « Catégorie »). +**Open**: F2 groups, F3 fields, F4 view model, F5, F9-F21. Recorded in `V1-2-6_UX_FINDINGS_NAV.md` §7, `V1-2-6_UX_PLAN.md` §3 U2b, contract `2026-11-06-v1-2-6-findings-nav-decisions.md`. +- **Status (2026-11-06)**: accepted, corrected 2026-11-06 after fresh verifier: F22 decision = owner sentence only (« préselectionner sa zone de rattachement. Ne pas imposer une seconde sélection inutile. »); form variant open: fixed zone (board 18 A) or preselected changeable field (literal reading). F8 decision = owner wording (« opération logique atomique, validée et annulable, sans doublon silencieux »); core validation via commitBatch, one undo entry, duplicate-name notice = study's proposed means, confirm in U2b contract. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index d0f93b88..55af532f 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -535,3 +535,4 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp ## 2026-11-06 - V1-2.6 U0 (docs only, BDR-101): V1-2 contract §6.2/§6.4 (draft rounds)/§6.7/§7.4/§8.2-8.4/§12.2 O22 (save + approval/publication fixed-category checks, not built)/§16.7/§16.12/§17.12; level-1 C3-C40 notes; design README v1-2-6 validated; rules sheet-model/schemas; 5 UX docs. T17, T12, T6, T14, T1 open. Verifier ECARTS(1) x2 fixed. No code, no DEV. +- V1-2.6 U2b principle approved by owner (BDR-103): U2b after U2; F1/F2/F6/F8/F22 decided, F7 term, F3/F4 partial; study §7 table F1-F22 with alternatives + consequences, F2 groups open (730 vs 627 leaves), F3 fields, F4 facet model; LRN-119 Activity. U1 plan 2e46c14 untouched. Docs only, no DEV. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 542fb532..36951968 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -807,3 +807,13 @@ Observation, not a routine: worktree held uncommitted format-only Prettier chang - **Reference**: 592 143 B of 600 000 B → margin 7 857 B (raw 1 569 864 B; pkg built 2026-11-04 after last core change `bbab0e6`; re-measured 2026-11-05 with same call, same figure). - **Rule**: margin = same call, same params (`level: 9`), same `pkg` file as gate. No system gzip substitute: results differ. Measure after every core change (each new op). Never raise ceiling silently: raise = explicit owner decision (D-R13) on measured figure. - **How**: after `pnpm wasm:build`, run size test (prints figure) or `node -e` with `zlib.gzipSync(buf, {level: 9})` on that file. + +## LRN-119 — React 19.2 Activity keeps state but re-runs effects on reveal: audit one-shot mount effects, no general ban (2026-11-06) +- **Context**: V1-2.6 U1 plan (2e46c14) chose kept-mounted `hidden` wrappers over React 19.2 `` for tab places; owner asked distinction recorded, no general ban (2026-11-06). +- **Fact (react.dev/reference/react/Activity, checked 2026-11-06)**: `mode="hidden"` keeps state, refs and DOM (`display: none`) but destroys Effects (cleanups run); reveal re-creates them (setups run again). Conceptually hidden = unmounted with saved state. Hidden children still re-render on prop changes, at lower priority. +- **Trap**: state kept ≠ effects quiet. Effect that does one-shot action on mount re-fires at each reveal: + - `apps/app/src/catalogue/useFraming.ts:69` `useEffect(() => setFraming(FIT), [resetKey])` → zoom and pan reset at each return, though framing state was kept. + - `apps/app/src/components/editor/findings/FindingTree.tsx:31-33` `useEffect(() => focus(focusId), [focusId])` → stale `focusId` re-focuses tree item at each return (steals focus). +- **Rule**: before wrapping subtree in ``, audit its effects. Idempotent on re-run (subscriptions, listeners, measures with cleanup) → fine. One-shot on mount (reset, focus, scroll, fetch, write) → make reveal-safe (apply once per key via ref, consume one-shot request) or keep `hidden` wrapper. `hidden` wrapper: no effect runs on switch, but hidden places re-render at normal priority (U1 plan §2 cost control). `` stays allowed where audit passes. +- **Future application**: U1 makes `focusId` one-shot and bans focus in mount effects; U2b search, filter panel, drawing in filter panel (`useFraming` reuse) follow same rule, so a later move to `` stays possible. +- **Status (2026-11-06)**: correct, amended 2026-11-06 after fresh verifier: hidden Activity keeps state (useRef values included) and DOM; refs to DOM elements detached while hidden (safelyDetachRef, react-dom 19.2.6), re-attached on reveal in layout phase before effects re-run; impact lines unchanged. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index fa00d566..4f9c7790 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -681,7 +681,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet - [x] static audits (core model, rendering/PDF/N-1, geometry/wasm, SQL/worker, editor/tests) · [x] docs/development V1-2-6_UX_{PLAN,COMPATIBILITY,TESTS,RISKS,DECISIONS}.md (sub-steps U0-U9, decisions T1-T19) · [x] independent review (3 lenses: CONCERNS 5/9/6, no BLOCKER) + fixes integrated (plan §6) · [x] commit + push branch · [x] owner answers 2026-11-05 (brief « V1-2.6 UX — Ratification des décisions techniques », BDR-100): T11 approved, T16 conditional deferral (curves lot), T2/T3 conditional on proofs, T4 no residual gap, T5 history preserved, T9 three actions, T10 navigation type, T12 principle · [x] five docs updated (decisions, compatibility §0/§7/§8, tests, risks + blocking criteria, plan §7) · [x] LRN-118 (wasm measuring rule) · [x] independent reviews: correctness challenger CONCERNS(5 MAJOR, 7 MINOR) integrated; verifier ECARTS(2) fixed; targeted re-check ECARTS(2) (one U6 test assumed permissive save, deploy order said all rounds) fixed · [x] third independent check before commit (2026-11-05): ECARTS(2) on K10/K11 (R-3 mitigation, U6 objective on older T4 scope, write-lock test assumed stripping save, T16 count scope in two forms) fixed · [x] fresh targeted re-check: CONFORME 12/12 (G1-G4 closed; 7 observations kept for U0) · [x] commit + push · [x] owner answers 2026-11-05 (brief « Autorisation U0 uniquement », BDR-101): T4 both SQL checks approved (O22 amended), T5 defaults, T10 option B, T15, T16 count before activation, « Remplacer par un polygone » explicit · [x] T17 answered 2026-11-06 (BDR-102) · [ ] still open: T12 text (before U7), T6 (V1-2.8), T14 follow-up; T1 only if a measure exceeds · [x] owner authorisation to start U0 (2026-11-05) - [ ] V1-2.6 UX U0, contract and decisions, docs only (contract `.claude/tasks/contracts/2026-11-05-v1-2-6-ux-u0.md`; no code, no SQL, no DEV, no U1): [x] V1-2 contract §6.2, §6.4, §6.7, §7.4, §8.2-§8.4, §12.2 + §17.1 (O22), §16.7, §16.12, §17.12 · [x] level-1 contract C3, C4, C5, C6, C7, C8, C11, C13, C16, C18, C20, C25, C28, C32, C33, C40, with the precedence rule of its header · [x] docs/design/README.md · [x] rules sheet-model.md, schemas.md · [x] five UX docs · [x] BDR-101 · [x] preconditions (r5:import-equine --check clean, seed 22/6/0 paths, wasm 592 143 B) · [x] independent verification: ECARTS x6 fixed, then CONFORME 12/12 (2026-11-06); open points for U2/U6 not in docs: point edge-size handle (boards 02/03), default laterality of the automatic access (U6), §15 replay text vs the category.fixed.* filter · [x] commit + push · [x] owner U0 checkpoint (approved for good in the brief « Autorisation de U1 uniquement », 2026-11-06) - [ ] V1-2.6 UX U1, editor shell (brief « Autorisation de U1 uniquement » + « U1 — Validation de la conception interne », approach A; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-ux-u1-1123.md`; plan `.claude/tasks/plans/2026-11-06-v1-2-6-ux-u1.md`, lots A, B1, B2, C-I; no Rust/SQL/worker/scripts, no DEV, no merge, no U2): [x] design approach A validated by the owner with 10 precisions · [x] owner choices 2026-11-06 (server save time, non-modal references panel, citation button in the finding's detail, board 01 annotation card) · [x] plan written + three-lens challenge (correctness CONCERNS 6, robustness CONCERNS 5, simplicity CONCERNS 2, no BLOCKER) integrated · [ ] owner plan checkpoint · [ ] lots A-I · [ ] gates, verifier, security · [ ] owner U1 checkpoint - - [ ] V1-2.6 UX complement « annotations ↔ constats » (owner brief 2026-11-06 « Nouvelle exigence UX : navigation bidirectionnelle »; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md`; design only, U1 plan untouched, no code, no DEV): [x] relations audit (one link `finding_zone_id`, no new association, equine draft 1:1) · [x] boards 17-22 `docs/design/v1-2-6-constats/` · [x] study `docs/development/V1-2-6_UX_FINDINGS_NAV.md` (no U1 integration point needed, sub-step U2b proposed, risks, tests, decisions F1-F21) · [x] fresh design review APPROVE WITH FIXES (3 MUST-FIX, 16 SHOULD), fixes applied · [x] fresh verifier ECARTS(4) → ECARTS(2) → CONFORME 9/9 (round 3) · [ ] owner validation of the complement (then F1-F21) + - [ ] V1-2.6 UX complement « annotations ↔ constats » (owner brief 2026-11-06 « Nouvelle exigence UX : navigation bidirectionnelle »; contract `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md`; design only, U1 plan untouched, no code, no DEV): [x] relations audit (one link `finding_zone_id`, no new association, equine draft 1:1) · [x] boards 17-22 `docs/design/v1-2-6-constats/` · [x] study `docs/development/V1-2-6_UX_FINDINGS_NAV.md` (no U1 integration point needed, sub-step U2b proposed, risks, tests, decisions F1-F21) · [x] fresh design review APPROVE WITH FIXES (3 MUST-FIX, 16 SHOULD), fixes applied · [x] fresh verifier ECARTS(4) → ECARTS(2) → CONFORME 9/9 (round 3; 567da67 came after it, not covered) · [x] owner principle validation 2026-11-06 (brief « Validation de principe U2b et préparation des checkpoints », BDR-103): U2b retained after U2 and before U3, F1/F2/F6/F8/F22 approved, F7 for the term « Famille », F3/F4 in part · [x] decisions F1-F22 table (alternatives, consequences, state), F2 groups vs leaves, F3 field list, F4 view semantics, boards with their decisions in study §7.4, U2b entry in `V1-2-6_UX_PLAN.md` §3, LRN-119 (``), contract `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-decisions.md` · [x] fresh verifier on that contract: ECARTS(9) → fixed → CONFORME 11/11 (6 observations outside criteria kept for the owner) · [ ] owner: F2 groups, F3 fields, F4 view model, F5, F9-F21 · [ ] U2b authorisation (after U2) - [ ] follow-up candidates (owner T14): multi-tab notice; RR item for the rollback limit of the category model (new id, reconcile with develop) - [ ] curves lot (ex-U9, owner T16 2026-11-05): curve handle editing, curved zone move, path remap, path point correction; spec `V1-2-6_UX_PLAN.md` §2 D, tests `V1-2-6_UX_TESTS.md` « Curves lot ». Rule: no feature that lets a path enter a document (package import, zones from the drawing's shapes, a curve drawing tool) ships before or without it. Before the new model is activated on an environment, and before U6 or U8 reaches any environment beyond the throwaway sandbox: read-only count of path geometries in its drafts and published versions (sandbox by U6 itself; DEV and shared environments by the owner or under explicit authorisation; non-zero reopens T16) - [ ] MANDATORY before merging V1-2 into develop (owner 2026-11-03): registry id reconciliation. LRN-095 collides: develop 09655b2 « Port a safe runner verbatim… » (2026-11-02) vs V1-2 « pgTAP across PGlite and the real Supabase image… » (2026-10-28, cited by BDR-084 and the V1-2.1 TODO lines). BLK-013 exists on develop only (« e2e:avatar on develop reached DEV »): `memory.sh` on V1-2 would hand out BLK-013 again, so a V1-2 blocker needs its id checked against develop first. Same for the TODO release-readiness ids: RR-11 is develop's (« sandbox-only e2e follow-ups »), V1-2 uses RR-12. No renumbering during V1-2.6 unless needed; renumber one side and patch its citers at the merge diff --git a/.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-decisions.md b/.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-decisions.md new file mode 100644 index 00000000..c81dac48 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-decisions.md @@ -0,0 +1,154 @@ +# CONTRACT — v1-2-6-findings-nav-decisions +- date: 2026-11-06 | flow: design checkpoint preparation (docs only) | branch: feature/v1-2-anatomical-sheets +- status: active +- worktree: /home/bchanot/Documents/faunosteo-v1-2 (every command from this absolute path; never DEV: the + `supabase_*_faunosteo` containers are DEV; no sandbox needed) +- base: 567da67 (complement after the verifier's CONFORME 9/9, trigger name per the core). Commit in place, push; no + merge, no `gitflow.sh finish`. +- context: follows `.claude/tasks/contracts/2026-11-06-v1-2-6-findings-nav-design.md` (complement design, verdict + CONFORME 9/9 on round 3, before 567da67). The U1 plan and contract stay as committed at 2e46c14. + +## REQUEST (verbatim — IMMUTABLE) + +# FAUNOSTEO — Validation de principe U2b et préparation des checkpoints + +Le propriétaire approuve le principe de la navigation bidirectionnelle entre annotations et constats. + +## 1. Placement + +Retenir une sous-étape U2b « Annotations et constats », après U2 et avant U3, avec son propre contrat, ses tests et son checkpoint. + +Ne pas modifier le plan U1 si les points d'intégration déjà prévus suffisent réellement. + +Ne pas commencer l'implémentation de U2b. + +## 2. Décisions enregistrables + +F1 : placement U2b approuvé. + +F2 : les compteurs portent sur les constats réels à toute profondeur, sans compter les conteneurs de familles et sans doublonner les constats associés à une même zone par plusieurs annotations. + +F3 : recherche instantanée, insensible aux accents et à la casse. La liste exacte des champs recherchés doit être présentée avant ratification complète. + +F4 : filtres texte et anatomiques combinés par intersection ; plusieurs zones anatomiques sélectionnées produisent une union sans doublon. Présenter la sémantique complète du filtre par vues avant ratification. + +F6 : sous 1 024 px, consultation et filtres par liste, aucune édition graphique. + +F7 : « Famille » désigne les familles de constats, distinctes des catégories anatomiques. + +F8 : l'association d'une annotation dépourvue de zone passe par une opération logique atomique, validée et annulable, sans doublon silencieux. + +Lorsqu'une annotation est sélectionnée et que l'utilisateur ajoute un constat, préselectionner sa zone de rattachement. Ne pas imposer une seconde sélection inutile. + +## 3. Décisions non encore ratifiées + +Préparer une table complète F1 à F21, reproduisant pour chacune : +- Le libellé exact. +- Les alternatives. +- La recommandation. +- Les conséquences techniques. +- L'état : approuvé, partiellement approuvé ou à décider. + +Ne pas convertir automatiquement les recommandations F5 et F9 à F21 en décisions du propriétaire. + +## 4. Apprentissage React + +Ajouter au registre d'apprentissages la distinction entre la conservation de l'état et la remise en route des effets avec React 19.2 ``. + +Documenter l'impact possible sur useFraming et FindingTree. + +Ne pas généraliser l'interdiction de ``. + +## 5. Complément graphique + +Conserver les six planches 17 à 22 comme proposition de conception U2b. + +Fournir un moyen simple de les revoir avec les décisions F1 à F21. + +Ne pas déclarer une nouvelle conformité indépendante après les modifications effectuées postérieurement au verdict CONFORME 9/9 sans vérification supplémentaire. + +## 6. Plan U1 + +Préserver le plan U1 existant au commit 2e46c14. + +Présenter son bilan de conception et les résultats des trois relecteurs indépendants, avec les éventuels blocages restants. + +Ne pas engager l'implémentation U1 avant le checkpoint d'autorisation correspondant. + +## 7. Restrictions + +Documentation et conception uniquement pour cette intervention. + +Aucune modification applicative, Rust, SQL ou worker. + +Aucune opération sur Supabase DEV. + +Aucune fusion, aucun déploiement et aucun début de V1-2.7. + +S'arrêter au prochain checkpoint documentaire. + +## CLARIFICATIONS +(none; owner questions stay in the study's section 7) + +## ACCEPTANCE CRITERIA +1. Placement (request 1): `docs/development/V1-2-6_UX_PLAN.md` §3 lists a sub-step « U2b · Annotations et constats » + between U2 and U3, stating its own contract, tests and owner checkpoint, that it starts only on a new owner + authorisation, and pointing to the study; the study's section 4 records F1 as approved; the study's section 3 + re-checks, with line references to the U1 plan, that the integration points already planned suffice, and proposes + no U1 amendment. + CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "^### U2b · Annotations et constats" docs/development/V1-2-6_UX_PLAN.md && awk '/^### U2 ·/{a=NR} /^### U2b ·/{b=NR} /^### U3 ·/{c=NR} END{exit !(a` (React 19.2), names `useFraming.ts:69` and `FindingTree.tsx:31-33` with their impact, and does + not forbid `` in general. +8. Boards (request 5): the PNG boards 17 to 22 and the contact sheet are byte-identical to 567da67; the study's + section 7.4 shows the six boards (Markdown images, any preview) each with the ids of the decisions whose « Boards » + column names it, consistent with that column, and no second copy of the decisions' content (amended 2026-11-06 + before verification: a generated HTML page needed a script, refused outside a skill run); `REVUE.md` says the + CONFORME 9/9 verdict predates 567da67 and does not cover it, and claims no conformity for this intervention + beyond the verdict of criterion 11. + CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 567da67 -- 'docs/design/v1-2-6-constats/*.png' && echo BOARDS_UNCHANGED + EXPECT: BOARDS_UNCHANGED + EVIDENCE: MET exit=0 marker-found :: BOARDS_UNCHANGED +9. Registries: the owner's approved decisions recorded in one decisions entry (no recommendation recorded as + decided), a journal line, the TODO line of the complement updated; all through `memory.sh` except TODO.md. +10. Constraints (request 7): no change under `apps/`, `crates/`, `supabase/`, `packages/`, `scripts/`, + `docs/design/v1-2-6/`; untracked review files never staged; no DEV, no merge, no V1-2.7. + CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet 567da67 -- apps crates supabase packages scripts docs/design/v1-2-6 && ! git ls-files --error-unmatch faunosteo-v1-2-6-revue-ux-chatgpt.md >/dev/null 2>&1 && echo FD_SCOPE_OK + EXPECT: FD_SCOPE_OK + EVIDENCE: MET exit=0 marker-found :: FD_SCOPE_OK +11. A fresh independent verifier against this contract, covering the 567da67 delta (board 19 C trigger name, F7 + citation, REVUE text) and this intervention; justified gaps fixed; exact verdict reported. STOP at the + documentary checkpoint. + +## FILE SCOPE +- docs/development/V1-2-6_UX_FINDINGS_NAV.md, docs/development/V1-2-6_UX_PLAN.md (U2b entry and order line), + docs/development/V1-2-6_UX_DECISIONS.md (one pointer line) +- docs/design/v1-2-6-constats/REVUE.md, docs/design/README.md (the complement's pointer line) +- .claude/tasks/TODO.md, this contract, .claude/memory (through memory.sh) +- NOT in scope: apps/**, crates/**, supabase/**, packages/**, scripts/**, docs/design/v1-2-6/**, the PNG boards, the + U1 plan and contract, the V1-1 checkout