Skip to content

fix(cli): scope the unscoped output moves to the leaves that take their target - #1571

Merged
napetrov merged 11 commits into
intel:mainfrom
napetrov:fix/cli-flag-move-scope
Dec 4, 2026
Merged

napetrov merged 11 commits into
intel:mainfrom
napetrov:fix/cli-flag-move-scope

Conversation

@napetrov

@napetrov napetrov commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of #94 (F1b move scoping, follow-up to #1414 and #591). #94 stays open.

Summary

--output-dir and --out-json were the two FlagMoves with no leaves, so their tombstone printed --out-dir or --out on every command. On a command that does not take that flag, the printed argv failed to parse. The flag-move test exempted unscoped moves, so this was never caught.

Each move is now scoped to the leaves that accept its target. The test no longer exempts unscoped moves, and every move must list its leaves.

Moves

old new leaves note
--output-dir --out-dir 21 (OUT_DIR_LEAVES) the leaves that take --out-dir
--out-json --out 60 file leaves (OUT_FILE_LEAVES) JSON artifact destinations
--out --out-dir 5 (OUT_AS_DIR_LEAVES) directory destinations

Kept rows: none removed. Old spellings on leaves outside these sets keep argparse's unrecognized-argument error.

Evidence

  • Red first: test_a_move_prints_argv_that_parses_on_each_leaf_it_applies_to fails for --out-json and --output-dir with the exemption removed.
  • Green: test_cli_flag_moves, test_cli_output, test_cli_flags, test_cli_f1b_* pass (478).
  • Regression tests cover --output-dir on skill routing and --out-json on six directory-only leaves, including benchmark run. The two focused test files passed 373 tests during the review round.

Merge danger

Tombstone text changes only for --output-dir and --out-json on the leaves that were removed from their scope. Those now give argparse's unrecognized-argument error. No parser change: all accepted spellings are identical.

Label: cli-interface-change.

🤖 Generated with Claude Code

…ir target

--output-dir and --out-json were unscoped FlagMoves, so their tombstone printed
--out-dir or --out on every leaf, including leaves that do not take that flag.
Scope each to the leaves that accept the target: --output-dir to the 21 leaves
that take --out-dir; --out-json to the leaves that take --out as a file plus the
five directory leaves it chains through to --out-dir (eval check among them).

The flag-move parse test no longer exempts unscoped moves, and a regression test
pins --output-dir on skill routing.

Part of intel#94

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

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 active review issues remain for the scoped CLI flag-hint changes.

No open issues 🎉

What changed in this PR

0 new findings; nothing to fix.

This PR advances #94’s CLI flag cleanup by limiting legacy output-flag hints to commands that accept their replacements.

Changes:

  • Scope output moves to explicit command sets, sharing the directory-move set.
  • Require every move to declare its scope and verify that replacement arguments parse.
  • Document the corrected hints; accepted flag spellings remain unchanged.
File Description
dokimi/​tests/​test_cli_flag_moves.py Enforces scoped moves and checks chained replacements.
dokimi/​dokimi/​cli_flags.py Defines command sets and scopes output-flag moves.
dokimi/​changelog.d/​20261202_120000_napetrov_scope-output-moves.md Documents corrected hints and errors outside their scope.

Review effort: Balanced

@exai-bot

exai-bot commented Dec 3, 2026 •

Copy link
Copy Markdown

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

CI at a621d4f: 21 passing, 4 skipped.

Review details
  • Commit reviewed: a621d4f against merge base 0db63b5
  • Coverage: 4 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 185k tokens (143k from cache), 17s
  • Tool calls: 16 (9 file_read, 5 code_search, 1 ci_status, 1 local_check_results)
  • CLI flag scope and output moves, tests, and changelog: 4 files

@github-actions github-actions Bot removed the cli-interface-change Changes dokimi's user-facing CLI surface label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Not a clean result: some breaks or tests were left out

At a621d4f: 0 caught · 0 missed

This is not a clean result:

  • 28 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 3, 2026 •

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.52%. Comparing base (49981f9) to head (a621d4f).
⚠️ Report is 1 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1571      +/-   ##
==========================================
- Coverage   96.53%   96.52%   -0.01%     
==========================================
  Files         550      550              
  Lines       73183    73187       +4     
  Branches    12623    12623              
==========================================
- Hits        70645    70643       -2     
- Misses       1553     1556       +3     
- Partials      985      988       +3     
Files with missing lines Coverage Δ
dokimi/dokimi/cli_flags.py 100.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

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

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes needed · reviewed b8a46cf

To fix: --out-json still sends users to --out-dir on the directory leaves, which never took it (line comments); the two nits can wait.

✅ make ci-local --offline: 34,118 passed · ⚠️ 1 failed: test_cli_fault_contract[eval score ragas] (a local langchain_openai import problem; it also fails on the base) · ✅ every 0.2.0 leaf with --out-json or --output-dir is still in the new lists · ✅ test_cli_flag_moves.py and test_cli_output.py pass on a merge with current main: 366 passed

Making every move scoped and checking that the printed argv parses on each listed leaf is a solid guard.

Comment thread dokimi/dokimi/cli_flags.py Resolved
Comment thread dokimi/dokimi/cli_flags.py Resolved
Comment thread dokimi/tests/test_cli_flag_moves.py Resolved
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g86_Jt73
Thread: PRRT_kwDOVBg7g86_Jt8H
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g86_Jt8B
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Review: PRR_kwDOVBg7g88AAAABb8JOxA
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>

@antonwolfy antonwolfy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The scoping of --output-dir and the strict test hold up. The merge waits on one point from @vlad-perevezentsev.

I agree with @vlad-perevezentsev's point on --out-json for the directory leaves, and on the two nits. New evidence: repo run src --out-json result.json prints repo run src --out-dir result.json, and eval check --out-json r.json prints eval check --out-dir r.json; benchmark run --out-json x prints nothing, so only the five directory leaves are affected.

What I ran, on a Linux review host at b8a46cf:

  • make ci-local: 37 passed, 1 failed, 16 skipped. The failure is test_cli_fault_contract[repo run], a 60 s pytest timeout under load. It passes when run alone, and the PR does not touch that file.
  • Changed-line coverage 100%.
  • A reproduction of the printed argv above, offline.

Checked, no issues

  • Signoff: the one commit has a Signed-off-by.
  • Changelog: the fragment is present and in the Fixed section.

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

napetrov commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Re: review by vlad-perevezentsev

--out-json still sends users to --out-dir on the directory leaves, which never took it
Scoped to file outputs in 2678e08. The same commit tests the directory-only leaves, and 6ee9ef8 corrects the directory flag comment.

@napetrov

napetrov commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Re: review by antonwolfy

repo run src --out-json result.json prints repo run src --out-dir result.json
2678e08 suppresses both bogus hints.

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

@vchamarthi vchamarthi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving a621d4f.
What I checked: the full test suite passes with main merged in (34,851 tests); it merges cleanly onto main.

@napetrov
napetrov merged commit 4447d49 into intel:main Dec 4, 2026
25 checks passed
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.

7 participants