Skip to content

refactor(pipeline): take the run's inputs as an EvaluationSettings - #1648

Open
napetrov wants to merge 4 commits into
intel:mainfrom
napetrov:arch/r14-4
Open

napetrov wants to merge 4 commits into
intel:mainfrom
napetrov:arch/r14-4

Conversation

@napetrov

@napetrov napetrov commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Give EvaluationPipeline.__init__ a settings dataclass, as #1644 left open.

EvaluationSettings (new, dokimi/orchestrator/pipeline_settings.py, exported from dokimi.orchestrator) is a frozen dataclass with the 25 fields of the old keyword signature, same names and defaults. The constructor is now EvaluationPipeline(settings=None, **kwargs):

  • settings= is used as given;
  • otherwise the keywords build an EvaluationSettings. Unknown or missing fields raise the same TypeError text as before (rewrapped under EvaluationPipeline.__init__);
  • both together raise a TypeError.

Production callers move to settings=: commands/benchmark.py and commands/orchestrate.py. ~50 test call sites keep the keyword form. Four test fakes that read the constructor kwargs now read vars(settings).

Positional arguments still work: the constructor takes *args and maps them onto the fields in the old order, with the same refusal texts. No call site in the repo passes any positionally (AST scan: 56 calls, 0 positional); the positional path exists for external callers. The *args/**kwargs signature is kept on purpose: the old keyword and positional calls must keep working, so the constructor does not list the 25 fields. The typed path is settings=, where EvaluationSettings checks the field names and arity (it does not check value types, as the old keywords did not).

Evidence

  • Differential probe (scratch/arch-r14-4/work/probe/pipeline_diff.py, not in the repo; base = 75787690a extracted with git archive): 40 scenarios, 6 of them positional. Kwargs mode on the new tree is byte-identical to base on all 40. Settings mode is byte-identical on 30; the 3 raw argument-error scenarios are kwargs-only by construction.
  • tests/test_pipeline_settings.py (8 new tests): settings and kwargs build the same attributes; positional fields fill in order; a positional repeated as a keyword is refused; the settings fields are the keywords; both-given refusal; unknown and missing field messages.
  • Pipeline, benchmark, answering-stack, evaluate and import-architecture test files on the final head: 233 passed.
  • Probe on the final head (after two follow-up commits: argument error order, token-budget docstring): kwargs mode identical to base on all 40 scenarios; settings mode identical except the 3 raw argument-error scenarios.
  • ci-local --offline --jobs static,typecheck on the head: 0 failed, 17 passed, 3 skipped.

Merge Danger

Door: two-way. No schema, file or CLI change; a revert restores the keyword signature.

Blast Radius: evaluate and benchmark run/batch construct the pipeline through the new path. The probe covers every question-source branch, so those branches are the evidence.

🤖 Generated with Claude Code

@napetrov napetrov added the skip-changelog No user-visible change: bypasses the changelog fragment check label Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Tests miss 9 of 55 small breaks of the lines this PR changes

At 5e3347c: 46 caught · 9 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
dokimi/dokimi/orchestrator/pipeline.py:113 bump-int 1 → 2 5
dokimi/dokimi/orchestrator/pipeline.py:114 drop-clause args or kwargs → (kwargs) 17

Not checked:

  • 2 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

codecov-commenter commented Dec 5, 2026 •

Copy link
Copy Markdown

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

Codecov Report

❌ Patch coverage is 98.64865% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.43%. Comparing base (19e5222) to head (5e3347c).

Files with missing lines Patch % Lines
dokimi/dokimi/orchestrator/pipeline.py 97.14% 0 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1648      +/-   ##
==========================================
- Coverage   96.44%   96.43%   -0.01%     
==========================================
  Files         585      586       +1     
  Lines       76600    76641      +41     
  Branches    13175    13177       +2     
==========================================
+ Hits        73876    73910      +34     
- Misses       1671     1673       +2     
- Partials     1053     1058       +5     
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_settings.py 100.00% <100.00%> (ø)
dokimi/dokimi/orchestrator/pipeline.py 95.21% <97.14%> (+0.09%) ⬆️

... 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.

@napetrov
napetrov marked this pull request as ready for review December 6, 2026 06:07
@napetrov
napetrov requested a review from a team as a code owner December 6, 2026 06:07
Copilot AI balanced review requested due to automatic review settings December 6, 2026 06:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The token setting needs to be documented as a retrieval budget because it does not cap answer length, potentially misleading callers.

1 open issue
What changed in this PR

1 new finding.

This refactor centralizes evaluation-run inputs in EvaluationSettings and builds on #1644’s pipeline phase extraction.

Changes:

  • Adds frozen settings while retaining keyword and positional construction.
  • Migrates production callers and updates test fakes.
  • Extracts pipeline phases and question-set helpers.
File Description
dokimi/​tests/​test_pipeline_settings.py Tests settings and constructor compatibility.
dokimi/​tests/​test_pipeline_question_set.py Updates the evaluate pipeline fake.
dokimi/​tests/​test_benchmark_registry_wiring.py Reads settings in the registry spy.
dokimi/​tests/​test_benchmark_command_question_set.py Updates the benchmark pipeline fake.
dokimi/​tests/​test_answering_stack_p_step2.py Adapts the answering-stack fake.
dokimi/​scripts/​growth_baseline.json Removes the reduced complexity baseline.
dokimi/​dokimi/​orchestrator/​question_sets.py Houses extracted question-set helpers.
dokimi/​dokimi/​orchestrator/​pipeline.py Accepts settings and extracts phase helpers.
dokimi/​dokimi/​orchestrator/​pipeline_settings.py Defines and documents run settings.
dokimi/​dokimi/​orchestrator/​__init__.py Exports EvaluationSettings.
dokimi/​dokimi/​commands/​orchestrate.py Constructs evaluation runs through settings.
dokimi/​dokimi/​commands/​benchmark.py Constructs benchmark runs through settings.
dokimi/​changelog.d/​20261204_120000_napetrov_arch-r8-7-pipeline-split.md Documents the phase-helper extraction.

Review effort: Balanced

@exai-bot

exai-bot commented Dec 6, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 11 selected item(s).

CI at 5d11fb1: 21 passing, 4 skipped.

Review details
  • Commit reviewed: 5d11fb1 against merge base 19e5222
  • Coverage: 11 files in 2 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 213k tokens (132k from cache), 13s
  • Tool calls: 17 (12 file_read, 2 file_read_diff, 2 local_check_results, 1 ci_status)
  • Pipeline settings extraction and orchestration tests: 7 files
  • Command integration with pipeline settings: 4 files

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>
Thread: PRRT_kwDOVBg7g87AQkCS
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…the settings object

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov napetrov removed the skip-changelog No user-visible change: bypasses the changelog fragment check label Dec 6, 2026

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.

4 participants