ruvnet/ruflo · error · Error

Learning bridge not initialized

Error message

Learning bridge not initialized

What it means

trainOnHistory() checked isReady() and found status is not 'ready' — the learning bridge was never initialized or was unloaded. Sentinel lifecycle guard: TD-learning over test execution history cannot run without the learning engine loaded.

Source

Thrown at v3/plugins/test-intelligence/src/bridges/learning-bridge.ts:115

    this.status = 'unloaded';
  }

  isReady(): boolean {
    return this.status === 'ready';
  }

  /**
   * Train on test execution history
   *
   * Uses temporal difference learning to update the test selection policy
   * based on historical outcomes.
   */
  async trainOnHistory(
    history: TestHistoryEntry[],
    config?: LearningConfig
  ): Promise<number> {
    if (!this.isReady()) {
      throw new Error('Learning bridge not initialized');
    }

    const mergedConfig = { ...this.config, ...config };
    let totalLoss = 0;

    // Build file-to-test mapping
    for (const entry of history) {
      this.testEmbeddings.set(entry.testId, this.computeTestEmbedding(entry));

      for (const file of entry.affectedFiles) {
        if (!this.fileTestMapping.has(file)) {
          this.fileTestMapping.set(file, new Set());
        }
        this.fileTestMapping.get(file)!.add(entry.testId);
      }
    }

    // Create experiences from history

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Ensure the module/bridge/plugin initialize() method has been called and awaited before invoking this operation.
  2. Guard against calls made during startup: await the initialization promise or check the initialized flag and fail fast with a clear setup hint.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/plugins/test-intelligence/src/bridges/learning-bridge.ts:115 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/b6d8eb0af1fe7df0. Report an issue: GitHub.