ruvnet/ruflo · error · BdBridgeError

VALIDATION_ERROR

VALIDATION_ERROR

Error message

Invalid argument at index ${index}: ${arg}

What it means

validateAndSanitizeArgs() ran one bd CLI argument through BdArgumentSchema (which blocks null bytes, metacharacters, traversal sequences, oversize values) and it failed. The VALIDATION_ERROR wrapper names the offending index and argument value; the whole argument list is rejected.

Source

Thrown at v3/plugins/gastown-bridge/src/bridges/bd-bridge.ts:980

    } catch {
      throw new BdBridgeError(
        'Failed to parse stats output',
        'PARSE_ERROR',
        'bd',
        args
      );
    }
  }

  /**
   * Validate and sanitize command arguments
   */
  private validateAndSanitizeArgs(args: string[]): string[] {
    return args.map((arg, index) => {
      try {
        return BdArgumentSchema.parse(arg);
      } catch (error) {
        throw new BdBridgeError(
          `Invalid argument at index ${index}: ${arg}`,
          'VALIDATION_ERROR',
          'bd',
          args,
          error as Error
        );
      }
    });
  }

  /**
   * Ensure bridge is initialized
   */
  private ensureInitialized(): void {
    if (!this.initialized) {
      throw new BdBridgeError(
        'Beads bridge not initialized. Call initialize() first.',
        'EXECUTION_FAILED'

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Validate each argument before passing it; correct the argument at the reported index to match the expected format.
  2. Consult the command schema for allowed argument types and values.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/plugins/gastown-bridge/src/bridges/bd-bridge.ts:980 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/b0fe38e629b39649. Report an issue: GitHub.