Files
clean-architecture-frontend…/docs/reviews
DongHyeonkaandClaude Opus 5.5 16abd920a7 refactor(storage): keep IndexedDB stored-row rules in one module (Q-6.5-7)
The runtime and maintenance each carried their own Stored* row types,
isStored* validators, record size formula, countBucket and failureOf, and
the dataset binding check had a third, hand-written budget validator. A
field added to one copy would make the other judge a healthy row corrupt.

indexeddb-records.ts now holds the row types, the validators, the budget
key and measureRecordBytes (payload + 512-byte envelope + UTF-16 key). Each
call site keeps its own failure code for a bad measurement (runtime
INVALID_INPUT, maintenance MIGRATION_FAILED), and only the binding check
still bounds a stored budget by hardBudgetBytes. The one validator
difference (maintenance's retention check did not re-validate the key it
compared against) is unobservable: it always passes a validated record key.

Verified: characterization tests added first in
tests/unit/indexeddb-maintenance.test.ts pin the size formula in both
writers, the per-site failure codes for NaN/negative/oversized sizes, and
the hardBudgetBytes bound at open (runtime and maintenance fail with
POLICY_REJECTED one byte over, open at the limit). They passed before and
after the refactor. INVENTORY.md (137/137) and the storage detail table
list the new file. All gates pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 13:30:26 +09:00
..