{"record":{"id":"305c69c0ec77c0f6","repo":"affaan-m/ECC","slug":"source-is-missing-the-expected-catalog-marker","errorCode":null,"errorMessage":"${source} is missing the expected catalog marker","messagePattern":"(.+?) is missing the expected catalog marker","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ci/catalog.js","lineNumber":82,"sourceCode":"function readFileOrThrow(filePath) {\n  try {\n    return fs.readFileSync(filePath, 'utf8');\n  } catch (error) {\n    throw new Error(`Failed to read ${path.basename(filePath)}: ${error.message}`);\n  }\n}\n\nfunction writeFileOrThrow(filePath, content) {\n  try {\n    fs.writeFileSync(filePath, content, 'utf8');\n  } catch (error) {\n    throw new Error(`Failed to write ${path.basename(filePath)}: ${error.message}`);\n  }\n}\n\nfunction replaceOrThrow(content, regex, replacer, source) {\n  if (!regex.test(content)) {\n    throw new Error(`${source} is missing the expected catalog marker`);\n  }\n\n  return content.replace(regex, replacer);\n}\n\nfunction parseReadmeExpectations(readmeContent) {\n  const expectations = [];\n\n  const quickStartMatch = readmeContent.match(\n    /access to\\s+(\\d+)\\s+agents,\\s+(\\d+)\\s+skills,\\s+and\\s+(\\d+)\\s+(?:commands|legacy command shims?)/i\n  );\n  if (!quickStartMatch) {\n    throw new Error('README.md is missing the quick-start catalog summary');\n  }\n\n  expectations.push(\n    { category: 'agents', mode: 'exact', expected: Number(quickStartMatch[1]), source: 'README.md quick-start summary' },\n    { category: 'skills', mode: 'exact', expected: Number(quickStartMatch[2]), source: 'README.md quick-start summary' },","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ci/catalog.js#L64-L100","documentation":"Generic sentinel thrown by replaceOrThrow when a regex marking a catalog-managed region fails to match the file content. The faulting input is the `source` label (a README/AGENTS section name) whose text no longer contains the expected marker.","triggerScenarios":"Thrown at scripts/ci/catalog.js:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Restore the expected catalog marker in the file named in `source`, using the text from a matching file on main as reference.","If the marker format intentionally changed, update the regex passed to replaceOrThrow at the call site.","Re-run the catalog script after the fix to confirm all regions match."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}