{"record":{"id":"89c548fd1f7ba103","repo":"JuliusBrussee/caveman","slug":"assemblystabilityerror-slot-id","errorCode":null,"errorMessage":"AssemblyStabilityError(slot.id)","messagePattern":"AssemblyStabilityError\\(slot\\.id\\)","errorType":"exception","errorClass":"AssemblyStabilityError","httpStatus":null,"severity":"error","filePath":"packages/sdk/typescript/src/index.ts","lineNumber":1843,"sourceCode":"    assemblyHashLedgers.set(cave, ledger);\n  }\n  const normalized = options.slots.map((slot) => {\n    if (!slot.id || ids.has(slot.id)) throw new Error(`assembly slot id must be non-empty and unique: ${JSON.stringify(slot.id)}`);\n    ids.add(slot.id);\n    if (![\"stable\", \"session\", \"volatile\"].includes(slot.stability)) {\n      throw new Error(`assembly slot ${JSON.stringify(slot.id)} has unknown stability ${JSON.stringify(slot.stability)}`);\n    }\n    let contentJSON: string;\n    try {\n      contentJSON = canonicalJSON(slot.content);\n    } catch {\n      throw new Error(`assembly slot ${JSON.stringify(slot.id)} content is not JSON-serializable`);\n    }\n    const contentHash = sha256Hex(contentJSON);\n    if (slot.stability !== \"volatile\") {\n      const key = `${options.sessionId}\\0${slot.id}`;\n      const previous = ledger.get(key);\n      if (previous !== undefined && previous !== contentHash) throw new AssemblyStabilityError(slot.id);\n      ledger.set(key, contentHash);\n    }\n    return { ...slot, content: JSON.parse(contentJSON) as unknown };\n  });\n\n  const ordered = ([\"stable\", \"session\", \"volatile\"] as const)\n    .flatMap((stability) => normalized.filter((slot) => slot.stability === stability));\n  const prefixSlots = ordered.filter((slot) => slot.stability !== \"volatile\");\n  const volatileSlots = ordered.filter((slot) => slot.stability === \"volatile\");\n\n  let request: Record<string, unknown>;\n  let prefixBytes: string;\n  let breakpoints: string[] = [];\n\n  if (provider === \"anthropic\") {\n    const toolsSlot = prefixSlots.find((slot) => slot.id === \"tools\" && Array.isArray(slot.content));\n    const systemSlots = prefixSlots.filter((slot) => slot !== toolsSlot);\n    const system = systemSlots.map((slot) => ({ type: \"text\", text: assemblyText(slot.content) }));","sourceCodeStart":1825,"sourceCodeEnd":1861,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/sdk/typescript/src/index.ts#L1825-L1861","documentation":"Thrown while validating assembly slots: a slot declares a stability tier other than the three known values ('stable', 'session', 'volatile'). Assembly caching keys off the stability tier, so an unrecognized tier cannot be defaulted; the offending slot id is included via the AssemblyStabilityError wrapper.","triggerScenarios":"Thrown at packages/sdk/typescript/src/index.ts:1843 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the slot's stability to 'stable', 'session', or 'volatile'","Check for typos or a stale stability literal from an older SDK version","Reclassify content that does not fit a tier into a new slot with the closest tier"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}