[PR #5530] [MERGED] fix(mari): stop false-positive Mutation blocked on character create & update #6800

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

📋 Pull Request Information

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

Base: staging ← Head: fix/mari-mutation-authorization-scope


📝 Commits (6)

  • 051c1c2 fix(mari): scope mutation authorization to the full active user turn
  • 5e50b13 fix: add .playwright-mcp to .gitignore
  • a37247b fix(mari): recognize German mutation verbs and ignore quoted card dialogue in denial check
  • 5d6c6b4 fix(mari): window the denial check on long pasted messages
  • c5396cc Merge branch 'staging' into fix/mari-mutation-authorization-scope
  • a33673a Merge branch 'staging' into fix/mari-mutation-authorization-scope

📊 Changes

4 files changed (+483 additions, -15 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 CHANGELOG.md (+6 -5)
📝 e2e/core-flows.e2e.ts (+374 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+100 -10)

📄 Description

Linked issue

Closes #

Why this change

Professor Mari's mutation-authorization gate (workspaceMutationAuthorizationIssue) falsely
blocked legitimate character/persona create and update requests, forcing repeated manual
"yes, create it" confirmations or failing outright. Reproduced live against a real session:
pasting a full German-language character card ("Erstelle mir aus dem Juli...") got rejected
with "Mutation blocked before execution" on the very first attempt, every time.

What changed

  • The generic-authorization scope no longer narrows to a valid-but-incomplete model-quoted
    excerpt (e.g. just the character's name) or lets the word "authorized" anywhere in a long
    pasted document force a false multi-category mismatch; it now falls back to the full active
    user turn.
  • Added German verb equivalents to the create/update/delete/move/copy/install intent patterns
    (erstelle/ändere/aktualisiere/lösche/...), via a Unicode-letter boundary helper, since a plain
    \b fails at the edges of umlaut-initial/umlaut-final German words (e.g. "ändern").
  • The denial check no longer reads quoted example dialogue ("Don't tell me it's nothing.") or a
    narrative sentence deep inside a long pasted card ("Juli should never feel like a quest
    objective.") as the user denying the change: quoted spans are stripped, and long messages
    (>500 chars) are only checked at their leading/trailing 220-char edges.
  • Added 3 e2e regressions in e2e/core-flows.e2e.ts that drive the real server plus a mocked
    local LLM connection: false-positive create via a narrow authorization quote, a German
    instruction with a card containing quoted/narrative denial-like text, and confirmation that
    the multi-category guard still blocks a genuinely conflicting authorization.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran the app locally on this branch and reproduced the original failure, then repeated the
    exact same input (German instruction + pasted character card) after the fix: character
    creation now succeeds immediately, with no "Mutation blocked" message and no extra
    confirmation step required.
  • Also ran pnpm regression:prompt and the issue-sweep-5380-5434 regression (existing
    authorization coverage, unaffected) and the 3 new Playwright e2e tests on both
    desktop-chromium and mobile-chromium projects — all green.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

N/A — server-side authorization-logic fix, no UI changes.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Professor Mari authorization handling for incomplete quoted requests and German instructions.
    • Prevented pasted character cards, example dialogues, and unrelated narrative text from authorizing unintended actions.
    • Improved denial detection in long requests while preserving valid authorization decisions.
    • Fixed capability-package validation and tracker output handling.
  • Tests

    • Added end-to-end coverage for authorized and blocked character-creation scenarios.
  • Chores

    • Updated release documentation and development-tool exclusions.

🔄 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/5530 **Author:** [@Kranael](https://github.com/Kranael) **Created:** 8/25/2026 **Status:** ✅ Merged **Merged:** 8/25/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/mari-mutation-authorization-scope` --- ### 📝 Commits (6) - [`051c1c2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/051c1c2cece291fdcb54e023fbd1033f4e50bef6) fix(mari): scope mutation authorization to the full active user turn - [`5e50b13`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5e50b1313d0339da522af5e835260e5285acc7b1) fix: add .playwright-mcp to .gitignore - [`a37247b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a37247bc7f3685fba7f0149e26b0c04febc1d315) fix(mari): recognize German mutation verbs and ignore quoted card dialogue in denial check - [`5d6c6b4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5d6c6b44d422095a8c70c0d96a05bc884a25686f) fix(mari): window the denial check on long pasted messages - [`c5396cc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c5396cc35e4a985a738d0eaa0aafca54a5cf7093) Merge branch 'staging' into fix/mari-mutation-authorization-scope - [`a33673a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a33673af6a93d51c5b4b2a2eae4055490f873a67) Merge branch 'staging' into fix/mari-mutation-authorization-scope ### 📊 Changes **4 files changed** (+483 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `CHANGELOG.md` (+6 -5) 📝 `e2e/core-flows.e2e.ts` (+374 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+100 -10) </details> ### 📄 Description ## Linked issue Closes # <!-- No existing issue for this yet — per CONTRIBUTING.md, one should be opened before merge. --> ## Why this change Professor Mari's mutation-authorization gate (`workspaceMutationAuthorizationIssue`) falsely blocked legitimate character/persona create and update requests, forcing repeated manual "yes, create it" confirmations or failing outright. Reproduced live against a real session: pasting a full German-language character card ("Erstelle mir aus dem Juli...") got rejected with "Mutation blocked before execution" on the very first attempt, every time. ## What changed - The generic-authorization scope no longer narrows to a valid-but-incomplete model-quoted excerpt (e.g. just the character's name) or lets the word "authorized" anywhere in a long pasted document force a false multi-category mismatch; it now falls back to the full active user turn. - Added German verb equivalents to the create/update/delete/move/copy/install intent patterns (erstelle/ändere/aktualisiere/lösche/...), via a Unicode-letter boundary helper, since a plain `\b` fails at the edges of umlaut-initial/umlaut-final German words (e.g. "ändern"). - The denial check no longer reads quoted example dialogue ("Don't tell me it's nothing.") or a narrative sentence deep inside a long pasted card ("Juli should never feel like a quest objective.") as the user denying the change: quoted spans are stripped, and long messages (>500 chars) are only checked at their leading/trailing 220-char edges. - Added 3 e2e regressions in `e2e/core-flows.e2e.ts` that drive the real server plus a mocked local LLM connection: false-positive create via a narrow authorization quote, a German instruction with a card containing quoted/narrative denial-like text, and confirmation that the multi-category guard still blocks a genuinely conflicting authorization. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Ran the app locally on this branch and reproduced the original failure, then repeated the exact same input (German instruction + pasted character card) after the fix: character creation now succeeds immediately, with no "Mutation blocked" message and no extra confirmation step required. - Also ran `pnpm regression:prompt` and the `issue-sweep-5380-5434` regression (existing authorization coverage, unaffected) and the 3 new Playwright e2e tests on both desktop-chromium and mobile-chromium projects — all green. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A — server-side authorization-logic fix, no UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved Professor Mari authorization handling for incomplete quoted requests and German instructions. * Prevented pasted character cards, example dialogues, and unrelated narrative text from authorizing unintended actions. * Improved denial detection in long requests while preserving valid authorization decisions. * Fixed capability-package validation and tracker output handling. * **Tests** * Added end-to-end coverage for authorized and blocked character-creation scenarios. * **Chores** * Updated release documentation and development-tool exclusions. <!-- 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:13:49 +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#6800
No description provided.