assertScope = (allegedScope, path, url) => {
  const scope = Object(allegedScope);
  assert(
    allegedScope === scope && !Array.isArray(scope),
    `${path} must be an object, got ${allegedScope} in ${q(url)}`,
  );

  const { compartment, ...extra } = scope;
  assertEmptyObject(
    extra,
    `${path} must not have extra properties, got ${q(
      Object.keys(extra),
    )} in ${q(url)}`,
  );

  assert.typeof(
    compartment,
    'string',
    `${path}.compartment must be a string, got ${q(compartment)} in ${q(url)}`,
  );
}
@param {unknown} allegedScope
@param {string} path
@param {string} url