Skip to content

Order persistent cache mutations within each tiered cache - #69

Merged
Jason-Doyle merged 3 commits into
mainfrom
experiment/ordered-persistent-cache-mutations
Dec 3, 2026
Merged

Jason-Doyle merged 3 commits into
mainfrom
experiment/ordered-persistent-cache-mutations

Conversation

@Jason-Doyle

Copy link
Copy Markdown
Owner

Change

Order persistent mutations admitted through one TieredObjectCache. Same-key
sets and deletes wait for predecessors; clearAll and destroy wait for
earlier admitted work and fence later mutations. Unrelated keys remain
independently runnable. Memory updates, read invalidation, admission checks
and failure behaviour are preserved.

The only production change is in src/browser/cache.ts: 46 insertions and
eight deletions. There is no public option, dependency, entry clone, retry,
stored-format or IndexedDB schema change.

Evidence

The report, exact tables, graph and raw evidence
record the prospective protocol and its 85/100 threshold. Source and collector
were pushed at c727304a0e83bcefde722b321de6e0109ad674ee before the first
and only detached comparative capture.

Across 384 matched pairs, expected outcomes improve from 264/384 to 384/384;
all 120 declared reverse-order conflicts reproduce in the baseline. Strict
adapter ordering improves from 72/384 to 384/384. Every pair preserves action
memory traces, clone work, metrics, admissions and adapter-attempt counts.
Both arms start five held unrelated-key operations. Each arm makes 1,392
adapter calls including cold verification, 768 action entry clones and
115,584 logical clone-input bytes. These are structural observations, not
latency or heap measurements.

Local qualification passes 37 focused cases, 275 existing controls, all
48 corrected native encrypted-IndexedDB/delayed-WebCrypto cases, types,
package build/exports, canonical documentation and website link checks.
The first native attempt passed 42/48 because two multikey fixture templates
used ineligible lower-case HEAD paths under the locations policy. Correcting
those two fixture lines changed neither runtime code nor protocol gates.
Both attempts and all runner digests are accounted for in the report.

The assessment is 91/100: 38/40 mutation correctness, 23/25 concurrency and
failure compatibility, 18/20 reproduction and 12/15 scope and simplicity.
Normal exact-head CI and human review remain required.

Costs and boundaries

Promise chains add scheduling, callbacks and active-key bookkeeping.
Conflicting operations can block behind a hung predecessor; cleanup can
retain dependency snapshots and block subsequent work. Caller concurrency
can create an uncapped backlog beyond resident-cache limits.

Adapters must report accurate completion promises, and set inputs must
remain stable until settlement. This does not order separate instances or
direct adapters, cover reads begun during unfinished mutations, or provide
cross-tab consistency or durable logout. No infrastructure, workflow,
deployment, release or shared-host runtime change is included.

@Jason-Doyle
Jason-Doyle merged commit 09aa634 into main Dec 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant