affaan-m/ECC · error · Error

Unsupported repair operation kind: ${operation.kind}

Error message

Unsupported repair operation kind: ${operation.kind}

What it means

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.

Source

Thrown at scripts/lib/install-lifecycle.js:646

      )
      : {};
    const mergedValue = deepMergeJson(currentValue, payload);

    writeContainedFile(operation.destinationPath, formatJson(mergedValue), trustedRoot, 'repair');
    return operation.destinationPath;
  }

  if (operation.kind === 'remove') {
    const removedPath = removeContainedPath(
      operation.destinationPath,
      trustedRoot,
      'repair',
      { recursive: true, force: true }
    );
    return removedPath ? operation.destinationPath : null;
  }

  throw new Error(`Unsupported repair operation kind: ${operation.kind}`);
}

function executeUninstallOperation(operation, trustedRoot) {
  // Confine deletes to the trusted install root (GHSA-hfpv-w6mp-5g95).
  if (operation.kind === 'copy-file') {
    const removedPath = removeContainedPath(
      operation.destinationPath,
      trustedRoot,
      'uninstall',
      { force: true }
    );
    if (!removedPath) {
      return {
        removedPaths: [],
        cleanupTargets: []
      };
    }

View on GitHub (pinned to 01e15490f0)

Solutions

  1. Upgrade the installer to the version that produced the install-state (check packageVersion in the state file).
  2. If upgrading is not possible, uninstall with the version that wrote the state, then install with the current version.
  3. Inspect operation.kind in the error message and confirm whether it is a real kind or corruption.
  4. Delete the install-state file and re-install fresh if the state is unrecoverable.

Example fix

// before: newer ECC wrote { kind: 'symlink-file', ... } unknown to old installer
// after: upgrade ECC so the kind is recognised
npm install -g everything-claude-code@latest
./install.sh --target claude --repair
Defensive patterns

Strategy: try-catch

Validate before calling

const KNOWN_REPAIR_KINDS = new Set(['copy-file', 'render-template', 'merge-json', 'remove']);
function findUnsupportedRepairKinds(state) {
  return (state.operations || [])
    .map(op => op.kind)
    .filter(k => !KNOWN_REPAIR_KINDS.has(k));
}
// before repair: assert findUnsupportedRepairKinds(state).length === 0

Type guard

function isKnownRepairKind(op) {
  return KNOWN_REPAIR_KINDS.has(op.kind);
}

Try / catch

try {
  await runRepair(record);
} catch (err) {
  if (err.message.startsWith('Unsupported repair operation kind')) {
    // upgrade installer or uninstall+reinstall with current version
  } else throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/23830b634dc92d55. Report an issue: GitHub.