affaan-m/ECC · error · Error

is missing the expected catalog marker

Error message

${source} is missing the expected catalog marker

What it means

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.

Solutions

  1. Restore the expected catalog marker in the file named in `source`, using the text from a matching file on main as reference.
  2. If the marker format intentionally changed, update the regex passed to replaceOrThrow at the call site.
  3. Re-run the catalog script after the fix to confirm all regions match.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/ci/catalog.js:82 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/305c69c0ec77c0f6. Report an issue: GitHub.

Appendix: source

Thrown at scripts/ci/catalog.js:82

function readFileOrThrow(filePath) {
  try {
    return fs.readFileSync(filePath, 'utf8');
  } catch (error) {
    throw new Error(`Failed to read ${path.basename(filePath)}: ${error.message}`);
  }
}

function writeFileOrThrow(filePath, content) {
  try {
    fs.writeFileSync(filePath, content, 'utf8');
  } catch (error) {
    throw new Error(`Failed to write ${path.basename(filePath)}: ${error.message}`);
  }
}

function replaceOrThrow(content, regex, replacer, source) {
  if (!regex.test(content)) {
    throw new Error(`${source} is missing the expected catalog marker`);
  }

  return content.replace(regex, replacer);
}

function parseReadmeExpectations(readmeContent) {
  const expectations = [];

  const quickStartMatch = readmeContent.match(
    /access to\s+(\d+)\s+agents,\s+(\d+)\s+skills,\s+and\s+(\d+)\s+(?:commands|legacy command shims?)/i
  );
  if (!quickStartMatch) {
    throw new Error('README.md is missing the quick-start catalog summary');
  }

  expectations.push(
    { category: 'agents', mode: 'exact', expected: Number(quickStartMatch[1]), source: 'README.md quick-start summary' },
    { category: 'skills', mode: 'exact', expected: Number(quickStartMatch[2]), source: 'README.md quick-start summary' },

View on GitHub (pinned to 8321021c54)