[PR #8044] [MERGED] Experience features 4/4: setup defaults, .experience.json files and catalog ruleset files (Capability API 1.372-1.374) #8070

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

📋 Pull Request Information

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

Base: staging ← Head: claude/project-thread-iwmrlb-part4


📝 Commits (4)

  • 6a59bfb Experience features 4/4: setup defaults, .experience.json files and catalog ruleset files (Capability API 1.372-1.374)
  • d891ab8 Merge remote-tracking branch 'origin/staging' into exp-part4-new
  • d752bdc Let a data-only Experience keep Game Mode's view, and fill an imported one's setup
  • f03b0bd Refuse an Experience file path that would need an escape

📊 Changes

28 files changed (+2970 additions, -65 deletions)

View changed files

📝 docs/development/optional-agent-packages.md (+96 -0)
📝 docs/extending/writing-rulesets.md (+2 -0)
📝 docs/extending/writing-story-scripts.md (+2 -1)
➕ e2e/game-experience-file-import.e2e.ts (+191 -0)
📝 packages/client/src/components/agents/AgentCatalogView.tsx (+1 -0)
➕ packages/client/src/components/game/ExperienceFileImportModal.tsx (+178 -0)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+40 -2)
📝 packages/client/src/components/game/GameSurface.tsx (+10 -4)
📝 packages/client/src/components/game/NewGameExperienceChooser.tsx (+90 -4)
📝 packages/client/src/hooks/use-capability-packages.ts (+27 -1)
➕ packages/client/src/lib/experience-file-review.ts (+41 -0)
📝 packages/client/src/localization/locales/en.json (+25 -0)
📝 packages/client/vite.config.ts (+4 -0)
📝 packages/server/src/middleware/rate-limit.ts (+14 -0)
📝 packages/server/src/routes/capability-packages.routes.ts (+20 -1)
📝 packages/server/src/routes/game.routes.ts (+7 -0)
📝 packages/server/src/routes/generate.routes.ts (+4 -1)
➕ packages/server/src/services/capability-packages/experience-asset-sanitizer.ts (+416 -0)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+359 -38)
➕ packages/shared/src/features/world/experience-file.ts (+483 -0)

...and 8 more files

📄 Description

Linked issue

Closes #7996 (4 of 4). Follows #8039.

Why this change

  • An Experience could not fill in the Game wizard's setup, so a player had to type the name, setting, tone and intro the author already wrote.
  • An Experience that holds only pictures, music and data still had to travel as a package zip through an agents catalog.
  • A catalog ruleset was a package zip, while a ruleset you import is already one <id>.ruleset.json file.

What changed

Capability API 1.372-1.374:

  • 1.372: setup defaults. contributions.gameSurface.setup.defaults fills the Game wizard when the Experience is picked: name, genre, setting, tone, difficulty, rating, language, combat style, goals, preferences, special instructions, art style and the intro message. The player can change every value; only the intro can be locked, and a locked intro shows read-only and opens the game.
  • 1.373: Experience files. An Experience with only pictures, music and data travels as one <id>.experience.json. The wizard's Experiences section gets Import an Experience file, which reads only the manifest first and shows a review (name, version, description, size, how much is pictures, music and data) before anything is sent. The server reads the file as it arrives, checks every file's size and hash against the manifest, checks each file is what its name says, and strips metadata from pictures and music. Anything that does not match is refused and nothing it wrote is kept.
  • 1.374: catalog rulesets are <id>.ruleset.json files read by the same reader as an imported ruleset. A catalog Experience must be an .experience.json file. A catalog entry with a zip artifact for either is refused before anything is downloaded, and the first-start catalog install skips Experiences. Packages already installed keep working.
  • The Experience file route has its own rate limit.

No CHANGELOG.md edit, per #7483.

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

  • Typecheck, lint, formatting and the full pnpm regression pass locally on this part, merged with current staging (which now holds parts 1 to 3). launcher-browser-ready can't listen on ::1 in the container it ran in.
  • New regressions: experience-file-import and catalog-package-files, plus additions to game-intro-message, route-rate-limits and the lifecycle table. New e2e: game-experience-file-import.
  • Not tried against a live model.

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)

Docs: docs/development/optional-agent-packages.md, docs/extending/writing-story-scripts.md, docs/extending/writing-rulesets.md.

UI evidence (if applicable)

The Game wizard's Experiences section gains an Import an Experience file button and a review dialog; picking an Experience fills the setup steps. No screenshots attached.


🔄 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/8044 **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-iwmrlb-part4` --- ### 📝 Commits (4) - [`6a59bfb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6a59bfba91968e658f8491d22a08cf5815aeb4be) Experience features 4/4: setup defaults, .experience.json files and catalog ruleset files (Capability API 1.372-1.374) - [`d891ab8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d891ab8757d92d7b4cfb3b38e336f714e4be34ec) Merge remote-tracking branch 'origin/staging' into exp-part4-new - [`d752bdc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d752bdc1715a048e6e204d57d57cbbdb6c91e636) Let a data-only Experience keep Game Mode's view, and fill an imported one's setup - [`f03b0bd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f03b0bd4b0875da63937f01d60e9fa922c18997c) Refuse an Experience file path that would need an escape ### 📊 Changes **28 files changed** (+2970 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/optional-agent-packages.md` (+96 -0) 📝 `docs/extending/writing-rulesets.md` (+2 -0) 📝 `docs/extending/writing-story-scripts.md` (+2 -1) ➕ `e2e/game-experience-file-import.e2e.ts` (+191 -0) 📝 `packages/client/src/components/agents/AgentCatalogView.tsx` (+1 -0) ➕ `packages/client/src/components/game/ExperienceFileImportModal.tsx` (+178 -0) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+40 -2) 📝 `packages/client/src/components/game/GameSurface.tsx` (+10 -4) 📝 `packages/client/src/components/game/NewGameExperienceChooser.tsx` (+90 -4) 📝 `packages/client/src/hooks/use-capability-packages.ts` (+27 -1) ➕ `packages/client/src/lib/experience-file-review.ts` (+41 -0) 📝 `packages/client/src/localization/locales/en.json` (+25 -0) 📝 `packages/client/vite.config.ts` (+4 -0) 📝 `packages/server/src/middleware/rate-limit.ts` (+14 -0) 📝 `packages/server/src/routes/capability-packages.routes.ts` (+20 -1) 📝 `packages/server/src/routes/game.routes.ts` (+7 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+4 -1) ➕ `packages/server/src/services/capability-packages/experience-asset-sanitizer.ts` (+416 -0) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+359 -38) ➕ `packages/shared/src/features/world/experience-file.ts` (+483 -0) _...and 8 more files_ </details> ### 📄 Description ## Linked issue Closes #7996 (4 of 4). Follows #8039. ## Why this change - An Experience could not fill in the Game wizard's setup, so a player had to type the name, setting, tone and intro the author already wrote. - An Experience that holds only pictures, music and data still had to travel as a package zip through an agents catalog. - A catalog ruleset was a package zip, while a ruleset you import is already one `<id>.ruleset.json` file. ## What changed Capability API 1.372-1.374: - 1.372: setup defaults. `contributions.gameSurface.setup.defaults` fills the Game wizard when the Experience is picked: name, genre, setting, tone, difficulty, rating, language, combat style, goals, preferences, special instructions, art style and the intro message. The player can change every value; only the intro can be locked, and a locked intro shows read-only and opens the game. - 1.373: Experience files. An Experience with only pictures, music and data travels as one `<id>.experience.json`. The wizard's Experiences section gets **Import an Experience file**, which reads only the manifest first and shows a review (name, version, description, size, how much is pictures, music and data) before anything is sent. The server reads the file as it arrives, checks every file's size and hash against the manifest, checks each file is what its name says, and strips metadata from pictures and music. Anything that does not match is refused and nothing it wrote is kept. - 1.374: catalog rulesets are `<id>.ruleset.json` files read by the same reader as an imported ruleset. A catalog Experience must be an `.experience.json` file. A catalog entry with a zip artifact for either is refused before anything is downloaded, and the first-start catalog install skips Experiences. Packages already installed keep working. - The Experience file route has its own rate limit. No CHANGELOG.md edit, per #7483. ## 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 - Typecheck, lint, formatting and the full `pnpm regression` pass locally on this part, merged with current staging (which now holds parts 1 to 3). `launcher-browser-ready` can't listen on `::1` in the container it ran in. - New regressions: `experience-file-import` and `catalog-package-files`, plus additions to `game-intro-message`, `route-rate-limits` and the lifecycle table. New e2e: `game-experience-file-import`. - Not tried against a live model. ## 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) Docs: `docs/development/optional-agent-packages.md`, `docs/extending/writing-story-scripts.md`, `docs/extending/writing-rulesets.md`. ## UI evidence (if applicable) The Game wizard's Experiences section gains an **Import an Experience file** button and a review dialog; picking an Experience fills the setup steps. No screenshots attached. --- <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:08 +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#8070
No description provided.