Commit Graph
36 Commits
Author SHA1 Message Date
bchanot 52bfc11553 feat(domain): equine legacy importer (packages/anatomy) + generated official equine sheet seed as draft 2026-10-09 00:38:48 +02:00
bchanot 12f0b21fdf feat(domain): finding kind observation → consultation_reason; Step 4 business decisions in spec + memory (BDR-033) 2026-10-09 00:24:22 +02:00
bchanot 5d32bed829 docs(docs): sheet model spec matches the hardened code (counter, SQL-only codes, census, migration list) 2026-10-09 00:05:39 +02:00
bchanot d3fa65af29 fix(supabase): revoke PUBLIC EXECUTE on private helpers, audited visibility RPC, input caps, authz-first RPCs, +32 pgTAP checks 2026-10-08 23:59:39 +02:00
bchanot 6966c54a2e docs(docs): Step 4 sheet model in CLAUDE.md, SUPABASE.md, WORKSPACE, README, plan note, changelog 2026-10-08 23:45:01 +02:00
bchanot aea8902711 docs(docs): anatomical sheet model spec (Step 4) + TODO plan 2026-10-08 23:42:42 +02:00
bchanot fcdcfb53b2 docs(docs): real-stack verification notes; BLK-006 resolved, EVAL-007, LRN-037 2026-10-08 23:04:22 +02:00
bchanot 1dd45a3109 docs(docs): SUPABASE.md runbook + CLAUDE/README/DEPLOY/WORKSPACE updated for the Supabase foundation 2026-10-08 22:46:38 +02:00
bchanot 02052f3622 docs(docs): restore 2026-05 design specs and plans under docs/history
Purged from docs/superpowers by the gitflow finish of step 1 (BDR-065);
that path is purged at every finish, so the records live under
docs/history/superpowers/ instead. References updated.
2026-10-08 21:51:13 +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
bchanot 8f217d8103 chore: purge transient planning artifacts (BDR-065) 2026-10-08 21:41:51 +02:00
bchanot e84cbaf884 test(tests): add characterisation suite of the current app (step 1)
Seven files, 91 cases, on the real SVGs and catalog: catalog invariants,
SVG <-> catalog mapping table, pathology-editor matcher parity, click chain
through the DOM, full PDF export/import, schema and persistence, i18n and
species. Two golden Report v2 fixtures. No application file changed.
Report: docs/development/CHARACTERIZATION_REPORT.md. 271/271 green.
2026-10-08 21:41:39 +02:00
bchanot b0cce2cd8c docs(docs): add SaaS implementation plan and architecture docs (step 0)
Eight documents under docs/development/ confronting the approved business
architecture with the audited code: 27-step plan, repository migration map,
domain map, frontend/backend architecture, migration and test strategy,
open questions. Reference document placed at the repository root.
2026-10-08 21:41:39 +02:00
bastien e471d41c6b docs(docs): add anatomical audit of existing SVG, catalog and report systems
Read-only technical audit before the SaaS redesign: 13 reports,
a logical anatomical-sheet JSON built from real horse data, verbatim
copies of the 52 relevant source files, and a self-contained ZIP.
2026-10-06 23:51:35 +02:00
Bastien Chanot b047d352c1 feat(species): locale-aware species labels via labelEn
B-6: SpeciesManifest only carried labelFr — EN users saw 'Cheval'.
labelEn required on the manifest, speciesLabel(s, locale) helper in
registry; AnimalForm dropdown + SvgEditor picker localized (locale
passed into initSvgEditor, re-inits on locale change). Scaffolder
template + ADDING-A-SPECIES.md + registry test updated.
2026-07-12 16:23:07 +02:00
Bastien ChanotandClaude Opus 4.8 744b9e6759 docs: 0.1.0 changelog + 174 tests + features + PDF fonts (no tag)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNaYKPEkjH1jbgoX1TwKMX
2026-07-01 14:31:37 +02:00
Bastien ChanotandClaude Opus 4.6 93503b7ce5 docs(anatomy): document data-anno-lateral attribute
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 22:22:33 +02:00
Bastien ChanotandClaude Opus 4.6 c73af46c33 docs(plans): add laterality support implementation plan
10 tasks: schema, parser, i18n, LateralityPicker, EditorRoute integration,
ObservationCard display, PDF output, SVG editor dropdown, docs, verification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 22:12:06 +02:00
Bastien ChanotandClaude Opus 4.6 880de17dbe docs(specs): add laterality support design spec
Defines per-zone bilateral/unpaired SVG attribute, ObservationZone.side
schema field, LateralityPicker UI flow, and SVG editor integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 22:09:50 +02:00
Bastien ChanotandClaude Opus 4.6 a73d8da263 fix(ui): responsive mobile — full phone/tablet adaptation across all components
Surgical CSS/className-only changes, zero behavior impact. 155/155 tests green.

- Dialog: tighter mobile padding (p-3/px-4), reduced max-height to 85vh
- Button: sm size h-8→h-9 (36px touch target), responsive text sizing
- VertebraPicker: 44px min-height touch targets on mobile region tabs
- SVG editor: sidebar stacks below canvas <768px, full-width mobile,
  zoom controls 40px, canvas min-height 40vh
- AnatomyCanvas: SVG child constrained to fit container
- EditorRoute: responsive gap/padding, canvas max-h-[55vh] on mobile
- ObservationList + ConclusionPanel: responsive section heading typography

Target: 375px+ (iPhone SE) usable, 768px+ (iPad) polished, desktop no regressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-23 20:01:50 +02:00
Bastien ChanotandClaude Opus 4.6 2d6ed809e2 chore: rename Zoosteo → Faunosteo across entire project
Brand strings, config defaults, i18n dicts, PDF attachment metadata,
HTML titles, Docker container name, package name, repo URLs, deploy
paths, and all documentation updated. Git remote switched to
faunosteo.git. Domain URLs (zoosteo.fr) preserved — DNS update is
separate. 155/155 tests green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 21:44:21 +02:00
Bastien ChanotandClaude Opus 4.6 9cca51c504 feat(editor): add standalone pathology editor tool
Standalone HTML page for editing species pathology JSON via SVG-based
zone selection. Supports pre-wired species list and manual SVG+JSON
upload. Features fuzzy zone matching (ported from zoneMatch.ts),
recursive tree editor with full CRUD, auto ID generation, and safe
JSON export preserving all zones and root fields.

Includes SVG sanitization (script/foreignObject/on* stripping),
unsaved changes protection, and French error messages.

Also copies pathologies.json to public/ for HTTP access from the editor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 04:42:07 +02:00
Bastien ChanotandClaude Opus 4.7 7dd4f633f8 chore: rename project from osteo-report to zoosteo
Remote moved to git.bchanot.fr/bchanot/zoosteo.git; brand strings
and production URL updated to match new identity.

- package.json: name → zoosteo
- src/config/env.ts: AppConfig DEFAULTS → "Zoosteo"
- docker/entrypoint.sh: APP_*_NAME fallbacks → "Zoosteo"
- src/i18n/{fr,en}.ts: import error message + PDF title prefix
- src/pdf/attachment.ts: embedded description metadata "state v2"
- index.html: <title> fallback
- scripts/scaffold-species.mjs: console banner
- tests/unit/components.Brand.test.tsx: regex
- README.md, CLAUDE.md, CHANGELOG.md, docs/ADDING-A-SPECIES.md:
  brand headings + intro lines
- DEPLOY.md: env defaults table + osteo.example.com → zoosteo.fr
  (clone URL, paths, certbot, curl, container name references)

PDF attachment FILENAME 'osteo-report.json' and the startsWith
contract in src/pdf/attachment.ts:35,40 are preserved — changing
them would break PDF import for every PDF already exported by the
app. docs/superpowers/** and .claude/audits/** left unchanged as
historical records.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 05:53:12 +02:00
Bastien Chanot 8385b49bbe docs: sync drift after catalog v2.0 + i18n + WinAnsi hotfix
doc-syncer audit applied 10 AUTO patches and 1 HUMAN reword (#5)
across the doc set.

README.md:
- Test count "7 tests pass on skeleton" / "88 tests across 23 files"
  → "155 tests" / "155 tests across 29 files".
- Reword "Observation builder" bullet + add hierarchical findings
  tree + browser-detected locale bullets (HUMAN #5).
- Status paragraph: pathology DB "intentionally empty" → full
  26-zone v2.0 catalog (792 nodes, 612 leaves, 41 vet leaves).
- Documentation section: add PATHOLOGIES-FORMAT.md link; tidy the
  DEPLOY.md mention (DEPLOY.md itself comes in the next commit).

CLAUDE.md:
- Architecture block: "embedFonts (Inter body + Fraunces heading)"
  → reality (Helvetica + TimesRoman / WinAnsi StandardFonts; TTF
  Inter/Fraunces planned).
- PDF convention: "Fonts are TTF" → "Fonts are StandardFonts
  (Helvetica/TimesRoman, WinAnsi)" with the ASCII-surrogate caveat.
- Folder map: add src/anatomy/labels.ts, include zoneMatch.ts in
  src/lib/{...}.ts.
- i18n: locale default "fr" → "navigator-detected fr/en, or 'fr'
  if no match" to match commit 9cf8a66.

docs/PATHOLOGIES-FORMAT.md:
- "PDF surface: snapshot label is prefixed ⚠" → "(!)" in two
  places (after WinAnsi hotfix 143fdc3). Picker ⚠ statement
  kept — browser renders U+26A0 natively.

docs/ADDING-A-SPECIES.md:
- data-anno-category: "Free-form" → enum of 7 valid values per
  ANATOMY-SVG-CONVENTION.md; parser throws SvgConventionError on
  unknown values.
- Section 4 (findings catalog): cross-link to
  docs/PATHOLOGIES-FORMAT.md so authors find the v2.0 contract.
2026-05-21 04:13:13 +02:00
Bastien Chanot 57b58b3af1 docs(species): refresh PATHOLOGIES-FORMAT for v2.0 contract
- schema_version "2.0" everywhere; new Changelog section with
  v1.0 → v2.0 entries highlighting the breaking change.
- New Scope (legal périmètre) section listing inclusions / exclusions
  and the two flag mechanisms (root scope_disclaimer + leaf boolean).
- Clarified SVG ↔ JSON link via strict label equality (not data-anno-id)
  and cranio-caudal zone ordering rule.
- Documented the 3 standardized categories per zone
  (*-dysfunctions / *-observations / anamnesis) and the 5 dysfunctions
  taxonomy patterns (head SSB / head peripheral / articular /
  vertebral hinge / vertebral region).
- Documented structural authoring rules (depth ≤ 4, ≥ 2 children per
  intermediate, sibling-scoped ID uniqueness).
- Spelled out the v2.0 requires_vet_referral / description_fr policy
  (boolean = source of truth; description_fr survives only on
  differential leaves) and the breaking-change notice for any consumer
  relying on description_fr.includes('vétérinaire').
- Rewrote the minimal example using v2.0 contract (boolean only,
  description_fr only when it adds a differential).
- Noted Zod's silent strip of unknown fields (e.g. species.notes,
  per-leaf metadata).
- Added current horse.json stats table (26 zones / 792 nodes /
  612 leaves / 41 vet leaves).
2026-05-21 03:23:30 +02:00
Bastien ChanotandClaude Opus 4.7 0a05c479a0 docs(plan): B3 i18n FR/EN implementation plan
12 tasks, TDD per task, file paths + full code shape + verification.
Locale store + dicts + useT separate green commits; PDF + route
migrations land as one atomic green-build commit (formatDate +
exportReportToPdf signature change cross the boundary).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 06:50:15 +02:00
Bastien ChanotandClaude Opus 4.7 d559f565ac docs(spec): B3 i18n FR/EN site + PDF design
Approved design before implementation. Locale = render preference
(store, not Report schema). PDF export takes explicit locale arg.
Finding leaf labels via existing dual snapshot; catalog descriptions
+ scope_disclaimer stay FR-only this iteration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 06:44:28 +02:00
Bastien ChanotandClaude 70f21ccf37 docs: add PATHOLOGIES-FORMAT spec for the findings JSON catalog
Documents the canonical pathologies.json shape next to the existing
ANATOMY-SVG-CONVENTION and PDF-FORMAT guides. Mirrors the Zod
contract in src/domain/schema/findings.ts:

- Top-level frame (schema_version, scope_disclaimer, species, zones).
- ZoneFindings shape and how name_fr/name_en bridge to SVG labels.
- Recursive FindingNode (leaf vs intermediate, optional description,
  vet-referral flag, sources).
- SourceRef enum + URL validation.
- A minimal worked example.
- How leaf selections become persisted Findings, with the labelFr/En
  snapshot contract that protects already-exported reports from
  retroactive catalog edits.
- Authoring workflow that defers to `pnpm scaffold:species` and Vite
  HMR-driven validation.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-20 06:15:26 +02:00
Bastien ChanotandClaude 70b7f20f6f feat(species): auto-discover species manifests + scaffold script
Registry
--------
src/domain/species/registry.ts previously hard-coded the species list,
which meant adding a new animal forced an edit in two places. The
registry now uses Vite's `import.meta.glob('./*/index.ts', { eager: true })`
and registers every manifest that default-exports a SpeciesManifest.
Duplicate ids log a warn and the first wins. Existing named imports
keep working — equine/index.ts adds `export default equine` next to the
named export.

The species dropdown is also now sorted alphabetically by labelFr (FR
locale) instead of insertion order, so two species don't shuffle
position based on glob ordering.

Scaffold script
---------------
`pnpm scaffold:species` (scripts/scaffold-species.mjs) is an
interactive Node ESM prompt that asks for the id, FR/EN labels, asset
folder, main SVG filename, detail SVG mappings, and the vertebral
formula, then writes:

  src/domain/species/<id>/index.ts        (with `export default`)
  src/domain/species/<id>/vertebrae.ts
  src/domain/species/<id>/pathologies.ts  (Zod-parses the JSON)
  src/domain/species/<id>/pathologies.json (minimal valid skeleton)
  public/species/<assetFolder>/           (directory placeholder)

The script refuses to overwrite existing files, so it's safe to rerun
after typos. SVG assets are not generated — drop them in the public
folder yourself.

Findings JSON updates
---------------------
No runtime hot-reload mechanism is needed in dev: `pathologies.ts`
imports `pathologies.json` and runs `SpeciesFindingsSchema.parse(data)`
at module load, so a JSON edit triggers Vite HMR + an immediate Zod
validation pass. In prod, rebuild and redeploy.

Docs
----
docs/ADDING-A-SPECIES.md rewritten around the new flow: quick start via
the scaffold script first, manual instructions second, and removed the
stale references to the flat `Pathology[]` model and the no-longer-
required registry edit step.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-20 05:46:33 +02:00
Bastien ChanotandClaude b9da4fa04a fix(anatomy,editor): detail-popup clicks + spine zones open VertebraPicker via data-anno-special
Three coupled bugs in zone interaction:
1. Clicks inside the head detail popup were ignored — EditorRoute
   looked up the clicked id in the main-SVG bones map only, so
   detail-only ids (point-mpbykomv et al.) returned undefined.
2. Spine zones did not open VertebraPicker on click; the picker was
   only reachable via the per-zone "Vertèbres…" button.
3. The new SVG hint data-anno-special="vertebral-precision" was
   present in Horse.svg but unread by the parser/UI.

Parser now reads data-anno-special into Bone.special. EditorRoute
parses the detail SVG on open and falls back to detailBones for id
lookups. When bone.special === 'vertebral-precision', clicking adds
the zone (if absent) and opens VertebraPicker for that zone index;
toggle-off via main click is disabled for these zones (use ✕). The
"Vertèbres…" button in ObservationCard is now shown only on zones
that support it. Convention doc updated.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-05-19 04:58:04 +02:00
Bastien ChanotandClaude Opus 4.7 1109e33383 refactor(anatomy): rename SVG data attrs (bone → anno) per new convention
User updated the clickable-zone convention in the source SVGs:

  data-bone-id        → data-anno-id
  data-bone-fr        → data-anno-name-fr
  data-bone-en        → data-anno-name-en
  data-category       → data-anno-category
  data-opens-detail   → data-anno-opens-detail

Bulk-renamed across:
- public/species/equine/Horse.svg + Horse_head.svg (86 anno-attrs each)
- src/anatomy/svgConvention.ts (parser + getBoneIdFromEvent)
- src/anatomy/types.ts (doc strings)
- src/components/canvas/AnatomyCanvas.tsx (querySelector + delegated click)
- src/styles/index.css (`[data-bone-id]` selectors → `[data-anno-id]`)
- src/domain/species/types.ts + schema/observation.ts (doc strings)
- docs/{ANATOMY-SVG-CONVENTION,ADDING-A-SPECIES,superpowers/specs,plans}.md
- CLAUDE.md + .claude/{memory/learnings,tasks/TODO}.md
- tests/unit/{anatomy.svgConvention,anatomy.svgLoader,components.AnatomyCanvas}.test.tsx

Internal TS type names and field names (Bone, boneId, parseSvgBones,
getBoneIdFromEvent) are kept intentionally — they're the application's
logical shape and the persisted JSON contract. ObservationZone.boneId is
the identifier seen in already-exported PDFs; renaming it would break
re-import of those PDFs. Only the SVG-side attribute names change.

90/90 tests pass, lint clean, build clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 03:10:06 +02:00
Bastien ChanotandClaude Opus 4.7 9a99fc916b docs: reframe as multi-praticien + multi-species (equine = first data set, not specialization)
The app is open to any praticien who wants to use it (not 'single-praticien'),
and the architecture is multi-species — equine ships first, dog/cat/goat/cow/
pig/rabbit/donkey/sheep come as pure data drops following the same convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 22:20:03 +02:00
Bastien ChanotandClaude Opus 4.7 4355055a42 docs(species): document how to add a new species end-to-end
Replace the placeholder with a full 7-step walkthrough: SVG convention,
file placement under public/, species manifest at src/domain/species/<id>/,
registry wiring, vertebral formula, pathology seed (empty allowed in v1),
and the two mirror tests (registry + real-SVG parse + pathologies schema).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 22:02:29 +02:00
Bastien ChanotandClaude Opus 4.7 8ca36b5ccd chore: initial scaffold + design spec + implementation plan
Skeleton for Osteo Report MVP. Build passes, 7 smoke tests green, real
Horse.svg + Horse_head.svg in public/species/equine/. Zod schemas are
the contract; store/anatomy/pdf modules are typed stubs throwing
"not implemented" awaiting implementation.

Spec: docs/superpowers/specs/2026-05-18-osteo-report-mvp-design.md
Plan: docs/superpowers/plans/2026-05-18-osteo-report-mvp.md (23 phases, ~70 TDD tasks)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 20:55:10 +02:00
Bastien Chanot 27afb719f5 clean all 2026-05-18 19:40:08 +02:00
ZenQuality a115e785a7 chore: initial scaffold
Generated by /init-project. React 19 + TS strict + Vite 6 + Tailwind 4 +
shadcn/ui + motion + pdf-lib + Zod + Zustand + react-router 7. Empty
skeleton, no business logic. Docker multi-stage + nginx + Traefik labels
commented. AGPL-3.0-or-later.
2026-05-17 06:43:11 +02:00