[GH-ISSUE #2028] 2. Storage and data access #991

Closed
opened 2026-10-21 05:24:53 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2028

Originally assigned to: @Xelvanis on GitHub.

Target 2: Storage And Data Access

target: 2
name: Storage and data access
scan_status: reported
parity_verdict: on_par
proof_level: focused_test
scan_refactor: origin/refactor 089e1d72 #2108 closure refresh; earlier batch anchors are preserved in the batch history below
legacy_ref: v1.6.1 file-native storage
report: https://github.com/Pasta-Devs/Marinara-Engine/issues/1904#issuecomment-4600505400
extra_report: https://github.com/Pasta-Devs/Marinara-Engine/issues/1904#issuecomment-4602178505
last_refreshed: 2026-06-04

Scope

Included:

  • Storage list/get/create/update/delete behavior.
  • Projection paths.
  • Remote vs embedded storage guard parity.
  • Lag/responsiveness repeat scan for projected reads and storage backend shape.
  • Data-loss and guard behavior: write validation, corrupt recovery, delete cascades, profile namespace, and connection secret masking.
  • Chat/message storage: #1923 swipe sidecar shape, special chat commands, metadata/extra merge semantics, and derived cleanup.
  • Performance hot paths: catalog selectors, chat timeline switching, generation context, background polling, and lorebook scans.
  • Cross-target storage handoff: profile backup/import lifecycle, import rollback atomicity, managed asset cache invalidation, and remote command exposure/admin guards.

Not checked:

  • Native Tauri app end-to-end timing and responsiveness under a real large profile.
  • Fresh batch 11 large-profile synthetic timing harness; prior batch 8/9 timing evidence is preserved as historical proof only.
  • No additional live large remote profile import or Docker/build proof was run after batch 11; #2108 closed on 2026-06-04, so no open Target 2 blocker remains.

Surface Inventory Additions

Surface ID Surface Bucket Source Legacy owner Refactor owner In scope Notes
02-STORAGE-STORAGE-projection-options Generic storage projection, search, pagination, and materialization options. STORAGE both packages/server/src/services/storage/*; message and resource list/get routes src/engine/capabilities/storage.ts; src-tauri/src/commands/storage/commands/entities.rs; src-tauri/src/commands/storage/shared.rs; src-tauri/src/http_dispatch.rs yes Target 1 names contract shape; Target 2 owns behavior and performance proof.
02-STORAGE-STORAGE-message-swipe-sidecar-shape Legacy message swipe sidecar storage and read-amplification parity. STORAGE legacy_only packages/server/src/db/schema/chats.ts; packages/server/src/services/storage/chats.storage.ts src-tauri/src/commands/storage/shared.rs; src-tauri/src/commands/storage/commands/entities.rs yes #1923 closed completed after merged PR #2021 restored sidecar storage shape.
02-STORAGE-STORAGE-registry-behavior-proof Registry defaults, delete cleanup, profile inclusion, and startup repair behavior. STORAGE both legacy storage services and schema defaults src-tauri/src/commands/storage/contracts.rs; src-tauri/src/commands/storage/shared.rs; src-tauri/src/commands/storage/profile.rs; src-tauri/src/state.rs yes Target 1 owns metadata shape; Target 2 owns behavior proof.
02-STORAGE-API-generic-crud-contract Generic storage CRUD contract, entity allowlist, stable null/deleted/not-found responses, duplicate support, and read/write normalization. API both packages/server/src/services/storage/*; resource routes in packages/server/src/routes/* src/engine/capabilities/storage.ts; src/shared/api/storage-api.ts; src/shared/api/storage-commands-api.ts; src-tauri/src/commands/storage/commands/entities.rs; src-tauri/src/http_dispatch.rs yes Projection rows do not prove base CRUD semantics or response/error shapes.
02-STORAGE-ERROR-write-validation-guards Storage write validation, protected/default record mutation guards, malformed typed JSON handling, invalid folder refs, and unsupported entity errors. ERROR both packages/shared/src/schemas/*; packages/server/src/routes/*; packages/server/src/services/storage/* src-tauri/src/commands/storage/contracts.rs; src-tauri/src/commands/storage/commands/entities.rs; src-tauri/src/commands/storage/shared.rs; src-tauri/src/http_dispatch.rs yes Public data-access error contract; needs positive and negative rows.
02-STORAGE-ERROR-collection-file-recovery Collection file recovery, .bak fallback, corrupt primary/backup handling, atomic writes, and flush self-heal behavior. ERROR both packages/server/src/db/file-backed-store.ts; packages/server/src/db/connection.ts; packages/server/src/app.ts src-tauri/crates/storage/src/lib.rs; src-tauri/src/state.rs yes Separate from warm-cache parity; owns what happens when user data files are damaged.
02-STORAGE-STORAGE-delete-cascade-outcomes Delete cascade and relationship cleanup for chats/messages, prompt/lorebook child rows, folders, active/default presets, tracker snapshots, and media-backed records. STORAGE both packages/server/src/services/storage/chats.storage.ts; packages/server/src/services/storage/lorebooks.storage.ts; packages/server/src/services/storage/prompts.storage.ts; folder storage services src-tauri/src/commands/storage/commands/entities.rs; src-tauri/src/commands/storage/chats.rs; src-tauri/src/commands/storage/contracts.rs; src-tauri/src/commands/storage/game_state_snapshots.rs; src-tauri/src/connection_refs.rs yes Expands registry cleanup from metadata presence to user-visible cascade results.
02-STORAGE-API-special-collection-commands Non-generic storage commands preserve invariants for duplicate, folder move/reorder, chat notes/memories, group delete, bulk message delete/count, tracker snapshots, persona activation, and character restore. API both packages/server/src/routes/chats.routes.ts; packages/server/src/routes/characters.routes.ts; packages/server/src/routes/connections.routes.ts; related storage services src-tauri/src/commands/storage/commands/entities.rs; src-tauri/src/commands/storage/commands/chats.rs; src-tauri/src/commands/storage/commands/game_state_snapshots.rs; focused wrappers in src/shared/api yes Generic CRUD parity does not cover special command invariants.
02-STORAGE-STORAGE-chat-metadata-extra-merge Chat metadata, summary maps, message extra, and swipe extra partial-merge semantics avoid lost updates and keep active-swipe fields coherent. STORAGE both packages/server/src/services/storage/chats.storage.ts; packages/server/src/routes/chats.routes.ts src/shared/api/storage-api.ts; src-tauri/src/commands/storage/chats.rs; src-tauri/src/commands/storage/shared.rs; src-tauri/src/http_dispatch.rs yes Important for summaries, unread markers, hidden flags, thinking, attachments, and generation metadata.
02-STORAGE-STORAGE-chat-derived-data-cleanup Chat/message edits, branches, deletes, and swipes keep derived memory chunks, tracker snapshots, gallery records/files, scene references, and prompt snapshots in sync. STORAGE both packages/server/src/services/storage/chats.storage.ts; packages/server/src/services/storage/game-state.storage.ts; packages/server/src/services/storage/gallery.storage.ts; packages/server/src/routes/chats.routes.ts src-tauri/src/commands/storage/chats.rs; src-tauri/src/commands/storage/game_state_snapshots.rs; src-tauri/src/commands/storage/shared.rs; src/engine/generation/tracker-snapshots.ts yes Current sidecar row only covers swipe layout/read amplification, not dependent data cleanup.
02-STORAGE-STORAGE-connection-secret-contract Connection secret data access masks API keys on public reads/exports, encrypts at rest, preserves blank updates, decrypts for runtime only, and resets default flags on duplicate. STORAGE both packages/server/src/services/storage/connections.storage.ts; packages/server/src/routes/connections.routes.ts; packages/server/src/routes/backup.routes.ts src-tauri/src/commands/storage/connection_secrets.rs; src-tauri/src/commands/storage/commands/entities.rs; src-tauri/src/http_dispatch.rs; src/shared/api/storage-api.ts yes Target 10 owns provider config meaning; Target 2 owns storage masking and persistence behavior.
02-STORAGE-STORAGE-profile-namespace-replace Profile collection namespace and import replacement semantics, including profile inclusion, absent collection preservation, present-empty clearing, and rejected import no-wipe behavior. STORAGE both packages/server/src/routes/backup.routes.ts; packages/server/src/db/file-backed-store.ts src-tauri/src/commands/storage/contracts.rs; src-tauri/src/commands/storage/profile.rs; src-tauri/src/commands/storage/profile/legacy.rs; src-tauri/src/commands/storage/profile/zip_import.rs yes Data-loss risk surface; Target 20 can own user import/export workflow.
02-STORAGE-COMPAT-profile-backup-lifecycle Profile export/import and managed backup lifecycle preserves storage collections plus asset manifests/files across native JSON, compatible ZIP, profile ZIP, upload import, list, download, and delete. COMPAT both packages/server/src/routes/backup.routes.ts; packages/shared/src/types/export.ts src-tauri/src/commands/storage/profile.rs; src-tauri/src/commands/storage/profile/assets.rs; src-tauri/src/commands/storage/profile/zip_import.rs; src-tauri/src/commands/storage/backup.rs; src/shared/api/profile-api.ts yes Target 2 owns storage payload/data-loss proof; Target 20 owns broader import/export UX parity.
02-STORAGE-COMPAT-import-rollback-atomicity Marinara/ST imports and bulk imports either create linked records/assets coherently or roll back created records/assets on failure. COMPAT both packages/server/src/routes/import.routes.ts; import services under packages/server/src/services/import/*; backup import paths src-tauri/src/commands/storage/imports/**; src-tauri/src/commands/storage/profile/assets.rs; src-tauri/src/commands/storage/imports/rollback.rs; src/shared/api/import-api.ts later Primary parity belongs Target 20, but storage mutation atomicity is a Target 2 evidence lead.
02-STORAGE-ERROR-admin-destructive-data-mutation Admin clear/expunge behavior scopes destructive deletes, requires confirmation, preserves protected records where applicable, and reports cleared collections/files. ERROR both packages/server/src/routes/admin.routes.ts; packages/server/src/db/schema/* src-tauri/src/commands/storage/admin.rs; src-tauri/src/http_dispatch.rs; src/shared/api/admin-api.ts yes Data-loss guard surface outside ordinary CRUD.
02-STORAGE-PERF-catalog-selector-hydration Catalog and selector reads hydrate character, persona, chat, preset, and resource summaries versus details without loading unnecessary large fields. PERF both legacy catalog/resource routes and storage services src/features/catalog/*/hooks; src/app; src/shared/api/storage-api.ts; src-tauri/src/commands/storage/commands/entities.rs yes Projection API parity needs consumer proof for high-cardinality list/search workflows.
02-STORAGE-PERF-chat-timeline-hot-paths Active chat switch, timeline paging, delayed counts, related chat reads, and cached fallback render avoid full-history/full-row storage loads. PERF both packages/server/src/services/storage/chats.storage.ts; packages/server/src/routes/chats.routes.ts src/features/catalog/chats/hooks/use-chats.ts; src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts; src/app/startup/chat-switch-effects.ts; src-tauri/src/commands/storage/commands/entities.rs; src-tauri/crates/storage/src/lib.rs yes Backend paged-message rows do not prove end-to-end chat switching/read shape.
02-STORAGE-PERF-generation-context-hot-paths Prompt Peek and live generation preflight storage reads cap messages and avoid eager large-field loads for chat, connection, characters, persona, preset bundles, lorebooks, regex, tools, and agents. PERF both legacy generate/prompt routes and storage services src/engine/generation/context.ts; src/engine/generation/prompt-preview.ts; src/engine/generation/prompt-assembly.ts; src/engine/generation/start-generation.ts; src/features/catalog/chats/hooks/use-chats.ts yes Prompt semantics belong later targets; Target 2 owns read shape, latency, and storage failure behavior.
02-STORAGE-PERF-background-and-lorebook-scans Background autonomous polling, schedule sync, lorebook activation, and knowledge/lorebook entry scans avoid broad all-row reads in periodic or per-turn paths. PERF both legacy conversation/lorebook/generate routes and storage services src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts; src/engine/modes/chat/schedules/schedule.service.ts; src/engine/generation/active-lorebook-scanner.ts; src/engine/generation/agent-runner.ts yes Active World Info hidden-scan row is narrower than all periodic/per-turn storage scans.
02-STORAGE-REMOTE-command-exposure-admin-guards Remote storage command exposure, embedded/remote allowlist parity, local-path denials, and admin-secret guards for privileged data mutation stay aligned. REMOTE refactor_only legacy HTTP routes have direct server exposure but no Tauri remote allowlist equivalent src/shared/api/remote-runtime.ts; src-tauri/src/http_dispatch.rs; src-tauri/src/http_server.rs; focused wrappers in src/shared/api yes Existing write-guard row does not cover exposure drift or privileged data-loss/exfiltration commands.
02-STORAGE-REMOTE-managed-asset-cache-coherency Remote storage/import/profile writes invalidate managed asset object URLs so avatars, backgrounds, gallery, lorebook images, sprites, and thumbnails do not stay stale. REMOTE refactor_only legacy browser/server asset routes refreshed through normal URLs src/shared/api/storage-api.ts; src/shared/api/import-api.ts; src/shared/api/profile-api.ts; src/shared/api/local-file-api.ts; src-tauri/src/http_server.rs later Target 4 owns media rendering; Target 2 may verify storage-write cache invalidation.
02-STORAGE-ASSET-managed-media-record-lifecycle Data-owned media file records support upload, serve, rename, delete, metadata, recovery, and folder/list behavior for avatars, gallery, backgrounds, sprites, and knowledge sources. ASSET both packages/server/src/routes/avatars.routes.ts; packages/server/src/routes/backgrounds.routes.ts; packages/server/src/routes/gallery.routes.ts; packages/server/src/routes/sprites.routes.ts; packages/server/src/routes/knowledge-sources.routes.ts src-tauri/src/commands/storage/avatars.rs; src-tauri/src/commands/storage/backgrounds.rs; src-tauri/src/commands/storage/media_uploads.rs; src-tauri/src/commands/storage/sprites.rs; src-tauri/src/commands/storage/knowledge.rs later Target 4/18 own asset/media parity; Target 2 should only scan record-level data access if needed.

Coverage Matrix

Status values are normalized to one tracker token per row. Proof flavor and limitations are recorded in the proof column instead of being encoded into the status.

Legacy Surface Status Refactor Evidence Follow-up
Remote storage write guard parity on_par Closed #1895/#1906; current remote command-surface proof passes. #1895/#1906 closed
Projected storage_get full-row read on_par Current storage crate and projected-message focused tests pass. #1919 closed
Paged chat message projection path on_par Current message projection and chat hook focused tests pass. #1923 closed
Warm cache and debounced flush parity on_par Current storage crate tests pass; prior batch 8/9 large-profile cache timing remains historical proof. #1933 closed
Active World Info hidden scan adjacency covered_static Static trace keeps hidden scan behavior outside the closed button path; broader lorebook scan proof is covered below. #1926 closed
Generic storage projection/search/page options on_par Current generic_storage and storage_list_projected focused tests pass. #2029 closed
Legacy message swipe sidecar storage shape on_par Current message_swipes, delete_swipe, and branch-chat focused tests pass. #2030 closed
Registry defaults, delete cleanup, profile, and startup behavior on_par Current storage crate profile/default/delete/startup coverage passes. #2034 closed
Generic storage CRUD contract on_par Current generic_storage focused tests pass. #2035 closed
Storage write validation and error guards on_par Current I/O mapping and storage-unavailable focused tests pass. #2036/#2052 closed
Collection file recovery and atomic flush on_par Current storage crate recovery/flush coverage passes. #2039 closed
Delete cascade and relationship cleanup outcomes on_par Current delete, branch-chat, projected-message, and chat-memory focused tests pass. #2049/#2072 closed
Special collection command invariants covered_static Current command/static trace covers admin clear and expunge guard shape; bulk delete remains storage-side proof only. #2058/#2082 closed
Chat metadata and message extra merge semantics on_par Current branch-chat, projected-message, and prompt snapshot focused tests pass. #2060/#2083 closed
Chat-derived data cleanup covered_static Current targeted delete/branch tests pass; bulk delete cleanup is covered by storage/static trace. #2067/#2083 closed
Connection secret storage on_par Static trace keeps provider keys and Discord OAuth tokens in privileged storage, with no legacy plain-text DB parity gap. none
Profile namespace and replacement semantics on_par Current profile import/export focused tests pass for desktop storage semantics. none
Profile export/import and managed backup lifecycle on_par Current 089e1d72 static/focused proof shows remote multipart profile upload, preview/progress coverage, JSON missing-asset warnings, and profile upload body-limit coverage; profile/ZIP/import rollback tests pass. #2108 closed on 2026-06-04, so no open Target 2 blocker remains. #2108 closed
Import rollback atomicity covered_static Current rollback focused tests pass; remaining user-visible import UX belongs to Target 20. Target 20 handoff
Managed asset cache coherency for storage writes covered_static Storage write/indexing behavior is covered statically; visual/render cache behavior remains Target 4/18 scope. Target 4/18 handoff
Admin clear and expunge guards on_par Current admin_clear_all and remote-admin guard focused tests pass. #2058/#2082 closed
Catalog and selector hydration performance covered_static Current selector and storage projected-cache tests pass; prior batch 8/9 synthetic timing remains historical proof only. none
Chat switch/timeline hot-path covered_static Current chat surface/projection proof passes; prior batch 8/9 timeline timing remains historical proof only. none
Prompt Peek and generation context read shape covered_static Current prompt snapshot focused tests pass; UI-level prompt preview remains covered outside this target. none
Background autonomous/lorebook scan load shape on_par Current active-lorebook scanner and chat-surface focused tests pass. none
Remote storage command exposure and admin guards on_par Current HTTP dispatch/admin guard focused tests pass, including backup and bulk-scan guard coverage. none

Batch Progress

Batch State Proof Notes
1. Foundation rescan done Focused Rust tests + static trace No new foundation blocker; #1923 later closed via merged PR #2021.
2. Data-loss and guard behavior done Focused Rust tests + static trace Core data-loss rows covered; later admin/remote follow-ups are closed.
3. Chat/message storage done Focused Rust tests + static trace #1923 and #2030 are closed and proof-checked.
4. Performance hot paths partial Scratch Rust timing harness + static trace Prior timing proof remains historical; no batch 10 native timing pass.
5. Cross-target handoff scan partial Focused Rust tests + static trace UX/media/provider portions remain Target 20, Target 4/18, and Target 3 handoffs.
6. Current refactor refresh done Focused Rust/TS tests + static trace + issue-state refresh #2029/#2030/#2034/#2035/#2039 were closed and proof-checked.
7. #2036 closure refresh done Merged PR state + focused local proof + static trace #2036 closed via PR #2052; batch 8 superseded this with current rescan proof.
8. Current rescan after #2052 done Focused Rust/TS tests + historical timing harness Storage hot-path proof passed; Target 2 still needed later remote/storage follow-up cleanup.
9. Current refactor rescan after remote/storage fixes blocked Focused Rust/TS proof + historical large-profile timing + static open-issue trace #2060/#2067/#2058/#2049 are closed and proof-checked; #2108 kept verdict at gaps_open.
10. Status-field refresh reported Current focused Rust/TS tests + static trace Coverage statuses normalized; #2108 storage-side evidence refreshed.
11. Current rescan at 089e1d72 blocked Focused Rust/TS tests + static trace #2108 remains open, but Target 2 storage/profile-import evidence is now current; remaining blocker is live large remote import/Docker proof or issue split/reclassify.
12. #2108 closure refresh done Live issue state + batch 11 focused proof #2108 closed on 2026-06-04; Target 2 now has no open blockers and moves to on_par.

Follow-Ups

Issue Status Reason
#1895 closed Remote storage write guard parity.
#1906 closed Remote storage write guard parity follow-up.
#1919 closed Projected storage_get full-row read parity.
#1923 closed Paged chat/message sidecar parity.
#1926 closed Hidden Active World Info adjacency/performance issue.
#1932 closed Paged chat message read projection.
#1933 closed Warm storage cache and debounced flush parity.
#2029 closed Generic storage projection/search/page options plus admin clear coverage.
#2030 closed Legacy message swipe sidecar storage shape.
#2034 closed Registry/default/profile/startup and generation/autonomous hot paths.
#2035 closed Generic storage CRUD and batched lorebook entry lookup.
#2036 closed Storage write validation and large selector performance follow-up.
#2039 closed Collection file recovery/atomic flush and remote exposure cleanup.
#2049 closed Delete cascade and relationship cleanup outcomes.
#2052 closed Storage write validation/selector performance follow-up.
#2058 closed Special collection command invariants and admin clear guards.
#2060 closed Chat metadata/extra merge and remote storage I/O status mapping.
#2067 closed Chat-derived data cleanup.
#2072 closed Delete cascade and cleanup follow-up.
#2082 closed Admin clear/expunge guard follow-up.
#2083 closed Chat cleanup and metadata merge follow-up.
#2108 closed Closed on 2026-06-04 after current 089e1d72 proof covered multipart profile upload, upload preview/progress, JSON missing-asset warnings, and profile upload body limit. No open Target 2 blocker remains.

Rescan Criteria

Target 2 is on_par as of origin/refactor 089e1d72 plus #2108 closure on 2026-06-04.

Rescan if a later refactor change touches storage CRUD/projection, profile import/export, remote profile upload routes, storage I/O error mapping, admin destructive commands, or managed asset import/write paths.

Residual manual gap:

  • Native app responsiveness under a real large profile remains desirable manual QA, but current target status uses focused proof.

Batch 1 Foundation Rescan - 2026-06-03

Base:

  • Refactor: merged PR #2021 / fix/message-swipe-sidecar-regression at f56efb20.
  • Legacy: origin/main / v1.6.1 file-native storage.

Outcome:

  • No new foundation storage blocker found.
  • At this batch's original run, target stayed gaps_open; #1923 later closed via merged PR #2021, and #2029/#2030 were later closed and proof-checked in batch 6.
  • #1933 and #1926 are only partially foundation-clean: static/storage proof is good, but timing/read-shape proof belongs to batch 4.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml generic_storage -> 4 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml storage_list_projected -> 4 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml storage_list_searches_projected_character_fields_without_returning_avatar_payloads -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml registry_answers_core_contract_questions -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_recovers_when_collection_and_backup_are_corrupt -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml agent_default_connection -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_storage -> 7 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -> 34 passed.

Batch 2 Data-Loss And Guard Behavior - 2026-06-03

Base:

  • Refactor: merged PR #2021 / fix/message-swipe-sidecar-regression at f56efb20.
  • Legacy: origin/main / v1.6.1 file-native storage.

Outcome:

  • Write validation, corrupt file recovery, delete cascades, profile namespace replacement, and connection secret masking are covered by focused positive/negative tests plus static trace.
  • At this batch's original run, admin destructive behavior was partial and tracked in #2029; batch 6 confirms the backend confirmation and remote Admin Access tests now pass.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml generic_storage_commands -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml generic_storage_mutations_reject_message_swipe_sidecars -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml normalize_typed_lorebook_entry -> 5 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml game_state_snapshot_rejects_malformed_persona_stats_string -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage corrupt_collection -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage writes_refresh_backup -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage replace_all_many -> 5 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage update_collections_atomically -> 5 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml deleting_ -> 6 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml delete_chat -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml delete_swipe -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_delete -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml connection_delete -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml admin_expunge -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml admin_access -> 0 matched.
  • cargo test --manifest-path src-tauri/Cargo.toml profile_import_ -> 13 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml legacy_present_but_malformed_table_is_rejected_without_wiping -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml legacy_partial_profile_does_not_wipe_absent_collections -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml connection_api_key -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml projected_connection_get_preserves_secret_mask_fields -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml duplicating_connection_resets_default_flags_and_keeps_secret_masked -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml profile_export_import_preserves_connection_folders -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml removes_professor_mari_character_seed -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml removes_legacy_professor_mari_records -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml admin_clear_all -> 0 matched.
  • cargo test --manifest-path src-tauri/Cargo.toml moving_connection_rejects_missing_folder -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml reordering_connection_folders_requires_each_folder_once -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml default_chat_preset -> 1 passed.

Batch 3 Chat/message Storage - 2026-06-03

Base:

  • Refactor: merged PR #2021 / fix/message-swipe-sidecar-regression at f56efb20.
  • Legacy: origin/main / v1.6.1 file-native storage.

Outcome:

  • #1923 sidecar storage shape is covered and merged via #2021: message rows strip nested swipes/swipeCount/swipePreviews, sidecars live in message-swipes, projected reads materialize summaries without returning full sidecar payloads, and native/legacy profile imports normalize or clear sidecars coherently.
  • Special swipe commands have positive/negative coverage for add/set/delete, active extra preservation, prompt snapshot storage, inactive append, and last/missing swipe rejection.
  • Metadata/extra merge is covered for active-swipe extra, prompt snapshots, attachment merging, branch summary pruning, and projected active extra reads.
  • At this batch's original run, derived cleanup was partial because Memory Recall ignored the legacy/canonical hiddenFromAI key; batch 6 confirms #2030 is closed and focused proof now passes.
  • Bulk message delete statically deletes sidecars and tracker snapshots, but bulk_delete_messages has no focused test match.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml message_swipes -> 26 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml prompt_snapshot -> 6 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml delete_swipe -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml branch_chat -> 4 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_delete_message_cleans_tracker_snapshots -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml projected_message -> 6 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml bulk_delete_messages -> 0 matched.
  • cargo test --manifest-path src-tauri/Cargo.toml chat_memor -> 0 matched.
  • cargo test --manifest-path src-tauri/Cargo.toml chat_message -> 0 matched.

Batch 4 Performance Hot Paths - 2026-06-04

Base:

  • Refactor: current worktree at f56efb20; origin/refactor fetched at 86c9b8c9 and shape-checked for the same hot-path callers.
  • Legacy: origin/main / v1.6.1 server storage reference.

Outcome:

  • Chat timeline paging is on the intended fast path: projected 20-row page over an 8,000-message synthetic chat measured 8.87ms cold / 8.18ms warm and avoided full transcript payloads.
  • At this batch's original run, generation and autonomous polling still had full-transcript hot paths tracked in #2034; batch 6 confirms the current branch now uses bounded/default projected reads by static trace.
  • At this batch's original run, lorebook activation scanned entries once per active book and was tracked in #2035; batch 6 confirms the current branch uses batched active entry reads with focused TS/Rust proof.
  • At this batch's original run, catalog selectors still had slow projected reads and some full-row selector hooks; character panel projected list measured 1798.17ms cold / 1681.39ms warm for 1,200 large cards and chat summaries measured 874.68ms / 872.68ms for 2,500 chats. Tracked in #2036, later closed by merged PR #2052; fresh timing still needed.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage perf_hot_paths_large_profile_timing -- --nocapture with temporary synthetic integration harness -> 1 passed.
  • Key timings from the harness:
    • timeline.page_projected_20: 8.87ms cold / 8.18ms warm; payload 130,221 bytes.
    • generation.full_messages: 3069.33ms cold / 2983.80ms warm; payload 101,686,891 bytes.
    • timeline.message_count: 129.76ms cold / 128.60ms warm.
    • catalog.characters.projected: 1798.17ms cold / 1681.39ms warm; payload 5,324,581 bytes.
    • catalog.chats.summary_projected: 874.68ms cold / 872.68ms warm; payload 878,891 bytes.
    • lorebook_entries.one_book_full_filter: 215.76ms cold / 20.22ms warm; payload 1,311,385 bytes.

Batch 5 Cross-target Handoff Scan - 2026-06-04

Base:

  • Refactor: current worktree at f56efb20; origin/refactor fetched at 86c9b8c9 and shape-checked for the same backup/remote exposure paths.
  • Legacy: origin/main / v1.6.1 server storage reference.

Outcome:

  • Profile JSON/ZIP import and managed backup storage paths have focused coverage for collection no-wipe behavior, asset staging/rollback, ZIP missing-asset warnings, and backup create/list/download/delete basics.
  • Import rollback atomicity has focused coverage for profile asset/collection rollback, Marinara nested record rollback, ST character/lorebook/preset rollback, chat import rollback, branch import target restore, and persona avatar managed-file rollback.
  • Managed asset cache coherency is covered at Target 2 wrapper level: profile/import/storage/media API wrappers invalidate remote managed asset object URLs after writes. Rendering/cache behavior remains Target 4/18.
  • At this batch's original run, remote exposure/admin guards had one storage blocker in #2039; batch 6 confirms backup_list now requires Admin Access and omits local backup paths, with Target 3 still owning remote-runtime-wide policy proof.
  • Profile/import/export UX lifecycle remains Target 20 handoff; provider/security policy outside storage data access remains Target 3.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml profile_import_ -- --nocapture -> 13 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml import_profile_zip -- --nocapture -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml rolls_back -- --nocapture -> 11 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml restores_target -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml preserves_group_id_when_branch_import_fails -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml persona_avatar_file_rolls_back -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_rejects_remote_raw_server_path_commands -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_server::tests::hostable_security_ -- --nocapture -> 10 passed.
  • Static legacy comparison: packages/server/src/routes/backup.routes.ts listed backups as { name, createdAt }; refactor src-tauri/src/commands/storage/backup.rs returns { name, createdAt, path }.

Batch 6 Current Refactor Refresh - 2026-06-04

Base:

  • Refactor: current worktree / origin/refactor at d20876dc.
  • Legacy: origin/main / v1.6.1 file-native storage reference.
  • At batch 6 time: #2029, #2030, #2034, #2035, and #2039 closed; #2036 open. Batch 7 supersedes #2036 state after PR #2052 merged.

Outcome:

  • At batch 6 time, target stayed gaps_open because #2036 still tracked large selector summary/cache performance. Batch 7 moves the current target verdict to fixed_needs_rescan after #2036 closed.
  • Admin destructive guards now require backend confirmation and remote Admin Access: command, dispatch, and hostable negative/positive tests pass.
  • Memory Recall now skips both hiddenFromAI and hiddenFromAi; focused Rust proof passes.
  • Generation and autonomous hot paths are statically fixed from the prior full-transcript shape: generation defaults to a bounded projected message load and autonomous activity initialization loads only recent projected fields. No fresh large-profile timing was run in this refresh.
  • Lorebook activation now batches active entry reads through listLorebookEntriesByLorebookIds and Rust list_where_in; focused TS and Rust proof pass.
  • Remote backup listing now requires Admin Access and omits local backup path from list responses; backup and remote command-surface proof pass.
  • Chat surface character lookup had already improved by batch 6; batch 7 confirms the remaining #2036 selector/cache blocker was closed by PR #2052. Fresh timing proof still has not been rerun.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml admin_clear_all -- --nocapture -> 8 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml chat_memor -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml lorebook_entries_list_by_lorebook_ids_reads_matching_books_once -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml hostable_security_requires_admin_access_for_remote_backup_list -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands -- --nocapture -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture -> 2 passed.
  • pnpm test -- src/engine/generation/active-lorebook-scanner.test.ts -> 1 file / 1 test passed.
  • pnpm test -- src/engine/generation/start-generation.test.ts -> no test file found.
  • pnpm test -- src/engine/modes/chat/autonomous/autonomous.service.test.ts -> no test file found.

Static trace:

  • Admin confirm: src-tauri/src/commands/storage/admin.rs, src-tauri/src/http_dispatch.rs, src-tauri/src/http_server.rs, src/shared/api/admin-api.ts.
  • Memory Recall hidden flags: src-tauri/src/commands/storage/chats.rs.
  • Bounded generation/autonomous reads: src/engine/generation/start-generation.ts, src/engine/generation/context.ts, src/engine/modes/chat/autonomous/autonomous.service.ts.
  • Batched lorebook activation: src/engine/capabilities/storage.ts, src/shared/api/storage-api.ts, src/engine/generation/active-lorebook-scanner.ts, src-tauri/src/commands/storage/commands/entities.rs.
  • Remote backup list guard/shape: src/shared/api/remote-runtime.ts, src-tauri/src/http_server.rs, src-tauri/src/commands/storage/backup.rs.
  • Batch 6 former #2036 selector gap trace: src/features/catalog/personas/hooks/use-personas.ts, src/features/catalog/connections/hooks/use-connections.ts, src/features/catalog/presets/hooks/use-presets.ts, src/features/catalog/characters/hooks/use-characters.ts, src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts. Batch 7 supersedes this with PR #2052 closure evidence.

Batch 7 #2036 Closure Refresh - 2026-06-04

Base:

  • Refactor: origin/refactor at 6057d69c, merged PR #2052 (Fix catalog summary selector reads).
  • Local focused proof checkout: fix/issue-2036-catalog-summary-reads at ca8c9afd.
  • Live follow-up state: #2036 closed on 2026-06-03 at 17:58Z; PR #2052 merged on 2026-06-03 at 17:58Z.

Outcome:

  • Target moves from gaps_open to fixed_needs_rescan: all known Target 2 follow-up blockers are closed, but there has not been a fresh Target 2 parity rescan or native/large-profile timing pass after #2052.
  • #2052 added projected-list cache reuse/invalidation in Rust storage and converted remaining selector hot paths to summary projections where this issue called them out.
  • Static trace on merged origin/refactor shows connection selectors use CONNECTION_SUMMARY_OPTIONS, preset list/default/default-mutation paths use PRESET_SUMMARY_OPTIONS, chat surface uses useCharacterSummariesByIds, and Rust storage owns projected-list cache keys/stamps plus invalidation.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage list_projected_ -- --nocapture -> 7 passed.
  • pnpm test -- src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx -> 1 file / 1 test passed.

Remaining rescan need:

  • Run fresh storage parity against current refactor and repeat large-profile cold/warm timing before upgrading to on_par.

Batch 8 Current Rescan After #2052 - 2026-06-04

Base:

  • Refactor: fresh branch from origin/refactor at 6057d69c.
  • Legacy: v1.6.1 file-native storage plus Target 3 legacy server error-handler trace for storage failure behavior.

Outcome:

  • #2036 stays fixed under current refactor proof: projected-list cache tests pass, selector hooks use summary projections, and large-profile warm catalog reads now hit the projected cache.
  • Storage CRUD/projection, message sidecar shape, prompt snapshots, branch/delete cleanup, Memory Recall hidden flags, admin clear-all, backup list Admin Access, profile/ZIP import, rollback, lorebook batching, active-lorebook TS, and chat-surface selector TS proof all pass on the current base.
  • Verdict stays gaps_open, not on_par, because hostable remote storage io_error still falls through to generic HTTP 500 instead of legacy-style actionable 503-class storage failure behavior. Tracked in #2060/#2067.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture -> 42 passed.
  • Focused Rust filters passed: generic_storage (4), storage_list_projected (4), message_swipes (26), prompt_snapshot (6), delete_swipe (2), branch_chat (4), projected_message (6), chat_memor (1), admin_clear_all (8), hostable_security_requires_admin_access_for_remote_backup_list (1), http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands (1), backup::tests (2), profile_import_ (13), import_profile_zip (2), rolls_back (11), persona_avatar_file_rolls_back (1), and lorebook_entries_list_by_lorebook_ids_reads_matching_books_once (1).
  • pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts -> 1 file / 1 test passed.
  • pnpm exec vitest run src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx -> 1 file / 1 test passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage perf_hot_paths_large_profile_timing -- --nocapture with a temporary local integration harness -> 1 passed; harness removed after proof.

Timing:

  • catalog.characters.panel_projected: 1829.58ms cold / 156.99ms warm; 1,200 rows; 32,513,491 bytes.
  • catalog.personas.summary_projected: 1430.33ms cold / 120.95ms warm; 1,200 rows; 34,897,289 bytes.
  • catalog.presets.summary_projected: 1449.57ms cold / 119.71ms warm; 1,500 rows; 1,803,389 bytes.
  • catalog.connections.summary_projected: 772.69ms cold / 65.94ms warm; 1,500 rows; 2,165,589 bytes.
  • catalog.chats.summary_projected: 1761.13ms cold / 153.89ms warm; 2,500 rows; 1,378,813 bytes.
  • timeline.page_projected_20: 12.34ms cold / 12.24ms warm; 20 rows; 773,961 bytes.
  • generation.recent_projected_80: 49.73ms cold / 49.45ms warm; 80 rows; 3,095,841 bytes.
  • lorebook.entries.where_in_projected: 1208.15ms cold / 1236.09ms warm; 2,500 rows; 23,356,391 bytes.

Static blocker trace:

  • src-tauri/crates/core/src/lib.rs maps std::io::Error into AppError code io_error.
  • src-tauri/src/http_server.rs maps known error codes to 400/401/403/404/422/502/501, but all other codes, including io_error, default to 500.
  • Legacy packages/server/src/middleware/error-handler.ts mapped readonly/locked storage backend failures to 503-style actionable responses.

Cross-target notes:

  • #2058 remains a Target 3/20 remote import-admin blocker, not a new Target 2 CRUD/projection blocker in this rescan.
  • #2049 remains a later memory/prompt/runtime semantics bug; batch 8 did not classify it as a Target 2 storage data-access blocker.

Batch 9 Current Refactor Rescan After Remote/Storage Fixes - 2026-06-04

Base:

  • Refactor: origin/refactor at 5248a86b.
  • Legacy: v1.6.1 file-native storage plus legacy server remote/profile behavior traces.

Outcome:

  • #2060 and #2067 are closed and proof-checked: storage-unavailable io_error cases map to HTTP 503 while uncategorized I/O remains 500.
  • #2058 is closed and proof-checked: remote import_st_bulk_scan now requires Admin Access.
  • #2049 is closed; static trace shows Memory Recall read-behind filtering in prompt assembly, while existing storage hidden-flag proof still passes.
  • Core Target 2 proof still passes on the current base: storage CRUD/projection, sidecar shape, profile/ZIP import for normal payloads, rollback, admin, backup, and catalog/timeline/lorebook hot-path controls.
  • Verdict stays gaps_open because #2108 reports large profile import is still broken for Remote Runtime: large ZIP upload exceeds/strains base64/body-limit transport, profile_import_file is desktop-only, and JSON-only import fails on missing asset base64 instead of importing data with warnings.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture -> 42 passed.
  • Focused Rust filters passed: generic_storage (4), storage_list_projected (4), message_swipes (26), prompt_snapshot (6), delete_swipe (2), branch_chat (4), projected_message (6), chat_memor (1), admin_clear_all (8), hostable_security_requires_admin_access_for_remote_backup_list (1), remote_st_bulk_scan_requires_admin_access (1), io_errors_map_to_storage_unavailable_http_status (3), locked_database_io_errors_map_to_storage_unavailable_http_status (1), message_only_storage_io_errors_map_to_storage_unavailable_http_status (1), uncategorized_io_errors_keep_internal_server_error_status (1), http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands (1), backup::tests (2), profile_import_ (13), import_profile_zip (2), rolls_back (11), persona_avatar_file_rolls_back (1), and lorebook_entries_list_by_lorebook_ids_reads_matching_books_once (1).
  • pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx src/shared/api/remote-runtime.test.ts src/engine/modes/chat/schedules/schedule.service.test.ts -> 4 files / 9 tests passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage perf_hot_paths_large_profile_timing -- --nocapture with a temporary local integration harness -> 1 passed; harness removed after proof.

Timing:

  • catalog.characters.panel_projected: 1337.62ms cold / 111.84ms warm; 1,200 rows; 32,471,491 bytes.
  • catalog.personas.summary_projected: 1037.13ms cold / 87.95ms warm; 1,200 rows; 32,278,890 bytes.
  • catalog.presets.summary_projected: 449.85ms cold / 35.14ms warm; 1,500 rows; 1,779,389 bytes.
  • catalog.connections.summary_projected: 488.38ms cold / 37.19ms warm; 1,500 rows; 2,129,589 bytes.
  • catalog.chats.summary_projected: 710.06ms cold / 56.93ms warm; 2,500 rows; 1,241,313 bytes.
  • timeline.page_projected_20: 8.68ms cold / 8.47ms warm; 20 rows; 354,791 bytes.
  • generation.recent_projected_80: 23.56ms cold / 24.54ms warm; 80 rows; 1,419,161 bytes.
  • lorebook.entries.where_in_projected: 1230.86ms cold / 1517.45ms warm; 2,500 rows; 23,356,391 bytes.

Static blocker trace:

  • src-tauri/src/http_server.rs caps JSON/API body size at MAX_API_BODY_BYTES = 256 * 1024 * 1024 and guards profile_import / profile_import_upload as privileged remote commands.
  • src/shared/api/profile-api.ts still base64-encodes file uploads before invoking profile_import_upload; profile_import_file is only available for embedded/Tauri path import and is listed as not remote in src-tauri/src/http_dispatch.rs.
  • src-tauri/src/commands/storage/profile/assets.rs still rejects profile JSON asset entries missing base64 data, matching the #2108 JSON-only failure mode.

Batch 10 Status-Field Refresh And Current Rescan - 2026-06-04

Base: Refactor origin/refactor / current checkout cc4c523b; legacy reference remains v1.6.1 file-native storage.

Outcome:

  • Header proof_level is normalized to focused_test instead of a compound proof string.
  • Coverage Matrix statuses are normalized to one tracker status per row; static, focused-test, timing, and cross-target details now live in the proof/follow-up columns.
  • Target remains gaps_open because #2108 is still open and this refresh did not run live large remote import, Docker/build proof, or native large-profile QA.
  • Current static trace suggests the Target 2 storage/profile-import part of #2108 may be stale: remote profile import now uses multipart /api/profile/import instead of remote base64 upload, and JSON profile assets with missing payloads warn/skip instead of hard-failing the whole import.

Current proof run:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture passed: 42 tests.
  • Focused Rust filters passed for generic_storage, storage_list_projected, message_swipes, prompt_snapshot, delete_swipe, branch_chat, projected_message, chat_memor, admin_clear_all, remote admin guard tests, storage I/O error mapping tests, backup tests, profile import/export tests, ZIP import tests, rollback tests, persona avatar rollback, and lorebook entry lookup.
  • pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx src/shared/api/remote-runtime.test.ts src/engine/modes/chat/schedules/schedule.service.test.ts passed: 4 files, 9 tests.

Current static trace:

  • src/shared/api/profile-api.ts routes remote file uploads through multipart HTTP for /api/profile/import; remote local-path import remains rejected as unsupported.
  • src-tauri/src/http_server.rs gives /api/profile/import a profile-sized body limit and streams multipart upload through the admin-gated profile import path.
  • src-tauri/src/commands/storage/profile/assets.rs records warnings for JSON profile asset entries without base64 payloads and continues importing the rest of the profile.

Still not proven in batch 10:

  • Native Tauri app end-to-end large-profile responsiveness.
  • Fresh synthetic timing harness for large profile storage hot paths; earlier timing evidence remains historical.
  • Additional live large remote profile import and Docker/build proof; #2108 later closed in batch 12.

Batch 11 Current Rescan At 089e1d72 - 2026-06-04

Base:

  • Refactor: fresh branch from origin/refactor at 089e1d72.
  • Legacy: v1.6.1 file-native storage plus existing Target 2/3 legacy traces for storage failure and profile import behavior.
  • Live follow-up state at batch 11 time: #2108 open; #2036 is merged/closed and included in current base. Batch 12 supersedes #2108 state.

Outcome:

  • #2036 remains closed under current proof.
  • Storage CRUD/projection, message sidecar, prompt snapshots, branch/delete cleanup, hidden memory filtering, admin/remote guards, backup, profile import/export, profile upload, ZIP import, rollback, lorebook lookup, and TS hot-path proof all pass on current base.
  • Remote profile import no longer uses the old base64 invoke path: src/shared/api/profile-api.ts sends remote files as multipart HTTP to /api/profile/import, and src-tauri/src/http_server.rs gives that route the profile upload limit and temp-file stream path.
  • JSON profile asset manifest entries with missing payload now warn/skip instead of rejecting the whole import; focused preview/native import tests cover this.
  • At batch 11 time, verdict stayed gaps_open because #2108 was still open and no live large remote import or Docker/build proof was run. Batch 12 supersedes this after #2108 closed.

Proof:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture -> 42 passed.
  • Focused Rust filters passed: generic_storage (4), storage_list_projected (4), message_swipes (26), prompt_snapshot (6), delete_swipe (2), branch_chat (4), projected_message (6), chat_memor (1), admin_clear_all (8), hostable_security_requires_admin_access_for_remote_backup_list (1), remote_st_bulk_scan_requires_admin_access (1), storage I/O error mapping filters (4), http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands (1), backup::tests (2), profile_import (30), import_profile_zip (3), rolls_back (11), persona_avatar_file_rolls_back (1), lorebook_entries_list_by_lorebook_ids_reads_matching_books_once (1), and profile_upload (4, including the profile upload body-limit test).
  • pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx src/shared/api/remote-runtime.test.ts src/engine/modes/chat/schedules/schedule.service.test.ts -> 4 files / 9 tests passed.

Static trace:

  • src/shared/api/profile-api.ts routes remote upload and preview through multipart HTTP for /api/profile/import and /api/profile/import/preview; remote local-path import still returns remote_local_path_unsupported.
  • src-tauri/src/http_server.rs exposes admin-gated /api/profile/import, /api/profile/import/preview, and /api/profile/import/events with the 1 GiB profile upload body limit.
  • src-tauri/src/commands/storage/profile/assets.rs records missing_asset warnings for JSON/ZIP manifest entries without payloads and continues importing the rest of the profile.
  • src-tauri/src/http_dispatch.rs still lists local file import commands as non-remote, so remote import coverage belongs to the multipart HTTP route.

Still not proven in batch 11:

  • Native Tauri app end-to-end large-profile responsiveness.
  • Fresh synthetic timing harness for large profile storage hot paths; earlier timing evidence remains historical.
  • Additional live large remote profile import and Docker/build proof; #2108 later closed in batch 12.

Batch 12 #2108 Closure Refresh - 2026-06-04

Base:

  • Refactor proof base remains origin/refactor at 089e1d72 from batch 11.
  • Live follow-up state: #2108 closed on 2026-06-04 at 10:59Z.

Outcome:

  • No open Target 2 blockers remain.
  • Target 2 moves from gaps_open to on_par using the current batch 11 focused proof plus live #2108 closure state.
  • Proof level remains focused_test; no native Tauri large-profile pass was added in this closure refresh.

Proof:

  • gh issue view 2108 --repo Pasta-Devs/Marinara-Engine --json state,closedAt -> CLOSED, 2026-06-04T10:59:15Z.
  • Batch 11 focused Rust/TS proof on 089e1d72 remains the current target proof.
Originally created by @Xelvanis on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2028 Originally assigned to: @Xelvanis on GitHub. # Target 2: Storage And Data Access ```yaml target: 2 name: Storage and data access scan_status: reported parity_verdict: on_par proof_level: focused_test scan_refactor: origin/refactor 089e1d72 #2108 closure refresh; earlier batch anchors are preserved in the batch history below legacy_ref: v1.6.1 file-native storage report: https://github.com/Pasta-Devs/Marinara-Engine/issues/1904#issuecomment-4600505400 extra_report: https://github.com/Pasta-Devs/Marinara-Engine/issues/1904#issuecomment-4602178505 last_refreshed: 2026-06-04 ``` ## Scope Included: - Storage list/get/create/update/delete behavior. - Projection paths. - Remote vs embedded storage guard parity. - Lag/responsiveness repeat scan for projected reads and storage backend shape. - Data-loss and guard behavior: write validation, corrupt recovery, delete cascades, profile namespace, and connection secret masking. - Chat/message storage: #1923 swipe sidecar shape, special chat commands, metadata/extra merge semantics, and derived cleanup. - Performance hot paths: catalog selectors, chat timeline switching, generation context, background polling, and lorebook scans. - Cross-target storage handoff: profile backup/import lifecycle, import rollback atomicity, managed asset cache invalidation, and remote command exposure/admin guards. Not checked: - Native Tauri app end-to-end timing and responsiveness under a real large profile. - Fresh batch 11 large-profile synthetic timing harness; prior batch 8/9 timing evidence is preserved as historical proof only. - No additional live large remote profile import or Docker/build proof was run after batch 11; #2108 closed on 2026-06-04, so no open Target 2 blocker remains. ## Surface Inventory Additions | Surface ID | Surface | Bucket | Source | Legacy owner | Refactor owner | In scope | Notes | | --- | --- | --- | --- | --- | --- | --- | --- | | 02-STORAGE-STORAGE-projection-options | Generic storage projection, search, pagination, and materialization options. | STORAGE | both | `packages/server/src/services/storage/*`; message and resource list/get routes | `src/engine/capabilities/storage.ts`; `src-tauri/src/commands/storage/commands/entities.rs`; `src-tauri/src/commands/storage/shared.rs`; `src-tauri/src/http_dispatch.rs` | yes | Target 1 names contract shape; Target 2 owns behavior and performance proof. | | 02-STORAGE-STORAGE-message-swipe-sidecar-shape | Legacy message swipe sidecar storage and read-amplification parity. | STORAGE | legacy_only | `packages/server/src/db/schema/chats.ts`; `packages/server/src/services/storage/chats.storage.ts` | `src-tauri/src/commands/storage/shared.rs`; `src-tauri/src/commands/storage/commands/entities.rs` | yes | #1923 closed completed after merged PR #2021 restored sidecar storage shape. | | 02-STORAGE-STORAGE-registry-behavior-proof | Registry defaults, delete cleanup, profile inclusion, and startup repair behavior. | STORAGE | both | legacy storage services and schema defaults | `src-tauri/src/commands/storage/contracts.rs`; `src-tauri/src/commands/storage/shared.rs`; `src-tauri/src/commands/storage/profile.rs`; `src-tauri/src/state.rs` | yes | Target 1 owns metadata shape; Target 2 owns behavior proof. | | 02-STORAGE-API-generic-crud-contract | Generic storage CRUD contract, entity allowlist, stable null/deleted/not-found responses, duplicate support, and read/write normalization. | API | both | `packages/server/src/services/storage/*`; resource routes in `packages/server/src/routes/*` | `src/engine/capabilities/storage.ts`; `src/shared/api/storage-api.ts`; `src/shared/api/storage-commands-api.ts`; `src-tauri/src/commands/storage/commands/entities.rs`; `src-tauri/src/http_dispatch.rs` | yes | Projection rows do not prove base CRUD semantics or response/error shapes. | | 02-STORAGE-ERROR-write-validation-guards | Storage write validation, protected/default record mutation guards, malformed typed JSON handling, invalid folder refs, and unsupported entity errors. | ERROR | both | `packages/shared/src/schemas/*`; `packages/server/src/routes/*`; `packages/server/src/services/storage/*` | `src-tauri/src/commands/storage/contracts.rs`; `src-tauri/src/commands/storage/commands/entities.rs`; `src-tauri/src/commands/storage/shared.rs`; `src-tauri/src/http_dispatch.rs` | yes | Public data-access error contract; needs positive and negative rows. | | 02-STORAGE-ERROR-collection-file-recovery | Collection file recovery, `.bak` fallback, corrupt primary/backup handling, atomic writes, and flush self-heal behavior. | ERROR | both | `packages/server/src/db/file-backed-store.ts`; `packages/server/src/db/connection.ts`; `packages/server/src/app.ts` | `src-tauri/crates/storage/src/lib.rs`; `src-tauri/src/state.rs` | yes | Separate from warm-cache parity; owns what happens when user data files are damaged. | | 02-STORAGE-STORAGE-delete-cascade-outcomes | Delete cascade and relationship cleanup for chats/messages, prompt/lorebook child rows, folders, active/default presets, tracker snapshots, and media-backed records. | STORAGE | both | `packages/server/src/services/storage/chats.storage.ts`; `packages/server/src/services/storage/lorebooks.storage.ts`; `packages/server/src/services/storage/prompts.storage.ts`; folder storage services | `src-tauri/src/commands/storage/commands/entities.rs`; `src-tauri/src/commands/storage/chats.rs`; `src-tauri/src/commands/storage/contracts.rs`; `src-tauri/src/commands/storage/game_state_snapshots.rs`; `src-tauri/src/connection_refs.rs` | yes | Expands registry cleanup from metadata presence to user-visible cascade results. | | 02-STORAGE-API-special-collection-commands | Non-generic storage commands preserve invariants for duplicate, folder move/reorder, chat notes/memories, group delete, bulk message delete/count, tracker snapshots, persona activation, and character restore. | API | both | `packages/server/src/routes/chats.routes.ts`; `packages/server/src/routes/characters.routes.ts`; `packages/server/src/routes/connections.routes.ts`; related storage services | `src-tauri/src/commands/storage/commands/entities.rs`; `src-tauri/src/commands/storage/commands/chats.rs`; `src-tauri/src/commands/storage/commands/game_state_snapshots.rs`; focused wrappers in `src/shared/api` | yes | Generic CRUD parity does not cover special command invariants. | | 02-STORAGE-STORAGE-chat-metadata-extra-merge | Chat metadata, summary maps, message extra, and swipe extra partial-merge semantics avoid lost updates and keep active-swipe fields coherent. | STORAGE | both | `packages/server/src/services/storage/chats.storage.ts`; `packages/server/src/routes/chats.routes.ts` | `src/shared/api/storage-api.ts`; `src-tauri/src/commands/storage/chats.rs`; `src-tauri/src/commands/storage/shared.rs`; `src-tauri/src/http_dispatch.rs` | yes | Important for summaries, unread markers, hidden flags, thinking, attachments, and generation metadata. | | 02-STORAGE-STORAGE-chat-derived-data-cleanup | Chat/message edits, branches, deletes, and swipes keep derived memory chunks, tracker snapshots, gallery records/files, scene references, and prompt snapshots in sync. | STORAGE | both | `packages/server/src/services/storage/chats.storage.ts`; `packages/server/src/services/storage/game-state.storage.ts`; `packages/server/src/services/storage/gallery.storage.ts`; `packages/server/src/routes/chats.routes.ts` | `src-tauri/src/commands/storage/chats.rs`; `src-tauri/src/commands/storage/game_state_snapshots.rs`; `src-tauri/src/commands/storage/shared.rs`; `src/engine/generation/tracker-snapshots.ts` | yes | Current sidecar row only covers swipe layout/read amplification, not dependent data cleanup. | | 02-STORAGE-STORAGE-connection-secret-contract | Connection secret data access masks API keys on public reads/exports, encrypts at rest, preserves blank updates, decrypts for runtime only, and resets default flags on duplicate. | STORAGE | both | `packages/server/src/services/storage/connections.storage.ts`; `packages/server/src/routes/connections.routes.ts`; `packages/server/src/routes/backup.routes.ts` | `src-tauri/src/commands/storage/connection_secrets.rs`; `src-tauri/src/commands/storage/commands/entities.rs`; `src-tauri/src/http_dispatch.rs`; `src/shared/api/storage-api.ts` | yes | Target 10 owns provider config meaning; Target 2 owns storage masking and persistence behavior. | | 02-STORAGE-STORAGE-profile-namespace-replace | Profile collection namespace and import replacement semantics, including profile inclusion, absent collection preservation, present-empty clearing, and rejected import no-wipe behavior. | STORAGE | both | `packages/server/src/routes/backup.routes.ts`; `packages/server/src/db/file-backed-store.ts` | `src-tauri/src/commands/storage/contracts.rs`; `src-tauri/src/commands/storage/profile.rs`; `src-tauri/src/commands/storage/profile/legacy.rs`; `src-tauri/src/commands/storage/profile/zip_import.rs` | yes | Data-loss risk surface; Target 20 can own user import/export workflow. | | 02-STORAGE-COMPAT-profile-backup-lifecycle | Profile export/import and managed backup lifecycle preserves storage collections plus asset manifests/files across native JSON, compatible ZIP, profile ZIP, upload import, list, download, and delete. | COMPAT | both | `packages/server/src/routes/backup.routes.ts`; `packages/shared/src/types/export.ts` | `src-tauri/src/commands/storage/profile.rs`; `src-tauri/src/commands/storage/profile/assets.rs`; `src-tauri/src/commands/storage/profile/zip_import.rs`; `src-tauri/src/commands/storage/backup.rs`; `src/shared/api/profile-api.ts` | yes | Target 2 owns storage payload/data-loss proof; Target 20 owns broader import/export UX parity. | | 02-STORAGE-COMPAT-import-rollback-atomicity | Marinara/ST imports and bulk imports either create linked records/assets coherently or roll back created records/assets on failure. | COMPAT | both | `packages/server/src/routes/import.routes.ts`; import services under `packages/server/src/services/import/*`; backup import paths | `src-tauri/src/commands/storage/imports/**`; `src-tauri/src/commands/storage/profile/assets.rs`; `src-tauri/src/commands/storage/imports/rollback.rs`; `src/shared/api/import-api.ts` | later | Primary parity belongs Target 20, but storage mutation atomicity is a Target 2 evidence lead. | | 02-STORAGE-ERROR-admin-destructive-data-mutation | Admin clear/expunge behavior scopes destructive deletes, requires confirmation, preserves protected records where applicable, and reports cleared collections/files. | ERROR | both | `packages/server/src/routes/admin.routes.ts`; `packages/server/src/db/schema/*` | `src-tauri/src/commands/storage/admin.rs`; `src-tauri/src/http_dispatch.rs`; `src/shared/api/admin-api.ts` | yes | Data-loss guard surface outside ordinary CRUD. | | 02-STORAGE-PERF-catalog-selector-hydration | Catalog and selector reads hydrate character, persona, chat, preset, and resource summaries versus details without loading unnecessary large fields. | PERF | both | legacy catalog/resource routes and storage services | `src/features/catalog/*/hooks`; `src/app`; `src/shared/api/storage-api.ts`; `src-tauri/src/commands/storage/commands/entities.rs` | yes | Projection API parity needs consumer proof for high-cardinality list/search workflows. | | 02-STORAGE-PERF-chat-timeline-hot-paths | Active chat switch, timeline paging, delayed counts, related chat reads, and cached fallback render avoid full-history/full-row storage loads. | PERF | both | `packages/server/src/services/storage/chats.storage.ts`; `packages/server/src/routes/chats.routes.ts` | `src/features/catalog/chats/hooks/use-chats.ts`; `src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts`; `src/app/startup/chat-switch-effects.ts`; `src-tauri/src/commands/storage/commands/entities.rs`; `src-tauri/crates/storage/src/lib.rs` | yes | Backend paged-message rows do not prove end-to-end chat switching/read shape. | | 02-STORAGE-PERF-generation-context-hot-paths | Prompt Peek and live generation preflight storage reads cap messages and avoid eager large-field loads for chat, connection, characters, persona, preset bundles, lorebooks, regex, tools, and agents. | PERF | both | legacy generate/prompt routes and storage services | `src/engine/generation/context.ts`; `src/engine/generation/prompt-preview.ts`; `src/engine/generation/prompt-assembly.ts`; `src/engine/generation/start-generation.ts`; `src/features/catalog/chats/hooks/use-chats.ts` | yes | Prompt semantics belong later targets; Target 2 owns read shape, latency, and storage failure behavior. | | 02-STORAGE-PERF-background-and-lorebook-scans | Background autonomous polling, schedule sync, lorebook activation, and knowledge/lorebook entry scans avoid broad all-row reads in periodic or per-turn paths. | PERF | both | legacy conversation/lorebook/generate routes and storage services | `src/features/modes/conversation/hooks/autonomous/use-background-autonomous.ts`; `src/engine/modes/chat/schedules/schedule.service.ts`; `src/engine/generation/active-lorebook-scanner.ts`; `src/engine/generation/agent-runner.ts` | yes | Active World Info hidden-scan row is narrower than all periodic/per-turn storage scans. | | 02-STORAGE-REMOTE-command-exposure-admin-guards | Remote storage command exposure, embedded/remote allowlist parity, local-path denials, and admin-secret guards for privileged data mutation stay aligned. | REMOTE | refactor_only | legacy HTTP routes have direct server exposure but no Tauri remote allowlist equivalent | `src/shared/api/remote-runtime.ts`; `src-tauri/src/http_dispatch.rs`; `src-tauri/src/http_server.rs`; focused wrappers in `src/shared/api` | yes | Existing write-guard row does not cover exposure drift or privileged data-loss/exfiltration commands. | | 02-STORAGE-REMOTE-managed-asset-cache-coherency | Remote storage/import/profile writes invalidate managed asset object URLs so avatars, backgrounds, gallery, lorebook images, sprites, and thumbnails do not stay stale. | REMOTE | refactor_only | legacy browser/server asset routes refreshed through normal URLs | `src/shared/api/storage-api.ts`; `src/shared/api/import-api.ts`; `src/shared/api/profile-api.ts`; `src/shared/api/local-file-api.ts`; `src-tauri/src/http_server.rs` | later | Target 4 owns media rendering; Target 2 may verify storage-write cache invalidation. | | 02-STORAGE-ASSET-managed-media-record-lifecycle | Data-owned media file records support upload, serve, rename, delete, metadata, recovery, and folder/list behavior for avatars, gallery, backgrounds, sprites, and knowledge sources. | ASSET | both | `packages/server/src/routes/avatars.routes.ts`; `packages/server/src/routes/backgrounds.routes.ts`; `packages/server/src/routes/gallery.routes.ts`; `packages/server/src/routes/sprites.routes.ts`; `packages/server/src/routes/knowledge-sources.routes.ts` | `src-tauri/src/commands/storage/avatars.rs`; `src-tauri/src/commands/storage/backgrounds.rs`; `src-tauri/src/commands/storage/media_uploads.rs`; `src-tauri/src/commands/storage/sprites.rs`; `src-tauri/src/commands/storage/knowledge.rs` | later | Target 4/18 own asset/media parity; Target 2 should only scan record-level data access if needed. | ## Coverage Matrix Status values are normalized to one tracker token per row. Proof flavor and limitations are recorded in the proof column instead of being encoded into the status. | Legacy Surface | Status | Refactor Evidence | Follow-up | | --- | --- | --- | --- | | Remote storage write guard parity | on_par | Closed #1895/#1906; current remote command-surface proof passes. | #1895/#1906 closed | | Projected `storage_get` full-row read | on_par | Current storage crate and projected-message focused tests pass. | #1919 closed | | Paged chat message projection path | on_par | Current message projection and chat hook focused tests pass. | #1923 closed | | Warm cache and debounced flush parity | on_par | Current storage crate tests pass; prior batch 8/9 large-profile cache timing remains historical proof. | #1933 closed | | Active World Info hidden scan adjacency | covered_static | Static trace keeps hidden scan behavior outside the closed button path; broader lorebook scan proof is covered below. | #1926 closed | | Generic storage projection/search/page options | on_par | Current `generic_storage` and `storage_list_projected` focused tests pass. | #2029 closed | | Legacy message swipe sidecar storage shape | on_par | Current `message_swipes`, `delete_swipe`, and branch-chat focused tests pass. | #2030 closed | | Registry defaults, delete cleanup, profile, and startup behavior | on_par | Current storage crate profile/default/delete/startup coverage passes. | #2034 closed | | Generic storage CRUD contract | on_par | Current `generic_storage` focused tests pass. | #2035 closed | | Storage write validation and error guards | on_par | Current I/O mapping and storage-unavailable focused tests pass. | #2036/#2052 closed | | Collection file recovery and atomic flush | on_par | Current storage crate recovery/flush coverage passes. | #2039 closed | | Delete cascade and relationship cleanup outcomes | on_par | Current delete, branch-chat, projected-message, and chat-memory focused tests pass. | #2049/#2072 closed | | Special collection command invariants | covered_static | Current command/static trace covers admin clear and expunge guard shape; bulk delete remains storage-side proof only. | #2058/#2082 closed | | Chat metadata and message extra merge semantics | on_par | Current branch-chat, projected-message, and prompt snapshot focused tests pass. | #2060/#2083 closed | | Chat-derived data cleanup | covered_static | Current targeted delete/branch tests pass; bulk delete cleanup is covered by storage/static trace. | #2067/#2083 closed | | Connection secret storage | on_par | Static trace keeps provider keys and Discord OAuth tokens in privileged storage, with no legacy plain-text DB parity gap. | none | | Profile namespace and replacement semantics | on_par | Current profile import/export focused tests pass for desktop storage semantics. | none | | Profile export/import and managed backup lifecycle | on_par | Current `089e1d72` static/focused proof shows remote multipart profile upload, preview/progress coverage, JSON missing-asset warnings, and profile upload body-limit coverage; profile/ZIP/import rollback tests pass. #2108 closed on 2026-06-04, so no open Target 2 blocker remains. | #2108 closed | | Import rollback atomicity | covered_static | Current rollback focused tests pass; remaining user-visible import UX belongs to Target 20. | Target 20 handoff | | Managed asset cache coherency for storage writes | covered_static | Storage write/indexing behavior is covered statically; visual/render cache behavior remains Target 4/18 scope. | Target 4/18 handoff | | Admin clear and expunge guards | on_par | Current `admin_clear_all` and remote-admin guard focused tests pass. | #2058/#2082 closed | | Catalog and selector hydration performance | covered_static | Current selector and storage projected-cache tests pass; prior batch 8/9 synthetic timing remains historical proof only. | none | | Chat switch/timeline hot-path | covered_static | Current chat surface/projection proof passes; prior batch 8/9 timeline timing remains historical proof only. | none | | Prompt Peek and generation context read shape | covered_static | Current prompt snapshot focused tests pass; UI-level prompt preview remains covered outside this target. | none | | Background autonomous/lorebook scan load shape | on_par | Current active-lorebook scanner and chat-surface focused tests pass. | none | | Remote storage command exposure and admin guards | on_par | Current HTTP dispatch/admin guard focused tests pass, including backup and bulk-scan guard coverage. | none | ## Batch Progress | Batch | State | Proof | Notes | | --- | --- | --- | --- | | 1. Foundation rescan | done | Focused Rust tests + static trace | No new foundation blocker; #1923 later closed via merged PR #2021. | | 2. Data-loss and guard behavior | done | Focused Rust tests + static trace | Core data-loss rows covered; later admin/remote follow-ups are closed. | | 3. Chat/message storage | done | Focused Rust tests + static trace | #1923 and #2030 are closed and proof-checked. | | 4. Performance hot paths | partial | Scratch Rust timing harness + static trace | Prior timing proof remains historical; no batch 10 native timing pass. | | 5. Cross-target handoff scan | partial | Focused Rust tests + static trace | UX/media/provider portions remain Target 20, Target 4/18, and Target 3 handoffs. | | 6. Current refactor refresh | done | Focused Rust/TS tests + static trace + issue-state refresh | #2029/#2030/#2034/#2035/#2039 were closed and proof-checked. | | 7. #2036 closure refresh | done | Merged PR state + focused local proof + static trace | #2036 closed via PR #2052; batch 8 superseded this with current rescan proof. | | 8. Current rescan after #2052 | done | Focused Rust/TS tests + historical timing harness | Storage hot-path proof passed; Target 2 still needed later remote/storage follow-up cleanup. | | 9. Current refactor rescan after remote/storage fixes | blocked | Focused Rust/TS proof + historical large-profile timing + static open-issue trace | #2060/#2067/#2058/#2049 are closed and proof-checked; #2108 kept verdict at `gaps_open`. | | 10. Status-field refresh | reported | Current focused Rust/TS tests + static trace | Coverage statuses normalized; #2108 storage-side evidence refreshed. | | 11. Current rescan at 089e1d72 | blocked | Focused Rust/TS tests + static trace | #2108 remains open, but Target 2 storage/profile-import evidence is now current; remaining blocker is live large remote import/Docker proof or issue split/reclassify. | | 12. #2108 closure refresh | done | Live issue state + batch 11 focused proof | #2108 closed on 2026-06-04; Target 2 now has no open blockers and moves to `on_par`. | ## Follow-Ups | Issue | Status | Reason | | --- | --- | --- | | #1895 | closed | Remote storage write guard parity. | | #1906 | closed | Remote storage write guard parity follow-up. | | #1919 | closed | Projected `storage_get` full-row read parity. | | #1923 | closed | Paged chat/message sidecar parity. | | #1926 | closed | Hidden Active World Info adjacency/performance issue. | | #1932 | closed | Paged chat message read projection. | | #1933 | closed | Warm storage cache and debounced flush parity. | | #2029 | closed | Generic storage projection/search/page options plus admin clear coverage. | | #2030 | closed | Legacy message swipe sidecar storage shape. | | #2034 | closed | Registry/default/profile/startup and generation/autonomous hot paths. | | #2035 | closed | Generic storage CRUD and batched lorebook entry lookup. | | #2036 | closed | Storage write validation and large selector performance follow-up. | | #2039 | closed | Collection file recovery/atomic flush and remote exposure cleanup. | | #2049 | closed | Delete cascade and relationship cleanup outcomes. | | #2052 | closed | Storage write validation/selector performance follow-up. | | #2058 | closed | Special collection command invariants and admin clear guards. | | #2060 | closed | Chat metadata/extra merge and remote storage I/O status mapping. | | #2067 | closed | Chat-derived data cleanup. | | #2072 | closed | Delete cascade and cleanup follow-up. | | #2082 | closed | Admin clear/expunge guard follow-up. | | #2083 | closed | Chat cleanup and metadata merge follow-up. | | #2108 | closed | Closed on 2026-06-04 after current `089e1d72` proof covered multipart profile upload, upload preview/progress, JSON missing-asset warnings, and profile upload body limit. No open Target 2 blocker remains. | ## Rescan Criteria Target 2 is `on_par` as of `origin/refactor 089e1d72` plus #2108 closure on 2026-06-04. Rescan if a later `refactor` change touches storage CRUD/projection, profile import/export, remote profile upload routes, storage I/O error mapping, admin destructive commands, or managed asset import/write paths. Residual manual gap: - Native app responsiveness under a real large profile remains desirable manual QA, but current target status uses focused proof. ## Batch 1 Foundation Rescan - 2026-06-03 Base: - Refactor: merged PR #2021 / `fix/message-swipe-sidecar-regression` at `f56efb20`. - Legacy: `origin/main` / v1.6.1 file-native storage. Outcome: - No new foundation storage blocker found. - At this batch's original run, target stayed `gaps_open`; #1923 later closed via merged PR #2021, and #2029/#2030 were later closed and proof-checked in batch 6. - #1933 and #1926 are only partially foundation-clean: static/storage proof is good, but timing/read-shape proof belongs to batch 4. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml generic_storage` -> 4 passed. - `cargo test --manifest-path src-tauri/Cargo.toml storage_list_projected` -> 4 passed. - `cargo test --manifest-path src-tauri/Cargo.toml storage_list_searches_projected_character_fields_without_returning_avatar_payloads` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml registry_answers_core_contract_questions` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_recovers_when_collection_and_backup_are_corrupt` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml agent_default_connection` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_storage` -> 7 passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage` -> 34 passed. ## Batch 2 Data-Loss And Guard Behavior - 2026-06-03 Base: - Refactor: merged PR #2021 / `fix/message-swipe-sidecar-regression` at `f56efb20`. - Legacy: `origin/main` / v1.6.1 file-native storage. Outcome: - Write validation, corrupt file recovery, delete cascades, profile namespace replacement, and connection secret masking are covered by focused positive/negative tests plus static trace. - At this batch's original run, admin destructive behavior was partial and tracked in #2029; batch 6 confirms the backend confirmation and remote Admin Access tests now pass. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml generic_storage_commands` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml generic_storage_mutations_reject_message_swipe_sidecars` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml normalize_typed_lorebook_entry` -> 5 passed. - `cargo test --manifest-path src-tauri/Cargo.toml game_state_snapshot_rejects_malformed_persona_stats_string` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage corrupt_collection` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage writes_refresh_backup` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage replace_all_many` -> 5 passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage update_collections_atomically` -> 5 passed. - `cargo test --manifest-path src-tauri/Cargo.toml deleting_` -> 6 passed. - `cargo test --manifest-path src-tauri/Cargo.toml delete_chat` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml delete_swipe` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_delete` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml connection_delete` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml admin_expunge` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml admin_access` -> 0 matched. - `cargo test --manifest-path src-tauri/Cargo.toml profile_import_` -> 13 passed. - `cargo test --manifest-path src-tauri/Cargo.toml legacy_present_but_malformed_table_is_rejected_without_wiping` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml legacy_partial_profile_does_not_wipe_absent_collections` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml connection_api_key` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml projected_connection_get_preserves_secret_mask_fields` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml duplicating_connection_resets_default_flags_and_keeps_secret_masked` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml profile_export_import_preserves_connection_folders` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml removes_professor_mari_character_seed` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml removes_legacy_professor_mari_records` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml admin_clear_all` -> 0 matched. - `cargo test --manifest-path src-tauri/Cargo.toml moving_connection_rejects_missing_folder` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml reordering_connection_folders_requires_each_folder_once` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml default_chat_preset` -> 1 passed. ## Batch 3 Chat/message Storage - 2026-06-03 Base: - Refactor: merged PR #2021 / `fix/message-swipe-sidecar-regression` at `f56efb20`. - Legacy: `origin/main` / v1.6.1 file-native storage. Outcome: - #1923 sidecar storage shape is covered and merged via #2021: message rows strip nested `swipes`/`swipeCount`/`swipePreviews`, sidecars live in `message-swipes`, projected reads materialize summaries without returning full sidecar payloads, and native/legacy profile imports normalize or clear sidecars coherently. - Special swipe commands have positive/negative coverage for add/set/delete, active extra preservation, prompt snapshot storage, inactive append, and last/missing swipe rejection. - Metadata/extra merge is covered for active-swipe extra, prompt snapshots, attachment merging, branch summary pruning, and projected active extra reads. - At this batch's original run, derived cleanup was partial because Memory Recall ignored the legacy/canonical `hiddenFromAI` key; batch 6 confirms #2030 is closed and focused proof now passes. - Bulk message delete statically deletes sidecars and tracker snapshots, but `bulk_delete_messages` has no focused test match. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml message_swipes` -> 26 passed. - `cargo test --manifest-path src-tauri/Cargo.toml prompt_snapshot` -> 6 passed. - `cargo test --manifest-path src-tauri/Cargo.toml delete_swipe` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml branch_chat` -> 4 passed. - `cargo test --manifest-path src-tauri/Cargo.toml dispatch_storage_delete_message_cleans_tracker_snapshots` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml projected_message` -> 6 passed. - `cargo test --manifest-path src-tauri/Cargo.toml bulk_delete_messages` -> 0 matched. - `cargo test --manifest-path src-tauri/Cargo.toml chat_memor` -> 0 matched. - `cargo test --manifest-path src-tauri/Cargo.toml chat_message` -> 0 matched. ## Batch 4 Performance Hot Paths - 2026-06-04 Base: - Refactor: current worktree at `f56efb20`; `origin/refactor` fetched at `86c9b8c9` and shape-checked for the same hot-path callers. - Legacy: `origin/main` / v1.6.1 server storage reference. Outcome: - Chat timeline paging is on the intended fast path: projected 20-row page over an 8,000-message synthetic chat measured `8.87ms` cold / `8.18ms` warm and avoided full transcript payloads. - At this batch's original run, generation and autonomous polling still had full-transcript hot paths tracked in #2034; batch 6 confirms the current branch now uses bounded/default projected reads by static trace. - At this batch's original run, lorebook activation scanned entries once per active book and was tracked in #2035; batch 6 confirms the current branch uses batched active entry reads with focused TS/Rust proof. - At this batch's original run, catalog selectors still had slow projected reads and some full-row selector hooks; character panel projected list measured `1798.17ms` cold / `1681.39ms` warm for 1,200 large cards and chat summaries measured `874.68ms` / `872.68ms` for 2,500 chats. Tracked in #2036, later closed by merged PR #2052; fresh timing still needed. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage perf_hot_paths_large_profile_timing -- --nocapture` with temporary synthetic integration harness -> 1 passed. - Key timings from the harness: - `timeline.page_projected_20`: `8.87ms` cold / `8.18ms` warm; payload `130,221` bytes. - `generation.full_messages`: `3069.33ms` cold / `2983.80ms` warm; payload `101,686,891` bytes. - `timeline.message_count`: `129.76ms` cold / `128.60ms` warm. - `catalog.characters.projected`: `1798.17ms` cold / `1681.39ms` warm; payload `5,324,581` bytes. - `catalog.chats.summary_projected`: `874.68ms` cold / `872.68ms` warm; payload `878,891` bytes. - `lorebook_entries.one_book_full_filter`: `215.76ms` cold / `20.22ms` warm; payload `1,311,385` bytes. ## Batch 5 Cross-target Handoff Scan - 2026-06-04 Base: - Refactor: current worktree at `f56efb20`; `origin/refactor` fetched at `86c9b8c9` and shape-checked for the same backup/remote exposure paths. - Legacy: `origin/main` / v1.6.1 server storage reference. Outcome: - Profile JSON/ZIP import and managed backup storage paths have focused coverage for collection no-wipe behavior, asset staging/rollback, ZIP missing-asset warnings, and backup create/list/download/delete basics. - Import rollback atomicity has focused coverage for profile asset/collection rollback, Marinara nested record rollback, ST character/lorebook/preset rollback, chat import rollback, branch import target restore, and persona avatar managed-file rollback. - Managed asset cache coherency is covered at Target 2 wrapper level: profile/import/storage/media API wrappers invalidate remote managed asset object URLs after writes. Rendering/cache behavior remains Target 4/18. - At this batch's original run, remote exposure/admin guards had one storage blocker in #2039; batch 6 confirms `backup_list` now requires Admin Access and omits local backup paths, with Target 3 still owning remote-runtime-wide policy proof. - Profile/import/export UX lifecycle remains Target 20 handoff; provider/security policy outside storage data access remains Target 3. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml profile_import_ -- --nocapture` -> 13 passed. - `cargo test --manifest-path src-tauri/Cargo.toml import_profile_zip -- --nocapture` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml rolls_back -- --nocapture` -> 11 passed. - `cargo test --manifest-path src-tauri/Cargo.toml restores_target -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml preserves_group_id_when_branch_import_fails -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml persona_avatar_file_rolls_back -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_rejects_remote_raw_server_path_commands -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml http_server::tests::hostable_security_ -- --nocapture` -> 10 passed. - Static legacy comparison: `packages/server/src/routes/backup.routes.ts` listed backups as `{ name, createdAt }`; refactor `src-tauri/src/commands/storage/backup.rs` returns `{ name, createdAt, path }`. ## Batch 6 Current Refactor Refresh - 2026-06-04 Base: - Refactor: current worktree / `origin/refactor` at `d20876dc`. - Legacy: `origin/main` / v1.6.1 file-native storage reference. - At batch 6 time: #2029, #2030, #2034, #2035, and #2039 closed; #2036 open. Batch 7 supersedes #2036 state after PR #2052 merged. Outcome: - At batch 6 time, target stayed `gaps_open` because #2036 still tracked large selector summary/cache performance. Batch 7 moves the current target verdict to `fixed_needs_rescan` after #2036 closed. - Admin destructive guards now require backend confirmation and remote Admin Access: command, dispatch, and hostable negative/positive tests pass. - Memory Recall now skips both `hiddenFromAI` and `hiddenFromAi`; focused Rust proof passes. - Generation and autonomous hot paths are statically fixed from the prior full-transcript shape: generation defaults to a bounded projected message load and autonomous activity initialization loads only recent projected fields. No fresh large-profile timing was run in this refresh. - Lorebook activation now batches active entry reads through `listLorebookEntriesByLorebookIds` and Rust `list_where_in`; focused TS and Rust proof pass. - Remote backup listing now requires Admin Access and omits local backup `path` from list responses; backup and remote command-surface proof pass. - Chat surface character lookup had already improved by batch 6; batch 7 confirms the remaining #2036 selector/cache blocker was closed by PR #2052. Fresh timing proof still has not been rerun. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml admin_clear_all -- --nocapture` -> 8 passed. - `cargo test --manifest-path src-tauri/Cargo.toml chat_memor -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml lorebook_entries_list_by_lorebook_ids_reads_matching_books_once -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml hostable_security_requires_admin_access_for_remote_backup_list -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands -- --nocapture` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml backup::tests -- --nocapture` -> 2 passed. - `pnpm test -- src/engine/generation/active-lorebook-scanner.test.ts` -> 1 file / 1 test passed. - `pnpm test -- src/engine/generation/start-generation.test.ts` -> no test file found. - `pnpm test -- src/engine/modes/chat/autonomous/autonomous.service.test.ts` -> no test file found. Static trace: - Admin confirm: `src-tauri/src/commands/storage/admin.rs`, `src-tauri/src/http_dispatch.rs`, `src-tauri/src/http_server.rs`, `src/shared/api/admin-api.ts`. - Memory Recall hidden flags: `src-tauri/src/commands/storage/chats.rs`. - Bounded generation/autonomous reads: `src/engine/generation/start-generation.ts`, `src/engine/generation/context.ts`, `src/engine/modes/chat/autonomous/autonomous.service.ts`. - Batched lorebook activation: `src/engine/capabilities/storage.ts`, `src/shared/api/storage-api.ts`, `src/engine/generation/active-lorebook-scanner.ts`, `src-tauri/src/commands/storage/commands/entities.rs`. - Remote backup list guard/shape: `src/shared/api/remote-runtime.ts`, `src-tauri/src/http_server.rs`, `src-tauri/src/commands/storage/backup.rs`. - Batch 6 former #2036 selector gap trace: `src/features/catalog/personas/hooks/use-personas.ts`, `src/features/catalog/connections/hooks/use-connections.ts`, `src/features/catalog/presets/hooks/use-presets.ts`, `src/features/catalog/characters/hooks/use-characters.ts`, `src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts`. Batch 7 supersedes this with PR #2052 closure evidence. ## Batch 7 #2036 Closure Refresh - 2026-06-04 Base: - Refactor: `origin/refactor` at `6057d69c`, merged PR #2052 (`Fix catalog summary selector reads`). - Local focused proof checkout: `fix/issue-2036-catalog-summary-reads` at `ca8c9afd`. - Live follow-up state: #2036 closed on 2026-06-03 at 17:58Z; PR #2052 merged on 2026-06-03 at 17:58Z. Outcome: - Target moves from `gaps_open` to `fixed_needs_rescan`: all known Target 2 follow-up blockers are closed, but there has not been a fresh Target 2 parity rescan or native/large-profile timing pass after #2052. - #2052 added projected-list cache reuse/invalidation in Rust storage and converted remaining selector hot paths to summary projections where this issue called them out. - Static trace on merged `origin/refactor` shows connection selectors use `CONNECTION_SUMMARY_OPTIONS`, preset list/default/default-mutation paths use `PRESET_SUMMARY_OPTIONS`, chat surface uses `useCharacterSummariesByIds`, and Rust storage owns projected-list cache keys/stamps plus invalidation. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage list_projected_ -- --nocapture` -> 7 passed. - `pnpm test -- src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx` -> 1 file / 1 test passed. Remaining rescan need: - Run fresh storage parity against current `refactor` and repeat large-profile cold/warm timing before upgrading to `on_par`. ## Batch 8 Current Rescan After #2052 - 2026-06-04 Base: - Refactor: fresh branch from `origin/refactor` at `6057d69c`. - Legacy: v1.6.1 file-native storage plus Target 3 legacy server error-handler trace for storage failure behavior. Outcome: - #2036 stays fixed under current refactor proof: projected-list cache tests pass, selector hooks use summary projections, and large-profile warm catalog reads now hit the projected cache. - Storage CRUD/projection, message sidecar shape, prompt snapshots, branch/delete cleanup, Memory Recall hidden flags, admin clear-all, backup list Admin Access, profile/ZIP import, rollback, lorebook batching, active-lorebook TS, and chat-surface selector TS proof all pass on the current base. - Verdict stays `gaps_open`, not `on_par`, because hostable remote storage `io_error` still falls through to generic HTTP 500 instead of legacy-style actionable 503-class storage failure behavior. Tracked in #2060/#2067. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture` -> 42 passed. - Focused Rust filters passed: `generic_storage` (4), `storage_list_projected` (4), `message_swipes` (26), `prompt_snapshot` (6), `delete_swipe` (2), `branch_chat` (4), `projected_message` (6), `chat_memor` (1), `admin_clear_all` (8), `hostable_security_requires_admin_access_for_remote_backup_list` (1), `http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands` (1), `backup::tests` (2), `profile_import_` (13), `import_profile_zip` (2), `rolls_back` (11), `persona_avatar_file_rolls_back` (1), and `lorebook_entries_list_by_lorebook_ids_reads_matching_books_once` (1). - `pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts` -> 1 file / 1 test passed. - `pnpm exec vitest run src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx` -> 1 file / 1 test passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage perf_hot_paths_large_profile_timing -- --nocapture` with a temporary local integration harness -> 1 passed; harness removed after proof. Timing: - `catalog.characters.panel_projected`: `1829.58ms` cold / `156.99ms` warm; 1,200 rows; 32,513,491 bytes. - `catalog.personas.summary_projected`: `1430.33ms` cold / `120.95ms` warm; 1,200 rows; 34,897,289 bytes. - `catalog.presets.summary_projected`: `1449.57ms` cold / `119.71ms` warm; 1,500 rows; 1,803,389 bytes. - `catalog.connections.summary_projected`: `772.69ms` cold / `65.94ms` warm; 1,500 rows; 2,165,589 bytes. - `catalog.chats.summary_projected`: `1761.13ms` cold / `153.89ms` warm; 2,500 rows; 1,378,813 bytes. - `timeline.page_projected_20`: `12.34ms` cold / `12.24ms` warm; 20 rows; 773,961 bytes. - `generation.recent_projected_80`: `49.73ms` cold / `49.45ms` warm; 80 rows; 3,095,841 bytes. - `lorebook.entries.where_in_projected`: `1208.15ms` cold / `1236.09ms` warm; 2,500 rows; 23,356,391 bytes. Static blocker trace: - `src-tauri/crates/core/src/lib.rs` maps `std::io::Error` into `AppError` code `io_error`. - `src-tauri/src/http_server.rs` maps known error codes to 400/401/403/404/422/502/501, but all other codes, including `io_error`, default to `500`. - Legacy `packages/server/src/middleware/error-handler.ts` mapped readonly/locked storage backend failures to 503-style actionable responses. Cross-target notes: - #2058 remains a Target 3/20 remote import-admin blocker, not a new Target 2 CRUD/projection blocker in this rescan. - #2049 remains a later memory/prompt/runtime semantics bug; batch 8 did not classify it as a Target 2 storage data-access blocker. ## Batch 9 Current Refactor Rescan After Remote/Storage Fixes - 2026-06-04 Base: - Refactor: `origin/refactor` at `5248a86b`. - Legacy: v1.6.1 file-native storage plus legacy server remote/profile behavior traces. Outcome: - #2060 and #2067 are closed and proof-checked: storage-unavailable `io_error` cases map to HTTP 503 while uncategorized I/O remains 500. - #2058 is closed and proof-checked: remote `import_st_bulk_scan` now requires Admin Access. - #2049 is closed; static trace shows Memory Recall read-behind filtering in prompt assembly, while existing storage hidden-flag proof still passes. - Core Target 2 proof still passes on the current base: storage CRUD/projection, sidecar shape, profile/ZIP import for normal payloads, rollback, admin, backup, and catalog/timeline/lorebook hot-path controls. - Verdict stays `gaps_open` because #2108 reports large profile import is still broken for Remote Runtime: large ZIP upload exceeds/strains base64/body-limit transport, `profile_import_file` is desktop-only, and JSON-only import fails on missing asset base64 instead of importing data with warnings. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture` -> 42 passed. - Focused Rust filters passed: `generic_storage` (4), `storage_list_projected` (4), `message_swipes` (26), `prompt_snapshot` (6), `delete_swipe` (2), `branch_chat` (4), `projected_message` (6), `chat_memor` (1), `admin_clear_all` (8), `hostable_security_requires_admin_access_for_remote_backup_list` (1), `remote_st_bulk_scan_requires_admin_access` (1), `io_errors_map_to_storage_unavailable_http_status` (3), `locked_database_io_errors_map_to_storage_unavailable_http_status` (1), `message_only_storage_io_errors_map_to_storage_unavailable_http_status` (1), `uncategorized_io_errors_keep_internal_server_error_status` (1), `http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands` (1), `backup::tests` (2), `profile_import_` (13), `import_profile_zip` (2), `rolls_back` (11), `persona_avatar_file_rolls_back` (1), and `lorebook_entries_list_by_lorebook_ids_reads_matching_books_once` (1). - `pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx src/shared/api/remote-runtime.test.ts src/engine/modes/chat/schedules/schedule.service.test.ts` -> 4 files / 9 tests passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage perf_hot_paths_large_profile_timing -- --nocapture` with a temporary local integration harness -> 1 passed; harness removed after proof. Timing: - `catalog.characters.panel_projected`: `1337.62ms` cold / `111.84ms` warm; 1,200 rows; 32,471,491 bytes. - `catalog.personas.summary_projected`: `1037.13ms` cold / `87.95ms` warm; 1,200 rows; 32,278,890 bytes. - `catalog.presets.summary_projected`: `449.85ms` cold / `35.14ms` warm; 1,500 rows; 1,779,389 bytes. - `catalog.connections.summary_projected`: `488.38ms` cold / `37.19ms` warm; 1,500 rows; 2,129,589 bytes. - `catalog.chats.summary_projected`: `710.06ms` cold / `56.93ms` warm; 2,500 rows; 1,241,313 bytes. - `timeline.page_projected_20`: `8.68ms` cold / `8.47ms` warm; 20 rows; 354,791 bytes. - `generation.recent_projected_80`: `23.56ms` cold / `24.54ms` warm; 80 rows; 1,419,161 bytes. - `lorebook.entries.where_in_projected`: `1230.86ms` cold / `1517.45ms` warm; 2,500 rows; 23,356,391 bytes. Static blocker trace: - `src-tauri/src/http_server.rs` caps JSON/API body size at `MAX_API_BODY_BYTES = 256 * 1024 * 1024` and guards `profile_import` / `profile_import_upload` as privileged remote commands. - `src/shared/api/profile-api.ts` still base64-encodes file uploads before invoking `profile_import_upload`; `profile_import_file` is only available for embedded/Tauri path import and is listed as not remote in `src-tauri/src/http_dispatch.rs`. - `src-tauri/src/commands/storage/profile/assets.rs` still rejects profile JSON asset entries missing base64 data, matching the #2108 JSON-only failure mode. ## Batch 10 Status-Field Refresh And Current Rescan - 2026-06-04 Base: Refactor `origin/refactor` / current checkout `cc4c523b`; legacy reference remains v1.6.1 file-native storage. Outcome: - Header `proof_level` is normalized to `focused_test` instead of a compound proof string. - Coverage Matrix statuses are normalized to one tracker status per row; static, focused-test, timing, and cross-target details now live in the proof/follow-up columns. - Target remains `gaps_open` because #2108 is still open and this refresh did not run live large remote import, Docker/build proof, or native large-profile QA. - Current static trace suggests the Target 2 storage/profile-import part of #2108 may be stale: remote profile import now uses multipart `/api/profile/import` instead of remote base64 upload, and JSON profile assets with missing payloads warn/skip instead of hard-failing the whole import. Current proof run: - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture` passed: 42 tests. - Focused Rust filters passed for `generic_storage`, `storage_list_projected`, `message_swipes`, `prompt_snapshot`, `delete_swipe`, `branch_chat`, `projected_message`, `chat_memor`, `admin_clear_all`, remote admin guard tests, storage I/O error mapping tests, backup tests, profile import/export tests, ZIP import tests, rollback tests, persona avatar rollback, and lorebook entry lookup. - `pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx src/shared/api/remote-runtime.test.ts src/engine/modes/chat/schedules/schedule.service.test.ts` passed: 4 files, 9 tests. Current static trace: - `src/shared/api/profile-api.ts` routes remote file uploads through multipart HTTP for `/api/profile/import`; remote local-path import remains rejected as unsupported. - `src-tauri/src/http_server.rs` gives `/api/profile/import` a profile-sized body limit and streams multipart upload through the admin-gated profile import path. - `src-tauri/src/commands/storage/profile/assets.rs` records warnings for JSON profile asset entries without base64 payloads and continues importing the rest of the profile. Still not proven in batch 10: - Native Tauri app end-to-end large-profile responsiveness. - Fresh synthetic timing harness for large profile storage hot paths; earlier timing evidence remains historical. - Additional live large remote profile import and Docker/build proof; #2108 later closed in batch 12. ## Batch 11 Current Rescan At 089e1d72 - 2026-06-04 Base: - Refactor: fresh branch from `origin/refactor` at `089e1d72`. - Legacy: v1.6.1 file-native storage plus existing Target 2/3 legacy traces for storage failure and profile import behavior. - Live follow-up state at batch 11 time: #2108 open; #2036 is merged/closed and included in current base. Batch 12 supersedes #2108 state. Outcome: - #2036 remains closed under current proof. - Storage CRUD/projection, message sidecar, prompt snapshots, branch/delete cleanup, hidden memory filtering, admin/remote guards, backup, profile import/export, profile upload, ZIP import, rollback, lorebook lookup, and TS hot-path proof all pass on current base. - Remote profile import no longer uses the old base64 invoke path: `src/shared/api/profile-api.ts` sends remote files as multipart HTTP to `/api/profile/import`, and `src-tauri/src/http_server.rs` gives that route the profile upload limit and temp-file stream path. - JSON profile asset manifest entries with missing payload now warn/skip instead of rejecting the whole import; focused preview/native import tests cover this. - At batch 11 time, verdict stayed `gaps_open` because #2108 was still open and no live large remote import or Docker/build proof was run. Batch 12 supersedes this after #2108 closed. Proof: - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -- --nocapture` -> 42 passed. - Focused Rust filters passed: `generic_storage` (4), `storage_list_projected` (4), `message_swipes` (26), `prompt_snapshot` (6), `delete_swipe` (2), `branch_chat` (4), `projected_message` (6), `chat_memor` (1), `admin_clear_all` (8), `hostable_security_requires_admin_access_for_remote_backup_list` (1), `remote_st_bulk_scan_requires_admin_access` (1), storage I/O error mapping filters (4), `http_dispatch::tests::remote_runtime_command_surfaces_match_desktop_minus_documented_non_remote_commands` (1), `backup::tests` (2), `profile_import` (30), `import_profile_zip` (3), `rolls_back` (11), `persona_avatar_file_rolls_back` (1), `lorebook_entries_list_by_lorebook_ids_reads_matching_books_once` (1), and `profile_upload` (4, including the profile upload body-limit test). - `pnpm exec vitest run src/engine/generation/active-lorebook-scanner.test.ts src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.test.tsx src/shared/api/remote-runtime.test.ts src/engine/modes/chat/schedules/schedule.service.test.ts` -> 4 files / 9 tests passed. Static trace: - `src/shared/api/profile-api.ts` routes remote upload and preview through multipart HTTP for `/api/profile/import` and `/api/profile/import/preview`; remote local-path import still returns `remote_local_path_unsupported`. - `src-tauri/src/http_server.rs` exposes admin-gated `/api/profile/import`, `/api/profile/import/preview`, and `/api/profile/import/events` with the 1 GiB profile upload body limit. - `src-tauri/src/commands/storage/profile/assets.rs` records `missing_asset` warnings for JSON/ZIP manifest entries without payloads and continues importing the rest of the profile. - `src-tauri/src/http_dispatch.rs` still lists local file import commands as non-remote, so remote import coverage belongs to the multipart HTTP route. Still not proven in batch 11: - Native Tauri app end-to-end large-profile responsiveness. - Fresh synthetic timing harness for large profile storage hot paths; earlier timing evidence remains historical. - Additional live large remote profile import and Docker/build proof; #2108 later closed in batch 12. ## Batch 12 #2108 Closure Refresh - 2026-06-04 Base: - Refactor proof base remains `origin/refactor` at `089e1d72` from batch 11. - Live follow-up state: #2108 closed on 2026-06-04 at 10:59Z. Outcome: - No open Target 2 blockers remain. - Target 2 moves from `gaps_open` to `on_par` using the current batch 11 focused proof plus live #2108 closure state. - Proof level remains `focused_test`; no native Tauri large-profile pass was added in this closure refresh. Proof: - `gh issue view 2108 --repo Pasta-Devs/Marinara-Engine --json state,closedAt` -> `CLOSED`, `2026-06-04T10:59:15Z`. - Batch 11 focused Rust/TS proof on `089e1d72` remains the current target proof.
bsakaguchi 2026-10-21 05:24:53 +07:00
Author
Owner

@Xelvanis commented on GitHub (Jun 3, 2026):

Target 2 batch 1 foundation rescan

Provisional refactor base: fix/message-swipe-sidecar-regression at f56efb20.
Legacy anchor: origin/main / v1.6.1 file-native storage.

Result: no new foundation storage blocker found. Target 2 stays gaps_open because #1923 is still the dedicated chat/message storage gap for batch 3.

Covered in this pass:

  • Generic CRUD: supported entities still create/read, unsupported entities reject before creating files, direct mutation of internal message-swipe sidecars rejects.
  • Projection/search/paging: storage_get uses storage-level get_projected; storage_list routes projected message pages through list_messages_for_chat_page_projected; character search expands read fields for matching then returns the caller projection without embedded avatar payloads.
  • Remote parity: /api/invoke storage list/get/create/update/delete dispatch delegates to the same embedded storage helpers, so #1895/#1906 guard drift stays fixed.
  • Registry behavior: collection contracts expose profile inclusion, startup JSON repair, defaults, and delete-cleanup metadata; startup corrupt primary+backup recovery still repairs to an empty collection with preserved corrupt sentinels.
  • #1933 warm-cache/debounce: current storage crate has an in-process collection cache plus 750ms dirty flush; timing proof is still deferred to batch 4.
  • #1926 hidden Active World Info row: provider embedding is not run from the closed button path because scanActiveLorebookEntries passes embeddingSource: null; the button still runs a lightweight storage scan while mounted, so storage read-shape/timing remains part of batch 4.

Proof run:

  • cargo test --manifest-path src-tauri/Cargo.toml generic_storage -> 4 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml storage_list_projected -> 4 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml storage_list_searches_projected_character_fields_without_returning_avatar_payloads -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml registry_answers_core_contract_questions -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_recovers_when_collection_and_backup_are_corrupt -> 1 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml agent_default_connection -> 2 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_storage -> 7 passed.
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage -> 34 passed.

Next batch: data-loss and guard behavior.

<!-- gh-comment-id:4612769127 --> @Xelvanis commented on GitHub (Jun 3, 2026): ## Target 2 batch 1 foundation rescan Provisional refactor base: `fix/message-swipe-sidecar-regression` at `f56efb20`. Legacy anchor: `origin/main` / v1.6.1 file-native storage. Result: no new foundation storage blocker found. Target 2 stays `gaps_open` because #1923 is still the dedicated chat/message storage gap for batch 3. Covered in this pass: - Generic CRUD: supported entities still create/read, unsupported entities reject before creating files, direct mutation of internal message-swipe sidecars rejects. - Projection/search/paging: `storage_get` uses storage-level `get_projected`; `storage_list` routes projected message pages through `list_messages_for_chat_page_projected`; character search expands read fields for matching then returns the caller projection without embedded avatar payloads. - Remote parity: `/api/invoke` storage list/get/create/update/delete dispatch delegates to the same embedded storage helpers, so #1895/#1906 guard drift stays fixed. - Registry behavior: collection contracts expose profile inclusion, startup JSON repair, defaults, and delete-cleanup metadata; startup corrupt primary+backup recovery still repairs to an empty collection with preserved corrupt sentinels. - #1933 warm-cache/debounce: current storage crate has an in-process collection cache plus 750ms dirty flush; timing proof is still deferred to batch 4. - #1926 hidden Active World Info row: provider embedding is not run from the closed button path because `scanActiveLorebookEntries` passes `embeddingSource: null`; the button still runs a lightweight storage scan while mounted, so storage read-shape/timing remains part of batch 4. Proof run: - `cargo test --manifest-path src-tauri/Cargo.toml generic_storage` -> 4 passed. - `cargo test --manifest-path src-tauri/Cargo.toml storage_list_projected` -> 4 passed. - `cargo test --manifest-path src-tauri/Cargo.toml storage_list_searches_projected_character_fields_without_returning_avatar_payloads` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml registry_answers_core_contract_questions` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml app_state_startup_recovers_when_collection_and_backup_are_corrupt` -> 1 passed. - `cargo test --manifest-path src-tauri/Cargo.toml agent_default_connection` -> 2 passed. - `cargo test --manifest-path src-tauri/Cargo.toml http_dispatch::tests::dispatch_storage` -> 7 passed. - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-storage` -> 34 passed. Next batch: data-loss and guard behavior.
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#991
No description provided.