[PR #5821] [MERGED] fix(mari): label the Accept action for held edits and offer a decline #6954

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5821
Author: @kolacheee
Created: 9/3/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @kolacheee

Base: staging ← Head: fix/5819-5820-mari-apply-clarity


📝 Commits (2)

  • 7831442 fix(mari): check completion claims mid-run and label the Accept action (#5819, #5820)
  • 78811b9 fix(mari): drop the mid-run claim guard, harden the Accept row (review)

📊 Changes

5 files changed (+106 additions, -7 deletions)

View changed files

📝 CHANGELOG.md (+3 -1)
📝 packages/client/src/components/chat/HomeProfessorMariChat.tsx (+22 -6)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/shared/src/types/professor-mari-workspace.ts (+32 -0)
📝 scripts/regressions/mari-polish.regression.ts (+48 -0)

📄 Description

Linked issue

Closes #5820

(#5819 was in this branch and has been withdrawn — see below.)

Why this change

Mari holds edits for approval and says "hit Accept and I'll apply the changes". The Accept button is genuinely rendered — directly under the caption "Suggestions only. Pick one, or type your own." So the one control that applies her pending edits is explicitly labelled optional, and the reporter's conclusion was the natural one: "I do not see anywhere to apply or revert edits, much less if she even did them."

The diagnostics confirm the engine did its job (held for approval; app_data character.update). Everything worked except telling the user — which means the visible half of the defer-and-approve safety mechanism reads as a failure of it, and likely inflates "she said she did it and nothing happened" reports.

What changed

  • The caption tells the truth. When the row carries a held-change approval it now reads that Mari is waiting and nothing has been changed yet, instead of calling itself a suggestion.
  • Declining is a click. A Don't apply chip sits beside Accept, so refusing no longer means composing a sentence — the "or revert" half of the report.
  • Both paths pair the two. The decline action reaches the live deferral (where the server pushes the Accept chip itself) as well as the reload-derived path, via a shared withHeldChangeDeclineChip.
  • Id collision handled. The agent reuses the id authorization-accept for an unrelated output-limit chip ("Continue the task."). A shared isMariHeldChangeApprovalChip matches id and prompt, so the approval wording and the decline action never appear on a row where nothing is held.

On #5819 (withdrawn from this PR)

This branch originally also extended the completion-claim guard to mid-run frames. An adversarial review showed that fix was both incomplete and unsafe, so it is reverted rather than shipped:

  • resolveWorkspaceMutationVerification collapses the whole run into one verdict, so once any create succeeds the aggregate reads verified and every later false claim in the batch passes. It therefore only caught runs where nothing applied — not the reported symptom of a partially successful batch.
  • It could cause duplicates: the mid-run coaching said "carry out that step now" without the read-first wording its terminal twin uses, and commandResultsForContinuity is per-run, so a continuation run accurately recapping earlier work resolved to none and was told to redo it.

A correct fix needs step-scoped auditing (a watermark over results since the last audited claim), read-first coaching, and continuation handling. Findings are posted on #5819.

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

  • Passing locally: mari-polish (new pins for the caption predicate, both decline call sites, and the id-collision guard), plus prompt, mari-ask-latch, mari-write-readback; both package lints; check-locales; pnpm build.
  • Manual browser pass still wanted, since this is a UI-wording change: ask Mari to edit a character so she holds the change, and confirm the row says she is waiting with nothing applied, that Don't apply appears beside Accept without reloading, and that after a reload both are still there. Also worth confirming the output-limit "Accept / Continue the task." row still reads as suggestions rather than an approval prompt.

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 (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Screenshots in #5820 show the current misleading caption; the manual pass above covers the corrected row.

Summary by CodeRabbit

  • New Features

    • Added a Don’t apply option alongside Accept for Professor Mari changes awaiting approval.
    • Added a clear status message explaining that no changes have been applied and outlining the available actions.
  • Bug Fixes

    • Professor Mari approval controls are no longer presented as generic suggestions.
    • Accept and Don’t apply actions now submit immediately instead of filling the message composer.

🔄 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/5821 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 9/3/2026 **Status:** ✅ Merged **Merged:** 9/3/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/5819-5820-mari-apply-clarity` --- ### 📝 Commits (2) - [`7831442`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7831442a52a0953a0a909eebf286d114afdfb89e) fix(mari): check completion claims mid-run and label the Accept action (#5819, #5820) - [`78811b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78811b9e31b9f717b1ed62019b5fba98fa2d7bf8) fix(mari): drop the mid-run claim guard, harden the Accept row (review) ### 📊 Changes **5 files changed** (+106 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -1) 📝 `packages/client/src/components/chat/HomeProfessorMariChat.tsx` (+22 -6) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/shared/src/types/professor-mari-workspace.ts` (+32 -0) 📝 `scripts/regressions/mari-polish.regression.ts` (+48 -0) </details> ### 📄 Description ## Linked issue Closes #5820 (#5819 was in this branch and has been **withdrawn** — see below.) ## Why this change Mari holds edits for approval and says "hit Accept and I'll apply the changes". The Accept button is genuinely rendered — directly under the caption **"Suggestions only. Pick one, or type your own."** So the one control that applies her pending edits is explicitly labelled optional, and the reporter's conclusion was the natural one: *"I do not see anywhere to apply or revert edits, much less if she even did them."* The diagnostics confirm the engine did its job (`held for approval; app_data character.update`). Everything worked except telling the user — which means the visible half of the defer-and-approve safety mechanism reads as a failure of it, and likely inflates "she said she did it and nothing happened" reports. ## What changed - **The caption tells the truth.** When the row carries a held-change approval it now reads that Mari is waiting and *nothing has been changed yet*, instead of calling itself a suggestion. - **Declining is a click.** A `Don't apply` chip sits beside Accept, so refusing no longer means composing a sentence — the "or revert" half of the report. - **Both paths pair the two.** The decline action reaches the live deferral (where the server pushes the Accept chip itself) as well as the reload-derived path, via a shared `withHeldChangeDeclineChip`. - **Id collision handled.** The agent reuses the id `authorization-accept` for an unrelated output-limit chip (`"Continue the task."`). A shared `isMariHeldChangeApprovalChip` matches id **and** prompt, so the approval wording and the decline action never appear on a row where nothing is held. ## On #5819 (withdrawn from this PR) This branch originally also extended the completion-claim guard to mid-run frames. An adversarial review showed that fix was both incomplete and unsafe, so it is reverted rather than shipped: - `resolveWorkspaceMutationVerification` collapses the **whole run** into one verdict, so once any create succeeds the aggregate reads `verified` and every later false claim in the batch passes. It therefore only caught runs where *nothing* applied — not the reported symptom of a partially successful batch. - It could cause **duplicates**: the mid-run coaching said "carry out that step now" without the read-first wording its terminal twin uses, and `commandResultsForContinuity` is per-run, so a continuation run accurately recapping earlier work resolved to `none` and was told to redo it. A correct fix needs step-scoped auditing (a watermark over results since the last audited claim), read-first coaching, and continuation handling. Findings are posted on #5819. ## 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 - Passing locally: `mari-polish` (new pins for the caption predicate, both decline call sites, and the id-collision guard), plus `prompt`, `mari-ask-latch`, `mari-write-readback`; both package lints; `check-locales`; `pnpm build`. - **Manual browser pass still wanted**, since this is a UI-wording change: ask Mari to edit a character so she holds the change, and confirm the row says she is waiting with nothing applied, that `Don't apply` appears beside Accept **without reloading**, and that after a reload both are still there. Also worth confirming the output-limit "Accept / Continue the task." row still reads as suggestions rather than an approval prompt. ## Docs and release impact - [ ] No docs changes needed - [x] 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 (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Screenshots in #5820 show the current misleading caption; the manual pass above covers the corrected row. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a **Don’t apply** option alongside **Accept** for Professor Mari changes awaiting approval. - Added a clear status message explaining that no changes have been applied and outlining the available actions. - **Bug Fixes** - Professor Mari approval controls are no longer presented as generic suggestions. - Accept and Don’t apply actions now submit immediately instead of filling the message composer. <!-- 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:15:11 +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#6954
No description provided.