Persistence: share entity write-through helper; normalize quota at db.put

This commit is contained in:
2026-06-16 23:06:37 +03:00
parent 778b4d848a
commit 2ed9db3792
18 changed files with 422 additions and 205 deletions
+6 -1
View File
@@ -129,7 +129,12 @@ Review all changes in scope. If changes span multiple patterns below, apply all
12. **Persistence safety**: records that may need migration carry a `version` field; reads
apply migrations; destructive actions (delete, revert, reset) confirm; storage failures
warn rather than silently lose data.
warn rather than silently lose data. All IndexedDB writes go through `db.put` — a
hand-rolled `tx(…, 'readwrite')` or raw `objectStore.put`/`delete` outside `db.ts` bypasses
the quota normalization that mints `StorageQuotaError`, silently losing the fail-loud signal
(arch 02). A new per-record entity tier's write-through subscriber calls the shared
`wireEntityWriteThrough` helper (`orchestration/entity-persistence.ts`) instead of
re-implementing the prev/next diff loop.
13. **Documentation hygiene** (the docs are maintained artifacts; keep them at altitude): - **Self-containment**: documentation and comments must not add pointers that require an
external repository to follow. Knowledge gets captured locally (`docs/spec/`,