{"record":{"id":"e58017f7a00d9d62","repo":"ruvnet/ruflo","slug":"dependency-validation-failed-errormessages","errorCode":null,"errorMessage":"Dependency validation failed:\n${errorMessages}","messagePattern":"Dependency validation failed:\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"v3/@claude-flow/plugins/src/registry/enhanced-plugin-registry.ts","lineNumber":399,"sourceCode":"  // =========================================================================\n  // Initialization\n  // =========================================================================\n\n  /**\n   * Initialize all registered plugins.\n   */\n  async initialize(): Promise<void> {\n    if (this.initialized) {\n      throw new Error('Registry already initialized');\n    }\n\n    // Validate dependencies\n    const errors = this.dependencyGraph.validate();\n    const criticalErrors = errors.filter(e => e.type !== 'missing' || !this.isOptionalDependency(e));\n\n    if (criticalErrors.length > 0) {\n      const errorMessages = criticalErrors.map(e => e.message).join('\\n');\n      throw new Error(`Dependency validation failed:\\n${errorMessages}`);\n    }\n\n    // Initialize based on strategy\n    const strategy = this.config.initializationStrategy ?? 'sequential';\n\n    switch (strategy) {\n      case 'sequential':\n        await this.initializeSequential();\n        break;\n      case 'parallel':\n        await this.initializeParallel();\n        break;\n      case 'parallel-safe':\n        await this.initializeParallelSafe();\n        break;\n    }\n\n    // Check for initialization errors (including conflicts)","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugins/src/registry/enhanced-plugin-registry.ts#L381-L417","documentation":"Thrown by EnhancedPluginRegistry.initialize() when the dependency graph validation reports critical errors. dependencyGraph.validate() walks every registered plugin's parsed metadata.dependencies and reports problems (missing dependencies, cycles, bad ranges); entries of type 'missing' whose declaration is optional are filtered out, and any remaining error messages are joined into this aggregate error before any plugin actually initializes.","triggerScenarios":"Registering plugin A that depends on 'b^1.0.0' while 'b' is not registered (and not declared optional); two plugins depending on each other, forming a cycle; a dependency version range that does not match the registered version (e.g. 'utils^2.0.0' vs registered 'utils' 1.4.0).","commonSituations":"Forgetting to register a shared dependency plugin in the bootstrap list; upgrading one plugin's dependency range without upgrading the dependency plugin; circular imports between two plugins; optional dependencies declared as plain strings instead of the optional form so they are treated as required.","solutions":["Read each 'name: message' line in the error - it names the missing/circular/incompatible dependency per plugin","Register the missing dependency plugin (at a satisfying version) before initialize()","Break dependency cycles by extracting the shared piece into a third plugin both depend on","Declare truly optional dependencies in the optional form so 'missing' does not become critical"],"exampleFix":"// before\nawait registry.register(aPlugin); // aPlugin depends on 'utils^2.0.0'\nawait registry.initialize(); // throws: Dependency validation failed ... missing utils\n\n// after\nawait registry.register(utilsPluginV2); // name 'utils', version 2.1.0\nawait registry.register(aPlugin);\nawait registry.initialize();","handlingStrategy":"validation","validationCode":"// Pre-flight the same check initialize() performs, without throwing\nconst errors = validatePluginDependencyGraph(registeredPlugins); // mirror of dependencyGraph.validate()\nconst critical = errors.filter(e => e.type !== 'missing' || !isOptionalDeclaration(e));\nif (critical.length > 0) {\n  // names the missing/cyclic deps before initialize() runs\n  reportAndAbort(critical);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await registry.initialize();\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Dependency validation failed')) {\n    // each line is 'plugin: message' - drive a targeted fix or report\n    const issues = err.message.split('\\n').slice(1);\n    await reportPluginIssues(issues);\n  }\n  throw err;\n}","preventionTips":["Register every plugin your others declare in metadata.dependencies before initialize()","Declare truly optional dependencies as optional so a missing dep does not block boot","Keep dependency version ranges in sync with the versions you actually register","Avoid mutual dependencies between two plugins; extract shared code into a third plugin"],"tags":["dependency-validation","dependency-graph","plugin-registry","typescript"],"backgroundTag":"dependency-validation-failed","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}