relativize = spec => {
  spec = String(spec || '');

  const solution = [];
  if (!solve(solution, spec.split('/'))) {
    throw Error(
      `Module specifier ${q(spec)} must not traverse behind an empty path`,
    );
  }

  return ['.', ...solution].join('/');
}
Relativize turns absolute identifiers into relative identifiers.
In package.json, internal module identifiers can be either relative or
absolute, but compartments backed by node_modules always use relative module
specifiers for internal linkage.

@param {string} spec - a module specifier that of a local module, that might
be erroneously framed without an initial '.' path component.
@returns {string} the idempotent module specifier, ensured to begin with
'.'.