Commit Graph
74 Commits
Author SHA1 Message Date
bchanot 9c606aa567 fix(anatomy): V1-2.2 the visible wins on the editor canvas
Owner decision 2026-11-01. The canvas paints and hits every point hitbox,
then every zone and trigger, then every visible twin, which captures on
what it paints; a junction's disc is no longer taken by the zone drawn
after it. The PDF view keeps the document order and its bytes. Click
spec: the five fixme run unmarked, six projects incl. a 320 px phone.
2026-11-01 00:56:11 +01:00
bchanot e67715025c test(pdf): R4.1 manifest call-1 svgSha256 for the isolated layer
Owner-authorised (brief 2026-11-01): the one byte digest no declared
transform can map, a9a3155c to 45fd4aaf. Call 2 and every other R4
digest unchanged; the original stays in Git history (87b8873).
2026-11-01 00:40:07 +01:00
bchanot 4f52f5e1c4 fix(anatomy): V1-2.2 marker layer and halo outside the drawing's group
Owner-approved lot B (brief 2026-11-01). The composition root is the
engine's (namespaces and frame); the drawing's root becomes a group and
the marker layer and halo are its siblings, so no root property reaches
a marker. Point hitboxes declare stroke none and visibleFill. Census over
the reader's whole allowlist; R3 references compared under the declared
transform; click proofs in three engines.
2026-11-01 00:39:57 +01:00
bchanot e823655f09 fix(anatomy): V1-2.2 owner arbitrations on SVG references and bytes
Refuse local references to ids a drawing does not define, scope canvas
ids per view, upload every drawing in one stored form checked by the
verdict and the preview, keep strict numeric rgb() colours, and commit
real Inkscape 1.4.3 exports with their generator.
2026-10-29 16:24:07 +01:00
bchanot 8ae756534c feat(domain): V1-2.2 wasm facade, contract types, module proofs
PreviewBuilder, PreviewSheet and clean_svg on the browser module, the
31 ts-rs types and their index, the glue interface, and the proofs on
the shipped module; the module stays under its 600 KB budget.
2026-10-29 13:14:22 +01:00
bchanot 930499cd25 feat(app): animal screens, relation panels, animals on the client page
Routes /app/animals, new, :animalId, edit under one workspace gate; list with
species filter; form (D-R7, U3 birth, no default sex or role, optional first
client); page with current and former relations, end, dates, void; client page
links its animals, adds one pre-associated, links an existing one. Card now
passes aria-labelledby, which it silently dropped.
2026-10-26 17:11:28 +01:00
bchanot 567ad40c80 fix(app): the « Client introuvable » screen focuses its heading too
Every client screen focuses its heading when it opens (contract §11.7); the
not-found screen did not. Unit and Chromium tests now assert the focus.
Found by the V1-1.5 verifier.
2026-10-26 02:11:15 +01:00
bchanot e1c1980949 fix(app): a re-read of the same account keeps its workspace on screen
USER_UPDATED (or a retry) set the workspace back to loading, which unmounted
the client routes and lost an open form's typed values. A ready workspace now
stays until the answer; found by the V1-1.5 security audit.
2026-10-26 02:08:25 +01:00
bchanot b38e62770e feat(app): clients list, page, create, edit, archive and restore
Routes /app/clients, /new, /:clientId, /:clientId/edit behind a workspace
gate that remounts per workspace; debounced POST search, archived toggle and
« Afficher plus » pages; form on field-limits (D-R7) with the phone entry
rule and ISO countries; request id per creation intent; conflict shows the
saved values; archive confirmation with the sole-owner preview; animals
read-only; leave guard on in-app links; Clients entry after the dashboard.
2026-10-26 01:59:25 +01:00
bchanot ff028ec071 feat(app): personal workspace in the account store, reset on account change
The store reads the personal workspace with the account (ready, loading,
inactive, unconfirmed, missing, error; never created in the browser). A
change of account drops profile, roles, avatar and workspace at once, and a
late answer for the previous account is ignored. generateUuid gives v4 ids on
the plain-HTTP LAN origin, where crypto.randomUUID is missing.
2026-10-26 01:59:25 +01:00
bchanot 8371aa0a2a fix(ui): keep the photo confirmation open until the removal settles
The dialog closed before the request, focus went back to the remove button, then the button vanished and focus fell on the page. The confirmation now closes with the photo gone, Escape and Cancel wait for it, and ModalDialog restores focus after the commit so its fallback sees the opener removed. The sr-only file input leaves the tab order: it was an invisible tab stop.
2026-10-25 22:46:18 +01:00
bchanot 6f885eccb2 feat(ui): modal dialogs on the native dialog element (D13)
ModalDialog wraps showModal(): the page behind is inert and does not scroll, focus starts on the first control and returns to the opener, or to the first control of its nearest container when the opener is gone. Escape and close requests only ask the consumer. Dialog gains aria-labelledby and an optional described message; the confirmations pass theirs. The mobile drawer uses the same primitive and closes at the sidebar breakpoint.
2026-10-25 22:36:31 +01:00
bchanot cd69f0ea11 test(tests): R5.7 census refuses #[ignore] ledger targets 2026-10-25 13:37:22 +01:00
bchanot 475a41d705 fix(tests): R5.7 gate findings, digest typo, census needs #[test] fns
RUST.md and FILES.tsv carry ba79698c...fde7; ledger cargo targets must name a #[test]
function. Verifier and security reports recorded, journal entry.
2026-10-25 04:18:52 +01:00
bchanot 1b359598ab chore(workspace): R5.7 delete packages/anatomy and packages/domain
The TS pipeline, domain, upload script and legacy scripts leave; xmldom out of the
lockfile, Dockerfile copies trimmed. LEDGER.tsv (407 cases) and FILES.tsv (112 files)
record each disposition; r4 and r5 census tests guard the tree, lockfile and
production imports.
2026-10-25 04:00:07 +01:00
bchanot 9e87016399 feat(domain): R5.6 fingerprint switch to sha256-rfc8785-validated-v1
The Rust pipeline is the official seed writer (pnpm import:equine); sheet-ref.json
and report-migration-map.json carry 12d78872...74e2 and the v1 block, the only two
seed files changed. 27c7383c...2660 stays a registered alias, honoured only through
LoadedSheet::recognises_historical_stamp (verified v1, recomputed document). M1: the
snapshot of an old report keeps its stamp; export, archive reader strict. Historical
oracles run in their pre-switch context; equivalence is crate-private.
2026-10-25 02:02:42 +01:00
bchanot 51a5a80192 fix(app): safeNextPath refuses a next value that normalises into //host (/..//, /%2e%2e//); dot-segment, scheme, encoding and consumer tests 2026-10-21 18:15:08 +02:00
bchanot 1877c4b340 test(ui): footer image test refuses protocol-relative sources 2026-10-21 15:50:24 +02:00
bchanot dcc79400de fix(ui): bundle the footer's ZenQuality logo (production CSP img-src 'self' refused the hotlink); CSP proof counts every violation; gitleaks allowlist carries the owner's [gated 2026-10-18] marker 2026-10-21 15:47:18 +02:00
bchanot 0dc1ba27c7 refactor(pdf): R4.8 the TypeScript PDF engine leaves: packages/pdf, pdf-lib, the TS CLI and import path, the oracle generators deleted; test read-back on an own reader of the writer's files (pdfFile.ts), view goldens from the session's SVGs, import helper on the module's reader, N-1 scanner exported by core-wasm/n-1; app no longer depends on @faunosteo/domain; r4.census suite 2026-10-19 12:17:01 +02:00
bchanot 264c5fa3fc docs(docs): RUST.md §10.8 R4.6 record (buffers, memory, parity, E3/E4 three engines, release series, W1, risks); ledger targets filled; compare-exports script; roundtrip raster-failure case; TODO R4.6 closed; memory BDR-062, LRN-063/064, journal 2026-10-19 02:49:42 +02:00
bchanot cdcdda8e1c docs(docs): R4.6 J2 recette (procedure, results grid, kit script), export harness phases and dist override, export series script, ledger targets of the app PDF suites, CLAUDE.md export flow; export driver publishes its User Timing split 2026-10-19 01:41:57 +02:00
bchanot d492bf7112 feat(pdf): R4.6 app export on the core's session: export.ts drives ExportSession (rasters one by one, warnings in the engine's order, abort on unmount), labels moved to the app, EditorRoute downloads the Blob of the parts; suites read the file's content streams (pdfRead helper), app-path bytes = R4 digests, hex strings upper-case as pdf-lib 2026-10-19 01:26:13 +02:00
bchanot 9e688b6801 feat(domain): R4.6 ExportSession (incremental export, OD-2): rasters decoded and written on arrival, chunked file handed out in parts, views composed by the core, raster_size_of (O4); wasm ExportSession and CoreExportSession; R4 digests re-frozen (catalog and page tree written last, B2) 2026-10-19 01:15:43 +02:00
bchanot 50c8fe0b33 feat(domain): R4.5e wasm proof export, resources per page, N-1 and TS-engine read-back, cost comparison
export_pdf_for_test on the proofs build (ExportInput JSON + base64 rasters): the 14 O2
runs give the native digests through wasm; the frozen O11 scanner reads every R4 PDF and
the N-1 Zod readers accept its envelope; a stripped R4 PDF answers attachment_stripped;
the TypeScript engine reads the R4 PDFs back to the R3 outcome; E2 size ≤ R3 + 5 %. Page
resources list the images the page draws (listing every embed cost 9 MB on CAP). Node,
stub rasters, TS → Rust: demo 198 → 36 ms, L 772 → 57 ms, CAP 5.7 s → 0.22 s; files
236 KB, 386 KB, 1.6 MB against 243 KB, 463 KB, 2.2 MB. Module with the writer linked
(proofs build): 531.6 KB gzip; shipped unchanged at 426 KB until R4.6 links it.
2026-10-18 23:21:05 +02:00
bchanot 4d45de5745 feat(domain): R4.5b/c serialiser, export driver, self-check, from_envelope; O2 parity suite
objects.rs (own minimal writer: numbered objects, streams, classic xref, pdf-lib's string
forms; pdf-writer not used: every number spelt through numberToString, no f32), serialize.rs
(catalog with names tree and AF, pages, 3 Type1 WinAnsi fonts, image XObjects with the
DeviceGray SMask, Link annotations with hex ASCII URIs, Info with Producer/Creator
Faunosteo, the Flate attachment with Params and Filespec), export.rs (checks → envelope
as JSON.stringify(_, null, 2) → layout → file → self-check through the R4 reader;
export_from_envelope). cargo pdf_serialize against the 14 R3 PDFs: content streams equal
after resource-name resolution, image planes and SMasks equal, links equal, Info equal
but Producer/Creator, attachment bytes equal (store path: values equal, D-R11 order);
qpdf --check clean, pdfdetach lists the attachment, poppler 150 dpi 0 pixel differs on
14 runs; R4 PDF → Rust import = R3 PDF import, re-export from the envelope byte-identical;
R4 output digests frozen in goldens/r4/pdf.*.sha256.
2026-10-18 23:10:18 +02:00
bchanot e659924ec0 feat(app): R4.3a the page reads the file chunk by chunk and streams it to the worker's sink
Measured at R4.3a (RUST.md §10.5): reading a file inside a WebKit worker costs about
180 MiB of content RSS whatever the method (arrayBuffer, stream, BYOB), 14 MiB on the
page; a page-side BYOB read feeding the worker's FileBytes gives 106 MiB on a 50 MiB file
against 272 in the worker and 76 for the TypeScript. Protocol v1 gains chunk / ack / end:
one 1 MiB buffer travels (transferred) and comes back after each push, so the page holds
one chunk and the worker's sink the only whole copy; no byte is parsed on the page. The
worker refuses an oversize announced before any chunk and a size that changes while
reading. Tests adapted (handler, client with a scripted ack, read failure on the page).
2026-10-18 18:57:55 +02:00
bchanot 6d1cce6e06 feat(app): R4.3b/c import worker, client, controller; HomeRoute on the disposable worker
Protocol v1 (task → ready → result | failed with phase and kind), the worker entry with
the glue bundled statically and the page's compiled Module posted, the file streamed into
the module's memory; client with start and task timers (paused while hidden), settle-once,
terminate always, error events never masked; module-level controller (one import at a
time, cancel on leaving Home, worker chunk prefetched once the engine is loaded); the
settlement mapped to the B.1.8 messages (OD-5: a trap, a timeout or an unreadable file is
« Erreur de lecture du PDF. », never a corrupt PDF). HomeRoute keeps its routing and size
pre-checks, loads its own index after acceptance, drops a result when the session changed.
Tests: handler and client in-process, the corpus message test (O8 51, O7 stored inputs,
O2/O3/Step 5), the six existing suites migrated to the real worker logic.
2026-10-18 18:10:42 +02:00
bchanot aada7997de docs(docs): R4.1 freeze record (RUST.md §10 draft, fixtures README R4 section)
Oracle table with commits, ledger totals, repository weight, freeze findings,
TypeScript baselines in Chromium, Firefox and WebKit with the watchdog
caveat; TODO R4.1a-f ticked; journal line.
2026-10-18 15:13:19 +02:00
bchanot 4bdfda59ba test(tests): R4.1f O10 report:compare outputs and the R4 test ledger (299 cases) 2026-10-18 06:00:34 +02:00
bchanot 96df15edae test(tests): R4.1d O7 reader outcomes (155 inputs, regex-semantics rows) and O9 inflate verdicts (Node) 2026-10-18 05:35:12 +02:00
bchanot 87b88739f8 test(tests): R4.1b writer oracles: O1 draw logs, O2 R3-build PDFs (real raster, store path), O3 pre-R2 envelope PDFs 2026-10-18 05:25:57 +02:00
bchanot 7a4297933d test(tests): R4.1d O8 differential tolerance corpus on the full R3 import path (51 cases) 2026-10-18 05:21:10 +02:00
bchanot 7ecbee9aae test(tests): R4.1a frozen TS scanner (N-1 PDF reader) and synthetic L/CAP reports 2026-10-18 05:19:41 +02:00
bchanot 2b8000e5ab fix(editor): PDF export download keeps its URL alive (WebKit may cancel) 2026-10-18 04:53:45 +02:00
bchanot 9bd9acaf58 fix(app): rescue copy importable, trapping draft held, replace confirmed
The JSON rescue copy could not be restored in the app, a draft that traps
the engine left the tab on a reload screen and spent a recovery on every
read, and an unsaved or in-progress report could be lost by a reload
outside the editor or by New report / Import without warning.

Home import reads the copy (content-sniffed, 16 MiB cap, strict UTF-8)
through the core's draft.restore before any session change; a trapping
(draft, archive) pair is held in the resolution panel and only re-read
on Retry; ReplaceSessionDialog guards New report and Import; the
beforeunload guard is app-wide while unsaved. Supersedes BDR-055's
"never held" for `internal` only.
2026-10-17 12:58:57 +02:00
bchanot 6371523f8c fix(editor): honest stopped state when the draft is unsaved; no dead retry
0279953 chose the stopped message from CoreRuntime.stopped alone: it
promised the report was kept even when the tab's storage refused the
draft (export, the banner's advice, needs the core), four surfaces still
offered a retry that could not work, and a failed recovery below the cap
was a dead end since nothing called retry().

The runtime restarts a failed recovery on the next call (compiled module
reused, cap still counts traps) and notifies status listeners. One
CoreStoppedNotice on the editor, Home, New report and the full-page
notice: reload when saved, else core.stopped_unsaved with a core-free
copy download (also on the storage-full banner) and a beforeunload
guard. Export, import and new report say the stopped message; a core
failure reading an unread draft is FAILED, not held. ESLint census of
the failure keys; core.stopped says "plusieurs erreurs".
2026-10-16 18:26:10 +02:00
bchanot 0279953e9e feat(editor): a clear final state once the engine spent its three recoveries (canvas and action alerts) 2026-10-15 17:58:11 +02:00
bchanot c0a5c8c7ce feat(editor): the canvas tells an engine failure (retry) from a view it cannot draw (no retry) 2026-10-15 01:03:16 +02:00
bchanot 09a6cf7def feat(editor): the canvas draws the view the Rust core composed; denylist and anatomy dependency removed 2026-10-14 23:59:46 +02:00
bchanot 47c5f49014 test(tests): R3 freeze O1 canvas trees and the visual comparison script 2026-10-14 23:26:20 +02:00
bchanot c97b0e7c67 fix(store): banner on a refused archive write, rescue download kept alive 2026-10-14 23:18:33 +02:00
bchanot a37c50b9ee fix(store): drop the replaced archive when the new one cannot be written 2026-10-14 23:15:54 +02:00
bchanot e34b7f282e fix(store): hold session texts whose set-aside fails, never overwrite them 2026-10-14 23:11:59 +02:00
bchanot da8a0370cb fix(app): set lone-surrogate texts aside or refuse them with a message (L1)
A draft the core refuses as lone_surrogate is unreadable content: it
goes to osteo:quarantine:draft verbatim with the existing notice. An
import is refused as ImportError('lone_surrogate') with the owner's
wording (home.import.error_lone_surrogate, FR/EN), the file untouched.
The publish gate reads the kind as invalid_shape. Tests on the real
core: quarantine keeps the exact text, an editor action leaves the
report as it was, normal text with pairs and literal backslashes reads
unchanged.
2026-10-14 21:49:39 +02:00
bchanot 74fcb37564 feat(app): R2 switch — the application runs its domain rules in the Rust core
Consumers now fed by the core (crates/core through @faunosteo/core-wasm):
- the sheet: the bundled payload is parsed and indexed by the core
  (SheetHandle, SheetIndexData); SheetIndex reads precomputed tables only;
- the store: new report, add / remove / move observation, draft restore
  (v2 migration + rebase) through the core, actions answering { ok };
- the editor click chain (zone.click), laterality and vertebra pickers
  (zone.add_sides, vertebra.initial / sync / select), the findings picker
  (finding.toggle by clicked leaf position), zone removal;
- the import: engine byte scan (TypeScript until R4), then the core's
  layered reading and rebase in one call; the export: the core builds the
  sheet snapshot, the frozen TypeScript engine writes the PDF (R4).
Lazy core: Home and the new-report form read the sheet availability from
the bundle and load the module on import / submit only; the auth shell
never references it. Degraded states (core_unavailable, invalid_sheet)
show the validated notice with a retry and never redirect or touch the
draft; an unreadable draft or archive is set aside under
osteo:quarantine:* (only content kinds; a failed write keeps it in place
and the editor stays), a rebase that flags items keeps the raw pre-rebase
draft. Four strings, wording validated by the owner.
Deleted: services/zoneInteraction.ts and its suite (13 cases ported to
cargo), the TypeScript Finding builder and vertebra selection rules of the
pickers, store rules, persistence parsing, hydrateReport. ESLint forbids
@faunosteo/domain in apps/app/src; the report:compare CLI keeps the frozen
domain until R4 (scripts/compare/sheet.ts). App suite 313/313 on the real
core (24 new tests: quarantine, degraded editor, core failures, N-1
reader); step6 goldens and the frozen envelopes unchanged.
2026-10-14 00:41:34 +02:00
bchanot 3639c8778e feat(domain): R2.3 editor rules in Rust — zone click chain, reducers, finding toggle, vertebra selection, report operations
zoneInteraction (decision + reducers, collectVertebrae concatenated-key
dedup, syncVertebrae Map order), FindingsTreePicker.toggleLeaf (clicked
leaf by position, parents first-wins), VertebraPicker toggle/all/none and
the store's newReport/add/remove/move, checked against 49 cases frozen
from the TypeScript (41 byte-equal, 8 equal up to key order: contract
order replaces insertion order, D-R11) and the 13-case service suite.
Typed error kinds where the TypeScript would throw or corrupt a list.
2026-10-14 00:17:22 +02:00
bchanot 3114d67959 test(tests): R2 freeze — archive envelopes of the three golden reports and the frozen N-1 reader
Envelopes exported by the TypeScript domain before the Rust switch (FR, no
logos, fixed export time) are the semantic oracle of the switch (D-R11:
key order may change, values may not). The shipped Zod schemas are copied
verbatim under packages/core-wasm/tests/n-1 (develop 1a7ee7d) so a rollback
reader stays testable after packages/domain is deleted at R5.
2026-10-13 23:53:12 +02:00
bchanot 926dd7df8c feat(app): profile photo — avatar upload in Mon compte, photo in the sidebar, drawer and top bar
packages/supabase assets module: closed AssetFailure kinds, begin / quarantine
upload (upsert off) / confirm / remove, own-row state read with an explicit
column list, download under the SELECT policy. App: client transport (magic
byte sniff, never SVG, createImageBitmap, canvas 1024 px, JPEG 0.9, 5 MiB
cap), AvatarSection (preview, save, 1 s polling up to 30 s, rejection and
failure messages per closed code, removal with confirmation, in-flight row
resumed at mount), auth store blob URL revoked on change and sign-out,
AvatarCircle in UserBadge and the top bar link to Mon compte (D3), FR/EN
strings, fake client extended, 27 new tests (app 300).
2026-10-13 19:32:37 +02:00
bchanot 1aed64b4ef fix(app): safeNextPath resolves next= against a sentinel origin (closes the /\host and tab/newline open redirect); tests; contract amended 2026-10-11 23:44:00 +02:00