[GH-ISSUE #2124] 5. Characters #1037

Closed
opened 2026-10-21 05:25:25 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @Promansis on GitHub.

Target 5: Characters

target: 5
name: Characters
scan_status: reported
parity_verdict: on_par
proof_level: focused_test
scan_refactor: refactor 7d4f39f4
latest_refactor_refresh: origin/refactor 95690e30
legacy_ref: main 77a30fa4
latest_legacy_ref: origin/main 9e960485
report: https://github.com/Pasta-Devs/Marinara-Engine/issues/1904#issuecomment-4604507027
latest_slice_refresh: Closure rescan on 2026-06-05
last_refreshed: 2026-06-05

Scope

Included:

  • Character contract and editor fields.
  • Character library/sidebar list, search, groups, CRUD, duplicate, and version history.
  • Status/schedule behavior.
  • Quote formatting.
  • Native import/export/avatar handling.
  • ST/PNG/CharX/native import flows, update-in-place import, embedded lorebook/regex handling, and failure states.
  • Character avatar, gallery, sprites, thumbnails, and runtime visual adjacency.
  • Prompt/runtime consumers for character fields, active description extensions, examples, status, and chat assignment.
  • Remote-capable character command routing where refactor exposes the surface.
  • Side panel summary/performance adjacency.

Not checked:

  • Native hands-on app proof.
  • Browser/UI proof for editor/import/export/avatar/sprite flows.
  • Browser timing proof for the Characters side panel first-open path.
  • Browser visual proof for Avatar Crop mount stability.
  • Full mode parity for roleplay/game/tracker consumers; inventory keeps those as later slices when broader than character ownership.

UI Authoring Static Refresh - 2026-06-04

Static trace refreshed these requested rows against refactor at 7d4f39f4, with main at 77a30fa4 treated as legacy.

Surface ID Refresh result Evidence
05-CHAR-UI-library-panel-search-groups covered_static Refactor CharactersPanel, CharacterLibraryView, and use-characters-panel-* hooks cover list/search/filter/sort, favorites, groups, selection, quick-start conversation/roleplay, and active chat assignment.
05-CHAR-UI-editor-core-fields covered_static with quote-formatting exception Refactor editor tabs save name, description, personality, scenario, first message, example dialogue, alternate greetings, creator notes, system prompt, post-history instructions, tags, and comment through CharacterEditor / useUpdateCharacter; quote normalization drift is tracked separately below.
05-CHAR-UI-editor-extensions covered_static Refactor editor tabs expose backstory, appearance, alternate descriptions, colors, RPG stats, gallery, embedded lorebook, sprites, and advanced prompt controls. Media/runtime behavior remains deferred to asset/runtime rows.
05-CHAR-UI-quote-formatting gaps_open Refactor formatter covers description/personality/scenario/first message/examples/alternate greetings plus backstory/appearance/alt descriptions, but legacy also formatted creator_notes, system_prompt, post_history_instructions, and depth_prompt.prompt. Follow-up filed: #2128.
05-CHAR-UI-create-maker-update covered_static Create Character initializes the v2 card defaults and opens the editor; Character Maker saves generated core/extension fields through useCreateCharacter; Card Update modal applies targeted non-stale field replacements through useUpdateCharacter with version metadata.
05-CHAR-UI-import-flow refactor_better Refactor import flow handles .json, .png, .charx, and .marinara; supports new vs update-in-place, target selection, tag modes, status rows, embedded-lorebook prompt, regex import, update snapshots, and duplicate cleanup partial-success messaging.
05-CHAR-UI-export-actions covered_static Refactor supports single native/compatible/PNG exports through CharacterEditorDialogs, bulk native/compatible exports from the panel, shared download payloads, and Rust character_export, character_export_png, and characters_export_bulk commands.

Stale Follow-Up Refresh - 2026-06-04

Static trace refreshed these stale rows against refactor at 7d4f39f4, with main as legacy:

Surface ID Refresh result Evidence
05-CHAR-STORAGE-summary-projections covered_static Refactor now has useCharacterPanelSummaries with CHARACTER_PANEL_SUMMARY_OPTIONS, uses projected storage_list, and keeps full summary/detail paths separate.
05-CHAR-UI-export-feedback covered_static Single character export now calls triggerDownloadWithToast(...) and toastExportError(...); bulk character export still reports success/failure.
05-CHAR-UI-avatar-crop-layout covered_static AvatarCropWidget now reserves stable MAX_DISPLAY_W/MAX_DISPLAY_H stage bounds and hides the measured image frame until imgRect is available. Browser proof was not run.
05-CHAR-PERF-side-panel-open refactor_better RightPanel lazy-loads features/catalog/characters/panel, the panel uses the lightweight summary projection, and compact rows no longer compute prompt/book token estimates.

Storage/Performance Static Refresh - 2026-06-04

Static trace refreshed these requested storage/performance rows against refactor, with main treated as legacy.

Surface ID Refresh result Evidence
05-CHAR-STORAGE-crud-version-history gaps_open with mostly refactor_better implementation Refactor snapshots and restores data, comment, avatarPath, avatar, avatarFilePath, and avatarFilename, and duplicate copies managed avatar files instead of sharing the source file. Remaining gap: version history likely renders oldest-first because the UI does not request descending createdAt; follow-up filed: #2129.
05-CHAR-STORAGE-summary-projections refactor_better Refactor has a dedicated panel summary projection, projected storage list/get paths with nested fieldSelections, separate full summary/detail reads, and a projected-search test that avoids returning avatar payloads. Legacy panel used the full /characters list.
05-CHAR-STORAGE-delete-cascade-assets refactor_better Refactor character delete cleanup removes owned avatar media and character-gallery rows/files through storage contracts, with a focused test for gallery record/file cleanup. Legacy removed the character gallery directory and DB rows cascaded, but avatar file cleanup was not visible in the delete route.
05-CHAR-PERF-side-panel-open refactor_better RightPanel lazy-loads the narrow features/catalog/characters/panel entrypoint, the panel uses useCharacterPanelSummaries, compact rows no longer compute prompt/book token estimates, and full first-message data is lazy-loaded only for add/start actions.

Contract/API Static Refresh - 2026-06-04

Static trace refreshed the requested contract/API rows against refactor at 7d4f39f4, with main at 77a30fa4 treated as legacy.

Surface ID Refresh result Evidence
05-CHAR-CONTRACT-card-v2-fields covered_static Refactor src/engine/contracts/types/character.ts and src/engine/contracts/schemas/character.schema.ts preserve the legacy Chara Card V2 envelope, core data fields, comments/avatar/version/group adjacency, and now use pass-through parsing for unknown card data.
05-CHAR-CONTRACT-extension-fields covered_static Refactor preserves known Marinara extension fields (talkativeness, favorite, world/depth prompt, backstory, appearance, alt descriptions, colors, RPG stats, and conversation status) and keeps unknown extension keys via pass-through/import normalization.
05-CHAR-CONTRACT-character-book covered_static Refactor keeps embedded character-book types/schema, import preview entry detection for array/object entries, ST/CharX import normalization, standalone lorebook extraction/reimport, and compatible export paths.
05-CHAR-API-shared-wrappers covered_static Character feature hooks use storageApi, characterApi, importApi, export/gallery/sprite wrappers; no raw invokeTauri or raw fetch calls were found in src/features/catalog/characters or src/features/catalog/sprites.
05-CHAR-REMOTE-command-routing covered_static Remote Runtime allowlist and src-tauri/src/http_dispatch.rs cover character export/export PNG, embedded-lorebook import, ST character import/inspect/batch, storage CRUD, avatar upload/remove, version restore, gallery, and sprite command paths.

Assets/Compat/Error Static Refresh - 2026-06-04

Static trace refreshed these requested asset, compatibility, and error rows against refactor at 7d4f39f4, with main at 77a30fa4 treated as legacy.

Surface ID Refresh result Evidence
05-CHAR-ASSET-managed-avatar-flow refactor_better Refactor upload/remove/import/export snapshots managed avatar metadata, mirrors display fields, copies managed avatar files on duplicate, repairs stale local refs, supports thumbnails, and exports native avatars as data URLs. Closed avatar follow-ups #1960 and #1944 have no remaining static blocker in this row.
05-CHAR-ASSET-gallery-images gaps_open with CRUD/display coverage Refactor gallery upload/list/delete/display and file cleanup are covered, including managed asset persistence and character-delete cascade. Remaining gap: native character export only serializes gallery rows whose url is already an inline data:image/..., so normal managed gallery uploads are omitted from .marinara export/round-trip; follow-up filed: #2130.
05-CHAR-ASSET-sprite-editor refactor_better Refactor character sprite UI and Rust commands cover list, single/folder upload, delete single/all, download/export, framing, cleanup, restore, generation adjacency, cache invalidation, and remote dispatch.
05-CHAR-COMPAT-st-charx-import refactor_better Refactor import flow accepts .json, .png, .charx, and .marinara; PNG/CharX payload extraction, ST normalization, embedded lorebook handling, regex scripts, tags, and trusted avatar-source handling are covered.
05-CHAR-COMPAT-native-marinara-import-export gaps_open Refactor preserves native card data, embedded lorebook, sprites, avatar export/import, and bulk export paths, but managed gallery images are omitted from native character export/round-trip; follow-up filed: #2130. Native gallery restore also needs focused proof to confirm embedded inline data becomes managed gallery assets.
05-CHAR-ERROR-import-avatar-rollback covered_static ST/native import rollback paths remove created character records, lorebooks, avatar media, gallery rows, sprite directories, and failed gallery upload media where applicable; partial duplicate cleanup status remains visible in the import flow.
05-CHAR-ERROR-avatar-thumbnail-safety refactor_better Refactor thumbnail generation handles managed avatar files and inline legacy avatar data while rejecting unsafe source paths, unsupported sizes, oversized inline data, and bad inline cache names; UI falls back to source image on thumbnail load failure.

Runtime/Mode Consumers Static Refresh - 2026-06-04

Static trace refreshed these requested runtime/mode consumer rows against refactor, with main treated as legacy.

Surface ID Refresh result Evidence
05-CHAR-UI-schedule-status-controls covered_static Refactor chat settings exposes autonomous messaging, character exchanges, schedule enable/generate/regenerate controls, per-character schedule editing, idle/DND delay overrides, and conversation status indicators. Conversation input and view render status dots, activity labels, and delayed indicators.
05-CHAR-RUNTIME-prompt-fields covered_static Refactor prompt assembly loads character description with active extensions, personality, scenario, backstory, appearance, examples, first message, system prompt, post-history instructions, depth prompts, tags, and character marker fields; legacy prompt marker/macro paths carried the same core card fields.
05-CHAR-RUNTIME-status-schedule covered_static Refactor schedule generation persists conversationSchedulesEnabled, characterSchedules, and scheduleWeekStart, derives current status/activity, updates character extensions.conversationStatus, exposes getConversationStatus, and injects schedule/status context plus schedule update command instructions into conversation prompts.
05-CHAR-RUNTIME-autonomous-status-delays gaps_open Refactor preserves scheduleless autonomy, offline skips, busy delays, delayed UI events, and background autonomous polling, but legacy used a shorter mention/manual-target delay path. Refactor accepts mentionedCharacterNames yet resolveConversationAvailability always uses generic getBusyDelay; follow-up filed: #2131.
05-CHAR-RUNTIME-chat-assignment covered_static Refactor character panel actions add/remove character IDs on active chats, start conversation/roleplay chats with characterIds, lazy-load first greetings for non-conversation first-message confirmation, and preserve conversation-specific behavior by skipping roleplay first-message injection in conversation chats.
05-CHAR-RUNTIME-mode-consumers covered_static_for_character_slice Refactor generation filters inactive character IDs, loads character contexts from active chat IDs, scopes prompts for conversation/roleplay group targets, and game/roleplay/tracker owners consume character cards separately. Full roleplay/game/tracker parity remains owned by their target rows; no direct Target 5 blocker was found in this slice.

Closure Rescan - 2026-06-05

Focused parityscan refreshed the four closed Target 5 follow-ups after fast-forwarding local refactor to origin/refactor at 95690e30. origin/main at 9e960485 was used as the legacy reference for these focused rows. No documented intentional divergence was found in docs/REFACTOR_PARITY_PIPELINE.md for the refreshed differences.

Follow-up Refresh result Current refactor evidence Legacy evidence
#2128 Fixed; covered_static with focused test proof src/features/catalog/characters/lib/character-editor-model.ts:39-:51 now includes creator_notes, system_prompt, post_history_instructions, and depth_prompt; :66-:73 formats depth_prompt.prompt while preserving the rest of the object. Focused Vitest passed. origin/main:packages/client/src/components/characters/CharacterEditor.tsx:170-:172 and :200 include the advanced fields and depth prompt text in quote formatting.
#2129 Fixed; covered_static with focused test proof src/features/catalog/characters/hooks/use-characters.ts:314-:318 now lists character-versions with orderBy: "createdAt" and descending: true. Focused hook Vitest passed. origin/main:packages/server/src/services/storage/characters.storage.ts:67-:72 orders character card versions by descending createdAt.
#2130 Fixed; covered_static with focused Rust proof src-tauri/src/commands/storage/exports.rs:805-:850 now exports inline gallery rows and managed gallery files; src-tauri/src/commands/storage/imports/marinara_assets.rs:115-:157 restores native gallery data through storage_create_inner, which materializes inline images as managed gallery files. Focused Rust gallery tests passed. origin/main:packages/server/src/routes/characters.routes.ts:160-:208 reads gallery image files and embeds them in the native character envelope.
#2131 Fixed; covered_static with focused test proof src/engine/generation/start-generation.ts:1400-:1449 now carries manual-target and mention context into availability resolution and selects getMentionDelay(...) only for mentioned/manual-target characters; src/engine/modes/chat/schedules/schedule.service.ts:1004-:1014 preserves the legacy short idle/DND delay windows. Focused generation Vitest passed. origin/main:packages/server/src/routes/generate.routes.ts:2595-:2635 treats requested mentions/manual targets as urgent and calls getMentionDelay(...), defined at origin/main:packages/server/src/services/conversation/schedule.service.ts:405-:412.

Verification run:

  • pnpm test -- src/features/catalog/characters/lib/character-editor-model.test.ts src/features/catalog/characters/hooks/use-characters.test.tsx src/engine/generation/start-generation.test.ts
  • cargo test --manifest-path src-tauri/Cargo.toml --workspace gallery

Target 5 status is upgraded to on_par for the refreshed blocker rows. Remaining proof limits: no hands-on Tauri/browser visual QA was run for Avatar Crop layout or side-panel timing beyond the earlier static coverage; deeper roleplay/game/tracker consumers remain target-owned by later mode scans.

Surface Inventory

Surface ID Surface Bucket Source Legacy owner Refactor owner In scope Notes
05-CHAR-CONTRACT-card-v2-fields Character Card V2 data, extensions, embedded lorebook, comment, avatar, version, and group contracts. CONTRACT both packages/shared/src/types/character.ts, packages/shared/src/schemas/character.schema.ts, packages/server/src/db/schema/characters.ts src/engine/contracts/types/character.ts, src/engine/contracts/schemas/character.schema.ts yes Baseline contract surface for all editor, storage, import/export, and prompt paths.
05-CHAR-CONTRACT-extension-fields Marinara character extensions: backstory, appearance, alt descriptions, colors, RPG stats, depth prompt, and conversation status/activity metadata. CONTRACT both packages/shared/src/types/character.ts, packages/client/src/components/characters/CharacterEditor.tsx src/engine/contracts/types/character.ts, src/features/catalog/characters/components/*Tab.tsx yes Prior matrix only named status and quote gaps; full extension contract should be traced.
05-CHAR-CONTRACT-character-book Embedded character book entries, flags, positions, and import/export linkage inside a character card. CONTRACT both packages/shared/src/types/character.ts, packages/shared/src/schemas/character.schema.ts src/engine/contracts/types/character.ts, src/engine/contracts/schemas/character.schema.ts, src/features/catalog/characters/components/CharacterLorebookTab.tsx yes Overlaps target 7, but character card ownership needs its own trace.
05-CHAR-STORAGE-crud-version-history Character create/update/delete/duplicate and version snapshot/restore preserve card data, comment, and avatar metadata. STORAGE both packages/server/src/services/storage/characters.storage.ts, packages/server/src/routes/characters.routes.ts src-tauri/src/commands/storage/characters.rs, src-tauri/src/commands/storage/commands/entities.rs, src/features/catalog/characters/hooks/use-characters.ts yes Closure rescan 2026-06-05: snapshot/restore/duplicate behavior remains stronger than legacy, and version history now requests descending createdAt; focused hook test passed.
05-CHAR-STORAGE-summary-projections Character list/search/detail queries request the right projection for side panel, library, and detail/editor paths. STORAGE both packages/client/src/hooks/use-characters.ts, packages/server/src/routes/characters.routes.ts src/features/catalog/characters/hooks/use-characters.ts, src-tauri/src/commands/storage/commands/entities.rs yes Refreshed 2026-06-04: #1934 and #1999 are closed; current refactor has a dedicated panel summary projection, projected storage reads, and keeps full summary/detail reads separate.
05-CHAR-STORAGE-delete-cascade-assets Deleting a character cleans attached gallery/avatar asset records/files and does not leave stale references. STORAGE both packages/server/src/services/storage/characters.storage.ts, packages/server/src/services/storage/character-gallery.storage.ts src-tauri/src/commands/storage/commands/entities.rs, src-tauri/src/commands/storage/avatars.rs yes Refreshed 2026-06-04: refactor cleanup removes owned avatar media plus character-gallery rows/files and has focused static test coverage.
05-CHAR-API-shared-wrappers Frontend character hooks use focused shared APIs/storage wrappers for CRUD, avatar, versions, embedded lorebook, gallery, and sprites. API refactor_only legacy direct HTTP client hooks src/shared/api/character-api.ts, src/shared/api/storage-api.ts, src/features/catalog/characters/hooks/use-characters.ts, src/features/catalog/sprites/hooks/use-sprites.ts yes Refactor architecture surface; should not regress to raw feature-level invokes.
05-CHAR-REMOTE-command-routing Hostable remote runtime exposes character export/import, avatar, version, gallery, sprite, and storage commands through allowlist plus dispatch. REMOTE refactor_only not applicable src/shared/api/remote-runtime.ts, src-tauri/src/http_dispatch.rs, src-tauri/src/lib.rs yes Needed because character flows are now native/hostable command surfaces.
05-CHAR-UI-library-panel-search-groups Character library and side panel support list/search/filter/sort, favorites, groups, selection, quick start, and chat assignment. UI both packages/client/src/components/panels/CharactersPanel.tsx, packages/client/src/components/characters/CharacterLibraryView.tsx src/features/catalog/characters/components/CharactersPanel.tsx, src/features/catalog/characters/components/CharacterLibraryView.tsx, src/features/catalog/characters/hooks/use-characters-panel-* yes Refreshed 2026-06-04: covered by UI authoring static trace.
05-CHAR-UI-editor-core-fields Editor saves core card fields: name, description, personality, scenario, first message, examples, alternate greetings, creator notes, system prompt, post-history instructions, tags, and comment. UI both packages/client/src/components/characters/CharacterEditor.tsx src/features/catalog/characters/components/CharacterEditor.tsx, src/features/catalog/characters/components/Character*Tab.tsx yes Refreshed 2026-06-04: covered by UI authoring static trace except quote-formatting drift tracked separately.
05-CHAR-UI-editor-extensions Editor saves extension tabs for backstory, appearance, alt descriptions, colors, RPG stats, gallery, embedded lorebook, sprites, and advanced prompts. UI both packages/client/src/components/characters/CharacterEditor.tsx src/features/catalog/characters/components/CharacterDescriptionTab.tsx, CharacterColorsTab.tsx, CharacterStatsTab.tsx, CharacterLorebookTab.tsx, CharacterGalleryTab.tsx, CharacterSpritesTab.tsx, CharacterAdvancedTab.tsx yes Refreshed 2026-06-04: editor presence covered; deeper media/runtime proof deferred.
05-CHAR-UI-quote-formatting Character editor applies configured quote formatting to card text fields and extension text. UI both packages/client/src/components/characters/CharacterEditor.tsx src/features/catalog/characters/lib/character-editor-model.ts, src/features/catalog/characters/components/CharacterEditor.tsx, src/shared/lib/dialogue-quotes.ts yes Closure rescan 2026-06-05: advanced fields and depth_prompt.prompt are now covered; focused formatter test passed.
05-CHAR-UI-create-maker-update Create Character, Character Maker, and Card Update modal populate/suggest/save card fields without bypassing editor/storage contracts. UI both packages/client/src/components/modals/CreateCharacterModal.tsx, CharacterMakerModal.tsx, CharacterCardUpdateModal.tsx src/features/catalog/characters/components/CreateCharacterModal.tsx, CharacterMakerModal.tsx, CharacterCardUpdateModal.tsx yes Refreshed 2026-06-04: covered by UI authoring static trace.
05-CHAR-UI-import-flow Import modal handles supported file types, new vs update-in-place, target selection, tag modes, status rows, and embedded lorebook prompt. UI both packages/client/src/components/modals/ImportCharacterModal.tsx, packages/client/src/lib/character-import.ts src/features/catalog/characters/hooks/use-character-import-flow.ts, src/features/catalog/characters/components/ImportCharacterModal.tsx, src/shared/lib/character-import.ts yes Refreshed 2026-06-04: refactor better due update-in-place, snapshots, regex import, and cleanup partial-success messaging.
05-CHAR-UI-export-actions Character exports support native Marinara, compatible Chara Card JSON/PNG, and bulk export affordances. UI both packages/client/src/components/characters/CharacterEditor.tsx, packages/server/src/routes/characters.routes.ts src/features/catalog/characters/components/CharacterEditorDialogs.tsx, src/features/catalog/characters/components/CharactersPanel.tsx, src-tauri/src/commands/storage/commands/profile.rs yes Refreshed 2026-06-04: covered by UI authoring static trace.
05-CHAR-UI-export-feedback Character export actions report clear success/failure feedback after downloads. UI unclear legacy export UI not traced src/features/catalog/characters/components/CharacterEditorDialogs.tsx, src/features/catalog/characters/hooks/use-characters-panel-selection.ts yes Refreshed 2026-06-04: #2001 is closed; current character single-export path uses shared success/error toast helpers.
05-CHAR-UI-avatar-crop-layout Character editor Avatar Crop widget mounts with stable size and does not flash oversized. UI refactor_only not found src/features/catalog/characters/components/CharacterMetadataTab.tsx, src/shared/components/ui/AvatarCropWidget.tsx yes Refreshed 2026-06-04: #2003 is closed; static trace shows stable reserved bounds, but browser visual proof was not run.
05-CHAR-UI-schedule-status-controls Conversation schedule/status controls show and edit character availability, generated schedules, and status dots. UI both packages/client/src/components/chat/ChatSetupWizard.tsx, packages/client/src/components/chat/ChatSettingsDrawer.tsx, packages/client/src/components/chat/ConversationView.tsx src/features/modes/shared/chat-ui, src/features/modes/conversation, src/app/shell/ChatSidebar.tsx yes Complements runtime status storage; needs UI proof if rescan claims status parity.
05-CHAR-RUNTIME-prompt-fields Prompt assembly consumes character fields, active description extensions, depth prompts, examples, and character macros consistently. RUNTIME both packages/server/src/services/prompt/marker-expander.ts, packages/server/src/services/prompt/character-description-extensions.ts src/engine/generation-core/prompt/character-description-extensions.ts, src/engine/generation/active-characters.ts, mode prompt builders yes Keep focused on character-owned fields; broader prompt assembly belongs to target 12.
05-CHAR-RUNTIME-status-schedule Schedule/status commands update character conversation status/activity where UI and generation consumers read it. RUNTIME both legacy conversation routes/status UI src/engine/generation/connected-commands.ts, src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts, src/app/shell/ChatSidebar.tsx yes Follow-up #1958 is closed but needs rescan.
05-CHAR-RUNTIME-autonomous-status-delays Character status, talkativeness, and schedules affect autonomous reply timing/skips. RUNTIME both packages/server/src/services/conversation/autonomous.service.ts, packages/server/src/routes/generate.routes.ts src/engine/generation, conversation generation hooks, chat metadata schedule services yes Closure rescan 2026-06-05: mention/manual-target short delay behavior is restored while generic busy delays, offline skip, and regenerate exclusion remain covered by focused generation tests.
05-CHAR-RUNTIME-chat-assignment Character and group selection create/update chats with correct characterIds, names, avatars, unread state, and sidebar status dots. RUNTIME both packages/client/src/hooks/use-start-chat-from-character.ts, chat/sidebar components src/features/catalog/characters/hooks/use-start-chat-from-character.ts, src/app/shell/ChatSidebar.tsx, mode surface data hooks yes Connects catalog character records to conversation entrypoints.
05-CHAR-RUNTIME-mode-consumers Roleplay, game, tracker, and scene memory read character cards, RPG stats, avatars/sprites, and memories. RUNTIME both legacy roleplay/game/tracker components and server services src/features/modes/roleplay, src/features/modes/game, src/features/runtime/tracker, src/engine/modes/roleplay later Inventory lead only; full proof belongs to mode/tracker targets unless a character rescan finds direct breakage.
05-CHAR-ASSET-managed-avatar-flow Avatar upload/remove/generated/crop/import/export stores managed avatar metadata, mirrors display fields, repairs stale local refs, and supports thumbnails. ASSET both legacy avatar/character routes and importer helpers src-tauri/src/commands/storage/avatars.rs, src-tauri/src/state.rs, src/features/catalog/characters/components/CharacterAvatarImage.tsx, src/shared/api/local-file-api.ts yes Refreshed 2026-06-04: refactor better static; closed #1960 and #1944 have no remaining static blocker in this row.
05-CHAR-ASSET-gallery-images Character gallery uploads, lists, deletes, displays, and survives chat deletion separately from chat gallery. ASSET both packages/server/src/services/storage/character-gallery.storage.ts, packages/client/src/components/characters/CharacterEditor.tsx src/features/catalog/characters/components/CharacterGalleryTab.tsx, src/features/catalog/characters/hooks/use-characters.ts, src-tauri/src/commands/storage/commands/media.rs yes Closure rescan 2026-06-05: native export now embeds managed gallery uploads and focused Rust gallery tests cover export/import plus managed file cleanup.
05-CHAR-ASSET-sprite-editor Character sprite list/upload/delete/download/framing/cleanup/export uses character-owned sprite assets and runtime expression data. ASSET both packages/client/src/hooks/use-characters.ts, packages/server/src/routes/sprites.routes.ts src/features/catalog/characters/components/CharacterSpritesTab.tsx, src/features/catalog/sprites/hooks/use-sprites.ts, src-tauri/src/commands/storage/sprites.rs yes Refreshed 2026-06-04: refactor better static. Runtime visual proof can be sliced to targets 4/19.
05-CHAR-COMPAT-st-charx-import ST JSON, PNG character cards, and CharX imports normalize card data, embedded lorebooks, regex scripts, tags, and trusted avatar sources. COMPAT both packages/server/src/services/import/st-character.importer.ts, packages/server/src/routes/import.routes.ts src-tauri/src/commands/storage/imports/*, src-tauri/src/commands/storage/commands/imports.rs, src/features/catalog/characters/hooks/use-character-import-flow.ts yes Refreshed 2026-06-04: refactor better static, including wrong-route rejection, rollback, and untrusted avatar-source denial.
05-CHAR-COMPAT-native-marinara-import-export Native .marinara character import/export preserves card data, avatar files, embedded lorebooks, sprites/gallery adjacency, and bulk payloads. COMPAT both packages/server/src/services/import/marinara.importer.ts, character export routes src-tauri/src/commands/storage/imports/marinara.rs, src-tauri/src/commands/storage/exports.rs, src-tauri/src/commands/storage/commands/profile.rs yes Closure rescan 2026-06-05: managed gallery export and embedded gallery import materialization are covered by focused Rust gallery tests.
05-CHAR-PERF-side-panel-open Opening the Characters side panel avoids broad editor/import chunks and avoids eager full prompt/book payload/token work. PERF both legacy panel/list implementation src/app/shell/RightPanel.tsx, src/features/catalog/characters/panel.ts, src/features/catalog/characters/hooks/use-characters.ts, src/features/catalog/characters/components/CharacterListRow.tsx yes Refreshed 2026-06-04: #1934 and #1999 are closed; current refactor uses a narrow panel entrypoint, lightweight panel summaries, and no compact-row token estimates.
05-CHAR-ERROR-import-avatar-rollback Import failures, malformed files, lorebook failures, unsafe avatar paths, and duplicate cleanup partial success are visible and recoverable. ERROR both packages/server/src/services/import/*, legacy import modal src-tauri/src/commands/storage/imports/service_tests.rs, src/features/catalog/characters/lib/character-import-model.ts, src/features/catalog/characters/hooks/use-character-import-flow.ts yes Refreshed 2026-06-04: covered static.
05-CHAR-ERROR-avatar-thumbnail-safety Avatar thumbnails handle managed files and inline legacy avatar data while rejecting unsafe paths/sizes. ERROR refactor_only legacy direct image serving src-tauri/src/commands/storage/avatars.rs, src/features/catalog/characters/components/CharacterAvatarImage.tsx, src/shared/api/avatar-api.ts yes Refreshed 2026-06-04: refactor better static; related #1944 remains closed.

Coverage Matrix

Surface ID Status Proof Follow-up
05-CHAR-CONTRACT-card-v2-fields covered_static contract/API static trace 2026-06-04
05-CHAR-CONTRACT-extension-fields covered_static contract/API static trace 2026-06-04
05-CHAR-CONTRACT-character-book covered_static contract/API static trace 2026-06-04
05-CHAR-STORAGE-crud-version-history refactor_better storage/performance static trace 2026-06-04; version ordering closure test 2026-06-05 #2129 closed
05-CHAR-STORAGE-summary-projections refactor_better storage/performance static trace 2026-06-04 #1934, #1999
05-CHAR-STORAGE-delete-cascade-assets refactor_better storage/performance static trace 2026-06-04
05-CHAR-API-shared-wrappers covered_static contract/API static trace 2026-06-04
05-CHAR-REMOTE-command-routing covered_static contract/API static trace 2026-06-04
05-CHAR-UI-library-panel-search-groups covered_static UI authoring static trace 2026-06-04
05-CHAR-UI-editor-core-fields covered_static UI authoring static trace 2026-06-04; quote-formatting row closed in 2026-06-05 rescan
05-CHAR-UI-editor-extensions covered_static UI authoring static trace 2026-06-04; deeper media/runtime proof deferred
05-CHAR-UI-quote-formatting covered_static UI authoring static trace 2026-06-04; closure formatter Vitest 2026-06-05 #2128 closed
05-CHAR-UI-create-maker-update covered_static UI authoring static trace 2026-06-04
05-CHAR-UI-import-flow refactor_better UI authoring static trace 2026-06-04
05-CHAR-UI-export-actions covered_static UI authoring static trace 2026-06-04
05-CHAR-UI-export-feedback covered_static stale follow-up static trace 2026-06-04 #2001
05-CHAR-UI-avatar-crop-layout covered_static stale follow-up static trace 2026-06-04; browser proof not run #2003
05-CHAR-UI-schedule-status-controls covered_static runtime/mode consumers static trace 2026-06-04
05-CHAR-RUNTIME-prompt-fields covered_static runtime/mode consumers static trace 2026-06-04
05-CHAR-RUNTIME-status-schedule covered_static runtime/mode consumers static trace 2026-06-04 #1958
05-CHAR-RUNTIME-autonomous-status-delays covered_static runtime/mode consumers static trace 2026-06-04; closure generation Vitest 2026-06-05 #2131 closed
05-CHAR-RUNTIME-chat-assignment covered_static runtime/mode consumers static trace 2026-06-04
05-CHAR-RUNTIME-mode-consumers covered_static_for_character_slice runtime/mode consumers static trace 2026-06-04; deeper roleplay/game/tracker parity remains target-owned
05-CHAR-ASSET-managed-avatar-flow refactor_better assets/compat/error static trace 2026-06-04 #1960, #1944
05-CHAR-ASSET-gallery-images refactor_better assets/compat/error static trace 2026-06-04; closure Rust gallery tests 2026-06-05 #2130 closed
05-CHAR-ASSET-sprite-editor refactor_better assets/compat/error static trace 2026-06-04
05-CHAR-COMPAT-st-charx-import refactor_better assets/compat/error static trace 2026-06-04
05-CHAR-COMPAT-native-marinara-import-export covered_static assets/compat/error static trace 2026-06-04; closure Rust gallery tests 2026-06-05 #2130 closed
05-CHAR-PERF-side-panel-open refactor_better stale follow-up static trace 2026-06-04 #1934, #1999
05-CHAR-ERROR-import-avatar-rollback covered_static assets/compat/error static trace 2026-06-04
05-CHAR-ERROR-avatar-thumbnail-safety refactor_better assets/compat/error static trace 2026-06-04 #1944

Follow-Ups

Issue State Why it matters
#2128 CLOSED; fixed at 95690e30 Character editor quote formatting now covers the legacy-covered advanced fields and depth_prompt.prompt; focused Vitest passed.
#2129 CLOSED; fixed at 95690e30 Character version history now requests newest-first createdAt ordering; focused hook Vitest passed.
#2130 CLOSED; fixed at 95690e30 Native character export/import now preserves managed gallery images through focused Rust gallery coverage.
#2131 CLOSED; fixed at 95690e30 Conversation @mentions/manual character targets now use the short mention delay path while normal replies keep generic busy delays; focused generation Vitest passed.
#1958 CLOSED Schedule updates stored character status outside card extensions.
#1959 CLOSED Original broad character editor quote-formatting gap; later narrow missed-field follow-up #2128 is now closed.
#1960 CLOSED Native character import stored embedded avatar data inline.
#1934 CLOSED Characters side panel first-open performance issue.
#1944 CLOSED Related inline avatar thumbnail issue.
#1999 CLOSED Refreshed character panel first-open performance issue after PR #2005.
#2001 CLOSED Export toast consistency issue covering character single-export feedback.
#2003 CLOSED Character editor Avatar Crop layout stability issue.

Rescan Criteria

  • Latest current-refactor refresh at 95690e30 on 2026-06-05 found #2128, #2129, #2130, and #2131 fixed; no intentional-divergence entry is needed for those rows.
  • Focused TypeScript proof covered advanced quote formatting, version-history newest-first ordering, mention/manual-target short delays, normal busy delays, offline skip, regenerate exclusion, and mixed mentioned/unmentioned conversation rows.
  • Focused Rust proof covered managed gallery upload persistence, native character export embedding managed gallery assets, native character import materializing embedded gallery assets as managed files, missing-file skip behavior, and gallery cleanup paths.
  • Keep #1934, #1999, #2001, and #2003 closed for target 5; the 2026-06-04 stale follow-up refresh found no remaining static blocker in those rows.
  • Use browser proof before upgrading Avatar Crop layout stability or side-panel first-open performance beyond static coverage.
  • Deeper roleplay/game/tracker character consumers remain owned by later mode/tracker parity targets unless a new Target 5-owned character blocker appears.
Originally created by @Promansis on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2124 Originally assigned to: @Promansis on GitHub. # Target 5: Characters ```yaml target: 5 name: Characters scan_status: reported parity_verdict: on_par proof_level: focused_test scan_refactor: refactor 7d4f39f4 latest_refactor_refresh: origin/refactor 95690e30 legacy_ref: main 77a30fa4 latest_legacy_ref: origin/main 9e960485 report: https://github.com/Pasta-Devs/Marinara-Engine/issues/1904#issuecomment-4604507027 latest_slice_refresh: Closure rescan on 2026-06-05 last_refreshed: 2026-06-05 ``` ## Scope Included: - Character contract and editor fields. - Character library/sidebar list, search, groups, CRUD, duplicate, and version history. - Status/schedule behavior. - Quote formatting. - Native import/export/avatar handling. - ST/PNG/CharX/native import flows, update-in-place import, embedded lorebook/regex handling, and failure states. - Character avatar, gallery, sprites, thumbnails, and runtime visual adjacency. - Prompt/runtime consumers for character fields, active description extensions, examples, status, and chat assignment. - Remote-capable character command routing where refactor exposes the surface. - Side panel summary/performance adjacency. Not checked: - Native hands-on app proof. - Browser/UI proof for editor/import/export/avatar/sprite flows. - Browser timing proof for the Characters side panel first-open path. - Browser visual proof for Avatar Crop mount stability. - Full mode parity for roleplay/game/tracker consumers; inventory keeps those as later slices when broader than character ownership. ## UI Authoring Static Refresh - 2026-06-04 Static trace refreshed these requested rows against `refactor` at `7d4f39f4`, with `main` at `77a30fa4` treated as legacy. | Surface ID | Refresh result | Evidence | | --- | --- | --- | | 05-CHAR-UI-library-panel-search-groups | `covered_static` | Refactor `CharactersPanel`, `CharacterLibraryView`, and `use-characters-panel-*` hooks cover list/search/filter/sort, favorites, groups, selection, quick-start conversation/roleplay, and active chat assignment. | | 05-CHAR-UI-editor-core-fields | `covered_static` with quote-formatting exception | Refactor editor tabs save name, description, personality, scenario, first message, example dialogue, alternate greetings, creator notes, system prompt, post-history instructions, tags, and comment through `CharacterEditor` / `useUpdateCharacter`; quote normalization drift is tracked separately below. | | 05-CHAR-UI-editor-extensions | `covered_static` | Refactor editor tabs expose backstory, appearance, alternate descriptions, colors, RPG stats, gallery, embedded lorebook, sprites, and advanced prompt controls. Media/runtime behavior remains deferred to asset/runtime rows. | | 05-CHAR-UI-quote-formatting | `gaps_open` | Refactor formatter covers description/personality/scenario/first message/examples/alternate greetings plus backstory/appearance/alt descriptions, but legacy also formatted `creator_notes`, `system_prompt`, `post_history_instructions`, and `depth_prompt.prompt`. Follow-up filed: #2128. | | 05-CHAR-UI-create-maker-update | `covered_static` | Create Character initializes the v2 card defaults and opens the editor; Character Maker saves generated core/extension fields through `useCreateCharacter`; Card Update modal applies targeted non-stale field replacements through `useUpdateCharacter` with version metadata. | | 05-CHAR-UI-import-flow | `refactor_better` | Refactor import flow handles `.json`, `.png`, `.charx`, and `.marinara`; supports new vs update-in-place, target selection, tag modes, status rows, embedded-lorebook prompt, regex import, update snapshots, and duplicate cleanup partial-success messaging. | | 05-CHAR-UI-export-actions | `covered_static` | Refactor supports single native/compatible/PNG exports through `CharacterEditorDialogs`, bulk native/compatible exports from the panel, shared download payloads, and Rust `character_export`, `character_export_png`, and `characters_export_bulk` commands. | ## Stale Follow-Up Refresh - 2026-06-04 Static trace refreshed these stale rows against `refactor` at `7d4f39f4`, with `main` as legacy: | Surface ID | Refresh result | Evidence | | --- | --- | --- | | 05-CHAR-STORAGE-summary-projections | `covered_static` | Refactor now has `useCharacterPanelSummaries` with `CHARACTER_PANEL_SUMMARY_OPTIONS`, uses projected `storage_list`, and keeps full summary/detail paths separate. | | 05-CHAR-UI-export-feedback | `covered_static` | Single character export now calls `triggerDownloadWithToast(...)` and `toastExportError(...)`; bulk character export still reports success/failure. | | 05-CHAR-UI-avatar-crop-layout | `covered_static` | `AvatarCropWidget` now reserves stable `MAX_DISPLAY_W`/`MAX_DISPLAY_H` stage bounds and hides the measured image frame until `imgRect` is available. Browser proof was not run. | | 05-CHAR-PERF-side-panel-open | `refactor_better` | `RightPanel` lazy-loads `features/catalog/characters/panel`, the panel uses the lightweight summary projection, and compact rows no longer compute prompt/book token estimates. | ## Storage/Performance Static Refresh - 2026-06-04 Static trace refreshed these requested storage/performance rows against `refactor`, with `main` treated as legacy. | Surface ID | Refresh result | Evidence | | --- | --- | --- | | 05-CHAR-STORAGE-crud-version-history | `gaps_open` with mostly `refactor_better` implementation | Refactor snapshots and restores `data`, `comment`, `avatarPath`, `avatar`, `avatarFilePath`, and `avatarFilename`, and duplicate copies managed avatar files instead of sharing the source file. Remaining gap: version history likely renders oldest-first because the UI does not request descending `createdAt`; follow-up filed: #2129. | | 05-CHAR-STORAGE-summary-projections | `refactor_better` | Refactor has a dedicated panel summary projection, projected storage list/get paths with nested `fieldSelections`, separate full summary/detail reads, and a projected-search test that avoids returning avatar payloads. Legacy panel used the full `/characters` list. | | 05-CHAR-STORAGE-delete-cascade-assets | `refactor_better` | Refactor character delete cleanup removes owned avatar media and character-gallery rows/files through storage contracts, with a focused test for gallery record/file cleanup. Legacy removed the character gallery directory and DB rows cascaded, but avatar file cleanup was not visible in the delete route. | | 05-CHAR-PERF-side-panel-open | `refactor_better` | `RightPanel` lazy-loads the narrow `features/catalog/characters/panel` entrypoint, the panel uses `useCharacterPanelSummaries`, compact rows no longer compute prompt/book token estimates, and full first-message data is lazy-loaded only for add/start actions. | ## Contract/API Static Refresh - 2026-06-04 Static trace refreshed the requested contract/API rows against `refactor` at `7d4f39f4`, with `main` at `77a30fa4` treated as legacy. | Surface ID | Refresh result | Evidence | | --- | --- | --- | | 05-CHAR-CONTRACT-card-v2-fields | `covered_static` | Refactor `src/engine/contracts/types/character.ts` and `src/engine/contracts/schemas/character.schema.ts` preserve the legacy Chara Card V2 envelope, core data fields, comments/avatar/version/group adjacency, and now use pass-through parsing for unknown card data. | | 05-CHAR-CONTRACT-extension-fields | `covered_static` | Refactor preserves known Marinara extension fields (talkativeness, favorite, world/depth prompt, backstory, appearance, alt descriptions, colors, RPG stats, and conversation status) and keeps unknown extension keys via pass-through/import normalization. | | 05-CHAR-CONTRACT-character-book | `covered_static` | Refactor keeps embedded character-book types/schema, import preview entry detection for array/object entries, ST/CharX import normalization, standalone lorebook extraction/reimport, and compatible export paths. | | 05-CHAR-API-shared-wrappers | `covered_static` | Character feature hooks use `storageApi`, `characterApi`, `importApi`, export/gallery/sprite wrappers; no raw `invokeTauri` or raw `fetch` calls were found in `src/features/catalog/characters` or `src/features/catalog/sprites`. | | 05-CHAR-REMOTE-command-routing | `covered_static` | Remote Runtime allowlist and `src-tauri/src/http_dispatch.rs` cover character export/export PNG, embedded-lorebook import, ST character import/inspect/batch, storage CRUD, avatar upload/remove, version restore, gallery, and sprite command paths. | ## Assets/Compat/Error Static Refresh - 2026-06-04 Static trace refreshed these requested asset, compatibility, and error rows against `refactor` at `7d4f39f4`, with `main` at `77a30fa4` treated as legacy. | Surface ID | Refresh result | Evidence | | --- | --- | --- | | 05-CHAR-ASSET-managed-avatar-flow | `refactor_better` | Refactor upload/remove/import/export snapshots managed avatar metadata, mirrors display fields, copies managed avatar files on duplicate, repairs stale local refs, supports thumbnails, and exports native avatars as data URLs. Closed avatar follow-ups #1960 and #1944 have no remaining static blocker in this row. | | 05-CHAR-ASSET-gallery-images | `gaps_open` with CRUD/display coverage | Refactor gallery upload/list/delete/display and file cleanup are covered, including managed asset persistence and character-delete cascade. Remaining gap: native character export only serializes gallery rows whose `url` is already an inline `data:image/...`, so normal managed gallery uploads are omitted from `.marinara` export/round-trip; follow-up filed: #2130. | | 05-CHAR-ASSET-sprite-editor | `refactor_better` | Refactor character sprite UI and Rust commands cover list, single/folder upload, delete single/all, download/export, framing, cleanup, restore, generation adjacency, cache invalidation, and remote dispatch. | | 05-CHAR-COMPAT-st-charx-import | `refactor_better` | Refactor import flow accepts `.json`, `.png`, `.charx`, and `.marinara`; PNG/CharX payload extraction, ST normalization, embedded lorebook handling, regex scripts, tags, and trusted avatar-source handling are covered. | | 05-CHAR-COMPAT-native-marinara-import-export | `gaps_open` | Refactor preserves native card data, embedded lorebook, sprites, avatar export/import, and bulk export paths, but managed gallery images are omitted from native character export/round-trip; follow-up filed: #2130. Native gallery restore also needs focused proof to confirm embedded inline data becomes managed gallery assets. | | 05-CHAR-ERROR-import-avatar-rollback | `covered_static` | ST/native import rollback paths remove created character records, lorebooks, avatar media, gallery rows, sprite directories, and failed gallery upload media where applicable; partial duplicate cleanup status remains visible in the import flow. | | 05-CHAR-ERROR-avatar-thumbnail-safety | `refactor_better` | Refactor thumbnail generation handles managed avatar files and inline legacy avatar data while rejecting unsafe source paths, unsupported sizes, oversized inline data, and bad inline cache names; UI falls back to source image on thumbnail load failure. | ## Runtime/Mode Consumers Static Refresh - 2026-06-04 Static trace refreshed these requested runtime/mode consumer rows against `refactor`, with `main` treated as legacy. | Surface ID | Refresh result | Evidence | | --- | --- | --- | | 05-CHAR-UI-schedule-status-controls | `covered_static` | Refactor chat settings exposes autonomous messaging, character exchanges, schedule enable/generate/regenerate controls, per-character schedule editing, idle/DND delay overrides, and conversation status indicators. Conversation input and view render status dots, activity labels, and delayed indicators. | | 05-CHAR-RUNTIME-prompt-fields | `covered_static` | Refactor prompt assembly loads character description with active extensions, personality, scenario, backstory, appearance, examples, first message, system prompt, post-history instructions, depth prompts, tags, and character marker fields; legacy prompt marker/macro paths carried the same core card fields. | | 05-CHAR-RUNTIME-status-schedule | `covered_static` | Refactor schedule generation persists `conversationSchedulesEnabled`, `characterSchedules`, and `scheduleWeekStart`, derives current status/activity, updates character `extensions.conversationStatus`, exposes `getConversationStatus`, and injects schedule/status context plus schedule update command instructions into conversation prompts. | | 05-CHAR-RUNTIME-autonomous-status-delays | `gaps_open` | Refactor preserves scheduleless autonomy, offline skips, busy delays, delayed UI events, and background autonomous polling, but legacy used a shorter mention/manual-target delay path. Refactor accepts `mentionedCharacterNames` yet `resolveConversationAvailability` always uses generic `getBusyDelay`; follow-up filed: #2131. | | 05-CHAR-RUNTIME-chat-assignment | `covered_static` | Refactor character panel actions add/remove character IDs on active chats, start conversation/roleplay chats with `characterIds`, lazy-load first greetings for non-conversation first-message confirmation, and preserve conversation-specific behavior by skipping roleplay first-message injection in conversation chats. | | 05-CHAR-RUNTIME-mode-consumers | `covered_static_for_character_slice` | Refactor generation filters inactive character IDs, loads character contexts from active chat IDs, scopes prompts for conversation/roleplay group targets, and game/roleplay/tracker owners consume character cards separately. Full roleplay/game/tracker parity remains owned by their target rows; no direct Target 5 blocker was found in this slice. | ## Closure Rescan - 2026-06-05 Focused parityscan refreshed the four closed Target 5 follow-ups after fast-forwarding local `refactor` to `origin/refactor` at `95690e30`. `origin/main` at `9e960485` was used as the legacy reference for these focused rows. No documented intentional divergence was found in `docs/REFACTOR_PARITY_PIPELINE.md` for the refreshed differences. | Follow-up | Refresh result | Current refactor evidence | Legacy evidence | | --- | --- | --- | --- | | #2128 | Fixed; `covered_static` with focused test proof | `src/features/catalog/characters/lib/character-editor-model.ts:39`-`:51` now includes `creator_notes`, `system_prompt`, `post_history_instructions`, and `depth_prompt`; `:66`-`:73` formats `depth_prompt.prompt` while preserving the rest of the object. Focused Vitest passed. | `origin/main:packages/client/src/components/characters/CharacterEditor.tsx:170`-`:172` and `:200` include the advanced fields and depth prompt text in quote formatting. | | #2129 | Fixed; `covered_static` with focused test proof | `src/features/catalog/characters/hooks/use-characters.ts:314`-`:318` now lists `character-versions` with `orderBy: "createdAt"` and `descending: true`. Focused hook Vitest passed. | `origin/main:packages/server/src/services/storage/characters.storage.ts:67`-`:72` orders character card versions by descending `createdAt`. | | #2130 | Fixed; `covered_static` with focused Rust proof | `src-tauri/src/commands/storage/exports.rs:805`-`:850` now exports inline gallery rows and managed gallery files; `src-tauri/src/commands/storage/imports/marinara_assets.rs:115`-`:157` restores native gallery data through `storage_create_inner`, which materializes inline images as managed gallery files. Focused Rust gallery tests passed. | `origin/main:packages/server/src/routes/characters.routes.ts:160`-`:208` reads gallery image files and embeds them in the native character envelope. | | #2131 | Fixed; `covered_static` with focused test proof | `src/engine/generation/start-generation.ts:1400`-`:1449` now carries manual-target and mention context into availability resolution and selects `getMentionDelay(...)` only for mentioned/manual-target characters; `src/engine/modes/chat/schedules/schedule.service.ts:1004`-`:1014` preserves the legacy short idle/DND delay windows. Focused generation Vitest passed. | `origin/main:packages/server/src/routes/generate.routes.ts:2595`-`:2635` treats requested mentions/manual targets as urgent and calls `getMentionDelay(...)`, defined at `origin/main:packages/server/src/services/conversation/schedule.service.ts:405`-`:412`. | Verification run: - `pnpm test -- src/features/catalog/characters/lib/character-editor-model.test.ts src/features/catalog/characters/hooks/use-characters.test.tsx src/engine/generation/start-generation.test.ts` - `cargo test --manifest-path src-tauri/Cargo.toml --workspace gallery` Target 5 status is upgraded to `on_par` for the refreshed blocker rows. Remaining proof limits: no hands-on Tauri/browser visual QA was run for Avatar Crop layout or side-panel timing beyond the earlier static coverage; deeper roleplay/game/tracker consumers remain target-owned by later mode scans. ## Surface Inventory | Surface ID | Surface | Bucket | Source | Legacy owner | Refactor owner | In scope | Notes | | --- | --- | --- | --- | --- | --- | --- | --- | | 05-CHAR-CONTRACT-card-v2-fields | Character Card V2 data, extensions, embedded lorebook, comment, avatar, version, and group contracts. | CONTRACT | both | `packages/shared/src/types/character.ts`, `packages/shared/src/schemas/character.schema.ts`, `packages/server/src/db/schema/characters.ts` | `src/engine/contracts/types/character.ts`, `src/engine/contracts/schemas/character.schema.ts` | yes | Baseline contract surface for all editor, storage, import/export, and prompt paths. | | 05-CHAR-CONTRACT-extension-fields | Marinara character extensions: backstory, appearance, alt descriptions, colors, RPG stats, depth prompt, and conversation status/activity metadata. | CONTRACT | both | `packages/shared/src/types/character.ts`, `packages/client/src/components/characters/CharacterEditor.tsx` | `src/engine/contracts/types/character.ts`, `src/features/catalog/characters/components/*Tab.tsx` | yes | Prior matrix only named status and quote gaps; full extension contract should be traced. | | 05-CHAR-CONTRACT-character-book | Embedded character book entries, flags, positions, and import/export linkage inside a character card. | CONTRACT | both | `packages/shared/src/types/character.ts`, `packages/shared/src/schemas/character.schema.ts` | `src/engine/contracts/types/character.ts`, `src/engine/contracts/schemas/character.schema.ts`, `src/features/catalog/characters/components/CharacterLorebookTab.tsx` | yes | Overlaps target 7, but character card ownership needs its own trace. | | 05-CHAR-STORAGE-crud-version-history | Character create/update/delete/duplicate and version snapshot/restore preserve card data, comment, and avatar metadata. | STORAGE | both | `packages/server/src/services/storage/characters.storage.ts`, `packages/server/src/routes/characters.routes.ts` | `src-tauri/src/commands/storage/characters.rs`, `src-tauri/src/commands/storage/commands/entities.rs`, `src/features/catalog/characters/hooks/use-characters.ts` | yes | Closure rescan 2026-06-05: snapshot/restore/duplicate behavior remains stronger than legacy, and version history now requests descending `createdAt`; focused hook test passed. | | 05-CHAR-STORAGE-summary-projections | Character list/search/detail queries request the right projection for side panel, library, and detail/editor paths. | STORAGE | both | `packages/client/src/hooks/use-characters.ts`, `packages/server/src/routes/characters.routes.ts` | `src/features/catalog/characters/hooks/use-characters.ts`, `src-tauri/src/commands/storage/commands/entities.rs` | yes | Refreshed 2026-06-04: #1934 and #1999 are closed; current refactor has a dedicated panel summary projection, projected storage reads, and keeps full summary/detail reads separate. | | 05-CHAR-STORAGE-delete-cascade-assets | Deleting a character cleans attached gallery/avatar asset records/files and does not leave stale references. | STORAGE | both | `packages/server/src/services/storage/characters.storage.ts`, `packages/server/src/services/storage/character-gallery.storage.ts` | `src-tauri/src/commands/storage/commands/entities.rs`, `src-tauri/src/commands/storage/avatars.rs` | yes | Refreshed 2026-06-04: refactor cleanup removes owned avatar media plus character-gallery rows/files and has focused static test coverage. | | 05-CHAR-API-shared-wrappers | Frontend character hooks use focused shared APIs/storage wrappers for CRUD, avatar, versions, embedded lorebook, gallery, and sprites. | API | refactor_only | legacy direct HTTP client hooks | `src/shared/api/character-api.ts`, `src/shared/api/storage-api.ts`, `src/features/catalog/characters/hooks/use-characters.ts`, `src/features/catalog/sprites/hooks/use-sprites.ts` | yes | Refactor architecture surface; should not regress to raw feature-level invokes. | | 05-CHAR-REMOTE-command-routing | Hostable remote runtime exposes character export/import, avatar, version, gallery, sprite, and storage commands through allowlist plus dispatch. | REMOTE | refactor_only | not applicable | `src/shared/api/remote-runtime.ts`, `src-tauri/src/http_dispatch.rs`, `src-tauri/src/lib.rs` | yes | Needed because character flows are now native/hostable command surfaces. | | 05-CHAR-UI-library-panel-search-groups | Character library and side panel support list/search/filter/sort, favorites, groups, selection, quick start, and chat assignment. | UI | both | `packages/client/src/components/panels/CharactersPanel.tsx`, `packages/client/src/components/characters/CharacterLibraryView.tsx` | `src/features/catalog/characters/components/CharactersPanel.tsx`, `src/features/catalog/characters/components/CharacterLibraryView.tsx`, `src/features/catalog/characters/hooks/use-characters-panel-*` | yes | Refreshed 2026-06-04: covered by UI authoring static trace. | | 05-CHAR-UI-editor-core-fields | Editor saves core card fields: name, description, personality, scenario, first message, examples, alternate greetings, creator notes, system prompt, post-history instructions, tags, and comment. | UI | both | `packages/client/src/components/characters/CharacterEditor.tsx` | `src/features/catalog/characters/components/CharacterEditor.tsx`, `src/features/catalog/characters/components/Character*Tab.tsx` | yes | Refreshed 2026-06-04: covered by UI authoring static trace except quote-formatting drift tracked separately. | | 05-CHAR-UI-editor-extensions | Editor saves extension tabs for backstory, appearance, alt descriptions, colors, RPG stats, gallery, embedded lorebook, sprites, and advanced prompts. | UI | both | `packages/client/src/components/characters/CharacterEditor.tsx` | `src/features/catalog/characters/components/CharacterDescriptionTab.tsx`, `CharacterColorsTab.tsx`, `CharacterStatsTab.tsx`, `CharacterLorebookTab.tsx`, `CharacterGalleryTab.tsx`, `CharacterSpritesTab.tsx`, `CharacterAdvancedTab.tsx` | yes | Refreshed 2026-06-04: editor presence covered; deeper media/runtime proof deferred. | | 05-CHAR-UI-quote-formatting | Character editor applies configured quote formatting to card text fields and extension text. | UI | both | `packages/client/src/components/characters/CharacterEditor.tsx` | `src/features/catalog/characters/lib/character-editor-model.ts`, `src/features/catalog/characters/components/CharacterEditor.tsx`, `src/shared/lib/dialogue-quotes.ts` | yes | Closure rescan 2026-06-05: advanced fields and `depth_prompt.prompt` are now covered; focused formatter test passed. | | 05-CHAR-UI-create-maker-update | Create Character, Character Maker, and Card Update modal populate/suggest/save card fields without bypassing editor/storage contracts. | UI | both | `packages/client/src/components/modals/CreateCharacterModal.tsx`, `CharacterMakerModal.tsx`, `CharacterCardUpdateModal.tsx` | `src/features/catalog/characters/components/CreateCharacterModal.tsx`, `CharacterMakerModal.tsx`, `CharacterCardUpdateModal.tsx` | yes | Refreshed 2026-06-04: covered by UI authoring static trace. | | 05-CHAR-UI-import-flow | Import modal handles supported file types, new vs update-in-place, target selection, tag modes, status rows, and embedded lorebook prompt. | UI | both | `packages/client/src/components/modals/ImportCharacterModal.tsx`, `packages/client/src/lib/character-import.ts` | `src/features/catalog/characters/hooks/use-character-import-flow.ts`, `src/features/catalog/characters/components/ImportCharacterModal.tsx`, `src/shared/lib/character-import.ts` | yes | Refreshed 2026-06-04: refactor better due update-in-place, snapshots, regex import, and cleanup partial-success messaging. | | 05-CHAR-UI-export-actions | Character exports support native Marinara, compatible Chara Card JSON/PNG, and bulk export affordances. | UI | both | `packages/client/src/components/characters/CharacterEditor.tsx`, `packages/server/src/routes/characters.routes.ts` | `src/features/catalog/characters/components/CharacterEditorDialogs.tsx`, `src/features/catalog/characters/components/CharactersPanel.tsx`, `src-tauri/src/commands/storage/commands/profile.rs` | yes | Refreshed 2026-06-04: covered by UI authoring static trace. | | 05-CHAR-UI-export-feedback | Character export actions report clear success/failure feedback after downloads. | UI | unclear | legacy export UI not traced | `src/features/catalog/characters/components/CharacterEditorDialogs.tsx`, `src/features/catalog/characters/hooks/use-characters-panel-selection.ts` | yes | Refreshed 2026-06-04: #2001 is closed; current character single-export path uses shared success/error toast helpers. | | 05-CHAR-UI-avatar-crop-layout | Character editor Avatar Crop widget mounts with stable size and does not flash oversized. | UI | refactor_only | not found | `src/features/catalog/characters/components/CharacterMetadataTab.tsx`, `src/shared/components/ui/AvatarCropWidget.tsx` | yes | Refreshed 2026-06-04: #2003 is closed; static trace shows stable reserved bounds, but browser visual proof was not run. | | 05-CHAR-UI-schedule-status-controls | Conversation schedule/status controls show and edit character availability, generated schedules, and status dots. | UI | both | `packages/client/src/components/chat/ChatSetupWizard.tsx`, `packages/client/src/components/chat/ChatSettingsDrawer.tsx`, `packages/client/src/components/chat/ConversationView.tsx` | `src/features/modes/shared/chat-ui`, `src/features/modes/conversation`, `src/app/shell/ChatSidebar.tsx` | yes | Complements runtime status storage; needs UI proof if rescan claims status parity. | | 05-CHAR-RUNTIME-prompt-fields | Prompt assembly consumes character fields, active description extensions, depth prompts, examples, and character macros consistently. | RUNTIME | both | `packages/server/src/services/prompt/marker-expander.ts`, `packages/server/src/services/prompt/character-description-extensions.ts` | `src/engine/generation-core/prompt/character-description-extensions.ts`, `src/engine/generation/active-characters.ts`, mode prompt builders | yes | Keep focused on character-owned fields; broader prompt assembly belongs to target 12. | | 05-CHAR-RUNTIME-status-schedule | Schedule/status commands update character conversation status/activity where UI and generation consumers read it. | RUNTIME | both | legacy conversation routes/status UI | `src/engine/generation/connected-commands.ts`, `src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts`, `src/app/shell/ChatSidebar.tsx` | yes | Follow-up #1958 is closed but needs rescan. | | 05-CHAR-RUNTIME-autonomous-status-delays | Character status, talkativeness, and schedules affect autonomous reply timing/skips. | RUNTIME | both | `packages/server/src/services/conversation/autonomous.service.ts`, `packages/server/src/routes/generate.routes.ts` | `src/engine/generation`, conversation generation hooks, chat metadata schedule services | yes | Closure rescan 2026-06-05: mention/manual-target short delay behavior is restored while generic busy delays, offline skip, and regenerate exclusion remain covered by focused generation tests. | | 05-CHAR-RUNTIME-chat-assignment | Character and group selection create/update chats with correct `characterIds`, names, avatars, unread state, and sidebar status dots. | RUNTIME | both | `packages/client/src/hooks/use-start-chat-from-character.ts`, chat/sidebar components | `src/features/catalog/characters/hooks/use-start-chat-from-character.ts`, `src/app/shell/ChatSidebar.tsx`, mode surface data hooks | yes | Connects catalog character records to conversation entrypoints. | | 05-CHAR-RUNTIME-mode-consumers | Roleplay, game, tracker, and scene memory read character cards, RPG stats, avatars/sprites, and memories. | RUNTIME | both | legacy roleplay/game/tracker components and server services | `src/features/modes/roleplay`, `src/features/modes/game`, `src/features/runtime/tracker`, `src/engine/modes/roleplay` | later | Inventory lead only; full proof belongs to mode/tracker targets unless a character rescan finds direct breakage. | | 05-CHAR-ASSET-managed-avatar-flow | Avatar upload/remove/generated/crop/import/export stores managed avatar metadata, mirrors display fields, repairs stale local refs, and supports thumbnails. | ASSET | both | legacy avatar/character routes and importer helpers | `src-tauri/src/commands/storage/avatars.rs`, `src-tauri/src/state.rs`, `src/features/catalog/characters/components/CharacterAvatarImage.tsx`, `src/shared/api/local-file-api.ts` | yes | Refreshed 2026-06-04: refactor better static; closed #1960 and #1944 have no remaining static blocker in this row. | | 05-CHAR-ASSET-gallery-images | Character gallery uploads, lists, deletes, displays, and survives chat deletion separately from chat gallery. | ASSET | both | `packages/server/src/services/storage/character-gallery.storage.ts`, `packages/client/src/components/characters/CharacterEditor.tsx` | `src/features/catalog/characters/components/CharacterGalleryTab.tsx`, `src/features/catalog/characters/hooks/use-characters.ts`, `src-tauri/src/commands/storage/commands/media.rs` | yes | Closure rescan 2026-06-05: native export now embeds managed gallery uploads and focused Rust gallery tests cover export/import plus managed file cleanup. | | 05-CHAR-ASSET-sprite-editor | Character sprite list/upload/delete/download/framing/cleanup/export uses character-owned sprite assets and runtime expression data. | ASSET | both | `packages/client/src/hooks/use-characters.ts`, `packages/server/src/routes/sprites.routes.ts` | `src/features/catalog/characters/components/CharacterSpritesTab.tsx`, `src/features/catalog/sprites/hooks/use-sprites.ts`, `src-tauri/src/commands/storage/sprites.rs` | yes | Refreshed 2026-06-04: refactor better static. Runtime visual proof can be sliced to targets 4/19. | | 05-CHAR-COMPAT-st-charx-import | ST JSON, PNG character cards, and CharX imports normalize card data, embedded lorebooks, regex scripts, tags, and trusted avatar sources. | COMPAT | both | `packages/server/src/services/import/st-character.importer.ts`, `packages/server/src/routes/import.routes.ts` | `src-tauri/src/commands/storage/imports/*`, `src-tauri/src/commands/storage/commands/imports.rs`, `src/features/catalog/characters/hooks/use-character-import-flow.ts` | yes | Refreshed 2026-06-04: refactor better static, including wrong-route rejection, rollback, and untrusted avatar-source denial. | | 05-CHAR-COMPAT-native-marinara-import-export | Native `.marinara` character import/export preserves card data, avatar files, embedded lorebooks, sprites/gallery adjacency, and bulk payloads. | COMPAT | both | `packages/server/src/services/import/marinara.importer.ts`, character export routes | `src-tauri/src/commands/storage/imports/marinara.rs`, `src-tauri/src/commands/storage/exports.rs`, `src-tauri/src/commands/storage/commands/profile.rs` | yes | Closure rescan 2026-06-05: managed gallery export and embedded gallery import materialization are covered by focused Rust gallery tests. | | 05-CHAR-PERF-side-panel-open | Opening the Characters side panel avoids broad editor/import chunks and avoids eager full prompt/book payload/token work. | PERF | both | legacy panel/list implementation | `src/app/shell/RightPanel.tsx`, `src/features/catalog/characters/panel.ts`, `src/features/catalog/characters/hooks/use-characters.ts`, `src/features/catalog/characters/components/CharacterListRow.tsx` | yes | Refreshed 2026-06-04: #1934 and #1999 are closed; current refactor uses a narrow panel entrypoint, lightweight panel summaries, and no compact-row token estimates. | | 05-CHAR-ERROR-import-avatar-rollback | Import failures, malformed files, lorebook failures, unsafe avatar paths, and duplicate cleanup partial success are visible and recoverable. | ERROR | both | `packages/server/src/services/import/*`, legacy import modal | `src-tauri/src/commands/storage/imports/service_tests.rs`, `src/features/catalog/characters/lib/character-import-model.ts`, `src/features/catalog/characters/hooks/use-character-import-flow.ts` | yes | Refreshed 2026-06-04: covered static. | | 05-CHAR-ERROR-avatar-thumbnail-safety | Avatar thumbnails handle managed files and inline legacy avatar data while rejecting unsafe paths/sizes. | ERROR | refactor_only | legacy direct image serving | `src-tauri/src/commands/storage/avatars.rs`, `src/features/catalog/characters/components/CharacterAvatarImage.tsx`, `src/shared/api/avatar-api.ts` | yes | Refreshed 2026-06-04: refactor better static; related #1944 remains closed. | ## Coverage Matrix | Surface ID | Status | Proof | Follow-up | | --- | --- | --- | --- | | 05-CHAR-CONTRACT-card-v2-fields | covered_static | contract/API static trace 2026-06-04 | | | 05-CHAR-CONTRACT-extension-fields | covered_static | contract/API static trace 2026-06-04 | | | 05-CHAR-CONTRACT-character-book | covered_static | contract/API static trace 2026-06-04 | | | 05-CHAR-STORAGE-crud-version-history | refactor_better | storage/performance static trace 2026-06-04; version ordering closure test 2026-06-05 | #2129 closed | | 05-CHAR-STORAGE-summary-projections | refactor_better | storage/performance static trace 2026-06-04 | #1934, #1999 | | 05-CHAR-STORAGE-delete-cascade-assets | refactor_better | storage/performance static trace 2026-06-04 | | | 05-CHAR-API-shared-wrappers | covered_static | contract/API static trace 2026-06-04 | | | 05-CHAR-REMOTE-command-routing | covered_static | contract/API static trace 2026-06-04 | | | 05-CHAR-UI-library-panel-search-groups | covered_static | UI authoring static trace 2026-06-04 | | | 05-CHAR-UI-editor-core-fields | covered_static | UI authoring static trace 2026-06-04; quote-formatting row closed in 2026-06-05 rescan | | | 05-CHAR-UI-editor-extensions | covered_static | UI authoring static trace 2026-06-04; deeper media/runtime proof deferred | | | 05-CHAR-UI-quote-formatting | covered_static | UI authoring static trace 2026-06-04; closure formatter Vitest 2026-06-05 | #2128 closed | | 05-CHAR-UI-create-maker-update | covered_static | UI authoring static trace 2026-06-04 | | | 05-CHAR-UI-import-flow | refactor_better | UI authoring static trace 2026-06-04 | | | 05-CHAR-UI-export-actions | covered_static | UI authoring static trace 2026-06-04 | | | 05-CHAR-UI-export-feedback | covered_static | stale follow-up static trace 2026-06-04 | #2001 | | 05-CHAR-UI-avatar-crop-layout | covered_static | stale follow-up static trace 2026-06-04; browser proof not run | #2003 | | 05-CHAR-UI-schedule-status-controls | covered_static | runtime/mode consumers static trace 2026-06-04 | | | 05-CHAR-RUNTIME-prompt-fields | covered_static | runtime/mode consumers static trace 2026-06-04 | | | 05-CHAR-RUNTIME-status-schedule | covered_static | runtime/mode consumers static trace 2026-06-04 | #1958 | | 05-CHAR-RUNTIME-autonomous-status-delays | covered_static | runtime/mode consumers static trace 2026-06-04; closure generation Vitest 2026-06-05 | #2131 closed | | 05-CHAR-RUNTIME-chat-assignment | covered_static | runtime/mode consumers static trace 2026-06-04 | | | 05-CHAR-RUNTIME-mode-consumers | covered_static_for_character_slice | runtime/mode consumers static trace 2026-06-04; deeper roleplay/game/tracker parity remains target-owned | | | 05-CHAR-ASSET-managed-avatar-flow | refactor_better | assets/compat/error static trace 2026-06-04 | #1960, #1944 | | 05-CHAR-ASSET-gallery-images | refactor_better | assets/compat/error static trace 2026-06-04; closure Rust gallery tests 2026-06-05 | #2130 closed | | 05-CHAR-ASSET-sprite-editor | refactor_better | assets/compat/error static trace 2026-06-04 | | | 05-CHAR-COMPAT-st-charx-import | refactor_better | assets/compat/error static trace 2026-06-04 | | | 05-CHAR-COMPAT-native-marinara-import-export | covered_static | assets/compat/error static trace 2026-06-04; closure Rust gallery tests 2026-06-05 | #2130 closed | | 05-CHAR-PERF-side-panel-open | refactor_better | stale follow-up static trace 2026-06-04 | #1934, #1999 | | 05-CHAR-ERROR-import-avatar-rollback | covered_static | assets/compat/error static trace 2026-06-04 | | | 05-CHAR-ERROR-avatar-thumbnail-safety | refactor_better | assets/compat/error static trace 2026-06-04 | #1944 | ## Follow-Ups | Issue | State | Why it matters | | --- | --- | --- | | #2128 | CLOSED; fixed at `95690e30` | Character editor quote formatting now covers the legacy-covered advanced fields and `depth_prompt.prompt`; focused Vitest passed. | | #2129 | CLOSED; fixed at `95690e30` | Character version history now requests newest-first `createdAt` ordering; focused hook Vitest passed. | | #2130 | CLOSED; fixed at `95690e30` | Native character export/import now preserves managed gallery images through focused Rust gallery coverage. | | #2131 | CLOSED; fixed at `95690e30` | Conversation @mentions/manual character targets now use the short mention delay path while normal replies keep generic busy delays; focused generation Vitest passed. | | #1958 | CLOSED | Schedule updates stored character status outside card extensions. | | #1959 | CLOSED | Original broad character editor quote-formatting gap; later narrow missed-field follow-up #2128 is now closed. | | #1960 | CLOSED | Native character import stored embedded avatar data inline. | | #1934 | CLOSED | Characters side panel first-open performance issue. | | #1944 | CLOSED | Related inline avatar thumbnail issue. | | #1999 | CLOSED | Refreshed character panel first-open performance issue after PR #2005. | | #2001 | CLOSED | Export toast consistency issue covering character single-export feedback. | | #2003 | CLOSED | Character editor Avatar Crop layout stability issue. | ## Rescan Criteria - Latest current-refactor refresh at `95690e30` on 2026-06-05 found #2128, #2129, #2130, and #2131 fixed; no intentional-divergence entry is needed for those rows. - Focused TypeScript proof covered advanced quote formatting, version-history newest-first ordering, mention/manual-target short delays, normal busy delays, offline skip, regenerate exclusion, and mixed mentioned/unmentioned conversation rows. - Focused Rust proof covered managed gallery upload persistence, native character export embedding managed gallery assets, native character import materializing embedded gallery assets as managed files, missing-file skip behavior, and gallery cleanup paths. - Keep #1934, #1999, #2001, and #2003 closed for target 5; the 2026-06-04 stale follow-up refresh found no remaining static blocker in those rows. - Use browser proof before upgrading Avatar Crop layout stability or side-panel first-open performance beyond static coverage. - Deeper roleplay/game/tracker character consumers remain owned by later mode/tracker parity targets unless a new Target 5-owned character blocker appears.
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#1037
No description provided.