S00-005: Select idb and verify transactional storage failure policies

Changes: Propose ADR 0004 comparing native IndexedDB, idb and Dexie; select idb 8.0.4 with account, transaction, quota, upgrade and key ownership policy. Repair rollback and add injected quota/blocked upgrade checks, exact wrapper lock, runtime guard, license texts and reproduction notes. Preserve historical recovery artifacts.
Validation: Fresh-cache npm ci and npm run check passed on Node 24.21.0/npm 11.19.0; manifest, HTTPS/SHA512 and license checks passed. make check passed 72 tooling tests; tasks.py validate and git diff --check passed. Native browser quota, disk durability and process restart were not tested; ADR remains proposed for independent QA.

Task: S00-005
Agent: auto-storage-0ce544ac4b40
Role: storage
Action: claim
Status: review

Task title: Выбрать IndexedDB wrapper и migration policy
This commit is contained in:
wt committed 2026-10-15 18:33:15 +07:00
1 parent 8f918bc040
commit 0e2b3098df
17 files changed
+713 -128

No files matched your search

@@ -0,0 +1,90 @@
# S00-005 executor evidence
Executor: auto-storage-0ce544ac4b40 (storage), 2026-10-15.
Result: proposed ADR 0004 and bounded storage experiments, pending independent QA.
Input: master/startup/role/workflow documents, required TESTING and ADR registry,
assigned resume/show/packet, original handoff, exact STORE-001/STORE-004 in
specs/tz_clear.md, accepted ADR 0001, direct S00-002/S00-023 executor/review evidence
and handoffs, preserved RECOVERY.md and unfinished experiment files.
No repeat claim, new task, subagent or model launch. No ancestor AGENTS.md found
by explicit parent-path inspection. Persistence contract is listed as future S01
work in the registry and is not present; this research needs no shared contract.
## Actual changes
- ADR compares native IndexedDB, idb 8.0.4 and Dexie 4.4.6; selects idb, sets
account isolation, transaction/completion, quota, migration, connection and key
ownership policy. Remains proposed. No production implementation claim.
- Isolated manifest/lock pins idb alongside preserved fake-indexeddb 6.2.5;
retained HTTPS/TLS and added strict engines + exact runtime check. Package license
texts copied from the installed unmodified packages into scoped licenses/.
- Replaced defective rollback with actual ConstraintError migration, schema/index/
data restoration assertions, corrected retry and same-process reopen.
- Added explicit injected quota-failure policy/atomic abort/checkpoint/account
preservation and real fixture blocked/versionchange/release/VersionError checks.
- README explains reproduction and limits. Historical RECOVERY.md and exploratory
_probe.mjs remain unchanged. No application module, shared interface, immutable
specification, plan definition or system/Git configuration changed.
## Commands and observed results
All successful npm commands used
`PATH=/tmp/luma-approved-toolchain/node-v24.21.0-linux-x64/bin:$PATH`.
Existing approved isolated runtime reused; no archive download/checksum claimed.
| Command/check | Exit | Observed result |
| --- | --- | --- |
| `python3 scripts/tasks.py resume --agent auto-storage-0ce544ac4b40`, `show S00-005`, `packet S00-005 --agent auto-storage-0ce544ac4b40` | 0 each | Correct assigned task, ready reviewed dependencies; scope read |
| `npm view idb version license engines dependencies --json --cache /tmp/luma-storage-cache --fetch-retries=0 --fetch-timeout=15000` | 0 | idb 8.0.4 ISC |
| `npm view dexie version license engines --json --cache /tmp/luma-storage-cache-dexie --fetch-retries=0 --fetch-timeout=15000` | 0 | Dexie 4.4.6 Apache-2.0; not installed |
| From experiment: `npm install --ignore-scripts --no-audit --no-fund --cache /tmp/luma-storage-cache --fetch-retries=0 --fetch-timeout=15000` | 0 | Added idb and updated isolated lock |
| From root: `npm --prefix experiments/0004-storage-design run check` | 0 | Exact runtime guard; rollback, injected quota policy, blocked upgrade assertions passed |
| `npm --prefix experiments/0004-storage-design ci --ignore-scripts --no-audit --no-fund --cache /tmp/luma-storage-clean-0ce544ac4b40 --fetch-retries=0 --fetch-timeout=15000` | 0 | Fresh-cache locked clean install: 2 packages |
| Same `npm --prefix ... run check` after clean install | 0 | All focused assertions passed again |
| Inline Python manifest/lock/license/integrity checks | 0 | 2 packages, no transitives; exact manifest agreement, HTTPS/SHA512, ISC/Apache-2.0 installed texts retained |
| Inline Python subprocess runs pinned node `src/check-runtime.mjs` without npm context | 0 wrapper | Child exit 1 expected and asserted; refuses absent pinned npm context |
| `make check > /tmp/luma-S00-005-check.log 2>&1` | 0 | Foundation validation and tooling tests passed; counts below |
| `git diff --check`, scoped `git diff`/`git status --short --untracked-files=all` | 0 | Only allowed experiment/ADR and workflow metadata; no tracked whitespace issues |
Primary sources opened through web tool: idb upstream README (transactions,
completion, lifecycle/typed API), Dexie design, IndexedDB and Storage standards,
WebKit storage policy, fake-indexeddb upstream README. Exact links/date in ADR.
Registry web-page fetches for latest idb/Dexie returned internal error; successful
normal-TLS npm registry metadata and locked package inspection supplied exact pins.
No TLS bypass, secret or production transport involved.
One setup error: npm install was initially invoked from project root instead of
the experiment. npm resolved an ancestor prefix and was denied writing
/home/tola/package-lock.json (EROFS, exit 226). No outside file was created or
permissions changed. Correct experiment-directory invocation succeeded. Initial
apply_patch attempted delete/add on the same rollback path and was rejected
without applying; the subsequent scoped file rewrite succeeded. Guessed future
persistence contract and optional experiment .gitignore reads returned missing;
their absence is not missing required input. Root .gitignore already excludes
node_modules and logs.
## Acceptance evidence and limitations
Rollback observes actual ConstraintError and AbortError, exact v1 data, absence
of migrated store/index, successful v2 retry/query and connection reopen. Quota
injection occurs after successful history/checkpoint requests and verifies saved
false, no history or checkpoint advancement, account B history/settings/opaque
crypto fixture preservation, followed by successful retry. Blocked upgrade is
observed before upgrade executes; closing the old connection allows v2 and stale
v1 fails. These execute the selected idb wrapper against fake-indexeddb.
Cua browser inventory returned apps=[] and browsers=[]. No native browser test
ran. In-memory reopen is not process/crash restart. Injected QuotaExceededError
does not prove browser quota generation at request/commit; physical disk failure,
eviction, browser multi-tab behavior, StorageManager grants, account deletion/
suppression and real crypto state are not verified. ADR/README preserve these
external and downstream checks. fake-indexeddb is explicitly test-only and no
production fallback was added. No vulnerability/provenance audit or app readiness
claim. Independent QA must reproduce focused checks and assess the policy/limits.
Coordinator owns Git and next process; executor stops immediately after submit.
Final foundation result: 296 tasks, 22 stages, 221 requirements, 211 allocated Web
requirements, revision 116; 72 tests passed in 18.889s. Separate
`python3 scripts/tasks.py validate` returned exit 0 with the same counts.
Lockfile SHA256: c6c416a92b1a3d10e3fb83bcdbbc803114adbd1dd24e06f5dceebb4b59f9ea7b.