@@ -294,7 +294,7 @@ describe('#5372 — the SHAPE: one key set across every producer', () => {
294294 // the id/name aliases the dispatch surfaces already published.
295295 expect ( keys ( rest ) ) . toEqual ( [
296296 'displayName' , 'email' , 'id' , 'isPlatformAdmin' , 'name' , 'organizationId' ,
297- 'permissions' , 'positions' , 'roles' , ' systemPermissions', 'userId' ,
297+ 'permissions' , 'positions' , 'systemPermissions' , 'userId' ,
298298 ] ) ;
299299 } ) ;
300300
@@ -312,7 +312,6 @@ describe('#5372 — the SHAPE: one key set across every producer', () => {
312312 displayName : 'Dev Admin' ,
313313 email : 'admin@objectos.ai' ,
314314 positions : [ 'platform_admin' ] ,
315- roles : [ 'platform_admin' ] ,
316315 // Derived by `createEvalUser`, never stored — ADR-0068 D2.
317316 isPlatformAdmin : true ,
318317 permissions : [ 'admin_full_access' ] ,
@@ -321,10 +320,23 @@ describe('#5372 — the SHAPE: one key set across every producer', () => {
321320 } ) ;
322321 } ) ;
323322
324- it ( 'the ADR-0090 position aliases stay in lockstep (`roles` is `positions`)' , async ( ) => {
323+ it ( 'publishes positions under ONE spelling — the `roles` alias is gone (#6011)' , async ( ) => {
324+ // REPLACED, not deleted. This pin used to assert the two spellings
325+ // stayed "in lockstep"; the maintainer's 2026-08-06 ruling closed the
326+ // alias outright (direction 2, immediate retirement — not a
327+ // deprecation window), so a lockstep assertion would now pin the
328+ // removed limb. Deleting it outright would have been worse: the
329+ // substance it guarded (positions reaches the body verbatim) would
330+ // have gone unguarded on this surface. So it asserts BOTH halves —
331+ // what the surviving key carries, and that the retired one is absent.
325332 const { actionCtx } = await dispatchRest ( makeEc ( { positions : [ 'sales_rep' ] } ) , makeQl ( DEV_ADMIN ) ) ;
326333
334+ // Substance: the canonical key carries the caller's positions verbatim.
327335 expect ( actionCtx . user . positions ) . toEqual ( [ 'sales_rep' ] ) ;
328- expect ( actionCtx . user . roles ) . toEqual ( actionCtx . user . positions ) ;
336+ // Direction: the retired spelling is ABSENT — not present-and-empty,
337+ // which is what a half-done removal (dropped value, surviving key)
338+ // would leave behind and what `toBeUndefined()` alone cannot tell apart.
339+ expect ( 'roles' in actionCtx . user ) . toBe ( false ) ;
340+ expect ( Object . keys ( actionCtx . user ) ) . not . toContain ( 'roles' ) ;
329341 } ) ;
330342} ) ;
0 commit comments