Skip to content

fix(api): OpenAPI contract corrections — servers URL, resource_type/status/tier enums, provisioning envelope#103

Merged
mastermanas805 merged 2 commits into
masterfrom
fix/openapi-contract-corrections
May 14, 2026
Merged

fix(api): OpenAPI contract corrections — servers URL, resource_type/status/tier enums, provisioning envelope#103
mastermanas805 merged 2 commits into
masterfrom
fix/openapi-contract-corrections

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

Wave FIX-E OpenAPI spec drift cleanup. Eight findings against the agent-facing OpenAPI doc — none broke runtime behavior, but every one silently misled an agent reading the spec to discover what to do next.

openapi_test.go gains 7 new gates so a future "let's tidy the schema" PR can't re-drop any of these without CI failing.

Coordination

  • test(coverage): drive internal/crypto to 95.6% #142/billing/checkout plan enum missing hobby_plus. FIX-A owns the plans.yaml hobby_plus row; this PR did not touch the enum to avoid clashing. FIX-A will roll up hobby_plus and the corresponding /billing/checkout plan enum in the same change.

Cross-references

  • sdk-go: fix(sdk-go): correct DefaultBaseURL + add Deploy() method — same wave.
  • mcp: fix(mcp): correct /api/me/* paths, claim host, env var, surface agent_action — same wave.

Test plan

  • go test ./internal/handlers/ -run TestOpenAPI -count=1 → PASS (all openapi tests, including the 7 new gates)
  • go build ./... → clean
  • Verified pre-existing TestTeamSelf_* failures are unrelated (column-count mismatch on models.GetTeamByID, reproduces on master)
  • Reviewer eye-pass on the new schema docstrings (esp. claim_url phrasing)

Stretches the contract surface, not the runtime — zero handler code changed.

Generated with Claude Code

mastermanas805 and others added 2 commits May 14, 2026 15:20
Wave FIX-E spec drift cleanup. Eight findings against the agent-facing
OpenAPI doc, none of which broke runtime behavior but every one of which
silently misled an agent trying to read the spec to discover what to do
next:

* servers[0].url was https://instant.dev (dead-brand 404). Now
  https://api.instanode.dev. #C1
* resource_type enum on ResourceItem AND the inline duplicate inside
  ClaimPreviewResponse listed "nats" (never written to the column —
  handlers emit "queue") and was missing "vector" entirely. Hoisted
  ClaimPreviewResponse.resources[] to $ref ResourceItem so the two enums
  can't drift again. #C9
* DeployResponse.item.status and DeployItem.status missed the
  intermediate "deploying" state the worker writes — strict-validating
  agents would reject poll responses. #C10
* TeamSummaryResponse.tier enum stopped at {anonymous,free,hobby,pro,team}
  but the live teams.plan_tier column carries hobby_plus, growth, and
  *_yearly variants — a dashboard that validated against this enum would
  reject every Plus / yearly customer. #C11
* ErrorResponse didn't document claim_url, which the
  free_tier_recycle_requires_claim envelope writes on the wire. #C12
* GET /start was documented as a 200 HTML page; the handler issues a 302
  redirect to the dashboard's /claim page. Spec now declares 302 + the
  Location header. #C13
* upgrade_jwt was documented in llms.txt but missing from every
  provisioning response schema. Added to DB, Cache, NoSQL, Queue,
  Storage, Webhook, Vector responses so an agent reading the OpenAPI
  alone discovers the field instead of falling back to URL-stripping
  (which the policy memory explicitly says we do not want). #C17

openapi_test.go gains seven new gates so a future "let's tidy the
schema" PR can't re-drop any of these without a CI fail.

Stretching the contract surface, not the runtime — zero handler code
changed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
FIX-A added hobby_plus + growth to the tier enum. This branch's version
also adds the *_yearly variants. Kept the superset (this branch's set)
which includes everything from both PRs.
@mastermanas805 mastermanas805 merged commit 75af7bf into master May 14, 2026
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