You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(spec,plugins): sweep the auth/session slot lookups (#4251)
Batch B2 of the #4251 sweep: every service-lookup erasure in the
auth/session family. plugin-auth/auth-plugin.ts (20),
plugin-hono-server/current-user-endpoints.ts (10) and
plugin-security/security-plugin.ts (1) now pass the slot's contract type;
the ratchet baseline drops 171 -> 140 sites, 40 -> 37 files, and all three
files leave the grandfather list.
The yield: POST /admin/import-users resolved the `metadata` slot and probed
`metadataService?.getMetaItem` to decide whether to pass the import's
field-coercion dependency. `getMetaItem` is a PROTOCOL method
(ObjectStackProtocolImplementation, registered under `protocol`);
MetadataManager, which occupies `metadata`, has never had it. The probe was
false on every deployment and the dep was never passed -- imported rows
reached sys_user uncoerced, with the branch claiming otherwise sitting
right there. Same shape as #4127's dead automation.trigger. The route reads
`protocol` now.
/me/apps reached ObjectQL's PRIVATE `_registry` through `as any` while
/auth/me/permissions, two handlers up in the same file, read the public
`registry` getter over the same field of the same object. Both read the
public accessor now; the one test that stubbed `_registry` was pinning that
private reach and stubs `registry`.
Contract, from evidence: IDataEngine's read methods (find / findOne /
count / aggregate) declare the trailing `options?: BaseEngineOptions`
argument they have always accepted. ObjectQL's own doc explains why it
exists -- the same `{ context }` object was correct as insert's 3rd
argument and SILENTLY DROPPED as find's, so an intended isSystem bypass
just vanished. The contract exposed only query.context, so callers using
the trailing channel could reach it only by erasing the lookup. Adding an
optional trailing parameter breaks no implementor or caller;
BaseEngineOptions was already exported but sat unused under the
legacy/deprecated heading, and moves up with the rationale attached. One
new spec test pins the argument at the call site.
Where the contract does not reach, the escape hatch is named rather than
`any`: PermissionEvaluatorSurface (security.permissions),
SettingsReadSurface (settings), EngineRegistrySurface /
EngineExtensionSurface (objectql beyond IDataEngine). That last one is
deliberate scope -- the standing record on getObjectQL in @objectstack/
runtime says ObjectQL is genuinely wider than IDataEngine and typing the
whole thing IDataEngine would be the more comfortable-looking lie. These
declarations are what that contract gets written from, and what it deletes.
Verified: full-repo typecheck 110/110; spec 7157/278, objectql 1394/87,
runtime 951/66, plugin-auth 579/26, plugin-security 677/32,
plugin-hono-server 135/12; eslint clean on every changed file;
check:slot-lookup 140 sites in 37 files.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fix(spec,plugins): sweep the auth/session slot lookups — 31 sites typed, and the user-import metadata reader was pointed at a service that never had the method (#4251)
9
+
10
+
Batch B2 of the #4251 sweep: every service-lookup erasure in the auth/session
0 commit comments