[PR #5037] [MERGED] Fix CSRF, prompt, persona, and regex import regressions #6598

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

📋 Pull Request Information

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

Base: staging ← Head: agent/issue-sweep-5030-5033-5036


📝 Commits (3)

  • 85d129b chore: start remaining issue sweep
  • 8cd2b13 fix: address remaining issue sweep
  • 446272e test: harden issue sweep regressions

📊 Changes

10 files changed (+156 additions, -57 deletions)

View changed files

📝 CHANGELOG.md (+7 -0)
📝 packages/client/src/components/characters/CharacterRegexSection.tsx (+16 -7)
📝 packages/server/src/config/runtime-config.ts (+1 -1)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+1 -0)
📝 packages/server/src/services/prompt/assembler.ts (+0 -14)
📝 packages/server/src/services/prompt/marker-expander.ts (+4 -13)
📝 scripts/regressions/assigned-issue-sweep.regression.ts (+47 -0)
📝 scripts/regressions/mari-db-review-durability.regression.ts (+43 -1)
📝 scripts/regressions/prompt.regression.ts (+26 -21)
📝 scripts/regressions/request-host-security.regression.ts (+11 -0)

📄 Description

Linked issues

Closes #5030
Closes #5031
Closes #5033
Closes #5036

Issue #5032 is already fixed on staging by #5027 and will be closed separately with that proof.

Why this change

The remaining open Engine reports came from four narrow regressions: a deployment sentinel treated as an origin, a prompt fallback overriding preset intent, a missing required persona default, and character-scoped regex imports rejecting otherwise usable entries.

What changed

  • Treat case-insensitive null values in CSRF_TRUSTED_ORIGINS as unset while retaining real origins.
  • Include Example Dialogue only through an enabled Dialogue Examples marker or an explicit Character Info field selection.
  • Supply useCharacterSheetAsReference: "false" when Professor Mari creates a persona.
  • Import character-scoped SillyTavern regexes with their supported placements and show the existing localized warning for ignored placements.
  • Add focused regressions and Unreleased changelog entries for each behavior.

Validation

  • pnpm check passes locally
  • Container build completed
  • Manual browser verification completed
  • Edge cases checked
  • Read and followed CONTRIBUTING.md

Automated evidence

  • pnpm check — passed
  • pnpm regression:request-security — passed
  • pnpm regression:prompt — passed
  • pnpm regression:mari-review-durability — passed
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/assigned-issue-sweep.regression.ts — passed
  • pnpm localization:check — passed
  • git diff --check — passed
  • pnpm smoke:ui — non-gating run stopped after 143 passes because unrelated existing navigation, catalog, Noodle-tour, and Professor Mari mobile tests timed out or failed under the two-worker run; no failure exercised a changed path.

Manual verification notes

  • Manually verify startup with CSRF_TRUSTED_ORIGINS=null.
  • Manually verify removed and disabled Example Dialogue sections stay out of generated prompts.
  • Manually create a persona through Professor Mari and retain it from the review card.
  • Manually import a character-scoped SillyTavern regex containing supported and unsupported placement values and confirm the import plus warning.

Docs and release impact

  • No docs changes needed
  • Updated docs as needed
  • Translated docs updated or follow-up issue opened
  • Version/release files updated if applicable

No user-facing documentation or release metadata changes are required. The Unreleased changelog is updated.

UI evidence

The scoped regex importer reuses the existing amber localized warning treatment from the global regex importer; no visual redesign or new copy was introduced.

Summary by CodeRabbit

  • Bug Fixes

    • Improved CSRF trusted-origin handling by ignoring null values while preserving valid origins.
    • Fixed Example Dialogue behavior so it appears only when explicitly enabled.
    • Newly created personas now use the correct default reference setting.
    • SillyTavern regex imports now succeed despite unsupported placements, with clear warnings shown afterward.
  • Tests

    • Added regression coverage for security settings, dialogue markers, persona creation, and regex import behavior.

🔄 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/5037 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/14/2026 **Status:** ✅ Merged **Merged:** 8/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/issue-sweep-5030-5033-5036` --- ### 📝 Commits (3) - [`85d129b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/85d129b8eec8ed4a92d9feeca24aafbacd63b8cb) chore: start remaining issue sweep - [`8cd2b13`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8cd2b13a862d8de6622a6c2fa925f3a84c01b0cb) fix: address remaining issue sweep - [`446272e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/446272e65959205c4516832124ddb4b22756f4ce) test: harden issue sweep regressions ### 📊 Changes **10 files changed** (+156 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+7 -0) 📝 `packages/client/src/components/characters/CharacterRegexSection.tsx` (+16 -7) 📝 `packages/server/src/config/runtime-config.ts` (+1 -1) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+1 -0) 📝 `packages/server/src/services/prompt/assembler.ts` (+0 -14) 📝 `packages/server/src/services/prompt/marker-expander.ts` (+4 -13) 📝 `scripts/regressions/assigned-issue-sweep.regression.ts` (+47 -0) 📝 `scripts/regressions/mari-db-review-durability.regression.ts` (+43 -1) 📝 `scripts/regressions/prompt.regression.ts` (+26 -21) 📝 `scripts/regressions/request-host-security.regression.ts` (+11 -0) </details> ### 📄 Description ## Linked issues Closes #5030 Closes #5031 Closes #5033 Closes #5036 Issue #5032 is already fixed on staging by #5027 and will be closed separately with that proof. ## Why this change The remaining open Engine reports came from four narrow regressions: a deployment sentinel treated as an origin, a prompt fallback overriding preset intent, a missing required persona default, and character-scoped regex imports rejecting otherwise usable entries. ## What changed - Treat case-insensitive `null` values in `CSRF_TRUSTED_ORIGINS` as unset while retaining real origins. - Include Example Dialogue only through an enabled Dialogue Examples marker or an explicit Character Info field selection. - Supply `useCharacterSheetAsReference: "false"` when Professor Mari creates a persona. - Import character-scoped SillyTavern regexes with their supported placements and show the existing localized warning for ignored placements. - Add focused regressions and Unreleased changelog entries for each behavior. ## Validation - [ ] pnpm check passes locally - [ ] Container build completed - [ ] Manual browser verification completed - [ ] Edge cases checked - [ ] Read and followed CONTRIBUTING.md ### Automated evidence - `pnpm check` — passed - `pnpm regression:request-security` — passed - `pnpm regression:prompt` — passed - `pnpm regression:mari-review-durability` — passed - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/assigned-issue-sweep.regression.ts` — passed - `pnpm localization:check` — passed - `git diff --check` — passed - `pnpm smoke:ui` — non-gating run stopped after 143 passes because unrelated existing navigation, catalog, Noodle-tour, and Professor Mari mobile tests timed out or failed under the two-worker run; no failure exercised a changed path. ### Manual verification notes - Manually verify startup with `CSRF_TRUSTED_ORIGINS=null`. - Manually verify removed and disabled Example Dialogue sections stay out of generated prompts. - Manually create a persona through Professor Mari and retain it from the review card. - Manually import a character-scoped SillyTavern regex containing supported and unsupported placement values and confirm the import plus warning. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs as needed - [ ] Translated docs updated or follow-up issue opened - [ ] Version/release files updated if applicable No user-facing documentation or release metadata changes are required. The Unreleased changelog is updated. ## UI evidence The scoped regex importer reuses the existing amber localized warning treatment from the global regex importer; no visual redesign or new copy was introduced. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved CSRF trusted-origin handling by ignoring `null` values while preserving valid origins. - Fixed Example Dialogue behavior so it appears only when explicitly enabled. - Newly created personas now use the correct default reference setting. - SillyTavern regex imports now succeed despite unsupported placements, with clear warnings shown afterward. - **Tests** - Added regression coverage for security settings, dialogue markers, persona creation, and regex import behavior. <!-- 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:11:56 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

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