Commit f551e4d
fix(api): /capabilities terminal-tier marker — null upgrade_url + is_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>1 parent 19dcb5f commit f551e4d
3 files changed
Lines changed: 89 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
| |||
128 | 140 | | |
129 | 141 | | |
130 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
131 | 157 | | |
132 | 158 | | |
133 | 159 | | |
| |||
137 | 163 | | |
138 | 164 | | |
139 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
140 | 175 | | |
141 | 176 | | |
142 | 177 | | |
| |||
151 | 186 | | |
152 | 187 | | |
153 | 188 | | |
154 | | - | |
| 189 | + | |
| 190 | + | |
155 | 191 | | |
156 | 192 | | |
157 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
169 | 181 | | |
170 | 182 | | |
171 | 183 | | |
| |||
237 | 249 | | |
238 | 250 | | |
239 | 251 | | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
240 | 286 | | |
241 | 287 | | |
242 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3246 | 3246 | | |
3247 | 3247 | | |
3248 | 3248 | | |
3249 | | - | |
| 3249 | + | |
| 3250 | + | |
3250 | 3251 | | |
3251 | | - | |
| 3252 | + | |
3252 | 3253 | | |
3253 | 3254 | | |
3254 | 3255 | | |
| |||
0 commit comments