Skip to content

chore(types): regenerate schemas from upstream spec#252

Merged
bokelley merged 2 commits into
mainfrom
bokelley/regen-schemas-2026-04-21
Apr 21, 2026
Merged

chore(types): regenerate schemas from upstream spec#252
bokelley merged 2 commits into
mainfrom
bokelley/regen-schemas-2026-04-21

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary

make regenerate-schemas — deterministic output from the upstream spec. Largest visible change is capabilities-response idempotency becoming a discriminated union.

Spec-level changes captured

  • get_adcp_capabilities_response.idempotency is now oneOf(IdempotencySupported, IdempotencyUnsupported) with a new account_id_is_opaque field. Unblocks code generators that can't lower draft-07 if/then constructs — the replay_ttl_seconds invariant is now enforced at the type level. Sellers declaring opaque account_ids can now signal that in capabilities.
  • New file: schemas/cache/core/x-entity-types.json + generated x_entity_types.py.
  • 296 other files: refreshed descriptions, enum reorderings (numbered discriminated-union variants shift — aliases in adcp/types/aliases.py continue to pin the stable names), minor field tightening.

Also ran black over generated_poc/ to match pre-commit's formatting expectations on generated files (currently the only reason pre-commit stalls on regen commits — follow-up to add an exclude there).

Tested

Test plan

  • CI green across Python 3.10–3.13
  • Skim the get_adcp_capabilities_response diff — this is the one type where the shape genuinely changed (union vs flat object). Downstream consumers matching on capabilities.idempotency.supported still work because supported is the discriminator; anything switching on presence of replay_ttl_seconds as a sentinel for "supported" needs to migrate to the discriminated shape.
  • Optional: consider adding src/adcp/types/generated_poc/ to [tool.black] extend-exclude so future regens don't hit the pre-commit stash conflict.

🤖 Generated with Claude Code

bokelley and others added 2 commits April 21, 2026 18:52
Pulled latest schemas via `make regenerate-schemas`. Spec drift
includes:

- protocol.get_adcp_capabilities_response.idempotency is now a
  discriminated oneOf (IdempotencySupported / IdempotencyUnsupported)
  with a new `account_id_is_opaque` field — lets code generators
  that can't lower draft-07 if/then constructs produce correct named
  types with the replay_ttl_seconds invariant at the type level.
- Other files: refreshed descriptions, enum reorderings that reshuffle
  numbered discriminated-union variants, minor field tightening.

296 generated files changed, ~24K lines in / ~20K lines out.
validate-generated passes. mypy clean across 678 source files.
Full suite: 2079 tests passing (no regressions — PR #251's A2A
contextId integration suite lands cleanly against the refreshed
types).

No source changes outside generated_poc/ + _generated.py +
_ergonomic.py + schemas/cache/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Running black on src/adcp/types/generated_poc/ during pre-commit
after make regenerate-schemas causes a stash conflict — the hook
reformats the just-regenerated files, tries to re-apply over the
seller's modifications, and rolls back. The regen script already
runs black on the consolidated _generated.py at generation time;
individual generated_poc/ files don't need per-commit formatting.

Mirrors the ruff extend-exclude list for the same set. After this,
a fresh make regenerate-schemas + git commit succeeds without
the pre-commit roll-back.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit a8a0f06 into main Apr 21, 2026
10 checks passed
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