mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[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
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:falsepreview 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 withapply:trueand applying it without the user ever replying.What happened (observed playtest, Auto mode, no skills or memories loaded)
Mari found and read the card, then in one uninterrupted run:
character.updatecarryingapply:false.apply:true, which executed.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-existingapp_datareasonargument)."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. Theapply:falselicense 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.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). ButshouldDeferMutations(:2227-2237) ANDs that withcommands.some(isMutatingWorkspaceCommand), andapply:falseis 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, norunEndedWithDeferral, and the run keeps going.Counterfactual, executed against the shipped functions: the identical prose with
apply:trueon 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.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.
Her stated justification is factually correct. An
apply:falsedry-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 noapp_datapreview 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.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
stopafter 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)
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.say, carry the realapply:truecommand in the same frame, setawaitingAuthorization: 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").apply:falsea 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.stopafter 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).
@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.