feat(domain): R2.2 sheet integrity rules, publish check, SheetIndexData and SQL conformance in Rust

The 21 rules of validateSheetDocument ported with identical codes,
severities, paths and messages (frozen from the TypeScript on 26
conformance fixtures), createEmptySheetDocument, the publish check
(strict shape then rules), and the index data React reads once (positions
with Map semantics, names, spine ids, finding-path keys). The fixtures
also carry the codes private.sheet_document_issues returns: a cargo test
generates supabase/tests/011_sheet_conformance.sql and refuses drift
(PGlite 12/12 files, real stack 446/446). .prettierignore keeps the
byte-exact oracles and generated fixtures out of pnpm format.
This commit is contained in:
bchanot committed 2026-10-14 00:17:21 +02:00
1 parent 343d6f4c1f
commit 0c47d0f837
40 files changed
+3280 -1

No files matched your search

@@ -0,0 +1 @@
{"name":"view-asset-missing-main","description":"the main view without an SVG asset","document":{"schema_version":2,"species_id":"equine","name":{"fr":"Cheval (extrait)","en":"Horse (slice)"},"description":{"fr":"Extrait de la fiche équine pour les tests du modèle","en":"Equine sheet slice for model tests"},"scope_disclaimer":{"fr":"Les éléments listés correspondent au périmètre légal de l'ostéopathie animale : dysfonctions ostéopathiques palpées, observations cliniques et motifs de consultation. Aucun diagnostic médical n'est posé. Toute pathologie organique relève du vétérinaire."},"attribution":{"authors":["Faunosteo"],"license":"MIT","notes":null},"vertebral_config":{"regions":[{"code":"C","name":{"fr":"Cervicales","en":"Cervical"},"count":7,"count_range":null},{"code":"T","name":{"fr":"Thoraciques","en":"Thoracic"},"count":18,"count_range":null},{"code":"L","name":{"fr":"Lombaires","en":"Lumbar"},"count":6,"count_range":null},{"code":"S","name":{"fr":"Sacrées","en":"Sacral"},"count":5,"count_range":null},{"code":"Cd","name":{"fr":"Caudales","en":"Caudal"},"count":18,"count_range":{"min":15,"max":21}}]},"references":[{"id":"legacy-catalog","type":"manual","citation":"Legacy equine catalog (pathologies.json, schema 2.0)","url":null,"doi":null}],"categories":[{"id":"articulations","name":{"fr":"Articulations","en":"Joints"},"color":"#ff9500"},{"id":"zone-colonne","name":{"fr":"Zone colonne","en":"Spine zone"},"color":"#e100ff"},{"id":"charnieres-vertebrales","name":{"fr":"Charnières vertébrales","en":"Vertebral junctions"},"color":"#ff0000"},{"id":"cadrans-du-crane","name":{"fr":"Cadrans du crâne","en":"Skull quadrants"},"color":"#1baa08"}],"views":[{"id":"view-main","name":{"fr":"Cheval entier","en":"Whole horse"},"svg_asset_id":null,"view_box":null,"kind":"main"},{"id":"view-head","name":{"fr":"Tête","en":"Head"},"svg_asset_id":null,"view_box":{"min_x":60,"min_y":100,"width":500,"height":380},"kind":"detail","parent_view_id":"view-main"}],"annotations":[{"id":"hip","view_id":"view-main","category_id":"articulations","laterality":"bilateral","geometry":{"type":"circle","cx":1516,"cy":695,"r":34},"review_status":"inherited","color":null,"name":{"fr":"Hanche (coxo-fémorale)","en":"Hip joint"},"finding_zone_id":"hip","vertebral_region_code":null,"kind":"point"},{"id":"cervical-vertebrae","view_id":"view-main","category_id":"zone-colonne","laterality":"unpaired","geometry":{"type":"polygon","points":[[468,276],[489,216],[558,248],[586,339],[552,461],[524,370]]},"review_status":"inherited","color":null,"name":{"fr":"Vertèbres cervicales","en":"Cervical Vertebrae"},"finding_zone_id":"cervical","vertebral_region_code":"C","kind":"zone"},{"id":"hinge-c7-t1","view_id":"view-main","category_id":"charnieres-vertebrales","laterality":"unpaired","geometry":{"type":"circle","cx":840.17,"cy":399.08,"r":30},"review_status":"inherited","color":null,"name":{"fr":"Charnière C7-T1 (cervico-thoracique)","en":"C7-T1 (Cervicothoracic)"},"finding_zone_id":"c7-t1","vertebral_region_code":null,"kind":"point"},{"id":"head-trigger","view_id":"view-main","category_id":"cadrans-du-crane","laterality":"unpaired","geometry":{"type":"polygon","points":[[454,332],[429,202],[349,154],[234,279],[164,384],[234,468]]},"review_status":"inherited","color":null,"kind":"detail_trigger","name":null,"opens_view_id":"view-head"},{"id":"atm","view_id":"view-head","category_id":"articulations","laterality":"bilateral","geometry":{"type":"circle","cx":384.94,"cy":314.02,"r":27},"review_status":"inherited","color":null,"name":{"fr":"Articulation Temporo-Mandibulaire (ATM)","en":"Temporomandibular Joint (TMJ)"},"finding_zone_id":"atm","vertebral_region_code":null,"kind":"point"},{"id":"sphenoid","view_id":"view-head","category_id":"cadrans-du-crane","laterality":"unpaired","geometry":{"type":"circle","cx":299,"cy":298,"r":27},"review_status":"inherited","color":null,"name":{"fr":"Sphénoïde","en":"Sphenoid"},"finding_zone_id":"sphenoid","vertebral_region_code":null,"kind":"point"}],"finding_zones":[{"id":"hip","name":{"fr":"Hanche (coxo-fémorale)","en":"Hip joint"},"categories":[{"id":"hip-dysfunctions","kind":"dysfunction","name":{"fr":"Dysfonctions ostéopathiques","en":"Osteopathic dysfunctions"},"description":{},"reference_ids":[],"review_status":"inherited","children":[{"id":"articular","name":{"fr":"Restrictions de mobilité articulaire","en":"Articular mobility restrictions"},"description":{},"requires_vet_referral":false,"reference_ids":[],"review_status":"inherited","children":[{"id":"restriction-flexion","name":{"fr":"Restriction en flexion","en":"Flexion restriction"},"description":{},"requires_vet_referral":false,"reference_ids":[],"review_status":"inherited","children":[]},{"id":"restriction-extension","name":{"fr":"Restriction en extension","en":"Extension restriction"},"description":{},"requires_vet_referral":false,"reference_ids":[],"review_status":"inherited","children":[]}]}]},{"id":"hip-observations","kind":Line truncated