[PR #7769] [MERGED] feat(mari): let Professor Mari write interactive onboarding #7919

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

📋 Pull Request Information

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

Base: staging ← Head: feat/mari-onboarding


📝 Commits (5)

  • 3617b34 feat(mari): character.onboarding.get|update app_data actions
  • 1d97b58 feat(mari): teach Professor Mari interactive onboarding
  • 7ed5baf fix(mari): onboarding guidance tweaks from live runs
  • faae87b docs(onboarding): match the Mari section to how her change card looks
  • d5ace34 fix(mari): refuse unknown onboarding question/option keys; neutral notice wording

📊 Changes

7 files changed (+534 additions, -7 deletions)

View changed files

📝 docs/characters/interactive-onboarding.md (+4 -0)
📝 docs/home/professor-mari.md (+3 -3)
➕ packages/server/src/services/mari-db/character-onboarding.ts (+202 -0)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+57 -0)
📝 packages/server/src/services/professor-mari/workspace-agent.service.ts (+16 -4)
➕ scripts/regressions/mari/character-onboarding.regression.ts (+210 -0)
➕ scripts/regressions/professor-mari-onboarding-guidance.regression.ts (+42 -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 #7760

Why this change

  • Writing an interactive onboarding by hand takes a while: the questions, the five template fields, {{name}} placeholders, {{#if}} follow-ups, and the naming rules. Professor Mari is the obvious helper, but she didn't know the feature existed. The only way she could have written one was a raw extensions.onboarding patch with no checks, so a misspelled name or a block the editor can't read ("Start over") would have been saved without warning.

What changed

  • You can ask Professor Mari to write a card's interactive onboarding, e.g. "Write a fun onboarding for Ambriel, with a template persona and a character question or two." She writes the persona questions, the five template fields and character questions, turns onboarding on, and adds each character question's {{name}} to the card's own description, personality or scenario.
  • Her onboarding is checked before it is saved. Two new app_data actions, character.onboarding.get and character.onboarding.update:
    • The server fills missing question and option ids and blank option values (the label is used).
    • It runs the existing onboarding schema and validateOnboarding. Names that are empty, invalid, reserved or used twice, a {{name}} with no question, a plain {{if}} without #, unknown keys or a wrong shape are refused, with one message listing every problem. She fixes them and sends again.
    • A question nothing uses still saves, but with a notice. The result she reads says so, so she fixes it instead of reporting done.
    • update merges: keys she sends replace, keys she leaves out stay, and a question list she sends replaces that whole list.
    • Writes go through the normal character replace mutation, so change cards, Undo, apply and character versioning work as for her other edits.
  • Her prompt teaches the feature: a rule paragraph (shape, both question lists, naming and {{#if}} rules, where character questions go, lowercase option values for mid-sentence answers) and one worked example.
  • Docs: a "Let Professor Mari write it" section in docs/characters/interactive-onboarding.md and one line on docs/home/professor-mari.md.

Design notes

  • Only get and update, no per-question add/update/delete actions (unlike preset choice blocks). A list holds at most 100 questions, so read, edit, resend is cheap, and two actions keep her prompt and our code small. Per-question actions can follow if she struggles with them.
  • Live runs shaped the prompt. Card: Ambriel (bleachbunny), a real Chub V2 card.
    • glm 5.3: clean first try (5 persona questions, 1 character question woven into her personality). Its option values carried their own article, giving "a A human city" in the persona, hence the lowercase-value rule.
    • ds4.1 flash (1017): put a character question's {{name}} into the onboarding template instead of the card. The server flagged the question as unused, but she still reported done. Two fixes followed: the prompt now says where character questions go and why, and a save with notices now says so in the result she reads.
    • ds4.1 flash rerun: clean, with 2 character questions in the card's scenario and 0 warnings.
  • The S1 prerequisite, mari characters update --json dropping sibling extensions, shipped separately in #7764.

Known limitations / follow-ups

  • Mari's change card doesn't show the onboarding itself. It reads "Changed personality and 1 more" and lists the onboarding only as "1 more field changed", because the receipt doesn't look inside nested objects. Follow-up: #7771.
  • Translated docs: #7772.

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

Local results (agent-run):

  • pnpm check: exit 0.
  • node scripts/run-regressions.mjs --filter onboarding: 6/6 passed.
  • --filter mari: 52/53 passed. The one failure, mari-appearance-pack.regression.mjs, is unrelated: on Windows sharp resolves a client sprite path as /C:/….
  • New regressions:
    • scripts/regressions/mari/character-onboarding.regression.ts drives the real MariDbService: valid write, partial update, 7 refusals that store nothing, unused-question notices and the result message Mari reads.
    • scripts/regressions/professor-mari-onboarding-guidance.regression.ts runs the prompt's worked example through the real server gate, so the example can't teach a broken pattern.
  • Local CodeRabbit on the server and prompt slices: 0 findings.
  • Ylli checked the player path for both live-run cards (fields and questions came out right).

To verify by hand:

  • Manually verify: ask Professor Mari "Write a fun onboarding for , with a template persona and a character question" and check the change card, then open the card's Onboarding tab: no editor warnings, and Rendered preview reads naturally.
  • Manually verify: start a Roleplay chat with that card, choose Create your persona, answer the questions, and check that the persona has the answers with no raw {{name}}, and that the character question's answer appears where Mari put it in the card.
  • Manually verify: ask her to change a single question ("make the origin question multi-select") and check that only that question changed.

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 new UI. Screenshots of the live run (glm 5.3): Mari's change card, then the card's Onboarding tab and Rendered preview.

Mari change card: personality edit plus 1 more field Ambriel Onboarding tab, interactive onboarding on Rendered preview of the persona Mari wrote

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Professor Mari can create and update interactive onboarding questions for character cards. Changes can be reviewed before they’re applied, and partial updates preserve existing content.
    • Onboarding changes are checked before saving. Invalid changes are rejected, while warnings flag unused questions.
  • Documentation
    • Added guidance and examples for creating onboarding content, updating character-card fields, and addressing validation issues.

🔄 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/7769 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `feat/mari-onboarding` --- ### 📝 Commits (5) - [`3617b34`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3617b342b4651baa9c074c99bce037b3abc98032) feat(mari): character.onboarding.get|update app_data actions - [`1d97b58`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1d97b5846351fbda1b44c6d2aa2efcdc5788374f) feat(mari): teach Professor Mari interactive onboarding - [`7ed5baf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7ed5baf030cc94e1c78c80e47a388deea30e7815) fix(mari): onboarding guidance tweaks from live runs - [`faae87b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/faae87b64a7e21d411022214fe2f7839f73cf165) docs(onboarding): match the Mari section to how her change card looks - [`d5ace34`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d5ace34cc6b4787e7974fd89062cfc0166833bef) fix(mari): refuse unknown onboarding question/option keys; neutral notice wording ### 📊 Changes **7 files changed** (+534 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/interactive-onboarding.md` (+4 -0) 📝 `docs/home/professor-mari.md` (+3 -3) ➕ `packages/server/src/services/mari-db/character-onboarding.ts` (+202 -0) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+57 -0) 📝 `packages/server/src/services/professor-mari/workspace-agent.service.ts` (+16 -4) ➕ `scripts/regressions/mari/character-onboarding.regression.ts` (+210 -0) ➕ `scripts/regressions/professor-mari-onboarding-guidance.regression.ts` (+42 -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 #7760 ## Why this change - Writing an interactive onboarding by hand takes a while: the questions, the five template fields, `{{name}}` placeholders, `{{#if}}` follow-ups, and the naming rules. Professor Mari is the obvious helper, but she didn't know the feature existed. The only way she could have written one was a raw `extensions.onboarding` patch with no checks, so a misspelled name or a block the editor can't read ("Start over") would have been saved without warning. ## What changed - **You can ask Professor Mari to write a card's interactive onboarding**, e.g. "Write a fun onboarding for Ambriel, with a template persona and a character question or two." She writes the persona questions, the five template fields and character questions, turns onboarding on, and adds each character question's `{{name}}` to the card's own description, personality or scenario. - **Her onboarding is checked before it is saved.** Two new `app_data` actions, `character.onboarding.get` and `character.onboarding.update`: - The server fills missing question and option ids and blank option values (the label is used). - It runs the existing onboarding schema and `validateOnboarding`. Names that are empty, invalid, reserved or used twice, a `{{name}}` with no question, a plain `{{if}}` without `#`, unknown keys or a wrong shape are refused, with one message listing every problem. She fixes them and sends again. - A question nothing uses still saves, but with a notice. The result she reads says so, so she fixes it instead of reporting done. - `update` merges: keys she sends replace, keys she leaves out stay, and a question list she sends replaces that whole list. - Writes go through the normal character `replace` mutation, so change cards, Undo, `apply` and character versioning work as for her other edits. - **Her prompt teaches the feature**: a rule paragraph (shape, both question lists, naming and `{{#if}}` rules, where character questions go, lowercase option values for mid-sentence answers) and one worked example. - **Docs:** a "Let Professor Mari write it" section in `docs/characters/interactive-onboarding.md` and one line on `docs/home/professor-mari.md`. ### Design notes - **Only `get` and `update`**, no per-question add/update/delete actions (unlike preset choice blocks). A list holds at most 100 questions, so read, edit, resend is cheap, and two actions keep her prompt and our code small. Per-question actions can follow if she struggles with them. - **Live runs shaped the prompt.** Card: Ambriel (bleachbunny), a real Chub V2 card. - **glm 5.3:** clean first try (5 persona questions, 1 character question woven into her personality). Its option values carried their own article, giving "a A human city" in the persona, hence the lowercase-value rule. - **ds4.1 flash (1017):** put a character question's `{{name}}` into the onboarding template instead of the card. The server flagged the question as unused, but she still reported done. Two fixes followed: the prompt now says where character questions go and why, and a save with notices now says so in the result she reads. - **ds4.1 flash rerun:** clean, with 2 character questions in the card's scenario and 0 warnings. - The S1 prerequisite, `mari characters update --json` dropping sibling extensions, shipped separately in #7764. ### Known limitations / follow-ups - **Mari's change card doesn't show the onboarding itself.** It reads "Changed personality and 1 more" and lists the onboarding only as "1 more field changed", because the receipt doesn't look inside nested objects. Follow-up: #7771. - Translated docs: #7772. ## 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 Local results (agent-run): - `pnpm check`: exit 0. - `node scripts/run-regressions.mjs --filter onboarding`: 6/6 passed. - `--filter mari`: 52/53 passed. The one failure, `mari-appearance-pack.regression.mjs`, is unrelated: on Windows `sharp` resolves a client sprite path as `/C:/…`. - New regressions: - `scripts/regressions/mari/character-onboarding.regression.ts` drives the real `MariDbService`: valid write, partial update, 7 refusals that store nothing, unused-question notices and the result message Mari reads. - `scripts/regressions/professor-mari-onboarding-guidance.regression.ts` runs the prompt's worked example through the real server gate, so the example can't teach a broken pattern. - Local CodeRabbit on the server and prompt slices: 0 findings. - Ylli checked the player path for both live-run cards (fields and questions came out right). To verify by hand: - Manually verify: ask Professor Mari "Write a fun onboarding for <a card>, with a template persona and a character question" and check the change card, then open the card's **Onboarding** tab: no editor warnings, and **Rendered preview** reads naturally. - Manually verify: start a Roleplay chat with that card, choose **Create your persona**, answer the questions, and check that the persona has the answers with no raw `{{name}}`, and that the character question's answer appears where Mari put it in the card. - Manually verify: ask her to change a single question ("make the origin question multi-select") and check that only that question changed. ## 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 new UI. Screenshots of the live run (glm 5.3): Mari's change card, then the card's Onboarding tab and Rendered preview. <img src="https://raw.githubusercontent.com/ylli-selmani/Marinara-Engine-Ylli-Edits/pr-assets/mari-onboarding/glm-1-change-card.jpg" width="480" alt="Mari change card: personality edit plus 1 more field"> <img src="https://raw.githubusercontent.com/ylli-selmani/Marinara-Engine-Ylli-Edits/pr-assets/mari-onboarding/glm-1-editor-toggle.jpg" width="480" alt="Ambriel Onboarding tab, interactive onboarding on"> <img src="https://raw.githubusercontent.com/ylli-selmani/Marinara-Engine-Ylli-Edits/pr-assets/mari-onboarding/glm-1-rendered-preview.jpg" width="480" alt="Rendered preview of the persona Mari wrote"> 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Professor Mari can create and update interactive onboarding questions for character cards. Changes can be reviewed before they’re applied, and partial updates preserve existing content. * Onboarding changes are checked before saving. Invalid changes are rejected, while warnings flag unused questions. * **Documentation** * Added guidance and examples for creating onboarding content, updating character-card fields, and addressing validation issues. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:08:50 +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#7919
No description provided.