Skip to content

[stacked on #1648] refactor(pipeline): EvaluationPipeline takes settings= only - #1669

Draft
napetrov wants to merge 6 commits into
intel:mainfrom
napetrov:arch/r15-3
Draft

napetrov wants to merge 6 commits into
intel:mainfrom
napetrov:arch/r15-3

Conversation

@napetrov

@napetrov napetrov commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #1648 (base 5d11fb161). EvaluationPipeline takes its inputs only as settings=EvaluationSettings(...).

 class EvaluationPipeline:
-    def __init__(self, *args, settings=None, **kwargs):
-        # builds EvaluationSettings from kwargs when settings is None
+    def __init__(self, settings: EvaluationSettings):
+        if not isinstance(settings, EvaluationSettings):
+            raise TypeError(...)
  • __init__ is typed, so mypy checks EvaluationSettings fields at each call site again.
  • Keyword and positional forms (EvaluationPipeline(questions_from=...)) now raise TypeError.
  • A non-EvaluationSettings value for settings= raises TypeError (was AttributeError).
  • 66 call sites moved to settings= (codemod, byte-offset insertion). Production callers were already on settings=. 19 test files touched, plus docs/methodology.md.
  • External use: grep of docs, examples and README found only docs/methodology.md using the keyword form. Updated here.
  • CLI unchanged.

Evidence

  • Before: EvaluationPipeline(questions_from=...) builds and runs.
    After: the same call raises TypeError. EvaluationPipeline(settings=EvaluationSettings(questions_from=...)) builds an identical pipeline.
  • Differential probe over the pipeline attributes for the old and new forms: identical after tmp-path normalisation.
  • Touched tests: 673 passed.
  • make ci-local: green except pip-audit, which fails with PermissionError on the shared /mnt/cached_oses cache dir. Environment issue, not in this diff.
  • Self-review: 2 pr-review local passes (fresh-context children), no blocking findings. Nits acted on in pass 1. Declined: SPDX header on the new fragment (311 of 526 existing fragments also lack it), duck-typed settings (deliberately unsupported), old historical fragments that mention the keyword form (left as history).
  • New refusals (scripts/list_new_error_paths.py, not a CI gate): the TypeError in pipeline.py and its tests in tests/test_pipeline_settings.py. Requirement: docs/methodology.md (keyword form replaced by settings=), public-API change recorded in the Changed fragment.

Changelog: Changed fragment 20261206_100000_napetrov_arch-r15-3-pipeline-settings.md. The #1648 fragment 20261205_221923_nikolay.a.petrov_pipeline-settings.md is removed because it said positional and keyword arguments still work.

Merge Danger

Door: two-way. Reverting restores the keyword/positional forms. Callers outside this repo that use the keyword form break until they move to settings=.

Stacking: this PR is based on #1648 (arch/r14-4). Merge #1648 first, then retarget this PR to main. Merging out of order would pull #1648's commits into main through this branch's base.

Blast Radius: public-api (EvaluationPipeline constructor, keyword and positional forms refused).

🤖 Generated with Claude Code

run() now calls one method per phase: the personas step, the question
step (one method per source: --questions-from, the cached set, the
golden set, generated), and the evaluation summary. The question-source
resolution in __init__ moves into two helpers. The output is unchanged.

The public question-set helpers (resolve_questions_from_path,
compute_question_set_hash, load_questions_payload) move to
orchestrator/question_sets.py, which pipeline.py imports, so the names
still resolve from pipeline. This keeps pipeline.py under the 800-line
growth cap. The run() complexity baseline entry is dropped.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
EvaluationPipeline.__init__ takes an EvaluationSettings dataclass with the
same fields and defaults as the keyword arguments it had. The production
callers (benchmark run and evaluate) pass settings=. The keyword form still
works: it builds the settings, and a refusal reads the same as before.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>

# Conflicts:
#	dokimi/dokimi/orchestrator/pipeline.py
Thread: PRRT_kwDOVBg7g87AQkCS
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
The constructor was (*args, settings=None, **kwargs), so mypy could not
check the fields of a call. It is now __init__(self, settings:
EvaluationSettings). A non-EvaluationSettings value raises TypeError.

Every caller moves to settings=EvaluationSettings(...): the production
callers were already there; the tests (about 60 sites) and the methodology
doc example move too. The keyword and positional forms are refused by the
signature. A changed fragment records the API change.

Stacked on intel#1648.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Tests miss 7 of 49 small breaks of the lines this PR changes

At 2580ee4: 42 caught · 7 missed

Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put # mutation-ok[<operator>]: <reason> at the end of the line or alone on the line above.

Where Operator Change no test notices Tests reaching the line
dokimi/dokimi/orchestrator/__init__.py:9 drop-element ["EvaluationPipeline", "EvaluationSettings"] → ["EvaluationPipeline"] 23
dokimi/dokimi/orchestrator/pipeline_settings.py:17 flip-bool True → False 23
dokimi/dokimi/orchestrator/pipeline_settings.py:81 bump-int 5 → 6 23
dokimi/dokimi/orchestrator/pipeline_settings.py:82 bump-int 2 → 3 23
dokimi/dokimi/orchestrator/pipeline_settings.py:88 bump-int 4000 → 4001 23
dokimi/dokimi/orchestrator/pipeline_settings.py:94 flip-bool False → True 23
dokimi/dokimi/orchestrator/__init__.py:9 drop-element ["EvaluationPipeline", "EvaluationSettings"] → ["EvaluationSettings"] 23

Not checked:

  • 3 changed lines were not mutated

Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.43%. Comparing base (19e5222) to head (2580ee4).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1669      +/-   ##
==========================================
- Coverage   96.44%   96.43%   -0.01%     
==========================================
  Files         585      586       +1     
  Lines       76600    76636      +36     
  Branches    13175    13176       +1     
==========================================
+ Hits        73876    73905      +29     
- Misses       1671     1674       +3     
- Partials     1053     1057       +4     
Files with missing lines Coverage Δ
dokimi/dokimi/commands/benchmark.py 96.80% <100.00%> (ø)
dokimi/dokimi/commands/orchestrate.py 100.00% <100.00%> (ø)
dokimi/dokimi/orchestrator/__init__.py 100.00% <100.00%> (ø)
dokimi/dokimi/orchestrator/pipeline.py 95.71% <100.00%> (+0.59%) ⬆️
dokimi/dokimi/orchestrator/pipeline_settings.py 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants