{"record":{"id":"23830b634dc92d55","repo":"affaan-m/ECC","slug":"unsupported-repair-operation-kind-operation-kin","errorCode":null,"errorMessage":"Unsupported repair operation kind: ${operation.kind}","messagePattern":"Unsupported repair operation kind: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install-lifecycle.js","lineNumber":646,"sourceCode":"      )\n      : {};\n    const mergedValue = deepMergeJson(currentValue, payload);\n\n    writeContainedFile(operation.destinationPath, formatJson(mergedValue), trustedRoot, 'repair');\n    return operation.destinationPath;\n  }\n\n  if (operation.kind === 'remove') {\n    const removedPath = removeContainedPath(\n      operation.destinationPath,\n      trustedRoot,\n      'repair',\n      { recursive: true, force: true }\n    );\n    return removedPath ? operation.destinationPath : null;\n  }\n\n  throw new Error(`Unsupported repair operation kind: ${operation.kind}`);\n}\n\nfunction executeUninstallOperation(operation, trustedRoot) {\n  // Confine deletes to the trusted install root (GHSA-hfpv-w6mp-5g95).\n  if (operation.kind === 'copy-file') {\n    const removedPath = removeContainedPath(\n      operation.destinationPath,\n      trustedRoot,\n      'uninstall',\n      { force: true }\n    );\n    if (!removedPath) {\n      return {\n        removedPaths: [],\n        cleanupTargets: []\n      };\n    }\n","sourceCodeStart":628,"sourceCodeEnd":664,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/install-lifecycle.js#L628-L664","documentation":"executeRepairOperation walks known operation kinds (copy-file, render-template, merge-json, remove) and throws this for anything else. It means the install-state recorded an operation.kind the running installer does not recognise — a forward-compatibility break.","triggerScenarios":"Repair is run with an install-state produced by a newer installer version that emits an operation kind this version cannot execute. Also triggered by a corrupted or hand-crafted install-state with an arbitrary kind string.","commonSituations":"User downgraded ECC after a newer install wrote the state; install-state file copied across machines running different versions; third-party tool wrote a non-standard kind into the state file.","solutions":["Upgrade the installer to the version that produced the install-state (check packageVersion in the state file).","If upgrading is not possible, uninstall with the version that wrote the state, then install with the current version.","Inspect operation.kind in the error message and confirm whether it is a real kind or corruption.","Delete the install-state file and re-install fresh if the state is unrecoverable."],"exampleFix":"// before: newer ECC wrote { kind: 'symlink-file', ... } unknown to old installer\n// after: upgrade ECC so the kind is recognised\nnpm install -g everything-claude-code@latest\n./install.sh --target claude --repair","handlingStrategy":"try-catch","validationCode":"const KNOWN_REPAIR_KINDS = new Set(['copy-file', 'render-template', 'merge-json', 'remove']);\nfunction findUnsupportedRepairKinds(state) {\n  return (state.operations || [])\n    .map(op => op.kind)\n    .filter(k => !KNOWN_REPAIR_KINDS.has(k));\n}\n// before repair: assert findUnsupportedRepairKinds(state).length === 0","typeGuard":"function isKnownRepairKind(op) {\n  return KNOWN_REPAIR_KINDS.has(op.kind);\n}","tryCatchPattern":"try {\n  await runRepair(record);\n} catch (err) {\n  if (err.message.startsWith('Unsupported repair operation kind')) {\n    // upgrade installer or uninstall+reinstall with current version\n  } else throw err;\n}","preventionTips":["Match installer version to the version that produced the install-state.","Avoid downgrade cycles; reinstall fresh when downgrading.","Do not introduce custom operation kinds in install-state.","Check state.source.repoVersion before invoking repair."],"tags":["repair","install","compatibility","validation"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}