mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7520] [MERGED] Professor Mari: move tools, round review and message storage out of the run loop #7773
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#7773
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7520
Author: @Gunterlie
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @Gunterlie
Base:
feat/mari-pi-runtime← Head:feat/mari-pi-runtime-1-extract📝 Commits (6)
d29a2dfMove Mari's workspace tool commands into WorkspaceCommandsd2817edKeep executeWorkspaceCommand delegate reachable for scripts466db9aExtract Mari's per-round safety review into workspace-round-review0ff8b5bExtract Mari's message storage into workspace-message-store11f7340Pin the round-review call sites in the run loop and format touched regressions5985535Mark type-only imports in workspace-commands📊 Changes
14 files changed (+1683 additions, -1230 deletions)
View changed files
📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+125 -1199)➕
packages/server/src/services/professor-mari/workspace-commands.ts(+1090 -0)➕
packages/server/src/services/professor-mari/workspace-message-store.ts(+110 -0)➕
packages/server/src/services/professor-mari/workspace-round-review.ts(+147 -0)📝
scripts/regressions/mari-ask-latch.regression.ts(+8 -5)📝
scripts/regressions/mari-edit-flow-revert.regression.ts(+3 -1)📝
scripts/regressions/mari-guard-sibling-paths.regression.ts(+9 -4)📝
scripts/regressions/mari-permissions-mode.regression.ts(+26 -6)📝
scripts/regressions/mari-polish.regression.ts(+3 -1)📝
scripts/regressions/mari-write-readback.regression.ts(+3 -1)📝
scripts/regressions/mari/review-cards.regression.ts(+6 -3)➕
scripts/regressions/professor-mari/round-review.regression.ts(+132 -0)📝
scripts/regressions/professor-mari/shell-sandbox.regression.ts(+9 -4)📝
scripts/regressions/prompt.regression.ts(+12 -6)📄 Description
Linked issue
No linked issue. This is planned work: slice 1 of 2 on the integration branch
feat/mari-pi-runtime(a trial of a second, pi-based runtime for Professor Mari, switchable in her settings). This PR targets that integration branch, notstaging.Why this change
What changed
workspace-commands.ts(new): classWorkspaceCommandsholds every tool command (read, write, edit, shell,mari, app data, package service), the path guards and the single mutation queue. Run-scoped state (permissions mode, the Manual and ask-latch floors, decision context) stays owned by the service and is read through a callback at use time.workspace-round-review.ts(new): the per-round sequencing of the safety checks that was inline inprompt()— deferral of mutating commands, the completion-claim audit with its repair budgets, and the stop after repeated equal failures.workspace-message-store.ts(new): creating the assistant message and building itsextra, one code path for every exit (normal, deferral, error, abort).workspace-agent.service.ts: 5,491 → 4,417 lines. Every previous export is still importable from this path. Thin delegates remain where regression scripts call them.scripts/regressions/professor-mari/round-review.regression.tsdrives the extracted review with recorded inputs (clean round, false "done" claim, readback mismatch, repeated-failure stop).mari-permissions-mode.regression.tspins the three loop call sites so the loop keeps passing its local permissions mode and one review state per run.Left inline on purpose, because moving them would change loop control: protocol and empty-frame repair, the length-limit stop, the chip repair and the round-limit summary.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Not done by a person yet. To verify by hand:
bwrap(see Proof).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
No UI change.
Proof
Run by agents on commit
59855358d:pnpm check: exit 0.node ./scripts/run-regressions.mjs --filter mari: 49/49 passed.node ./scripts/run-regressions.mjs --filter scripts/regressions/prompt.regression.ts: 1/1 passed.this.xrewiring. Same order of checks, counters, limits, events, texts and storedextrakeys. One mutation queue. The import cycle between the new files and the service evaluates nothing at module top level.workspace-commands.ts), fixed in59855358d.Not proven:
bwrap, so the shell sandbox runtime path was not executed.commandBashis shown identical by text comparison only.round-review.regression.tsdoes not cover the mid-run repair budget, thestagedandunverifiedprompts, orawaitingAuthorization. The existing loop-level scripts still cover those paths.Known trade-offs:
workspace-agent.service.ts(import cycle, safe at load). About 30 helpers were exported from the service for them.executeWorkspaceCommandis now public on the service so regression scripts can reach it. No runtime effect.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.