chore(memory): BDR-113, LRN-128..130, R1 accepted technically

This commit is contained in:
bchanot committed 2026-11-12 14:01:47 +01:00
1 parent 9852e4e5bc
commit 17c21a62cc
3 files changed
+36 -1

No files matched your search

+10
View File
@@ -918,3 +918,13 @@ Owner brief « R0 — Autorisation des trois dernières corrections graphiques
**Where**: scripts/db-trial.sh grant_platform_role `local need=1` (owner branch need=2 dropped), harness 375/0 (0 factors refused, 1 granted, 2 granted, tx recount 0 refused); SUPABASE.md §5.2; V1-2 §5.7.1 step 2 dated note + §5.6 pointer. Commit 45d7453; contract .claude/tasks/contracts/2026-11-11-trial-owner-one-factor-2050.md; verifier CONFORME 7/7, security PASS, 3-lens challenge folded.
**Alternatives**: keep 2 for owner (rejected by owner: trial friction); change SQL/production rule (forbidden without study).
**Trade-off**: one-factor owner losing device → no second path; recovery = V1-2 §5.7.7 by hand at trial db, or new account via `grant` (SUPABASE.md §5.2).
## BDR-113 — R1 editor deselection paths and Escape priority (D6b press-based rule; editor only) (2026-11-12)
- **Status**: accepted (owner 2026-11-12; R1 editor only; manual db:trial check pending)
**Decision** (owner GO 2026-11-12 « GO R1 COMPLET + D6b », gates G1/G2): R1 sheet editor only: deselect paths = « Désélectionner » button, Escape, empty press on drawing (D6b). Scope: editor AnnotationCanvas + its read-only twin (CatalogueCanvas `onEmpty`, editor-only). NOT a general rule for other components; catalogue reader (SheetRoute) unchanged (BDR-099 item 5).
**D6b rule**: verdict from the PRESS (`src/catalogue/useEmptyTap.ts`): pointerdown target without `[data-anno-id]`, primary, button 0, no second pointer anywhere (document capture listener), no contextmenu, accumulated move ≤ 4 px. Mouse → act at pointerup, swallow next click. Touch + pen → act in tap's own click, only if click target has no `[data-anno-id]` (pen = controller ruling after code review; cost: rare second tap after field blur-rebuild).
**Escape order** (A5, validated, must hold): dialog > « Plus » menu > references panel > tracing > selection. Text field keeps Escape. Only SHOWN annotation body acts (`usePlaceVisible`), via document keydown listener while selection resolved, no tracing, no references open, no `dialog[open]`; target body or inside `[data-editor-workspace]`.
**Focus** (G1, owner): button → A6 (row else drawing box); Escape from properties panel → A6; Escape elsewhere and drawing press → focus stays / canvas box. Announcement « Aucune annotation sélectionnée. ». G2: « Supprimer » style unchanged.
**Alternatives rejected**: decide from click target (pointer capture retargets click of selected marker press; blur-commit rebuild drops click); deselect at pointerup for all pointers (touch click lands on shifted layout); Escape registry in workspace (hidden kept body cannot hold focus → per-body listener simpler).
**Refs**: contract .claude/tasks/contracts/2026-11-12-r1-history-deselect-1141.md; plan rev 3 .claude/tasks/plans/2026-11-12-r1-history-deselect-1141.md; commits 7dda61d, bbb1668, bbdfd27, a1ee194, 132756e, 6ed90ef; docs V1-2-6_U1_CORRECTIONS.md R1 « Behaviour and limits », ANNOTATION-RENDERING.md D6b. Supersedes D6 line « empty-canvas click left to U2 » (BDR-107).
**Validation**: technical (verifier 15/15, security PASS x2, code review fixes landed, e2e:shell 197/4/99 = baseline fails only); owner manual check on db:trial PENDING.
+25
View File
@@ -886,3 +886,28 @@ Limit: wording of this client version only.
**Not closed** (named, owner scope): failing init statement still logged (`log_min_error_statement = error`); migrate.sh puts password on psql argv during init; db-sandbox.sh same DB_INIT without flag; DEV CLI stack likely same log line.
**Remediation of exposed value**: one-off TR_PW rotation 2026-11-11 (owner): 5 roles one tx (local logging off), secrets.env, auth/storage/rest recreated by `pnpm db:trial start`; old pw refused on scram path (container network IP; 127.0.0.1 is trust, proves nothing), new ok ×5; db container frozen env keeps dead old value.
**Future application**: any self-hosted Postgres image with init scripts → set logging GUCs on server command line, never in init SQL; mandatory pre-production check in DEPLOY.md security prerequisites. Password probe must use non-trust pg_hba path + control with wrong password.
## LRN-128 — Click-time hit tests lie: pointer capture, blur-rebuild and touch click synthesis; decide taps from the press (2026-11-12)
**Context**: R1 D6b (deselect on empty drawing press), sheet editor, Chromium. Found by plan challenge + code review, confirmed by e2e recorder.
**Observed mechanisms** (facts):
- Pointer capture retargets: `setPointerCapture` on the box at pointerdown (move gesture) → mouseup/click delivered to capture target (box), not the pressed marker → `closest('[data-anno-id]')` on click target = null.
- Blur commit at mousedown: focusable box takes focus → field blur commits → store version bump → canvas `replaceChildren` rebuild before mouseup → pressed node detached → click can be dropped (Blink).
- Touch: Chromium builds the tap's click after touchend, hit-tests the layout as it is then (after any pointerup state change shifting it), and applies touch adjustment toward `cursor:pointer` targets near the finger (~6-10 px).
- happy-dom reproduces none of these (no capture retarget, no focus on pointerdown, no layout).
**Implementation recommendations** (choices, not facts):
- Decide a "tap on empty" from the press (pointerdown target, movement, pointer count), not from the click target.
- Apply mouse verdict at pointerup and swallow the following click; apply touch/pen verdict in the tap's own click and re-check its target.
- Unit tests: simulate capture retarget (`upOn: box`) and mousedown focus explicitly; prove the rest in real Chromium (CDP touch) with an event recorder asserting which guard fired.
**Refs**: plan challenge records (.claude/tasks/plans/2026-11-12-r1-history-deselect-1141.md), useEmptyTap.ts, e2e/shell/editor-deselect.spec.ts, BDR-113.
## LRN-129 — Document-level Escape must re-check dialog and panel layers (body focus skips the React root) (2026-11-12)
**Context**: R1 Escape priority in sheet editor (React 19). Code review found body-focused Escape skipping higher layers.
**Facts**: keydown with focus on `document.body` (after click on non-focusable text) never traverses the React root → React handlers (ModalDialog, ReferencesPanel, workspace onKeyDown) never run. React synthetic `stopPropagation` does stop native propagation to `document`. A capture listener on document runs before everything, incl. dialogs.
**Rule**: a document-level Escape listener must re-check the priority interfaces itself: `dialog[open]` present → skip; references panel open → skip deselect (and close panel for body-targeted Escape); `defaultPrevented`, `isComposing`, text field target → skip; act only on shown body. Keep validated order dialog > « Plus » > references > tracing > selection; every consumer `preventDefault` so later layers skip.
**Test**: unit cases with focus on body + dialog open / references open / dialog outside workspace (phone drawer).
**Refs**: deselect.ts useEscapeDeselect, EditorWorkspace useBodyEscape, EditorTabs useMoreEscape, commit 132756e, BDR-113.
## LRN-130 — happy-dom pointer/focus defaults; compressed-output proxy false OOM on piped pnpm lint (2026-11-12)
**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.
+1 -1
View File
@@ -686,7 +686,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
- [ ] shortcut: `apps/app/src/editor/sheetDocument.ts:15` keeps the last parsed document in one module-level entry (every kept place reads the document, one parse serves them all per commit), not store state. Limit: module state against the « no global state » rule, one entry. Upgrade path: the store holds the parsed document next to its text and the places select it
- [ ] V1-2.6 U1 corrections after the owner's first trial (brief « V1-2.6 UX — Arbitrages du premier essai propriétaire », 2026-11-09, BDR-107; contract `.claude/tasks/contracts/2026-11-09-v1-2-6-trial-arbitrations.md`; plan `docs/development/V1-2-6_U1_CORRECTIONS.md`): design and docs only so far, no app/scripts/SQL/Rust code, no DEV, sandbox untouched, no merge, no U2/U2b/V1-2.7
- [x] R0 boards 23-30 `docs/design/v1-2-6-r0/`: GRAPHICALLY VALIDATED 2026-11-09 (BDR-110) after owner corrections (BDR-109 + three last: 24 A, 26, 28) and closing counter-check CONFORME; A1-A15 settled (`ARBITRAGES.md`); archive `~/faunosteo-v1-2-6-r0-maquettes.zip`; impeccable 4.1.0 offline: 2 observations kept by owner
- [x] R1 history « Défaire » / « Refaire » + « Désélectionner » + Escape priority + D6b: DELIVERED 2026-11-12 (`7dda61d`, `bbb1668`, `bbdfd27` + `a1ee194`, `ab823f4` + `2327d61` + `0849e54`, `0d1edac`); gates on `0d1edac`: typecheck, lint, build ok; unit app 1371, supabase 180, core-wasm 66; e2e:ui 227; e2e:shell 197 passed / 4 failed (`admin.spec.ts:717`, anomaly B, baseline) / 99 skipped; limits in `V1-2-6_U1_CORRECTIONS.md` R1
- [x] R1 history « Défaire » / « Refaire » + « Désélectionner » + Escape priority + D6b: DELIVERED 2026-11-12 (`7dda61d`, `bbb1668`, `bbdfd27` + `a1ee194`, `ab823f4` + `2327d61` + `0849e54`, `0d1edac`; review fixes `132756e`, `6ed90ef`, `9807ed2`; docs `90a5e7a`, `a180b9e`, `58d432d`, `b8dda1b`, comment `6ef5223`); final gates on `a180b9e` (src = HEAD but one comment): typecheck, lint, build ok; unit app 1381, supabase 180, core-wasm 66; e2e:ui 227; e2e:shell 197 passed / 4 failed (`admin.spec.ts:717`, anomaly B, baseline) / 99 skipped; verifier 15/15, security PASS x2, code review fixes landed; limits in `V1-2-6_U1_CORRECTIONS.md` R1; memory BDR-113, LRN-128..130. Owner 2026-11-12 « Validation mémoire R1 »: R1 accepted TECHNICALLY on the report; owner manual validation on db:trial still to do (line below); R2, R3, R4, U2, U2b not started
- [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)