Skip to content

fix(codegen): backport composed envelope generation to main - #1753

Draft
bokelley wants to merge 1 commit into
mainfrom
fix/backport-envelope-codegen
Draft

bokelley wants to merge 1 commit into
mainfrom
fix/backport-envelope-codegen

Conversation

@bokelley

@bokelley bokelley commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Optional maintenance fallback: adcontextprotocol/adcp#8636 selects this SDK's next branch for 3.3 schema CI, where both SDK generation jobs now pass. This stable-line backport is retained as a validated alternative and is not required for that integration path.

The spec repository's current default-branch checkout cannot generate the composed 3.3 schema tree because the repairs in #1705 and #1741 landed on next.

Backport both repairs: resolve inlined core references at every caller depth, retain composed envelope ancestry and narrowed fields, and locate generated classes by name. The response-emitter conflict preserves main's existing explicit-null handling. The SDK stays pinned to 3.2.7 and its generated output remains byte-identical.

Validation in Docker:

  • Stable 3.2.7 bundle, Python 3.11: 156 focused generator, hierarchy, class-matcher and schema-pin tests pass; make validate-generated confirms byte-identical output.
  • Current 3.3 source bundle, Python 3.12: full make regenerate-schemas, make validate-generated, and the same 156 tests pass. This includes export consolidation, envelope ancestry, narrowed fields and version-field retention.
  • The new composed-envelope regression reproduces the missing-reference failure against the original main generator.
  • Normal pre-commit and commit-message hooks pass, including formatting, lint, mypy and adopter type checks.

The candidate run mirrors spec CI's disposable pin/manifest adjustment and candidate-only sync isolation. It uses the deterministic bundle built at adcontextprotocol/adcp commit 95e1447549daf96ea4f29b9a879f7fe4090a4a59, including #8547, with SHA-256 d3a612e34b0e6ddb533f7d5c867ddccca9697f4734f743bfde0f2fba924876c7. This validates the current source bundle; the existing published beta.2 artifact remains unchanged.

Refs #1680 and adcontextprotocol/adcp#8547. The implementation is backported from #1705 and #1741.

Backport the generator and class-matcher repairs from #1705 and #1741 so the spec CI default-branch checkout can generate the composed 3.3 envelopes. Preserve the stable 3.2.7 pin and generated output. The response-emitter conflict retains main behavior for explicit-null handling.
@bokelley
bokelley marked this pull request as ready for review October 31, 2026 01:10

@aao-secretariat aao-secretariat Bot 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.

Ladon verdict: Approve

Approve — codegen-tooling backport (scripts + tests only).

Checked:

  • No findings from the reviewer (critical/high/medium/low all clear).
  • Diff touches only scripts/generate_types.py, scripts/post_generate_fixes.py, and three test files — no public adcp.* surface, no wire-shape change, generated output claimed byte-identical for the 3.2.7 pin.
  • New pin_conflicting_allof_properties logic is fail-closed (raises on undecidable oneOf/anyOf-branch disagreement rather than guessing), and stabilize_inlined_core_refs rewrites resolve correctly via existing _normalize_schema_ref_target.
  • find_class_header/require_class_header and normalize_emitted_envelope_bases correctly follow generated class composition; strong new test coverage.
  • fix(codegen) semver signal is correct for a non-breaking tooling change.

Gate checks: no no-auto-approve team match; gated_paths false; high_risk false. No blocking or medium findings → decision table falls through to row 9 (approve). Note: review_decision is REVIEW_REQUIRED, but with gated_paths: false row 2 does not apply.

@bokelley
bokelley marked this pull request as draft October 31, 2026 01:25

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.

1 participant