Repository navigation
test(arms): pin what arms run, matrix-run and subjects run hand the arms runner - #264
Merged
napetrov merged 1 commit intoOct 29, 2026
Merged
Conversation
…unner The three entry points reach one arms run by different paths: matrix-run copies its Namespace per cell, subjects run builds one by hand from FORWARDED_RUN_CONFIG_FIELDS, and _build_arms_output reads most fields with a getattr default, so a dropped field reads as the default. Pin, per entry point, what ArmRunner's constructor and its run, judge and build_output calls receive when every field the command takes is set away from its default and when none is set, plus the judge panel, session and named-cell cases. The argv goes through cli.parse_args to the command's handler and the calls are recorded on the class, so a typed run config can replace the Namespace hand-off without editing these tests. Refs intel#4 Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
vlad-perevezentsev
requested review from
antonwolfy,
jharlow-intel,
napetrov,
vchamarthi and
xaleryb
as code owners
October 28, 2026 13:54
12 of 17 tasks
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #264 +/- ##
==========================================
+ Coverage 92.83% 92.89% +0.06%
==========================================
Files 262 262
Lines 33016 33016
Branches 5510 5510
==========================================
+ Hits 30649 30670 +21
+ Misses 1571 1553 -18
+ Partials 796 793 -3 🚀 New features to boost your workflow:
|
6 tasks done
napetrov
approved these changes
Oct 29, 2026
vlad-perevezentsev
added a commit
to vlad-perevezentsev/dokimi
that referenced
this pull request
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arms run,arms matrix-runandsubjects runall end in one arms run, each by its own path.matrix-runcopies its Namespace for each cell and_apply_matrix_cellmutates the copy.subjects runbuilds a Namespace by hand fromFORWARDED_RUN_CONFIG_FIELDS._build_arms_outputreads most fields withgetattr(args, ..., default), so a field one path drops looks exactly like a user who chose the default. This PR changes only tests. It pins what reaches the runner from each entry point, so that a later move to a typed run config (#4 Wave 5) can show an empty test diff.tests/test_arms_run_config_parity.py(new, 11 tests):dokimi.cli.parse_args, the functionmaincalls (it also fills in the--judge-modeldefault from--judge-provider), and then to the command's handler. No hand-built Namespace, and no assert onforwarded_run_config(): a refactor changes both.ArmRunner.__init__,run,judgeandbuild_output, recorded on the class and then run for real. Arguments the caller left out are recorded with the runner's own default (inspect.signature(...).bind+apply_defaults).top_k/rerank_thresholdare read from the doc treatmentcreate_treatmentsbuilt. The judge is read from theJudge/JudgePanelobject passed torunner.judge. Because the methods are patched on the class, the tests also pass whenArmRunner,Judgeandcreate_treatmentsare imported at module top (checked).provider_calls(adapter seam, response cache off, a bypass to litellm fails the test), with a judge-shaped reply for every request.arms runFORWARDED_RUN_CONFIG_FIELDSexcept the session pair, plus--plugins,--baseline-arm--judge--judge-modelleft to--judge-provider);--session-turns/--turn-reminder; named--matrix-cellbeats--model/--provider/--pluginsarms matrix-runsubjects runbaseline_armoverride is visibleWhat the tests pin about today's behaviour
These are facts, not fixes; nothing in the package changes.
subjects runhas no--temperature,--seed,--judge-temperature,--judge-panel,--stats-correction,--session-turnsor--turn-reminder. Its runs always getNone/None/None/single judge/holm/no session.arms matrix-runhas no--session-turns/--turn-reminder. The flags it does share witharms runreach every cell, but--model/--provider/--pluginsare replaced by the cell's values.subjects run, the forwardedmodel,providerandharnessnever reach the runner. The matrix cell sets all three, from the descriptor's[[matrix.cells]]or, without them, from the one cell built from these flags.Evidence
The branch is
upstream/main+ one new test file, so the tests describe main as it is:11 passed.Mutation sweep: 57 single edits to
commands/arms.py,commands/subjects.pyandcli.py, each run against this file and then reverted:ArmRunner(...)keyword dropped (13);runlibrary_id/concurrency;judgebaseline_arm/concurrency;build_outputbaseline_arm;Judgetemperature / model;JudgeConfigtemperature / provider;create_treatmentstop_k/rerank_threshold;--context7-idignored;--judgeignored;--judge-panelignored;_apply_matrix_cellname / model / provider / plugins dropped; thestats_correctiongetattr defaultholm→bh; thesubjects runbaseline_armoverride dropped; its default cell model replaced; the--judge-modelprovider default inparse_argsturned offFORWARDED_RUN_CONFIG_FIELDSminuscontext7_id,judge,judge_model,judge_provider,top_k,rerank_threshold,max_iterations,max_tokens,grounded_from_topics,concurrencyFORWARDED_RUN_CONFIG_FIELDSminusmodel,provider,harnessFORWARDED_RUN_CONFIG_FIELDSminus the 7 fieldssubjects runhas no flag forgrounded_from_topicsgetattr defaultFalse→Truematrix-runsharing one Namespace across cells instead of copying itEach of the survivors is a change that does not alter behaviour today, not a gap in the test.
pytest: 9256 passed, 57 skipped.tests/test_audit_test_quality.pypasses (no flagged shapes). Each test passes alone and under xdist.Merge Danger
Door: two-way. One new test file; nothing in the package changes.
Blast Radius: none at runtime. A future change to how these three commands configure an arms run fails these tests until its effect is intended and the tables are updated.
Overlap: #238 and #255 touch
commands/arms.py/commands/subjects.py. This PR does not, and its file name does not clash with #238's tests (test_arms_output_errors.py,test_arms_matrix_cells_input.py). If #255 adds a provider choice, nothing here changes.Not in this PR:
FORWARDED_RUN_CONFIG_FIELDS/forwarded_run_config/ thegetattrdefaults → one config object). That is the next PR, and these tests must pass on it unchanged.subjects runandmatrix-run(listed above): adding them changes behaviour, so it is a separate change.Checklist
pytestpasses (9256 passed, 57 skipped)ruff,mypy, and schema checks pass (make ci-local)dokimi/tests/changes)AGENTS.md: mutation sweep aboveRefs #4