Found while implementing #12034 (SDK-side binding of packages.get); out of that card's scope, which is the response shape only.
The defect
GET /api/v1/packages/:id accepts a ?version= query parameter from the SDK and the only surface that serves the route never reads it. The caller is answered 200 with the installed version, and nothing in the status, headers or body distinguishes that from a version-scoped read that actually happened.
The SDK still sends it. ScopedEnvironmentClient.packages.get in packages/client/src/index.ts takes version as its second argument and appends it:
get: async (id: string, version?: string) => {
const qs = version ? `?version=${encodeURIComponent(version)}` : '';
const res = await this.parent._fetch(this.url(`/packages/${encodeURIComponent(id)}${qs}`));
...
}
The serving handler is the runtime dispatcher's /packages domain (packages/runtime/src/domains/packages.ts, the parts.length === 1 && m === 'GET' branch). It reads the path id and nothing else — query is never touched on that branch:
const id = decodeURIComponent(parts[0]);
const pkg = registry.getPackage(id);
Why it is a regression rather than an always-dead parameter
The parameter was honoured until recently, by the REST registrar's twin of this route. #16628 (fix(rest): the dispatcher's /packages domain is the one implementation of the package read and delete routes (#14503), merged 2026-09-08) deleted that handler, and the deleted code read the parameter and guarded its arity:
const requested = readSingleQueryValue(req.query?.version);
if (...) {
sendError(res, 400, 'VALIDATION_ERROR', repeatedQueryParamMessage('version', requested.count));
}
const version = requested.value || 'latest';
const pkg = await packageService.get(packageId, version);
So the deletion, which was correct about the one-route-one-owner problem it was solving, silently dropped a request-side capability along with the duplicate response shape. The dispatcher never had that read to inherit.
Repro
Against any host serving the dispatcher's /packages domain, with com.acme.crm@1.0.0 installed:
GET /api/v1/packages/com.acme.crm?version=99.0.0 answers 200 with the 1.0.0 row.
- Expected: either the
99.0.0 record, or a refusal naming version.
The environment-scoped mount reaches the same handler through the @objectstack/hono catch-all, so scoped.packages.get(id, '99.0.0') has the same outcome from the SDK.
Why this is filed rather than fixed in #12034's PR
The fix is a decision, not a mechanical repair — three defensible answers, and they differ on the wire:
- Restore the version-scoped read in the dispatcher branch (with the arity guard the deleted handler carried), making the SDK parameter true again.
- Remove
version from the SDK signature and let the route be identity-only.
- Refuse it — declare the route's closed query-parameter set per the Route and surface ownership rule so an unrecognised name gets a located
400 instead of being dropped.
Option 3 is the one the repo's own standing rule points at for a GET route that reads req.query, and it composes with either of the first two. Whichever is chosen, it is a producer-side wire change and wants its own ruling.
Notes
Found while implementing #12034 (SDK-side binding of
packages.get); out of that card's scope, which is the response shape only.The defect
GET /api/v1/packages/:idaccepts a?version=query parameter from the SDK and the only surface that serves the route never reads it. The caller is answered200with the installed version, and nothing in the status, headers or body distinguishes that from a version-scoped read that actually happened.The SDK still sends it.
ScopedEnvironmentClient.packages.getinpackages/client/src/index.tstakesversionas its second argument and appends it:The serving handler is the runtime dispatcher's
/packagesdomain (packages/runtime/src/domains/packages.ts, theparts.length === 1 && m === 'GET'branch). It reads the path id and nothing else —queryis never touched on that branch:Why it is a regression rather than an always-dead parameter
The parameter was honoured until recently, by the REST registrar's twin of this route. #16628 (
fix(rest): the dispatcher's /packages domain is the one implementation of the package read and delete routes (#14503), merged 2026-09-08) deleted that handler, and the deleted code read the parameter and guarded its arity:So the deletion, which was correct about the one-route-one-owner problem it was solving, silently dropped a request-side capability along with the duplicate response shape. The dispatcher never had that read to inherit.
Repro
Against any host serving the dispatcher's
/packagesdomain, withcom.acme.crm@1.0.0installed:GET /api/v1/packages/com.acme.crm?version=99.0.0answers200with the1.0.0row.99.0.0record, or a refusal namingversion.The environment-scoped mount reaches the same handler through the
@objectstack/honocatch-all, soscoped.packages.get(id, '99.0.0')has the same outcome from the SDK.Why this is filed rather than fixed in #12034's PR
The fix is a decision, not a mechanical repair — three defensible answers, and they differ on the wire:
versionfrom the SDK signature and let the route be identity-only.400instead of being dropped.Option 3 is the one the repo's own standing rule points at for a
GETroute that readsreq.query, and it composes with either of the first two. Whichever is chosen, it is a producer-side wire change and wants its own ruling.Notes
POST /api/v1/packages/publishanswers a misleading 405 (Allowed: DELETE, GET, HEAD, PATCH) — the request is absorbed by/packages/:idbecause the REST package registrar is not mounted on showcase #7563, POST /api/v1/packages is a publish-vs-install shape collision — REST registers first and shadows the dispatcher (#3587 finding) #3610 orGET /api/v1/packages/:idswallows the same failed REGISTRY read — and answers a terminal404 RESOURCE_NOT_FOUNDfor it #11376 — those are about the mounting/shadowing of these routes and the registry-read swallow, and all three are closed.client.packages.get(id)does not accept a version at all, so only the scoped SDK method can reach this today.