affaan-m/ECC · error · Error

is not valid JSON

Error message

${source} is not valid JSON: ${error.message}

What it means

parseCatalogDescriptionExpectations throws when a catalog source file (a JSON manifest, e.g. an install manifest or openai.yaml-derived JSON) fails JSON.parse. The faulting input is the file content at `source`; the underlying parse error message is appended, so this is a wrapper around malformed JSON rather than a semantic check failure.

Solutions

  1. Fix the JSON syntax error reported after the colon (check trailing commas, unquoted keys, encoding).
  2. Validate the file with a JSON linter or `node -e "JSON.parse(...)"` before rerunning.
  3. Regenerate the manifest from its canonical source if it is produced by tooling.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at scripts/ci/catalog.js:336 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/3c6cfe82b4df3c70. Report an issue: GitHub.

Appendix: source

Thrown at scripts/ci/catalog.js:336

    }

    expectations.push({
      category: pattern.category,
      mode: pattern.mode === 'minimum' && match[2] ? 'minimum' : pattern.mode,
      expected: Number(match[1]),
      source: `${pattern.source} (${pattern.category})`
    });
  }

  return expectations;
}

function parseCatalogDescriptionExpectations(content, source, getDescription) {
  let parsed;
  try {
    parsed = JSON.parse(content);
  } catch (error) {
    throw new Error(`${source} is not valid JSON: ${error.message}`);
  }

  const description = getDescription(parsed);
  if (typeof description !== 'string') {
    throw new Error(`${source} is missing the catalog count description`);
  }

  const match = description.match(/(\d+)\s+agents,\s+(\d+)\s+skills,\s+(\d+)\s+legacy command shims?/i);
  if (!match) {
    throw new Error(`${source} is missing the catalog count description`);
  }

  return [
    { category: 'agents', mode: 'exact', expected: Number(match[1]), source },
    { category: 'skills', mode: 'exact', expected: Number(match[2]), source },
    { category: 'commands', mode: 'exact', expected: Number(match[3]), source },
  ];
}

View on GitHub (pinned to 8321021c54)