Skip to content

feat(arms): resume from partial checkpoints - #1659

Open
napetrov wants to merge 2 commits into
intel:mainfrom
napetrov:feat/arms-resume
Open

napetrov wants to merge 2 commits into
intel:mainfrom
napetrov:feat/arms-resume

Conversation

@napetrov

@napetrov napetrov commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Summary

arms run --resume-from <out stem>.partial.json
  verify questions, model settings and local treatment contents
  restore completed questions and their judge material
  answer remaining questions, then judge the full set
  save the new output and preserve the source checkpoint

The resume flag covers single runs with baseline, profile and local skill arms.

Evidence

  • Before — In a six-question local-tool run interrupted after three questions, the response cache restored three baseline answers. Re-running the three completed skill answers took 11 model requests and 11 tool calls, and changed all three answers.
  • After — The interruption test restores the saved skill answer and its judge material in input order, verifies zero generation calls for that question, and checks that the checkpoint keeps its original bytes. Mismatched questions, settings or bundled files fail before generation.
  • The full suite passed locally (36,266 passed, 28 skipped). Coverage of changed lines was 93%.

Merge Danger

Door — Two-way

Blast Radius — Arms

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov
napetrov requested a review from a team as a code owner December 6, 2026 06:22
Copilot AI balanced review requested due to automatic review settings December 6, 2026 06:22
@github-actions github-actions Bot added the cli-interface-change Changes dokimi's user-facing CLI surface label Dec 6, 2026
@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown

CLI interface change detected

This PR changes dokimi's user-facing CLI surface (commands and/or options):

~ `dokimi arms run` parameters changed:
    + added option `--resume-from`

Updated on every push; the cli-interface-change label is on while the diff is non-empty.

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.

🟢 Approval recommended

No actionable issues were found in the reviewed changes.

No open issues 🎉

What changed in this PR

0 new findings; nothing to fix.

Adds checkpoint resume support to arms run, reusing completed answers and judge material while preserving the source checkpoint.

Changes:

  • Validates questions, settings, and local treatment contents before restoring answers.
  • Generates remaining answers and judges the full set when requested.
  • Adds resume tests, artifact metadata, and CLI documentation.
File Description
dokimi/​tests/​test_run_wide_stop.py Updates the preparation mock for checkpoint arguments.
dokimi/​tests/​test_arm_runner_incremental.py Tests restoration, compatibility checks, and checkpoint preservation.
dokimi/​dokimi/​schemas/​arms.v1.json Adds resume metadata fields.
dokimi/​dokimi/​eval/​arms_run.py Integrates checkpoint preparation and restored answers.
dokimi/​dokimi/​eval/​arms_checkpoint.py Implements fingerprinting, validation, and recovery.
dokimi/​dokimi/​eval/​arm_runner.py Skips generation for restored questions.
dokimi/​dokimi/​commands/​arms.py Adds resume handling and output-path safeguards.
dokimi/​dokimi/​cli_flags.py Registers the checkpoint flag concept.
dokimi/​docs/​reference/​cli-interface.json Records the new CLI option.
dokimi/​docs/​evaluating-treatments.md Documents resume usage and limitations.
dokimi/​changelog.d/​20261202_210000_arms-resume.md Announces checkpoint resume support.

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 1d4a8ff: 21 passing, 4 skipped.

Review details
  • Commit reviewed: 1d4a8ff 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: 639k tokens (475k from cache), 1m29s
  • Tool calls: 53 (37 file_read, 10 code_search, 2 ci_status, 2 file_read_diff, 2 local_check_results)
  • Arms resume CLI and documentation: 5 files
  • Arms checkpointing, incremental execution, and tests: 6 files

Comment thread dokimi/dokimi/eval/arms_checkpoint.py Resolved
Thread: PRRT_kwDOVBg7g87AQtrg
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@codecov-commenter

codecov-commenter commented Dec 6, 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 89.24051% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.42%. Comparing base (19e5222) to head (1d4a8ff).

Files with missing lines Patch % Lines
dokimi/dokimi/eval/arms_checkpoint.py 86.17% 10 Missing and 7 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1659      +/-   ##
==========================================
- Coverage   96.44%   96.42%   -0.02%     
==========================================
  Files         585      586       +1     
  Lines       76600    76749     +149     
  Branches    13175    13209      +34     
==========================================
+ Hits        73876    74005     +129     
- Misses       1671     1680       +9     
- Partials     1053     1064      +11     
Files with missing lines Coverage Δ
dokimi/dokimi/cli_flags.py 100.00% <ø> (ø)
dokimi/dokimi/commands/arms.py 98.45% <100.00%> (+0.03%) ⬆️
dokimi/dokimi/eval/arm_runner.py 96.97% <100.00%> (ø)
dokimi/dokimi/eval/arms_run.py 98.09% <100.00%> (+0.10%) ⬆️
dokimi/dokimi/eval/arms_checkpoint.py 86.17% <86.17%> (ø)

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

@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Tests miss 13 of 50 small breaks of the lines this PR changes, and the check was not complete

At 1d4a8ff: 37 caught · 13 missed · 30 not tried in time

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/eval/arms_checkpoint.py:39 flip-bool True → False 9
dokimi/dokimi/eval/arms_checkpoint.py:72 return-none [treatment.plugin_set, _treatment_identity(treatment.inner)] → None 2
dokimi/dokimi/eval/arms_checkpoint.py:77 return-none identity → None 36
dokimi/dokimi/eval/arms_checkpoint.py:79 return-none [*identity, treatment.max_chars, treatment.profile.system_prompt] → None 11
dokimi/dokimi/eval/arms_checkpoint.py:84 delete-statement raise ValueError(f"arm {treatment.name!r} depends on input that cannot be finger → pass 7
dokimi/dokimi/eval/arms_checkpoint.py:90 delete-statement raise ValueError("session checkpoints do not carry judge context") → pass 1
dokimi/dokimi/eval/arms_checkpoint.py:93 delete-statement settings["answer_route"] = resolve_model(settings["model"], settings["provider"] → pass 29
dokimi/dokimi/eval/arms_checkpoint.py:95 flip-bool True → False 29
dokimi/dokimi/eval/arms_checkpoint.py:101 drop-clause not isinstance(data, dict) or data.get("schema_version") != "arms.v1" or "partia → (data.get('schema_version') != 'arms.v1' or 'partial' not in data) 7
dokimi/dokimi/eval/arms_checkpoint.py:104 delete-statement validate_artifact("arms", data) → pass 7
dokimi/dokimi/eval/arms_checkpoint.py:121 drop-clause cell is None or cell.raw.get("error") or is_empty_reply(cell.text) → (cell is None or cell.raw.get('error')) 3
dokimi/dokimi/eval/arms_checkpoint.py:134 drop-clause partial["questions_requested"] != len(questions) or partial["questions_recorded" → (partial["questions_recorded"] != len(rows)) 3
dokimi/dokimi/eval/arms_checkpoint.py:141 drop-clause index is None or index in seen or row.question_text != question_text_of(question → (index in seen or row.question_text != question_text_of(questions[index])) 3

Not the whole picture:

  • 30 breaks were not tried before the time budget ran out
  • 90 more breaks of covered changed lines were over the limit and not tried
  • 4 candidate test files were not run
  • 32 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.

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

cli-interface-change Changes dokimi's user-facing CLI surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants