{"record":{"id":"a10af4a44d77e701","repo":"affaan-m/ECC","slug":"unsupported-uninstall-operation-kind-operation","errorCode":null,"errorMessage":"Unsupported uninstall operation kind: ${operation.kind}","messagePattern":"Unsupported uninstall operation kind: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/install-lifecycle.js","lineNumber":794,"sourceCode":"      };\n    }\n\n    const previousJson = getOperationPreviousJson(operation);\n    if (previousJson !== undefined) {\n      writeContainedFile(operation.destinationPath, formatJson(previousJson), trustedRoot, 'uninstall');\n      return {\n        removedPaths: [],\n        cleanupTargets: []\n      };\n    }\n\n    return {\n      removedPaths: [],\n      cleanupTargets: []\n    };\n  }\n\n  throw new Error(`Unsupported uninstall operation kind: ${operation.kind}`);\n}\n\nfunction inspectManagedOperation(repoRoot, trustedRoot, operation) {\n  const destinationPath = operation.destinationPath;\n  if (!destinationPath) {\n    return {\n      status: 'invalid-destination',\n      operation\n    };\n  }\n\n  let managedDestination;\n  try {\n    managedDestination = getManagedDestination(\n      destinationPath,\n      trustedRoot,\n      'inspect managed operation',\n      { allowFinalSymlink: operation.kind === 'remove' }","sourceCodeStart":776,"sourceCodeEnd":812,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/install-lifecycle.js#L776-L812","documentation":"executeUninstallOperation walks known kinds (copy-file, render-template, merge-json, remove) and throws this for any other operation.kind. Same forward-compatibility guard as the repair counterpart, scoped to the uninstall code path.","triggerScenarios":"Uninstall is run against an install-state whose operation.kind is unknown to the current installer (newer version produced the state, or the state was hand-edited/corrupted).","commonSituations":"Downgrading ECC after a newer version wrote the state; copying an install-state across machines with mismatched installer versions; third-party tooling that wrote a custom kind.","solutions":["Upgrade the installer to the version recorded under state.source.repoVersion / packageVersion.","If upgrade is not possible, manually remove the install-state file and any installed files referenced by known operations, then re-install.","Confirm the kind value from the error message — if it looks like corruption, discard the state file.","Uninstall with the exact installer version that performed the install."],"exampleFix":"// before: state written by ECC 3.x, uninstall run by ECC 2.x\n// after:\nnpm install -g everything-claude-code@latest\n./install.sh --target claude --uninstall","handlingStrategy":"try-catch","validationCode":"const KNOWN_UNINSTALL_KINDS = new Set(['copy-file', 'render-template', 'merge-json', 'remove']);\nfunction findUnsupportedUninstallKinds(state) {\n  return (state.operations || [])\n    .map(op => op.kind)\n    .filter(k => !KNOWN_UNINSTALL_KINDS.has(k));\n}\n// before uninstall: assert findUnsupportedUninstallKinds(state).length === 0","typeGuard":"function isKnownUninstallKind(op) {\n  return KNOWN_UNINSTALL_KINDS.has(op.kind);\n}","tryCatchPattern":"try {\n  await runUninstall(record);\n} catch (err) {\n  if (err.message.startsWith('Unsupported uninstall operation kind')) {\n    // upgrade installer or remove state and reinstall\n  } else throw err;\n}","preventionTips":["Keep installer version aligned with the install-state authoring version.","Prefer fresh reinstall over cross-version uninstall.","Do not author custom operation kinds.","Inspect state.source.repoVersion before invoking uninstall."],"tags":["uninstall","install","compatibility","validation"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}