Open
Conversation
Add migration proposal for Zod v3 runtime schema validation covering: - IPC channel inputs (renderer→main) - JSON data loaded from disk (installations.json, settings.json) - External API responses (GitHub releases, CDN manifests) - Source module contracts (buildInstallation return shapes) Includes PoC schema definitions in schemas/ directory with a standalone validation example. No existing application code is modified. Depends on: Proposal Comfy-Org#2 (TypeScript) for z.infer<> type inference. Amp-Thread-ID: https://ampcode.com/threads/T-019c7926-be08-704f-b583-1c5167315271
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal #10: Zod — Runtime Schema Validation
Summary
Adds a migration proposal and PoC schema definitions for Zod v3 runtime schema validation at all system boundaries: IPC channel inputs, JSON data loaded from disk, external API responses, and source module contracts.
What's Included
.github/proposals/proposal-zod.mdschemas/installation.tsinstallations.js)schemas/settings.tssettings.jsdefaults +ipc.jssections)schemas/ipc.tsschemas/github.tsschemas/validate-example.tsinstallations.jsonandsettings.jsonagainst the schemasKey Decisions
require())z.infer<>type inference is the killer feature for eliminating type/runtime drift; bundle size is irrelevant in an Electron app (~120 MB baseline).passthrough()on all schemas — allows forward compatibility and source-specific extensionssafeParse()rollout strategy — log validation failures first, don't crash; switch to strictparse()laterDependencies
z.infer<>benefit requires TSNo Application Code Modified
This PR only adds new files (proposal doc + schema definitions). No existing code is changed.