assertCompartmentMap = (
  allegedCompartmentMap,
  url = '<unknown-compartment-map.json>',
) => {
  const compartmentMap = Object(allegedCompartmentMap);
  assert(
    allegedCompartmentMap === compartmentMap && !Array.isArray(compartmentMap),
    `Compartment map must be an object, got ${allegedCompartmentMap} in ${q(
      url,
    )}`,
  );
  const {
    // TODO migrate tags to conditions
    // https://github.com/endojs/endo/issues/2388
    tags: conditions,
    entry,
    compartments,
    ...extra
  } = Object(compartmentMap);
  assertEmptyObject(
    extra,
    `Compartment map must not have extra properties, got ${q(
      Object.keys(extra),
    )} in ${q(url)}`,
  );
  assertConditions(conditions, url);
  assertEntry(entry, url);
  assertCompartments(compartments, url);
}
@param {unknown} allegedCompartmentMap
@param {string} [url]
@returns {asserts allegedCompartmentMap is CompartmentMapDescriptor}