Skip to content

chore(contracts): vendor only the parts of the upstream contract the SDK consumes - #105

Merged
vdavez merged 2 commits into
mainfrom
chore/contract-public-projection
Oct 29, 2026
Merged

vdavez merged 2 commits into
mainfrom
chore/contract-public-projection

Conversation

@vdavez

@vdavez vdavez commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

What

  • scripts/refresh_contract.py now writes a public projection of the upstream filter/shape contract: it drops server-side implementation details (filter, paginator and view class names, docs and Swagger audit bookkeeping, generator path) and keeps everything the SDK's gates read.
  • contracts/filter_shape_contract.json is re-vendored through the projection at API 5.13.0. The diff is deletions only.
  • The token-gated staleness notice in lint.yml now projects the upstream file before comparing, so it doesn't warn on every run.
  • tests/test_refresh_contract.py pins the projection and asserts the committed contract is already projected.

Why

The vendored contract is only an input to the conformance and shape-coverage gates. Server-side implementation details in it aren't used by the SDK, so they don't need to be published.

Testing

  • ruff format --check, ruff check, mypy tango/: clean.
  • check_filter_shape_conformance.py: passes. --list-unmapped still emits pagination_class (now empty).
  • check_shape_coverage.py: 0 new gaps.
  • pytest: 699 passed, 1 skipped.
  • Regenerating the shape overlay gives the same output from the projected contract as from the full one.

No CHANGELOG entry: only scripts/, tests/, contracts/ and CI change, and none of them ship in the package.

🤖 Generated with Claude Code

vdavez and others added 2 commits October 29, 2026 15:01
…SDK consumes

The refresh script now writes a public projection of the upstream filter/shape contract, dropping server-side implementation details: filter and paginator class names, docs-coverage bookkeeping, and the generator path.
The vendored contract is re-generated through the projection at API 5.13.0; everything the conformance and shape-coverage gates read is unchanged.
The CI staleness notice compares against a fresh projection of the upstream contract instead of the raw file.
A new test pins the projection so a future refresh cannot reintroduce the dropped keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The projection now also removes each resource's server view path and its swagger audit flag; the public Swagger parameter list stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vdavez
vdavez marked this pull request as ready for review October 29, 2026 20:15
@vdavez
vdavez merged commit a88234e into main Oct 29, 2026
11 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