DRAFT: fix(types): validate unsafe response casts#839
Open
open-inspect[bot] wants to merge 1 commit into
Open
Conversation
Terraform Validation Results
Pushed by: @open-inspect[bot], Action: |
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.
This is an automated nightly unsafe-cast remediation sweep. It replaces selected high-risk response-boundary assertions with Zod validation following the TypeScript Coding Standards unsafe-cast / parse-don't-assert guidance and the Zod boundary-validation pattern established in PR #807. This PR is marked DRAFT in the title/body because two exact verification gates are blocked in this workspace, as detailed below.
Requested label:
automation:unsafe-castFindings Fixed
packages/web/src/lib/auth.ts:77(await response.json()) as GithubEmail[]from GitHub's/user/emailsAPI, feeding auth allowlist email resolutiongithub-email-schema.ts; validates consumed fields and acceptsvisibility: null; malformed responses fail closed with[]packages/github-bot/src/handlers.ts:69(await response.json()) as { sessionId: string }, feeding GitHub bot session statecontrol-plane-responses.ts; invalid success responses throw through the existing session creation error pathpackages/github-bot/src/handlers.ts:91(await response.json()) as { messageId: string }, feeding GitHub bot message statecontrol-plane-responses.ts; invalid success responses throw through the existing prompt delivery error pathVerification
npm run build -w @open-inspect/sharednpm run build -w @open-inspect/github-botnpm run build -w @open-inspect/web/automations/newfails withTypeError: Cannot read properties of null (reading 'useContext'); this page was not touched by this changenpm run typechecknpm run lint.opencode/tooling files and reports globals such asprocess,fetch,Headers; committed files are cleannpm run lint -- --ignore-pattern '.opencode/**'npm run lint -w @open-inspect/sharednpm run lint -w @open-inspect/github-botnpm run lint -w @open-inspect/webnpm test -w @open-inspect/sharednpm test -w @open-inspect/github-botnpm test -w @open-inspect/webDependency Check
Added
zod@^4.4.3to@open-inspect/webfor a genuinely package-local auth boundary.package-lock.jsonchanged only to add the correspondingpackages/webdependency entry; no unrelated lockfile churn remains.Created with Open-Inspect