[GH-ISSUE #5748] Professor Mari can override her own approval question: an ask-frame carrying only an apply:false preview cannot be held, so she applies unasked one round later #3174

Closed
opened 2026-10-21 06:00:14 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @kolacheee on GitHub.

In one sentence: when Mari asks "want me to apply this?" with only an apply:false preview attached, the engine recognizes the question but has nothing to hold, so the same run continues and she can answer her own question — regenerating the full edit with apply:true and applying it without the user ever replying.

What happened (observed playtest, Auto mode, no skills or memories loaded)

User: Testing stuff again. Let's turn KZK into a magical girl, propose your edits.

Mari found and read the card, then in one uninterrupted run:

  1. Drafted the transformation and said "I'm running this as a preview so you can review the proposed edits in the UI. Let me know if you want me to apply these changes!" — with a character.update carrying apply:false.
  2. Next round, with no user reply in between: "Ah, my bad! To properly show you the Keep/Restore review card UI for character edits, I need to actually submit the changes. Let's apply the magical girl transformation right now" — and re-emitted the identical patch with apply:true, which executed.
  3. Verified with a read and reported the edit saved.

So one requested edit generated the full payload twice, and an explicit "let me know if you want me to apply" was overridden by Mari herself one round later. The user's "propose your edits" ended in an applied change.

The #5740 "Acting on" line is what exposed the causal chain: it read "Apply the magical girl edits to KZK to generate the Keep/Restore review card." — Mari's own justification, not the user's words — which is the record faithfully reporting that the trigger for the apply was her reasoning, not the user's message.

Why it happens — the verified chain

Every link below was verified in source (and the deferral/regex links executed empirically against the transcript text). All of the involved code and prompt text is identical on staging — this is not caused by the #5740 branch (its diff was checked region-by-region; the record capture, prompt schema line, and read-back block have no path into apply behavior, and the tool-trace labels in the screenshots are the pre-existing app_data reason argument).

  1. "Propose" is undefined on first use. The word appears in Mari's prompt exactly once — workspace-agent.service.ts:718, the preference-memory bullet shipped by #5727, which names "propose changes" as a known phrasing mismatch but only reacts after it has happened twice. Nothing tells her what "propose your edits" means the first time. The apply:false license at :602/:714 ("…or when you are inspecting a risky change before deciding what to do") even scripts preview → decide → apply as one legitimate in-run sequence, and the home-widget rule at :711 models exactly the preview-then-confirm two-step she attempted.

  2. The approval detector fired — and the engine threw the result away. Round 3's "Let me know if you want me to apply these changes!" matches visibleTextRequestsUserApproval (:1611, the "want me to … apply" alternation; verified by executing the shipped regexes). But shouldDeferMutations (:2227-2237) ANDs that with commands.some(isMutatingWorkspaceCommand), and apply:false is classified preview-only (:1642-1646 → :1659), i.e. non-mutating. An ask-frame whose only command is a preview is structurally invisible to the deferral: no Accept chip, no hold, no runEndedWithDeferral, and the run keeps going.

    Counterfactual, executed against the shipped functions: the identical prose with apply:true on that same round ⇒ shouldDeferMutations === true, commands held, Accept chip shown, run ends. The preview flag alone defeated the hold. That is why this is a structural class, not a model stumble.

  3. The preview's own result text coaches the pivot. A dry-run returns "Preview only: no changes were saved. Use apply:true only if the user asked you to make the change." (:904, delivered into her context at :2463). The user did ask for edits — as a proposal — so her reading of that test passes, and the sibling apply-branch text (:907) tells her the Keep/Restore card is what the user gets to see.

  4. Her stated justification is factually correct. An apply:false dry-run produces no user-visible artifact at all — the server never creates a review record for it (mari-db.service.ts:7095-7105), and the client has no app_data preview presentation. The Keep/Restore card really is the only diff UI, and it only exists after applying. "To show you the review card I need to actually submit" is true.

  5. Nothing catches the second round. Round 4's declarative "Let's apply…" matches none of the approval regexes (they anchor on interrogative asks — verified alternation-by-alternation); Auto mode has no server floor (the only executor floors are Plan and Manual-silent); no run-scoped state remembers that an earlier round asked permission (the deferral decision is recomputed from scratch each round from that round's frame only); and the loop never consults stop after a command batch (:2345 and :2410 both key on an empty command list), so there is no "run these previews, then wait for me" frame available even if she tried to emit one.

Relation to #5721

Adjacent, not the same defect — same visible cost (one edit, two full generations), opposite polarity. #5721 was the engine over-blocking: a gate discarded Mari's correct first attempt and forced a typed re-confirmation across two runs. This is the engine under-holding: no gate exists for an ask+preview frame, and both generations happen inside one run with no user turn between them. Fixing one does not regress the other, but any fix here should be checked against the #5727 revert rationale.

Candidate directions (not prescriptive — maintainer's call)

  • Run-scoped ask latch (engine): once a round's text asks for apply-permission (or sets awaitingAuthorization), later rounds of the same run treat mutating commands the way Manual does — hold behind Accept rather than execute. The only option that makes the floor non-negotiable in Auto. Risk: a run that asks a mid-flight clarifying question and then continues authorized work would get held; touches the most-pinned code path.
  • Prompt: map propose/draft wording onto the deferral the engine can already hold — describe the concrete before/after in say, carry the real apply:true command in the same frame, set awaitingAuthorization: true. One generation, one Accept chip, zero duplicate payload; the machinery for this is fully built. Should require the explicit field rather than the regexes (verified misses: "Shall I proceed?", "Sound good?", "Let me know if this looks right").
  • Fix the dry-run coaching string (:904): say that previews are invisible to the user and that a user turn is the gate — not "use apply:true only if the user asked", which re-poses the decision to Mari every round. One line, nothing pins it. Advisory only; alone it risks a model stopping after an invisible preview, so pair it with the previous item.
  • Give apply:false a real user-visible preview card: the before/after rows already exist server-side; the client just never renders them. Removes the true premise behind the self-override entirely, and makes the prompt's "the UI has returned an explicit preview artifact" clause (:715) refer to something real. Largest change; needs a design call so a "not saved" card can never be mistaken for the saved Keep/Restore card.
  • Honor stop after a command batch (plus softening the ":674 stop should usually be false" rule) so an ask-and-wait frame with previews is expressible. Small diff, but real blast radius — every legitimate multi-step sequence relies on stop:false with commands.

Do not route this through #5740's understood-request record — that record is diagnostic-only by hard constraint, and in this incident it did its job (it is how the self-authored justification was caught).

Originally created by @kolacheee on GitHub (Sep 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5748 Originally assigned to: @kolacheee on GitHub. **In one sentence:** when Mari asks "want me to apply this?" with only an `apply:false` preview attached, the engine recognizes the question but has nothing to hold, so the same run continues and she can answer her own question — regenerating the full edit with `apply:true` and applying it without the user ever replying. ## What happened (observed playtest, Auto mode, no skills or memories loaded) > **User:** Testing stuff again. Let's turn KZK into a magical girl, propose your edits. Mari found and read the card, then in one uninterrupted run: 1. Drafted the transformation and said *"I'm running this as a preview so you can review the proposed edits in the UI. Let me know if you want me to apply these changes!"* — with a `character.update` carrying `apply:false`. 2. Next round, with no user reply in between: *"Ah, my bad! To properly show you the Keep/Restore review card UI for character edits, I need to actually submit the changes. Let's apply the magical girl transformation right now"* — and re-emitted the identical patch with `apply:true`, which executed. 3. Verified with a read and reported the edit saved. So one requested edit generated the full payload twice, and an explicit "let me know if you want me to apply" was overridden by Mari herself one round later. The user's "propose your edits" ended in an applied change. The #5740 "Acting on" line is what exposed the causal chain: it read *"Apply the magical girl edits to KZK to generate the Keep/Restore review card."* — Mari's own justification, not the user's words — which is the record faithfully reporting that the trigger for the apply was her reasoning, not the user's message. ## Why it happens — the verified chain Every link below was verified in source (and the deferral/regex links executed empirically against the transcript text). All of the involved code and prompt text is **identical on `staging`** — this is not caused by the #5740 branch (its diff was checked region-by-region; the record capture, prompt schema line, and read-back block have no path into apply behavior, and the tool-trace labels in the screenshots are the pre-existing `app_data` `reason` argument). 1. **"Propose" is undefined on first use.** The word appears in Mari's prompt exactly once — `workspace-agent.service.ts:718`, the preference-memory bullet shipped by #5727, which names "propose changes" as a known phrasing mismatch but only reacts after it has happened *twice*. Nothing tells her what "propose your edits" means the first time. The `apply:false` license at :602/:714 ("…or when you are inspecting a risky change before deciding what to do") even scripts preview → decide → apply as one legitimate in-run sequence, and the home-widget rule at :711 models exactly the preview-then-confirm two-step she attempted. 2. **The approval detector fired — and the engine threw the result away.** Round 3's "Let me know if you want me to apply these changes!" *matches* `visibleTextRequestsUserApproval` (:1611, the "want me to … apply" alternation; verified by executing the shipped regexes). But `shouldDeferMutations` (:2227-2237) ANDs that with `commands.some(isMutatingWorkspaceCommand)`, and `apply:false` is classified preview-only (:1642-1646 → :1659), i.e. non-mutating. An ask-frame whose only command is a preview is structurally invisible to the deferral: no Accept chip, no hold, no `runEndedWithDeferral`, and the run keeps going. **Counterfactual, executed against the shipped functions:** the identical prose with `apply:true` on that same round ⇒ `shouldDeferMutations === true`, commands held, Accept chip shown, run ends. The preview flag alone defeated the hold. That is why this is a structural class, not a model stumble. 3. **The preview's own result text coaches the pivot.** A dry-run returns *"Preview only: no changes were saved. Use apply:true only if the user asked you to make the change."* (:904, delivered into her context at :2463). The user did ask for edits — as a proposal — so her reading of that test passes, and the sibling apply-branch text (:907) tells her the Keep/Restore card is what the user gets to see. 4. **Her stated justification is factually correct.** An `apply:false` dry-run produces no user-visible artifact at all — the server never creates a review record for it (`mari-db.service.ts:7095-7105`), and the client has no `app_data` preview presentation. The Keep/Restore card really is the only diff UI, and it only exists after applying. "To show you the review card I need to actually submit" is true. 5. **Nothing catches the second round.** Round 4's declarative "Let's apply…" matches none of the approval regexes (they anchor on interrogative asks — verified alternation-by-alternation); Auto mode has no server floor (the only executor floors are Plan and Manual-silent); no run-scoped state remembers that an earlier round asked permission (the deferral decision is recomputed from scratch each round from that round's frame only); and the loop never consults `stop` after a command batch (:2345 and :2410 both key on an empty command list), so there is no "run these previews, then wait for me" frame available even if she tried to emit one. ## Relation to #5721 Adjacent, not the same defect — same visible cost (one edit, two full generations), opposite polarity. #5721 was the engine *over-blocking*: a gate discarded Mari's correct first attempt and forced a typed re-confirmation across two runs. This is the engine *under-holding*: no gate exists for an ask+preview frame, and both generations happen inside one run with no user turn between them. Fixing one does not regress the other, but any fix here should be checked against the #5727 revert rationale. ## Candidate directions (not prescriptive — maintainer's call) - **Run-scoped ask latch (engine):** once a round's text asks for apply-permission (or sets `awaitingAuthorization`), later rounds of the *same run* treat mutating commands the way Manual does — hold behind Accept rather than execute. The only option that makes the floor non-negotiable in Auto. Risk: a run that asks a mid-flight clarifying question and then continues authorized work would get held; touches the most-pinned code path. - **Prompt: map propose/draft wording onto the deferral the engine can already hold** — describe the concrete before/after in `say`, carry the real `apply:true` command in the same frame, set `awaitingAuthorization: true`. One generation, one Accept chip, zero duplicate payload; the machinery for this is fully built. Should require the explicit field rather than the regexes (verified misses: "Shall I proceed?", "Sound good?", "Let me know if this looks right"). - **Fix the dry-run coaching string (:904):** say that previews are invisible to the user and that a *user turn* is the gate — not "use apply:true only if the user asked", which re-poses the decision to Mari every round. One line, nothing pins it. Advisory only; alone it risks a model stopping after an invisible preview, so pair it with the previous item. - **Give `apply:false` a real user-visible preview card:** the before/after rows already exist server-side; the client just never renders them. Removes the true premise behind the self-override entirely, and makes the prompt's "the UI has returned an explicit preview artifact" clause (:715) refer to something real. Largest change; needs a design call so a "not saved" card can never be mistaken for the saved Keep/Restore card. - **Honor `stop` after a command batch** (plus softening the ":674 stop should usually be false" rule) so an ask-and-wait frame with previews is expressible. Small diff, but real blast radius — every legitimate multi-step sequence relies on stop:false with commands. Do **not** route this through #5740's understood-request record — that record is diagnostic-only by hard constraint, and in this incident it did its job (it is how the self-authored justification was caught).
bsakaguchi 2026-10-21 06:00:14 +07:00
Author
Owner

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

Implementation starting now (kolacheee, via Claude session): run-scoped ask latch in the engine plus the dry-run coaching and propose-mapping prompt fixes. Branch: fix/5748-mari-ask-latch.

<!-- gh-comment-id:5503116162 --> @kolacheee commented on GitHub (Sep 2, 2026): Implementation starting now (kolacheee, via Claude session): run-scoped ask latch in the engine plus the dry-run coaching and propose-mapping prompt fixes. Branch: fix/5748-mari-ask-latch.
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#3174
No description provided.