M4 20261028100000_sheet_access_hardening + M5 20261028110000_sheet_review_workflow (applied together; no unprotected window). Implements contract §5-§14. - Catalogue rights table + owner RPCs; has_mfa / has_aal2_session (live auth.sessions check); grant_active vs caller_has split; catalogue reader predicate; can_edit_sheet on the sheet_editor capability (F14). - AR-1 B: aal2 required on every platform role change, target verified factor, race-free last-owner guard (F18/F19); service_role loses table privileges on the catalogue + profiles/profile_roles and EXECUTE on the role RPCs (F12/F17). - Reviewed lifecycle: version provenance + review columns, content/freeze/ author triggers, rounds/comments/acknowledgments, save/submit/withdraw/ comment/acknowledge/decide, atomic publish_sheet_version(review_id) on the stored verdict, deprecate/archive/restore, species RPCs, equine working copy, uploads with the storage check (F7) + editor INSERT policy + 2 MiB bucket. F1-F3,F5,F6,F8,F9,F13,F15,F16 closed. Verdict is a fixture until M6 (V1-2.3). - O22: SQL business mirror removed, declared status check kept; pgTAP 011 and the Rust generator's SQL parts deleted, ledger retargeted. - Access layer sheets.ts (closed SheetFailure kinds); old client publish gate deleted; types regenerated; upload tool reads via get_sheet_asset_state. Tested on the throwaway sandbox only; DEV untouched. pgTAP 850 (real stack) / 122 (PGlite) green; real-GoTrue AR-1 B + F18 race green; fresh install and M3->M5 upgrade green; V1-1 regression green; rust:check, typecheck, lint, build, types drift clean. BDR-084, LRN-095.
packages/
Shared code lives here once it has a real owner and real content: an empty
package would only add build configuration to maintain (IMPLEMENTATION_PLAN.md
Step 2, FRONTEND_ARCHITECTURE.md §6). First package: supabase/ (Step 3).
Planned packages and the step that creates each one:
| Package | Content | Created at |
|---|---|---|
@faunosteo/domain |
Zod schemas of the sheet, report and archive contracts (created Step 4, deleted R5.7, 2026-10-25): the contracts and rules live in the Rust core (crates/core/src/domain); its sources stay byte-identical as the frozen N-1 reader under core-wasm/tests/n-1/domain |
Step 4; gone at R5.7 |
@faunosteo/anatomy |
legacy importer, curation pipeline, annotation-layer renderer (created Steps 4b to 5, deleted R5.7, 2026-10-25): the core's anatomy (R3) and curation (R5, pnpm import:equine) modules replace it |
Step 4b; gone at R5.7 |
@faunosteo/pdf |
browser-free PDF engine (created Step 6, deleted R4.8, 2026-10-19): its reader, writer and compare tool live in the Rust core (crates/core/src/pdf); its byte-scan reader stays as the frozen N-1 copy under core-wasm/tests/n-1/scanner |
Step 6; gone at R4.8 |
@faunosteo/i18n |
FR/EN dictionaries (no React) + useT |
first second consumer (public-web or worker) |
@faunosteo/supabase |
browser client factory, generated database types, PGlite harness running the pgTAP suite, sheet publish gate | created, Step 3 |
@faunosteo/core-wasm |
the Rust core compiled to WebAssembly: CoreRuntime (lazy load, poison on a trap, offline re-instantiation, sheet handles per instance), Node source, pkg/ shipped and pkg-proofs/ (built by pnpm wasm:build, git-ignored, BUILD_STAMP), TypeScript types of the contracts generated by ts-rs (committed), the frozen N-1 Zod reader (./n-1), the trap, size and measurement tests |
created, R0; runtime and app consumers R2 |
Since R2 the Rust core (crates/core) holds the business logic domain held
for the application (docs/development/RUST.md §8); domain then stayed
frozen for the pipeline only (the application stopped depending on it at R4.8). Since
R3 the core also holds the SVG reader, the annotation layer and the view
composition the editor canvas draws (RUST.md §9). Since R4 (RUST.md §10)
the core reads, writes and compares the PDF archives; pdf was deleted at
R4.8. Since R5 (RUST.md §11) the anatomical pipeline runs in the core;
domain and anatomy were deleted at R5.7, their tests dispositioned case by
case in crates/core/tests/curation/LEDGER.tsv
(docs/development/RUST_ARCHITECTURE_REVIEW.md Part VI).
| @faunosteo/config | runtime config resolution shared by app, public-web, worker | with public-web |
| @faunosteo/ui | UI primitives and design tokens | only when public-web reuses them |
Convention: a package has its own package.json (name, exports, types),
tsconfig.json extending the root one, and tests beside its sources.