{"record":{"id":"78c7c6a98087bc6a","repo":"koala73/worldmonitor","slug":"generated-internal-probe-filters-incorrectly-cover-public","errorCode":null,"errorMessage":"Generated internal probe filters incorrectly cover public function(s): ${collisions.join(', ')}. Deploy-skew visibility for removed public names would be lost.","messagePattern":"Generated internal probe filters incorrectly cover public function\\(s\\): (.+?)\\. Deploy-skew visibility for removed public names would be lost\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/sync-sentry-convex-probe-filters.mjs","lineNumber":179,"sourceCode":"/**\n * Assert the safety half of the invariant: no *public* Convex function name\n * is covered by the generated internal filter set. A removed/renamed public\n * call must still report (deploy-skew visibility).\n *\n * @param {string} convexRoot\n * @param {string[]} internalPatterns\n */\nexport function assertPublicFunctionsRemainVisible(convexRoot, internalPatterns) {\n  const patternSet = new Set(internalPatterns);\n  const collisions = [];\n  for (const entry of listPublicConvexFunctionExports(convexRoot)) {\n    const pattern = convexMissingPublicFunctionPattern(entry.moduleRef, entry.name);\n    if (patternSet.has(pattern)) {\n      collisions.push(`${entry.moduleRef}:${entry.name}`);\n    }\n  }\n  if (collisions.length > 0) {\n    throw new Error(\n      'Generated internal probe filters incorrectly cover public function(s): '\n        + `${collisions.join(', ')}. Deploy-skew visibility for removed public `\n        + 'names would be lost.',\n    );\n  }\n}\n\n/**\n * @param {string[]} patterns\n * @returns {string}\n */\nexport function formatCommittedFilterList(patterns) {\n  const header = [\n    '# Generated by scripts/sync-sentry-convex-probe-filters.mjs --write',\n    '# Do not edit by hand. Source of truth: convex/ internal{Query,Mutation,Action} exports.',\n    '# Each line is a Sentry filters:error_messages glob for case-1 Convex probe noise.',\n    '# Public function names are intentionally absent — deploy-skew must still report.',\n    '#',","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/koala73/worldmonitor/blob/e586b8b4b80f595aa7ece295eec10d76f2921240/scripts/sync-sentry-convex-probe-filters.mjs#L161-L197","documentation":"assertPublicFunctionsRemainVisible checks that the generated internal-probe filter patterns do not match any still-public Convex function names. If a generated 'missing public function' pattern would collide with an actual public function, the script throws because deploy-skew probes for that removed name would hide errors from a function that still exists.","triggerScenarios":"The generated pattern list (from convexMissingPublicFunctionPattern for removed/renamed public functions) contains a pattern identical to one for a moduleRef:name entry that is currently still public — typically after renaming a function back or re-adding a name that was previously removed.","commonSituations":"A Convex public function was renamed, then an engineer reused the old name (or reverted a rename) while the stale generated probe-filter list was still committed; running the sync script or its check mode detects the collision.","solutions":["Regenerate the filter list with `npm run generate:sentry-convex-probe-filters` so removed-function patterns reflect current code.","Rename the newly added public function to something that doesn't collide with a removed-name pattern.","Remove the stale removed-function entry if the function has actually been restored to public visibility."],"exampleFix":"// before (stale generated entry claims myModule:oldName was removed, but it is public again)\n// after\n// rm the stale removed-public-function record or rename the function, then:\n// npm run generate:sentry-convex-probe-filters && npm run check:sentry-convex-probe-filters","handlingStrategy":"validation","validationCode":"// before applying, regenerate and diff\n// npm run generate:sentry-convex-probe-filters && git diff --exit-code <generated-list>","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate the filter list in the same PR that renames or re-adds public Convex functions.","Never reuse a removed public function's old name without regenerating.","Treat the generated file as build output; never hand-edit it."],"tags":["code-generation","invariant","sentry"],"backgroundTag":"internal-invariant-violation","analyzedSha":"e586b8b4b80f595aa7ece295eec10d76f2921240","analyzedAt":"2026-09-22T01:50:49.965Z","contentChangedAt":"2026-09-22T01:50:49.965Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}