docs(chore): step 4c validated — head view check, migration limit BLK-008, review semantics, .env.example expected change, BDR-037, TODO follow-up

This commit is contained in:
bchanot committed 2026-10-10 10:32:57 +02:00
1 parent c0c17fcf5f
commit 866e84f75b
7 files changed
+50 -2

No files matched your search

+7
View File
@@ -67,3 +67,10 @@ Friction: Step 4 verifier + security gate both found every `private.*` function
Root: foundation ran `alter default privileges in schema private revoke execute on functions from public`; PostgreSQL adds per-schema defaults on top of the built-in PUBLIC EXECUTE, a per-schema REVOKE cannot remove it. Nothing reachable via API (PostgREST exposes public only, anon no USAGE on private) but the rule "EXECUTE revoked from public" was false.
Fix: explicit `revoke all on function private.f(args) from public` for every function (new migration 20261008110100 for the Step 3 helpers, inline for Step 4); pgTAP 001 census: anon executes nothing in private/audit, authenticated only the 7 policy predicates.
Status: resolved (commit on feature/step-04-anatomical-sheet-model).
---
## BLK-008 | 2026-10-10 | Schema v2 CHECK migration fails on a database holding a v1 draft
Migration 20261010100000 replaces the CHECK with `document_schema_version = 2` without rewriting rows → errors on any DB seeded before 4c (dev only today). Cause: schema bump shipped as constraint change, not as data migration. Solution: before real data, data migration lifting stored documents (add `references: []`, `review_status` defaults) then CHECK; rule from user: incremental non-destructive migrations, never a reset. Documented ANATOMICAL_SHEET_MODEL.md §6.
Status: open (no real data yet; treat before Step 7+ persistence of user reports).
+7
View File
@@ -312,3 +312,10 @@ Status: closed (DEPLOY.md "Docker resource naming", SUPABASE.md §3, CLAUDE.md).
Schema v2: document `references` registry (id, type, citation, url|doi), `reference_ids` + `review_status` (inherited|reviewed|to_confirm) on finding nodes/categories/annotations, `count_range` on vertebral regions; rules `reference.id.duplicate`, `finding.reference.missing`, `region.count_range.invalid` on TS + SQL (jsonpath `**` descent); CHECK `document_schema_version = 2`. Curation = authored JSON changeset (`curation/changes.json`: CHG-nnn, level A|B|C, kind, FR/EN title, rationale, reference_ids, priority, question required for C; ops set/rename/add/remove/move/cite over string targets) applied by a deterministic pipeline to the 4b baseline → `draft/` (document, one cleaned SVG, head view = view_box crop, CHANGELOG with before/after per elementary edit, 10-section REVIEW-REPORT, `review/annotations-<view>.svg` before/after drawings, converging seed). Legacy baseline kept generated under `legacy-import/`, `v1/` removed. Nothing publishes.
Alt rejected: editing `document.json` by hand (no traceability, golden test); TS code per change (reviewers read data, not code); per-node inline sources (792 copies → registry + ids); PNG renders in git (operator artifact, renderer-dependent).
Status: closed; content awaits professional review (REVIEW-REPORT §10, 9 questions).
---
## BDR-037 | 2026-10-10 | Step 4c validated: reference draft, review semantics, migration rule
User decisions: curated equine draft = reference draft of the app until published (no publication without professional review); technical integrity ≠ medical validation (`inherited` / `reviewed` / `to_confirm` stay visible, REVIEW-REPORT the hand-off doc for the osteopath, 11 open questions → next changeset); future schema changes = incremental non-destructive migrations (BLK-008); legal scope text re-read on consolidated Légifrance texts before publication; head view preserved as crop, per-view assets still possible. Docker `faunosteo_` rule permanent; `.env.example` change documented in DEPLOY.md (file denied to Claude). SaaS development continues without waiting for medical validation.
Status: closed.
+1
View File
@@ -188,3 +188,4 @@ Step 4 validated + finished into develop. User decisions on the 7 open points
- 2026-10-10 Step 4c on feature/step-04c-equine-curation: Docker `faunosteo_` convention (BDR-035); schema v2 (references, review_status, count_range; migration 20261010100000, pgTAP 008); curation pipeline (executor) + review overlays; 4 research agents (skull, axial, limbs, osteo/legal) → 44 changes / 679 ops / 48 refs authored from scratch python modules; draft 811 nodes, 28 annotations, 0 integrity errors; 9 points moved, carpus added, 9 questions for the osteopath. Root check green, real stack pgTAP + types clean, docker build OK. BDR-036, LRN-042. Gates next; stop for user validation; no publication.
- Gates 4c: verifier ×3 (4→2→1 écarts, last 3 doc lines fixed by hand at cap), executor closed the applier rule + typed tests; security PASS (LOW url scheme → SQL rule `reference.url.scheme`). Real stack 267/267, Storage e2e OK. EVAL-010. Awaiting user validation; `.env.example` COMPOSE_PROJECT_NAME left to the user (file denied).
- Step 4c VALIDATED by user 2026-10-10 → tracking: head view check documented (spec §6), BLK-008 migration limit, BDR-037, DEPLOY.md `.env.example` note. Finished into develop. Next: Step 5 (app on the canonical sheet), design points flagged before any UI work.
+2 -1
View File
@@ -77,13 +77,14 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo
- [x] 4b.4 real stack: db reset + db test + types check + assets upload + REST read check; docs (SUPABASE.md, ANATOMICAL_SHEET_MODEL.md §6 import, CLAUDE.md, plan note, CHANGELOG)
- [x] 4b.5 verify: pnpm check green (61+30+20+278), real stack 256/256, types in sync, docker build OK, Storage API 400→200 after confirmation (alice/anon 400); verifier ECARTS(4) + security MEDIUM (hash claim) → fixed (uploaded_at + confirm RPC, authored labels, seeds-listed test, Dockerfile manifests); EVAL-009
- [x] Step 4b VALIDATED by user 2026-10-09 → finished into develop. Draft stays private, never auto-published.
- [ ] Step 4c (DONE, awaiting user validation; never publish) — equine sheet audit, correction, enrichment (2026-10-09, branch feature/step-04c-equine-curation). User brief: research-backed audit of SVG annotations + findings catalog, corrections by confidence level (A demonstrated / B supported, flagged / C uncertain, question for the osteopath), traceable changeset (id, before, after, nature, rationale, references, level, needs confirmation), reproducible baseline of the 4b import, no publication, no design redesign (propose first).
- [x] Step 4c VALIDATED by user 2026-10-10 → finished into develop; draft stays private, never auto-published — equine sheet audit, correction, enrichment (2026-10-09, branch feature/step-04c-equine-curation). User brief: research-backed audit of SVG annotations + findings catalog, corrections by confidence level (A demonstrated / B supported, flagged / C uncertain, question for the osteopath), traceable changeset (id, before, after, nature, rationale, references, level, needs confirmation), reproducible baseline of the 4b import, no publication, no design redesign (propose first).
- [x] 4c.0 Docker naming convention `faunosteo_` (compose container/project names; Supabase CLI names fixed `supabase_<svc>_<project_id>` → documented limit). Docs + memory (BDR).
- [x] 4c.1 domain schema v2: document `references` registry + node `reference_ids`, `review_status` on nodes and annotations, `count_range` on vertebral regions; rules `finding.reference.missing`, `region.count_range.invalid`; tests; migration extending the schema CHECK + SQL issues; types regen; pgTAP.
- [x] 4c.2 packages/anatomy curation layer: changeset schema (Zod, JSON data), applier (set / rename / add / remove / move / cite / annotation ops), before-values captured by the applier, CHANGELOG + REVIEW-REPORT generators, diff v1 → draft; seed dir restructure: `legacy-import/` (baseline, generated) + `draft/` (curated working revision, seeded); cleaned SVG asset (legacy markers stripped), head view = view_box crop of the single asset.
- [x] 4c.3 research (parallel agents, WebSearch): axial skeleton + vertebral variation; skull/sutures/SBS/TMJ/hyoid; appendicular nomenclature NAV/Barone; osteopathic terminology + French legal scope + vet red flags; catalog analyzer pass. Output: findings with verifiable references, classified A/B/C.
- [x] 4c.4 content changes: sphenoid zone restructured (SSB tree duplicated under sphenoid), terminology (lésion → dysfonction, NAV names, FR grammar), 62 EN descriptions + EN disclaimer, vet flags audit, references registry + citations, additions (carpus…), SVG point moves (B, before/after renders), Cd range 15–21.
- [x] 4c.5 reports: REVIEW-REPORT.md for the osteopath (10 sections, questions ranked), CHANGELOG table, before/after review SVGs (draft/review/, PNG renders by operator), quantitative before/after.
- [ ] 4c follow-up (open, not blocking Step 5): 11 questions for the osteopath (draft/REVIEW-REPORT.md §10) → next changeset; legal scope text to re-read on consolidated Légifrance articles before publication; BLK-008 data migration v1→v2 before real data; user action `.env.example` COMPOSE_PROJECT_NAME=faunosteo (DEPLOY.md)
- [x] 4c.6 verify (root check 68+21+100+278, PGlite + real stack 267/267, types, docker build, Storage e2e; verifier ×3 → fixes, security PASS; EVAL-010): pnpm check, PGlite + real stack pgTAP, types, docker build, golden tests; gates verifier + security; docs (spec §6/§7, SUPABASE.md, CLAUDE.md, plan Step 4c, CHANGELOG); memory (BDR/LRN/EVAL/journal). Stop for user validation.
---
+7
View File
@@ -23,6 +23,13 @@ reverse proxy reads from it on `127.0.0.1:8080`.
### Docker resource naming
Expected change in `.env.example` (file not editable by the assistant):
replace `COMPOSE_PROJECT_NAME=osteo-report` with `COMPOSE_PROJECT_NAME=faunosteo`
or drop the line. The variable overrides `name: faunosteo` in
`docker-compose.yml`, so an `.env` copied from the example would still create
`osteo-report_*` resources. No secret is involved.
Several SaaS may share one VPS, so every Docker resource Faunosteo owns
carries the `faunosteo_` prefix whenever its name is configurable:
containers, Compose project (hence networks and named volumes), images and
@@ -363,6 +363,31 @@ level B or C change, every finding, finding category and annotation it
touched is left at `to_confirm` (recorded in the CHANGELOG), and an explicit
`reviewed` in such a change throws.
Head view after the single-asset switch (checked 2026-10-10): the `head`
detail view still exists (`parent_view_id: main`, opened by `head-trigger`),
keeps its 9 annotations with the same ids (parietal, frontal, occipital and
hyoid at their legacy position, the five others moved by CHG-044), and is
rendered as the `view_box` crop of the shared drawing. `svg_asset_id` stays
nullable per view, so a future revision can give any view its own drawing
again (CHG with `set view:<id>.svg_asset_id`), nothing in the model assumes
one asset.
Status semantics: technical integrity (zero issue) is not anatomical or
clinical validation. `inherited` = taken over from the legacy catalog
without review; `reviewed` = checked against a cited source by a level A
change; `to_confirm` = changed or added on documented grounds, awaiting the
partner osteopath. The draft is the reference draft of the application until
a platform admin publishes it after that review (REVIEW-REPORT §10, 11 open
questions; the legal scope text must be re-read on the consolidated
Légifrance articles first).
Known limit of migration 20261010100000: it tightens the CHECK to
`document_schema_version = 2` without rewriting stored rows, so it fails on a
database that still holds a schema 1 draft (a dev database seeded before Step
4c). It is safe with `db reset`; before any database with real data, write a
data migration that lifts stored documents to the current schema, then
tightens the CHECK (BLK-008). Future schema bumps follow that order.
Seed: `equine_draft.sql` is idempotent and converging. On a fresh database
it inserts the sheet, the cleaned asset row and the draft through
`private.insert_sheet_draft`; when the sheet's only version is a draft
+1 -1
View File
@@ -149,7 +149,7 @@ Risks: subtle divergences between parser and importer on the detail trigger (no
(migration 20261009100000), pgTAP 006/007. Business decisions of 2026-10-09 recorded in
ANATOMICAL_SHEET_MODEL.md §5 (follow-gated use → community step; verified publication →
identity step; erasure path → retention step).
Step 4c done 2026-10-10 (branch feature/step-04c-equine-curation, awaiting user validation):
Step 4c done and validated by the user 2026-10-10 (branch feature/step-04c-equine-curation, finished into develop):
document schema v2 (references registry, review_status, vertebral count_range; migration
20261010100000, pgTAP 008), curation pipeline in packages/anatomy (changeset → draft with
CHANGELOG, REVIEW-REPORT, before/after review drawings), seed layout legacy-import/ + curation/ +