{"record":{"id":"0bca5ee87075e76b","repo":"koala73/worldmonitor","slug":"library-is-full-max-max-imported-imported-fram","errorCode":null,"errorMessage":"Library is full (max ${MAX_IMPORTED} imported frameworks).","messagePattern":"Library is full \\(max (.+?) imported frameworks\\)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/services/analysis-framework-store.ts","lineNumber":119,"sourceCode":"3. Hidden assumptions audit: list 3–5 assumptions embedded in the consensus view that are treated as given but are actually contestable. For each, describe what would happen if the assumption is wrong.\n4. Worst-case scenario (tail risk): describe the plausible worst-case outcome that the consensus view is systematically underweighting. What would need to be true for this to materialise?\n5. Who benefits from the current narrative: identify actors who have incentives to promote the consensus framing. Does the prevalence of a narrative correlate with the interests of those spreading it?\n6. Early warning signals: what observable data points would indicate the contrarian scenario is beginning to unfold? List 2–3 specific, trackable signals.\nClose with: a one-sentence devil's advocate verdict — what is the most important thing the consensus is probably wrong about?`,\n  },\n];\n\nconst _activeCache = new Map<AnalysisPanelId, AnalysisFramework | null>();\n\nexport function loadFrameworkLibrary(): AnalysisFramework[] {\n  const imported = loadFromStorage<AnalysisFramework[]>(LIBRARY_KEY, []);\n  return [...BUILT_IN_FRAMEWORKS, ...imported];\n}\n\nexport function saveImportedFramework(fw: Omit<AnalysisFramework, 'isBuiltIn' | 'createdAt'>): void {\n  const imported = loadFromStorage<AnalysisFramework[]>(LIBRARY_KEY, []);\n  if (imported.length >= MAX_IMPORTED) {\n    throw new Error(`Library is full (max ${MAX_IMPORTED} imported frameworks).`);\n  }\n  if (fw.systemPromptAppend.length > MAX_INSTRUCTIONS_LEN) {\n    throw new Error(`Instructions exceed the ${MAX_INSTRUCTIONS_LEN}-character limit (${fw.systemPromptAppend.length} chars). Trim and retry.`);\n  }\n  const existing = loadFrameworkLibrary();\n  if (existing.some(f => f.name === fw.name)) {\n    throw new Error(`A framework named '${fw.name}' already exists. Rename the existing one first.`);\n  }\n  const newFw: AnalysisFramework = { ...fw, isBuiltIn: false, createdAt: Date.now() };\n  saveToStorage(LIBRARY_KEY, [...imported, newFw]);\n  _activeCache.clear();\n}\n\nexport function deleteImportedFramework(id: string): void {\n  if (BUILT_IN_FRAMEWORKS.some(f => f.id === id)) return;\n  const imported = loadFromStorage<AnalysisFramework[]>(LIBRARY_KEY, []);\n  saveToStorage(LIBRARY_KEY, imported.filter(f => f.id !== id));\n  _activeCache.clear();","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/src/services/analysis-framework-store.ts#L101-L137","documentation":"Client-side limit in saveImportedFramework (analysis-framework-store): the number of imported analysis frameworks in localStorage already equals MAX_IMPORTED, so no more can be saved. Built-in frameworks are unaffected; the cap bounds localStorage usage.","triggerScenarios":"Thrown at src/services/analysis-framework-store.ts:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete one or more existing imported frameworks to free a slot","Consider exporting and then removing frameworks you rarely use"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}