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,4 @@
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.
@@ -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.
+28 -5
View File
@@ -1,9 +1,32 @@
# S00-005 handoff for independent QA
Executor: auto-storage-0ce544ac4b40 (storage), 2026-10-15.
Outcome: proposed ADR 0004 selects idb 8.0.4 and defines transaction, quota,
migration/connection and crypto key ownership policy. Scoped experiment now
executes rollback, explicit quota-failure policy and blocked upgrade scenarios.
Historical interrupted work was resumed only after independently reviewed S00-023;
RECOVERY.md remains a historical inventory, not current test status.
# Blocked handoff
QA input: docs/decisions/0004-storage-design.md, experiment README, exact lock/
license texts and src checks; full executor evidence at
state/evidence/S00-005-auto-storage-0ce544ac4b40.md. Verify source scope and
executor message, reproduce fresh-cache npm ci and npm run check on accepted
Node 24.21.0/npm 11.19.0. Linux runtime used here:
/tmp/luma-approved-toolchain/node-v24.21.0-linux-x64/bin.
The wrapper lock digest is c6c416a92b1a3d10e3fb83bcdbbc803114adbd1dd24e06f5dceebb4b59f9ea7b.
Original: S00-005; reporter: auto-storage-88c3286c6641; resolution: S00-023.
Actual results: fresh-cache install and selected-wrapper fixture checks exit 0;
make check exit 0 (296 tasks, 72 tooling tests). Foundation checks are not app
readiness. Rollback now causes actual unique-index ConstraintError, validates
schema/data restoration, retry and same-process reopen. Injected quota failure
aborts history/checkpoint together and preserves account B. Held old connection
produces versionchange/blocked, closes to release v2, and stale v1 is refused.
Previous runner session was interrupted before submit/escalate; processes stopped. User now explicitly requests resuming development. Preserve partial artifacts, verify them in a fresh bounded remediation, and return original to a new executor only after independent review.
Next: complete and review the remediation; only a fresh session may continue.
Limits: browser inventory empty. Quota is an explicit injected error; no native
quota exhaustion, disk durability, process restart, eviction, real multi-tab,
persistence grants, deletion/suppression or crypto-unlock test was run. Fixtures
are synthetic and test-only. S01 contracts remain future work; no app schema/
port/adapter was introduced. ADR remains proposed until independent acceptance.
If QA accepts, record ADR acceptance metadata within its allowed scope and
separate review evidence, then approve via CLI. Coordinator alone commits and
launches another fresh session. Executor exits immediately after submit.
+30 -6
View File
@@ -1,6 +1,6 @@
{
"schema_version": 1,
"revision": 115,
"revision": 117,
"tasks": {
"S00-001": {
"status": "done",
@@ -64,17 +64,18 @@
"resumed_after_blocker": true
},
"S00-005": {
"status": "todo",
"owner": null,
"started_at": "2026-10-15T09:15:46+00:00",
"status": "review",
"owner": "auto-storage-0ce544ac4b40",
"started_at": "2026-10-15T11:26:11+00:00",
"reason": null,
"updated_at": "2026-10-15T11:09:33+00:00",
"updated_at": "2026-10-15T11:33:09+00:00",
"blocked_by": [],
"resume_status": "in_progress",
"blocker_report": "state/blockers/S00-023.md",
"handoff": "state/handoffs/S00-005.md",
"previous_owner": "auto-storage-88c3286c6641",
"resumed_after_blocker": true
"resumed_after_blocker": true,
"evidence": "state/evidence/S00-005-auto-storage-0ce544ac4b40.md"
},
"S00-006": {
"status": "todo",
@@ -2940,6 +2941,29 @@
"to": "done",
"reason": null,
"evidence": "state/evidence/S00-003-review.md"
},
{
"revision": 116,
"at": "2026-10-15T11:26:11+00:00",
"action": "claim",
"task": "S00-005",
"agent": "auto-storage-0ce544ac4b40",
"role": "storage",
"from": "todo",
"to": "in_progress",
"reason": null
},
{
"revision": 117,
"at": "2026-10-15T11:33:09+00:00",
"action": "submit",
"task": "S00-005",
"agent": "auto-storage-0ce544ac4b40",
"role": null,
"from": "in_progress",
"to": "review",
"reason": null,
"evidence": "state/evidence/S00-005-auto-storage-0ce544ac4b40.md"
}
],
"retired_agents": [