maybeReadPolicyOverride = async (
  policyOverridePath,
  { readFile = nodeFs.promises.readFile } = {}
) => {
  /** @type {unknown} */
  let allegedPolicy
  try {
    // eslint-disable-next-line @jessie.js/safe-await-separator
    allegedPolicy = await readJsonFile(policyOverridePath, { readFile })
  } catch (err) {
    if (err instanceof SyntaxError) {
      throw new InvalidPolicyError(
        `Invalid LavaMoat policy overrides at ${hrPath(policyOverridePath)}; failed to parse JSON`,
        { cause: err }
      )
    }
    if (/** @type {NodeJS.ErrnoException} */ (err).code === 'ENOENT') {
      log.debug(
        `No LavaMoat policy overrides found at ${hrPath(policyOverridePath)}`
      )
      return
    }

    if (/** @type {NodeJS.ErrnoException} */ (err).code !== 'ENOENT') {
      throw new InvalidPolicyError(
        `Failed to read LavaMoat policy overrides file at ${hrPath(policyOverridePath)}`,
        { cause: err }
      )
    }
  }

  try {
    assertPolicy(allegedPolicy)
    return allegedPolicy
  } catch (err) {
    throw new InvalidPolicyError(
      `Invalid LavaMoat policy overrides at ${hrPath(policyOverridePath)}; does not match expected schema`,
      { cause: err }
    )
  }
}
Reads a `policy-override.json` from disk, if any.

@param {string | URL} policyOverridePath Path to policy override
@param {ReadPolicyOverrideOptions} [options] Options
@returns {Promise<LavaMoatPolicy | undefined>}