[GH-ISSUE #5776] Bash mari CLI dry-runs count as applied mutations, so the verification guard can be satisfied for a change that never persisted #3190

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

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

Originally assigned to: @kolacheee on GitHub.

In one sentence: a mari CLI mutation run through the bash command without --apply is a dry-run that persists nothing, but the verification guard counts it as an applied mutation, so a follow-up read "verifies" a change that never happened and Mari can claim completion.

The gap

This is the #5756 bug class on the bash path. isAppliedWorkspaceMutation (workspace-agent.service.ts) treats every successful mutating bash command as applied - the "saved": true gate applies only to app_data results. But the mari CLI's documented default is dry-run: mari lorebooks add-entry ... without --apply routes through parseDirectMariArgv to commandMariDirect, executeMutation returns ok: true, mode: "dry-run" with nothing written, and the result output even contains "saved": false / "status": "dry_run_only" - which the guard never tests for bash results. bashLooksMutating matches the subcommand regardless of --apply. Same shape for mari db insert|patch|replace|delete|transform, mari themes create|update|set-active, and mari images ....

So: Mari forgets --apply, the round counts as a mutation, she runs any successful read, the round resolves "verified", and "I've added the entry" passes the completion-claim guard while the store is untouched - a silent persistent failure.

Fix direction

Don't sniff the output blindly for dry_run_only - sandboxed bash output is script-controlled, so a script that prints the marker would let a real applied mutation dodge verification debt (the forgery class #5775 hardened against). Instead, distinguish trust domains by input: re-run parseDirectMariArgv on the command at classification time. If it parses as a direct mari invocation, the output is engine-authored (the sandbox never runs it) and can be trusted for a "saved"/dry-run check; if not, keep the current conservative applied classification. Longer term, the structured applied-vs-staged outcome direction from #5756 covers this properly.

Found during the adversarial review for #5775; pre-existing, not introduced there.

Originally created by @kolacheee on GitHub (Sep 2, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5776 Originally assigned to: @kolacheee on GitHub. **In one sentence:** a `mari` CLI mutation run through the `bash` command without `--apply` is a dry-run that persists nothing, but the verification guard counts it as an applied mutation, so a follow-up read "verifies" a change that never happened and Mari can claim completion. ## The gap This is the #5756 bug class on the bash path. `isAppliedWorkspaceMutation` (workspace-agent.service.ts) treats every successful mutating bash command as applied - the `"saved": true` gate applies only to `app_data` results. But the mari CLI's documented default is dry-run: `mari lorebooks add-entry ...` without `--apply` routes through `parseDirectMariArgv` to `commandMariDirect`, `executeMutation` returns `ok: true, mode: "dry-run"` with nothing written, and the result output even contains `"saved": false` / `"status": "dry_run_only"` - which the guard never tests for bash results. `bashLooksMutating` matches the subcommand regardless of `--apply`. Same shape for `mari db insert|patch|replace|delete|transform`, `mari themes create|update|set-active`, and `mari images ...`. So: Mari forgets `--apply`, the round counts as a mutation, she runs any successful read, the round resolves "verified", and "I've added the entry" passes the completion-claim guard while the store is untouched - a silent persistent failure. ## Fix direction Don't sniff the output blindly for `dry_run_only` - sandboxed bash output is script-controlled, so a script that prints the marker would let a real applied mutation dodge verification debt (the forgery class #5775 hardened against). Instead, distinguish trust domains by input: re-run `parseDirectMariArgv` on the command at classification time. If it parses as a direct mari invocation, the output is engine-authored (the sandbox never runs it) and can be trusted for a `"saved"`/dry-run check; if not, keep the current conservative applied classification. Longer term, the structured applied-vs-staged outcome direction from #5756 covers this properly. Found during the adversarial review for #5775; pre-existing, not introduced there.
bsakaguchi 2026-10-21 06:00:23 +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#3190
No description provided.