Skip to content

DID-10196: [VER2-PY] sdk-python: DESIGN.md 3.1 detection rules and the shared openapi/breaking-vectors.json - #26

Merged
arosasg merged 2 commits into
mainfrom
botinc/run-8353cb3b
Nov 7, 2026
Merged

arosasg merged 2 commits into
mainfrom
botinc/run-8353cb3b

Conversation

@botinc-agent

@botinc-agent botinc-agent Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The seven server SDKs' spec syncs disagree on edge cases (removed parameters, nullable request values, format changes, server: false operations), so one upstream change can produce seven different "Breaking changes" lists. DESIGN.md 3.1 named the categories but not the exact rules, and nothing shared checked them.

Solution

  • DESIGN.md 3.1: the exact rules text from DID-10196 (SHA-256 2f22a158…).
  • Detector (codegen/spec_sync.py) follows the rules. Changes from today:
    • Now counted: a removed parameter, a body becoming required, and a response field that is no longer required.
    • Now listed, not counted: a request value that can now be null, and changes inside server: false operations.
    • Success statuses: a 2xx status that loses its body, or a sole status replaced by one without a body, counts as "can now be null" and, when no other status returns the old body, type string -> null (null = no body left).
    • Unions: a union that becomes "any" through an untyped variant still compares its paired variants.
  • Shared form of each line: BreakingChange.normalized() gives <METHOD> <path> <where> <field>: <kind>; classify(before, after) runs the real sync on two documents. Parameters now read "query parameter limit" in the summary.
  • codegen/breaking_vectors.py writes openapi/breaking-vectors.json: 73 hand-written cases, at least two per DESIGN.md bullet. It refuses to write while the detector disagrees, and --check reports a stale file.
  • Commit as ci:, so this releases nothing.

Verification

  • test_breaking_vectors.py, test_spec_sync.py, test_codegen.py: 171 passed. Every vector passes, renders are byte-identical, the 2026-11-04 pair still gives 14 changes and 2026-11-06 "None detected".
  • ruff check and format, mypy (924 files), pyright: clean. DESIGN.md hash matches.
  • The generator regenerates openapi/breaking-vectors.json with identical bytes and --check passes.
  • CI run 42350760484 at 31102cb: every job passed (tests on Linux, macOS and Windows, Python 3.10 to 3.14, lint, type check, generated code, build, secret scan). The live sandbox tests were skipped because CI has no sandbox key.

🤖 Generated with Claude Code

@arosasg
arosasg merged commit 186b40a into main Nov 7, 2026
13 checks passed
@arosasg
arosasg deleted the botinc/run-8353cb3b branch November 7, 2026 07:25
arosasg added a commit that referenced this pull request Nov 8, 2026
The last commit of the vectors pull request (#26) was pushed after it merged,
so main kept 73 cases while sdk-node, sdk-go, sdk-java, sdk-php and sdk-dotnet
copied the 75-case file from its branch. This lands that commit: the cases
union-required-field-no-longer-required and
union-variant-numbered-with-its-null-variant, the generator entries and the
detector change they need. openapi/breaking-vectors.json now has the same
bytes as the other repositories (SHA-256 5c9a66000f9743f9...).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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