{"record":{"id":"f05207d89bfdbfb7","repo":"stablyai/orca","slug":"generated-skill-artifacts-are-stale-n-stale-map","errorCode":null,"errorMessage":"Generated skill artifacts are stale:\\n${stale.map((filePath) => path.relative(REPO_ROOT, filePath)).join('\\n')}\\nRun pnpm generate:skill-bundle-manifest.","messagePattern":"Generated skill artifacts are stale:\\\\n(.+?)\\\\nRun pnpm generate:skill-bundle-manifest\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/generate-skill-bundle-manifest.mjs","lineNumber":639,"sourceCode":"  const expected = [\n    [CURRENT_MANIFEST_PATH, artifacts.currentManifest, null],\n    [SNAPSHOT_REGISTRY_PATH, artifacts.snapshotRegistry, null],\n    [RELEASE_MAPPING_PATH, artifacts.releaseMapping, isToleratedReleaseMappingPrefix]\n  ].filter(([filePath]) => paths.includes(filePath))\n  const stale = []\n  for (const [filePath, value, tolerated] of expected) {\n    try {\n      await access(filePath, constants.R_OK)\n      const committedText = await readFile(filePath, 'utf8')\n      if (committedText !== serialized(value) && !tolerated?.(committedText, artifacts)) {\n        stale.push(filePath)\n      }\n    } catch {\n      stale.push(filePath)\n    }\n  }\n  if (stale.length > 0) {\n    throw new Error(\n      `Generated skill artifacts are stale:\\n${stale\n        .map((filePath) => path.relative(REPO_ROOT, filePath))\n        .join('\\n')}\\nRun pnpm generate:skill-bundle-manifest.`\n    )\n  }\n}\n\nasync function main() {\n  const argv = process.argv.slice(2)\n  const rebuildFromTags = argv.includes('--rebuild-from-tags')\n  const releaseIndex = argv.indexOf('--release')\n  const releaseVersion = releaseIndex !== -1 ? argv[releaseIndex + 1] : null\n  if (releaseIndex !== -1 && !releaseVersion) {\n    throw new Error('--release requires a version argument, e.g. --release 1.4.160')\n  }\n\n  const committedRegistry = await readCommittedRegistry()\n  const committedMapping = await readCommittedReleaseMapping()","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/generate-skill-bundle-manifest.mjs#L621-L657","documentation":"Thrown by verifyArtifacts when one or more committed skill artifacts (current-manifest.json, snapshot-registry.json, release-mapping.json) do not byte-match the freshly regenerated values, or are unreadable. The error lists the stale file paths relative to REPO_ROOT and names the regeneration command (generate-skill-bundle-manifest.mjs:620-645). This is a lint/CI guard ensuring generated artifacts stay in sync with the skills/ source tree.","triggerScenarios":"Editing, adding, or deleting a file under skills/ without re-running the generator; a release-mapping row that was appended at cut but not committed; a schema bump or generator-logic change that alters serialization; a missing artifact file (access/R_OK fails).","commonSituations":"A PR that touches skill content but the author forgot `pnpm generate:skill-bundle-manifest`; CI lint catching drift after a merge; a generator refactor that changed key ordering or whitespace in JSON output; a rebase that dropped the regeneration commit.","solutions":["Run `pnpm generate:skill-bundle-manifest` locally and commit the regenerated artifact files.","Inspect the listed stale paths to see which artifact diverged; diff it against the regenerated version to confirm the change is expected.","If the change is from a generator-logic refactor, ensure the refactor is intentional and update any relevant tests, then regenerate."],"exampleFix":"# before: CI fails with 'Generated skill artifacts are stale'\ngit commit -am \"update skill content\"  # forgot to regenerate\n# after\npnpm generate:skill-bundle-manifest\ngit add resources/skills/*.json\ngit commit -m \"chore(skills): regenerate bundle manifest\"","handlingStrategy":"validation","validationCode":"// Run the generator before committing skill changes:\n// pnpm generate:skill-bundle-manifest\n// then stage resources/skills/*.json","typeGuard":null,"tryCatchPattern":"try {\n  await import('./generate-skill-bundle-manifest.mjs')\n} catch (error) {\n  if (/Generated skill artifacts are stale/.test(error.message)) {\n    // run pnpm generate:skill-bundle-manifest, re-stage, and re-run\n  } else throw error\n}","preventionTips":["Run `pnpm generate:skill-bundle-manifest` as a pre-commit hook whenever files under skills/ change.","Add the verify step to CI so drift is caught before merge.","After any generator-logic refactor, regenerate all artifacts in the same commit."],"tags":["ci","lint","codegen","skills"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}