{"record":{"id":"819c3ce228e9eecf","repo":"paperclipai/paperclip","slug":"wiki-path-must-stay-inside-agents-md-idea-md-raw","errorCode":null,"errorMessage":"Wiki path must stay inside AGENTS.md, IDEA.md, raw/, or wiki/: ${path}","messagePattern":"Wiki path must stay inside AGENTS\\.md, IDEA\\.md, raw/, or wiki/: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/wiki/core.ts","lineNumber":1176,"sourceCode":"  if (\n    !trimmed ||\n    trimmed.includes(\"\\\\\") ||\n    trimmed.split(\"/\").some((segment) => segment === \"\" || segment === \".\" || segment === \"..\")\n  ) {\n    throw new Error(`Invalid wiki path: ${path}`);\n  }\n  if (\n    trimmed !== \".gitignore\" &&\n    trimmed !== \"WIKI.md\" &&\n    trimmed !== \"AGENTS.md\" &&\n    trimmed !== \"IDEA.md\" &&\n    trimmed !== \"index.md\" &&\n    trimmed !== \"log.md\" &&\n    !trimmed.startsWith(\"raw/\") &&\n    !trimmed.startsWith(\"wiki/\") &&\n    !(options.allowMetadata && trimmed.startsWith(\".paperclip/\"))\n  ) {\n    throw new Error(`Wiki path must stay inside AGENTS.md, IDEA.md, raw/, or wiki/: ${path}`);\n  }\n  return trimmed;\n}\n\nfunction assertPagePath(path: string): string {\n  const normalized = assertWikiPath(path);\n  if (normalized !== \"index.md\" && normalized !== \"log.md\" && normalized !== \"WIKI.md\" && normalized !== \"AGENTS.md\" && normalized !== \"IDEA.md\" && !normalized.startsWith(\"wiki/\")) {\n    throw new Error(`Wiki page writes must target AGENTS.md, IDEA.md, or wiki/: ${path}`);\n  }\n  if (!normalized.endsWith(\".md\")) {\n    throw new Error(`Wiki page path must be a markdown file: ${path}`);\n  }\n  return normalized;\n}\n\nfunction assertPageWriteAllowed(path: string, writer: WritePageInput[\"writer\"] = \"agent_tool\"): void {\n  if (writer !== \"board_ui\" && PROTECTED_WIKI_CONTROL_FILES.has(path)) {\n    throw new Error(`Refusing to overwrite protected wiki control file ${path}; board-managed edits must use the wiki UI.`);","sourceCodeStart":1158,"sourceCodeEnd":1194,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/packages/plugins/plugin-llm-wiki/src/wiki/core.ts#L1158-L1194","documentation":"Error \"Wiki path must stay inside AGENTS.md, IDEA.md, raw/, or wiki/: ${path}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:1177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the path inside AGENTS.md, IDEA.md, raw/, or wiki/."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}