[PR #1957] [MERGED] Otome Hearth 0.6.0: each love interest's plush is the animal that fits them, drawn as SVG #2046

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1957
Author: @SpicyMarinara
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/otome-plush-svg-1954


📝 Commits (6)

  • 5db0df1 feat(otome-forge): each love interest's plush is the animal that fits them, drawn as SVG (#1954)
  • 8832d5c fix(otome-forge): the plush allow-list refuses inherited attribute names instead of throwing (#1954)
  • 29c08b4 Merge staging (0.5.2: banners follow the Heat) into 0.6.0
  • f3f4ffe Merge staging (0.5.3: what the protagonist knows, canon worlds, rest) into 0.6.0
  • 08b898b fix(otome-forge): the plush allow-list skips comments as tokens, refuses repeats, caps what it keeps (#1954)
  • 29e2eff fix(otome-forge): the plush allow-list reads x1..y2 as names and takes no comments at all (#1954)

📊 Changes

23 files changed (+887 additions, -248 deletions)

View changed files

➕ artifacts/otome-forge-0.6.0.zip (+0 -0)
📝 catalog/preview/catalog.json (+8 -8)
📝 catalog/preview/notes.json (+6 -6)
📝 catalog/preview/v2/catalog.json (+8 -8)
📝 catalog/preview/v2/notes.json (+6 -6)
📝 catalog/preview/v3/catalog.json (+8 -8)
📝 catalog/preview/v3/notes.json (+6 -6)
📝 packages/otome-forge/CHANGELOG.md (+4 -0)
📝 packages/otome-forge/README.md (+7 -5)
📝 packages/otome-forge/client.js (+40 -40)
📝 packages/otome-forge/manifest.json (+5 -5)
📝 packages/otome-forge/server.mjs (+127 -125)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/components/PlushShelf.tsx (+24 -12)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/dates/ClawMachine.tsx (+10 -8)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts (+9 -0)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/claw.ts (+9 -4)
➕ packages/otome-forge/src/engine/packages/server/src/services/otome-forge/art/plush-svg.ts (+152 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/minigames/claw.ts (+6 -1)
➕ packages/otome-forge/src/engine/packages/server/src/services/otome-forge/minigames/plush.ts (+180 -0)
📝 packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/claw.ts (+19 -4)

...and 3 more files

📄 Description

Pull request

Linked issue

Closes #1954

Why this change

  • The maintainer's request: each love interest's Claw Machine plush should be an animal plushie that fits them, in their colours, drawn as SVG by the model. Their examples: Dottore as a cyan raven with red eyes, Pantalone as a black cat with violet eyes.
  • Their pick: the model writes the SVG (over hand-drawn templates), for any animal, unique to each love interest.
  • Before: a love interest's plush was a round frame around their look, portrait or initials, and the Claw Machine never called a model.

What changed

otome-forge 0.6.0 (staging-only).

  • Drawing (minigames/plush.ts):
    • When: a background "ensure" job per love interest, copied from Home's line packs. GET /play queues it for a love interest with a bible and no plush, and never waits for it.
    • The call: one Planning call picks the animal from who they are (personality, role and manner first, look second). It draws a 64×64 SVG chibi plush in their look's colours, with eyes in their eye colour, their accent colour, and the series plushies' outline ink.
    • Kept: on the unit (plushArt), and never drawn again.
    • Failures: a failure is left alone for 10 minutes, and the prompt is logged in debug mode.
  • The allow-list (art/plush-svg.ts): the model's SVG never reaches a browser as written.
    • Rebuilt from tokens: only svg, g, path, circle, ellipse, rect, polygon, polyline, line; only the listed attributes, each value matching a pattern (numbers, path data, #rrggbb or a colour name, translate/rotate/scale); well nested under our own <svg> root (namespace and box).
    • Refused, with a reason the repair turn sends back: text, entities, URLs, ids, styles, scripts, links, images, CDATA, doctype and unknown attributes.
    • Checked on every read (schemas/unit.ts normalizePlushArt); a damaged plush is dropped and drawn again.
    • Shown as an <image> from a data URL, which runs nothing. The Engine's CSP already allows data: images.
    • No dependency: the server bundle has no XML parser, and Node has no DOMParser.
  • Showing it: GET /play's animal carries the plush. PlushArt draws it in place of the framed look on the machine, the haul and the shelf, and falls back to the framed look until it exists.
  • Docs and release: the README (the Claw Machine, a costs row, what is stored), CHANGELOG 0.6.0, and the rebuilt bundle, client, manifest, catalogs, notes and 0.6.0 zip.

Order: staging (with #1952's 0.5.2 and #1956's 0.5.3) is merged in, and the bundle is rebuilt as 0.6.0.

Package and security impact

  • Affected package IDs: otome-forge (0.6.0, staging-only).
  • Engine compatibility impact: none.
  • New or changed permissions/entrypoints: no new route. GET /play now queues a background model call per love interest, once.
  • Security:
    • Model-written markup is shown in the browser only after the server-side allow-list rebuilds it.
    • It's shown only as an image from a data URL, never inline.
    • The allow-list is checked again on every read.
  • Restart, storage, update, or uninstall impact:
    • A new optional unit field, plushArt; units without one read as before.
    • It's swept with the run, and no gallery file is made.
    • The retry cool-down is held in memory only, as the line packs' is.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Agent-side checks:

  • Pass: npm run test:otome-forge (492 + 12), the strict typecheck, npm run check, git diff --check, test-catalog-lanes, validate-package-locales and catalog-release-notes.
  • tests/otome-forge-plush.regression.ts (new):
    • The allow-list: a plush is rebuilt with our own root, and passes again unchanged. Its data URL decodes to the clean SVG.
    • Refusals: 29 kinds of markup are refused with a reason and never become a picture, among them scripts, styles, foreignObject, images, use, links, handlers, xlink:href, style attributes, ids, url() paints, matrix, entities, text, CDATA, doctype, unquoted values, uppercase tags, nested or misordered tags, unclosed or extra content, and length or shape limits.
    • On read: a stored plush is checked again; damaged ones are dropped.
    • GET /play: one call per love interest, in the background. The prompt carries their accent and look, a kept plush is shown as a data URL and never drawn again, and the prompt is logged in debug mode.
    • Failures: a refused SVG gets one repair turn that says why. A love interest whose plush failed is left alone within the cool-down and asked again after it.
    • Fail without the fix: turning the allow-list off fails 2 tests, and so does turning the "draw once" checks off.
  • tests/otome-forge-claw.regression.ts: unchanged and passing. A round still calls no model.
  • Not run locally:
    • validate-catalog: the sparse worktree leaves out other packages' zips, so CI runs it.
    • The browser suite: CI runs it. The claw e2e mocks GET /play, so it still covers the framed-look fallback.
  • Local CodeRabbit: 1 finding, fixed in 8832d5c40. An attribute named like an Object.prototype key (constructor, toString) made the allow-list throw instead of refusing the SVG; the lookup now uses own keys only, and the tests cover both names.
  • CodeQL (incomplete multi-character sanitization): fixed in 08b898b6f. Comments are skipped as tokens instead of cut out with a regex replace, so the text is never rewritten.
  • Dottore:
    • Repeated attributes: fixed in 08b898b6f. A repeat is refused, since it isn't well-formed XML and the plush would never load.
    • Prototype names: fixed in 8832d5c40.
  • Independent multi-agent review (security red team, job flow, client, release): 7 confirmed, 3 refuted. Fixed in 08b898b6f:
    • repeated attributes;
    • the length cap measured before the rebuild, so a kept plush could be dropped on read and drawn again on every visit;
    • two README lines;
    • a vacuous tooLong test;
    • the header in shared/claw.ts.
    • The prototype-name finding was already fixed.
    • Refuted: a zero-size viewBox (twice), and the "first time you open Dates" wording. That wording is still made more accurate.
    • No bypass found: the red team found no way to get script, CSS, links or external fetches through, and no measurable ReDoS slowdown on 12,000-character inputs.

Please verify by hand:

  • Manually verify, with a Planning connection, that opening Dates once draws each love interest's plush in the background, and that after a moment the Claw Machine, the haul and the shelf show each as a fitting animal in their colours.
  • Manually verify, with debug mode on, that the server log shows the plush prompt once per love interest, and never again once each is drawn.
  • Manually verify that the shelf's not-yet-won silhouettes still grey out an animal plush.
  • Manually verify that with no Planning or Story connection, the plushies keep their framed look and nothing fails.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

Owner: @SpicyMarinara (made by Claude).

🤖 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-Agents/pull/1957 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/otome-plush-svg-1954` --- ### 📝 Commits (6) - [`5db0df1`](https://github.com/Pasta-Devs/Marinara-Agents/commit/5db0df1ae231cede6525482a594a66762a60fa74) feat(otome-forge): each love interest's plush is the animal that fits them, drawn as SVG (#1954) - [`8832d5c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/8832d5c40c9147353b9f1ff9b7d8815a73c525b1) fix(otome-forge): the plush allow-list refuses inherited attribute names instead of throwing (#1954) - [`29c08b4`](https://github.com/Pasta-Devs/Marinara-Agents/commit/29c08b45576713ae4a43af1c20e75e5d31083a9b) Merge staging (0.5.2: banners follow the Heat) into 0.6.0 - [`f3f4ffe`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f3f4ffef6650f85ac2b5cea971c3312caa72d6d1) Merge staging (0.5.3: what the protagonist knows, canon worlds, rest) into 0.6.0 - [`08b898b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/08b898b6fbada537652b7635a80659af430710b4) fix(otome-forge): the plush allow-list skips comments as tokens, refuses repeats, caps what it keeps (#1954) - [`29e2eff`](https://github.com/Pasta-Devs/Marinara-Agents/commit/29e2effeab6e91f82c18ac9e670be0712564c0b8) fix(otome-forge): the plush allow-list reads x1..y2 as names and takes no comments at all (#1954) ### 📊 Changes **23 files changed** (+887 additions, -248 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.6.0.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+8 -8) 📝 `catalog/preview/notes.json` (+6 -6) 📝 `catalog/preview/v2/catalog.json` (+8 -8) 📝 `catalog/preview/v2/notes.json` (+6 -6) 📝 `catalog/preview/v3/catalog.json` (+8 -8) 📝 `catalog/preview/v3/notes.json` (+6 -6) 📝 `packages/otome-forge/CHANGELOG.md` (+4 -0) 📝 `packages/otome-forge/README.md` (+7 -5) 📝 `packages/otome-forge/client.js` (+40 -40) 📝 `packages/otome-forge/manifest.json` (+5 -5) 📝 `packages/otome-forge/server.mjs` (+127 -125) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/components/PlushShelf.tsx` (+24 -12) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/dates/ClawMachine.tsx` (+10 -8) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/api-types.ts` (+9 -0) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/shared/claw.ts` (+9 -4) ➕ `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/art/plush-svg.ts` (+152 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/minigames/claw.ts` (+6 -1) ➕ `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/minigames/plush.ts` (+180 -0) 📝 `packages/otome-forge/src/engine/packages/server/src/services/otome-forge/routes/claw.ts` (+19 -4) _...and 3 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #1954 ## Why this change - **The maintainer's request:** each love interest's Claw Machine plush should be an animal plushie that fits them, in their colours, drawn as SVG by the model. Their examples: Dottore as a cyan raven with red eyes, Pantalone as a black cat with violet eyes. - **Their pick:** the model writes the SVG (over hand-drawn templates), for any animal, unique to each love interest. - **Before:** a love interest's plush was a round frame around their look, portrait or initials, and the Claw Machine never called a model. ## What changed `otome-forge` 0.6.0 (staging-only). - **Drawing (`minigames/plush.ts`):** - **When:** a background "ensure" job per love interest, copied from Home's line packs. GET /play queues it for a love interest with a bible and no plush, and never waits for it. - **The call:** one Planning call picks the animal from who they are (personality, role and manner first, look second). It draws a 64×64 SVG chibi plush in their look's colours, with eyes in their eye colour, their accent colour, and the series plushies' outline ink. - **Kept:** on the unit (`plushArt`), and never drawn again. - **Failures:** a failure is left alone for 10 minutes, and the prompt is logged in debug mode. - **The allow-list (`art/plush-svg.ts`):** the model's SVG never reaches a browser as written. - **Rebuilt from tokens:** only `svg, g, path, circle, ellipse, rect, polygon, polyline, line`; only the listed attributes, each value matching a pattern (numbers, path data, `#rrggbb` or a colour name, translate/rotate/scale); well nested under our own `<svg>` root (namespace and box). - **Refused, with a reason the repair turn sends back:** text, entities, URLs, ids, styles, scripts, links, images, CDATA, doctype and unknown attributes. - **Checked on every read** (`schemas/unit.ts normalizePlushArt`); a damaged plush is dropped and drawn again. - **Shown as an `<image>` from a data URL,** which runs nothing. The Engine's CSP already allows `data:` images. - No dependency: the server bundle has no XML parser, and Node has no DOMParser. - **Showing it:** GET /play's `animal` carries the plush. `PlushArt` draws it in place of the framed look on the machine, the haul and the shelf, and falls back to the framed look until it exists. - **Docs and release:** the README (the Claw Machine, a costs row, what is stored), CHANGELOG 0.6.0, and the rebuilt bundle, client, manifest, catalogs, notes and 0.6.0 zip. **Order:** staging (with #1952's 0.5.2 and #1956's 0.5.3) is merged in, and the bundle is rebuilt as 0.6.0. ## Package and security impact - Affected package IDs: `otome-forge` (0.6.0, staging-only). - Engine compatibility impact: none. - **New or changed permissions/entrypoints:** no new route. GET /play now queues a background model call per love interest, once. - **Security:** - Model-written markup is shown in the browser only after the server-side allow-list rebuilds it. - It's shown only as an image from a data URL, never inline. - The allow-list is checked again on every read. - **Restart, storage, update, or uninstall impact:** - A new optional unit field, `plushArt`; units without one read as before. - It's swept with the run, and no gallery file is made. - The retry cool-down is held in memory only, as the line packs' is. ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-side checks: - **Pass:** `npm run test:otome-forge` (492 + 12), the strict typecheck, `npm run check`, `git diff --check`, `test-catalog-lanes`, `validate-package-locales` and `catalog-release-notes`. - **`tests/otome-forge-plush.regression.ts` (new):** - **The allow-list:** a plush is rebuilt with our own root, and passes again unchanged. Its data URL decodes to the clean SVG. - **Refusals:** 29 kinds of markup are refused with a reason and never become a picture, among them scripts, styles, `foreignObject`, images, `use`, links, handlers, `xlink:href`, style attributes, ids, `url()` paints, `matrix`, entities, text, CDATA, doctype, unquoted values, uppercase tags, nested or misordered tags, unclosed or extra content, and length or shape limits. - **On read:** a stored plush is checked again; damaged ones are dropped. - **GET /play:** one call per love interest, in the background. The prompt carries their accent and look, a kept plush is shown as a data URL and never drawn again, and the prompt is logged in debug mode. - **Failures:** a refused SVG gets one repair turn that says why. A love interest whose plush failed is left alone within the cool-down and asked again after it. - **Fail without the fix:** turning the allow-list off fails 2 tests, and so does turning the "draw once" checks off. - **`tests/otome-forge-claw.regression.ts`:** unchanged and passing. A round still calls no model. - **Not run locally:** - `validate-catalog`: the sparse worktree leaves out other packages' zips, so CI runs it. - The browser suite: CI runs it. The claw e2e mocks GET /play, so it still covers the framed-look fallback. - **Local CodeRabbit:** 1 finding, fixed in `8832d5c40`. An attribute named like an `Object.prototype` key (`constructor`, `toString`) made the allow-list throw instead of refusing the SVG; the lookup now uses own keys only, and the tests cover both names. - **CodeQL** (incomplete multi-character sanitization): fixed in `08b898b6f`. Comments are skipped as tokens instead of cut out with a regex replace, so the text is never rewritten. - **Dottore:** - Repeated attributes: fixed in `08b898b6f`. A repeat is refused, since it isn't well-formed XML and the plush would never load. - Prototype names: fixed in `8832d5c40`. - **Independent multi-agent review** (security red team, job flow, client, release): 7 confirmed, 3 refuted. Fixed in `08b898b6f`: - repeated attributes; - the length cap measured before the rebuild, so a kept plush could be dropped on read and drawn again on every visit; - two README lines; - a vacuous `tooLong` test; - the header in `shared/claw.ts`. - The prototype-name finding was already fixed. - **Refuted:** a zero-size `viewBox` (twice), and the "first time you open Dates" wording. That wording is still made more accurate. - **No bypass found:** the red team found no way to get script, CSS, links or external fetches through, and no measurable ReDoS slowdown on 12,000-character inputs. Please verify by hand: - [ ] Manually verify, with a Planning connection, that opening Dates once draws each love interest's plush in the background, and that after a moment the Claw Machine, the haul and the shelf show each as a fitting animal in their colours. - [ ] Manually verify, with debug mode on, that the server log shows the `plush` prompt once per love interest, and never again once each is drawn. - [ ] Manually verify that the shelf's not-yet-won silhouettes still grey out an animal plush. - [ ] Manually verify that with no Planning or Story connection, the plushies keep their framed look and nothing fails. ## Documentation impact - [ ] No documentation changes needed - [x] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation Owner: @SpicyMarinara (made by Claude). 🤖 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:39:02 +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-Agents#2046
No description provided.