{"record":{"id":"59064f7b8be17a97","repo":"ruvnet/ruflo","slug":"circular-dependency","errorCode":"CIRCULAR_DEPENDENCY","errorMessage":"Circular dependency detected: ${cycle.join(' -> ')}","messagePattern":"Circular dependency detected: (.+?)","errorType":"exception","errorClass":"PluginError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/shared/src/plugin-loader.ts","lineNumber":552,"sourceCode":"      if (level.length > 0) {\n        levels.push(level);\n      }\n    }\n\n    return levels;\n  }\n\n  /**\n   * Detect circular dependencies\n   */\n  private detectCircularDependencies(graph: Map<string, DependencyNode>): void {\n    const visited = new Set<string>();\n    const stack = new Set<string>();\n\n    const visit = (name: string, path: string[]): void => {\n      if (stack.has(name)) {\n        const cycle = [...path, name];\n        throw new PluginError(\n          `Circular dependency detected: ${cycle.join(' -> ')}`,\n          name,\n          'CIRCULAR_DEPENDENCY'\n        );\n      }\n\n      if (visited.has(name)) {\n        return;\n      }\n\n      visited.add(name);\n      stack.add(name);\n\n      const node = graph.get(name);\n      if (node) {\n        for (const dep of Array.from(node.dependencies)) {\n          visit(dep, [...path, name]);\n        }","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/shared/src/plugin-loader.ts#L534-L570","documentation":"PluginLoader's DFS over the plugin dependency graph found a name already on the current visit stack, proving a cycle; the message spells out the full loop (A -> B -> ... -> A). No valid plugin load order exists for a cyclic graph, so loading aborts with CIRCULAR_DEPENDENCY.","triggerScenarios":"Thrown at v3/@claude-flow/shared/src/plugin-loader.ts:552 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Break the dependency cycle by removing one edge listed in the reported cycle.","Refactor shared functionality into a new plugin that both sides depend on."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}