Commit Graph
448 Commits
Author SHA1 Message Date
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 ce76c6597a feat(supabase): @faunosteo/supabase package with PGlite harness and typed client
- tests/db: PGlite (PostgreSQL 17 WASM) applies the Supabase shim + migrations and
  runs supabase/tests/*.sql through pgTAP without Docker
- schema-types test pins tables, columns, enums, RPC args, RLS-on, no using(true)
- database.types.ts in supabase gen types format; createBrowserClient (PKCE)
- Supabase CLI pinned as root devDependency; db:* root scripts
2026-10-08 22:20:54 +02:00
bchanot 2d5ff0c33e feat(supabase): foundation migrations (audit, profiles, platform roles) + pgTAP suite
- schemas private/audit, set_updated_at, append-only audit.audit_logs, private.log_event
- profiles created by auth.users trigger; own-row RLS; column-level UPDATE grant
- platform_role enum (owner/admin/moderator/support), profile_roles history table,
  is_platform_* helpers, grant/revoke RPCs audited; writes only via RPC
- config.toml (public schema only, strong passwords, no edge runtime), local seed
- 79 pgTAP checks: allowed and denied paths for every policy
2026-10-08 22:20:54 +02:00
bchanot 62c5a3ac86 chore(chore): plan step 3 Supabase foundation in TODO 2026-10-08 22:06:37 +02:00
bchanot d9a7bd70b8 chore(chore): refresh gitflow post-commit/post-merge hooks (fail-closed autopush)
ci / check (push) Canceled after 0s
ci / docker (push) Canceled after 0s
2026-10-08 22:06:19 +02:00
bchanot ab8451210b chore(chore): capitalize step 2 decisions, learning and journal
ci / check (push) Canceled after 0s
ci / docker (push) Canceled after 0s
2026-10-08 21:57:05 +02:00
bchanot 49596022c9 Merge feature/step-02-monorepo-workspace into develop
ci / check (push) Canceled after 0s
ci / docker (push) Canceled after 0s
2026-10-08 21:56:42 +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 c8d48ab4cc Merge feature/step-01-characterisation-tests into develop 2026-10-08 21:41:52 +02:00
bchanot 8f217d8103 chore: purge transient planning artifacts (BDR-065) 2026-10-08 21:41:51 +02:00
bchanot e9047a99d2 chore(chore): capitalize step 0-1 learnings, eval and journal 2026-10-08 21:41:40 +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 2ae1e48b7e chore(chore): refresh gitflow hooks (gitleaks backstop, auto-push, ref protection)
pre-commit gains a gitleaks secret scan on every branch, a per-repo
gitflow.protect opt-out, and exempts .githooks/** like .claude/**.
Adds the generated post-commit, post-merge and reference-transaction
hooks from the gitflow lib.
2026-10-06 23:53:24 +02:00
bastien 021569f44c Merge chore/anatomical-audit into develop 2026-10-06 23:52:45 +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 83e40af99b Merge chore/tour-2026-07-12 into develop 2026-07-18 01:18:19 +02:00
Bastien Chanot cbf62ff5c2 docs(tour): mark BUGS-FOUND B-1..B-6 fixed with commit refs 2026-07-12 17:54:23 +02:00
Bastien Chanot d702e9fb45 chore(pdf): decompose addObservationPage (context object + sub-functions) 2026-07-12 17:52:50 +02:00
Bastien Chanot fe307e1d8d chore(editor): split onZoneClick into per-behavior handlers 2026-07-12 17:05:32 +02:00
Bastien Chanot 0ec1b27d1f chore(pdf): extract shared render constants module 2026-07-12 17:02:45 +02:00
Bastien Chanot a5849113e5 chore(i18n): extract shared pickLocaleLabel helper 2026-07-12 17:00:07 +02:00
Bastien Chanot d7c9d39b13 chore: apply reconcile suggestions — CLAUDE.md drift + TODO sync
REC-1: registry cross-ref ranges (22 BDR / 31 LRN / 5 BLK).
REC-2: env-var identity checked with tour evidence.
REC-3: draft mirror note — restore landed f58a49f.
REC-4: CLAUDE.md factual drift — canvg→native raster, svgToPngDataUrl→
loadSvg, version 1→2, pako→DecompressionStream, pnpm path, folder tree
(EditorsRoute, AppHeader/Footer, LateralityPicker, pdf render files).
TODO gains a dated tour+fixes DONE block.
2026-07-12 16:56:32 +02:00
Bastien Chanot 9d8267ba22 chore: drop dead BoneState values and unreferenced logo PNGs
CLN-6: BoneState 'linked'/'multi' never produced anywhere + their two
CSS rules. CLN-7: 22 of 24 public/assets PNGs unreferenced (favicon is
/favicon.svg; PDF uses the two kept 512px files) — SVG sources and
generate-sizes.sh remain in logos/. Shrinks every build/Docker image.
2026-07-12 16:34:22 +02:00
Bastien Chanot c48406788a fix(pdf): cap inflated attachment size on import
SEC-8 (user-approved change to the protected import path): the flate
fallback materialized the whole decompressed stream unbounded — a
crafted PDF with a deflate bomb could freeze the tab. Stream is now
read chunk-wise and cancelled past 16 MB (valid report JSON is orders
of magnitude smaller); bomb → null → import fails with the generic
error. TDD: real CompressionStream bomb fixture, 180/180 green.
2026-07-12 16:27:40 +02:00
Bastien Chanot 0214ae1537 fix(docker): escape env values in env.js heredoc
SEC-9: a double quote or backslash in APP_* broke the generated JS
(silent config corruption). js_escape() escapes both and collapses
newlines before interpolation. Docker-verified with a hostile
APP_BRAND_NAME: env.js parses, value round-trips exactly.
2026-07-12 16:26:21 +02:00
Bastien Chanot f58a49f7fc feat(store): restore sessionStorage draft on store init
B-3: the osteo:draft mirror was write-only — a page refresh at
/editor bounced to home and lost the session despite the advertised
auto-save. Store now initializes report from readPersistedDraft()
(per-tab sessionStorage: refresh keeps the session, closing the tab
drops it; reset still clears). TDD: 4 new tests incl. refresh
simulation via module re-import — 178/178 green.
2026-07-12 16:25:21 +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 Chanot 74e1623135 fix(i18n): localize SvgEditor input placeholders
B-5: 'head', 'ex: Hanche', 'ex: Hip joint' were hardcoded on an
otherwise localized page. Three new svg_editor.*_placeholder keys,
parity kept; FR output unchanged.
2026-07-12 13:23:56 +02:00
Bastien Chanot 255ab96668 fix(i18n): EN PDF title prefix matches FR document-type semantics
B-4: FR titled exports 'Bilan ostéo — <name>' but EN used the brand
('Faunosteo — '). EN now 'Osteo report — ' — also removes a hardcoded
brand string from the dict (identity rule).
2026-07-12 13:21:45 +02:00
Bastien Chanot 83f02c8fa8 fix(ui): localize Dialog close and LanguageSwitcher group aria-labels
B-1: Dialog close button exposed French 'Fermer' to EN screen-reader
users; B-2: switcher group label was English-only. New dict keys
common.close + lang.group_label in both dicts (parity kept).
2026-07-12 13:21:07 +02:00
Bastien Chanot b7e6371f8a chore(memory): capitalize tour 2026-07-12 — LRN-030/031, EVAL-004, journal 2026-07-12 13:03:24 +02:00
Bastien Chanot 716b1a2be1 docs(tour): report — 2026-07-12 run, converged, 11 commits 2026-07-12 12:50:56 +02:00
Bastien Chanot 1078f74793 docs: sync README, DEPLOY, CHANGELOG with tour fixes (canvg drop, non-root container, base pin) 2026-07-12 11:57:19 +02:00
Bastien Chanot 86ac366136 chore(ui): read Brand logo alt text from config
alt="Faunosteo" hardcoded — identity strings must come from
useConfig() (CLAUDE.md identity rule). Output identical under
default config; custom APP_BRAND_NAME now honored.
2026-07-12 04:48:04 +02:00
Bastien Chanot 4ea8c90c7f chore(i18n): drop dead dict keys, wire LanguageSwitcher through dict
6 keys unused in both dicts removed (common.back, common.none,
editors.title, lateral.bilateral, lateral.unpaired,
pdf.export_date_prefix). LanguageSwitcher hardcoded strings identical
to existing lang.* keys — now reads them via t(); rendered output
unchanged (values identical in both dicts).
2026-07-12 04:48:04 +02:00
Bastien Chanot bbdc0e851a chore: remove dead code and duplicate logic
- drop unused assertNever, canvg dependency (never imported),
  readonly re-export shim in VertebraPicker, stale equine named export
- unexport validateBoneElement (internal only)
- getBoneIdFromEvent now delegates to getAnnotatedElement (dup walk-up)
- rasterizeSvg: drop ignored _scale param (2 call sites + tests)
- extract byte-identical word-wrap into pdf/render/text.ts
- extract mergeBones helper in EditorRoute (block duplicated twice)
- fix stale canvg comment in observationPage
Checks: typecheck, lint, 174/174 tests, build all green
2026-07-12 04:47:54 +02:00
Bastien Chanot c55da07697 fix(docker): pin runner base image to nginx:1.31-alpine
Unpinned nginx:alpine made builds non-reproducible across releases.
Minor-version pin keeps patch updates. Verified: build + HTTP 200.
2026-07-12 03:48:05 +02:00
Bastien Chanot a2bd884bb1 fix(config): add minimum-release-age supply-chain guard
semgrep MEDIUM: pnpm installs now skip package versions published
less than 24h ago (npm supply-chain attack window).
2026-07-12 03:46:59 +02:00
Bastien Chanot d8e478a104 fix(docker): run container fully as non-root nginx user
semgrep HIGH: no USER directive before ENTRYPOINT (container ran as
root). Runtime dirs, conf.d and html dir chowned to nginx so the
entrypoint (env.js write + PORT envsubst) and nginx master both run
as uid 101. Verified: docker build + run, HTTP 200, SPA fallback,
env override OK, ps shows master+workers as nginx.
CONSTRAINT: PORT env var must now be >=1024 (default 8080 unaffected).
2026-07-12 03:46:59 +02:00
Bastien Chanot 187dfb5371 fix(config): move build toolchain to devDependencies
vite, @vitejs/plugin-react-swc, @tailwindcss/vite are build-time only;
they were inflating the production dependency audit surface.
Build + tests verified green after the move.
2026-07-12 03:34:00 +02:00
Bastien Chanot 3f91a45660 fix(editor): sanitize user-imported SVGs before DOM insertion
SvgEditorRoute.loadSVG inserted dropped SVG files with no stripping;
pathology-editor stripped descendants but missed the root element's
on* attributes and javascript: hrefs. Both now remove script/
foreignObject nodes, on* handlers (root included) and javascript:
hrefs before appendChild. Impact bounded (no auth/backend), MEDIUM.
2026-07-12 03:32:50 +02:00
Bastien Chanot 18865def06 fix(config): patch CVE-affected deps (vite, vitest, happy-dom)
- vite 7.3.3 -> 7.3.6 (GHSA-fx2h-pf6j-xcff HIGH, GHSA-v6wh-96g9-6wx3 MED)
- vitest 3.2.4 -> 3.2.7 (GHSA-5xrq-8626-4rwp CRITICAL, dev-only)
- happy-dom 16.8.1 -> 20.10.6 (GHSA-37j7-fg3j-429f CRITICAL, dev-only)
- esbuild -> 0.28.1 within vite range, js-yaml lockfile refresh
pnpm audit: 0 known vulnerabilities; typecheck + 174/174 tests green
2026-07-12 03:25:51 +02:00
Bastien Chanot 605ee7cd74 Merge feature/doc-sync into develop 2026-07-01 14:31:37 +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 Chanot 2c501c310d Merge chore/reconcile-memory into develop 2026-07-01 14:27:49 +02:00
Bastien ChanotandClaude Opus 4.8 60119c6dcb chore(memory): reconcile TODO with main +41 commits (174 tests, version 0.1.0)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNaYKPEkjH1jbgoX1TwKMX
2026-07-01 00:20:23 +02:00
Bastien Chanot 4991c10ef7 chore: adopt gitflow socle + pre-commit hook 2026-06-29 01:47:14 +02:00
Bastien ChanotandClaude Opus 4.8 6e2285250e i18n(lateral): rename 'Impair'/'Unpaired' to 'Unilatéral'/'Unilateral'
Practitioner-facing copy only — the displayed term for a zone with no left/right side. Internal token 'unpaired', data-anno-lateral attribute, and types are unchanged. Affects the SVG editor laterality dropdown and the lateral.unpaired key (FR + EN).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 00:28:58 +02:00