[PR #8725] [MERGED] fix(mari): keep text-only answers instead of replacing them over claim wording #8769

Closed
opened 2026-11-07 17:39:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8725
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/8711-mari-claim-audit-false-positives


📝 Commits (5)

  • f5bffbb fix(mari): stop claim audits discarding text-only answers (#8711)
  • 8f92035 fix(mari): catch real held and completion claims again (#8711)
  • 7fc99d3 fix(mari): keep a flagged reply when the run changed nothing (#8711)
  • 7abcfb4 fix(mari): keep closing answers of no-change runs, with a notice flag (#8711)
  • 1000ca9 fix(mari): a replaced reply drops its notice; single quotes are never stripped (#8711)

📊 Changes

12 files changed (+562 additions, -60 deletions)

View changed files

📝 packages/client/src/components/chat/mari/CompactMariMessage.tsx (+13 -1)
📝 packages/client/src/components/chat/mari/MariTranscript.tsx (+2 -1)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/server/src/services/professor-mari/pi-runtime.ts (+36 -9)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+66 -13)
📝 packages/server/src/services/professor-mari/workspace-message-store.ts (+3 -0)
📝 packages/server/src/services/professor-mari/workspace-round-review.ts (+42 -2)
📝 packages/shared/src/types/chat.ts (+5 -0)
📝 packages/shared/src/types/professor-mari-workspace.ts (+10 -2)
📝 scripts/regressions/professor-mari/mari-send-now.regression.ts (+19 -0)
📝 scripts/regressions/professor-mari/pi-runtime.regression.ts (+219 -31)
📝 scripts/regressions/professor-mari/round-review.regression.ts (+146 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8711

Why this change

Professor Mari's completion-claim and held-change checks read her reply's wording, and could throw away a text-only answer. A draft list with "a lantern that is created", a quoted example, a code block, or an explanation of how change cards work was enough. The answer was replaced by a hidden repair, or by the canned "I did not make or hold any change." The user lost what they asked for. Explaining the problem tended to trip the check again.

Narrowing the phrase checks always traded false positives for missed real claims; three review rounds confirmed it. So this changes what happens when a check fires, as the issue's Expected behaviour asks: keep the original content and show a warning instead of replacing it.

What changed

  • Closing answers of runs that changed nothing keep their words. A closing answer is a round with no commands besides chips, a question card or the to-do list.
    • When the run tried no change and a check flags the words, they are kept exactly. No hidden repair is sent, no repair budget is spent, and the canned line is not used.
    • The reply carries a mariNothingChanged flag. The client shows it as a localized note, mari.reply.nothingChanged, through the existing MariNote (role="status").
    • The note is never part of Mari's text and never in the history sent back to the model.
    • The flag stays with the words it was raised for: a Send now checkpoint gets its own, and words a later round sets drop it.
  • Everything else is unchanged. Mid-run narration beside real commands, and any run that tried a change, are repaired as on staging. A run tried a change if it made one, previewed one, held one, set one aside beside a question, had one rejected by the protocol, or ran any shell command.
  • The checks read only her own prose. They skip closed code fences, inline code, blockquote lines and double or curly quoted phrases within one sentence.
    • Single quotes are never skipped; they are too often apostrophes ("'90s", "'em", "the twins'").
    • An unclosed fence hides nothing past its own line.
    • Otherwise the detectors are as strong as on staging.
  • pi's held-change guard is skipped only in runs that tried no change.

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

What the agent ran:

  • node ./scripts/run-regressions.mjs --filter mari: 86/86 pass. prompt.regression.ts and the other claim-audit lanes (chat-sweep, assigned-chat-sweep, connection-account-resolvers) pass too.
  • pnpm check passes (exit 0). The 12 existing client lint warnings are in files this PR doesn't touch.
  • pnpm localization:check passes.
  • The regressions pin, on both runtimes:
    • The issue's false positives keep their text in a closing no-change answer, with no repair request, flagged only when a check fires. These are the 12-item draft list, a closed code block, a quoted example, a blockquote, the change-card explanation and step 5.
    • Real false claims keep their text and carry the flag: "Done! Your greeting has been updated.", "Yes, it's saved.", "Sure, I've staged the rename for your review.".
    • A mid-run "I've created entry A…" beside a read is repaired.
    • Runs with a shell command, a failed edit or a held write are repaired as on staging.
    • The note is absent from the next run's model history.
    • Send now gives the flag only to the flagged checkpoint reply.
    • An unclosed fence and apostrophe sentences ("The '90s theme is set for the twins'.") are still caught.
    • Flagged words that a later pi round replaces save no flag.
  • Several regressions fail on staging. A mutation check shows that disabling the notice rule fails the pi-runtime regression.
  • CodeRabbit raised 0 findings on the first commit.
  • Three rounds of independent review with adversarial verification shaped the final contract; the last two blockers they found are fixed in the final commit.

Manual verification notes

  • Manually verify in Professor Mari: ask for "a list of 12 short item descriptions I can paste into another screen" several times. The list always shows.
  • Manually verify that when the list contains phrases like "is created" or "are saved", it stays whole, with a small "No change was made or held in this reply" note under it.
  • Manually verify that asking whether her reply format could confuse the change-card system gets her explanation, not "I did not make or hold any change."
  • Manually verify that a real change she claims after a failed edit, or with Manual mode holding it, is still corrected as before.
  • Manually verify that the note shows on both runtimes, and after reloading the chat.

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)

docs/home/professor-mari.md doesn't describe the claim checks.

🤖 Generated with Claude Code


🔄 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/8725 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/3/2026 **Status:** ✅ Merged **Merged:** 11/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/8711-mari-claim-audit-false-positives` --- ### 📝 Commits (5) - [`f5bffbb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f5bffbbf9398fd68c0b83da9776465e5ef71bdb0) fix(mari): stop claim audits discarding text-only answers (#8711) - [`8f92035`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8f920358dcaa7442150ca4d8d55c1a1831b811c7) fix(mari): catch real held and completion claims again (#8711) - [`7fc99d3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7fc99d36f1119b6b3cb3664abd3123d9918743de) fix(mari): keep a flagged reply when the run changed nothing (#8711) - [`7abcfb4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7abcfb4b4f6169d74741f42f4802366eac044ab7) fix(mari): keep closing answers of no-change runs, with a notice flag (#8711) - [`1000ca9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1000ca9aa66b7ab7fd29b3986d90c61a36f02b41) fix(mari): a replaced reply drops its notice; single quotes are never stripped (#8711) ### 📊 Changes **12 files changed** (+562 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/mari/CompactMariMessage.tsx` (+13 -1) 📝 `packages/client/src/components/chat/mari/MariTranscript.tsx` (+2 -1) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/server/src/services/professor-mari/pi-runtime.ts` (+36 -9) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+66 -13) 📝 `packages/server/src/services/professor-mari/workspace-message-store.ts` (+3 -0) 📝 `packages/server/src/services/professor-mari/workspace-round-review.ts` (+42 -2) 📝 `packages/shared/src/types/chat.ts` (+5 -0) 📝 `packages/shared/src/types/professor-mari-workspace.ts` (+10 -2) 📝 `scripts/regressions/professor-mari/mari-send-now.regression.ts` (+19 -0) 📝 `scripts/regressions/professor-mari/pi-runtime.regression.ts` (+219 -31) 📝 `scripts/regressions/professor-mari/round-review.regression.ts` (+146 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8711 ## Why this change Professor Mari's completion-claim and held-change checks read her reply's wording, and could throw away a text-only answer. A draft list with "a lantern that is created", a quoted example, a code block, or an explanation of how change cards work was enough. The answer was replaced by a hidden repair, or by the canned "I did not make or hold any change." The user lost what they asked for. Explaining the problem tended to trip the check again. Narrowing the phrase checks always traded false positives for missed real claims; three review rounds confirmed it. So this changes what happens when a check fires, as the issue's Expected behaviour asks: keep the original content and show a warning instead of replacing it. ## What changed - **Closing answers of runs that changed nothing keep their words.** A closing answer is a round with no commands besides chips, a question card or the to-do list. - When the run tried no change and a check flags the words, they are kept exactly. No hidden repair is sent, no repair budget is spent, and the canned line is not used. - The reply carries a `mariNothingChanged` flag. The client shows it as a localized note, `mari.reply.nothingChanged`, through the existing `MariNote` (`role="status"`). - The note is never part of Mari's text and never in the history sent back to the model. - The flag stays with the words it was raised for: a Send now checkpoint gets its own, and words a later round sets drop it. - **Everything else is unchanged.** Mid-run narration beside real commands, and any run that tried a change, are repaired as on `staging`. A run tried a change if it made one, previewed one, held one, set one aside beside a question, had one rejected by the protocol, or ran any shell command. - **The checks read only her own prose.** They skip closed code fences, inline code, blockquote lines and double or curly quoted phrases within one sentence. - Single quotes are never skipped; they are too often apostrophes ("'90s", "'em", "the twins'"). - An unclosed fence hides nothing past its own line. - Otherwise the detectors are as strong as on `staging`. - **pi's held-change guard** is skipped only in runs that tried no change. ## 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` What the agent ran: - `node ./scripts/run-regressions.mjs --filter mari`: 86/86 pass. `prompt.regression.ts` and the other claim-audit lanes (chat-sweep, assigned-chat-sweep, connection-account-resolvers) pass too. - `pnpm check` passes (exit 0). The 12 existing client lint warnings are in files this PR doesn't touch. - `pnpm localization:check` passes. - The regressions pin, on both runtimes: - The issue's false positives keep their text in a closing no-change answer, with no repair request, flagged only when a check fires. These are the 12-item draft list, a closed code block, a quoted example, a blockquote, the change-card explanation and step 5. - Real false claims keep their text and carry the flag: "Done! Your greeting has been updated.", "Yes, it's saved.", "Sure, I've staged the rename for your review.". - A mid-run "I've created entry A…" beside a read is repaired. - Runs with a shell command, a failed edit or a held write are repaired as on `staging`. - The note is absent from the next run's model history. - Send now gives the flag only to the flagged checkpoint reply. - An unclosed fence and apostrophe sentences ("The '90s theme is set for the twins'.") are still caught. - Flagged words that a later pi round replaces save no flag. - Several regressions fail on `staging`. A mutation check shows that disabling the notice rule fails the pi-runtime regression. - CodeRabbit raised 0 findings on the first commit. - Three rounds of independent review with adversarial verification shaped the final contract; the last two blockers they found are fixed in the final commit. ### Manual verification notes - Manually verify in Professor Mari: ask for "a list of 12 short item descriptions I can paste into another screen" several times. The list always shows. - Manually verify that when the list contains phrases like "is created" or "are saved", it stays whole, with a small "No change was made or held in this reply" note under it. - Manually verify that asking whether her reply format could confuse the change-card system gets her explanation, not "I did not make or hold any change." - Manually verify that a real change she claims after a failed edit, or with Manual mode holding it, is still corrected as before. - Manually verify that the note shows on both runtimes, and after reloading the chat. ## 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) `docs/home/professor-mari.md` doesn't describe the claim checks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:33 +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#8769
No description provided.