Repository navigation
Preserve changed cache rows during failed-decryption cleanup - #70
Merged
Merged
Conversation
Compare known metadata and encrypted bytes before removing a failed-read snapshot, using one readwrite transaction for lookup and deletion. Retain delegated cleanup for overridden delete methods and non-binary snapshots. Add focused and native-browser qualification plus the paired comparison collector.
Keep the initial missing read in the measured phase. Enforce the existing absolute ordinary-read transaction and request gate, and label unreadable-retention expectations explicitly. Runtime implementation, prospective rules and matrix dimensions are unchanged.
Record corrected paired encrypted-state evidence, native transaction atomicity and ordinary-read work. Retain the rejected initial ledger capture, exact report digests and the prospective92/100 assessment with explicit compatibility and failure-path cost limits. Keep canonical cache documentation consistent.
Resolve the current database connection before the conditional cleanup transaction. Cover close/reopen during decryption in focused tests and both policy/budget combinations across browser engines.
Retain the superseded matrix and add a detached capture of the current-connection source. Record 354 focused/control passes, 66 native passes and the negative close/reopen and declaration attempts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Guard failed-decryption cleanup against removing a changed committed encrypted
cache row. For eligible concrete built-in snapshots, compare known metadata
and IV/ciphertext bytes in the same readwrite transaction as any delete.
Unchanged corrupt rows are still removed.
Production scope is one file: 57 insertions and one deletion in
src/browser/cache.ts. Public options, formats, budgets, device-key lifecycle,tiered invalidation and mutation ordering are unchanged. Subclasses, delete
overrides and non-binary original snapshots retain delegated unconditional
cleanup and its replacement races.
Evidence
Protocol, report, exact tables, graph and raw captures.
All 192 protected retention failures reproduce in the historical module.
The candidate recovers 120 usable cold outcomes; 72 additional retained rows
remain corrupt and correctly miss on their own later read. Passing legacy
controls does not mean their replacement races are fixed.
All three comparative captures remain published. Independent replay rejected the
first capture's omitted initial-miss work despite its collector completion
flag. An explicit regression check reproduced both budget modes; the corrected
harness and strengthened existing work gate were pushed before a new detached
capture. Runtime code did not change for that ledger correction.
Further compatibility qualification found reuse of the original connection
could disable persistence after close/reopen during decryption. Cleanup now
resolves the adapter's current connection before its transaction. The new
focused regression and all 12 policy/budget/browser close-reopen controls pass.
The second capture remains retained as superseded source; the third detached
capture qualifies the final production revision. Protocol and matrix dimensions
remain unchanged.
Qualification
The final candidate passes 42 focused cases and all 312 existing controls.
The exact historical module has 23 expected focused failures. Final native
qualification passes 66 cases: 22 each in Chromium, Firefox and WebKit,
including six queued-writer atomicity cases and 12 close/reopen controls
overall. Earlier attempts, including an intermediate declaration error,
remain recorded in the report. Root/collector/native types,
package isolation/exports, canonical documentation and website links pass.
Raw rows, transaction plans, binary identities, memory/copy work, all pair
gates, CSV rows, graph bars and report tables were independently reconciled.
Normal exact-head CI remains required before merge.
Costs and decision
Eligible failures add one stored-row lookup and result copy inside the
existing cleanup transaction, plus comparisons and potential additional
object-store lock occupancy. Ordinary successful reads and misses retain
their exact request/copy work. No latency, heap or corruption-frequency
benefit is established.
This is one-row stale-cleanup protection, not arbitrary-record repair,
read linearizability, cross-instance mutation ordering or durable logout.
No provider campaign, infrastructure change, runtime upgrade or release ran.
Assessment: 92/100 against the prospective 85/100 threshold
(38/40 correctness, 24/25 compatibility, 18/20 reproduction, 12/15 simplicity).
Recommend merge after all required checks and human review.