docs(docs): realign active docs on develop for P0

Roadmap section and step statuses in the plan, D-R9 Rust services in
place of Edge Functions and a Node worker, platform roles per BDR-026,
equine sheet draft-only, curation-only authoring until Step 17,
OPEN_QUESTIONS statuses and conflict resolutions, dated snapshot
notices on the Step 0 documents.
This commit is contained in:
bchanot committed 2026-10-25 17:12:37 +01:00
1 parent c71fafa3c5
commit ac60b24267
12 files changed
+260 -92

No files matched your search

+15 -8
View File
@@ -5,6 +5,13 @@ Status: Step 0 deliverable, 2026-10-08. Derived from
current code (`docs/faunosteo-audit/`). No SQL here: entity names are the
conceptual tables of the architecture document, listed so that each
implementation step knows which domain it touches.
Revised 2026-10-25 (P0): platform roles (BDR-026), sheet document fields
(BDR-031), Storage as built (`STORAGE.md`). The "Reuse" rows and §19 describe
the code of 2026-10-08: the TypeScript modules they name have since moved into
`crates/core` or been deleted (Steps 5 to 8, R2 to R5); `CLAUDE.md` holds the
current map. Clients and Animals (§4, §5) are being reframed by the V1-1
contract (`V1-1_OWNERS_ANIMALS.md`): workspaces, no global client record,
client-animal links with roles; owner orientations awaiting ratification.
Conventions used below:
@@ -54,7 +61,7 @@ Animals, Identity and (optionally) Organizations.
| Item | Content |
|---|---|
| Entities | `profiles` (= `auth.users.id`), `profile_roles` (additive roles: practitioner, student, professor, owner, admin, moderator, support), `platform_invitations` |
| Entities | `profiles` (= `auth.users.id`), `profile_roles` (enum `platform_role`: owner, admin, moderator, support; BDR-026), `platform_invitations` (not built). Professional statuses (practitioner, student, professor) are outcomes of Professional Verification, cabinet roles live in the cabinet membership: neither is a platform role. |
| Depends on | Supabase Auth (email/password, Google, Apple, OTP/magic link, phone verification) |
| Depended on by | every other domain |
| Server-only | role grants (admin action, never a browser update), phone/email verification state, invitation acceptance |
@@ -109,10 +116,10 @@ Animals, Identity and (optionally) Organizations.
| Item | Content |
|---|---|
| Entities | `species` (list: id, labels), `anatomical_sheets` (identity, creator, visibility, status, provenance `based_on_sheet_id`/`based_on_version_id`, `current_version_id`), `anatomical_sheet_versions` (version number, status draft/published/deprecated, `document_schema_version`, `content_jsonb`, assets, publication metadata), sheet assets in Storage (SVG per view) |
| Canonical document (JSONB) | `schema_version`, `species_id`, `vertebral_config` (ordered regions: code, label FR/EN, count), `views[]` (id, kind main/detail, `parent_view_id`, `opened_by_annotation_id`, `view_box`, `svg_asset_id`), `annotations[]` (stable id, view id, kind point/zone/detail-trigger, category id, names FR/EN, laterality, special, geometry), `categories[]` (id, label, colour), `finding_tree.zones{}` (current `ZoneFindings` shape), `annotation_finding_map[]` (annotation id → finding zone id), `scope_disclaimer`, legacy id map (old `data-anno-id` → new id) kept for migration only |
| Canonical document (JSONB) | `schema_version`, `species_id`, `vertebral_config` (ordered regions: code, label FR/EN, count), `views[]` (id, kind main/detail, `parent_view_id`, `opened_by_annotation_id`, `view_box`, `svg_asset_id`), `annotations[]` (stable id, view id, kind point/zone/detail-trigger, category id, names FR/EN, laterality, special, geometry), `categories[]` (id, label, colour), finding tree by finding zone, `finding_zone_id` inline on each annotation (no separate map, BDR-031), `scope_disclaimer`; legacy id mapping kept in the seed's generated files and the report migration map. Exact shape: `ANATOMICAL_SHEET_MODEL.md` |
| Depends on | Identity (creator), Files (SVG assets), Community (visibility/grants read at use time), Billing (private visibility add-on) |
| Depended on by | Reports (exact version reference), Community, Animals (species list), Imports (none) |
| Server-only | version immutability once published, version numbering, garbage collection preconditions (no report, no fork, no grant, no pending process), SVG sanitization before any other user can read the asset, "can use / can fork" evaluation |
| Server-only | version immutability once published, version numbering, garbage collection preconditions (no report, no fork, no grant, no pending process), SVG reading by the core before any other user can read the asset, "can use / can fork" evaluation |
| Reuse | `parseSvgBones` (importer and renderer), `findings.ts` schema (finding tree), `zoneMatch.ts` (importer only), `regionFromLabel` (importer only), `AnatomyCanvas`, `DetailModal`, `VertebraPicker`, `FindingsTreePicker`, the two equine SVGs and the catalog as seed, the tree-edit behaviour of `pathology-editor.html` and the annotation operations of `SvgEditorRoute` as functional references |
| Notes | Rules 2–8 of the brief (§18) all live here. The current code has no sheet object at all (audit 02 §6): no id, no version, no author, no persisted SVG ↔ catalog link. |
@@ -121,7 +128,7 @@ Animals, Identity and (optionally) Organizations.
| Item | Content |
|---|---|
| Entities | `reports` (report number, animal, practitioner, organization nullable, ownership scope, status draft/completed/archived, report date, `anatomical_sheet_version_id`, `current_document`, revision counter, `completed_at`, `free_edit_until`, soft delete), `report_revisions` (document snapshots with reason), `report_access_grants`, `practitioner_report_counters` (row-locked numbering), report PDF artifacts (Files) |
| Report document (JSONB) | current `Report` v2 shape evolved to v3: observations with zones keyed by `annotationId` + `viewId`, vertebrae with region code, findings with snapshots, free text, severity, comment, conclusion, recommendations, next appointment, identity snapshots (practitioner, animal, client), `localAnnotations[]` (report-only points, see `OPEN_QUESTIONS.md` Q6), locale used for the last PDF |
| Report document (JSONB) | current `Report` v2 shape evolved to v3: observations with zones keyed by `annotationId` + `viewId`, vertebrae with region code, findings with snapshots, free text, severity, comment, conclusion, recommendations, next appointment, identity snapshots (practitioner, animal, client), `localAnnotations[]` (report-only points, see `OPEN_QUESTIONS.md` Q6); the locale stays out of the report (BDR-014), the PDF envelope records it |
| Depends on | Animals (and Clients through them), Identity, Organizations, Anatomical Sheets (exact version), Billing & Entitlements (quota, free edit window), Files (PDF artifacts) |
| Depended on by | Community (shared report revisions), Booking (appointment ↔ report link, optional), Imports, Notifications (secure sending to the owner) |
| Server-only | report numbering, completion (quota check, `free_edit_until`), revision checkpoints, "deleted completed reports still count", shared-practitioner revision acceptance, import quota preflight |
@@ -173,10 +180,10 @@ Animals, Identity and (optionally) Organizations.
| Item | Content |
|---|---|
| Entities | `assets` (bucket, object key, owner scope, resource type/id, mime, size, checksum, sanitization status), buckets `avatars/ logos/ professional-documents/ client-files/ animal-files/ report-files/ anatomical-sheets/ imports/` |
| Entities | `assets` (status, owner, server-built keys, lease; `STORAGE.md`), buckets `avatars` (policies), `logos`, `professional-documents`, `client-files`, `animal-files`, `report-files`, `imports` (closed), `anatomical-sheet-assets` (sheet drawings) |
| Depends on | Identity, and every owning domain for access rules |
| Depended on by | Verification, Clients, Animals, Reports (PDF artifacts), Anatomical Sheets (SVG), Imports, Public Profile (photos, logos) |
| Server-only | object key generation (`<resource>/<resource-id>/<asset-id>/<safe-filename>`), signed URL issuance, SVG sanitization and quarantine, `storage.objects` RLS |
| Server-only | object key generation from uuids, quarantine and decoding in the Rust worker's sandboxed child, `storage.objects` RLS through `assets`; owner-only files read under RLS with no signed URL (BDR-048) |
| Reuse | `sanitizeSvg` (10 lines in `SvgEditorRoute` and duplicated in `pathology-editor.html`) as the *client-side* pre-check only; the server sanitizer is new. |
## 13. Billing & Entitlements
@@ -235,8 +242,8 @@ Animals, Identity and (optionally) Organizations.
| Item | Content |
|---|---|
| Entities | `student_professor_links`, `student_access_periods`, student-owned educational reports |
| Depends on | Identity (student/professor roles), Reports, Billing (student entitlement), Anatomical Sheets |
| Notes | Must not be built in the MVP, but `profile_roles` and `entitlement_grants` are shaped so it fits later without migration pain. |
| Depends on | Identity and Professional Verification (student/professor statuses, not platform roles: BDR-026), Reports, Billing (student entitlement), Anatomical Sheets |
| Notes | Must not be built in the MVP, but verification statuses and `entitlement_grants` are shaped so it fits later without migration pain. No plan step owns education yet. |
## 19. Reuse matrix (current code → domain)