[PR #8371] [MERGED] fix(mari): clear persona fields with "", explain nested onboarding, let onboarding cover character.update #8321

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

📋 Pull Request Information

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

Base: staging ← Head: fix/mari-window-and-engine-fixes


📝 Commits (2)

  • 0f58401 fix(mari): clear persona fields with "", explain nested onboarding, let onboarding cover character.update
  • 4d02fc9 docs(mari): list every persona column persona.update writes

📊 Changes

8 files changed (+123 additions, -17 deletions)

View changed files

📝 packages/server/src/assets/mari-skills/characters.md (+2 -2)
📝 packages/server/src/assets/mari-skills/onboarding.md (+1 -0)
📝 packages/server/src/services/mari-db/character-onboarding.ts (+11 -3)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+25 -12)
📝 packages/server/src/services/professor-mari/workspace-commands.ts (+6 -0)
📝 scripts/regressions/mari/app-data-envelope-errors.regression.ts (+19 -0)
📝 scripts/regressions/mari/character-onboarding.regression.ts (+6 -0)
📝 scripts/regressions/mari/db-review-durability.regression.ts (+53 -0)

📄 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

Closes #8368

(#8367, the Mari window layout on phones, was planned for this PR. It doesn't reproduce on current staging, so it stays open; see the issue.)

Why this change

Professor Mari reported four small engine and handbook warts herself. Each one costs a small model a wrong turn:

  1. Persona fields couldn't be cleared. persona.update silently dropped "" for every text field. Sent alone, the clear got the wrong error. Sent beside another field, the write said verified, so she told the user a clear had happened when it hadn't. Characters already cleared fine.
  2. An onboarding block nested one level too deep ({"onboarding":{…}} inside the onboarding argument) got "Unknown onboarding key(s): onboarding." That's true, but it doesn't say what to do.
  3. onboarding.md tells her to send the card patch with the block, but character.update was gated on the characters handbook. After reading only onboarding, the block saved and the patch was refused.
  4. characters.md left out two persona columns, imageAppearance and imageAppearanceEnabled, which persona.update writes.

What changed

Persona clears (mari-db.service.ts)

  • New assignClearableStringField. It works like assignStringField, except that "" and whitespace-only count as a value and are saved as "", matching how summary and the character card fields already behave.
  • persona.update uses it for every text field except name, which still never clears. null and non-strings are still dropped, as on characters.

Nested onboarding hint (character-onboarding.ts)

  • Sometimes an unknown key is onboarding, patch or data and holds an object. The error then adds: "The block is nested one level too deep: send its fields directly as the onboarding argument."
  • The same keys holding a string get no hint.
  • onboarding.md's error table gets the matching row.

Handbook gate (workspace-commands.ts)

  • Reading builtin-onboarding now satisfies the gate for character.update, and only that action. character.create still needs the characters handbook, and having read nothing is still refused.
  • Rejected: a handbook line telling her to read a second handbook first. Covering it in the engine is cheaper for every model, and onboarding already documents the exact patch.

Handbook (characters.md)

  • The persona columns list now includes imageAppearance and imageAppearanceEnabled (a boolean).
  • The "clearing differs" workaround is replaced by one line: characters and personas both clear with ""; null is dropped.

Regressions

  • db-review-durability covers four persona cases:
    • aboutMe: "" beside name clears it, and the read-back verifies it;
    • a lone aboutMe: "" counts as a patch field and clears;
    • whitespace-only clears;
    • name: "" is not applied.
  • character-onboarding: a nested block names the fix; a wrapper key holding a string doesn't.
  • app-data-envelope-errors: onboarding covers character.update; character.create is still gated; having read nothing is still refused.

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 character-onboarding, db-review-durability, app-data-envelope-errors, builtin-skills, onboarding-guidance and persona.
  • The nested-block test was proven to bite: removing the hint fails it, and restoring it passes.

Still to check by hand:

  • Ask Mari to clear a persona's About Me. Confirm the field is empty afterwards and her reply doesn't claim more than happened.
  • Ask Mari to add onboarding to a card and change a card field in the same request, having read only the onboarding handbook. Confirm both writes land.

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. The change is in Mari's engine and her handbooks.

🤖 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/8371 **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:** `fix/mari-window-and-engine-fixes` --- ### 📝 Commits (2) - [`0f58401`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0f58401621c6b3077e0383abd16190044a3c72c6) fix(mari): clear persona fields with "", explain nested onboarding, let onboarding cover character.update - [`4d02fc9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4d02fc90446ff6d095bc47ee426b1be34abf7445) docs(mari): list every persona column persona.update writes ### 📊 Changes **8 files changed** (+123 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/assets/mari-skills/characters.md` (+2 -2) 📝 `packages/server/src/assets/mari-skills/onboarding.md` (+1 -0) 📝 `packages/server/src/services/mari-db/character-onboarding.ts` (+11 -3) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+25 -12) 📝 `packages/server/src/services/professor-mari/workspace-commands.ts` (+6 -0) 📝 `scripts/regressions/mari/app-data-envelope-errors.regression.ts` (+19 -0) 📝 `scripts/regressions/mari/character-onboarding.regression.ts` (+6 -0) 📝 `scripts/regressions/mari/db-review-durability.regression.ts` (+53 -0) </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 Closes #8368 (#8367, the Mari window layout on phones, was planned for this PR. It doesn't reproduce on current staging, so it stays open; see the issue.) ## Why this change Professor Mari reported four small engine and handbook warts herself. Each one costs a small model a wrong turn: 1. **Persona fields couldn't be cleared.** `persona.update` silently dropped `""` for every text field. Sent alone, the clear got the wrong error. Sent beside another field, the write said `verified`, so she told the user a clear had happened when it hadn't. Characters already cleared fine. 2. **An onboarding block nested one level too deep** (`{"onboarding":{…}}` inside the `onboarding` argument) got "Unknown onboarding key(s): onboarding." That's true, but it doesn't say what to do. 3. **`onboarding.md` tells her to send the card patch with the block**, but `character.update` was gated on the characters handbook. After reading only onboarding, the block saved and the patch was refused. 4. **`characters.md` left out two persona columns,** `imageAppearance` and `imageAppearanceEnabled`, which `persona.update` writes. ## What changed **Persona clears** (`mari-db.service.ts`) - New `assignClearableStringField`. It works like `assignStringField`, except that `""` and whitespace-only count as a value and are saved as `""`, matching how `summary` and the character card fields already behave. - `persona.update` uses it for every text field except `name`, which still never clears. `null` and non-strings are still dropped, as on characters. **Nested onboarding hint** (`character-onboarding.ts`) - Sometimes an unknown key is `onboarding`, `patch` or `data` and holds an object. The error then adds: "The block is nested one level too deep: send its fields directly as the `onboarding` argument." - The same keys holding a string get no hint. - `onboarding.md`'s error table gets the matching row. **Handbook gate** (`workspace-commands.ts`) - Reading `builtin-onboarding` now satisfies the gate for `character.update`, and only that action. `character.create` still needs the characters handbook, and having read nothing is still refused. - Rejected: a handbook line telling her to read a second handbook first. Covering it in the engine is cheaper for every model, and onboarding already documents the exact patch. **Handbook** (`characters.md`) - The persona columns list now includes `imageAppearance` and `imageAppearanceEnabled` (a boolean). - The "clearing differs" workaround is replaced by one line: characters and personas both clear with `""`; `null` is dropped. **Regressions** - `db-review-durability` covers four persona cases: - `aboutMe: ""` beside `name` clears it, and the read-back verifies it; - a lone `aboutMe: ""` counts as a patch field and clears; - whitespace-only clears; - `name: ""` is not applied. - `character-onboarding`: a nested block names the fix; a wrapper key holding a string doesn't. - `app-data-envelope-errors`: onboarding covers `character.update`; `character.create` is still gated; having read nothing is still refused. ## 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 `character-onboarding`, `db-review-durability`, `app-data-envelope-errors`, `builtin-skills`, `onboarding-guidance` and `persona`. - The nested-block test was proven to bite: removing the hint fails it, and restoring it passes. Still to check by hand: - Ask Mari to clear a persona's About Me. Confirm the field is empty afterwards and her reply doesn't claim more than happened. - Ask Mari to add onboarding to a card and change a card field in the same request, having read only the onboarding handbook. Confirm both writes land. ## 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. The change is in Mari's engine and her handbooks. 🤖 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-10-27 06:07:42 +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#8321
No description provided.