validate = async (
    targetName,
    rootOpt,
    log = defaultLog,
    meta = undefined,
    options = {},
  ) => {
    await null;
    const {
      noTransforms: expectedNoTransforms = false,
      elideComments: expectedElideComments = false,
      format: expectedFormat = DEFAULT_MODULE_FORMAT,
      conditions: expectedConditions = [],
    } = options;
    expectedConditions.sort();
    if (!meta) {
      const metaJson = await loadMetaText(targetName, log);
      if (metaJson) {
        try {
          meta = JSON.parse(metaJson);
        } catch (error) {
          if (error instanceof SyntaxError) {
            throw SyntaxError(`Cannot parse JSON from ${targetName}, ${error}`);
          }
          throw error;
        }
      }
    }
    if (!meta) {
      throw Fail`no metadata found for ${q(targetName)}`;
    }
    const {
      bundleFileName,
      bundleTime,
      bundleSize,
      contents,
      moduleSource: { absolute: moduleSource },
      format = 'endoZipBase64',
      noTransforms = false,
      elideComments = false,
      conditions = [],
    } = meta;
    conditions.sort();
    assert.equal(bundleFileName, toBundleName(targetName));
    assert.equal(format, expectedFormat);
    assert.equal(noTransforms, expectedNoTransforms);
    assert.equal(elideComments, expectedElideComments);
    assert.equal(conditions.length, expectedConditions.length);
    conditions.forEach((tag, index) => {
      assert.equal(tag, expectedConditions[index]);
    });
    if (rootOpt) {
      moduleSource === cwd.neighbor(rootOpt).absolute() ||
        Fail`bundle ${targetName} was for ${moduleSource}, not ${rootOpt}`;
    }
    /** @type {import('fs').Stats} */
    const { mtime: actualBundleTime, size: actualBundleSize } = await wr
      .readOnly()
      .neighbor(bundleFileName)
      .stat();
    assert.equal(actualBundleTime.toISOString(), bundleTime);
    assert.equal(actualBundleSize, bundleSize);
    const moduleRd = wr.readOnly().neighbor(moduleSource);
    const actualStats = await Promise.all(
      contents.map(
        async ({ relativePath, mtime: priorMtime, size: priorSize }) => {
          const itemRd = moduleRd.neighbor(relativePath);
          /** @type {import('fs').Stats} */
          const { mtime, size } = await itemRd.stat();
          return {
            relativePath,
            mtime: mtime.toISOString(),
            size,
            priorMtime,
            priorSize,
          };
        },
      ),
    );
    const changed = actualStats.filter(
      ({ mtime, size, priorMtime, priorSize }) =>
        mtime !== priorMtime || size !== priorSize,
    );
    changed.length === 0 ||
      Fail`changed: ${q(changed)}. ${q(targetName)} bundled at ${q(
        bundleTime,
      )}`;
    return meta;
  }
@param {string} targetName
@param {any} rootOpt
@param {Logger} [log]
@param {BundleMeta} [meta]
@param {object} [options]
@param {boolean} [options.noTransforms]
@param {boolean} [options.elideComments]
@param {ModuleFormat} [options.format]
@param {string[]} [options.conditions]
@returns {Promise<BundleMeta>}