Repository navigation
fix(cli): scope the unscoped output moves to the leaves that take their target - #1571
Conversation
…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>
There was a problem hiding this comment.
🟢 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
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟡 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 · 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.
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
left a comment
There was a problem hiding this comment.
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 istest_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>
|
Re: review by vlad-perevezentsev
|
|
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
vchamarthi
left a comment
There was a problem hiding this comment.
Approving a621d4f.
What I checked: the full test suite passes with main merged in (34,851 tests); it merges cleanly onto main.
Part of #94 (F1b move scoping, follow-up to #1414 and #591). #94 stays open.
Summary
--output-dirand--out-jsonwere the two FlagMoves with noleaves, so their tombstone printed--out-diror--outon 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
--output-dir--out-dirOUT_DIR_LEAVES)--out-dir--out-json--outOUT_FILE_LEAVES)--out--out-dirOUT_AS_DIR_LEAVES)Kept rows: none removed. Old spellings on leaves outside these sets keep argparse's unrecognized-argument error.
Evidence
test_a_move_prints_argv_that_parses_on_each_leaf_it_applies_tofails for--out-jsonand--output-dirwith the exemption removed.test_cli_flag_moves,test_cli_output,test_cli_flags,test_cli_f1b_*pass (478).--output-dironskill routingand--out-jsonon six directory-only leaves, includingbenchmark run. The two focused test files passed 373 tests during the review round.Merge danger
Tombstone text changes only for
--output-dirand--out-jsonon 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