Feature Type
Pipeline architecture
Problem or Need
19 functions across Stages 2, 3, and 4 have 5-6 parameters, which exceeds the recommended threshold of 4. While less critical than the 8-parameter functions tracked in #306, these would benefit from the same options object pattern for consistency and maintainability.
Stage 2 - Generation (4 functions):
| File |
Function |
Params |
Line |
src/stages/2-generation/cost-estimator.ts |
estimateGenerationCost |
6 |
113 |
src/stages/2-generation/cost-estimator.ts |
countPromptTokens |
5 |
76 |
src/stages/2-generation/diversity-manager.ts |
createBaseScenario |
5 |
71 |
src/stages/2-generation/agent-scenario-generator.ts |
generateAllAgentScenarios |
5 |
321 |
src/stages/2-generation/skill-scenario-generator.ts |
generateAllSkillScenarios |
5 |
207 |
Stage 3 - Execution (3 functions):
| File |
Function |
Params |
Line |
src/stages/3-execution/index.ts |
runExecution |
5 |
101 |
src/stages/3-execution/plugin-loader.ts |
buildPluginQueryInput |
5 |
98 |
Stage 4 - Evaluation (12 functions):
| File |
Function |
Params |
Line |
src/stages/4-evaluation/multi-sampler.ts |
evaluateWithMultiSampling |
6 |
173 |
src/stages/4-evaluation/aggregation/scenario-results.ts |
buildEvaluationResult |
6 |
31 |
src/stages/4-evaluation/detection/capture-detection.ts |
createDetection |
5 |
28 |
src/stages/4-evaluation/detection/orchestrator.ts |
detectAllComponentsWithHooks |
5 |
110 |
src/stages/4-evaluation/index.ts |
runSynchronousEvaluation |
5 |
258 |
src/stages/4-evaluation/index.ts |
calculateAndSaveMetrics |
5 |
350 |
src/stages/4-evaluation/index.ts |
runEvaluation |
5 |
408 |
src/stages/4-evaluation/llm-judge.ts |
evaluateWithLLMJudge |
5 |
270 |
src/stages/4-evaluation/llm-judge.ts |
evaluateWithFallback |
5 |
338 |
src/stages/4-evaluation/llm-judge.ts |
evaluateWithJsonFallback |
5 |
397 |
src/stages/4-evaluation/multi-sampler.ts |
evaluateSingleSample |
5 |
304 |
src/stages/4-evaluation/multi-sampler.ts |
runJudgment |
5 |
340 |
Proposed Solution
Apply the same options object pattern as #306:
// Example for createDetection
interface CreateDetectionOptions {
componentType: ComponentType;
componentName: string;
triggered: boolean;
confidence: DetectionConfidence;
reason: string;
}
function createDetection(options: CreateDetectionOptions): Detection
Recommended approach:
- Address Stage 4 functions first (most functions, highest impact)
- Then Stage 3 functions
- Finally Stage 2 functions
Pipeline Stage Affected
General / Multiple stages
Component Type (if applicable)
Not component-specific
Alternatives Considered
- Higher threshold (6 params): Would only catch the worst offenders, but 5 params is already at the boundary of maintainability
- Gradual adoption: Refactor as functions are modified for other reasons (lower priority approach)
- Skip Stage 2: Generation functions are less frequently modified
How important is this feature to you?
Low - Just a suggestion
Additional Context
Acceptance Criteria:
Depends on: #306 (address 8-parameter functions first for consistency)
Related: See anti-pattern-audit.md section 3.1.1 for full analysis
🤖 Created with Claude Code
Feature Type
Pipeline architecture
Problem or Need
19 functions across Stages 2, 3, and 4 have 5-6 parameters, which exceeds the recommended threshold of 4. While less critical than the 8-parameter functions tracked in #306, these would benefit from the same options object pattern for consistency and maintainability.
Stage 2 - Generation (4 functions):
src/stages/2-generation/cost-estimator.tsestimateGenerationCostsrc/stages/2-generation/cost-estimator.tscountPromptTokenssrc/stages/2-generation/diversity-manager.tscreateBaseScenariosrc/stages/2-generation/agent-scenario-generator.tsgenerateAllAgentScenariossrc/stages/2-generation/skill-scenario-generator.tsgenerateAllSkillScenariosStage 3 - Execution (3 functions):
src/stages/3-execution/index.tsrunExecutionsrc/stages/3-execution/plugin-loader.tsbuildPluginQueryInputStage 4 - Evaluation (12 functions):
src/stages/4-evaluation/multi-sampler.tsevaluateWithMultiSamplingsrc/stages/4-evaluation/aggregation/scenario-results.tsbuildEvaluationResultsrc/stages/4-evaluation/detection/capture-detection.tscreateDetectionsrc/stages/4-evaluation/detection/orchestrator.tsdetectAllComponentsWithHookssrc/stages/4-evaluation/index.tsrunSynchronousEvaluationsrc/stages/4-evaluation/index.tscalculateAndSaveMetricssrc/stages/4-evaluation/index.tsrunEvaluationsrc/stages/4-evaluation/llm-judge.tsevaluateWithLLMJudgesrc/stages/4-evaluation/llm-judge.tsevaluateWithFallbacksrc/stages/4-evaluation/llm-judge.tsevaluateWithJsonFallbacksrc/stages/4-evaluation/multi-sampler.tsevaluateSingleSamplesrc/stages/4-evaluation/multi-sampler.tsrunJudgmentProposed Solution
Apply the same options object pattern as #306:
Recommended approach:
Pipeline Stage Affected
General / Multiple stages
Component Type (if applicable)
Not component-specific
Alternatives Considered
How important is this feature to you?
Low - Just a suggestion
Additional Context
Acceptance Criteria:
Depends on: #306 (address 8-parameter functions first for consistency)
Related: See
anti-pattern-audit.mdsection 3.1.1 for full analysis🤖 Created with Claude Code