[PR #1721] [MERGED] fix(slurp2): start and keep settings on zod 4 Engines (0.4.2) #1709

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1721
Author: @Gunterlie
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @Gunterlie

Base: staging ← Head: fix/slurp2-zod4-defaults


📝 Commits (4)

  • 89932d6 fix(slurp2): start and keep settings on zod 4 Engines (0.4.2)
  • 4fafb2b fix(slurp2): keep unsent keys out of the settings PATCH on zod 4
  • 9bca797 Merge branch 'staging' into fix/slurp2-zod4-defaults
  • d0a8025 Merge remote-tracking branch 'origin/staging' into fix/slurp2-zod4-defaults

📊 Changes

27 files changed (+692 additions, -594 deletions)

View changed files

➕ artifacts/slurp2-0.4.2.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/slurp2/CHANGELOG.md (+5 -0)
📝 packages/slurp2/client.js (+254 -245)
📝 packages/slurp2/docs/architecture/slurp2-vocabulary-rename-map.json (+1 -0)
📝 packages/slurp2/manifest.json (+5 -5)
📝 packages/slurp2/server.mjs (+208 -208)
📝 packages/slurp2/src/engine/packages/client/src/slp/features/onboarding/slp-release.ts (+6 -1)
📝 packages/slurp2/src/engine/packages/server/src/slp/features/ads/slp-ads-routes.ts (+4 -4)
📝 packages/slurp2/src/engine/packages/server/src/slp/features/settings/slp-settings-routes.ts (+2 -2)
📝 packages/slurp2/src/engine/packages/server/src/slp/modules/settings/slp-settings.ts (+4 -0)
📝 packages/slurp2/src/engine/packages/shared/src/slp/slp-drama.ts (+18 -16)
📝 packages/slurp2/src/engine/packages/shared/src/slp/slp-fan-types.ts (+15 -14)
📝 packages/slurp2/src/engine/packages/shared/src/slp/slp-model-budget.ts (+9 -8)
📝 packages/slurp2/src/engine/packages/shared/src/slp/slp-scene.ts (+2 -1)

...and 7 more files

📄 Description

Pull request

Linked issue

Closes #1720

Why this change

Staging users cannot start Slurp after their Engine update. Engine staging moved from zod 3 to zod 4 (0dddb04dc), and Slurp keeps zod external, so it runs on the Engine's zod.

Two zod 4 changes break Slurp:

  1. .default({}) returns the value as-is and skips the inner defaults. SLURP_REALISTIC_TUNING became world: {}, and scaleCurves read world.commission.curve at module load. The server crashed and the rollback to 0.4.0 crashed the same way.
  2. .partial() applies an inner .default() to a missing field. A partial save of Slurp settings, a Garnish ad patch or a creator account update resets every unsent field to its default.

Engine fixed its own schemas with .prefault() and partialInput() (7f78465b3). .prefault() is zod 4 only, and Engine main is still on zod 3, so Slurp gets two portable helpers instead.

What changed

  • New shared/src/slp/slp-schema-defaults.ts:
    • slpFilledDefault(schema, value = {}) = schema.default(() => schema.parse(value)), the same result as zod 4 .prefault(), also on zod 3.
    • slpPartialInput(schema), the same as Engine partialInput() (missing stays missing), works on zod 3 and 4.
  • Every object .default({}) in slurp2 (tuning, fan types, model budget, storyline, scene, drama) uses slpFilledDefault.
  • The settings update schema, the PATCH /settings body (slurpSettingsPatchSchema), the Garnish ad patch, and the creator account schemas that Engine changed in 7f78465b3 use slpPartialInput / slpFilledDefault.
  • tests/slurp2-vocabulary-shape.regression.ts: rename-map entry partialInput → slpPartialInput, plus intended deltas where Engine uses zod 4-only .prefault().
  • tests/slurp2-simulation-tuning.regression.ts: tuning has a numeric world.commission.curve, a zod/v4 schema gets nested defaults through the helper, and slpSettingsUpdateSchema.parse({}) and a modelBudget + fanTypes patch parse to {}, and the PATCH /settings route uses slurpSettingsPatchSchema.
  • Version 0.4.2 (patch), changelog, release note, rebuilt artifact and catalogs.

Package and security impact

  • Affected package IDs: slurp2
  • Engine compatibility impact: none. Works on zod 3 (Engine main) and zod 4 (Engine staging).
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none. No stored data format change.

Validation

Built and tested against an isolated Engine staging checkout at 105a707a1 (zod 4.6.7).

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuild 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-run results (not a substitute for the boxes above):

  • This repo's node_modules has zod 3.25.76, so CI runs the regressions on zod 3. The zod/v4 helper assertion covers zod 4 in CI.
  • Local zod 4 proof (repo zod swapped for 4.6.7): slurp2-simulation-tuning passes. With the old code it gives the reported TypeError: ... (reading 'curve'), and a plain .partial() settings patch fails the new assertion.
  • npm run test:slurp:regressions on zod 3: 321 passed, 0 failed. Before the shape fixes, slurp2-vocabulary-shape failed against the zod 4 Engine.
  • The same suite on zod 4: 319 passed, 2 failed (slurp2-content-packs, slurp2-storyline-format). Both are strict deep-equal diffs only: a second settings read adds storyTags: [] (readers use storyTags ?? []), and a JSON round trip drops undefined keys. No behavior change, left out of this hotfix.
  • slurp2-architecture regression, typecheck-packages slurp2, npm run check, test-catalog-lanes, validate-package-locales, validate-catalog, catalog-release-notes pass.
  • Not done: live install on an Engine instance.

Documentation impact

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

UI evidence (if applicable)

No UI change.


🔄 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/1721 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/slurp2-zod4-defaults` --- ### 📝 Commits (4) - [`89932d6`](https://github.com/Pasta-Devs/Marinara-Agents/commit/89932d6216de5fe0e18a69d894a89a45b9ffef36) fix(slurp2): start and keep settings on zod 4 Engines (0.4.2) - [`4fafb2b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4fafb2ba3250603f3954398f6adf815720003ffe) fix(slurp2): keep unsent keys out of the settings PATCH on zod 4 - [`9bca797`](https://github.com/Pasta-Devs/Marinara-Agents/commit/9bca7972432db4f0598534aeb93a84d81cff0018) Merge branch 'staging' into fix/slurp2-zod4-defaults - [`d0a8025`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d0a802571a3195466b81736f747999c03a922bcc) Merge remote-tracking branch 'origin/staging' into fix/slurp2-zod4-defaults ### 📊 Changes **27 files changed** (+692 additions, -594 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/slurp2-0.4.2.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/slurp2/CHANGELOG.md` (+5 -0) 📝 `packages/slurp2/client.js` (+254 -245) 📝 `packages/slurp2/docs/architecture/slurp2-vocabulary-rename-map.json` (+1 -0) 📝 `packages/slurp2/manifest.json` (+5 -5) 📝 `packages/slurp2/server.mjs` (+208 -208) 📝 `packages/slurp2/src/engine/packages/client/src/slp/features/onboarding/slp-release.ts` (+6 -1) 📝 `packages/slurp2/src/engine/packages/server/src/slp/features/ads/slp-ads-routes.ts` (+4 -4) 📝 `packages/slurp2/src/engine/packages/server/src/slp/features/settings/slp-settings-routes.ts` (+2 -2) 📝 `packages/slurp2/src/engine/packages/server/src/slp/modules/settings/slp-settings.ts` (+4 -0) 📝 `packages/slurp2/src/engine/packages/shared/src/slp/slp-drama.ts` (+18 -16) 📝 `packages/slurp2/src/engine/packages/shared/src/slp/slp-fan-types.ts` (+15 -14) 📝 `packages/slurp2/src/engine/packages/shared/src/slp/slp-model-budget.ts` (+9 -8) 📝 `packages/slurp2/src/engine/packages/shared/src/slp/slp-scene.ts` (+2 -1) _...and 7 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #1720 ## Why this change Staging users cannot start Slurp after their Engine update. Engine `staging` moved from zod 3 to zod 4 (`0dddb04dc`), and Slurp keeps `zod` external, so it runs on the Engine's zod. Two zod 4 changes break Slurp: 1. `.default({})` returns the value as-is and skips the inner defaults. `SLURP_REALISTIC_TUNING` became `world: {}`, and `scaleCurves` read `world.commission.curve` at module load. The server crashed and the rollback to 0.4.0 crashed the same way. 2. `.partial()` applies an inner `.default()` to a missing field. A partial save of Slurp settings, a Garnish ad patch or a creator account update resets every unsent field to its default. Engine fixed its own schemas with `.prefault()` and `partialInput()` (`7f78465b3`). `.prefault()` is zod 4 only, and Engine `main` is still on zod 3, so Slurp gets two portable helpers instead. ## What changed - New `shared/src/slp/slp-schema-defaults.ts`: - `slpFilledDefault(schema, value = {})` = `schema.default(() => schema.parse(value))`, the same result as zod 4 `.prefault()`, also on zod 3. - `slpPartialInput(schema)`, the same as Engine `partialInput()` (missing stays missing), works on zod 3 and 4. - Every object `.default({})` in slurp2 (tuning, fan types, model budget, storyline, scene, drama) uses `slpFilledDefault`. - The settings update schema, the `PATCH /settings` body (`slurpSettingsPatchSchema`), the Garnish ad patch, and the creator account schemas that Engine changed in `7f78465b3` use `slpPartialInput` / `slpFilledDefault`. - `tests/slurp2-vocabulary-shape.regression.ts`: rename-map entry `partialInput → slpPartialInput`, plus intended deltas where Engine uses zod 4-only `.prefault()`. - `tests/slurp2-simulation-tuning.regression.ts`: tuning has a numeric `world.commission.curve`, a `zod/v4` schema gets nested defaults through the helper, and `slpSettingsUpdateSchema.parse({})` and a `modelBudget` + `fanTypes` patch parse to `{}`, and the `PATCH /settings` route uses `slurpSettingsPatchSchema`. - Version 0.4.2 (patch), changelog, release note, rebuilt artifact and catalogs. ## Package and security impact - Affected package IDs: `slurp2` - Engine compatibility impact: none. Works on zod 3 (Engine `main`) and zod 4 (Engine `staging`). - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none. No stored data format change. ## Validation Built and tested against an isolated Engine `staging` checkout at `105a707a1` (zod 4.6.7). - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuild 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-run results (not a substitute for the boxes above): - This repo's `node_modules` has zod 3.25.76, so CI runs the regressions on zod 3. The `zod/v4` helper assertion covers zod 4 in CI. - Local zod 4 proof (repo `zod` swapped for 4.6.7): `slurp2-simulation-tuning` passes. With the old code it gives the reported `TypeError: ... (reading 'curve')`, and a plain `.partial()` settings patch fails the new assertion. - `npm run test:slurp:regressions` on zod 3: 321 passed, 0 failed. Before the shape fixes, `slurp2-vocabulary-shape` failed against the zod 4 Engine. - The same suite on zod 4: 319 passed, 2 failed (`slurp2-content-packs`, `slurp2-storyline-format`). Both are strict deep-equal diffs only: a second settings read adds `storyTags: []` (readers use `storyTags ?? []`), and a JSON round trip drops `undefined` keys. No behavior change, left out of this hotfix. - `slurp2-architecture` regression, `typecheck-packages slurp2`, `npm run check`, `test-catalog-lanes`, `validate-package-locales`, `validate-catalog`, `catalog-release-notes` pass. - Not done: live install on an Engine instance. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) No UI change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-27 06:06:03 +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#1709
No description provided.