[PR #7882] [MERGED] fix(mari): verify Pi mutation claims and add Classic recovery #7982

Closed
opened 2026-10-24 04:09:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7882
Author: @Gunterlie
Created: 10/20/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: the-pi-is-always-with-you


📝 Commits (7)

  • 438ec6f fix(mari): verify mutation claims and default to Pi with recovery
  • a41d209 Merge branch 'staging' into the-pi-is-always-with-you
  • 4fca310 Merge branch 'staging' into the-pi-is-always-with-you
  • e54fb22 fix(mari): require current-scope mutation evidence for self-attributed completion claims
  • 726ab51 Merge branch 'staging' into the-pi-is-always-with-you
  • 93d0f27 fix(mari): allow exact terminal recaps of previously verified completion claims
  • 43a173c Merge branch 'staging' into the-pi-is-always-with-you

📊 Changes

26 files changed (+704 additions, -44 deletions)

View changed files

📝 e2e/chat-diagnose-mari.e2e.ts (+10 -1)
📝 e2e/core-flows.e2e.ts (+8 -0)
➕ e2e/inline-completion.e2e.ts (+36 -0)
📝 e2e/mari-arrival-append.e2e.ts (+4 -0)
📝 e2e/mari-decision-authoring.e2e.ts (+7 -0)
➕ e2e/mari-runtime-recovery.e2e.ts (+109 -0)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+2 -0)
📝 packages/client/src/components/chat/mari/MariComposer.tsx (+7 -0)
➕ packages/client/src/components/chat/mari/MariRuntimeRecovery.tsx (+56 -0)
📝 packages/client/src/components/chat/mari/use-mari-workspace-run.ts (+2 -1)
📝 packages/client/src/lib/inline-completion.ts (+15 -14)
📝 packages/client/src/localization/locales/en.json (+6 -1)
📝 packages/server/src/db/seed-mari.ts (+9 -0)
📝 packages/server/src/routes/professor-mari-workspace.routes.ts (+1 -0)
📝 packages/server/src/services/professor-mari/pi-runtime.ts (+1 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+45 -13)
📝 packages/server/src/services/professor-mari/workspace-round-review.ts (+4 -0)
📝 packages/shared/src/constants/mari-runtime.ts (+3 -3)
📝 packages/shared/src/types/professor-mari-workspace.ts (+2 -0)
➕ scripts/regressions/inline-completion.regression.ts (+19 -0)

...and 6 more files

📄 Description

Linked issue

Closes #7879

Why this change

A read-only Pi run could read Duke Gunterlie, make no deletion call, and still report “I deleted Duke Gunterlie.” The completion audit incorrectly let a successful state read support a claim that Mari performed a mutation. Pi also needs an accessible escape route as it becomes the default.

What changed

  • Pi (experimental) becomes the default for new and existing installs through a one-time rollout. Users can choose Classic afterward and keep that choice across restarts.
  • After three consecutive failed Pi runs, offer “Switch to Classic”; Classic offers “Try Pi again.” Switching preserves the conversation and never automatically resends a request. Success resets the failure count; cancellation does not count.
  • Require an applied mutation before accepting a first-person mutation claim in a read-only run. Preserve ordinary read-only answers and recaps of mutations actually performed in the run.
  • Keep multiword name suggestions visible through spaces, including DC → dc simulator, in both the omnibar and Mari composer.
  • Add real Pi/store regression coverage for 12-entry creation, a manually added existing key, unsupported deletion claims, actual deletion and key removal. Explicitly select Classic in fixtures that return its JSON-frame protocol.

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

Automated local evidence so far:

  • pnpm check passed before the final audit tightening; the final revision is being revalidated.
  • The new Pi regression reproduced the unsupported deletion claim before the fix and passes after it. Real store operations create exactly 12 entries, report the existing wardrobe key as unchanged, and delete Duke plus the requested primary/secondary keys.
  • Runtime rollout/recovery and inline-completion regressions pass; the related Mari regression selection passed 18/18.
  • Focused desktop Chromium browser checks pass at 390, 768 and 1440 pixels, including both switch directions and preserved chat history. Default and SillyTavern light/dark captures were inspected.
  • Mobile Chromium cases pass. WebKit cannot launch on this host because its system libraries are missing.
  • pnpm smoke:ui passed 7/7.
  • Initial local CodeRabbit review found one minor completion-performance issue; fixed by skipping fragments longer than any candidate. Final review is pending.

Manually verify with real providers that Mari follows the requested lorebook edits and accurately reports no-op changes. The original Discord attachment URLs return HTTP 403, so the exact reporter transcript could not be replayed. Manually verify the iOS keyboard and recovery control in Safari.

Docs and release impact

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

No release metadata or user-facing documentation changes. Runtime help text and new recovery labels are localized in the canonical English catalog.

UI evidence (if applicable)

Browser proofs are in e2e/mari-runtime-recovery.e2e.ts and e2e/inline-completion.e2e.ts; they save screenshots of the third-error fallback, Classic recovery and trailing-space name completion. Local captures were inspected at 390/768/1440 pixels and in the default/SillyTavern light/dark themes.

Summary by CodeRabbit

  • New Features

    • Professor Mari now uses the Pi runtime by default, with existing installations migrated on first startup.
    • Added runtime recovery controls that suggest switching to Classic after three consecutive Pi failures, with the option to return to Pi.
    • Runtime changes apply to the next response without resending the current request.
    • Improved inline completion for partial, case-insensitive text and phrases containing spaces.
  • Bug Fixes

    • Runtime status now refreshes after failures, and successful Pi runs reset failure tracking.
    • Conversation history is preserved when switching runtimes.

🔄 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/7882 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/20/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `the-pi-is-always-with-you` --- ### 📝 Commits (7) - [`438ec6f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/438ec6ffb8e9013474ae9dda792d7bc6957b577e) fix(mari): verify mutation claims and default to Pi with recovery - [`a41d209`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a41d209d16efbad7f4cea3cb14b74607d1cddf8a) Merge branch 'staging' into the-pi-is-always-with-you - [`4fca310`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4fca310d2da598df3ad9701d9747be94d5bc7220) Merge branch 'staging' into the-pi-is-always-with-you - [`e54fb22`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e54fb221304d75cb65bbd8e0331da3bf7d64722b) fix(mari): require current-scope mutation evidence for self-attributed completion claims - [`726ab51`](https://github.com/Pasta-Devs/Marinara-Engine/commit/726ab51a99940a327a8679bd1305bb4c1355c240) Merge branch 'staging' into the-pi-is-always-with-you - [`93d0f27`](https://github.com/Pasta-Devs/Marinara-Engine/commit/93d0f27db9f06ffe491f2d50b725fe1f240cfa62) fix(mari): allow exact terminal recaps of previously verified completion claims - [`43a173c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/43a173c19655ea0a723a71513a11b7477bfd72bc) Merge branch 'staging' into the-pi-is-always-with-you ### 📊 Changes **26 files changed** (+704 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `e2e/chat-diagnose-mari.e2e.ts` (+10 -1) 📝 `e2e/core-flows.e2e.ts` (+8 -0) ➕ `e2e/inline-completion.e2e.ts` (+36 -0) 📝 `e2e/mari-arrival-append.e2e.ts` (+4 -0) 📝 `e2e/mari-decision-authoring.e2e.ts` (+7 -0) ➕ `e2e/mari-runtime-recovery.e2e.ts` (+109 -0) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+2 -0) 📝 `packages/client/src/components/chat/mari/MariComposer.tsx` (+7 -0) ➕ `packages/client/src/components/chat/mari/MariRuntimeRecovery.tsx` (+56 -0) 📝 `packages/client/src/components/chat/mari/use-mari-workspace-run.ts` (+2 -1) 📝 `packages/client/src/lib/inline-completion.ts` (+15 -14) 📝 `packages/client/src/localization/locales/en.json` (+6 -1) 📝 `packages/server/src/db/seed-mari.ts` (+9 -0) 📝 `packages/server/src/routes/professor-mari-workspace.routes.ts` (+1 -0) 📝 `packages/server/src/services/professor-mari/pi-runtime.ts` (+1 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+45 -13) 📝 `packages/server/src/services/professor-mari/workspace-round-review.ts` (+4 -0) 📝 `packages/shared/src/constants/mari-runtime.ts` (+3 -3) 📝 `packages/shared/src/types/professor-mari-workspace.ts` (+2 -0) ➕ `scripts/regressions/inline-completion.regression.ts` (+19 -0) _...and 6 more files_ </details> ### 📄 Description ## Linked issue Closes #7879 ## Why this change A read-only Pi run could read Duke Gunterlie, make no deletion call, and still report “I deleted Duke Gunterlie.” The completion audit incorrectly let a successful state read support a claim that Mari performed a mutation. Pi also needs an accessible escape route as it becomes the default. ## What changed - Pi (experimental) becomes the default for new and existing installs through a one-time rollout. Users can choose Classic afterward and keep that choice across restarts. - After three consecutive failed Pi runs, offer “Switch to Classic”; Classic offers “Try Pi again.” Switching preserves the conversation and never automatically resends a request. Success resets the failure count; cancellation does not count. - Require an applied mutation before accepting a first-person mutation claim in a read-only run. Preserve ordinary read-only answers and recaps of mutations actually performed in the run. - Keep multiword name suggestions visible through spaces, including `DC ` → `dc simulator`, in both the omnibar and Mari composer. - Add real Pi/store regression coverage for 12-entry creation, a manually added existing key, unsupported deletion claims, actual deletion and key removal. Explicitly select Classic in fixtures that return its JSON-frame protocol. ## 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 Automated local evidence so far: - `pnpm check` passed before the final audit tightening; the final revision is being revalidated. - The new Pi regression reproduced the unsupported deletion claim before the fix and passes after it. Real store operations create exactly 12 entries, report the existing wardrobe key as unchanged, and delete Duke plus the requested primary/secondary keys. - Runtime rollout/recovery and inline-completion regressions pass; the related Mari regression selection passed 18/18. - Focused desktop Chromium browser checks pass at 390, 768 and 1440 pixels, including both switch directions and preserved chat history. Default and SillyTavern light/dark captures were inspected. - Mobile Chromium cases pass. WebKit cannot launch on this host because its system libraries are missing. - `pnpm smoke:ui` passed 7/7. - Initial local CodeRabbit review found one minor completion-performance issue; fixed by skipping fragments longer than any candidate. Final review is pending. Manually verify with real providers that Mari follows the requested lorebook edits and accurately reports no-op changes. The original Discord attachment URLs return HTTP 403, so the exact reporter transcript could not be replayed. Manually verify the iOS keyboard and recovery control in Safari. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No release metadata or user-facing documentation changes. Runtime help text and new recovery labels are localized in the canonical English catalog. ## UI evidence (if applicable) Browser proofs are in `e2e/mari-runtime-recovery.e2e.ts` and `e2e/inline-completion.e2e.ts`; they save screenshots of the third-error fallback, Classic recovery and trailing-space name completion. Local captures were inspected at 390/768/1440 pixels and in the default/SillyTavern light/dark themes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Professor Mari now uses the Pi runtime by default, with existing installations migrated on first startup. * Added runtime recovery controls that suggest switching to Classic after three consecutive Pi failures, with the option to return to Pi. * Runtime changes apply to the next response without resending the current request. * Improved inline completion for partial, case-insensitive text and phrases containing spaces. * **Bug Fixes** * Runtime status now refreshes after failures, and successful Pi runs reset failure tracking. * Conversation history is preserved when switching runtimes. <!-- 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-24 04:09:22 +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#7982
No description provided.