Commit Graph
40 Commits
Author SHA1 Message Date
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 21906c4358 feat(domain): R2.2 report migration, rebase, sheet snapshot and layered archive reading in Rust; draft restore and archive import operations
migrateReportV2ToV3 / readReportDocument (version read on the raw value,
JS truthiness kept, a malformed mapped path still fails the read),
rebaseReportOnSheet (??= labels, archived names first-match),
buildSheetSnapshot / assertSnapshot (raw depth, shape, caps in UTF-16 and
UTF-8, integrity), readArchiveDocument (layered: report first, wrapper,
snapshot gate, sheet invariant, unsupported_envelope origin quirk).
Checked against 84 cases frozen from the TypeScript and 765 Zod verdicts
(one declared difference: L1, a lone surrogate reads as U+FFFD), the
ported report and archive suites and the 612 legacy leaves. Facade:
draft.restore (content kinds invalid / unsupported_version, rebase_failed
never a content kind), archive.import (incompatible_version with found,
no_attachment), archive.snapshot.
2026-10-14 00:28:02 +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 9771d997f4 fix(app): failed sign-out reported (local session still cleared); reauthentication_needed phrased; docs(docs): exact production redirect allowlist 2026-10-11 23:45:14 +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
bchanot aeea1f2e9b chore(app): drawer honours prefers-reduced-motion; chore(memory): BDR-041, LRN-047, journal, TODO 7.x 2026-10-11 23:40:11 +02:00
bchanot aa1985eead test(app): identity step — auth store, locale sync, login/signup, guards, shell, dashboard, account
- tests/helpers/fakeSupabase: in-memory auth events + profiles/profile_roles builder
- validation schemas and safeNextPath; classifyAuthError mapping (packages/supabase)
- LoginRoute (unavailable, validation, next path, phrased failure, OAuth buttons, show password)
- SignupRoute (policy, mismatch, metadata + redirect, user exists)
- RequireAuth / RedirectIfSignedIn, AppLayout (nav, active, drawer, sign out), Dashboard, Account forms
2026-10-11 23:33:25 +02:00
bchanot c517ea267b feat(app): identity screens and /app shell — auth store, login/signup/reset flows, dashboard, account
- state/authStore: session subscription (initialize + onAuthStateChange), profile + roles load, recovery flag, URL failure; services/localeSync: profiles.locale <-> localeStore
- routes: /login, /signup, /forgot-password, /reset-password, /auth/callback; guards RequireAuth (next=) and RedirectIfSignedIn; /app (dashboard), /app/account behind the guard
- shell: AppLayout (desktop sidebar, light top bar, mobile drawer), SidebarNav, UserBadge, SignOutButton
- account: personal / professional / preferences / security sections, one save each, Zod validation with i18n keys
- ui: Icon, FormField, Notice, ButtonLink (buttonClassName shared), PasswordField, OAuthButtons (config-driven)
- Home header: Mon espace / Se connecter when Supabase is configured; local tool routes untouched
- i18n: auth.*, shell.*, dashboard.*, account.*, home.space.* in fr + en
2026-10-11 23:29:13 +02:00
bchanot 0f7292f9b3 test(config): authProviders parsing; fixture carries the new field 2026-10-11 23:16:57 +02:00
bchanot b10b227ee9 feat(supabase): auth, profile and roles services; professional columns on profiles; OAuth + TOTP config
- packages/supabase: signIn/signUp/OAuth/reset/updatePassword/signOut wrappers with a closed AuthFailure kind, fetch/update own profile, own platform roles
- migration 20261011100000: practice_name, professional_title, siret (format-checked, column grants); pgTAP 009; database.types regenerated
- config.toml: TOTP enroll/verify on, [auth.external.google|apple] via env(), wildcard redirect URLs
- app config: authProviders (APP_AUTH_PROVIDERS / VITE_AUTH_PROVIDERS), entrypoint env.js, DEPLOY table
- TODO: Step 7 plan
2026-10-11 23:16:13 +02:00
bchanot 60ee71208f fix(pdf): bounded attachment extraction by byte scan — no pdf-lib parse on import, export without object streams (BLK-009) 2026-10-11 16:42:45 +02:00
bchanot 62b8a43e09 feat(home): import messages open with a full-restoration or partial-recovery headline; BDR-040 recorded 2026-10-11 16:31:37 +02:00
bchanot e8f1734424 feat(editor): tell the practitioner when a restored draft was rebased on a different sheet 2026-10-11 16:15:13 +02:00
bchanot 293a6e0b36 fix(pdf): bundle the branding assets into the app (no fetch at export), export returns its warnings and the editor reports missing elements 2026-10-11 16:09:39 +02:00
bchanot 1f417b21fd fix(pdf): security hardening — hex-encoded link URIs, strict branding URL schema, branding and labels re-validated at export, PNG dimension budget, CSS escape and parenthesis rules in the sanitiser, finite raster size, file size checked before read 2026-10-11 13:54:18 +02:00
bchanot 9bd5173a9c feat(app): export and import through @faunosteo/pdf — snapshot, archived branding and labels, browser rasterizer, imported archive kept in session, explicit rebase with messages; legacy PDF modules removed 2026-10-11 13:32:14 +02:00
bchanot cdc0943f35 feat(domain): archive contracts — sheet snapshot (lean document, caps, integrity), envelope v1 layered reader, branding and label schemas, report rebase, sheet index moved from the app; bundle carries asset hashes 2026-10-11 12:30:57 +02:00
bchanot 8b86b926c8 test(pdf): step 6 phase 0 freeze — demo report, bare v3 PDF, 39 goldens (text, images, links, views) and route characterisation tests 2026-10-11 12:13:36 +02:00
bchanot 1f0b710b6e fix(editor): drop the permanent will-change on the findings list, its text blurred on screen 2026-10-10 22:15:09 +02:00
bchanot 388e209ea9 fix(pdf): report:compare --diff follows the privacy default, generic reason on a malformed attachment, Unicode control and format characters escaped, regular files only 2026-10-10 16:01:12 +02:00
bchanot b1b3e4927e fix(pdf,tests): report:compare escapes control characters, prints names and free text only with --full, stats before read, missing file as a per-file failure; inferRegionCode regression test; import.ts JSDoc reattached 2026-10-10 15:53:07 +02:00
bchanot dc78a00835 feat(pdf): archive check tool pnpm report:compare (attachment vs its v3 reading, unresolved items flagged, --diff/--summary/--identity); readAttachedDocument split out of extractReportJson; stale scaffold:species script removed; docs 2026-10-10 15:44:20 +02:00
bchanot 1e0491f3bc test(anatomy,app): every legacy catalog leaf (612) and annotation (27) through the v2 to v3 migration against the draft document, the sheet index and a PDF roundtrip 2026-10-10 15:44:20 +02:00
bchanot e7f4167ada fix(domain,app): own-key lookups for untrusted ids in the v2 migration, attachment and PDF size caps; EVAL-011, journal, TODO 2026-10-10 12:23:03 +02:00
bchanot 17a6d9b323 test(app): former PDF, observation card, route and schema assertions restored on v3; foreign JSON attachment reported as no_attachment; doc counts 2026-10-10 12:21:19 +02:00
bchanot 06a2e86f3c test: replacement coverage for the deleted legacy suites (v3 schema rejections, appointment kinds, i18n keys and placeholders, pickLocaleLabel, region mapping, new report route); importer comment 2026-10-10 12:06:59 +02:00
bchanot 09d8b01a54 fix(app): editor route split into dialogs and pickers components, canvas without lint suppression, findings picker coverage restored; golden test pins every generated draft file; stale doc lines 2026-10-10 11:55:57 +02:00
bchanot ce2ec26112 feat(app): application on the canonical sheet — report v3 store with v2 draft migration, bundled SheetProvider (SHEET_BUNDLE), annotation layer rendered from the document, zone interaction service, pickers and cards on the sheet index, PDF v3 export with v2 archive import; legacy registry, matchers, editors and assets removed 2026-10-10 11:36:14 +02:00
bchanot 0a17e390cf feat(anatomy): report migration map and sheet reference generated by the pipeline, pure annotation-layer renderer (legacy marker look) shared with the app, app review drawings, marker colours as document data 2026-10-10 11:17:34 +02:00
bchanot cce0bdcd9c test(app): freeze golden v2 PDFs exported by the current pipeline (step 5.0, synthetic reports) 2026-10-10 11:06:53 +02:00
bchanot ab04b2e43d style(supabase): prettier pass on the new TypeScript files 2026-10-08 22:46:37 +02:00
bchanot d239374d81 feat(app): optional Supabase connection in runtime config + lazy typed client
- env.ts: supabase: SupabaseConnection | null resolved from env.js
  (supabaseUrl/supabaseAnonKey), VITE_SUPABASE_*, else null; half config refused
- lib/supabase.ts: getSupabaseClient() null when unconfigured, one client per URL
- entrypoint.sh writes the two public values; .env.example placeholders
- Dockerfile copies packages/supabase manifest for the install layer
- no UI change; 7 new tests (278 app)
2026-10-08 22:43:18 +02:00
bchanot 8673475293 chore(workspace): move the app to apps/app under a pnpm workspace (step 2)
144 files moved with git mv (pure renames). Root package.json delegates
dev/typecheck/test:run/lint/build to the packages; Node 24 LTS and
pnpm 10.13.1 pinned (.nvmrc, .node-version, engines, packageManager,
root devDependency, engine-strict). Dockerfile builds @faunosteo/app on
node:24-alpine and copies apps/app/dist; nginx and runtime config
unchanged. CI workflow for Gitea Actions. packages/ reserved (README only).
Docs synced: WORKSPACE.md, CLAUDE.md, README, DEPLOY, CHANGELOG, plan.
271/271 tests, typecheck, lint, build green from the root.
2026-10-08 21:51:13 +02:00