bchanot
3eba6d89b2
fix(supabase): V1-2.1 bound printed numbers before the size measure
...
check_document_structure sums the numbers' printed digits one at a time
before building the whole text, so huge exponents answer
document.too_large instead of an out-of-memory error. pgTAP 020: the
full AR-1 B matrix and the rights RPCs refused to every non-owner; 017:
exponent vectors, the number bomb, publish.species.other alone.
2026-10-28 20:08:18 +01:00
bchanot
77e5fa4cf5
feat(supabase): V1-2.1 M4/M5 secure sheet access and review workflow
...
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.
2026-10-28 15:52:49 +01:00
bchanot
2d5ff0c33e
feat(supabase): foundation migrations (audit, profiles, platform roles) + pgTAP suite
...
- schemas private/audit, set_updated_at, append-only audit.audit_logs, private.log_event
- profiles created by auth.users trigger; own-row RLS; column-level UPDATE grant
- platform_role enum (owner/admin/moderator/support), profile_roles history table,
is_platform_* helpers, grant/revoke RPCs audited; writes only via RPC
- config.toml (public schema only, strong passwords, no edge runtime), local seed
- 79 pgTAP checks: allowed and denied paths for every policy
2026-10-08 22:20:54 +02:00