Skip to content

refactor(schemas): generate canonical artifact schemas from Zod - #1578

Open
mldangelo-oai wants to merge 10 commits into
mainfrom
mdangelo/codex/canonical-zod-schemas
Open

mldangelo-oai wants to merge 10 commits into
mainfrom
mdangelo/codex/canonical-zod-schemas

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

Generate canonical findings, manifest, coverage, and patch-risk schemas from shared Zod definitions. Merge current main; the prerequisite compact-contract refactor is already merged.

Changes

  • Keep runtime validation on the selected plugin JSON schemas while deriving build-time ownership and private types from Zod.
  • Preserve schema IDs, named definitions, conditional constraints, and historical saved-artifact aliases.
  • Keep current main coverage semantics: do not restore removed completeness outcomes or constraints.
  • Check generated-resource freshness and add focused compatibility regressions.

Testing

  • All five required portable plugin checks: passed.
  • SDK/MCP type and formatting checks: passed.
  • Three MCP contract/schema-loader test files: passed.
  • Python scan-contract, validation, report, and threat-model projection regressions: 98 passed, with 95 passing subtests.
  • Three native review passes and a fresh independent verifier on this head: no actionable findings.
  • Full SDK and refreshed hosted CI results are tracked separately; pending runs are not claimed as passing.

Risk and rollout

Runtime validation continues to use the selected plugin JSON schemas. Public CLI syntax, current artifact inputs, historical supported aliases, schema IDs, named references, and SDK model contracts remain unchanged. Generated JSON stays checked in, and typecheck rejects stale output. The generator's legacy-compatible artifact shapes do not relax current semantic validation.

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:08:19.904580Z 31079e8 New commits
🔒 Security Review ✅ Completed 2026-10-16T04:08:21.090995Z 31079e8 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:21

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 0257a4e626

ℹ️ 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.

🟢 Approval recommended

The generated contracts preserve existing validation behavior and are supported by focused regression coverage.

0 open findings

What changed in this PR

Moves canonical artifact schema ownership to shared Zod definitions while preserving checked-in JSON validation contracts and SDK models.

Changes:

  • Adds Zod sources and generation for four canonical schemas.
  • Uses AJV narrowing for patch-risk assessments.
  • Adds regression coverage and authoring documentation.
File Description
CONTRIBUTING.md Documents schema authoring and generation.
plugins/​codex-security/​mcp-app/​scripts/​canonical-schemas.mts Defines canonical Zod contracts.
plugins/​codex-security/​mcp-app/​scripts/​generate-artifact-schemas.mjs Generates canonical JSON schemas.
plugins/​codex-security/​mcp-app/​src/​helpers/​validate-patch-risk-assessment.ts Uses generated-schema type narrowing.
plugins/​codex-security/​mcp-app/​src/​patch-risk-schema.ts Defines patch-risk contract and type.
plugins/​codex-security/​mcp-app/​src/​threat-model-schema.ts Supports canonical scope-list constraints.
plugins/​codex-security/​mcp-app/​tests/​test_canonical_artifact_contracts.ts Covers compatibility constraints.
plugins/​codex-security/​schemas/​coverage.schema.json Regenerated coverage schema.
plugins/​codex-security/​schemas/​findings.schema.json Regenerated findings schema.
plugins/​codex-security/​schemas/​patch-risk-assessment.schema.json Regenerated patch-risk schema.
plugins/​codex-security/​schemas/​scan-manifest.schema.json Regenerated manifest schema.

🧠 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 14:56

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 089210b092

ℹ️ 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

It rewires four canonical validation contracts and depends on #1575, warranting final human compatibility review.

0 open findings

🧠 Review effort: Balanced

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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: c87de6b8b6

ℹ️ 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

Compatibility-critical schema generation spans multiple consumers and requires final human verification after dependency #1575 is merged.

0 open findings

🧠 Review effort: Balanced

@mldangelo-oai mldangelo-oai changed the title refactor: generate canonical artifact schemas from Zod refactor(schemas): generate canonical artifact schemas from Zod 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 eabcaf3a3fdf 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_canonical_artifact_contracts.ts. The full cross-platform suite was not run locally; Windows execution remains unverified here.

Base automatically changed from mdangelo/codex/compact-zod-contracts to main October 13, 2026 13:45

@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 PR diff at 57a6ed3c36b0 in three independent source passes, including comparison of the four exported schemas with the PR base.

The generated schemas preserve the existing structural constraints, named references, IDs, and legacy union representations. Runtime validation still uses the selected plugin's JSON schemas; the new Zod definitions supply generation and the private patch-risk type. No blocking findings in this delta over #1575.

Static review and schema comparison; I did not rerun the test 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