Add /enhance path to openapi.yaml (wave-gateway#799) - #44
Conversation
The live-bound POST /v1/enhance route (ESPCN super-resolution, v1 ships exactly one model) had no OpenAPI entry. Documents auth (bearer key, enhance:write scope), the x402 402 challenge for unauthenticated callers (mirrors the Render/MoQ PaymentRequired idiom), the raw-body-or-?url= input contract, the per-job receipt headers (x-enhance-*), the wave_enhance_minutes duration-billing note, and the 400/413/422/501/503 error shapes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9a7d1ce7-336e-40e3-bcfd-b76367566d57) |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — The gateway runtime is unchanged, but the PR intentionally replaces an existing draft operation with a fully typed binary and pay-per-call contract, changing the generated SDK surface and request/response media types. This public API-schema compatibility change warrants human review. Not approved because:
Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more. |
PR Summary by QodoDocument POST /v1/enhance in OpenAPI (AI super-resolution, x402)
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Code Review by Qodo
1.
|
Qodo FixerNo findings are within the configured fix scope. To change which findings are fixed, adjust the setting on your Qodo configuration page. |
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_1a6e3fe0-9b47-4c10-8219-752aa83502f7) |
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
🟢 WAVE BugBot — clearNo confident findings on the changed lines. Local review · $0 inference · wave-dispatch |
…ce spec Resolves the duplicate /enhance path introduced by the merge: keeps this PR's hand-authored operation (binary body, model/url query params, per-job response headers) over the auto-generated draft placeholder that had landed on main in the interim. CHANGELOG.md conflict resolved by keeping both unrelated additive entries. Verified live: unauthenticated POST https://api.wave.online/v1/enhance returns 402 (x402 challenge, atomicAmount 600000), confirming the route is live and priced, matching this PR's documented meter. Added a published-drift-allowlist.json shared-drift exemption for POST /enhance, keyed on the published contracts x-schema-status still being draft — it lapses the moment the gateways own spec generation promotes the operation, so this repo stays ahead of the gateway without silently outliving its own justification. Regenerated contract-drift.json and generated/api-types.d.ts.
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_e342da75-f29d-4a74-b977-bd37662a2f4a) |
CodeAnt Nitpicks1 code suggestion1. This raw conflict marker leaves the changelog with an unresolved merge artifact and causes the following MoQ and attestation entries to be duplicated.Comment mismatch · |
…ce contract alignment Resolves conflicts from #40 (README), #43 (CI/body-guard), and #48 (Clip/Voice contract alignment) landing ahead of this PR. - CHANGELOG.md: kept both this PR entry (Enhance AI video super-resolution surface) and mains body content-policy gate entry. - contract-drift.json: took mains version then regenerated via published-drift.mjs against the merged openapi.yaml (exit OK, no drift). - generated/api-types.d.ts: regenerated via npm run gen:types against the merged openapi.yaml. - openapi.yaml and README.md merged cleanly with no manual edits needed. Live-verified POST /v1/enhance still returns 402 (x402 challenge, priced wave_enhance_minutes meter) against https://api.wave.online/v1/enhance, confirming the route is live and staying published (not draft).
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_92378563-2c4b-400d-932e-3625ea7bc16c) |
User description
Summary
Adds the missing OpenAPI entry for
POST /v1/enhance— an AI video super-resolution route thathas been live-routed with no spec entry and no SDK method (closes the contract-drift gap flagged
against wave-gateway#799).
Enhancetag +POST /enhancepath, mirroring the existingRender/MoQ/AV Mux-Demuxpaths' style (x402
PaymentRequiredidiom, binary in/out, per-job receipt headers).espcn(ESPCN super-resolution — a fixed exact 3x factor bakedinto the trained model weights, not a runtime parameter); any other
modelvalue 400s.enhance:writescope. Unauthenticated →402with the same x402challenge shape used elsewhere in this spec (
$ref: '#/components/responses/PaymentRequired').wave_enhance_minutesmeter — the OUTPUT artifact's renderedduration, rounded up to the next whole minute. (I checked the actual spoke source before
writing this: it does not currently apply a resolution-weighting factor to the minute
count — that weighting is an open, undecided pricing question upstream, not shipped code — so
the spec documents plain output-duration minutes rather than inventing a formula.)
?url=fetch, 200 MiB cap), the per-job receiptresponse headers (
x-enhance-model,x-enhance-scale-factor,x-enhance-*-dimensions,x-wave-meter,x-wave-usage-minutes), and the error shapes actually returned by the spoke(
400/401/402/403/413/422/429/501/502/503).Breaking: yes
After merging origin/main (which since diverged and independently added an auto-generated
skills-index draft placeholder for
POST /enhance—x-schema-status: draft,application/jsonadditionalProperties: truebody), this PR's hand-authored operation replaces that placeholder.oasdiffcorrectly flags this as breaking (request-body-media-type-removed,response-media-type-removed— the placeholder'sapplication/jsonmedia types are gone,replaced by the real
video/*/application/octet-streambinary shapes). This is intentional andcorrect, not an oversight: the placeholder was never an accurate contract (verified live —
POST https://api.wave.online/v1/enhancereturns the x402 402 challenge for an unauthenticatedcall, consistent with binary-body semantics, not the draft's generic JSON shape), and no consumer
could have been calling it successfully with
application/jsonin the first place. Acknowledgingper this repo's breaking-change gate rather than silently overriding it.
Validation
Ran this repo's own CI checks locally (
.github/workflows/foundation-gate.yml):53 warnings is the exact pre-existing baseline this workflow's own comment documents (no new
warnings or errors introduced by this change).
CI on this PR may show as failed/cancelled due to the ongoing GitHub Actions "Service
Unavailable" incident — that is unrelated to this change; see the local runs above for the real
result.
Test plan
npx @redocly/cli lint openapi.yamlpasses with the pre-existing warning count onlyassert-refs.mjsconfirms every$refin the file still resolvesNote
Medium Risk
Intentionally breaking OpenAPI media types and operation shape for SDK codegen; documents x402 billing and auth lanes for a live paid route, but does not change gateway runtime behavior.
Overview
Replaces the skills-index draft
POST /enhanceplaceholder (operationIdenhance, genericapplication/jsonbody) with a hand-authoredenhanceVideocontract aligned to the live gateway: binaryvideo/*/application/octet-streaminput (or?url=HTTPS fetch, 200 MiB cap), streaming binary output,espcn-only query param, bearer or x402 pay-per-call (wave_enhance_minutes), and receipt/billing response headers plus the full 4xx/5xx set.Adds an
Enhancetag, moves the path next to other product surfaces (and drops the duplicate draft block at the bottom ofopenapi.yaml), and updatesPOST /studio-ai/enhancementscopy to point async library jobs at Studio AI vs synchronous bytes at/enhance. Regeneratesgenerated/api-types.d.tsandcontract-drift.json, and adds ashared-driftallowlist entry forPOST /enhancewhile the published spec still marks the operation draft.Reviewed by Cursor Bugbot for commit 9d746fe. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.Note
Add
POST /enhanceendpoint for synchronous AI video super-resolution to openapi.yamlPOST /enhancepath to openapi.yaml with operationIdenhanceVideo, supporting theespcnmodel for synchronous video super-resolution.httpsURL via?url=query parameter, with a 200 MiB size limit.x-enhance-model,x-enhance-scale-factor,x-wave-meter,x-wave-usage-minutes, etc.).wave_enhance_minutes.POST /studio-ai/enhancementsdescription to distinguish it from the new synchronous endpoint.Macroscope summarized bab8755.
Summary by Sourcery
Expand the public API contract with production-ready video enhancement, MoQ token, and attestation specifications while refreshing generated types and drift metadata.
New Features:
POST /enhancevideo super-resolution API with binary input/output,espcnprocessing, authentication and x402 payment behavior, billing metadata, and supported error responses.Enhancements:
/enhanceplaceholder with a complete hand-authored contract and distinguish it from asynchronous Studio AI enhancement jobs.CI:
Documentation:
Chores:
CodeAnt-AI Description
Document the live
/v1/enhancevideo super-resolution endpointWhat Changed
POST /enhancecontract for synchronous AI video enhancementespcnmodel with fixed 3x upscaling, binary streaming responses, billing, and receipt headersenhanceVideooperation and distinguish it from asynchronous Studio AI enhancement jobsImpact
✅ Typed SDK support for video enhancement✅ Clearer binary input and output contracts✅ Clearer payment, billing, and failure handling💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.