Hmbown/CodeWhale · error · Error

${label} does not match the authoritative inventory; missing

Error message

${label} does not match the authoritative inventory; missing: ${missing.join(", ")}; unexpected: ${unexpected.join(", ")}; duplicate basenames are present

What it means

assertExactNames() found that the set of names presented (directory entries or manifest rows) does not equal the authoritative inventory exported by npm/codewhale/scripts/artifacts (allReleaseAssetNames, checksummedReleaseAssetNames, BUNDLE_ASSET_NAMES). The message enumerates missing names, unexpected names, and whether duplicates were present. Both verifyAssetDirectory and assertManifest route through this check.

Source

Thrown at scripts/release/assemble-release-assets.js:57

    if (!match) {
      throw new Error(`${label} contains an invalid checksum row: ${trimmed}`);
    }
    const name = match[2];
    if (checksums.has(name)) {
      throw new Error(`${label} contains duplicate checksum rows for ${name}`);
    }
    checksums.set(name, match[1].toLowerCase());
  }
  return checksums;
}

function assertExactNames(actualNames, expectedNames, label) {
  const actual = new Set(actualNames);
  const expected = new Set(expectedNames);
  const missing = expectedNames.filter((name) => !actual.has(name));
  const unexpected = actualNames.filter((name) => !expected.has(name));
  if (missing.length > 0 || unexpected.length > 0 || actual.size !== actualNames.length) {
    throw new Error(
      `${label} does not match the authoritative inventory` +
        `${missing.length > 0 ? `; missing: ${missing.join(", ")}` : ""}` +
        `${unexpected.length > 0 ? `; unexpected: ${unexpected.join(", ")}` : ""}` +
        `${actual.size !== actualNames.length ? "; duplicate basenames are present" : ""}`,
    );
  }
}

async function assertManifest(directory, manifestName, expectedNames) {
  const manifestPath = path.join(directory, manifestName);
  const checksums = parseChecksumManifest(
    await fs.readFile(manifestPath, "utf8"),
    manifestName,
  );
  assertExactNames([...checksums.keys()], expectedNames, manifestName);
  for (const name of expectedNames) {
    const actual = await sha256(path.join(directory, name));
    if (checksums.get(name) !== actual) {

View on GitHub (pinned to 8880682c63)

Solutions

  1. Reconcile against the message: add the files listed under 'missing' and delete those under 'unexpected' so the set matches the authoritative inventory exactly
  2. Re-run the complete build workflow so every artifact named by allReleaseAssetNames() is produced and downloaded before assemble
  3. Remove stray files from the asset/output directory before verify
  4. If the inventory intentionally changed, update npm/codewhale/scripts/artifacts.js so expected and produced sets agree, then rebuild

Example fix

# before: verify fails -- unexpected: .DS_Store, old-asset.tar.gz; missing: codewhale-aarch64-linux.tar.gz

# after
cd assets && rm -f .DS_Store old-asset.tar.gz
cp /path/to/build/codewhale-aarch64-linux.tar.gz .
node scripts/release/assemble-release-assets.js --verify assets
Defensive patterns

Strategy: validation

Validate before calling

const { allReleaseAssetNames } = require("./npm/codewhale/scripts/artifacts");
const fs = require("node:fs/promises");
async function directoryMatchesInventory(dir) {
  const actual = await fs.readdir(dir);
  const expected = allReleaseAssetNames();
  const missing = expected.filter((name) => !actual.includes(name));
  const unexpected = actual.filter((name) => !expected.includes(name));
  const hasDuplicates = new Set(actual).size !== actual.length;
  return { ok: missing.length === 0 && unexpected.length === 0 && !hasDuplicates, missing, unexpected, hasDuplicates };
}

Prevention

When it happens

Trigger: Running --verify on a directory containing a stray file (.DS_Store, a leftover tarball, an editor temp file); a manifest missing one of the checksummed or bundle asset rows; an extra row for a retired asset; duplicate basenames among entries.

Common situations: A new platform asset added to artifacts.js but the build job for it was skipped or failed; CI downloading only a subset of workflow artifacts; local inspection leaving files behind; the inventory edited between build and assemble so expected and produced sets diverge.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16). Data as JSON: /api/errors/6f44c7d1a57b91c5. Report an issue: GitHub.