4.0 KiB
4.0 KiB
paths
| paths | |||||
|---|---|---|---|---|---|
|
Anatomical sheet model (crates/core/src/domain/sheet + migration 20261008110000)
docs/development/ANATOMICAL_SHEET_MODEL.mdis the source of truth for the model as built: document shape, issue codes, tables, RPCs.docs/development/V1-2_ANATOMICAL_SHEETS.mdholds the ratified V1-2 rules (O1-O23, BDR-082): every V1-2 change follows it, and V1-2.9 folds it back into the model file.- Ids are stable slugs never derived from labels; labels are
{ fr, en }objects. Annotation → findings is the explicitfinding_zone_id; vertebral regions are ordered data with free codes. No label matching at runtime. - A published version is immutable (trigger, every role) and, from V1-2, never deleted, even deprecated. Change = new
draft (
create_sheet_draft) then publication; from V1-2, publication only from an approved round on a server verdict of the core. - The Rust core is the only authority on document rules (O22): add a rule to
validate_sheet_documentand to the spec table only. A rule that must not strip existing fingerprints or reject old snapshots lives inedit.rs(editor refusals) and in the verdict-only tier ofsheet_report, never as avalidate.rserror (V1-2.6 fixed categories, T4). V1-2 (M5) dropped the SQL mirror (private.sheet_document_issues); SQL keeps the structural and relational guards, the declared status check and, from V1-2.6 U6, the two declared fixed-category checks (save non-regression; approval and publication), which hold the fixed-category invariants only (contract §12.2, §17.12). Never add any other business rule in SQL. - Document schema change → bump
SHEET_DOCUMENT_SCHEMA_VERSION, extend the SQL CHECK ondocument_schema_version. No bump during V1-2 (BLK-008). Ratified exception (V1-2.6 T2, BDR-100, BDR-101): an optional key omitted when absent (skip_serializing_if,js::present,ts(optional), an explicitnullrefused, never defaulted in the fingerprinted document) is not a version change; it ships only with the proofs ofdocs/development/V1-2-6_UX_COMPATIBILITY.md§8, and its first write is a point of no return (one-way compatibility, never called full backward compatibility). - Historical equine sheet
503dc301…= generated seeddraft/(pnpm import:equine --outinto an empty folder, then reviewed and copied; never editlegacy-import/ordraft/by hand;curation_draft/curation_reviewfail on drift,pnpm import:equine --checklists it). Its content changes only throughcuration/changes.json(traced in CHANGELOG.md), and the pipeline stays unchanged during V1-2. It is never published; equine work moves to an application working copy (O17), whose publication is an owner act after the business review. - Sheet SVG bytes live in Storage bucket
anatomical-sheet-assetsas<sha256>.svg, never overwritten. Until M5 (V1-2.1) uploads are an operator task (pnpm assets:upload <seed dir>, local stacks, service key in env); from M5, editors upload from the application after the core's cleaning, and the worker verifies every submitted revision (M6). - Omitted
review_statusmeansinherited(#[serde(default)]): any check on statuses treats an absent value asinherited. - Since V1-2.2 the core also holds the review model (
review.rs: groups, digests,coverable, change list), the server verdict (verdict.rs, the shape the M5 SQL reads; the function is never exported to the browser, only its TypeScript type for the review screen), the document measure (size.rs: PostgreSQL'sjsonbtext, neverJSON.stringify),PreviewSheetand the editor's commands (edit.rs, the §6.6 marking rules). A change to the SVG reader, the rules, the caps, the fingerprint or the digests is a core change (contract §6.4: the release withdraws the rounds of drafts in flight; a published version's round stays approved). RUST.md §12.