docs(api): single-source the /usage rate limit and unify cutover caveats - #109
Merged
Merged
Conversation
Follow-ups from the blocking reviews of the /v1/usage docs:
- The usage budget (30 requests per minute per member) now lives once,
in rateLimits.ts (USAGE_REQUESTS_PER_MINUTE, mirroring the cloud-api
keyedLimiter value), and reaches info.description through a new
{{USAGE_RATE_LIMIT}} placeholder resolved in resolveSpec — same
mechanism as {{RATE_LIMITS}}; rendered text is byte-identical. The
/usage endpoint description and its 429 stay static (the contract)
and are pinned by test against the shared constant.
- All four api_requests descriptions now use the exact same cutover
sentence; the caveat test asserts the full sentence on every schema.
Tests: 3 new single-source tests + strengthened caveat assertions;
vitest 66 files / 1308 tests green; npm run build green.
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.
Tracking issue
#102 (follow-ups of the shipped /v1/usage docs)
Summary
USAGE_REQUESTS_PER_MINUTEinrateLimits.ts(mirroring the cloud-api keyedLimiter value), rendered intoinfo.descriptionthrough a new{{USAGE_RATE_LIMIT}}placeholder — same mechanism as{{RATE_LIMITS}}; rendered text byte-identical.api_requestsdescriptions use the exact same cutover sentence; the caveat test asserts the full sentence on every schema./usageendpoint description and its 429 stay static (the contract) and are now pinned by test against the shared constant.Changes
src/lib/rateLimits.tsUSAGE_REQUESTS_PER_MINUTE = 30with doc commentsrc/lib/apiDoc.ts{{USAGE_RATE_LIMIT}}placeholder resolution inresolveSpecsrc/data/openapi.jsoninfo.description;UsageAllTime.api_requestssentence unifiedsrc/lib/openapiSpec.test.tsTest plan
npm test— 66 files / 1308 tests green (RED observed first for all new assertions)npm run buildgreen;canonicalParity+docsNavconfirm bot text and navigation unchangedDeploy notes