{"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":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-lifecycle.js","lineNumber":876,"sourceCode":"        beforeCommit() {\n          getManagedDestination(settingsPath, trustedRoot, 'repair');\n        },\n      }\n    );\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, options = {}) {\n  // Confine deletes to the trusted install root (GHSA-hfpv-w6mp-5g95).\n  if (operation.kind === 'copy-file') {\n    if (options.preserveDriftedCopies) {\n      const existingDestination = getContainedExistingPath(\n        operation.destinationPath,\n        trustedRoot,\n        'uninstall',\n        { allowFinalSymlink: true }\n      );\n      if (!existingDestination) {\n        return {\n          removedPaths: [],\n          cleanupTargets: []\n        };\n      }","sourceCodeStart":858,"sourceCodeEnd":894,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-lifecycle.js#L858-L894","documentation":"Thrown by the repair operation executor when operation.kind is not one of the supported kinds (e.g. copy-file, render-template, merge-json, remove). Indicates the repair dispatcher encountered an operation kind it does not know how to execute.","triggerScenarios":"An install-state record contains an operation kind added by a newer installer version, or a corrupted/forged operation object with an unrecognized or empty `kind`.","commonSituations":"Rolling back to an older installer that doesn't know new operation kinds; editing state JSON by hand; mixing plugin versions where state written by v2 is read by v1.","solutions":["Update the installer to the same version that wrote the install-state","Inspect operation.kind in the state record and correct/remove unknown entries","Delete stale state and reinstall so all operations use supported kinds"],"exampleFix":"// before: reading new-kind state with old installer\nrepairFromRecord(record); // kind: 'symlink' unknown to old code\n// after: upgrade installer first\nawait updateInstallerToLatest();\nrepairFromRecord(record);","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['copy-file','render-template','merge-json','remove'];\nconst unsupported = record.state.operations.filter(op => !SUPPORTED.includes(op.kind));\nif (unsupported.length) throw new Error(`unknown kinds: ${unsupported.map(o => o.kind).join(',')}`);","typeGuard":"const isSupportedKind = (kind) => ['copy-file','render-template','merge-json','remove'].includes(kind);","tryCatchPattern":"try { repairFromRecord(record); } catch (e) { if (String(e.message).startsWith('Unsupported repair operation kind')) { await upgradeInstallerThenRepair(record); } else throw e; }","preventionTips":["Upgrade the installer before repairing state written by newer versions","Check operation kinds in the state before repair","Avoid manually editing state records"],"tags":["install","repair","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}