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
- Check the EVOLUTION_LOG_TYPES constant in scripts/lib/skill-evolution/versioning.js and pass exactly one of its members
- Fix the spelling of the logType argument
- If a genuinely new log type is needed, add it to EVOLUTION_LOG_TYPES in the library rather than passing an unlisted value
- 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
- Import or copy the EVOLUTION_LOG_TYPES constant instead of inlining strings
- Keep logType values in a shared constant used by all call sites
- Grep for logType literals after any library upgrade
- Add a unit test per supported log type to catch renames
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
- artifact has invalid modality binding
- assigneeKind must be 'agent' or 'human'.
- CV effect has an invalid subject anchor
- explicit candidate review state required
- --host-provider must be anthropic, openai, or unknown
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)