fix: refine OpenAPI semantic diff and adopt status JSON - #54
Merged
Conversation
Treat additive enum widenings as non-breaking, and make failed adopt regeneration restore pins then regenerate from specs/ so partial syncs cannot leave pins and generated sources out of step.
Drop brokerSpec/dataSpec/tradingSpec when nesting generateApis after adopt, and force pin paths so overrides cannot leave generated sources out of sync with specs/.
Treat security-only ops, nullable/binary equivalents, and additive oneOf/anyOf as non-breaking; keep allOf growth breaking. Write openapi-adopt-status.json and adopt on structural pin drift so equivalent spellings still catch up. Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThe PR refines OpenAPI semantic comparison and adds machine-readable adoption status output.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| scripts/openapi_tools.py | Refines semantic normalization and composition matching, and now preserves operation authentication changes as breaking differences. |
| scripts/adopt_openapi.py | Adds structural pin-drift detection and writes machine-readable adoption status before applying exit gating. |
| scripts/tests/test_openapi_tools.py | Adds coverage for security changes, schema equivalences, and additive composition members. |
| scripts/tests/test_adopt_openapi.py | Covers status JSON output, structural pin catch-up, and refusal of security-only breaking adoption. |
| GENERATION.md | Documents structural pin adoption and the refined semantic change categories. |
| CHANGELOG.md | Records the semantic-diff and structural pin-adoption behavior changes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Load pinned and candidate specs] --> B[Normalize equivalent OpenAPI forms]
B --> C[Compute semantic diff]
A --> D[Compare structural fingerprints]
C --> E{Breaking semantic change?}
D --> F{Any structural drift?}
E --> G[Write adoption report and status JSON]
F --> G
G --> H{Dry run or no change?}
H -->|Yes| I[Exit without updating pins]
H -->|No| J{Breaking change allowed?}
J -->|No| K[Refuse adoption]
J -->|Yes| L[Update pins and regenerate clients]
Reviews (2): Last reviewed commit: "fix: treat operation security requiremen..." | Re-trigger Greptile
Operation-level security feeds generated auth method names, so ignore it no longer during adopt classification.
Contributor
Author
SpenserJ
reviewed
Aug 10, 2026
* ci: open one OpenAPI adopt PR instead of breaking issues Always adopt with --allow-breaking on the bot branch, publish a draft PR when the classifier reports breaking changes or adopt fails, and ready PRs otherwise. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(ci): serialize openapi-drift runs on shared adopt PR Prevent overlapping schedule and workflow_dispatch runs from interleaving force-pushes and PR draft/body/label updates on bot/openapi-adopt. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Reconcile #53 pin-backup compile gating with classifier status JSON, structural pin catch-up, and the single adopt-PR drift workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
Compare effective operation security after document inheritance: keep OR alternative widenings additive, but treat empty→required, AND-tightening, and replacements as breaking. Also fold titled null-union members and align docs with the classifier. Co-authored-by: Cursor <cursoragent@cursor.com>
SpenserJ
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nullable/ binary equivalents (includinganyOf/oneOf+type: null, also with$refsiblings) and additiveoneOf/anyOfmembers; addedallOfmembers stay breaking.securityafter document-level inheritance: adding OR alternatives while keeping every previously accepted non-empty scheme set is additive (e.g. Market Data BasicAuth alongside API keys); removing/replacing schemes, AND-tightening, and optional/empty → required stay breaking.build/openapi-adopt-status.jsonfor machine-readablebreaking/changedgating.bot/openapi-adopt(draft when breaking or adopt fails) with concurrency serialization.Test plan
PYTHONPATH=. python -m unittest scripts.tests.test_openapi_tools scripts.tests.test_adopt_openapi./gradlew adoptOpenApiDryRun— Market Data inherit→BasicAuth OR widening is extended; cryptosecurity: []→ required remains breakingbuild/openapi-adopt-status.jsonis written on dry-run