Skip to content

chore: better schema gen#4

Merged
gersmann merged 8 commits intomainfrom
chhore/better-schema-gen/sg
Sep 14, 2025
Merged

chore: better schema gen#4
gersmann merged 8 commits intomainfrom
chhore/better-schema-gen/sg

Conversation

@gersmann
Copy link
Copy Markdown
Owner

No description provided.

- Unify protocol generation: TS → JSON Schema → Pydantic
- Human‑readable union variants (EventMsg*, ClientRequest*, …)
- Remove old TS→Python generator script and flow
- Add dev tooling: datamodel-code-generator; post-processors for schema/types
- Bump crate and package version to 0.2.12
- Optional fields: change Field(...) to Field(None, ...) for types including None
- Union wrappers: add model_rebuild() calls post-generation to resolve forward refs
- Schema gen: pass --tsconfig to ts-json-schema-generator for stable module resolution
- Generator: use index.ts for --path and pass --tsconfig to ts-json-schema-generator
- Schema postprocess: hoist titles and relax  for nullable fields; print summary
- Types postprocess: dedupe duplicate model_rebuild() calls; print summary
@github-actions
Copy link
Copy Markdown
Contributor

Codex Autonomous Review:

  • Overall: patch is correct
  • Findings (total): 0

The changes introduce a new schema generation pipeline, regenerate protocol models with Pydantic v2, add supporting scripts and a small Rust helper binary, and update metadata. The diffs are internally consistent and do not reveal discrete correctness, type, or runtime issues in the modified lines.
Confidence: 0.64

@gersmann
Copy link
Copy Markdown
Owner Author

@codex the review actions seems to be running twice - can we fix this?
image

@gersmann gersmann merged commit ebb2eac into main Sep 14, 2025
4 checks passed
@gersmann gersmann deleted the chhore/better-schema-gen/sg branch September 14, 2025 17:01
gersmann added a commit that referenced this pull request Sep 14, 2025
* chore(release): 0.2.12

- Unify protocol generation: TS → JSON Schema → Pydantic
- Human‑readable union variants (EventMsg*, ClientRequest*, …)
- Remove old TS→Python generator script and flow
- Add dev tooling: datamodel-code-generator; post-processors for schema/types
- Bump crate and package version to 0.2.12

* fix: address PR feedback

- Optional fields: change Field(...) to Field(None, ...) for types including None
- Union wrappers: add model_rebuild() calls post-generation to resolve forward refs
- Schema gen: pass --tsconfig to ts-json-schema-generator for stable module resolution

* fix: make codegen robust and dedupe

- Generator: use index.ts for --path and pass --tsconfig to ts-json-schema-generator
- Schema postprocess: hoist titles and relax  for nullable fields; print summary
- Types postprocess: dedupe duplicate model_rebuild() calls; print summary

* fix(postprocess): correct  base for  vs definitions and print summary

* fix(postprocess): stop injecting noqa on root line to preserve Field(...) metadata

* fix(postprocess): stop injecting noqa on root line to preserve Field(...) metadata

* fix(schema): enforce RequestId as string|integer; improve schema postprocess summary

* fix(schema): coerce ExecCommandEndEvent.exit_code to integer
@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

  • Updated the Codex Review & Edits workflow to run only for pull requests or when @codex is explicitly mentioned, and to skip events triggered by github-actions[bot], preventing duplicate review runs .github/workflows/codex-autoreview.ymlL17-L25

Testing

  • make lint
  • make test

View task →

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.

1 participant