@@ -511,15 +511,26 @@ describe('publishCommand — registry interaction (preserved scenarios)', () =>
511511 expect ( stdout ) . toContain ( 'an admin will review your submission shortly' )
512512 } )
513513
514- test ( 'namespaced facet: URL-encodes the slash' , async ( ) => {
514+ test ( 'scoped facet: URL-encodes the scoped identity' , async ( ) => {
515+ // The facet identity grammar (FacetManifestSchema) accepts an unscoped
516+ // slug (`cowsay`) or a scoped `@scope/name` (`@acme/cowsay`); the legacy
517+ // bare-slash form (`acme/cowsay`) is no longer a valid manifest name.
518+ //
519+ // TODO(scoped-routes): the registry has moved to literal-slash scoped
520+ // routes (`/v0/facets/@scope/name/...`), but the engine registry client
521+ // still hits the single-`{name}` route and lets openapi-fetch percent-
522+ // encode the whole identity (`@acme/cowsay` → `%40acme%2Fcowsay`). The
523+ // scoped-route migration (publish/resolve/download) is tracked separately;
524+ // this assertion documents the *current* client behavior and is expected
525+ // to flip to the literal-slash form when that lands.
515526 await buildFacetFixture ( projectRoot , {
516- name : 'acme/cowsay' ,
527+ name : '@ acme/cowsay' ,
517528 version : '0.1.0' ,
518529 commands : { cowsay : '# cowsay\n' } ,
519530 } )
520531 const spy = createFetchSpy (
521532 ( ) =>
522- new Response ( JSON . stringify ( fixtures . publishResponse ( { name : 'acme/cowsay' } ) ) , {
533+ new Response ( JSON . stringify ( fixtures . publishResponse ( { name : '@ acme/cowsay' } ) ) , {
523534 status : 201 ,
524535 } ) ,
525536 )
@@ -530,7 +541,7 @@ describe('publishCommand — registry interaction (preserved scenarios)', () =>
530541 expect ( spy . calls ) . toHaveLength ( 1 )
531542 const call = spy . calls [ 0 ]
532543 if ( call === undefined ) expect . unreachable ( )
533- expect ( call . url ) . toBe ( 'https://api.test/v0/facets/acme %2Fcowsay/versions' )
544+ expect ( call . url ) . toBe ( 'https://api.test/v0/facets/%40acme %2Fcowsay/versions' )
534545 } )
535546
536547 test ( '413 (tarball too large): renders the registry error verbatim' , async ( ) => {
0 commit comments