mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7376] [CLOSED] feat(mari): built-in skill library, on-demand skill tool, pacing rules #7708
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#7708
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/7376
Author: @ATreemanDork
Created: 10/9/2026
Status: ❌ Closed
Base:
staging← Head:feat/mari-skills-pacing📝 Commits (8)
74882darefactor(mari): move workspace tool definitions into a tool registry025a5e3feat(mari): built-in skill library, on-demand skill tool, pacing rules837c9d7feat(mari): direct the model to load matching skills before actingda0d759feat(mari): show a skill-active chip when the skill tool loads a skill5ca52fafix(mari): let the skill tool pass workspace command validation8f8aafafix(mari): self-correct misrouted skill fetchesc920e5dfix(mari): steer skill fetches away from app_data in the prompt4bc144ffix(mari): stop parrotting the catchphrase in workspace replies📊 Changes
13 files changed (+2249 additions, -478 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/client/src/components/chat/HomeProfessorMariChat.tsx(+43 -5)📝
packages/client/src/localization/locales/en.json(+2 -0)📝
packages/server/src/services/mari-db/mari-db.service.ts(+12 -0)➕
packages/server/src/services/professor-mari/builtin-skills.ts(+524 -0)➕
packages/server/src/services/professor-mari/tool-registry.ts(+1317 -0)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+122 -451)📝
packages/server/src/services/professor-mari/workspace-skills.service.ts(+114 -6)📝
packages/shared/src/types/professor-mari-workspace.ts(+4 -1)➕
scripts/regressions/mari-skill-tool.regression.ts(+73 -0)📝
scripts/regressions/open-issues.regression.ts(+7 -1)📝
scripts/regressions/professor-mari-preset-variables.regression.ts(+23 -11)📝
scripts/regressions/professor-mari/shell-sandbox.regression.ts(+7 -3)📄 Description
Closes #7375
Stacked PR: This branch is based on #7366 (tool-registry refactor) and includes its commit
74882da1c. GitHub shows "includes #7366"; it will be rebased ontostagingonce #7366 lands.Why this change
Professor Mari's Home workspace prompt currently carries verbose how-to guidance — command-family reference, guided sequences, lorebook/preset authoring guides — inline on every turn, and the model has no structured way to be handed task-specific instructions. Long inline guides get compressed poorly by models and bloat the always-in-context prompt.
This PR ships a built-in skill library with on-demand retrieval:
builtin-skills.ts) covering Mari's task catalog (docs, files, commands, deps, chats, characters, lorebooks, presets, themes).<skill_library>block (~19 lines) with one line per skill; full docs are fetched only when needed.skilltool (16th, kindmeta, non-mutating, idempotent): Mari callsskillwith an id from the index to load the full instructions.skilltool case was missing from the workspace-command validation gate, so every skill call failed with "Unsupported workspace command: skill" before reaching the dispatcher; (b) models keep trying to reach the skill library throughapp_data({"action": "skill"}) — the structured app-data runtime now answers with a self-correcting error pointing at theskilltool and the in-context<skill_library>index, and theapp_datatool description now states that skills are not app_data actions (that description is where the model forms the "skills are app data" belief); (c) acommandSkill()miss now points at the in-context skill index, so a guessed id (models do invent ids likescenario-build) is self-correcting instead of a bare dead end. All pinned by a new regression lane.<skill_library>index now tells the model to load the skill(s) matching a task before acting and follow theirWorkflow. Multi-tool tasks (e.g. create a character and a lorebook) are thus driven by the matching skill's tool-recipe instead of being improvised from the pacing block. (Server-side auto-activation - task→skill routing - is the documented upgrade path if this soft directive proves unreliable.)skilltool loads a skill, the chat timeline now shows a dedicatedMari skill/Skill activechip naming the skill and tagging it· Built-in/· Custom(parses the skill tool's<skill id name builtin>output wrapper; degrades to a humanized id with no tag while the call is still running). Reuses the existingskilltone; no new localization keys.builtinflag only appears on built-ins).<tool_inventory>derived from the tool registry;MARI_GUIDED_SEQUENCESand the lorebook/preset authoring guides are replaced by a short<pacing>block (their content now lives in the task skills). All behavioral rules (read-back,apply:falsesemantics, decision authoring,MAX_COMMAND_ROUNDS = 12) are unchanged.What changed
packages/server/src/services/professor-mari/builtin-skills.ts(new): 16 built-in skill documents, fixedBUILTIN_SKILL_TIMESTAMP,BUILTIN_SKILLS/BUILTIN_SKILL_MAP/BUILTIN_SKILL_IDSexports,getBuiltinSkill(),renderSkillLibraryIndex().tool-registry.ts:skilltool entry (16th); count comment updated. Derived exports (WORKSPACE_TOOL_NAMES, etc.) pick it up automatically. Theapp_datadescription now states that skills are not app_data actions (the index is already in context, and theskilltool loads one by id) — that description is where the model forms the "skills are app data" belief.workspace-agent.service.ts:renderToolInventory()replaces the Command-families block in the system prompt;<pacing>block replaces${MARI_GUIDED_SEQUENCES}and the lorebook/preset authoring guides in the protocol prompt (behavioral rules kept);buildSkillsPrompt()now emits the two-layer<skill_library>index +<user_skills>; newcase "skill"dispatch viacommandSkill()(service-first, then shipped constant;<skill id name builtin>XML output);workspaceCommandValidationIssue()gains acase "skill"so skill calls clear the validation gate (they previously failed with "Unsupported workspace command: skill" before reaching the dispatcher); acommandSkill()miss ("Skill "X" not found.") now points at the in-context skill index so a guessed id is self-correcting.packages/server/src/services/mari-db/mari-db.service.ts:executeActionreturns a self-correcting error forskill*app_data actions (models sometimes route a skill fetch here instead of theskilltool), pointing at the tool and the in-context<skill_library>index instead of the generic unsupported-action dead end.scripts/regressions/mari-skill-tool.regression.ts(new): pins the skill-tool validation gate (valid id dispatches to the wrapper, missing id rejects, unknown id reachescommandSkillwith a self-correcting miss) and the app_data skill routing (runtime:skillandskill.getactions get the self-correcting error, not the generic dead end).workspace-skills.service.ts:list()merges the built-in library (materialized file wins; shipped constant synthesized with pinned timestamps); newgetById();update()materializes a built-in on first edit;delete()of an unedited built-in is a no-op (Restore Default = remove the override);builtinflag only on built-ins.packages/shared/.../professor-mari-workspace.ts:"skill"in the tool-name union;builtin?: booleanon the skill summary.HomeProfessorMariChat.tsx: "Built-in" badge next to built-in names; delete button becomes "Restore Default" withRotateCcwfor built-ins (enabled only once the built-in has been edited). 2 new en.json keys. Plus the active-skill timeline chip (getSkillToolPresentation+ askillbranch ininferToolPresentation).professor-mari-preset-variables.regression.ts: check 1 now pins the{{variableName}}guidance in thecreate-preset/edit-presetskill docs; check 2 (protocol promptpreset.createexample) unchanged.CHANGELOG.md: [Unreleased] entry.Validation
pnpm checkpasses locally (TypeScript + ESLint + format + localization + build)CONTRIBUTING.mdAdditional automated validation run locally:
pnpm regression:prompt: 1/1 passedpnpm regression:node(full suite): 544/545 passed. The one failure,log-worker-ready, is an unrelated log-worker harness flake ("unsettled top-level await" onbecomesReady, no reference to mari/skills/registry in the test); it passes when re-run standalone.professor-mari9/9,professor-mari-preset-variables1/1,mari-package-service1/1,mari/decision-authoring1/1,mari-skill-tool1/1,open-issues1/1,capability-tool-runtime1/1,game-mode-dice-tool1/1,multiplayer-generation-policy1/1 — all passed; fullmarifilter re-run 32/32 after the app_data routing changepnpm version:check: version files in sync for 2.5.0<tool_inventory>(16 lines incl.skill), protocol-prompt<pacing>+|skillschema union, and the built-in lifecycle (fresh list = 16 pinned built-ins → edit materializes file →updatedAt > createdAt→ delete restores shipped text → unedited delete is a no-op → user-skill payloads carry nobuiltinkey) — all passedManual verification notes
create-lorebook).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)
UI change is the Skills panel badge + Restore Default button (screenshot to be added after manual browser verification).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.