{"record":{"id":"7816eace476de4ce","repo":"ruvnet/ruflo","slug":"dependency-cycle","errorCode":"DEPENDENCY_CYCLE","errorMessage":"Cannot compute execution order: dependency cycle detected","messagePattern":"Cannot compute execution order: dependency cycle detected","errorType":"exception","errorClass":"GasTownError","httpStatus":null,"severity":"error","filePath":"v3/plugins/gastown-bridge/src/convoy/observer.ts","lineNumber":520,"sourceCode":"   */\n  async getExecutionOrder(convoyId: string): Promise<string[]> {\n    ConvoyIdSchema.parse(convoyId);\n\n    const convoy = this.tracker.getConvoy(convoyId);\n    if (!convoy) {\n      throw ConvoyError.notFound(convoyId);\n    }\n\n    const beads = await this.fetchBeads(convoy.trackedIssues);\n\n    if (this.config.useWasm && this.wasmModule) {\n      try {\n        const wasmNodes = this.beadsToWasmNodes(beads);\n        const resultJson = this.wasmModule.topo_sort(JSON.stringify(wasmNodes));\n        const result: TopoSortResult = JSON.parse(resultJson);\n\n        if (result.hasCycle) {\n          throw new GasTownError(\n            'Cannot compute execution order: dependency cycle detected',\n            GasTownErrorCode.DEPENDENCY_CYCLE,\n            { cycleNodes: result.cycleNodes }\n          );\n        }\n\n        return result.sorted;\n      } catch (error) {\n        if (error instanceof GasTownError) throw error;\n        this.logger.warn('WASM topo sort failed, falling back to JS', {\n          error: error instanceof Error ? error.message : String(error),\n        });\n      }\n    }\n\n    // JavaScript fallback using Kahn's algorithm\n    return this.topoSortJS(beads);\n  }","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/gastown-bridge/src/convoy/observer.ts#L502-L538","documentation":"getExecutionOrder() performed a topological sort of the convoy's beads (WASM or JS) and the result reported a dependency cycle, so no valid execution order exists. The cycle must be broken (fix blockedBy/blocks references) before ordering can be computed.","triggerScenarios":"Thrown at v3/plugins/gastown-bridge/src/convoy/observer.ts:520 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the circular dependency: inspect the reported nodes and break the cycle by reordering or dropping an edge.","Validate the dependency graph with a topological sort before execution and reject cyclic definitions early."],"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-14T00:17:10.932Z"}