chore(memory): contract — owner validation of the detail views plan, phase 2 criteria

This commit is contained in:
bchanot committed 2026-11-22 23:43:30 +01:00
1 parent bc68463eca
commit 388bdacd66
1 file changed
+36 -3
@@ -1,6 +1,7 @@
# CONTRACT — detail-views-graphic-crop
- date: 2026-11-22 | flow: ship-feature | branch: feature/v1-2-anatomical-sheets
- status: active (phase 1: analysis, arbitrations and mockups for the owner's graphic validation; no product code before that approval)
- status: active (phase 2: implementation authorised by the owner 2026-11-22 on plan rev 3, arbitrations integrated in rev 4 `.claude/tasks/plans/2026-11-22-detail-views-graphic-crop.md`)
- run-base: bc68463e
## REQUEST (verbatim — IMMUTABLE)
FAUNOSTEO — Validation du critère 32 et nouvelle demande U2
@@ -83,6 +84,7 @@ Q: Owner arbitrations on Q1-Q4 + aspect ratio (2026-11-22, second message) / A:
Q: Owner review of board revision 2 (2026-11-22, third message) / A: [gated 2026-11-22] Validated: functional orientation; internal category principle (auto-created, holds generated and hand-drawn accesses, absent from anatomical categories, head access stays in Articulations); overlap + annotation priority on editor, catalogue and bilan + clickable label incl. keyboard; crop on parent, 8 handles, crop/access separation, auto access then reshape, rectangle/polygon/circle accesses, view+access in one Undo, back to parent, graphic recrop; new view empty (copy = U5); targeted PDF fix; new accesses grouped under « Accès aux vues détaillées » in the annotations list, not an ordinary category; labels hidden during recrop. To do: compatibility strategy for the `role` key (compatible evolution, versioning or controlled restriction; no silent incompatibility under one schema version without explicit justification; SQL and Rust consequences checked before applying); limit label conflicts near each other and at the drawing edge; NO arbitrary ratio bound (no 1:2-3:1), keep minimum sizes and justified technical limits; editor and bilan may keep a 4:3 space with neutral bands, nothing outside the crop in a detail view; PDF keeps proportions, no stretch; PDF fix with visual non-regression tests and a check of existing PDFs and goldens. Deliver: analysis, arbitrations and mockups updated; final panels at full resolution (creation, free crop, polygon and circle access, labels, bilan navigation, portrait and very elongated view) in an easily browsable folder or archive; graphic validation before the implementation plan. Technical solutions compatible with these decisions are delegated.
Q: Owner arbitrations on board revision 3 (2026-11-22, fourth message) / A: [gated 2026-11-22] Validated: reserved id `cat-access` instead of `role: navigation` now; schema v2, no new key, no SQL migration for this feature; plan must verify: no collision with an existing category, creation by the core, uniqueness and behaviour on removal or edit, read and rewrite by an N-1 application, compatibility with existing sheets, future transition to the U6 role. Free-ratio crops validated with justified technical limits, very elongated both ways, handle manipulation by mouse and touch; whole crop with neutral bands in editor and bilan; content outside the crop never visible in a detail view. PDF option validated: views with width/height >= 3:1 use the full available width, height per real proportions; no stretch, no squash, no drawing outside the crop, no overlap with notes or other PDF elements; layout may adapt; both Rust defects fixed in the plan; existing PDF test references checked without automatic regeneration, any needed change justified and submitted. D25 validated (five fixed positions, no tab over a tab or a point, never outside the drawing, leader when moved, long names abbreviated with full name reachable) plus an accessible behaviour when no position fits, so a view is never impossible to open. Panel 15 to be redrawn with real D25 phone behaviour (close accesses, crossing leaders); panel 17 needs no artificial above-right geometry, that case is covered by tests. Graphic validation still pending on full-resolution panels 11, 15, 17, 18, 19; then the implementation plan with the usual reviews.
Q: Owner graphic validation of board revision 4 (2026-11-22, fifth message) / A: [gated 2026-11-22] Revision 4 validated graphically, no new mockup revision. Approved: rectangle selection on the parent view, eight crop handles, free ratio, crop vs access distinction, auto-generated access, independent reshaping, rectangle/polygon/circle accesses, access labels and their interaction priority, D25 placement, « Autres vues (N) » fallback, panel 15 phone behaviour (five close accesses: two tabs stay, three go to « Autres vues (3) »), recrop of existing views, nested view navigation, neutral bands and nothing outside the crop, PDF full width from 3:1. Compatibility strategy confirmed: reserved id `cat-access`, no new schema key, no SQL migration for this feature. The plan must keep explicit: (1) a view may temporarily have no access while a draft is prepared, but a detail view without an access from its parent keeps an error that blocks submission; (2) the PDF fix covers long notes, the current 60 pt floor, page breaks and no overlap with other elements, never deforms images nor shows content outside the crop. Plan must separate: Rust core changes; document compatibility and the N-1 reader; frame creation and editing; accesses and their shapes; annotation priority on the three surfaces; label placement and accessibility; parent/child navigation; PDF engine fixes; automated tests and manual trials on db:trial. Non-regression tests on historical documents and existing PDF references; new PDF references shown to the owner visually before being frozen. Keep: no change to pre-existing sandbox data, never editor-equine on the persistent sandbox, never DEV, no db:trial without an authorised checkpoint, no merge, no deploy. Usual plan reviews with autonomy on technical details; present the final plan and any arbitrations. This validation covers the design only: no code before the owner validates the technical plan.
Q: Owner validation of the technical plan rev 3 (2026-11-22, sixth message) / A: [gated 2026-11-22] Plan rev 3 (65889011) validated, implementation authorised under the usual process, no new revision needed for adaptations matching these decisions. A1 validated: grow only the access (never the crop frame) to the readability minimum, tell the person, show the result, allow reshaping, respect the drawing limits. A2 validated: strip « Ouvrir la vue », « Recadrer la vue », « Déplacer l'accès », « Propriétés »; deletion stays in Propriétés. A3 validated with a precision: long notes may continue on a new page repeating the header and the observation title; no overlap at all with images, notes, other elements or footers; paginate before any reduction under 60 pt; any exception justified and tested, the eight wide views included. A4 changed: keep the views' order in the PDF; classic views may use two columns and wide views a full row, without changing the reading order; never move panoramic views to the end. A5 alternative chosen: exact crop for every ratio, nothing outside the frame even between 1:2 and 5:1; keep logos; check differences with historical references; never regenerate existing references automatically. A6 validated: `cat-access` created by the core when a first access is actually added; a view created without an access needs no category. A7 validated: neutral bands on detail views only, main view unchanged. A8 validated: on the catalogue « Autres vues (N) » under the zoom controls, never hiding them nor preventing their use. Confirmed: the compatible `cat-access` strategy, no new schema key, the N-1 characterisation test first, historical data preserved, annotations' priority over accesses, the R4 graphic journey, the new access shapes, mouse, keyboard and touch, view + access in one Undo, the raster and PDF layout fix. Wasm: check the margin after the Rust changes; if insufficient, present alternatives before sacrificing a validated behaviour. Autonomy on technical choices, tests, independent reviews and ordinary fixes. Stops kept: (1) new PDF references shown as images before frozen; (2) historical references never modified or regenerated without justification and validation; (3) no change to pre-existing sandbox data; (4) never editor-equine on the persistent sandbox; (5) never DEV; (6) never start or change db:trial without the owner's go; (7) no merge, no deploy. The owner runs the final functional trial on db:trial. After implementation: present the technical report and the manual trial protocol with expected results. U2/U4 stays open until the owner's manual validation.
## ACCEPTANCE CRITERIA
Phase 1 (this run, before any product code):
@@ -93,8 +95,39 @@ Phase 1 (this run, before any product code):
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && test -z "$(git diff --name-only 80991bad..HEAD -- apps crates packages supabase)" && test -z "$(git status --porcelain -- apps crates packages supabase)" && echo PHASE1-NO-PRODUCT-CODE
EXPECT: PHASE1-NO-PRODUCT-CODE
EVIDENCE: MET exit=0 marker-found :: PHASE1-NO-PRODUCT-CODE
Phase 2 criteria are appended, tagged [gated <date>], after the owner's design approval.
Phase 2 (owner approval of the plan 2026-11-22; PLAN_BASE = bc68463e, the plan rev 4 commit):
5. [gated 2026-11-22] The core's internal category, N-1 characterisation, access minimum and editor commands pass (Tasks 1-3).
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && cargo test -p faunosteo-core --test n1_access_category --test sheet_access_category --test sheet_frame --test sheet_preview --test sheet_edit >/dev/null 2>&1 && echo CORE-OK
EXPECT: CORE-OK
6. [gated 2026-11-22] Validation rules unchanged and no SQL migration since the plan (sheet-model rule; owner « sans migration SQL »).
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && git diff --quiet bc68463e..HEAD -- crates/core/src/domain/sheet/validate.rs supabase/migrations && echo RULES-UNCHANGED
EXPECT: RULES-UNCHANGED
7. [gated 2026-11-22] Historical references, oracles, N-1 copies and the equine seed unchanged since the plan (owner stop 2).
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && test -z "$(git diff --name-only bc68463e..HEAD -- apps/app/tests/fixtures/goldens crates/core/tests/oracles packages/core-wasm/tests/n-1 supabase/seed ':(exclude)crates/core/tests/oracles/proportions')" && echo FROZEN-UNCHANGED
EXPECT: FROZEN-UNCHANGED
8. [gated 2026-11-22] PDF suites, old and new, pass: raster exact for every view ratio, images in proportion and in the views' order, pagination before any row under 60 pt, no overlap (Tasks 24-28).
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && cargo test -p faunosteo-core --features pdf-write --test pdf_layout --test pdf_serialize --test pdf_session --test pdf_content --test pdf_proportions --test pdf_budget >/dev/null 2>&1 && echo PDF-OK
EXPECT: PDF-OK
9. [gated 2026-11-22] The wasm module stays under its 600 000 B budget (LRN-118 measure).
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && pnpm --filter @faunosteo/core-wasm exec vitest run tests/size.test.ts >/dev/null 2>&1 && echo WASM-OK
EXPECT: WASM-OK
10. [gated 2026-11-22] App, packages and SQL (PGlite) suites pass.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && pnpm test:run >/dev/null 2>&1 && echo UNIT-OK
EXPECT: UNIT-OK
11. [gated 2026-11-22] Type-check passes.
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && pnpm typecheck >/dev/null 2>&1 && echo TYPES-OK
EXPECT: TYPES-OK
12. [gated 2026-11-22] Lint passes (run alone).
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && pnpm lint >/dev/null 2>&1 && echo LINT-OK
EXPECT: LINT-OK
13. [gated 2026-11-22] The N-1 fixture is the one characterised at N1_BASE: committed once, never changed (Task 5).
CHECK: cd /home/bchanot/Documents/faunosteo-v1-2 && test "$(git log --format=%H -- crates/core/tests/fixtures/n1/access-category.json | wc -l)" -eq 1 && echo FIXTURE-ONCE
EXPECT: FIXTURE-ONCE
14. [gated 2026-11-22] Browser proofs green (Task 29: editor-detail-views and catalogue shell specs at --workers=2, e2e/ui access-labels, the regression set; data guard clean; never editor-equine). Manual: the run outputs in the SDD ledger.
15. [gated 2026-11-22] The implementation follows plan rev 4 (Tasks 0-31) and the validated board (D1-D25, A1-A8 as answered by the owner): judged by the verifier against the plan and the board README. Manual.
16. [gated 2026-11-22] The new PDF references were shown to the owner as images and frozen only after the owner's go (Task 28). Manual: the owner's message quoted in the freezing commit.
17. [gated 2026-11-22] After the gates, the technical report and the manual trial protocol with expected results are presented to the owner; the trial on db:trial is the owner's; U2/U4 stays open until the owner's manual validation. Manual.
## FILE SCOPE
Phase 1: docs/design/v1-2-6-u2-detail-views/ (new), docs/design/README.md (index line), docs/design/v1-2-6/maquettes.html and 08-vue-detaillee-creation-desktop.png (board 08 caption fix, owner 2026-11-22 [gated]), .claude/tasks/ (contract, plan).
Phase 2 (after approval, to be fixed by the plan): apps/app/src/components/editor/{annotations,views}/, apps/app/src/editor/{annotations,state}/, apps/app/src/i18n/{fr,en}.ts, apps/app/src/components/canvas/ (bilan modal), apps/app/src/components/catalogue/, tests (unit, e2e/shell), docs/ANNOTATION-RENDERING.md, docs/development/V1-2-6_*.md; crates/core only if a rule or query must move to Rust (BDR-043).
Phase 2 (fixed by plan rev 4, « File Structure »): crates/core/src/domain/sheet/{access,edit,mod,preview}.rs, crates/core/src/anatomy/frame.rs, crates/core/src/pdf/write/{views.rs,layout/observation.rs}, crates/core/tests/** (new tests, fixtures/n1, common/page_boxes.rs, oracles/proportions after the owner's go), crates/core/Cargo.toml ([[test]] entries), packages/core-wasm/types (generated), packages/core-wasm/tests/n-1.access-category.test.ts, supabase/tests/024_sheet_access_category.sql, apps/app/src/{editor,anatomy,components/{editor,canvas,catalogue,ui},app/routes,i18n,styles}/**, apps/app/tests/{unit,fixtures/d25}/**, apps/app/e2e/{shell,ui,harness}/**, docs/{ANNOTATION-RENDERING.md,PDF-FORMAT.md}, docs/development/{RUST.md,ANATOMICAL_SHEET_MODEL.md,V1-2-6_UX_COMPATIBILITY.md,V1-2-6_UX_TESTS.md,V1-2-6_UX_PLAN.md,V1-2-6_OWNER_TRIAL.md}, docs/design/{README.md,v1-2-6-u2-detail-views/**}, .claude/tasks/**.