Skip to content

fix(api): /capabilities terminal-tier marker — null upgrade_url + is_terminal_tier (DOG-26)#185

Merged
mastermanas805 merged 1 commit into
masterfrom
fix/api-capabilities-terminal-tier-upgrade-url-2026-05-30
May 30, 2026
Merged

fix(api): /capabilities terminal-tier marker — null upgrade_url + is_terminal_tier (DOG-26)#185
mastermanas805 merged 1 commit into
masterfrom
fix/api-capabilities-terminal-tier-upgrade-url-2026-05-30

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • DOG-26: top-rank tier (Team today) emits upgrade_url=null + is_terminal_tier=true so SDKs/dashboards can suppress the Upgrade CTA without string-matching "team"
  • Every other tier keeps the pricing URL + is_terminal_tier=false
  • Terminal marker is rank-driven (entries[len-1].rank) — adding an enterprise tier above Team tomorrow Just Works

Rule-17 coverage block

  • Symptom: upgrade_url for the terminal Team tier loops to /pricing/ (no destination)
  • Enumeration: grep upgrade_url + UpgradeURL in api/internal/handlers/ (capabilities-specific sites)
  • Sites found: 3 — capabilities.go emit, capabilities_test.go assert, openapi.go schema
  • Sites touched: 3 (all)
  • Coverage test: TestCapabilities_TerminalTierUpgradeURLIsNull — registry-iterating (rule 18): asserts body.Tiers[len-1].IsTerminalTier == true + UpgradeURL == nil, every other tier is the inverse. Doesn't hardcode "team" as the terminal name — works as the ladder evolves.
  • Live verified: pending merge + auto-deploy + curl https://api.instanode.dev/api/v1/capabilities | jq '.tiers[] | {tier, upgrade_url, is_terminal_tier}'

OpenAPI contract

  • upgrade_url: string["string", "null"] (non-breaking — only Team gets null)
  • is_terminal_tier: new required boolean

Test plan

  • go build ./...
  • go vet ./...
  • go test ./internal/handlers/ -short -count=1 -run TestCapabilities (all 8 cases pass)
  • go test ./internal/handlers/ -short -count=1 -run TestOpenAPI (schema valid)
  • Post-merge: curl /api/v1/capabilities | jq '.tiers[] | select(.tier=="team") | .upgrade_url' returns null

…terminal_tier (DOG-26)

Today every tier including Team returns upgrade_url="https://instanode.dev/pricing/".
Team is the top of the rank ladder — there is nothing to upgrade to.
SDKs/dashboards rendering an Upgrade CTA on the Team plan show a button
that loops back to the pricing page with no action.

Now: top-rank tier emits upgrade_url=null + is_terminal_tier=true. Every
other tier keeps the pricing URL + is_terminal_tier=false. Clients can
suppress the Upgrade CTA via the boolean (or "URL is null" check)
without string-matching "team" — adding an enterprise tier above team
tomorrow Just Works.

Done via rank-iterating the live registry (capabilities.go computes
terminalRank as entries[len-1].rank after the rank sort), so the contract
is anchored to plans.Rank, not to a hardcoded tier name.

OpenAPI: upgrade_url is now ["string", "null"]; is_terminal_tier is a
required boolean. Both schema changes are non-breaking — existing clients
that read upgrade_url as a string get null for Team only.

Coverage block:
  Symptom:        upgrade_url for terminal tier (Team) loops to pricing
  Enumeration:    grep upgrade_url + UpgradeURL in api/internal/handlers/
                  for capabilities-specific sites (1 emit + 1 test + 1 openapi)
  Sites found:    3
  Sites touched:  3 (capabilities.go emit, capabilities_test.go assert,
                  openapi.go schema + required list)
  Coverage test:  TestCapabilities_TerminalTierUpgradeURLIsNull —
                  registry-iterating (rule 18): asserts entries[len-1]
                  has IsTerminalTier=true + UpgradeURL=nil, and every
                  other tier is the inverse. Adding a new top tier
                  automatically shifts the assertion target.
  Live verified:  pending merge + auto-deploy + curl /api/v1/capabilities
                  | jq '.tiers[] | {tier, upgrade_url, is_terminal_tier}'

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 force-pushed the fix/api-capabilities-terminal-tier-upgrade-url-2026-05-30 branch from f551e4d to 582e9a2 Compare May 30, 2026 05:44
@mastermanas805 mastermanas805 merged commit 4759b67 into master May 30, 2026
14 checks passed
@mastermanas805 mastermanas805 deleted the fix/api-capabilities-terminal-tier-upgrade-url-2026-05-30 branch May 30, 2026 05:59
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