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.
12 KiB
12 KiB
Changelog
All notable changes to Faunosteo are documented here. Format: Keep a Changelog. Versions follow Semantic Versioning.
[Unreleased]
Changed (SaaS migration, plan Step 2)
- pnpm workspace — the application moved to
apps/app(@faunosteo/app) withgit mv; root commands (pnpm typecheck|test:run|lint|build|dev) delegate to the packages.packages/reserved, empty. CI workflow added (.gitea/workflows/ci.yml). - Node 24 LTS / pnpm 10.13.1 — declared in
.nvmrc,.node-version,engines,packageManager;engine-stricton; Dockerfile builds onnode:24-alpineand copiesapps/app/dist.
Added (SaaS migration, plan Steps 0–1)
- Implementation plan —
docs/development/(27-step plan, migration map, domain map, architecture, strategies, open questions). - Characterisation suite — 91 tests on the real SVGs, catalog and PDF pipeline; two golden Report v2 fixtures (
CHARACTERIZATION_REPORT.md).
Added
- Laterality & bilaterality —
LateralSideSchema(left/right) +Bone.lateral,data-anno-lateralparsed from the SVG;LateralityPickermodal in the zone-click flow, side shown in zone badges and PDF labels; bilateral zones get a separate findings picker per side. - SVG anatomy editor —
/svg-editorroute, the vanilla annotation tool wrapped in React (BDR-017). - Standalone pathology editor —
public/pathology-editor.html, a zero-dependency JSON tree editor with SVG zone selection (BDR-020/021/022). - Welcome screen — tabbed editor entry with a project SVG picker;
/editorslisting page. - Footer branding — global footer with copyright, "Powered by ZenQuality" and the "Paws in Harmony" partnership logo, on both the site and the exported PDF.
- gitflow socle —
main/developmodel + versioned pre-commit hook.
Changed
- Unified
AppHeaderacross every route (logo brand + tagline). - Responsive mobile — full phone/tablet adaptation across all components.
- Project renamed Zoosteo → Faunosteo across the whole codebase.
Removed
canvgdependency — PDF SVG rasterization now uses the browser's nativeImage/canvaspipeline (src/pdf/render/svgToPng.ts) instead of thecanvglibrary.
Fixed
pathology-editor.html404 in production — it lived at the repo root, Vite never bundled it intodist/; moved topublic/so it ships (LRN-029).- Docker species caching —
Cache-Control: no-cacheheader added for/species/assets so an updated catalog is served fresh. - nginx runner base image pinned to
nginx:1.31-alpine(was the floatingnginx:alpinetag).
Security
- Docker container runs fully as non-root (
USER nginx) —PORTmust now be>=1024(default8080unaffected). - Supply-chain guard —
.npmrcgainedminimum-release-age=1440, blocking install of package versions published less than 24h ago. - User-imported SVGs sanitized — the SVG editor and the standalone pathology editor now strip
<script>/<foreignObject>nodes,on*event-handler attributes, andjavascript:hrefs before inserting an imported SVG into the DOM.
[0.1.0] — 2026-05-21
First public release. Single-praticien web app for veterinary osteopathy bilans on animal anatomy SVGs. Static SPA, no backend, no auth; the exported PDF is the long-term record, with the full report JSON embedded as a native PDF attachment so re-importing the PDF restores the session for a follow-up.
Added
- Anatomy canvas — inline SVG with clickable zones, hitbox+visible twin pattern, delegated click listener, async-mount safe.
- Detail popups — click a zone (e.g. head) to open a secondary SVG with finer-grained zones. Independent bones map, fallback lookup across main + detail.
- Vertebra picker — region tabs (C/T/L/S/Cd) with multi-select chip grid; region tab preselected from the clicked zone label.
- Hierarchical findings tree — per-zone picker with breadcrumb drill-down, leaf toggle, vet-referral badge, count badges on intermediate nodes, scope-disclaimer modal shown once per session.
- Bilingual UI (FR / EN) — full i18n via flat dict +
useT()hook, language switcher in every header, locale persisted tolocalStorage, default auto-detected from the browser. - PDF export — A4 portrait with rasterized anatomy SVGs (canvg
@ 2×), structured per-zone observation sections (
CONSTATS — <ZONE>CONSTATS LIBRES), severity pill, conclusion page, locale-aware static labels. Inter-item separator rendered as accent-coloured bold bullet.
- PDF import — Zod-validated re-import of a previously exported PDF
restores the entire session. Typed
ImportError(discriminant +foundVersion) with i18n-resolved user-facing messages. - Practitioner cache — last-used practitioner block prefilled via
localStorage. - Runtime identity —
APP_SITE_NAME/APP_BRAND_NAME/APP_FOOTER_NAME/APP_TAGLINEinjected intoenv.jsat container start; no rebuild required for brand changes. - Species auto-discovery — drop a
src/domain/species/<id>/index.tsdefault-exporting aSpeciesManifestand the species appears in the picker.pnpm scaffold:specieswrites a valid skeleton. - Findings catalog v2.0 — full equine catalog authored by the
domain expert: 26 zones (9 head + 17 body), 792 nodes, 612 leaves,
41 vet-referral leaves. Schema documented in
docs/PATHOLOGIES-FORMAT.mdwith the 3 standardized categories per zone, 5 taxonomy patterns for dysfunctions, structural authoring rules (depth ≤ 4, ≥ 2 children per intermediate, sibling-scoped ID uniqueness), and the legal-scope disclaimer. - Fuzzy zone matcher — SVG
data-anno-name-fr/-en↔ JSONzone.name_fr/name_enbridged via normalize + Levenshtein (EN-first, FR fallback). Tolerant of case, accents, and minor typos. - Docker delivery — multi-stage
Dockerfile(node:20 → nginx:alpine),docker-compose.yml,entrypoint.shruntime env injection, nginx SPA fallback +env.jsno-cache rule. Production deploy guide inDEPLOY.md. - Documentation —
README.md,CLAUDE.md(project conventions for Claude),docs/ANATOMY-SVG-CONVENTION.md(SVG data-* contract),docs/ADDING-A-SPECIES.md(recipe for a new species),docs/PATHOLOGIES-FORMAT.md(findings JSON authoring contract),docs/PDF-FORMAT.md(PDF layout placeholder), and project-state notes under.claude/{tasks,memory,audits}/.
Changed
- Report schema v1 → v2:
Observationcarries hierarchicalfindings: Finding[](zone + path + snapshotted FR/EN label + vet flag) andfreeTextFindings: string[]; oldpathologyIds/freeTextPathologiesremoved.ReportSchema.versionbumped1→2. v1 PDFs are not migrated — they hard-fail import with a version-specific message (no install base to justify a migration shim). - Catalog v1.2 → v2.0 contract:
requires_vet_referralboolean is now the sole source of truth for the vet-orientation flag. Generic "orienter vers vétérinaire" wording purged fromdescription_fron 25 leaves where the boolean alone sufficed. 16 leaves carrying a clinical differential (cause neuro/sinusale/ ligamentaire/etc.) keep theirdescription_fr. Consumers relying ondescription_fr.includes('vétérinaire')must migrate — all in-tree consumers already key off the boolean. - PDF locale = render preference, not a schema field. Finding
snapshots already carry both FR and EN labels (
labelFrSnapshot/labelEnSnapshot), soexportReportToPdf(report, { locale })picks the right snapshot at render time without a schema bump. - PDF date format — locale-aware via
formatDate(iso, locale), replacing the FR-onlyformatDateFrhelper.
Fixed
- PDF export crashed
WinAnsi cannot encode "⚠" (0x26a0)whenever an observation carried arequires_vet_referralfinding —pdf/fonts.tsembedsStandardFonts.Helveticawhich uses WinAnsi (cp1252, Latin-1 only). PDF vet-referral marker swapped⚠→(!); picker DOM keeps⚠(browsers render U+26A0 natively). Regression test added onwidthOfTextAtSize+ prefixed label. Follow-up tracked: switch PDF body to embedded TTF (Inter / Fraunces perCLAUDE.mdspec) so future non-Latin-1 glyphs work without ASCII surrogates. - PDF import error messages localized via typed
ImportErrordiscriminant — the prior FR-only messages leaked through to the EN UI on import failure. - Detail-popup zone clicks silently dropped — main-only bones map
did not know detail SVG ids; fallback lookup
bones.get(id) ?? detailBones.get(id)added in the shared click handler. - PDF text overlap —
drawText({ maxWidth })wraps glyphs but not the cursor; caller now measures withwidthOfTextAtSizeand advances cursor per wrapped line. - PDF multi-SVG layout — observation pages with N SVGs overflowed page bounds. Now: pre-rasterize all, measure aspect, reserve text-area height, derive cell budget per row; single-SVG layout halved + centered.
- PDF anatomy rasterization leaks — interaction-only attributes
(
data-anno-*, transparent hitboxes, faint default fills) stripped before raster, non-selected zones hidden, selected zones recoloured. - Zone highlight scoping — collapsed observations no longer leave faint tints on the canvas; highlights re-painted after async SVG mount so detail-popup zones colour correctly.
- Hyoid label case — SVG
data-anno-name-fr="hyoïde"→"Hyoïde"to match the JSON strict-equality rule across all 26 zones (fuzzy matcher still acts as safety net). - i18n key parity — fr/en dicts validated by a parity test
(
Object.keys(fr).sort()deep-equalsObject.keys(en).sort()) so a missing translation fails CI instead of falling back to the key literal at runtime.
Known limitations
- PDF body fonts are
StandardFonts.Helvetica/TimesRoman(WinAnsi / Latin-1) instead of the planned TTF Inter / Fraunces. Any non-Latin-1 glyph in PDF text needs an ASCII surrogate until the TTF migration lands. description_frfor sensitive vet-referral leaves and thescope_disclaimerare FR-only; vet-expert authoring is needed for the EN copy.- Only the equine species ships. The infrastructure (manifest + auto-discovery + scaffold script + schema) accepts any species — domain expert authoring is the gating step.
- No backend, no accounts, no cloud sync. Each PDF is the long-term record for the corresponding bilan.
Pre-1.0 milestones (for reference)
These were never tagged but are reflected in git history on main.
- Scaffold (2026-05-18) — initial skeleton from approved design
spec: 80+ files (schemas, stubs, routes, stores, PDF modules, Docker
infra), real
Horse.svg+Horse_head.svg,pnpm/build/typecheck/testsall green. - Editor polish (2026-05-19) — detail-popup click bridge, VertebraPicker auto-region, PDF rendering fixes (header rule clear, text-line wrapping, multi-SVG grid, halo glow), eyebrow + Times 22 title + accent severity pill.
- Findings tree pivot (2026-05-20) — B0 schema (
findings.tsZod), B1 Report schema v2 (Observation.findings), B2 UI (FindingsTreePickerreplaces flatPathologyPicker), B3 i18n FR/EN site + PDF, B5 stub cleanup.requires_vet_referralboolean introduced alongside the textual fallback. - Catalog v2.0 + WinAnsi hotfix (2026-05-21) — full 26-zone horse
catalog landed,
requires_vet_referralbecomes the sole source of truth, PDF vet marker swapped to a WinAnsi-safe surrogate. Docs refreshed,DEPLOY.md+CHANGELOG.mdwritten, repo pushed tohttps://git.bchanot.fr/bchanot/faunosteo.git.