[PR #2505] [CLOSED] Fix storage cache stamps #5626

Closed
opened 2026-10-22 04:17:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2505
Author: @Promansis
Created: 6/6/2026
Status: ❌ Closed

Base: refactor ← Head: fix/storage-cache-stamps-2497-2498


📝 Commits (5)

  • f3a1b1d fix storage get id lookup cache
  • 8a11748 Merge projected storage list cache stamp
  • 3323802 Fix storage clippy single match
  • bc97677 Harden storage read cache stamps
  • d0a0897 Retry unstable storage id index builds

📊 Changes

1 file changed (+873 additions, -38 deletions)

View changed files

📝 src-tauri/crates/storage/src/lib.rs (+873 -38)

📄 Description

Linked issue

Closes #2497
Closes #2498

Why this change

  • Storage reads by id and projected-list reads could reuse stale or overly broad cache state after disk-backed collection access. The fixes keep cached id lookups narrow and make projected-list cache validation use the intended metadata stamp while atomic write conflict checks keep content-aware protection.

What changed

  • Added a cached id-index path for disk reads so repeated get and projected get calls can reuse indexed record ranges without loading full pretty JSON collections.
  • Split storage cache stamps so projected list caches use length/mtime metadata, while atomic update conflict detection still uses a content signature.
  • Added focused Rust storage regression tests for id-index reuse, projected id lookup behavior, and projected-list cache stamp behavior.

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • src-tauri/crates/storage/src/lib.rs
  • Disk-backed collection reads by id
  • Projected collection list cache invalidation
  • Atomic collection update conflict checks

Boundary notes:

  • Change stays inside the Rust storage capability crate.
  • No React, engine, shared API, Tauri command registration, or remote-runtime routing boundaries changed.

Pressure points touched:

  • None. No ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs command registration, or import modules touched.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • cargo test --manifest-path src-tauri/crates/storage/Cargo.toml repeated_get_uses_cached_id_index_after_disk_read passed.
  • cargo test --manifest-path src-tauri/crates/storage/Cargo.toml repeated_projected_get_uses_cached_id_index_after_disk_read passed.
  • cargo test --manifest-path src-tauri/crates/storage/Cargo.toml projected_get_id_index_avoids_caching_full_pretty_rows passed.
  • cargo test --manifest-path src-tauri/crates/storage/Cargo.toml projected_collection_stamp_uses_metadata_without_content_signature passed.
  • cargo test --manifest-path src-tauri/crates/storage/Cargo.toml list_projected_cache_detects_same_length_rewrite_when_mtime_changes passed.
  • pnpm check passed.
  • Durable test rationale: these are storage cache regressions that can silently return stale or overly broad data; existing command-level proof is not enough to guard future cache changes; the tests are narrow storage-crate unit tests around the affected cache paths.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Storage cache bugfix only; no new user-discoverable feature, setting, mode, panel, import path, agent, media capability, or advanced tool.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. Rust storage-only change; no visible UI behavior changed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2505 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/6/2026 **Status:** ❌ Closed **Base:** `refactor` ← **Head:** `fix/storage-cache-stamps-2497-2498` --- ### 📝 Commits (5) - [`f3a1b1d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f3a1b1da2c75b3e87de963c06da26bf04fc2b6cf) fix storage get id lookup cache - [`8a11748`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8a117486bd0f08703fb79f33e3ef8ebe5dea8c18) Merge projected storage list cache stamp - [`3323802`](https://github.com/Pasta-Devs/Marinara-Engine/commit/33238026e0b204bc517af4280ec369e2a90a1f2a) Fix storage clippy single match - [`bc97677`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bc9767772779e94c5527752c34865259548e781c) Harden storage read cache stamps - [`d0a0897`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d0a089772e088ab90b10b8bd06f1a01713718240) Retry unstable storage id index builds ### 📊 Changes **1 file changed** (+873 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/crates/storage/src/lib.rs` (+873 -38) </details> ### 📄 Description ## Linked issue Closes #2497 Closes #2498 ## Why this change - Storage reads by id and projected-list reads could reuse stale or overly broad cache state after disk-backed collection access. The fixes keep cached id lookups narrow and make projected-list cache validation use the intended metadata stamp while atomic write conflict checks keep content-aware protection. ## What changed - Added a cached id-index path for disk reads so repeated `get` and projected `get` calls can reuse indexed record ranges without loading full pretty JSON collections. - Split storage cache stamps so projected list caches use length/mtime metadata, while atomic update conflict detection still uses a content signature. - Added focused Rust storage regression tests for id-index reuse, projected id lookup behavior, and projected-list cache stamp behavior. ## Refactor impact Primary owner: Rust storage Impact areas reviewed: - `src-tauri/crates/storage/src/lib.rs` - Disk-backed collection reads by id - Projected collection list cache invalidation - Atomic collection update conflict checks Boundary notes: - Change stays inside the Rust storage capability crate. - No React, engine, shared API, Tauri command registration, or remote-runtime routing boundaries changed. Pressure points touched: - None. No ModeSurface, GameSurface, shared mode UI, `src-tauri/src/lib.rs` command registration, or import modules touched. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo test --manifest-path src-tauri/crates/storage/Cargo.toml repeated_get_uses_cached_id_index_after_disk_read` passed. - `cargo test --manifest-path src-tauri/crates/storage/Cargo.toml repeated_projected_get_uses_cached_id_index_after_disk_read` passed. - `cargo test --manifest-path src-tauri/crates/storage/Cargo.toml projected_get_id_index_avoids_caching_full_pretty_rows` passed. - `cargo test --manifest-path src-tauri/crates/storage/Cargo.toml projected_collection_stamp_uses_metadata_without_content_signature` passed. - `cargo test --manifest-path src-tauri/crates/storage/Cargo.toml list_projected_cache_detects_same_length_rewrite_when_mtime_changes` passed. - `pnpm check` passed. - Durable test rationale: these are storage cache regressions that can silently return stale or overly broad data; existing command-level proof is not enough to guard future cache changes; the tests are narrow storage-crate unit tests around the affected cache paths. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Storage cache bugfix only; no new user-discoverable feature, setting, mode, panel, import path, agent, media capability, or advanced tool. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. Rust storage-only change; no visible UI behavior changed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:56 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5626
No description provided.