Skip to content

adapters/hono's two bare { data } discovery bodies lose their ratchet owner when #9364 lands #9436

Description

@os-zhuang

Filed unassigned by the #9364 dev seat while banking that card's counter deltas. Nobody is on it.

Blocked-by: #9389 — the ruling there decides which way this one goes, so it should not be dispatched before that card lands.

The gap

scripts/check-route-envelope.mjs pins packages/adapters/hono/src/index.ts at two counters:

counterwhat it isowner after #9364
errorCodeNotString 1errorJson wrote the HTTP status into error.codefixed by #9364
unenveloped 2two { data: await dispatcher.getDiscoveryInfo(prefix) } bodies, no success flagnobody

Triage scoped #9364 to the error-path half only (errorJson), so the errorCodeNotString counter goes to zero there and the file's entry survives carrying unenveloped 2 alone. That entry's ratchet field names #9364 — a card the same PR closes.

The three bare-payload surfaces #9389 rules on are a deliberately closed list: /api/v1/runtime/config, current-user-endpoints.ts, and /bootstrap-status. These two bodies are not among them, so #9389 will not sweep them up either.

Why they are the same class as #9389, and why that matters

Both are the discovery payload for a mount:

app.get(prefix,async(c)=>c.json({data: awaitdispatcher.getDiscoveryInfo(prefix)}));app.get(`${prefix}/discovery`,async(c)=>c.json({data: awaitdispatcher.getDiscoveryInfo(prefix)}));

They are read before authentication, by SDKs and codegen rather than by a browser SPA — which is why they were not in #9389's SPA-driven list, and also why the answer may legitimately differ from it. { data } is one key away from the envelope (success is the whole difference), so the migration cost here is far lower than for the SPA-read surfaces #9389 weighs.

What needs deciding

The same fork #9389 states, on a different consumer population:

Whichever way it goes, the gate records it — but only if the entry keeps pointing at a card that is open. Today's ratchet pointer goes stale the moment #9364 merges.

Same-shape residue in the ratchet table

Three other entries name #9364 in their ratchet field and are #9389's to retarget when it lands: runtime-config-plugin.ts, current-user-endpoints.ts, auth-plugin.ts. Noting it here so the dangling-pointer sweep is one job rather than four discoveries.

Related: #9364 (the error-path half, where this was measured) · #9389 (the pre-auth bare-payload ruling) · #9267 (added the gate surface) · #3843 (the envelope guard's founding class).

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions