{"record":{"id":"e53c0bb5d3a249e4","repo":"paperclipai/paperclip","slug":"everything-in-the-company-is-only-available-on-the","errorCode":null,"errorMessage":"Everything in the company is only available on the default wiki space.","messagePattern":"Everything in the company is only available on the default wiki space\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/wiki/core.ts","lineNumber":999,"sourceCode":"  space: WikiSpace;\n  profile: PaperclipIngestionProfileV1;\n}) {\n  const policy = evaluatePaperclipProfilePolicy({\n    space: input.space,\n    profile: input.profile,\n    purpose: \"profile_update\",\n    requireEnabledProfile: input.profile.enabled && input.space.slug !== DEFAULT_SPACE_SLUG,\n  });\n  if (!policy.allowed) throw new Error(policy.message);\n  if (input.profile.enabled && input.profile.sourceScopes.length === 0) {\n    throw new Error(\"Paperclip ingestion profile must include at least one source scope before it can be enabled.\");\n  }\n  if (input.profile.sourceScopes.length > MAX_PAPERCLIP_INGESTION_PROFILE_SOURCE_COUNT) {\n    throw new Error(`Paperclip ingestion profile sources exceed the hard cap of ${MAX_PAPERCLIP_INGESTION_PROFILE_SOURCE_COUNT}.`);\n  }\n  for (const scope of input.profile.sourceScopes) {\n    if (scope.kind === \"company_all\" && input.space.slug !== DEFAULT_SPACE_SLUG) {\n      throw new Error(\"Everything in the company is only available on the default wiki space.\");\n    }\n    if (scope.kind === \"selected_projects\") {\n      if (scope.projectIds.length > MAX_PAPERCLIP_PROFILE_SELECTED_PROJECTS) {\n        throw new Error(`selected_projects exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_SELECTED_PROJECTS}.`);\n      }\n      for (const projectId of scope.projectIds) {\n        const project = await ctx.projects.get(projectId, input.companyId);\n        if (!project) throw new Error(`Project belongs to another company or does not exist: ${projectId}`);\n      }\n    }\n    if (scope.kind === \"root_issues\") {\n      if (scope.issueIds.length > MAX_PAPERCLIP_PROFILE_ROOT_ISSUES) {\n        throw new Error(`root_issues exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_ROOT_ISSUES}.`);\n      }\n      for (const issueId of scope.issueIds) {\n        const issue = await ctx.issues.get(issueId, input.companyId);\n        if (!issue) throw new Error(`Issue belongs to another company or does not exist: ${issueId}`);\n      }","sourceCodeStart":981,"sourceCodeEnd":1017,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/wiki/core.ts#L981-L1017","documentation":"Thrown by validatePaperclipIngestionProfile() inside the per-scope loop when a scope of kind company_all is configured on a space whose slug is not DEFAULT_SPACE_SLUG (\"default\"). company_all ingests every issue in the company, which is only permitted on the default wiki space — custom spaces must scope explicitly (selected_projects / root_issues).","triggerScenarios":"Adding a { kind: \"company_all\" } scope to a profile on a custom (non-default) space. Copying a default-space profile to a team space without editing scopes.","commonSituations":"User expects 'everything in the company' on a team-specific space. Profile template that defaults to company_all reused across spaces. Misunderstanding that company_all is reserved for the default space.","solutions":["Move the company_all scope to the default space's profile, OR","Replace company_all on the custom space with explicit scopes (selected_projects and/or root_issues).","In the UI, hide/disable the 'Everything in the company' option for non-default spaces."],"exampleFix":"// before (custom space \"team-a\")\nprofile.sourceScopes = [{ kind: \"company_all\" }]; // throws\n// after\nprofile.sourceScopes = [{ kind: \"selected_projects\", projectIds: [\"p1\",\"p2\"] }];\n// or move company_all to the default space's profile.","handlingStrategy":"validation","validationCode":"const DEFAULT_SPACE_SLUG = \"default\";\nfunction assertCompanyAllOnlyOnDefault(scope: { kind: string }, spaceSlug: string) {\n  if (scope.kind === \"company_all\" && spaceSlug !== DEFAULT_SPACE_SLUG) {\n    throw new Error(\"company_all is only allowed on the default space.\");\n  }\n}","typeGuard":"function isCompanyAllAllowed(scope: { kind: string }, spaceSlug: string): boolean {\n  return scope.kind !== \"company_all\" || spaceSlug === \"default\";\n}","tryCatchPattern":"try {\n  await validatePaperclipIngestionProfile(ctx, { companyId, space, profile });\n} catch (err) {\n  if (err instanceof Error && err.message === \"Everything in the company is only available on the default wiki space.\") {\n    // replace company_all with selected_projects/root_issues, or move to default space\n  } else throw err;\n}","preventionTips":["Hide the 'Everything in the company' option for non-default spaces in the UI.","Use selected_projects or root_issues for custom spaces.","Validate scope kind against space slug at the API boundary."],"tags":["llm-wiki","profile","source-scope","paperclip","default-space"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}