mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #8221] Migrate Zod 4 on staging while preserving stored data and transfers #8161
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8161
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8221
Originally assigned to: @SpicyMarinara on GitHub.
Problem
PR #8210 updates Zod from 3.25.76 to version 4, but the current schemas use APIs and parsing behavior that changed between major versions. The original dependency-only PR did not build. DOMPurify 3.4.17 is already present on staging.
Scope
@SpicyMarinara / Codex owns the compatibility work in existing PR #8210, targeting staging only.
Validation
Run the full project check, meaningful parsing/import/export and ruleset-schema regressions, local review, and all required hosted checks plus Dottore review before staging merge.
Compatibility and security blocker — not ready to merge
Owner: @SpicyMarinara / Codex. The existing PR #8210 stays draft, targeting staging. Its published head is
ccd3c374409f766fe0671969309ba8142353ba23; it must not be merged as it stands.The native Zod 4.6.7 core migration is implemented. The full local
pnpm checkpassed, including production client/server builds and the unchanged bundle budget. All 33 exported update schemas matched the captured Zod 3 empty-update baseline (19 accept with{}, 14 intentionally reject). The maintained real-route/storage compatibility regression and ruleset editor-schema regression passed. Local review found one small stored-parameter test gap; the added assertions received a completed two-file follow-up review with zero findings. Local validation used a private reconstructed dependency forest, not a successful frozen reinstall; earlier environment and disk failures are retained separately.There is a separate, real public-contract blocker: downloaded packages are explicitly promised Zod 3 in the client host namespace and shared package-server imports. The existing
marinara-host-namespaceregression fails against the native-4 candidate with4 !== 3. Silently replacing that library would break installed agents; changing only the advertised major or weakening that regression would not make the packages compatible.A deliberately scoped
zod-v3: npm:zod@3.25.76production alias was investigated locally to preserve those interfaces while leaving the Engine core on native Zod 4. The exact repository audit command,pnpm audit --audit-level low --json, then exited 1 with one HIGH finding: GHSA-mrhx-c7xc-m3w5, affecting<4.6.6, through the client/server legacy 3.25.76 dependency. The production-only audit reported the same finding. The compatibility proposal has not been pushed or merged, and its runtime/lifecycle validation is unfinished. No audit suppression, fabricated version or silent major-API change was applied.A mergeable resolution needs a coordinated SDK/downloaded-package migration to native Zod 4, or a genuinely patched legacy dependency that preserves the documented interface. That broader migration is not part of this PR's current authorized scope. #8216 tracks separate Engine request prevalidation; it is not complete remediation of legacy package validators. Keep #8221 open for this blocker. The premature translation follow-up #8226 is being closed because its proposed compatibility documentation never shipped.
@SpicyMarinara commented on GitHub (Oct 25, 2026):
Owner: @SpicyMarinara / Codex. Resuming the closed native-core candidate for the authorized issue sweep. Current staging now includes a reviewed Zod 3 security backport, so I am testing native Zod 4 core validation with an explicit backported Zod 3 compatibility alias for the documented API-1 package interfaces. No package library major will be silently changed. PR #8210 will remain draft until the compatibility, storage/transfer, install, security, and review gates pass.
@SpicyMarinara commented on GitHub (Oct 25, 2026):
Implemented in PR #8210, merged to
stagingas7bb1c9c19e7dcc1f98d3facdbcab0690cffc4e5cfrom reviewed headea12cf9fbe7137b2d0a7dc22d41287cea1fcb56d. Head/merge ancestry is verified; the actual merged treeb83f61b11197b2b2cdaf9e0b7626ace82056a330matches the predicted native-plus-world-clock merge.Engine core now uses native Zod 4.6.7. Existing API-1 packages retain their synchronous, patched Zod 3 namespace in a separate lazy chunk. Sparse updates, nested defaults, party-summary fallback, bounded HTTP diagnostics, imports/transfers and generated ruleset schemas retain their intended behavior.
Full local
pnpm check, the actual installed-package production browser case, static chunk graph, import/security/native-export controls and all hosted required checks, Node shards and platform jobs passed. The combined candidate also passed a full check, 11 focused regression files, and the final Gacha package's real five-process update/offline/uninstall lifecycle with all seven saved documents preserved. Local CodeRabbit findings and all three substantive Dottore findings were reproduced and addressed; final Dottore was Viable, With Notes, with all threads resolved. Mari explicitly authorized approval of this exact head and checking only the verified automated validation item; both manual boxes remain unchecked.The existing exact-version legacy security backport remains required for API-1 compatibility; the configured audit passes with its reviewed exception, not a claim that raw upstream advisory metadata is clean. Post-merge staging CI is tracked separately as the final media PR proceeds. Translated SDK/schema documentation is tracked by #8303. No app/storage-format/API version change or main promotion.