Repository navigation
refactor(sdk): reuse runtime message and result handling - #1583
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🟢 Approval recommended
The refactors preserve existing behavior and no unresolved correctness issues were identified.
0 open findings
What changed in this PR
Refactors SDK runtime message handling to reuse existing helpers and inferred types while preserving CLI, persistence, and result behavior. Builds on #1579.
Changes:
- Shares session parsing, progress notification, finding identity, severity, and publication schemas.
- Consolidates CLI rendering and structured-error state.
- Derives internal and public types from their implementation owners.
| File | Description |
|---|---|
sdk/typescript/src/api.ts |
Infers authentication result type. |
sdk/typescript/src/auth.ts |
Derives login results from runtime execution. |
sdk/typescript/src/classify-severity.ts |
Reuses shared severity constants. |
sdk/typescript/src/cli.ts |
Consolidates rendering, errors, validation, and record checks. |
sdk/typescript/src/contract.ts |
Centralizes finding identity derivation and validation setup. |
sdk/typescript/src/cost-model.ts |
Infers token pricing types. |
sdk/typescript/src/cost.ts |
Shares session parsing and state constructors. |
sdk/typescript/src/deduplication/deduplication.ts |
Derives severity ordering from shared constants. |
sdk/typescript/src/deep-config.ts |
Reuses record validation. |
sdk/typescript/src/findings-import.ts |
Reuses record and finding identity helpers. |
sdk/typescript/src/mock-scan.ts |
Derives immutable mock finding types. |
sdk/typescript/src/multiscan.ts |
Derives task types from inventory parsing. |
sdk/typescript/src/publication-events.ts |
Shares publication evidence fields. |
sdk/typescript/src/publication-store.ts |
Validates publication records with a shared schema. |
sdk/typescript/src/publish.ts |
Reuses publication options and inferred reconciliation types. |
sdk/typescript/src/saved-scan-bootstrap.ts |
Reuses record validation. |
sdk/typescript/src/scan-activity.ts |
Exposes shared session content parsing. |
sdk/typescript/src/scan-comparison.ts |
Reuses non-blocking observer notification. |
sdk/typescript/src/scan-logs.ts |
Derives session log types from lookup results. |
sdk/typescript/src/severity-store.ts |
Constructs complete validated classifications. |
sdk/typescript/src/version.ts |
Infers package version result types. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…hema-result-types
…odex/runtime-message-handling
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…/codex/sdk-schema-result-types
…odex/runtime-message-handling
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
zcrab-oai
left a comment
There was a problem hiding this comment.
Reviewed 8c9db2dbc406 in two source-review passes, including relevant callers and contracts.
Approved. No new actionable findings in the reviewed scope.
Validation: CI-helper TypeScript compilation and plugin bundling passed locally; native binaries came from CI with matching compiled source inputs. Focused SDK tests passed: contract.test.ts, cost.test.ts, publication-events.test.ts. The full cross-platform suite was not run locally; Windows execution remains unverified here.
Summary
Reuse existing SDK helpers for messages, progress observers, result projections, and CLI rendering.
Changes
Testing
Risk and rollout
The parent SDK result-type change is merged. CLI syntax, defaults, output formats, persisted formats, and public result shapes remain unchanged. Observer calls retain synchronous invocation, receiver binding, and error handling. Compaction accounting, cost enforcement, diagnostics, CSV identity, and publication storage are preserved. No migration is required. The cancellation fixture repair changes only test wiring.
Public disclosure review
Reviewed the source, synthetic fixtures, commit metadata, description, and available public PR discussion and validation output.