[PR #5207] [MERGED] feat: improve card versioning, Beholder state, Termux logs, and TTS #6674

Closed
opened 2026-10-23 04:12:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5207
Author: @SpicyMarinara
Created: 8/17/2026
Status: ✅ Merged
Merged: 8/17/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/assigned-5202-5204


📝 Commits (10+)

  • 1a66b12 chore: start assigned issue sweep
  • 0b4ebe6 feat: improve card versioning and Beholder state updates
  • df577e5 test: keep persona exports and source checks portable
  • a462903 Revert "test: keep persona exports and source checks portable"
  • 6d76c75 test: keep persona exports and source checks portable
  • f11d680 fix: normalize persona versioning exports
  • 365f628 test: expect avatar revision bumps
  • 6431e23 fix: capture complete Termux launcher logs
  • ec4c658 fix: preserve speaker extractor voice routing
  • ee98729 fix: apply CodeRabbit review findings

📊 Changes

31 files changed (+806 additions, -121 deletions)

View changed files

📝 CHANGELOG.md (+5 -0)
📝 e2e/core-flows.e2e.ts (+3 -2)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+40 -7)
📝 packages/client/src/components/chat/ChatArea.tsx (+7 -9)
📝 packages/client/src/components/personas/PersonaEditor.tsx (+48 -9)
📝 packages/client/src/lib/tts-dialogue.ts (+24 -1)
📝 packages/client/src/lib/tts-roleplay-speaker-extractor.ts (+1 -0)
📝 packages/client/src/localization/locales/en.json (+4 -2)
📝 packages/client/src/localization/locales/ko.json (+2 -2)
📝 packages/client/src/localization/locales/zh-Hans.json (+2 -2)
📝 packages/server/src/db/schema/characters.ts (+2 -0)
📝 packages/server/src/routes/backup.routes.ts (+2 -0)
📝 packages/server/src/routes/characters.routes.ts (+4 -1)
📝 packages/server/src/routes/tts.routes.ts (+9 -1)
📝 packages/server/src/services/agents/agent-executor.ts (+31 -16)
📝 packages/server/src/services/agents/beholder-state.ts (+212 -0)
📝 packages/server/src/services/import/marinara.importer.ts (+1 -0)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+7 -0)
📝 packages/server/src/services/personas/persona-projector.ts (+2 -0)
📝 packages/server/src/services/storage/characters.storage.ts (+93 -12)

...and 11 more files

📄 Description

Linked issues

Closes #5202.
Closes #5208.
Closes #5210.
Addresses the Engine-owned portion of #5204.

Why this change

Character and Persona card versions required manual maintenance, Beholder could not safely consume its newer delta-state response contract without losing prior state, Termux launcher crashes could occur before diagnostics existed, and Roleplay speaker extraction could hide its provider output and misroute decorated known-character labels through Random NPC Voice.

What changed

  • Start new Character and Persona cards at version 1.0 with automatic versioning enabled by default.
  • Add localized editor switches so automatic versioning can be disabled per card.
  • Bump enabled card versions for saved edits and avatar replacements while preserving explicit imported versions.
  • Carry the versioning preference through imports, exports, backups, conversions, and Professor Mari database actions.
  • Send Beholder the active Persona as self, all prior state on every run, and temperature 0.
  • Accept legacy full snapshots plus the new unchanged/delta response forms, merge deltas without dropping omitted state, and retain the last valid state after unusable output.
  • Start the persistent Termux session log before update, dependency, and build work so pre-server crashes leave diagnostics too, while retaining the server's real exit status.
  • Log the Roleplay speaker extractor's raw provider response in debug mode, tell it which character owns the current reply for ambiguous lines, and resolve harmless speaker-label decoration to a unique known character before falling back to Random NPC Voice.
  • Add release notes and regression coverage for the storage, export, prompt, parsing, merge, logging, and TTS voice-routing contracts.

The separate Marinara-Agents prompt update remains blocked on the canonical, uncorrupted EXTRACTION_SYSTEM_4K source described in #5204. This PR does not invent or silently truncate that package-owned prompt.

Automated evidence

  • pnpm check passed.
  • pnpm regression passed: 126/126 suites.
  • pnpm regression:launcher-update passed.
  • The focused TTS source-persistence regression passed, including decorated Maukie routing with Random NPC Voice enabled.
  • The affected Character/Persona Playwright case passed in both desktop and mobile Chromium: 2/2.

Manual verification

  • Verify automatic versioning controls and revision bumps in the Character editor.
  • Verify automatic versioning controls and revision bumps in the Persona editor.
  • Verify Beholder unchanged and delta responses in a Roleplay chat.
  • Verify a Termux launch creates its timestamped log before update/build work begins.
  • Verify speaker-extractor debug output is printed and Maukie's assigned voice wins for a Maukie-authored Roleplay reply.

All validation boxes are intentionally left for human verification.

Summary by CodeRabbit

  • New Features
    • Added automatic versioning controls for character and persona cards.
    • Card edits can create revision snapshots and increment versions automatically; resets now start at 1.0.
    • Versioning preferences are preserved during imports, exports, duplication, and restoration.
    • Improved Beholder state updates with delta handling and safe fallback behavior.
    • Improved roleplay speaker attribution for text-to-speech, including decorated names and message authors.
    • Added persistent Termux session logging with cleanup and exit-status reporting.
  • Bug Fixes
    • Improved handling of ambiguous or missing roleplay speaker matches.

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

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5207 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/17/2026 **Status:** ✅ Merged **Merged:** 8/17/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/assigned-5202-5204` --- ### 📝 Commits (10+) - [`1a66b12`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a66b12d879655e75226866c4c4786b30f43e826) chore: start assigned issue sweep - [`0b4ebe6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b4ebe693b370575f1b4d5b78f2e11f0fdd9012d) feat: improve card versioning and Beholder state updates - [`df577e5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/df577e59f85e0c0f3c0381691ec9ba5676f18ac0) test: keep persona exports and source checks portable - [`a462903`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a462903b86e84eef710833144ec17fd87185cd1b) Revert "test: keep persona exports and source checks portable" - [`6d76c75`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6d76c756e743e19eb6fb5d928d55236ed1447d76) test: keep persona exports and source checks portable - [`f11d680`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f11d680f4d2c398c20401e7d3a0286b1449818e8) fix: normalize persona versioning exports - [`365f628`](https://github.com/Pasta-Devs/Marinara-Engine/commit/365f628688289f1d4b74ab4c8af002568aa9406e) test: expect avatar revision bumps - [`6431e23`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6431e23be2f04c7050ea57248d4b03663d7a7d75) fix: capture complete Termux launcher logs - [`ec4c658`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec4c65860f62dd15b47164c875eba2813dc2f887) fix: preserve speaker extractor voice routing - [`ee98729`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ee9872909e898b67393f9589035508d739748f7c) fix: apply CodeRabbit review findings ### 📊 Changes **31 files changed** (+806 additions, -121 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+5 -0) 📝 `e2e/core-flows.e2e.ts` (+3 -2) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+40 -7) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+7 -9) 📝 `packages/client/src/components/personas/PersonaEditor.tsx` (+48 -9) 📝 `packages/client/src/lib/tts-dialogue.ts` (+24 -1) 📝 `packages/client/src/lib/tts-roleplay-speaker-extractor.ts` (+1 -0) 📝 `packages/client/src/localization/locales/en.json` (+4 -2) 📝 `packages/client/src/localization/locales/ko.json` (+2 -2) 📝 `packages/client/src/localization/locales/zh-Hans.json` (+2 -2) 📝 `packages/server/src/db/schema/characters.ts` (+2 -0) 📝 `packages/server/src/routes/backup.routes.ts` (+2 -0) 📝 `packages/server/src/routes/characters.routes.ts` (+4 -1) 📝 `packages/server/src/routes/tts.routes.ts` (+9 -1) 📝 `packages/server/src/services/agents/agent-executor.ts` (+31 -16) 📝 `packages/server/src/services/agents/beholder-state.ts` (+212 -0) 📝 `packages/server/src/services/import/marinara.importer.ts` (+1 -0) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+7 -0) 📝 `packages/server/src/services/personas/persona-projector.ts` (+2 -0) 📝 `packages/server/src/services/storage/characters.storage.ts` (+93 -12) _...and 11 more files_ </details> ### 📄 Description ## Linked issues Closes #5202. Closes #5208. Closes #5210. Addresses the Engine-owned portion of #5204. ## Why this change Character and Persona card versions required manual maintenance, Beholder could not safely consume its newer delta-state response contract without losing prior state, Termux launcher crashes could occur before diagnostics existed, and Roleplay speaker extraction could hide its provider output and misroute decorated known-character labels through Random NPC Voice. ## What changed - Start new Character and Persona cards at version 1.0 with automatic versioning enabled by default. - Add localized editor switches so automatic versioning can be disabled per card. - Bump enabled card versions for saved edits and avatar replacements while preserving explicit imported versions. - Carry the versioning preference through imports, exports, backups, conversions, and Professor Mari database actions. - Send Beholder the active Persona as `self`, all prior state on every run, and temperature 0. - Accept legacy full snapshots plus the new unchanged/delta response forms, merge deltas without dropping omitted state, and retain the last valid state after unusable output. - Start the persistent Termux session log before update, dependency, and build work so pre-server crashes leave diagnostics too, while retaining the server's real exit status. - Log the Roleplay speaker extractor's raw provider response in debug mode, tell it which character owns the current reply for ambiguous lines, and resolve harmless speaker-label decoration to a unique known character before falling back to Random NPC Voice. - Add release notes and regression coverage for the storage, export, prompt, parsing, merge, logging, and TTS voice-routing contracts. The separate Marinara-Agents prompt update remains blocked on the canonical, uncorrupted `EXTRACTION_SYSTEM_4K` source described in #5204. This PR does not invent or silently truncate that package-owned prompt. ## Automated evidence - `pnpm check` passed. - `pnpm regression` passed: 126/126 suites. - `pnpm regression:launcher-update` passed. - The focused TTS source-persistence regression passed, including decorated `Maukie` routing with Random NPC Voice enabled. - The affected Character/Persona Playwright case passed in both desktop and mobile Chromium: 2/2. ## Manual verification - [ ] Verify automatic versioning controls and revision bumps in the Character editor. - [ ] Verify automatic versioning controls and revision bumps in the Persona editor. - [ ] Verify Beholder unchanged and delta responses in a Roleplay chat. - [ ] Verify a Termux launch creates its timestamped log before update/build work begins. - [ ] Verify speaker-extractor debug output is printed and Maukie's assigned voice wins for a Maukie-authored Roleplay reply. All validation boxes are intentionally left for human verification. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added automatic versioning controls for character and persona cards. - Card edits can create revision snapshots and increment versions automatically; resets now start at `1.0`. - Versioning preferences are preserved during imports, exports, duplication, and restoration. - Improved Beholder state updates with delta handling and safe fallback behavior. - Improved roleplay speaker attribution for text-to-speech, including decorated names and message authors. - Added persistent Termux session logging with cleanup and exit-status reporting. - **Bug Fixes** - Improved handling of ambiguous or missing roleplay speaker matches. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:12:37 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

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