[GH-ISSUE #5754] Professor Mari verifies her own edit a round late and apologizes for it - the verification read should ride the same frame as the write #3180

Closed
opened 2026-10-21 06:00:18 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @kolacheee on GitHub (Sep 2, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5754

Originally assigned to: @kolacheee on GitHub.

In one sentence: after applying an edit, Professor Mari announces "Oops, my bad! Let me just double-check that the changes actually stuck" and burns an extra round on a verification read — the check itself is a deliberate engine guard, but she runs it a round too late and narrates it as if she made a mistake.

What happened (maintainer playtest, fresh Auto chat, no skills/memories)

User: can you make KZK into a construction worker
Mari: search → read card → "Let's apply this patch." [character.update, apply:true — succeeds]
Mari: "Oops, my bad! Let me just double-check that the changes actually stuck before I call it a day. One sec." [character.get]
Mari: "Alright, read confirmed! The changes stuck perfectly."

From the user's seat this reads as her losing confidence in her own write — "if my boss tells me to change something and I do, I don't roll into his office and go 'wait, oops, lemme check'."

Why it happens — this is the verification guard, working as designed but surfaced badly

There is no read-write gap and nothing went wrong. Two long-standing mechanisms force that read:

  1. The apply-result coaching. Every successful apply:true result ends with "Verify the resulting state with a read command before claiming user-visible success." (compactMutationResult, workspace-agent.service.ts ~:907). Mari reads that after the write lands and complies — in a separate round, narrated apologetically because from her perspective she was just corrected.
  2. The completion-claim interception (backstop). If she instead tries to end the run claiming success, workspaceActionNeedsVerification (~:1797) intercepts the frame and pushes "A mutating workspace command succeeded, but no successful read verified the resulting state. Run a confirmatory read now." — same visible result: an "oops"-flavored extra round.

The guard exists for good reason (writes can silently fail; unverified "done!" claims were a real bug class) and should stay. The problem is when the read happens and how she frames it.

The structural fix is already supported by the engine

resolveWorkspaceMutationVerification (:1765) walks command results in order, and a successful read-only result after the mutation in the same batch counts as verified. So a frame staging [character.update(apply:true), character.get] verifies invisibly — no extra round, no "one sec", no oops. Nothing in the prompt teaches this: every mutating few-shot (:730-746) models write-then-read across separate turns, and the :907 coaching arrives after the batch, when a separate round is the only option left.

Possible directions (maintainer's call)

  • Prompt: teach same-frame write+read — the mutating few-shots include the confirmatory read in the SAME response after the mutating command, with a rule stating commands run in order and a read after the write satisfies verification. Kills a full round-trip and the entire oops-window in the common case.
  • Tone: amend :907 and the interception text to forbid the apology framing — run the read matter-of-factly and present it as the natural completion step ("Applied — verifying… confirmed"), never as correcting a mistake.
  • Keep the interception unchanged as the backstop for frames that skip the read anyway.

Pre-existing behavior — reproduces on staging; unrelated to #5748's ask latch (verified during that investigation: the verification machinery and the :907 text are untouched there).

Originally created by @kolacheee on GitHub (Sep 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5754 Originally assigned to: @kolacheee on GitHub. **In one sentence:** after applying an edit, Professor Mari announces "Oops, my bad! Let me just double-check that the changes actually stuck" and burns an extra round on a verification read — the check itself is a deliberate engine guard, but she runs it a round too late and narrates it as if she made a mistake. ## What happened (maintainer playtest, fresh Auto chat, no skills/memories) > **User:** can you make KZK into a construction worker > Mari: search → read card → "Let's apply this patch." [`character.update`, `apply:true` — succeeds] > Mari: **"Oops, my bad! Let me just double-check that the changes actually stuck before I call it a day. One sec."** [`character.get`] > Mari: "Alright, read confirmed! The changes stuck perfectly." From the user's seat this reads as her losing confidence in her own write — "if my boss tells me to change something and I do, I don't roll into his office and go 'wait, oops, lemme check'." ## Why it happens — this is the verification guard, working as designed but surfaced badly There is no read-write gap and nothing went wrong. Two long-standing mechanisms force that read: 1. **The apply-result coaching.** Every successful `apply:true` result ends with *"Verify the resulting state with a read command before claiming user-visible success."* (`compactMutationResult`, workspace-agent.service.ts ~:907). Mari reads that after the write lands and complies — in a separate round, narrated apologetically because from her perspective she was just corrected. 2. **The completion-claim interception (backstop).** If she instead tries to end the run claiming success, `workspaceActionNeedsVerification` (~:1797) intercepts the frame and pushes *"A mutating workspace command succeeded, but no successful read verified the resulting state. Run a confirmatory read now."* — same visible result: an "oops"-flavored extra round. The guard exists for good reason (writes can silently fail; unverified "done!" claims were a real bug class) and should stay. The problem is **when** the read happens and **how she frames it**. ## The structural fix is already supported by the engine `resolveWorkspaceMutationVerification` (~:1765) walks command results **in order**, and a successful read-only result after the mutation **in the same batch** counts as verified. So a frame staging `[character.update(apply:true), character.get]` verifies invisibly — no extra round, no "one sec", no oops. Nothing in the prompt teaches this: every mutating few-shot (~:730-746) models write-then-read across separate turns, and the :907 coaching arrives after the batch, when a separate round is the only option left. ## Possible directions (maintainer's call) - **Prompt:** teach same-frame write+read — the mutating few-shots include the confirmatory read in the SAME response after the mutating command, with a rule stating commands run in order and a read after the write satisfies verification. Kills a full round-trip and the entire oops-window in the common case. - **Tone:** amend :907 and the interception text to forbid the apology framing — run the read matter-of-factly and present it as the natural completion step ("Applied — verifying… confirmed"), never as correcting a mistake. - Keep the interception unchanged as the backstop for frames that skip the read anyway. Pre-existing behavior — reproduces on staging; unrelated to #5748's ask latch (verified during that investigation: the verification machinery and the :907 text are untouched there).
bsakaguchi 2026-10-21 06:00:18 +07:00
Author
Owner

@kolacheee commented on GitHub (Sep 2, 2026):

Implementation starting (kolacheee, via Claude session) - combined PR with #5752 and #5753 on branch fix/5752-5754-mari-polish.

<!-- gh-comment-id:5504058668 --> @kolacheee commented on GitHub (Sep 2, 2026): Implementation starting (kolacheee, via Claude session) - combined PR with #5752 and #5753 on branch fix/5752-5754-mari-polish.
Author
Owner

@atlasveldine commented on GitHub (Sep 2, 2026):

Perhaps I’m misunderstanding something about Mari’s tool design, but if Mari’s write-enabled tools strictly require a subsequent read after every mutation, is there any actual reason to offload that orchestration step to the LLM…?

The way I see it, it seems as if there’s two reasons for verification:

  1. “Did the write succeed?”
    • Or in other words, did Marinara Engine actually apply the data correctly?
    • If that’s the reason, this should be handled deterministically within Marinara Engine’s code rather than by “asking” (or forcing) the LLM to double-check after the fact.
  2. “Did the LLM apply the intended changes?”
    • Or in other words, did the LLM use the tooling correctly and not accidentally wipe portions of the data?
    • If that’s the reason, where the LLM genuinely needs to inspect the outcome to confirm correctness, wouldn't it be significantly faster (and cheaper, too) to just have Mari’s write-enabled tools return the updated state directly in its tool result?

Correct me if I’m wrong, but it sounds to me like right now, write-type tools return success: true (or something like it), with a note appended that prompts the model to manually call a read-type tool to “verify,” then an intercept that forces the model to continue if it fails to do so. This introduces potentially multiple unnecessary round-trips, increasing API costs for something which we already know Mari needed to have access to back when she originally ran the write-type tool call in the first place.

If write tools were to instead simply return the new state directly, along with a note telling the LLM to verify against what it intended the output to be, Mari would get immediate visibility to verify her work and the engine guard would be instantly satisfied, without any need for back-to-back tool calls in the first place. This’d eliminate the unnecessary latency and API costs, as well as the “oops”/“one sec” apology this issue’s discussing.

Just my two cents. Apologies if I’m missing some broader architectural constraint here, as I’m not terribly familiar with how Mari is designed.

<!-- gh-comment-id:5504122964 --> @atlasveldine commented on GitHub (Sep 2, 2026): Perhaps I’m misunderstanding something about Mari’s tool design, but if Mari’s `write`-enabled tools strictly require a subsequent `read` after every mutation, is there any actual reason to offload that orchestration step to the LLM…? The way I see it, it seems as if there’s two reasons for verification: 1. “Did the write succeed?” - Or in other words, did Marinara Engine *actually apply* the data correctly? - If that’s the reason, this should be handled deterministically within Marinara Engine’s code rather than by “asking” (or forcing) the LLM to double-check after the fact. 2. “Did the LLM apply the *intended* changes?” - Or in other words, did the LLM use the tooling correctly and not accidentally wipe portions of the data? - If *that’s* the reason, where the LLM genuinely *needs* to inspect the outcome to confirm correctness, wouldn't it be significantly faster (and cheaper, too) to just have Mari’s `write`-enabled tools return the updated state directly in its tool result? Correct me if I’m wrong, but it sounds to me like right now, `write`-type tools return `success: true` (or something like it), with a note appended that prompts the model to manually call a `read`-type tool to “verify,” then an intercept that forces the model to continue if it fails to do so. This introduces potentially *multiple* unnecessary round-trips, increasing API costs for something which we already know Mari needed to have access to back when she originally ran the `write`-type tool call in the first place. If `write` tools were to instead simply return the new state directly, along with a note telling the LLM to verify against what it *intended* the output to be, Mari would get immediate visibility to verify her work and the engine guard would be instantly satisfied, without any need for back-to-back tool calls in the first place. This’d eliminate the unnecessary latency and API costs, as well as the “oops”/“one sec” apology this issue’s discussing. Just my two cents. Apologies if I’m missing some broader architectural constraint here, as I’m not terribly familiar with how Mari is designed.
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#3180
No description provided.