fix(types): replace unsafe casts with validated parsing - #2002
open-inspect[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Terraform Validation Results
Pushed by: @open-inspect[bot], Action: |
Automated nightly unsafe-cast remediation sweep. This PR fixes three qualifying unsafe TypeScript casts by parsing at the boundary instead of asserting, following the TypeScript Coding Standards guidance for unsafe casts / parse-don't-assert and the Zod boundary-validation pattern established in PR #807.
packages/control-plane/src/routes/slack-notify.ts:221raw as Record<string, unknown>onrequest.json()bodyslackNotifyBodySchemawithz.inferandsafeParse, preserving the existinginvalid_inputresponse contract and null-as-absent optional fields.packages/shared/src/triggers/webhook/normalizer.ts:24and:51body/current as Record<string, unknown>on generic webhook payloadswebhookObjectSchemaandsafeParsebefore idempotency stripping and JSONPath traversal.packages/control-plane/src/session/pull-request-snapshot.ts:87parsed as Record<string, unknown>on persisted artifact metadata JSONartifactMetadataSchemaandsafeParse, preserving malformed/non-object fallback to{}.Verification commands run:
npm run build -w @open-inspect/sharednpm run build -w @open-inspect/control-planenpm run typechecknpm run lintnpm run formatnpm test -w @open-inspect/sharednpm test -w @open-inspect/control-planegit diff --checkandgit diff --cached --checkCreated with Open-Inspect