Skip to content

Fix storage cache append merge - #2508

Merged
Promansis merged 6 commits into
Pasta-Devs:refactorfrom
Promansis:fix/storage-cache-append-friendship
Jun 6, 2026
Merged

Fix storage cache append merge#2508
Promansis merged 6 commits into
Pasta-Devs:refactorfrom
Promansis:fix/storage-cache-append-friendship

Conversation

@Promansis

Copy link
Copy Markdown
Collaborator

Linked issue

Closes #2497
Closes #2498
Related to #2493

Why this change

What changed

  • Rebases the storage cache stamp/id-index work onto current refactor, which already includes the chat append fast path.
  • Keeps Speed up chat message storage appends #2504's append helpers and Fix storage cache stamps #2505's id-index/read-index invalidation model together.
  • Invalidates disk id indexes when append writes land and updates clean cached collection row_indices_by_id entries for appended rows.
  • Extends the clean cached append regression test so appended rows must be readable through get(id).

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
  • Clean cached append path for messages and message-swipes
  • Message swipe create path that uses append fast path

Boundary notes:

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

Pressure points touched:

  • Rust storage crate collection persistence/cache internals.
  • 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 fmt --manifest-path src-tauri/crates/storage/Cargo.toml -- --check passed.
  • git diff --check passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage passed: 56 tests.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine message_swipes --lib passed: 37 tests.
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passed.
  • pnpm check passed.
  • Durable test rationale: clean-cache appends plus id-index lookups can silently miss freshly appended rows after Speed up chat message storage appends #2504 and Fix storage cache stamps #2505 are combined; storage tests already cover the append owner; the added assertion is narrow and proves appended rows remain readable by id.

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:

  • Rust storage cache/append merge fix 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.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4c309e78-2284-4444-88b2-52d698d108e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the bugfix Bug fix label Jun 6, 2026
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

✅ Bunny Review Completed

Tip

Review posted. The specimen has left the observation table.

  • Commit: fdf0fa1 - Fix storage cache append merge

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

🐰 Bunny Review

Bunny Merge Signal: Ready With Notes

Warning

READY WITH NOTES
No actionable defects were isolated, but non-blocking notes remain.

Findings Nitpicks Controls Reviewed Head Mode
0 0 1 warn, 2 pass fdf0fa18 full

Note

Mode: full
Head: fdf0fa1 - Fix storage cache append merge
Base: origin/refactor - Fix agent default parity (#2501)

🧭 Specimen Summary

  • The specimen grafts a faster ID lookup apparatus onto FileStorage: cached row-position maps, disk-backed ID indexes, pretty-record byte ranges, and content stamps now stand between callers and the old full-collection march. It also tightens projection-cache reuse and atomic conflict checks around content-aware stamps, an entertaining attempt to catch the filesystem changing costumes mid-experiment. Storage caches are delightful only while they tell the truth; the visible invalidation and stamp checks mostly remember that unpleasant requirement.

🔎 Isolated Defects

Tip

No actionable defects isolated.

🧹 Nitpicks

  • None recorded.

✅ Control Checks

Status Type Check Detail
✅ PASS CI Timing CI Status Expected CI controls completed without a reported failure.
✅ PASS Non-blocking Coverage Specialist invariant audit The visible diff keeps index construction, cache mutation, append installation, and replacement refresh behind invalidation or content-stamp agreement; no concrete pre-scan/write-loop mismatch survived inspection.
⚠️ WARN Review Limitation Packet bounds The patch was truncated, so the judgment rests on the supplied overview, per-file context, identifier map, guidance, and CI context rather than an unbounded raw-file audit.

🧪 Observations

  • Established full-review scope from origin/refactor merge base 237babc2fa14b6e88267fd5f143eb8c2053dfa11 to head fdf0fa18ba5e8979ccef38cf79480dd9c002cf1b; only src-tauri/crates/storage/src/lib.rs changed.
  • Read AGENTS.md and the architecture-guard guidance; the specimen remains inside the Rust storage capability and shows no React, feature, shared API, or remote-dispatch boundary trespass.
  • Traced the new ID-index paths through cached rows, dirty rows, disk range indexes, fallback full reads, append-many cache mutation, replacement invalidation, and atomic content-stamp checks.

🧰 CI Status

  • pass: Frontend, Architecture, and Organization
  • pass: Rust Capability Layer
  • pass: Browser Smoke and Performance
  • note: Bunny gates only required job conclusions from ci-checks.json; advisory reports such as continue-on-error dependency checks are not included in this status.

@Promansis
Promansis merged commit 73c6d36 into Pasta-Devs:refactor Jun 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant