fix(api): align the telemetry-ingest routes' published statuses with their handlers - #9751
Conversation
…their handlers The two near-identical ingest routes' published operations disagreed with their handlers and each other. POST /v1/ams/ingest declared a 202 it never returns (its handler returns 200 on success) and omitted 413, while POST /v1/orb/ingest was a legacy registerPath block declaring only 200/400 with no security stanza at all -- publishing an unauthenticated write endpoint that in fact carries its own ORB_INGEST_TOKEN bearer and can 401/403/413. - /v1/ams/ingest now declares 200 (not the unreachable 202), plus 413 for the readOrbIngestBody 1 MiB body ceiling. - /v1/orb/ingest moves from the spec.ts registerPath block to a SpecEntry in internal-and-public-route-specs.ts with auth: "orb" (which derives the OrbBearer security stanza) and responses 200, 400, 401, 403, 413. - openapi.json regenerated. Adds test/unit/openapi-ingest-status-parity.test.ts asserting, for BOTH routes, that no bearer -> 401, an oversized content-length -> 413, and a valid authenticated batch -> 200, and that each of those statuses (and, for orb, the OrbBearer security + 403) is declared in buildOpenApiSpec(); the route-spec-ratchet test still passes in both directions. Closes JSONbored#9708
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-29 06:12:40 UTC
Review summary Nits — 6 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Decision record
Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9751 +/- ##
==========================================
+ Coverage 76.58% 76.70% +0.11%
==========================================
Files 282 284 +2
Lines 59419 59729 +310
Branches 6553 6559 +6
==========================================
+ Hits 45508 45816 +308
Misses 13629 13629
- Partials 282 284 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|


What & why
Closes #9708.
The two near-identical telemetry-ingest routes' published operations disagreed with their handlers
and with each other:
POST /v1/ams/ingestdeclared a202its handler never returns (the real success status is200)and omitted
413.POST /v1/orb/ingestwas a legacyregisterPathblock declaring only200/400with nosecuritystanza at all — publishing an unauthenticated write endpoint that actually carries itsown
ORB_INGEST_TOKENbearer and can return401/403/413.Change
/v1/ams/ingestnow declares200(not the unreachable202), plus413for thereadOrbIngestBody1 MiB (MAX_ORB_INGEST_BODY_BYTES) body ceiling./v1/orb/ingestmoves from thespec.tsregisterPathblock to aSpecEntryininternal-and-public-route-specs.tswithauth: "orb"(which derives theOrbBearersecuritystanza) and responses
200, 400, 401, 403, 413.openapi.jsonregenerated;security: [{ "OrbBearer": [] }]now present on/v1/orb/ingest.Validation
test/unit/openapi-ingest-status-parity.test.ts: for both routes, no bearer →401, anoversized
content-length→413, and a valid authenticated batch →200; and each of thosestatuses (plus, for orb, the
OrbBearersecurity and403) is declared inbuildOpenApiSpec().test/unit/route-spec-ratchet.test.tsstill passes in both directions.202fails the status-parity assertion.ui:openapi:checkdrift-check clean.