{"record":{"id":"b6a02f56697f8927","repo":"stablyai/orca","slug":"no-historical-released-snapshot-is-available-for","errorCode":null,"errorMessage":"No historical released snapshot is available for ${name}","messagePattern":"No historical released snapshot is available for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scripts/verify-skill-update-roundtrip.mjs","lineNumber":73,"sourceCode":"  if (!skill) {\n    throw new Error(`Current manifest is missing ${name}`)\n  }\n  return skill\n}\n\nfunction historicalRelease(name) {\n  const current = currentSkill(name)\n  for (const release of releaseMapping.releases.toReversed()) {\n    const revision = release.skills[name]\n    if (typeof revision !== 'number' || revision >= current.releaseRevision) {\n      continue\n    }\n    const snapshot = registry.skills[name]?.find((entry) => entry.releaseRevision === revision)\n    if (snapshot) {\n      return { tag: `v${release.appVersion}`, snapshot }\n    }\n  }\n  throw new Error(`No historical released snapshot is available for ${name}`)\n}\n\nasync function materializePackage(name, tag, destination) {\n  const prefix = `skills/${name}/`\n  const entries = execFileSync('git', ['ls-tree', '-r', '-z', tag, '--', `skills/${name}`])\n    .toString('utf8')\n    .split('\\0')\n    .filter(Boolean)\n  if (entries.length === 0) {\n    throw new Error(`${tag} does not contain ${name}`)\n  }\n  for (const entry of entries) {\n    const match = /^(\\d+) (\\w+) ([a-f0-9]+)\\t(.+)$/.exec(entry)\n    if (!match || match[2] !== 'blob') {\n      throw new Error(`Unsupported historical tree entry: ${entry}`)\n    }\n    const relativePath = match[4].slice(prefix.length)\n    const destinationPath = path.join(destination, ...relativePath.split('/'))","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/verify-skill-update-roundtrip.mjs#L55-L91","documentation":"historicalRelease() walks releaseMapping.releases in reverse (newest first) looking for the most recent release whose skills[name] revision is a number strictly less than the current skill's releaseRevision, and that has a matching snapshot in snapshot-registry.json. It throws when no prior release shipped an older revision of that skill with a preserved snapshot — i.e. there is no valid previous version to round-trip the update from.","triggerScenarios":"A brand-new skill with no prior release history; the snapshot registry missing the historical revision entry; release-mapping.json malformed or lacking releases entries that reference this skill; all prior releases reference the same or higher revision than current.","commonSituations":"Adding the first skill to the update system before any release ships it; regenerating snapshot-registry.json and dropping older revisions; release-mapping.json not updated after a release; skill's releaseRevision was decremented or left unchanged across releases.","solutions":["Confirm the skill has shipped in at least one prior release by inspecting release-mapping.json releases[].skills[name].","Verify snapshot-registry.json contains an entry for that skill at the older releaseRevision.","If this is a new skill, add a prior snapshot or skip the round-trip test until a release has shipped it.","Regenerate the snapshot and release-mapping artifacts with the documented tooling to restore consistency."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before the round-trip, confirm a historical snapshot exists:\nfunction hasHistorical(name) {\n  const current = currentSkill(name)\n  return releaseMapping.releases.some((r) => {\n    const rev = r.skills[name]\n    return typeof rev === 'number' && rev < current.releaseRevision &&\n      registry.skills[name]?.some((s) => s.releaseRevision === rev)\n  })\n}\nif (!hasHistorical(targetName)) {\n  console.warn(`Skipping round-trip: no historical snapshot for ${targetName}`)\n  process.exit(0)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship at least one release containing the skill before enabling the round-trip gate for it.","Keep release-mapping.json and snapshot-registry.json in the same commit when adding/changing a skill.","Treat a missing historical snapshot for a brand-new skill as a skip, not a failure, until first release."],"tags":["manifest","skill-update","release-mapping","snapshot","test-fixture"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}