{"record":{"id":"d9b442612d94ab45","repo":"Fission-AI/OpenSpec","slug":"dist-is-missing-run-pnpm-build-first-hashes","errorCode":null,"errorMessage":"dist/ is missing. Run `pnpm build` first - hashes are computed from the build.","messagePattern":"dist/ is missing\\. Run `pnpm build` first - hashes are computed from the build\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/regen-parity-hashes.mjs","lineNumber":70,"sourceCode":"    return newest;\n  }\n  for (const entry of entries) {\n    if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue;\n    const full = join(dir, entry.name);\n    const mtime = entry.isDirectory() ? newestMtime(full) : statSync(full).mtimeMs;\n    if (mtime > newest) newest = mtime;\n  }\n  return newest;\n}\n\n// Hashes are computed from dist/, but the parity test recomputes them from\n// src/. Regenerating against a stale build therefore writes hashes the test\n// then rejects, after reporting \"nothing to update\" - a false all-clear on the\n// most common mistake there is, forgetting to build. Refuse to guess.\nconst srcMtime = newestMtime(join(repoRoot, 'src'));\nconst distMtime = newestMtime(join(repoRoot, 'dist'));\nif (distMtime < 0) {\n  throw new Error('dist/ is missing. Run `pnpm build` first - hashes are computed from the build.');\n}\nif (srcMtime > distMtime) {\n  throw new Error(\n    'dist/ is older than src/, so the hashes would be computed from a stale build\\n' +\n      'and the parity test - which reads src/ - would reject them. Run `pnpm build` first.'\n  );\n}\n\nconst templates = await import(distUrl('core/templates/skill-templates.js'));\nconst { getSkillTemplates, generateSkillContent } = await import(\n  distUrl('core/shared/skill-generation.js')\n);\n\nconst TEST_FILE = join(repoRoot, 'test/core/templates/skill-templates-parity.test.ts');\n\nconst sha256 = (value) => createHash('sha256').update(value).digest('hex');\n\n// The generated-content hashes are keyed by skill directory. Read that mapping","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/scripts/regen-parity-hashes.mjs#L52-L88","documentation":"Error \"dist/ is missing. Run `pnpm build` first - hashes are computed from the build.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at scripts/regen-parity-hashes.mjs:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}