docs(docs): R4 catalogue card integrity warning as built
This commit is contained in:
1 parent
dadd8e5d29
commit
e1cdd9d25c
6 files changed
+185
-5
No files matched your search
@@ -787,6 +787,99 @@ Points raised before the validation (R3, as built):
|
||||
the test itself (never by editing an existing sheet); axe on the list.
|
||||
- Its own commit and verification, kept out of the U1 shell lots.
|
||||
|
||||
#### As built 2026-11-17
|
||||
|
||||
Owner brief 2026-11-16 (R3 closed, R4 start), plan `.claude/tasks/plans/2026-11-16-r4-card-integrity-2337.md` rev 3
|
||||
validated 2026-11-17 (« Je valide le plan R4 avec les décisions suivantes »): D1 alternative, D2 to D4 as recommended,
|
||||
R-1 to R-8 accepted, precisions P1 (the trial tells the sandbox's anomalies apart from R4) and P2 (the spec cleans
|
||||
only what it created) binding. Contract `.claude/tasks/contracts/2026-11-17-r4-card-integrity-0004.md`. Branch
|
||||
`feature/v1-2-anatomical-sheets`, no merge, no deploy, DEV unchanged, no write on the trial stack. Board 30
|
||||
`docs/design/v1-2-6-r0/30-catalogue-carte-integrite.png`, wording A10.
|
||||
|
||||
- The check is untouched: the card still runs `loadVersion` (version, drawings, `CataloguePreview`, the core's
|
||||
`check_published`). Nothing changed under `crates/`, `packages/core-wasm/`, `catalogue/catalogue.ts`,
|
||||
`catalogue/preview.ts`, nor on the sheet page (`SheetRoute`, `CatalogueFailureNotice`, `useSheetVersion`).
|
||||
- `useCardDetails` returns `{ state, retry }`: `loading`, `ready` (date, counts, thumbnail, `viewRefused`) or
|
||||
`failed` (the closed kind, `retrying`, the attempt number). `cardFailure(failure, stopped)` in
|
||||
`catalogue/failure.ts` sorts the kinds; `components/catalogue/CardFailure.tsx` draws the line. A failed card keeps
|
||||
the name, « Publiée », « Version n » (no date: the date comes with the details that failed) and « Consulter »
|
||||
(enabled, same link); counts and thumbnail give way to the line.
|
||||
- Integrity class (R-1): `fingerprint_mismatch`, `drawing_hash_mismatch`, `drawing_missing`, `invalid_document`. Text
|
||||
A10 in bold, « Contrôle d'intégrité échoué : cette version ne peut pas être affichée. » (EN « Integrity check
|
||||
failed: this version cannot be displayed. », key `catalogue.card.integrity_failed`), error tone, glyph `alert`, no
|
||||
« Réessayer ». Storage answering 400 or 404 for a drawing is `drawing_missing` (pinned by a unit test); 401, 429,
|
||||
network and other Storage answers are not integrity.
|
||||
- Size limits (D1, owner alternative): `caps` shows the existing « Cette version dépasse les limites de taille d'une
|
||||
fiche. », error tone, glyph `alert`, no « Réessayer », never the integrity text.
|
||||
- Other failures (R-2, R-4, R-5): warning tone (the amber of board 30's network card, ink text, no new token), the
|
||||
existing text (`catalogue.failure.<kind>`; `access_denied.title` « Accès non autorisé » for `denied`; the core's
|
||||
text for `core_unavailable`), glyph `wifi-off` for `network` and `alert` otherwise, « Réessayer » for that card
|
||||
only. No retry once the engine stopped for good. A `core_unavailable` retry calls `coreRuntime().retry()` before
|
||||
reloading; a version that traps the core spends one of the tab's three recoveries per click, as on the sheet page.
|
||||
- Main view not drawable (D2): a version that passes but whose main view the core refuses to compose keeps its
|
||||
counts and shows the existing `catalogue.failure.view` in a neutral `info` line (no role, no retry). The engine
|
||||
failing there (`core_unavailable`, `internal`) is the core line with its retry. Nothing is silent any more.
|
||||
- Announcements and focus (R-3): the lines are not live regions (no burst when several cards fail at load). During
|
||||
a retry the line and « Réessayer » stay mounted, the button `aria-disabled`, the card `aria-busy`, clicks ignored.
|
||||
A retry that fails again keeps the focus on « Réessayer » and a visually hidden polite region, empty at load and
|
||||
cleared at each attempt, says the line again. On success the focus moves to the card's « Consulter » only if it
|
||||
was on that card's removed « Réessayer » or on `body`.
|
||||
- `Notice` gains the tone `warning`, `icon?` and `live?` (default true); its existing call sites keep their role
|
||||
and glyph (test). `Icon` gains `wifi-off`. `Card` passes an optional `aria-busy` (outside the plan's file list,
|
||||
needed by R-3, accepted at review).
|
||||
- Browser proof (`apps/app/e2e/shell/catalogue-integrity.spec.ts`, `BROWSER_TESTS.md`): one sound and one altered
|
||||
sheet seeded per run (`storedFingerprint: '0'.repeat(64)`), integrity in fr and en at desktop and 375 px, network
|
||||
in fr on both projects (one version aborted, `route.fallback()` for the rest, the card remounted by search, never a
|
||||
reload). Cleanup (D4, ruling below): each own sheet archived by id through `private.set_sheet_status` as the seed
|
||||
owner, then read back; the own `catalog_reader` grant revoked by id and read back; no statement matches by pattern.
|
||||
- D4 ruling: archive, not soft delete. The owner authorised a soft deletion, but the application never deletes a
|
||||
sheet that had a published version (§6.9, `delete_anatomical_sheet`), so a deleted row with published history is
|
||||
a state no screen can reach. Archiving is reachable, takes the sheet out of the catalogue and stays inside the
|
||||
authorisation. Cost: the archived test sheets stay in the admin sheet list under « Archivée », tagged « R4 <tag> ».
|
||||
- Rust by default (R-8): sorting closed kinds into lines is display formatting; one class C row in
|
||||
`RUST_ARCHITECTURE_REVIEW.md` Part II.
|
||||
- One deviation from board 30, recorded in `docs/design/README.md`: on desktop the network card stacks
|
||||
« Réessayer » above « Consulter » where the board draws them side by side (the card's width wraps the row).
|
||||
Pending the design review, not fixed.
|
||||
|
||||
Results (exact; nothing that failed is called green):
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| App unit suite (`pnpm --filter @faunosteo/app test:run`, at `6ad8d83`) | 1771 tests in 138 files passed (1753 before the card tests) |
|
||||
| `pnpm typecheck`, `pnpm lint`, `pnpm build` | exit 0 at each code commit (build: the usual chunk-size notice only) |
|
||||
| `catalogue-integrity.spec.ts` alone on the sandbox (`dadd8e5`) | 6 passed, 0 failed, 0 skipped, 0 flaky, twice (once with temporary screenshot lines, once as committed) |
|
||||
| `catalogue.spec.ts` alone after the support change | 8 passed, 0 failed, 0 skipped, 0 flaky |
|
||||
| Data guard before and after the runs (read-only) | 0 removed, 0 changed, 81 added (27 sheets, 43 versions, 11 grants). The 8 « R4 … » sheets read back archived (one `anatomical_sheet.archived` audit row each), the 4 own grants revoked (`e2e cleanup`) |
|
||||
| Catalogue census of the sandbox (read-only, 2026-11-17, below) | 164 entries: 160 pass and compose their main view, 4 `fingerprint_mismatch` (anomaly A) |
|
||||
| `pnpm check:all` | not yet run |
|
||||
|
||||
Sandbox catalogue census (P1, read-only): every catalogue entry (active official sheet whose current version is
|
||||
published) read by SQL under `default_transaction_read_only`, its drawings fetched from Storage by GET, then the
|
||||
core's `PreviewBuilder` built from the version's status, document and stored fingerprint as `loadVersion` does, and
|
||||
the main view composed as the card does. 164 entries: 80 « Cheval publié <tag> » and 80 « Cheval refusé <tag> »
|
||||
(left by `catalogue.spec.ts`) pass and compose; the four « Cheval sandbox » entries (two at version 1, two at
|
||||
version 2) answer `fingerprint_mismatch`: their stored fingerprint is `'a'.repeat(64)`, the fictitious value of the
|
||||
worker stand-ins (anomaly A, section 5). No other kind was found. Limit: Storage was read with the service key, so a
|
||||
drawing the reader's Storage policy would refuse is not detected by the census.
|
||||
|
||||
Limits (accepted, recorded):
|
||||
|
||||
- R-7: when the engine fails for the whole tab, every card shows the core line with its own « Réessayer »; one card's
|
||||
retry restarts the engine and reloads that card only, the others reload on their own retry.
|
||||
- R-6: a failed `listSheetVersions` drops the publication date without a word. A failed card shows « Version n »
|
||||
without a date.
|
||||
- D2: the view line reuses `catalogue.failure.view`, a text written for the sheet page (« Cette vue ne peut pas être
|
||||
affichée : … »); no card-specific wording was asked for.
|
||||
- Sandbox accumulation: each spec run adds 2 to the seed owner's row in `private.catalog_write_budgets` (created by
|
||||
the first run, 8 of 300 per hour after the R4 runs, outside the data guard); the spec's reader accounts stay (as
|
||||
every suite's, BLK-015); `catalogue.spec.ts` still leaves its published sheets listed and the global warm-up its
|
||||
« Fiche e2e … » sheet and `sheet_editor` grant per invocation (existing accumulation, BLK-015, RR-13).
|
||||
- Every card loads its version at mount: with 164 entries the sandbox catalogue is slow to settle (with RR-13).
|
||||
- Unit only: the engine stopped for good in a card (`cardFailure` test), and two cards failing on the core at once.
|
||||
Not checked in a browser: `aria-busy` and `aria-disabled` during an attempt, a screen reader reading the polite
|
||||
region.
|
||||
|
||||
## 4. Order and dependencies
|
||||
|
||||
R0 first (validation). R1 is independent of R2 and can ship first. R2 depends on the validated boards 23 to 27. R3
|
||||
@@ -801,7 +894,7 @@ depend on the working-copy slot.
|
||||
|---|---|---|
|
||||
| A. Fictitious fingerprints | Worker stand-ins publish with `'a'.repeat(64)`: `packages/supabase/tests/sandbox/sheet-fixtures.ts:115` (`openRound`), `sheets-concurrency.sandbox.ts:168`, `sheets-perf.sandbox.ts:169`. Seven published or deprecated versions on the sandbox fail `check_published`; the owner opened three of them on 2026-11-09. | Compute the real fingerprint through the core as the catalogue e2e does (`fingerprintOf`), never weaken the publish gate or the reader's check. |
|
||||
| B. Working copy never archived | (a) `packages/supabase/tests/sandbox/sheets-admin.sandbox.ts` created the historical sheet's working copy (`8c315a12-…`, 2026-11-08 21:00:30) and never archived it; the single slot then disables « Créer une copie de travail » (`WorkingCopyAction.tsx:88`). (b) Even on a fresh stack `editor-equine.spec.ts` flips the slot while `admin.spec.ts:717` runs in parallel. Only the historical sheet offers the action, so the test depended on shared state. | FIXED (owner, 2026-11-12, option 1): the dialog's axe, layout and keyboard checks run on the real component in `e2e/ui/working-copy.spec.ts`; `admin.spec.ts` keeps the historical page and checks the button state against its reason; the sandbox suite archives only the copies it created (`returning id` checked) and each cleanup step runs independently. Limit: the dialog is no longer checked in its real server context by this accessibility test. Open: the creation branch of the cleanup is not yet run on a fresh stack. `editor-equine.spec.ts` still archives and restores pre-existing copies on every run. |
|
||||
| C. Silent card failure | Section 3, R4. | Show the failure, never hide or route around it. |
|
||||
| C. Silent card failure | Section 3, R4. | Show the failure, never hide or route around it. CLOSED by R4 (2026-11-17, §R4 « As built »): the card says its failure inside itself, « Consulter » kept, the check unchanged. The four sandbox entries it shows failing are anomaly A, still open. |
|
||||
|
||||
## 6. Arbitrations
|
||||
|
||||
|
||||
Reference in new issue
Block a user