[GH-ISSUE #5967] Unreleased regression: the claim audit discards a frame's real commands when the same frame claims completion #3308

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

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

Originally assigned to: @SpicyMarinara on GitHub.

Found while diagnosing #5966. This is on staging only and has not shipped, so it is catchable before release — but it would land on exactly the users #5966 is about, and make them worse off.

What happens

In workspace-agent.service.ts the claim audit runs before the frame's commands are executed:

  • staging:2791 — auditWorkspaceCompletionClaim(action, …)
  • staging:2826 — a challenged claim does continue
  • staging:2930 — executeWorkspaceCommandBatch(action.commands, …), never reached

So when a model emits one frame that both claims completion and carries the real command — {"say":"I've updated the entry.","commands":[{…lorebook.updateEntry…}],"stop":false} — the audit fires (nothing backs the claim yet, because the command hasn't run), the frame is discarded, and Mari's actual edit is thrown away. The user sees nothing.

Why it is a regression

On shipped v2.4.4 this cannot happen. workspaceActionNeedsVerification bails out on any command-bearing frame:

main:2019   if (action.commands.length > 0 || !action.stop || !workspaceTextClaimsMutationCompletion(action.visibleText)) {
main:2020     return null;

auditWorkspaceCompletionClaim has no equivalent bail, so PR #5893 (#5819/#5830) widened the audit onto frames that previously executed normally. That widening was deliberate for claim-only frames; catching claim-plus-command frames looks like fallout rather than intent.

Why it matters more than it looks

MAX_MIDRUN_CLAIM_REPAIR_ROUNDS = 2 (staging:196). A model whose habit is to narrate optimistically in the same frame as the command hits this on every attempt: three such frames exhaust the budget and the run ends at staging:2828 with the visible "could not verify" message and nothing applied.

That habit is characteristic of exactly the weaker non-Claude models in #5966. Today those users get a false claim and no card; after staging ships they could instead get a real edit silently discarded, twice, then a hard stop.

Suggested fix

Audit the claim after the frame's own commands execute, so a claim made in the same frame as its backing mutation is judged against the evidence that frame produced. That keeps the #5830 behavior for claim-only frames — which is the case the guard was written for — while letting an optimistically-narrated real edit through.

Failing that, matching main's bail (skip the audit when action.commands.length > 0) restores the shipped behavior, at the cost of losing mid-run claim coverage on mixed frames.

Whichever way it goes, the regression lane should pin it: scripts/regressions/prompt.regression.ts currently has no case for a frame that both claims and carries commands.

Not started on a fix — flagging it before the release rather than after.

Originally created by @kolacheee on GitHub (Sep 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5967 Originally assigned to: @SpicyMarinara on GitHub. Found while diagnosing #5966. This is on `staging` only and has not shipped, so it is catchable before release — but it would land on exactly the users #5966 is about, and make them worse off. ## What happens In `workspace-agent.service.ts` the claim audit runs **before** the frame's commands are executed: - `staging:2791` — `auditWorkspaceCompletionClaim(action, …)` - `staging:2826` — a challenged claim does `continue` - `staging:2930` — `executeWorkspaceCommandBatch(action.commands, …)`, never reached So when a model emits **one frame that both claims completion and carries the real command** — `{"say":"I've updated the entry.","commands":[{…lorebook.updateEntry…}],"stop":false}` — the audit fires (nothing backs the claim *yet*, because the command hasn't run), the frame is discarded, and **Mari's actual edit is thrown away**. The user sees nothing. ## Why it is a regression On shipped v2.4.4 this cannot happen. `workspaceActionNeedsVerification` bails out on any command-bearing frame: ``` main:2019 if (action.commands.length > 0 || !action.stop || !workspaceTextClaimsMutationCompletion(action.visibleText)) { main:2020 return null; ``` `auditWorkspaceCompletionClaim` has no equivalent bail, so PR #5893 (#5819/#5830) widened the audit onto frames that previously executed normally. That widening was deliberate for *claim-only* frames; catching claim-**plus**-command frames looks like fallout rather than intent. ## Why it matters more than it looks `MAX_MIDRUN_CLAIM_REPAIR_ROUNDS = 2` (`staging:196`). A model whose habit is to narrate optimistically in the same frame as the command hits this on every attempt: three such frames exhaust the budget and the run ends at `staging:2828` with the visible "could not verify" message and **nothing applied**. That habit is characteristic of exactly the weaker non-Claude models in #5966. Today those users get a false claim and no card; after `staging` ships they could instead get a real edit silently discarded, twice, then a hard stop. ## Suggested fix Audit the claim **after** the frame's own commands execute, so a claim made in the same frame as its backing mutation is judged against the evidence that frame produced. That keeps the #5830 behavior for claim-only frames — which is the case the guard was written for — while letting an optimistically-narrated real edit through. Failing that, matching `main`'s bail (skip the audit when `action.commands.length > 0`) restores the shipped behavior, at the cost of losing mid-run claim coverage on mixed frames. Whichever way it goes, the regression lane should pin it: `scripts/regressions/prompt.regression.ts` currently has no case for a frame that both claims and carries commands. Not started on a fix — flagging it before the release rather than after.
bsakaguchi 2026-10-21 06:01:51 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

Codex is taking this issue for @SpicyMarinara in the assigned-issue sweep, together with #5966/#5967. The fix targets staging: preserve commands in mixed claim/command frames, repair malformed command frames, and check completion against executed results. Existing permission and preview boundaries stay in force.

<!-- gh-comment-id:5592167488 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): Codex is taking this issue for @SpicyMarinara in the assigned-issue sweep, together with #5966/#5967. The fix targets `staging`: preserve commands in mixed claim/command frames, repair malformed command frames, and check completion against executed results. Existing permission and preview boundaries stay in force.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

Fixed and merged to staging in #5973. The audit no longer discards valid commands; regressions cover supported frame variants, actual saved edits, and Manual/Plan permission floors.

<!-- gh-comment-id:5592940779 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): Fixed and merged to staging in #5973. The audit no longer discards valid commands; regressions cover supported frame variants, actual saved edits, and Manual/Plan permission floors.
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#3308
No description provided.