[PR #8063] [MERGED] feat(mari): let Professor Mari edit ruleset character sheets #8083

Closed
opened 2026-10-24 04:10:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8063
Author: @kolacheee
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @kolacheee

Base: staging ← Head: claude/project-thread-cpecc0


📝 Commits (10+)

  • 1c3f293 feat(mari): let Professor Mari edit ruleset character sheets
  • 88dc6a4 Merge branch 'staging' into claude/project-thread-cpecc0
  • 0c44e21 fix(mari): name refused rows by what a resend uses; live-read values
  • 40c83b7 Merge remote-tracking branch 'origin/staging' into claude/project-thread-cpecc0
  • e1709fd fix(mari): refuse a cleared value under an unknown sheet id
  • 786a72f Merge remote-tracking branch 'origin/staging' into claude/project-thread-cpecc0
  • 1857b30 fix(mari): tie the cleared-id table to the patch's own keys
  • b9754a9 fix(mari): key the cleared-id check by every clearable patch map
  • d312b97 fix(mari): one record applies and checks every clearable map; name cleared unknown list columns
  • b42fbfc Merge remote-tracking branch 'origin/staging' into claude/project-thread-cpecc0

📊 Changes

7 files changed (+778 additions, -2 deletions)

View changed files

📝 docs/characters/colors-and-stats.md (+2 -0)
📝 docs/home/professor-mari.md (+1 -0)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+114 -0)
➕ packages/server/src/services/mari-db/ruleset-sheets.ts (+339 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+8 -2)
📝 packages/shared/src/schemas/ruleset.schema.ts (+15 -0)
➕ scripts/regressions/mari/ruleset-sheets.regression.ts (+299 -0)

📄 Description

Linked issue

Closes #8062

Why this change

  • Professor Mari could not touch a character's or persona's Game Mode ruleset sheet. persona.update only passes text fields, and a raw write of personaStats or data.extensions would risk the bars, RPG stats and every other ruleset's sheet that share that object, with nothing checking the values.

What changed

  • New app_data actions: persona.rulesetSheet.get|update and character.rulesetSheet.get|update. One patch shape works for every ruleset, because every ruleset is built from the same sheet primitives.
  • get without rulesetId lists the stored sheets and installed rulesets. With it, it returns the sheet in the current layout, the numbers it works out to, and the layout of ids and limits a patch is written against.
  • update merges abilities, skills, saves, bonuses, fields (null clears a value back to its default) and list rows (update/remove/add, or set to replace a list) into the stored build. A missing sheet starts blank. Every touched value is checked with the rule creature sheets already use, now exported as rulesetSheetBuildIssues, and every problem is listed at once. Only that ruleset's entry is written, and a stored sheet that cannot be read is never overwritten. Live state (current health, spent slots) is not written here.
  • Mari's prompt and tool schema know the actions. Docs: a line on the Professor Mari page and in Ruleset sheets.

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

  • New regression scripts/regressions/mari/ruleset-sheets.regression.ts drives the real MariDbService against both docs example rulesets: Ember Roads on a persona and Gravewatch on a card. It covers listing and previews, every refusal leaving the stored sheet untouched (including cleared unknown ids such as abilities: { brawn: 2, luck: null }), list update/remove/add with refused rows named by their stored index after a removal, set beside empty arrays, unreadable sheets never being overwritten, and Gravewatch's worked-out harm_left in values.
  • Local results on the final head: pnpm check passed; regression lanes mari 19/19, professor-mari 19/19, persona 6/6, game-ruleset 266/266, plus the new regression 1/1. No UI changes, so no manual click-through or container run beyond CI.

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): added to #7512
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No UI changes.


🔄 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/8063 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-cpecc0` --- ### 📝 Commits (10+) - [`1c3f293`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1c3f2930f1adfc091fbff269bdcf10653eebeac6) feat(mari): let Professor Mari edit ruleset character sheets - [`88dc6a4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/88dc6a435f3fdbebaf16789842c3735440f794a3) Merge branch 'staging' into claude/project-thread-cpecc0 - [`0c44e21`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0c44e217bc244e502663d2356bf8c2688d7588be) fix(mari): name refused rows by what a resend uses; live-read values - [`40c83b7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/40c83b7d1db652a6222b5f4da86d6b1273059d7c) Merge remote-tracking branch 'origin/staging' into claude/project-thread-cpecc0 - [`e1709fd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e1709fd5bf92220ceca0b5abffafc6508d9a4c54) fix(mari): refuse a cleared value under an unknown sheet id - [`786a72f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/786a72f31b117b8e056da3ffeb2ac51dcd58c27d) Merge remote-tracking branch 'origin/staging' into claude/project-thread-cpecc0 - [`1857b30`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1857b30cdf7624f5106d7b6b32cb5ce3dcdd9434) fix(mari): tie the cleared-id table to the patch's own keys - [`b9754a9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b9754a9c16812c7cc070e5e84a683e0ff3c574ff) fix(mari): key the cleared-id check by every clearable patch map - [`d312b97`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d312b9743b32c11cdac46b7807f15ffccaa7c078) fix(mari): one record applies and checks every clearable map; name cleared unknown list columns - [`b42fbfc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b42fbfce31c45849438a243eda6a03648a6f38b9) Merge remote-tracking branch 'origin/staging' into claude/project-thread-cpecc0 ### 📊 Changes **7 files changed** (+778 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/colors-and-stats.md` (+2 -0) 📝 `docs/home/professor-mari.md` (+1 -0) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+114 -0) ➕ `packages/server/src/services/mari-db/ruleset-sheets.ts` (+339 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+8 -2) 📝 `packages/shared/src/schemas/ruleset.schema.ts` (+15 -0) ➕ `scripts/regressions/mari/ruleset-sheets.regression.ts` (+299 -0) </details> ### 📄 Description ## Linked issue Closes #8062 ## Why this change - Professor Mari could not touch a character's or persona's Game Mode ruleset sheet. `persona.update` only passes text fields, and a raw write of `personaStats` or `data.extensions` would risk the bars, RPG stats and every other ruleset's sheet that share that object, with nothing checking the values. ## What changed - New `app_data` actions: `persona.rulesetSheet.get|update` and `character.rulesetSheet.get|update`. One patch shape works for every ruleset, because every ruleset is built from the same sheet primitives. - `get` without `rulesetId` lists the stored sheets and installed rulesets. With it, it returns the sheet in the current layout, the numbers it works out to, and the layout of ids and limits a patch is written against. - `update` merges `abilities`, `skills`, `saves`, `bonuses`, `fields` (`null` clears a value back to its default) and list rows (`update`/`remove`/`add`, or `set` to replace a list) into the stored build. A missing sheet starts blank. Every touched value is checked with the rule creature sheets already use, now exported as `rulesetSheetBuildIssues`, and every problem is listed at once. Only that ruleset's entry is written, and a stored sheet that cannot be read is never overwritten. Live state (current health, spent slots) is not written here. - Mari's prompt and tool schema know the actions. Docs: a line on the Professor Mari page and in Ruleset sheets. ## Validation - [x] `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 - New regression `scripts/regressions/mari/ruleset-sheets.regression.ts` drives the real `MariDbService` against both docs example rulesets: Ember Roads on a persona and Gravewatch on a card. It covers listing and previews, every refusal leaving the stored sheet untouched (including cleared unknown ids such as `abilities: { brawn: 2, luck: null }`), list update/remove/add with refused rows named by their stored index after a removal, `set` beside empty arrays, unreadable sheets never being overwritten, and Gravewatch's worked-out `harm_left` in `values`. - Local results on the final head: `pnpm check` passed; regression lanes mari 19/19, professor-mari 19/19, persona 6/6, game-ruleset 266/266, plus the new regression 1/1. No UI changes, so no manual click-through or container run beyond CI. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation): added to #7512 - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:10:13 +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#8083
No description provided.