Skip to content

refactor(mcp): derive Deep Scan contracts from existing schemas - #1584

Open
mldangelo-oai wants to merge 20 commits into
mainfrom
mdangelo/codex/deep-scan-response-contracts
Open

mldangelo-oai wants to merge 20 commits into
mainfrom
mdangelo/codex/deep-scan-response-contracts

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Derive repeated MCP and Deep Scan fields from their existing schemas and constructors. Merge the reviewed main snapshot; the prerequisite workbench refactor is already merged.

Changes

  • Share persisted response types and mutation result handling.
  • Reuse producer-owned artifact and candidate types, and forward cancellation through the MCP callback context.
  • Preserve current retry dispatch, persistence flags, accepted legacy responses, diagnostic behavior, and scoped fresh/resumed worker settings.
  • Build the Node-capability test bundle in a fresh Bun process to avoid a reproducible coverage/bundler cache interaction. Keep both native and unavailable-zstd assertions unchanged.

Testing

  • All five required portable plugin checks, SDK/MCP types, formatting, and bundled-plugin build: passed.
  • Focused SDK regressions: 31 passed.
  • Focused MCP regression run: 13 passed; expanded persistence/recovery/resume/publication run: 42 passed.
  • Node-capability tests under coverage: 2 passed, including a second run after reproducing the parent-process bundler failure. Both also passed at the failing CI shard's exact seed/order.
  • SDK/MCP types and full formatting were repeated after the test-isolation fix: passed.
  • Full SDK fixed-seed run, started before the test-isolation change: 4,782 passed, 67 skipped, and 11 authentication-fixture failures isolated to the local test environment; the complete authentication file passed 128/128 from a neutral working directory. The default randomized full run is running from that neutral directory.
  • Three fresh native review passes and an independent verifier on the final test-isolation commit: no actionable findings.
  • The preceding hosted run passed all jobs except the Linux/macOS bundler failure and their dependent aggregates. Refreshed hosted CI is pending, not claimed as passing.

Risk and rollout

No CLI surface, persisted-format, accepted-status, runtime-setting, default, or diagnostic-policy changes. No migration is required. Public SDK progress interfaces remain augmentable. Registered MCP callbacks retain their request context and cancellation signal.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T04:43:11.145913Z 58dfff4 New commits
🔒 Security Review ✅ Completed 2026-10-16T04:43:55.785248Z 58dfff4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 11, 2026 00:43

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 133018f3c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The validation-sensitive contract refactor is broad and explicitly requires #1577 to be reviewed and merged first.

0 open findings

What changed in this PR

Consolidates MCP and Deep Scan contracts around existing Zod schemas and producer types while preserving validation, persistence, diagnostics, and cancellation behavior. This PR depends on #1577.

Changes:

  • Derives progress, persistence, worker, artifact, and candidate types from authoritative schemas.
  • Centralizes response parsing and retry policy.
  • Forwards MCP cancellation through the SDK callback context.
File Description
sdk/​typescript/​src/​worker-progress.ts Derives progress contracts from Zod schemas.
sdk/​typescript/​src/​deep-progress.ts Consolidates Deep Scan progress validation.
plugins/​codex-security/​mcp-app/​tests/​test_deep_scan_store.ts Expands persistence normalization tests.
plugins/​codex-security/​mcp-app/​src/​server/​compact-artifact-tools.ts Uses typed MCP callback cancellation.
plugins/​codex-security/​mcp-app/​src/​helpers/​normalize-candidates.ts Derives candidate fields and types.
plugins/​codex-security/​mcp-app/​src/​deep-scan/​worker-runner.ts Reuses failure and cancellation outcomes.
plugins/​codex-security/​mcp-app/​src/​deep-scan/​types.ts Derives durable state types from schemas.
plugins/​codex-security/​mcp-app/​src/​deep-scan/​store.ts Centralizes parsing and retry selection.
plugins/​codex-security/​mcp-app/​src/​deep-scan/​response.ts Adds schema-based response normalization.
plugins/​codex-security/​mcp-app/​src/​deep-scan/​registry.ts Reuses coordinator constructor input type.
plugins/​codex-security/​mcp-app/​src/​deep-scan/​artifacts.ts Infers artifact layout type.
plugins/​codex-security/​mcp-app/​src/​artifact-io.ts Uses native Zod row results and errors.
plugins/​codex-security/​mcp-app/​server.ts Shares equivalent schema primitives.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 11, 2026 01:22

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 8705f07f30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Cross-cutting persistence, validation, worker lifecycle, and cancellation changes warrant final human review after dependency #1577.

0 open findings

🧠 Review effort: Balanced

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 11, 2026 15:01

Copy link
Copy Markdown
Collaborator Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The broad persisted-contract and cancellation refactor warrants final human review after its dependent pull request is merged.

0 open findings

🧠 Review effort: Balanced

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: cc309b0cb6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@mldangelo-oai
mldangelo-oai requested a balanced review from Copilot October 11, 2026 15:54

Copy link
Copy Markdown
Collaborator Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The cross-cutting persistence, validation, cancellation, and public SDK type changes warrant final human review after dependency #1577.

0 open findings

🧠 Review effort: Balanced

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: bd95155736

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@mldangelo-oai mldangelo-oai changed the title refactor: consolidate MCP and Deep Scan message contracts refactor(mcp): derive Deep Scan contracts from existing schemas Oct 12, 2026

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed bf93c30c2a90 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 MCP tests passed: test_deep_scan_store.ts, test_deep_scan_store_integration.ts. The full cross-platform suite was not run locally; Windows execution remains unverified here.

Base automatically changed from mdangelo/codex/shared-workbench-messages to main October 13, 2026 13:49

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the actual diff at 63bb0d2e271e327ba002dd9a397fedb4eaa38814 in three independent passes, including the changed tests and documentation. The shared argument builder retains repeated flags, ordering, empty strings, and zero values; the response schemas retain the existing optional-field defaults and validation behavior. Worker cancellation, serialized writes, and terminal publication still follow the existing lifecycle.

No blocking findings. Static review only; I did not rerun the suites or generators.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants