Fission-AI/OpenSpec · error

dist/ is missing. Run `pnpm build` first - hashes are comput

Error message

dist/ is missing. Run `pnpm build` first - hashes are computed from the build.

What it means

Error "dist/ is missing. Run `pnpm build` first - hashes are computed from the build." thrown in Fission-AI/OpenSpec.

Source

Thrown at scripts/regen-parity-hashes.mjs:70

    return newest;
  }
  for (const entry of entries) {
    if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue;
    const full = join(dir, entry.name);
    const mtime = entry.isDirectory() ? newestMtime(full) : statSync(full).mtimeMs;
    if (mtime > newest) newest = mtime;
  }
  return newest;
}

// Hashes are computed from dist/, but the parity test recomputes them from
// src/. Regenerating against a stale build therefore writes hashes the test
// then rejects, after reporting "nothing to update" - a false all-clear on the
// most common mistake there is, forgetting to build. Refuse to guess.
const srcMtime = newestMtime(join(repoRoot, 'src'));
const distMtime = newestMtime(join(repoRoot, 'dist'));
if (distMtime < 0) {
  throw new Error('dist/ is missing. Run `pnpm build` first - hashes are computed from the build.');
}
if (srcMtime > distMtime) {
  throw new Error(
    'dist/ is older than src/, so the hashes would be computed from a stale build\n' +
      'and the parity test - which reads src/ - would reject them. Run `pnpm build` first.'
  );
}

const templates = await import(distUrl('core/templates/skill-templates.js'));
const { getSkillTemplates, generateSkillContent } = await import(
  distUrl('core/shared/skill-generation.js')
);

const TEST_FILE = join(repoRoot, 'test/core/templates/skill-templates-parity.test.ts');

const sha256 = (value) => createHash('sha256').update(value).digest('hex');

// The generated-content hashes are keyed by skill directory. Read that mapping

View on GitHub (pinned to 6926ccb18a)

When it happens

Trigger: Thrown at scripts/regen-parity-hashes.mjs:70 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/d9b442612d94ab45. Report an issue: GitHub.