Summary
Structural cleanups with no behaviour change.
- URL constants and internal header builders are exported from the public API but shouldn't be.
SimpleEvaluator and KibanaScoresClient are used externally but missing from __all__. (__init__.py, api/__init__.py)
- Seven ES-export logging helpers in
utils/logging.py have zero call sites in the codebase. Remove them.
KibanaDatasetsClient, KibanaScoresClient, and KibanaEvaluatorsClient each have an identical __init__ (kibana_url, api_key, timeout). Extract a shared base or dataclass.
- The connector-ID validation block is copy-pasted in
correctness/evaluator.py and groundedness/evaluator.py. Extract a shared helper.
runner/cli/commands/run.py repeats env-var name strings that are already literals in config.py. Define them as constants in config.py and import them. The _apply_overrides() function is a slower env.update(overrides). Remove it.
- Dead
EvaluationResult.reasoning and .details fields (never set or read).
SimpleEvaluator uses @dataclass but its __init__ is overridden immediately, leaving an unintended __repr__ and __eq__. Replace with a plain class.
- Five always-populated fields on
EvaluationRun are typed Optional for no reason. Make them required.
log_evaluation_start logs the same info that the following per-evaluator lines already cover. Remove it.
- No tests for
runner/suites.py, cli/commands/run.py, or evaluators/criteria/*. No conftest.py. _RecordingAsyncClient is copy-pasted into four separate test files. Move the best version to a shared fixture.
Done when
Summary
Structural cleanups with no behaviour change.
SimpleEvaluatorandKibanaScoresClientare used externally but missing from__all__. (__init__.py,api/__init__.py)utils/logging.pyhave zero call sites in the codebase. Remove them.KibanaDatasetsClient,KibanaScoresClient, andKibanaEvaluatorsClienteach have an identical__init__(kibana_url,api_key,timeout). Extract a shared base or dataclass.correctness/evaluator.pyandgroundedness/evaluator.py. Extract a shared helper.runner/cli/commands/run.pyrepeats env-var name strings that are already literals inconfig.py. Define them as constants inconfig.pyand import them. The_apply_overrides()function is a slowerenv.update(overrides). Remove it.EvaluationResult.reasoningand.detailsfields (never set or read).SimpleEvaluatoruses@dataclassbut its__init__is overridden immediately, leaving an unintended__repr__and__eq__. Replace with a plain class.EvaluationRunare typedOptionalfor no reason. Make them required.log_evaluation_startlogs the same info that the following per-evaluator lines already cover. Remove it.runner/suites.py,cli/commands/run.py, orevaluators/criteria/*. Noconftest.py._RecordingAsyncClientis copy-pasted into four separate test files. Move the best version to a shared fixture.Done when