{"record":{"id":"841e1b94bb3a09ce","repo":"ruvnet/ruflo","slug":"either-gaps-or-targetpath-must-be-provided","errorCode":null,"errorMessage":"Either gaps or targetPath must be provided","messagePattern":"Either gaps or targetPath must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/agentic-qe/src/tools/coverage-analysis/prioritize-gaps.ts","lineNumber":156,"sourceCode":" */\nexport async function handler(\n  input: PrioritizeGapsInput,\n  context: ToolContext\n): Promise<{ content: Array<{ type: 'text'; text: string }> }> {\n  const startTime = Date.now();\n\n  try {\n    // Validate input\n    const validatedInput = PrioritizeGapsInputSchema.parse(input);\n\n    // Get bridge for defect history lookup\n    const bridge = context.get<{ searchSimilarPatterns: (q: string, k: number) => Promise<unknown[]> }>('aqe.bridge');\n\n    // Get or generate gaps\n    let gaps = validatedInput.gaps;\n    if (!gaps || gaps.length === 0) {\n      if (!validatedInput.targetPath) {\n        throw new Error('Either gaps or targetPath must be provided');\n      }\n      gaps = await generateGapsFromPath(validatedInput.targetPath);\n    }\n\n    // Apply weights\n    const weights = { ...DEFAULT_WEIGHTS, ...validatedInput.weights };\n\n    // Calculate priority scores for each gap\n    const prioritizedGaps = await calculatePriorities(\n      gaps,\n      validatedInput.factors,\n      weights,\n      bridge\n    );\n\n    // Sort by priority score\n    prioritizedGaps.sort((a, b) => b.priorityScore - a.priorityScore);\n","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/agentic-qe/src/tools/coverage-analysis/prioritize-gaps.ts#L138-L174","documentation":"prioritize-gaps handler was given neither a gaps array (empty/undefined) nor a targetPath to scan for gaps, so there is nothing to prioritize. The input guard fires after zod validation because both sources being absent is only detectable together.","triggerScenarios":"Thrown at v3/plugins/agentic-qe/src/tools/coverage-analysis/prioritize-gaps.ts:156 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide all required parameters listed in the message.","Validate required fields before dispatch and report the full set of missing fields at once."],"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"}