{"record":{"id":"bedd9339b2165d79","repo":"koala73/worldmonitor","slug":"missing-publisher-origin-for-provider-provider","errorCode":null,"errorMessage":"Missing publisher origin for provider: ${provider}","messagePattern":"Missing publisher origin for provider: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/mcp/registry/source-tools.ts","lineNumber":62,"sourceCode":"\nconst PROVIDER_HOSTS = new Map<string, string[]>();\nfor (const entry of ACTIVE_PROVIDERS) {\n  const provider = entry.provider || entry.host;\n  const hosts = PROVIDER_HOSTS.get(provider) || [];\n  if (!hosts.includes(entry.host)) hosts.push(entry.host);\n  PROVIDER_HOSTS.set(provider, hosts);\n}\n\nconst PROVIDER_ORIGINS = new Map<string, string | null>();\nfor (const [provider, hosts] of PROVIDER_HOSTS) {\n  PROVIDER_ORIGINS.set(provider, resolveSourceOrigin({ provider, hosts }));\n}\n\nfunction providerOrigin(entry: ManifestEntry): string | null {\n  const provider = entry.provider || entry.host;\n  const origin = PROVIDER_ORIGINS.get(provider);\n  if (origin === undefined && !PROVIDER_ORIGINS.has(provider)) {\n    throw new Error(`Missing publisher origin for provider: ${provider}`);\n  }\n  return origin ?? null;\n}\n\nconst SOURCE_VIEWS = ['summary', 'providers', 'outlets'] as const;\nconst SOURCE_PLATFORMS = ['telegram'] as const;\nconst DEFAULT_ROW_LIMIT = 50;\nconst MAX_ROW_LIMIT = 200;\n\ninterface PlatformIdentity {\n  platform: (typeof SOURCE_PLATFORMS)[number];\n  handle: string;\n}\n\nconst PLATFORM_IDENTITIES_BY_SOURCE = new Map<string, PlatformIdentity[]>();\nfor (const entry of TELEGRAM_CHANNEL_TRUST) {\n  const identities = PLATFORM_IDENTITIES_BY_SOURCE.get(entry.name) || [];\n  identities.push({ platform: 'telegram', handle: entry.handle });","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/api/mcp/registry/source-tools.ts#L44-L80","documentation":"providerOrigin could not resolve a publisher origin for a manifest provider: the provider's entry in PROVIDER_ORIGINS maps to null (resolveSourceOrigin failed for all of its hosts). This is a static registry-build defect in the ACTIVE_PROVIDERS manifest data — a provider lacks a usable host/origin — not a runtime user-input problem.","triggerScenarios":"Thrown at api/mcp/registry/source-tools.ts:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the provider's manifest entry in ACTIVE_PROVIDERS so it includes a resolvable host","Make providerOrigin return a safe default or skip the provider instead of throwing when the origin is missing","Add a registry unit test asserting every ACTIVE_PROVIDERS entry resolves to a non-null origin"],"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"}