chore(memory): BLK-013, LRN-131, R1 last feedback, RR-14

This commit is contained in:
bchanot committed 2026-11-12 15:38:39 +01:00
1 parent dca33b0047
commit c54ba5d62f
5 files changed
+116

No files matched your search

+7
View File
@@ -102,3 +102,10 @@ Friction: JSON copy (6371523) had no in-app restore (Home picker PDF only; devto
Root cause: copy shipped without restore path (round trip never tested in app); `internal` from draft read treated as transient core failure, no memory of trapping input; guard scoped to one route; session replacement unguarded since MVP.
Solution: 9bd9aca (BDR-056). Evidence: round trip identical (3 golden reports, slot + import); fuzz 37k draft.restore 0 traps, OOM only ~50 MB drafts (5 MB worst = 0.4-0.8 GB wasm). Verifier CONFORME 10/10, security PASS 2 LOW, check:all green.
Status: resolved 2026-10-17. Residuals: GC finalizer throws "memory access out of bounds" after stack-overflow trap (console only, live instance unaffected 50/50), ≤ 3 dead instances retained (~13.5 MB typical, ~4.5 MB each) until reload; raw lone surrogate in archive text quarantines readable draft (unreachable, session.rs); copy lacks archive envelope; iOS Safari likely ignores beforeunload (dialog + copy are protection there); Retry clicked during ms-long recovery → reload screen; re-importing copy of trapping draft re-traps (spends recovery); copy near 16 MiB may OOM low-memory device; storage full + confirmed replace + reload restores replaced draft; `internal` may come from handle rebuild (Retry reopens).
## BLK-013 — Editor drawing jumps on select/deselect (SelectionTag in flow above canvas) (2026-11-12)
- **Status**: resolved 927537b
Friction: owner R1 trial on db:trial (brief « V1-2.6 — R1 — Dernier retour utilisateur », 2026-11-12): « Sélection : zone « … » » text above drawing; drawing moves down on select, back up on deselect; redundant with highlight + side panel.
Root cause: `SelectionTag.tsx` = in-flow `inline-block` `<p>`, mounted only while an annotation selected, placed before canvas in both twins (EditableAnnotations.tsx TagOf, tabs/AnnotationsTab.tsx). Mount/unmount changes column height above canvas. Not a live region (no announce lost).
Solution: 927537b: tag `sr-only` (Tailwind 4.3: absolute, 1 px, clipped; no reserved space in `space-y-3` column), no role/aria-live, kept for SR browse mode. Unit test (sr-only, not live); e2e editor-deselect.spec.ts: canvas `boundingBox().y` unchanged for point, zone, link selected then deselected, desktop + read-only twin 375 px; editor-equine toBeVisible → toHaveCount(1). Gates: typecheck, lint, unit app 1382; e2e:shell db:sandbox 6 editor specs 37 passed / 37 skipped (other viewport) / 0 failed (run 1: 1 unrelated flake equine:348 commit latency). Verifier CONFORME (pass 2), security PASS x2. Docs 00936c8: board 04 + board 26 (v1-2-6-r0) deviation in docs/design/README.md, U1_CORRECTIONS R1, BROWSER_TESTS, OWNER_TRIAL §4.9.
Scope of resolution: SelectionTag shift only. NOT all drawing shifts: ToolNotes `role="alert"` hint above canvas (EditableAnnotations.tsx ~373) cleared by `select` still moves drawing one line when a hint is showing (kept visible, out of R1 scope, TODO). Selection itself still not announced to SR (unchanged). Owner browser confirmation on db:trial pending.
+1
View File
@@ -554,3 +554,4 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp
## 2026-11-12
- 2026-11-12 R1 + D6b delivered on feature/v1-2-anatomical-sheets (owner GO): Défaire/Refaire, Désélectionner, Escape priority, empty press on drawing deselects (useEmptyTap, press-based; mouse at pointerup, touch+pen at own click). Plan challenged x2 (capture retarget, blur-rebuild click drop, touch click-through). Gates: unit 1381/180/66, e2e:ui 227, e2e:shell 197/4/99 (4 = admin.spec.ts:717 baseline). Verifier 15/15, security PASS x2, code review fixes landed. Stopped at R1 checkpoint; R2 not started.
- 2026-11-12 R1 last owner feedback: « Sélection » tag above drawing made sr-only (927537b), drawing stable on select/deselect (desktop + 375 twin e2e); docs 00936c8 (board 04/26 deviation). BLK-013, LRN-131. Owner: R1 accepted technically, visual fix to confirm on db:trial; ToolNotes shift + SR selection announce + iOS open; RR-14 secrets rule added. R2 not started.
+9
View File
@@ -911,3 +911,12 @@ Limit: wording of this client version only.
**happy-dom** (20.x, vitest): `PointerEvent` init defaults `isPrimary: false`, `pointerType: ''`, `buttons: 0`; `fireEvent.click` moves no focus; no layout (box size 0), no pointer-capture retarget. → pass `isPrimary: true, button: 0, buttons: 1, pointerType` explicitly; focus explicitly; pan translation assertions impossible (assert zoom / preventDefault instead).
**Compressed command output (rtk proxy)**: `pnpm lint | tail` printed `[warn] Linter process terminated abnormally (possibly out of memory)` with rc 254, while `pnpm lint > file 2>&1` gave rc 0 and every package "Done" (2026-11-12, worktree faunosteo-v1-2). Observed once in this context only; the message comes from the proxy wrapping a piped command, NOT proof that eslint never runs out of memory elsewhere. → For gate evidence, redirect to a file and read rc + per-package lines; a real OOM still has to be ruled out from the unproxied log.
**Refs**: scratchpad gate logs r1-gates/final*, .superpowers ledger for plan 2026-11-12-r1-history-deselect-1141.
## LRN-131 — Conditional in-flow element above a canvas = layout shift; fix per message, sr-only only for redundant text (2026-11-12)
**Context**: R1 owner feedback 2026-11-12: drawing jumped at each selection change in sheet editor (BLK of same date, 927537b).
**General problem (layout)**: any element mounted/unmounted or resized on a state change and placed in flow ABOVE a canvas or hit-tested area moves that area: visual jump, and next clicks/taps land on stale coordinates. Sources: selection labels, transient hints, notices, banners.
**Detection**: e2e reads target `boundingBox().y` before and after each state change (select, deselect, hint on/off), desktop + phone; happy-dom has no layout, so unit tests can only assert classes/structure.
**Fix options (choose per message, not one rule)**: (a) redundant info already carried elsewhere (highlight, side panel) → drop visually, keep `sr-only` text if useful for SR browse (SelectionTag case); (b) message user must see (warning, refusal, error, save state) → stays VISIBLE: reserve fixed space (min-height slot), overlay inside canvas box (`relative` parent, absolute + pointer-events-none), or place below / beside canvas. Never sr-only a warning to fix layout.
**A11y check**: sr-only text not live = no announce, available to browse only; announce needs live region, avoid duplicating an existing one.
**Open instance**: ToolNotes hint above canvas (EditableAnnotations.tsx ~373) cleared on select = remaining shift, needs option (b).
**Refs**: SelectionTag.tsx, editor-deselect.spec.ts layout tests, docs/design/README.md deviation 2026-11-12, LRN on layout shift vs hit-test (recompute box per press).
+4
View File
@@ -690,6 +690,9 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
- [x] D6b (owner 2026-11-12, U1 manual test on db:trial): a click or tap on the drawing outside any annotation deselects; built and tested in Chromium
- [ ] R1 follow-ups: undo/redo glyph paths differ from board i-undo / i-redo (U1 code, deferred) · « Toutes les annotations » and « Supprimer » are 36 px below xl (touch target) · « Toutes les annotations »: focus falls to the page when its row is filtered out
- [ ] owner manual checks on db:trial: R1 (« Défaire » / « Refaire », « Désélectionner », Escape) and D6b with mouse and touch, iOS Safari included (not proven by the tests)
- [x] last owner feedback (brief « V1-2.6 — R1 — Dernier retour utilisateur », 2026-11-12): « Sélection : … » tag above the drawing made screen-reader-only, drawing stable on select / deselect (`927537b`, docs `00936c8`, BLK-013, LRN-131); unit app 1382; e2e:shell db:sandbox 6 editor specs 37 passed / 37 skipped / 0 failed; verifier CONFORME, security PASS x2. Owner 2026-11-12: R1 accepted technically
- [ ] owner browser confirmation on db:trial of the `927537b` visual fix (drawing stays in place, no tag above it; `V1-2-6_OWNER_TRIAL.md` §4.9 step 3)
- [ ] R1 known limits kept (owner 2026-11-12): ToolNotes `role="alert"` hint above the canvas (EditableAnnotations.tsx ~373), cleared on select, still moves the drawing one line when a hint is showing (must stay visible: fixed slot or overlay, LRN-131) · the selection itself is not announced to screen readers (only the deselection is) · iOS Safari validation still needed · the other R1 deviations already documented (follow-ups line above, `V1-2-6_U1_CORRECTIONS.md` R1 « Behaviour and limits »)
- [ ] R2 fifth tab « Références », tiles, search + clear, view-only sort, panel from a finding only (34 rem, 150-200 ms slide, reduced motion) (after R0 validation and its own go)
- [ ] R3 sheet list: search + name sort first; date, date sort and « most recent » home card only after the dedicated SQL checkpoint `docs/development/V1-2-6_R3_SQL_CHECKPOINT.md` (A7 ratified 2026-11-09; never a creation date shown as modification date)
- [ ] R4 catalogue card integrity warning (independent fix, = anomaly C): `useCardDetails.ts` drops a failed `loadVersion` silently; UI only, check never bypassed
@@ -729,6 +732,7 @@ Inventory: `.claude/audits/2026-10-25-functional-inventory.md`. Each item: treat
- [ ] RR-10 census tools maintenance (LOW `#[ignore]` positions) and controlled oracle evolution on a new anatomical changeset
- [ ] RR-12 (RR-11 is taken on develop: « sandbox-only e2e follow-ups ») AAL2 token after factor removal, production security prerequisite (owner 2026-11-03, recorded at V1-2.6, NOT fixed): catalogue and sheet RPCs and Storage policies check the JWT `aal2` claim (`private.has_mfa()`), not the live session (`has_aal2_session()` serves role and rights RPCs only), so a token issued at `aal2` keeps passing them after a factor removal until it expires. Study a live-session check or a revocation strategy compatible with Supabase / GoTrue before production; no authentication change in V1-2.6. Recorded in V1-2 contract §13
- [ ] RR-13 (free on develop, max RR-11, and on V1-2, max RR-12) « Pagination côté serveur de la liste des droits et prévention de l'épuisement mémoire » (owner 2026-11-09, BDR-106; priority technical track, separate from U1 and U2; NOT implemented, needs its own plan and owner go). Cause: `list_catalog_grants()` (`supabase/migrations/20261028100000_sheet_access_hardening.sql:542`) and `GrantList.tsx` return and render every grant; on a long-lived sandbox (2 306 rows) the axe scan takes the Chromium renderer to ~2.2 GB and earlyoom kills it (« Target crashed », admin.spec 9/9 on 89da8d3, 580ff28, 606f7ba; absent at seed volume); the same memory pressure SIGTERMs DEV `pg_meta` (39 restarts in 2 days, stateless). The plan must cover: [ ] bounded server paging · [ ] deterministic result order · [ ] authorization checks unchanged · [ ] paging and large-volume tests · [ ] admin scenario independence tests (admin.spec:717 working-copy slot) · [ ] memory consumption check · [ ] Supabase DEV protected from indirect effects of the test suites
- [ ] RR-14 (on V1-2; develop max RR-11) secrets outside logs, process arguments and test artifacts, production security prerequisite (owner 2026-11-12; not blocking R2; recorded in V1-2 contract §13): no real password or secret in any log; no real secret in process arguments (argv); no real secret in test or CI/CD artifacts; these three checked before any deployment. Trigger: guardrails FAIL `API-PASSWORD-PLAINTEXT` / `API-PASSWORD-LOGGED` at `scripts/db-trial-check.sh:1340` (security gate 2026-11-12); the passwords there are fictitious, test-only. Owner: harness NOT modified, no secret rotation now
## Phase A — DONE (kept for reference)
@@ -0,0 +1,95 @@
# CONTRACT — r1-selection-tag
- date: 2026-11-12 | flow: bugfix | branch: feature/v1-2-anatomical-sheets
- status: active
## REQUEST (verbatim — IMMUTABLE)
# FAUNOSTEO V1-2.6 — R1 — Dernier retour utilisateur
Les 10 tests manuels R1 sur db:trial sont réussis, y compris la désélection par clic sur le squelette, le tactile, le focus et les raccourcis.
Un dernier défaut UX a été constaté.
## Problème
Lorsqu'une annotation est sélectionnée, un texte apparaît au-dessus du schéma :
« Sélection : zone « Vertèbres cervicales » »
Cet affichage est redondant : l'annotation est déjà surlignée sur le dessin et son nom apparaît dans le panneau latéral.
Il provoque surtout un déplacement vertical du schéma, particulièrement désagréable lorsqu'on sélectionne et désélectionne plusieurs annotations.
## Correction autorisée
1. Identifier le composant responsable de cet affichage.
2. Supprimer son affichage visuel dans l'éditeur, en modification comme en lecture seule.
3. Ne laisser aucun espace vide réservé à cet affichage.
4. Garantir une position stable du schéma lors des changements de sélection.
5. Conserver le surlignage et les informations de l'annotation dans le panneau latéral.
6. Si ce texte sert aussi d'annonce accessible, conserver une solution adaptée aux lecteurs d'écran, hors du flux visuel, sans annonce redondante ni perte d'accessibilité.
7. Ne pas supprimer les autres messages utiles, notamment les erreurs, avertissements et états de sauvegarde.
## Tests attendus
- Sélection d'un point, d'une zone et d'un lien.
- Désélection par clic, bouton et Échap.
- Absence de déplacement vertical de l'interface.
- Éditeur modifiable et consultation en lecture seule.
- Desktop et mobile.
- Accessibilité et absence de régression des interactions R1.
## Périmètre
Correction UX minimale, rattachée à R1.
Ne pas modifier les règles de sélection, le document, l'historique Défaire/Refaire, les données ou la sauvegarde.
Ne pas toucher à db:trial, DEV ou aux données de la sandbox, en dehors des tests automatisés autorisés sur l'environnement isolé prévu.
Faire relire la correction, exécuter les tests pertinents, documenter, commit et push.
R2, R3, R4, U2 et U2b restent bloqués.
Fournir le résultat et s'arrêter au checkpoint final R1.
## DIAGNOSIS
- BUG: « Sélection : … » tag shown above the drawing on selection; drawing moves down by its height, back up on deselect.
- ROOT CAUSE: `SelectionTag` (apps/app/src/components/editor/annotations/SelectionTag.tsx) renders an in-flow `inline-block` `<p>` mounted only while an annotation is selected, placed before the canvas in both twins (EditableAnnotations.tsx TagOf, tabs/AnnotationsTab.tsx). Mount/unmount changes the column height above the canvas.
- A11y: the tag is not a live region (no role, no aria-live); selection is not announced by it today. Deselection announce (deselect.ts) is separate and untouched.
- RELATED MEMORY: none bears (LRN on layout shift vs hit-test is general, honored by the e2e recomputing positions).
## CLARIFICATIONS
Q: announce the selection politely (reviewer suggestion)? / A: no. Brief item 6 conditions it on the tag being an announcement, it is not; "sans annonce redondante". Text kept sr-only, not live.
Q: other shift source: ToolNotes `role="alert"` hint cleared by `select` (EditableAnnotations.tsx ~373)? / A: out of scope (brief: minimal, keep warnings); reported to the owner, not changed.
Q: design record? / A: owner brief ratifies the deviation from board 04; recorded in docs/design/README.md under the existing accepted deviations.
Q: suites environment? / A: unit local; e2e:shell only on `pnpm db:sandbox` (already up, faunosteo_dbsandbox_*), targeted specs; never db:trial, never DEV; no sandbox up/reset/down.
## ACCEPTANCE CRITERIA
1. SelectionTag renders `sr-only`, no visible style classes, no role/aria-live; both twins still render it.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q 'className="sr-only"' src/components/editor/annotations/SelectionTag.tsx && ! grep -qE "aria-live|role=|inline-block|surface-strong" src/components/editor/annotations/SelectionTag.tsx && grep -q "<SelectionTag" src/components/editor/tabs/AnnotationsTab.tsx && grep -q "<SelectionTag" src/components/editor/annotations/EditableAnnotations.tsx && echo TAG_OK
EXPECT: TAG_OK
EVIDENCE: MET exit=0 marker-found :: TAG_OK
2. Regression unit test asserts sr-only and not live; typecheck, lint, full unit suite green.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && grep -q "keeps the selection tag out of the visual flow" apps/app/tests/unit/editor-annotations-tab.test.tsx && pnpm -s typecheck >/dev/null 2>&1 && pnpm -s lint >/dev/null 2>&1 && pnpm -s test:run >/dev/null 2>&1 && echo UNIT_OK
EXPECT: UNIT_OK
EVIDENCE: MET exit=0 marker-found :: UNIT_OK
3. e2e: editor-deselect.spec.ts has a test asserting the canvas top is unchanged after selecting and deselecting a point, a zone and a link; editor-equine.spec.ts no longer asserts the tag visible.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2/apps/app && grep -q "the drawing does not move when the selection changes" e2e/shell/editor-deselect.spec.ts && ! grep -q "selectionTag(page)).toBeVisible" e2e/shell/editor-equine.spec.ts && echo E2E_SRC_OK
EXPECT: E2E_SRC_OK
EVIDENCE: MET exit=0 marker-found :: E2E_SRC_OK
4. Shell specs editor-deselect, editor-equine, editor-access, editor-annotations run green on `pnpm db:sandbox` (manual run, counts reported); no selection rule, document, history, save or data code changed.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && [ -z "$(git diff --name-only HEAD -- apps/app/src/editor apps/app/src/state supabase crates scripts docker packages)" ] && echo SCOPE_OK
EXPECT: SCOPE_OK
EVIDENCE: MET exit=0 marker-found :: SCOPE_OK
5. docs/design/README.md records the owner-ratified deviation for board 04 (2026-11-12); SelectionTag doc comment states why.
## FILE SCOPE
- apps/app/src/components/editor/annotations/SelectionTag.tsx
- apps/app/tests/unit/editor-annotations-tab.test.tsx
- apps/app/e2e/shell/editor-deselect.spec.ts
- apps/app/e2e/shell/editor-equine.spec.ts
- apps/app/e2e/support/editor.ts
- docs/design/README.md
- docs sync (approved by owner 2026-11-12): docs/development/BROWSER_TESTS.md, docs/development/V1-2-6_U1_CORRECTIONS.md, docs/development/V1-2-6_OWNER_TRIAL.md
- closure (owner 2026-11-12): docs/development/V1-2_ANATOMICAL_SHEETS.md §13 (RR-14 prerequisite), .claude/tasks/TODO.md
- this contract; memory: .claude/memory/{blockers,learnings,journal}.md (BLK-013, LRN-131)