feat!(types): resolve PolicyInfo / MCPPolicyInfo naming collision (v6.0.0)#186
Merged
Conversation
….0.0) The TS SDK had two unrelated types using overlapping names that predated the OpenAPI spec write-up: - `PolicyInfo` (proxy.ts): proxy-mode shape returned by /api/request - `MCPPolicyInfo` (connector.ts): MCP shape returned by /mcp/* — this is what the OpenAPI spec actually calls `PolicyInfo`. The wire-shape contract gate flagged this as drift on the spec PolicyInfo schema, since the SDK's PolicyInfo did not match the spec shape and there was no way for the gate to know the SDK uses MCPPolicyInfo for the spec's PolicyInfo. This PR swaps the names to align with the OpenAPI spec: v5.x → v6.0.0 PolicyInfo → ProxyPolicyInfo (proxy-mode shape) MCPPolicyInfo → PolicyInfo (MCP shape; matches OpenAPI) Both old names are kept as `type` aliases for one major-version migration window: type MCPPolicyInfo = PolicyInfo (in connector.ts) type PolicyInfoLegacyProxyShape = ProxyPolicyInfo (in proxy.ts) Removed in v7.0.0. Code that uses the proxy-mode shape via `response.policyInfo` on ExecuteQueryResponse continues to compile — the property type changed from `PolicyInfo` to `ProxyPolicyInfo`, but the field shape is identical. Code that explicitly imports `PolicyInfo` from the public API will see the new MCP shape (which is what the spec said it should be). Migration: - s/MCPPolicyInfo/PolicyInfo/ in MCP-handling code, OR keep the MCPPolicyInfo alias for now. - s/PolicyInfo/ProxyPolicyInfo/ in proxy-mode code, OR temporarily use PolicyInfoLegacyProxyShape. CHANGELOG marks this as BREAKING under [Unreleased]; the v6.0.0 header will land at release time. Tests: 859 pass. Lint clean.
722fa4f to
59183d7
Compare
Member
Author
|
Rebased onto current
Holding for merge until the bundled-release story is ready: platform spec PR axonflow-enterprise#1710 lands and the community mirror sync runs, then this PR ships in the same release as the spec corrections ( CHANGELOG |
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
v6.0.0 prep PR. Resolves the only genuinely-breaking change surfaced by the wire-shape contract gate audit: the `PolicyInfo` / `MCPPolicyInfo` naming collision.
This is the second of two PRs from the wire-shape audit:
Background
The TS SDK had two unrelated types using overlapping names:
The two types refer to genuinely different concepts; the names just collided historically. The wire-shape gate could never resolve spec `PolicyInfo` to the right SDK type, because the spec name and the SDK name pointed at different shapes.
Change
Swap the names to align with the OpenAPI spec:
Migration
Code using the proxy-mode shape via the property `response.policyInfo` on `ExecuteQueryResponse` continues to compile — the property type changed from `PolicyInfo` to `ProxyPolicyInfo`, but the field shape is identical.
Code that explicitly imports the type names by hand needs one of:
Both legacy aliases are removed in v7.0.0.
Verification
Why a separate PR from #185
#185 is a pure additive sweep — every entry is opt-in (new optional fields) or marked `@deprecated` (compile-time compatible). It's safe to ship without a major version bump.
This PR is the only genuinely breaking change from the audit. Putting it in its own PR makes the v6.0.0 manifest reviewable on its own and keeps #185's diff focused on additions.
Out of scope
Test plan