affaan-m/ECC · error · Error

Unknown evolution log type

Error message

Unknown evolution log type: ${logType}

What it means

getEvolutionLogPath validates the logType against the EVOLUTION_LOG_TYPES whitelist before building a jsonl path. Only recognized evolution log types may be used; anything else is rejected. This keeps log file names constrained to the set the tooling knows how to read and write.

Solutions

  1. Check the EVOLUTION_LOG_TYPES constant in scripts/lib/skill-evolution/versioning.js and pass exactly one of its members
  2. Fix the spelling of the logType argument
  3. If a genuinely new log type is needed, add it to EVOLUTION_LOG_TYPES in the library rather than passing an unlisted value
  4. If this appeared after a library upgrade, migrate call sites to the renamed log types

Example fix

// before
getEvolutionLogPath(skillPath, 'changes'); // not a known type
// after
getEvolutionLogPath(skillPath, 'history'); // a member of EVOLUTION_LOG_TYPES
Defensive patterns

Strategy: validation

Validate before calling

const EVOLUTION_LOG_TYPES = ['history']; // mirror from versioning.js
if (!EVOLUTION_LOG_TYPES.includes(logType)) {
  throw new Error(`logType must be one of: ${EVOLUTION_LOG_TYPES.join(', ')}`);
}

Type guard

function isValidLogType(t) {
  return typeof t === 'string' && EVOLUTION_LOG_TYPES.includes(t);
}

Try / catch

try {
  return getEvolutionLog(skillPath, logType);
} catch (err) {
  if (err.message.startsWith('Unknown evolution log type')) {
    console.error(`'${logType}' unsupported — check EVOLUTION_LOG_TYPES`);
    return emptyLog;
  } throw err;
}

Prevention

When it happens

Trigger: Calling getEvolutionLogPath, appendEvolutionRecord, or getEvolutionLog with a logType string not present in EVOLUTION_LOG_TYPES — e.g. a misspelled type, a custom type, or a type renamed in a newer version of the library.

Common situations: Hand-written scripts passing ad-hoc log names; renaming a log type in a library upgrade while old scripts still pass the old name; typos like 'evolotion' instead of the canonical type.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at scripts/lib/skill-evolution/versioning.js:52

  const skillFilePath = getSkillFilePath(skillPath);
  if (!fs.existsSync(skillFilePath)) {
    throw new Error(`Skill file not found: ${skillFilePath}`);
  }

  return skillFilePath;
}

function getVersionsDir(skillPath) {
  return path.join(normalizeSkillDir(skillPath), VERSION_DIRECTORY_NAME);
}

function getEvolutionDir(skillPath) {
  return path.join(normalizeSkillDir(skillPath), EVOLUTION_DIRECTORY_NAME);
}

function getEvolutionLogPath(skillPath, logType) {
  if (!EVOLUTION_LOG_TYPES.includes(logType)) {
    throw new Error(`Unknown evolution log type: ${logType}`);
  }

  return path.join(getEvolutionDir(skillPath), `${logType}.jsonl`);
}

function ensureSkillVersioning(skillPath) {
  ensureSkillExists(skillPath);

  const versionsDir = getVersionsDir(skillPath);
  const evolutionDir = getEvolutionDir(skillPath);

  ensureDir(versionsDir);
  ensureDir(evolutionDir);

  for (const logType of EVOLUTION_LOG_TYPES) {
    const logPath = getEvolutionLogPath(skillPath, logType);
    if (!fs.existsSync(logPath)) {
      fs.writeFileSync(logPath, '', 'utf8');

View on GitHub (pinned to 8321021c54)