Skip to content

fix(types): validate persisted session SQL results - #1741

Merged
ColeMurray merged 3 commits into
mainfrom
automation/unsafe-cast-sweep-20260903
Sep 8, 2026
Merged

fix(types): validate persisted session SQL results#1741
ColeMurray merged 3 commits into
mainfrom
automation/unsafe-cast-sweep-20260903

Conversation

@open-inspect

@open-inspect open-inspect Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This is an automated nightly unsafe-cast remediation sweep. It replaces three qualifying persisted-data casts with parse-don't-assert validation at session state boundaries, following the TypeScript Coding Standards guidance for unsafe casts and the Zod boundary-validation pattern established in PR #807.

Finding Risk Cast Removed Fix
packages/control-plane/src/session/terminal-message-projection-store.ts:58 Medium toArray() as PendingRow[] for persisted terminal projection state Added package-local Zod pendingRowSchema plus inline safeParse parser before mapping to domain state
packages/control-plane/src/session/message-repository.ts:106 Medium result.one() as { count: number } for unfinished prompt count Replaced with readRequiredNumberColumn inline guard before queue admission uses the value
packages/control-plane/src/session/message-repository.ts:201 Medium .one() as { count: number } for Autofix attempt-limit count Replaced with readRequiredNumberColumn inline guard before attempt-limit admission uses the value

Verification:

Command Result
npm run format Passed
npm run build -w @open-inspect/shared Passed
npm run build -w @open-inspect/control-plane Passed
npm run typecheck Passed
npm run lint Passed
npm test -w @open-inspect/control-plane Passed, 242 files / 3591 tests

No dependency changes were made.


Created with Open-Inspect

@open-inspect open-inspect Bot added the automation:unsafe-cast Automated unsafe TypeScript cast remediation label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format
Init
Validate
Tests

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @open-inspect[bot], Action: pull_request

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format
Init
Validate
Tests

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@ColeMurray ColeMurray left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head d090ea6, all changed files, persisted row schemas, SQL counts, admission/projection callers, alarm recovery/retry contracts, and all discussion. The follow-up ensures projection validation failures cannot abort lifecycle cleanup: recovery runs before the original error is rethrown, retaining retry and malformed-row evidence. Validation remains needed and compatible with current main. Shared build, full control-plane typecheck, lint/format, 108 unit tests and 12 Workerd integration tests passed. Exact-head CI is green with intentional Terraform deployment skips; no actionable comments or remaining blockers.

@ColeMurray
ColeMurray merged commit 20f613a into main Sep 8, 2026
13 checks passed
@ColeMurray
ColeMurray deleted the automation/unsafe-cast-sweep-20260903 branch September 8, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:unsafe-cast Automated unsafe TypeScript cast remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants