Skip to content

refactor(examples): port custom validation to TypeScript - #792

Open
kmbroai wants to merge 2 commits into
dev/kyleb/remove-python-ci-utilitiesfrom
dev/kyleb/remove-python-validation-example
Open

refactor(examples): port custom validation to TypeScript#792
kmbroai wants to merge 2 commits into
dev/kyleb/remove-python-ci-utilitiesfrom
dev/kyleb/remove-python-validation-example

Conversation

@kmbroai

@kmbroai kmbroai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Remove Python from the custom-validation demo. Compile the typed app and HTTP validator through the existing SDK build command, then execute the generated JavaScript on the supported Node.js runtime.

Changes

  • Replace the two Python example files with typed .mts sources and keep generated JavaScript untracked.
  • Reuse node --run build:examples -- --outDir <target> in the demo runner and its test, with the SDK as the build working directory.
  • Preserve the synthetic invoice ownership flaw, authentication controls, proof JSON, server cleanup, and compilation into the temporary scan target.
  • Update validation prompts and documentation and include the example in strict type and formatting checks.

Testing

  • The focused generated HTTP-proof test passed with five assertions on Node 22.13.0.
  • SDK/MCP type checks, SDK formatting, runner formatting, the documented SDK build, and runner help from outside the checkout passed.
  • Default and custom output paths, including a path containing spaces, produced identical compiled files. Compiler diagnostics and the stop-before-scan failure guard were preserved.
  • Earlier comparisons verified the original Python proof JSON and failure-path server cleanup. A live model-backed scan was not run.

Risk and rollout

Stacked on #768. The demo uses existing SDK development dependencies, synthetic data, and an ephemeral loopback HTTP server. Build failures now use the Node script runner's exit status: the checked compilation failure returns 1 instead of the compiler's 2, with the same diagnostics and no scan start. This PR removes two Python files.

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 Sep 2, 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
🔒 Security Review Completed 2026-09-04T23:33:56.654176Z c6eafac 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 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.

The compiled example preserves the authentication controls and proof output, and the HTTP validation and server cleanup test passes locally. No actionable findings in the example migration.

@kmbroai
kmbroai force-pushed the dev/kyleb/remove-python-validation-example branch 2 times, most recently from d567878 to 53491e7 Compare September 3, 2026 19:00
@kmbroai
kmbroai force-pushed the dev/kyleb/remove-python-validation-example branch from 53491e7 to c6eafac Compare September 4, 2026 23:29

@mldangelo-oai mldangelo-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.

The migration behavior remains sound; one non-blocking single-source simplification is inline.

Comment thread examples/custom-validation/run.mjs
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.

2 participants