{"record":{"id":"0b354cb82e594005","repo":"koala73/worldmonitor","slug":"parts-join-n","errorCode":null,"errorMessage":"${parts.join('\\n')}","messagePattern":"\\$\\{parts\\.join\\('\\\\n'\\)\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/sync-sentry-convex-probe-filters.mjs","lineNumber":385,"sourceCode":"    return;\n  }\n\n  const parts = [\n    'Committed Sentry Convex probe filter list drifted from convex/ source.',\n    `  File: ${relativeToRepo(COMMITTED_LIST_PATH)}`,\n    '  Run: npm run generate:sentry-convex-probe-filters',\n  ];\n  if (missing.length > 0) {\n    parts.push(`  Missing (${missing.length}):`);\n    for (const line of missing.slice(0, 20)) parts.push(`    + ${line}`);\n    if (missing.length > 20) parts.push(`    … and ${missing.length - 20} more`);\n  }\n  if (extra.length > 0) {\n    parts.push(`  Extra (${extra.length}):`);\n    for (const line of extra.slice(0, 20)) parts.push(`    - ${line}`);\n    if (extra.length > 20) parts.push(`    … and ${extra.length - 20} more`);\n  }\n  throw new Error(parts.join('\\n'));\n}\n\n/**\n * Merge generated patterns into live Sentry filters, PUT, and read back.\n *\n * @param {string[]} patterns\n * @param {{ dryRun: boolean }} opts\n */\nasync function runApply(patterns, opts) {\n  const token = resolveToken();\n  if (!token) {\n    throw new Error(\n      'Set SENTRY_API_TOKEN (or SENTRY_AUTH_TOKEN / SENTRY_SESSION_TOKEN) to a '\n        + 'sntryu_ user token with project:read and project:write.',\n    );\n  }\n  const org = process.env.SENTRY_ORG || DEFAULT_ORG;\n  const project = process.env.SENTRY_PROJECT || DEFAULT_PROJECT;","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/koala73/worldmonitor/blob/e586b8b4b80f595aa7ece295eec10d76f2921240/scripts/sync-sentry-convex-probe-filters.mjs#L367-L403","documentation":"After comparing committed filter patterns with expected patterns, runCheck throws an error whose message is the assembled diff report: missing entries, extra entries (up to 20 shown), and counts. This is the drift signal — the committed generated file does not match what generation would now produce.","triggerScenarios":"Running check mode when the committed list differs from freshly computed patterns: a public Convex function was added/removed/renamed without regenerating, or the committed file was hand-edited.","commonSituations":"A PR renamed a public function but the author forgot to run the generator; a merge kept an outdated committed list; someone edited the generated file manually.","solutions":["Run `npm run generate:sentry-convex-probe-filters` and commit the updated list.","Review the missing/extra entries in the message to confirm the intended function changes.","Never hand-edit the generated file; fix the source of truth (Convex function definitions) instead."],"exampleFix":"// before\n// committed list still contains module:oldFunction after rename\n// after\nnpm run generate:sentry-convex-probe-filters\ngit commit -am \"regenerate sentry convex probe filters\"","handlingStrategy":"validation","validationCode":"// pre-commit or CI step\n// npm run generate:sentry-convex-probe-filters && git diff --exit-code -- <generated-list-path>","typeGuard":null,"tryCatchPattern":"try { runCheck(patterns); } catch (err) { console.error(err.message); process.exit(1); } // message already is the diff report","preventionTips":["Run the generator whenever Convex public function names change.","Add a CI check that fails on generated-file drift.","Never hand-edit the generated list."],"tags":["code-generation","drift","ci"],"backgroundTag":"schema-validation-failed","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"}