docs(docs): consolidate V1-2 contract with ratified O1-O23, open AR-1

This commit is contained in:
bchanot committed 2026-10-28 11:35:51 +01:00
1 parent 397d6007b4
commit 7fec2ce86f
7 files changed
+1621 -646

No files matched your search

+21 -10
View File
@@ -1,17 +1,28 @@
---
paths: ["crates/core/src/domain/sheet/**", "docs/development/ANATOMICAL_SHEET_MODEL.md", "supabase/seed/anatomical-sheets/**", "crates/core/src/bin/upload_sheet_assets/**"]
paths: ["crates/core/src/domain/sheet/**", "docs/development/ANATOMICAL_SHEET_MODEL.md", "docs/development/V1-2_ANATOMICAL_SHEETS.md", "supabase/seed/anatomical-sheets/**", "crates/core/src/bin/upload_sheet_assets/**"]
---
# Anatomical sheet model (crates/core/src/domain/sheet + migration 20261008110000)
- `docs/development/ANATOMICAL_SHEET_MODEL.md` is the source of truth: document shape, issue codes, tables, RPCs.
- `docs/development/ANATOMICAL_SHEET_MODEL.md` is the source of truth for the model as built: document shape, issue
codes, tables, RPCs. `docs/development/V1-2_ANATOMICAL_SHEETS.md` holds 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
explicit `finding_zone_id`; vertebral regions are ordered data with free codes. No label matching at runtime.
- A published version is immutable (trigger, every role). Change = new draft (`create_sheet_draft`) then
`publish_sheet_version`. Integrity rule codes are shared by `validate_sheet_document` (Rust core) and
`private.sheet_document_issues` (SQL); add a rule on both sides and in the spec table.
- 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_document` and to the spec
table only. Never extend `private.sheet_document_issues`: V1-2 (M5) removes its business rules and keeps the
structural and relational guards.
- Document schema change → bump `SHEET_DOCUMENT_SCHEMA_VERSION`, extend the SQL CHECK on `document_schema_version`.
- Official equine sheet = generated seed `draft/` (`pnpm import:equine --out` into an empty folder, then reviewed and copied; never edit `legacy-import/` or `draft/` by hand;
`curation_draft` / `curation_review` fail on drift, `pnpm import:equine --check` lists it). Every content change goes through `curation/changes.json` (traced in CHANGELOG.md).
It is a DRAFT until a platform admin publishes it after business review of `REVIEW-REPORT.md`.
- Sheet SVG bytes live in Storage bucket `anatomical-sheet-assets` as `<sha256>.svg`; uploads are an operator task
(`pnpm assets:upload <seed dir>` with the service key in env), never from the browser.
No bump during V1-2 (BLK-008).
- Historical equine sheet `503dc301…` = generated seed `draft/` (`pnpm import:equine --out` into an empty folder, then
reviewed and copied; never edit `legacy-import/` or `draft/` by hand; `curation_draft` / `curation_review` fail on
drift, `pnpm import:equine --check` lists it). Its content changes only through `curation/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-assets` as `<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_status` means `inherited` (`#[serde(default)]`): any check on statuses treats an absent value as
`inherited`.