{"record":{"id":"f8882abe63259cee","repo":"ruvnet/ruflo","slug":"invalid-dimensions-this-dimensions-must-be-a","errorCode":null,"errorMessage":"Invalid dimensions: ${this.dimensions}. Must be a positive integer.","messagePattern":"Invalid dimensions: (.+?)\\. Must be a positive integer\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/embeddings/src/rvf-embedding-service.ts","lineNumber":143,"sourceCode":" * vector in R^n where n = configured dimensions (default 384).\n *\n * Extends EventEmitter and implements IEmbeddingService for drop-in\n * compatibility with other providers.\n */\nexport class RvfEmbeddingService extends EventEmitter implements IEmbeddingService {\n  readonly provider: EmbeddingProvider = 'rvf';\n\n  private readonly dimensions: number;\n  private readonly cache: LRUCache<string, Float32Array>;\n  private readonly normalizationType: NormalizationType;\n  private readonly embeddingListeners: Set<EmbeddingEventListener> = new Set();\n  private persistentCache: RvfEmbeddingCache | null = null;\n\n  constructor(config: RvfEmbeddingConfig) {\n    super();\n    this.dimensions = config.dimensions ?? DEFAULT_DIMENSIONS;\n    if (this.dimensions <= 0 || !Number.isInteger(this.dimensions)) {\n      throw new Error(`Invalid dimensions: ${this.dimensions}. Must be a positive integer.`);\n    }\n    this.cache = new LRUCache(config.cacheSize ?? DEFAULT_CACHE_SIZE);\n    this.normalizationType = config.normalization ?? 'none';\n\n    // Initialize persistent RVF cache if a path is provided\n    if (config.cachePath) {\n      this.persistentCache = new RvfEmbeddingCache({\n        cachePath: config.cachePath,\n        maxSize: config.cacheSize ?? 10000,\n        dimensions: this.dimensions,\n      });\n    }\n  }\n\n  // --------------------------------------------------------------------------\n  // IEmbeddingService Implementation\n  // --------------------------------------------------------------------------\n","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/embeddings/src/rvf-embedding-service.ts#L125-L161","documentation":"Thrown when the RVF embedding service is constructed with a non-positive or non-integer dimensions value. Defense: validate configuration at startup and require a positive integer before any embedding call.","triggerScenarios":"Thrown at v3/@claude-flow/embeddings/src/rvf-embedding-service.ts:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set dimensions to a positive integer matching the embedding model's output size.","Read the model's reported dimension instead of hardcoding an invalid value."],"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"}