[PR #8386] [MERGED] perf(mari): trim the skill index and the app_data description #8569

Closed
opened 2026-11-07 16:45:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8386
Author: @ylli-selmani
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ylli-selmani

Base: staging ← Head: perf/prompt-diet-cuts


📝 Commits (2)

  • 4d80963 perf(mari): trim built-in skill descriptions to their triggers (K1)
  • b34999a perf(mari): drop the entity list from the app_data tool description (T2)

📊 Changes

10 files changed (+17 additions, -14 deletions)

View changed files

📝 packages/server/src/assets/mari-skills/characters.md (+1 -1)
📝 packages/server/src/assets/mari-skills/decisions.md (+1 -1)
📝 packages/server/src/assets/mari-skills/extensions.md (+1 -1)
📝 packages/server/src/assets/mari-skills/home-widgets.md (+1 -1)
📝 packages/server/src/assets/mari-skills/lorebook.md (+1 -1)
📝 packages/server/src/assets/mari-skills/onboarding.md (+1 -1)
📝 packages/server/src/assets/mari-skills/repair.md (+1 -1)
📝 packages/server/src/assets/mari-skills/themes.md (+1 -1)
📝 packages/server/src/services/professor-mari/pi-runtime.ts (+5 -2)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+4 -4)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Part of #8375 (follow-up to #8376)

Why this change

#8376 cut how much each tool turn adds to Professor Mari's context. This is the small text half: two pieces of permanent prompt that repeat what the model already gets elsewhere, about 1.1k chars off every request. The bigger text cuts from the plan (tool rules, permissions, field names) are parked on purpose: they would mostly help 16k-context setups, and the risk lands on weak models.

What changed

Skill index (assets/mari-skills/*.md)

  • Eight built-in skill descriptions are trimmed to the words that say when to read the handbook (the surface and the symptoms), dropping the list of what the handbook covers. About 680 chars. The presets description stays as it was: its whole tail is trigger words.
  • The same descriptions feed the skills menu search, so every trigger word stays.

app_data tool description (workspace-agent.service.ts)

  • Drops the list of every surface app_data covers (chats, characters, folders, personas…), which the action enum already names. 853 → 445 chars.
  • The paging (nextOffset), lorebook.getEntry and elided-field (field=) hints stay, slightly tightened.

Review follow-ups from #8376

  • pi-runtime.ts: the system prompt separator is one named constant, used by both the join and the <workspace_context> offset.
  • workspace-agent.service.ts: CHANGED_FIELDS_MAX_DEPTH sits above the doc comment, so the doc stays on changedFieldsOnly.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Agent-run checks:

  • pnpm check exits 0.
  • node scripts/run-regressions.mjs --filter passes for skill (4/4), professor-mari (23/23), mari- (18/18), app-data (2/2) and pi-runtime (1/1). The full suite is left to CI.

Live canaries by Ylli on Gemma 4 12b (nanogpt), after each commit:

  • Character create: reads the characters handbook first, saves a full card.
  • Preset edit: the first preset.update is refused by the handbook gate, she reads builtin-presets, then saves and verifies.
  • A 210-entry lorebook: reads total correctly, and fetches the last entry with offset: 209, limit: 1.
  • "What lorebooks do I have?": correct list.
  • Skills menu search for words kept in the trimmed tails: "aliases" finds Characters and personas; "fires" finds Decisions and Lorebook authoring.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No UI changes beyond shorter skill descriptions in the skills menu.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8386 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `perf/prompt-diet-cuts` --- ### 📝 Commits (2) - [`4d80963`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4d8096341532f0401751860125ff691536e60e94) perf(mari): trim built-in skill descriptions to their triggers (K1) - [`b34999a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b34999a2b4a9586b58316199b000aa5ef000ff8d) perf(mari): drop the entity list from the app_data tool description (T2) ### 📊 Changes **10 files changed** (+17 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/assets/mari-skills/characters.md` (+1 -1) 📝 `packages/server/src/assets/mari-skills/decisions.md` (+1 -1) 📝 `packages/server/src/assets/mari-skills/extensions.md` (+1 -1) 📝 `packages/server/src/assets/mari-skills/home-widgets.md` (+1 -1) 📝 `packages/server/src/assets/mari-skills/lorebook.md` (+1 -1) 📝 `packages/server/src/assets/mari-skills/onboarding.md` (+1 -1) 📝 `packages/server/src/assets/mari-skills/repair.md` (+1 -1) 📝 `packages/server/src/assets/mari-skills/themes.md` (+1 -1) 📝 `packages/server/src/services/professor-mari/pi-runtime.ts` (+5 -2) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+4 -4) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Part of #8375 (follow-up to #8376) ## Why this change #8376 cut how much each tool turn adds to Professor Mari's context. This is the small text half: two pieces of permanent prompt that repeat what the model already gets elsewhere, about 1.1k chars off every request. The bigger text cuts from the plan (tool rules, permissions, field names) are parked on purpose: they would mostly help 16k-context setups, and the risk lands on weak models. ## What changed **Skill index** (`assets/mari-skills/*.md`) - Eight built-in skill descriptions are trimmed to the words that say *when* to read the handbook (the surface and the symptoms), dropping the list of what the handbook covers. About 680 chars. The presets description stays as it was: its whole tail is trigger words. - The same descriptions feed the skills menu search, so every trigger word stays. **`app_data` tool description** (`workspace-agent.service.ts`) - Drops the list of every surface app_data covers (chats, characters, folders, personas…), which the `action` enum already names. 853 → 445 chars. - The paging (`nextOffset`), `lorebook.getEntry` and elided-field (`field=`) hints stay, slightly tightened. **Review follow-ups from #8376** - `pi-runtime.ts`: the system prompt separator is one named constant, used by both the join and the `<workspace_context>` offset. - `workspace-agent.service.ts`: `CHANGED_FIELDS_MAX_DEPTH` sits above the doc comment, so the doc stays on `changedFieldsOnly`. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-run checks: - `pnpm check` exits 0. - `node scripts/run-regressions.mjs --filter` passes for `skill` (4/4), `professor-mari` (23/23), `mari-` (18/18), `app-data` (2/2) and `pi-runtime` (1/1). The full suite is left to CI. Live canaries by Ylli on Gemma 4 12b (nanogpt), after each commit: - Character create: reads the characters handbook first, saves a full card. - Preset edit: the first `preset.update` is refused by the handbook gate, she reads `builtin-presets`, then saves and verifies. - A 210-entry lorebook: reads `total` correctly, and fetches the last entry with `offset: 209, limit: 1`. - "What lorebooks do I have?": correct list. - Skills menu search for words kept in the trimmed tails: "aliases" finds Characters and personas; "fires" finds Decisions and Lorebook authoring. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No UI changes beyond shorter skill descriptions in the skills menu. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:39 +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#8569
No description provided.