{"record":{"id":"5c342a7725114ad9","repo":"affaan-m/ECC","slug":"destination-verification-failed","errorCode":"DESTINATION_VERIFICATION_FAILED","errorMessage":"${CURRENT_PLUGIN_ID} exists at ${destinationScope} scope but is not enabled.","messagePattern":"(.+?) exists at (.+?) scope but is not enabled\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/claude-scope-migration.js","lineNumber":92,"sourceCode":"  }\n  if (\n    installed.length > 2\n    || uniqueScopes.size !== installed.length\n    || (\n      installed.length === 2\n      && !uniqueScopes.has(destinationScope)\n    )\n  ) {\n    throw migrationError(\n      'AMBIGUOUS_PLUGIN_SCOPES',\n      `Cannot safely migrate ${CURRENT_PLUGIN_ID} from ambiguous scopes: ${observedScopes.join(', ')}.`,\n      { observedScopes }\n    );\n  }\n\n  if (installed.length === 1 && installed[0].scope === destinationScope) {\n    if (installed[0].enabled !== true) {\n      throw migrationError(\n        'DESTINATION_VERIFICATION_FAILED',\n        `${CURRENT_PLUGIN_ID} exists at ${destinationScope} scope but is not enabled.`,\n        {\n          phase: 'destination-verification',\n          observedScopes,\n          recovery: recoveryCommands(null, destinationScope),\n        }\n      );\n    }\n    return {\n      destination: installed[0],\n      mode: 'already-migrated',\n      observedScopes,\n      sourceScope: null,\n    };\n  }\n  if (installed.length === 1) {\n    return {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/claude-scope-migration.js#L74-L110","documentation":"ClaudeSetupError with code DESTINATION_VERIFICATION_FAILED thrown by assertMigrationInventory in scripts/lib/claude-scope-migration.js:92. When the only ECC plugin installation is already at the requested destination scope, the migrator verifies it is actually enabled. If Claude reports `enabled !== true` (disabled plugin), the 'already migrated' conclusion cannot be trusted, so the tool fails with phase 'destination-verification' and recovery commands to re-enable/reinstall at the destination.","triggerScenarios":"Running a scope migration whose single detected installation is already at the destination scope, but its `enabled` field in `claude plugin list --json` is false or missing — i.e., the plugin was installed at that scope but disabled via `claude plugin disable` or a settings change.","commonSituations":"A user disabled the ECC plugin (e.g. to troubleshoot hooks) and later ran the migration expecting a no-op; a failed prior setup left the plugin registered but disabled; Claude's list output omits `enabled` for plugins installed but never activated.","solutions":["Re-enable the plugin at that scope: `claude plugin enable <plugin-id> --scope <destination>`.","Or run the recovery command from the error details: `ecc setup --mode claude-plugin --scope <destination> --move-scope --yes`.","Confirm with `claude plugin list --json` that the entry now shows `enabled: true`, then re-run the migration.","If enable keeps failing, uninstall and reinstall at the destination: `claude plugin uninstall <id> --scope <destination> --keep-data` then `ecc setup --mode claude-plugin --scope <destination> --yes`."],"exampleFix":"// before: plugin installed at project scope but disabled\n\n// after\n// claude plugin enable everything-claude-code --scope project\n// ecc migrate-scope --scope project  # now recognizes already-migrated state","handlingStrategy":"validation","validationCode":"const plugins = parsePluginList(run(['plugin', 'list', '--json'], { cwd }).stdout)\n  .filter(p => p.id === CURRENT_PLUGIN_ID);\nif (plugins.length === 1 && plugins[0].scope === destinationScope && plugins[0].enabled !== true) {\n  console.error(`Plugin disabled at ${destinationScope}; run: claude plugin enable ${CURRENT_PLUGIN_ID} --scope ${destinationScope}`);\n  process.exit(1);\n}","typeGuard":"function isEnabledAtDestination(plugin, dest) { return plugin.scope === dest && plugin.enabled === true; }","tryCatchPattern":"try { await migrateScope({ scope }) }\ncatch (e) {\n  if (e.code === 'DESTINATION_VERIFICATION_FAILED') {\n    console.log('Enable it first:', e.details.recovery.join(' && '));\n  } else throw e;\n}","preventionTips":["Re-enable the plugin after any troubleshooting session that disabled it.","Before migrating, check the `enabled` field in `claude plugin list --json`.","Avoid `claude plugin disable` without a follow-up re-enable plan.","Treat enabled=false at the destination as 'not migrated' in automation."],"tags":["claude-plugin","scope-migration","disabled-plugin","verification"],"backgroundTag":"invalid-state-transition","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"}