[PR #8210] [MERGED] chore(validation): migrate core Zod while preserving installed packages #8187

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8210
Author: @dependabot[bot]
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @SpicyMarinara

Base: staging ← Head: dependabot/npm_and_yarn/npm_and_yarn-a4b5dcdebf


📝 Commits (10+)

  • 8042ef6 Merge pull request #7905 from Pasta-Devs/staging
  • 536c0e3 chore(review): replace automatic CodeRabbit reviews with Dottore
  • cd89ce1 art(review): use approved Dottore character design for all reviewer sprites
  • bba32aa Merge pull request #7960 from Pasta-Devs/hotfix/dottore-review-cutover
  • ee87627 fix(ci): allow CodeQL analysis up to 60 minutes
  • 457e827 Merge pull request #8015 from Pasta-Devs/hotfix/codeql-analysis-timeout
  • b8dc339 fix(ci): activate incremental review dispatch on default branch
  • e5ead06 Merge pull request #8208 from Pasta-Devs/hotfix/dottore-default-dispatch-8197
  • 0dddb04 chore(deps): bump the npm_and_yarn group across 4 directories with 2 updates
  • 7f78465 fix(validation): preserve schema behavior with native Zod 4

📊 Changes

94 files changed (+5675 additions, -4158 deletions)

View changed files

📝 docs/development/optional-agent-packages.md (+11 -3)
📝 docs/extending/ruleset.schema.json (+4688 -3683)
📝 e2e/marinara-host-namespace.e2e.ts (+21 -0)
📝 package.json (+1 -2)
📝 packages/client/package.json (+2 -1)
📝 packages/client/src/lib/game-setup-share.ts (+2 -1)
📝 packages/client/src/lib/marinara-host-contract.ts (+2 -2)
📝 packages/client/src/lib/marinara-host.ts (+1 -1)
📝 packages/client/vite.config.ts (+6 -0)
📝 packages/server/package.json (+2 -1)
📝 packages/server/src/middleware/error-handler.ts (+31 -5)
📝 packages/server/src/routes/advanced-memory.routes.ts (+2 -1)
📝 packages/server/src/routes/agents.routes.ts (+1 -1)
📝 packages/server/src/routes/avatar-models.routes.ts (+3 -1)
📝 packages/server/src/routes/chats.routes.ts (+2 -1)
📝 packages/server/src/routes/combat-director.routes.ts (+2 -2)
📝 packages/server/src/routes/connections.routes.ts (+5 -6)
📝 packages/server/src/routes/game-board-packs.routes.ts (+1 -1)
📝 packages/server/src/routes/game-creature-packs.routes.ts (+1 -1)
📝 packages/server/src/routes/game-inventory.routes.ts (+1 -1)

...and 74 more files

📄 Description

Linked issue

Closes #8221.

Why this change

Engine validators need native Zod 4 while existing installed API-1 packages continue receiving their promised Zod 3 interface. A direct dependency bump changes sparse updates, default parsing, ruleset editor schemas and validation errors, so those paths need compatibility fixes and proof together.

What changed

  • Move Engine core validators in all three workspaces to Zod 4.6.7. Preserve sparse PATCH input, nested import defaults and partial expression maps; keep existing game/ruleset input behavior.
  • Keep the explicit patched zod-v3 3.25.76 alias for the browser host namespace and managed server-package dependency snapshots. Preserve named/default imports, CJS require, package metadata and legacy subpaths without a capability-API bump.
  • Keep the package-only legacy validator in a separate lazy chunk, guarded against static startup imports. The public package namespace remains synchronous.
  • Handle native and legacy validation errors as bounded, structured HTTP 400 responses. Sparse-update type errors retain their underlying field message and full path; ordinary union errors and the 50-detail cap are preserved.
  • Preserve party field-summary fallback when omitted, while an explicit empty summary keeps its existing meaning.
  • Generate the ruleset editor JSON Schema through native Zod, preserve $comment annotations in maps without relaxing their other key/value constraints, and update the installed-package SDK documentation. Remove the obsolete Zod-3-only JSON Schema converter.

Validation

Full pnpm check passed at ea12cf9fb, including staging 51c7e9ed. Frozen install and pnpm version:check passed. Native compatibility/security/ruleset regressions, the two combat-route regressions, game-dice rewrite costs, generated editor-schema consistency, server TypeScript and E2E TypeScript passed.

Hosted regression feedback exposed legacy Zod-message expectations, a private parser spy removed upstream, and an omitted party-summary default. The 19 affected regression files now pass their preserved negative controls; assertions use native messages/paths and public parse boundaries. The party-summary fix preserves GM fallback when omitted and the intentional empty-summary behavior when explicitly supplied. The generated editor schema remains current.

Prior migration checks also passed all 15 import regressions, static host-contract proof and the native-export memory fixture with a 128 MB heap limit. Desktop Chromium proved the actual Zod 3 record/default/deepPartial/error-alias ABI, complete namespace, audio, dialog and separate Motion contexts. The first suite had five passes and a chat-stream provider-wait timeout; that case passed an exact unchanged isolated replay, with the initial failure trace/screenshot retained. No source/assertion/timeout change was made for the replay. After quota recovery, the full local CodeRabbit review completed on 823121e65 against base 3f8f59719, listing all 89 changed files. Both findings were reproduced and fixed: map annotation names and sparse-update field messages. Their actual Ajv/HTTP negative-to-positive regressions pass, including unchanged bounds, nested paths, ordinary unions and the validation-detail cap. The follow-up completed on 6c70c7ceb against 823121e65, listing all 22 delta files. Its one remaining suggestion is stylistic wording in the retention guide inherited unchanged from staging; it is outside this native PR diff and does not identify a correctness defect. No unresolved substantive local finding remains.

Dottore's full hosted review of 6c70c7ceb identified three low-severity defects. All were traced and repaired at ea12cf9fb: default-parameter and lorebook bulk-edit handlers now reuse the existing supplied-field diagnostic generator, as do the same affected avatar-feature and game-create callers. Actual route regressions failed before and pass after the fix, preserving the response shapes, nested paths, type/range messages, empty-edit rejection and missing-book control. The legacy Zod alias had shared the eager 161,491-byte validator chunk; the production manifest now shows native validation at 99,613 bytes in the static entry graph and legacy validation at 61,526 bytes outside it. The lazy host still includes legacy Zod synchronously. A production Chromium installed-package SDK test passed after the rebuild. The fresh 10-file local CodeRabbit repair review completed with zero findings. Dottore's two optional import-placement notes do not identify behavior defects and remain unchanged.

Final combined validation passed on local audit source b50834b5b7d5a943f33b899f210ec82b7c2ac8f1 (tree b19cffbde9b3bea45ab533e7d6b89701a75a3687), combining this exact ea12cf9fb native head, media bcd0b3bfa, world-clock 79a2c4179 and staging 51c7e9ed. Full pnpm check, 11 focused Node regression files, the production static-entry graph guard and actual installed-package SDK browser case passed. The repaired Gacha Forge package 6b449f4d also passed its actual five-process installation/update/offline/uninstall lifecycle against this compiled combined server, preserving all seven saved documents and rejecting stale-review/tampered-archive controls. Same-open-app audio replay and invalidation passed through the actual combined client TTS service with a synthetic provider. This is exact candidate compatibility evidence; it is not a claim that the eventual staging tree or real-provider/device behavior has passed. A subsequent isolated media direct-Seedance reference repair will require its own affected validation.

Security evidence: the configured audit exits 0 and returns no advisories because it recognizes the existing reviewed exception. Raw registry metadata still counts one HIGH advisory against the legacy 3.25.76 version. Its exact-version backport remains installed and the regression passes 56 bounded sync/async controls plus valid-data/API checks across ESM/CJS root, bundled v4 and mini entrypoints. This does not claim the raw audit is clean or that stock Zod 3 is fixed.

  • Confirm recorded automated result: pnpm check passed at ea12cf9fb and combined tree b19cffbd. (Checked with Mari’s explicit authorization in this session.)
  • Manually verify existing installed/downloaded packages with this Engine candidate.
  • Manually verify imports/exports and chat, connection and character updates with disposable data.

Docs and release impact

Updated docs/extending/ruleset.schema.json and docs/development/optional-agent-packages.md; #8303 tracks translated documentation. No app-version, storage-format, capability-API or transfer-limit change.

UI evidence (if applicable)

No visual interface change. The focused browser fixture verifies the actual installed-package host namespace and its Zod 3 ABI rather than relying only on compile-time dependency versions. The repaired ea12cf9fb head has a substantive current-head Dottore verdict of Viable, With Notes (zero defects and all three repair contracts confirmed). Its hosted CI is still running; required human checklist completion and outside-contributor owner approval remain separate merge gates. Earlier 6c70c7ceb technical CI does not substitute for the repaired head.


🔄 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/8210 **Author:** [@dependabot[bot]](https://github.com/apps/dependabot) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `dependabot/npm_and_yarn/npm_and_yarn-a4b5dcdebf` --- ### 📝 Commits (10+) - [`8042ef6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8042ef6ec638801de45b8d82f82cd2dea85f51a4) Merge pull request #7905 from Pasta-Devs/staging - [`536c0e3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/536c0e3a43929644feb75e056129797e8d4059e1) chore(review): replace automatic CodeRabbit reviews with Dottore - [`cd89ce1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cd89ce114a57f387df8db52475d964f824cc792d) art(review): use approved Dottore character design for all reviewer sprites - [`bba32aa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bba32aa32a7611b369b3f01372725d5292be6696) Merge pull request #7960 from Pasta-Devs/hotfix/dottore-review-cutover - [`ee87627`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ee87627ece8d1aa98381906af367b0e95179c45e) fix(ci): allow CodeQL analysis up to 60 minutes - [`457e827`](https://github.com/Pasta-Devs/Marinara-Engine/commit/457e827a3d3291be978121f8c50c98c5dd9d644d) Merge pull request #8015 from Pasta-Devs/hotfix/codeql-analysis-timeout - [`b8dc339`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b8dc339eb498051921806b0fb7bc130922019361) fix(ci): activate incremental review dispatch on default branch - [`e5ead06`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e5ead06ac2fe1cb3e039f8cab7e4d266b01dac44) Merge pull request #8208 from Pasta-Devs/hotfix/dottore-default-dispatch-8197 - [`0dddb04`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0dddb04dc41314b647c473518802dc510dc4d27e) chore(deps): bump the npm_and_yarn group across 4 directories with 2 updates - [`7f78465`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7f78465b3175307d377a67debbbe4bdff0d982d7) fix(validation): preserve schema behavior with native Zod 4 ### 📊 Changes **94 files changed** (+5675 additions, -4158 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/optional-agent-packages.md` (+11 -3) 📝 `docs/extending/ruleset.schema.json` (+4688 -3683) 📝 `e2e/marinara-host-namespace.e2e.ts` (+21 -0) 📝 `package.json` (+1 -2) 📝 `packages/client/package.json` (+2 -1) 📝 `packages/client/src/lib/game-setup-share.ts` (+2 -1) 📝 `packages/client/src/lib/marinara-host-contract.ts` (+2 -2) 📝 `packages/client/src/lib/marinara-host.ts` (+1 -1) 📝 `packages/client/vite.config.ts` (+6 -0) 📝 `packages/server/package.json` (+2 -1) 📝 `packages/server/src/middleware/error-handler.ts` (+31 -5) 📝 `packages/server/src/routes/advanced-memory.routes.ts` (+2 -1) 📝 `packages/server/src/routes/agents.routes.ts` (+1 -1) 📝 `packages/server/src/routes/avatar-models.routes.ts` (+3 -1) 📝 `packages/server/src/routes/chats.routes.ts` (+2 -1) 📝 `packages/server/src/routes/combat-director.routes.ts` (+2 -2) 📝 `packages/server/src/routes/connections.routes.ts` (+5 -6) 📝 `packages/server/src/routes/game-board-packs.routes.ts` (+1 -1) 📝 `packages/server/src/routes/game-creature-packs.routes.ts` (+1 -1) 📝 `packages/server/src/routes/game-inventory.routes.ts` (+1 -1) _...and 74 more files_ </details> ### 📄 Description ## Linked issue Closes #8221. ## Why this change Engine validators need native Zod 4 while existing installed API-1 packages continue receiving their promised Zod 3 interface. A direct dependency bump changes sparse updates, default parsing, ruleset editor schemas and validation errors, so those paths need compatibility fixes and proof together. ## What changed - Move Engine core validators in all three workspaces to Zod 4.6.7. Preserve sparse PATCH input, nested import defaults and partial expression maps; keep existing game/ruleset input behavior. - Keep the explicit patched `zod-v3` 3.25.76 alias for the browser host namespace and managed server-package dependency snapshots. Preserve named/default imports, CJS `require`, package metadata and legacy subpaths without a capability-API bump. - Keep the package-only legacy validator in a separate lazy chunk, guarded against static startup imports. The public package namespace remains synchronous. - Handle native and legacy validation errors as bounded, structured HTTP 400 responses. Sparse-update type errors retain their underlying field message and full path; ordinary union errors and the 50-detail cap are preserved. - Preserve party field-summary fallback when omitted, while an explicit empty summary keeps its existing meaning. - Generate the ruleset editor JSON Schema through native Zod, preserve `$comment` annotations in maps without relaxing their other key/value constraints, and update the installed-package SDK documentation. Remove the obsolete Zod-3-only JSON Schema converter. ## Validation Full `pnpm check` passed at ea12cf9fb, including staging 51c7e9ed. Frozen install and `pnpm version:check` passed. Native compatibility/security/ruleset regressions, the two combat-route regressions, game-dice rewrite costs, generated editor-schema consistency, server TypeScript and E2E TypeScript passed. Hosted regression feedback exposed legacy Zod-message expectations, a private parser spy removed upstream, and an omitted party-summary default. The 19 affected regression files now pass their preserved negative controls; assertions use native messages/paths and public parse boundaries. The party-summary fix preserves GM fallback when omitted and the intentional empty-summary behavior when explicitly supplied. The generated editor schema remains current. Prior migration checks also passed all 15 import regressions, static host-contract proof and the native-export memory fixture with a 128 MB heap limit. Desktop Chromium proved the actual Zod 3 record/default/deepPartial/error-alias ABI, complete namespace, audio, dialog and separate Motion contexts. The first suite had five passes and a chat-stream provider-wait timeout; that case passed an exact unchanged isolated replay, with the initial failure trace/screenshot retained. No source/assertion/timeout change was made for the replay. After quota recovery, the full local CodeRabbit review completed on 823121e65 against base 3f8f59719, listing all 89 changed files. Both findings were reproduced and fixed: map annotation names and sparse-update field messages. Their actual Ajv/HTTP negative-to-positive regressions pass, including unchanged bounds, nested paths, ordinary unions and the validation-detail cap. The follow-up completed on 6c70c7ceb against 823121e65, listing all 22 delta files. Its one remaining suggestion is stylistic wording in the retention guide inherited unchanged from staging; it is outside this native PR diff and does not identify a correctness defect. No unresolved substantive local finding remains. Dottore's full hosted review of 6c70c7ceb identified three low-severity defects. All were traced and repaired at ea12cf9fb: default-parameter and lorebook bulk-edit handlers now reuse the existing supplied-field diagnostic generator, as do the same affected avatar-feature and game-create callers. Actual route regressions failed before and pass after the fix, preserving the response shapes, nested paths, type/range messages, empty-edit rejection and missing-book control. The legacy Zod alias had shared the eager 161,491-byte validator chunk; the production manifest now shows native validation at 99,613 bytes in the static entry graph and legacy validation at 61,526 bytes outside it. The lazy host still includes legacy Zod synchronously. A production Chromium installed-package SDK test passed after the rebuild. The fresh 10-file local CodeRabbit repair review completed with zero findings. Dottore's two optional import-placement notes do not identify behavior defects and remain unchanged. Final combined validation passed on local audit source b50834b5b7d5a943f33b899f210ec82b7c2ac8f1 (tree b19cffbde9b3bea45ab533e7d6b89701a75a3687), combining this exact ea12cf9fb native head, media bcd0b3bfa, world-clock 79a2c4179 and staging 51c7e9ed. Full pnpm check, 11 focused Node regression files, the production static-entry graph guard and actual installed-package SDK browser case passed. The repaired Gacha Forge package 6b449f4d also passed its actual five-process installation/update/offline/uninstall lifecycle against this compiled combined server, preserving all seven saved documents and rejecting stale-review/tampered-archive controls. Same-open-app audio replay and invalidation passed through the actual combined client TTS service with a synthetic provider. This is exact candidate compatibility evidence; it is not a claim that the eventual staging tree or real-provider/device behavior has passed. A subsequent isolated media direct-Seedance reference repair will require its own affected validation. Security evidence: the configured audit exits 0 and returns no advisories because it recognizes the existing reviewed exception. Raw registry metadata still counts one HIGH advisory against the legacy 3.25.76 version. Its exact-version backport remains installed and the regression passes 56 bounded sync/async controls plus valid-data/API checks across ESM/CJS root, bundled v4 and mini entrypoints. This does not claim the raw audit is clean or that stock Zod 3 is fixed. - [x] Confirm recorded automated result: `pnpm check` passed at `ea12cf9fb` and combined tree `b19cffbd`. (Checked with Mari’s explicit authorization in this session.) - [ ] Manually verify existing installed/downloaded packages with this Engine candidate. - [ ] Manually verify imports/exports and chat, connection and character updates with disposable data. ## Docs and release impact Updated `docs/extending/ruleset.schema.json` and `docs/development/optional-agent-packages.md`; #8303 tracks translated documentation. No app-version, storage-format, capability-API or transfer-limit change. ## UI evidence (if applicable) No visual interface change. The focused browser fixture verifies the actual installed-package host namespace and its Zod 3 ABI rather than relying only on compile-time dependency versions. The repaired ea12cf9fb head has a substantive current-head Dottore verdict of Viable, With Notes (zero defects and all three repair contracts confirmed). Its hosted CI is still running; required human checklist completion and outside-contributor owner approval remain separate merge gates. Earlier 6c70c7ceb technical CI does not substitute for the repaired head. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-25 04:04:32 +07:00
bsakaguchi changed title from [PR #8210] [CLOSED] chore(deps): bump the npm_and_yarn group across 4 directories with 2 updates to [PR #8210] [MERGED] chore(validation): migrate core Zod while preserving installed packages 2026-10-26 04:04:05 +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#8187
No description provided.