Repository navigation
feat(cli): route table as data, sectioned help, cost labels, data schema (#94 A1) - #284
Conversation
The top-level route list now comes from dokimi/cli_routes.py: each root sits in one of four sections (The loop, Subjects, Evals, Analysis and data), and every route's help line ends in [free] or [paid]. A route is paid when any model call is possible in some flag combination; a root is paid if any leaf is. `dokimi data schema list|show KIND` prints a schema as JSON; cli_routes is the first kind. The table also carries tombstones (an old argv prefix that moved prints "moved: dokimi ..." and exits 2, never runs). The table is empty for now, and the test covers the mechanism with a test-only entry. Handler-neutral: no command moves or renames. Route help text stays with each parser, except run and compare, which get a one-line help from the table. Refs intel#94 (A1), intel#276 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
moved_argv matches by argv prefix, but tombstone_problems compared paths to the leaf list only. A tombstone on a group (repo tasks) therefore passed the check and shadowed live routes under it, and a root or alias destination (library) was wrongly reported as not a route. A path now counts as a route when it names a root or alias, or a group or leaf under one. Self-review of the A1 commit (blocking). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…bels A tombstone whose old path extends a live leaf (compare x, where compare takes files) shadows that leaf's invocations, so tombstone_problems now reports it. The tombstone check resolves aliases through one helper. A route with neither parser help nor a table summary gets its label without a leading space. Self-review round 2 (no blocking; these two nits and the test count fixed). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…path moved_argv compared raw argv, so `product old` skipped a tombstone on `library old`. It now compares canonical paths (an alias is replaced by its root's name on both sides). An empty old path matched every argv, and an option (--version) is not a command; tombstone_problems reports both. Self-review round 3 (2 blocking, both fixed; the alias-ownership check is new). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #284 +/- ##
==========================================
+ Coverage 93.57% 93.60% +0.02%
==========================================
Files 277 279 +2
Lines 35800 35949 +149
Branches 6070 6094 +24
==========================================
+ Hits 33500 33649 +149
+ Misses 1486 1485 -1
- Partials 814 815 +1
🚀 New features to boost your workflow:
|
CLI interface change detectedThis PR changes dokimi's user-facing CLI surface (commands and/or options): + added command `dokimi data`
+ option `--help/-h`
+ added command `dokimi data schema`
+ option `--help/-h`
+ added command `dokimi data schema list`
+ option `--help/-h`
+ added command `dokimi data schema show`
+ argument `kind`
+ option `--help/-h`Updated on every push; the |
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
Review at 08ac435. The route table, the sectioned help and the tombstone check do what #94 A1 asks, and the cost labels match what the commands do. What is left is small and is in the line comments.
What I ran, at 08ac435:
make ci-local --offline: 9,681 passed, 0 failed, 57 skipped; every static step passed (the network-only ones were skipped).dokimi --help,dokimi repo --help,dokimi novelty --helpanddokimi data schema show cli_routes: four sections, every root and leaf ends in[free]or[paid],library (product)keeps its alias.- Each
freeleaf's handler, looked up from the parser: none of them makes a model call. The ones that take--model/--provider/--harness(benchmark preflight,repo budget,repo compare) use them only to check keys, pick a profile or filter rows.
Checked, no issues
- Unknown routes:
cost_ofreturns None for a route the table does not know, so a missing entry shows no label rather than[free], andtest_route_table_matches_the_parser_leaves_and_rootsfails on it. - Tombstones: the check runs before argparse, rewrites an alias argv to the new path, and
tombstone_problemsrejects an empty or option old path, a live route, a path under a live leaf and a target that is not a route. The table is empty, so no user-visible change yet. - Changelog: the fragment says what changed in
--helpand thatdata schemahas one kind for now.
antonwolfy
left a comment
There was a problem hiding this comment.
Review at 08ac435. The route table, the sectioned help and the tombstone check do what #94 A1 asks, and the cost labels hold up against the handlers. One thing is worth fixing before merge: the tests do not pin the costs the PR promises.
I agree with @vlad-perevezentsev's points on the missing cli_routes.v1 schema file and on the data help text and the routed flag.
What I ran, on a Linux review host at 08ac435:
make ci-local: 26 passed, 2 failed. Full suite 9,730 passed; changed-line coverage step passed.pip-auditfails onfilelockadvisories in the lock files, which this PR does not touch.Run testsfailed ontest_unbalanced_quote_in_hook_completes_quickly(took 1.44 s, limit 1 s),test_a_cell_finished_with_another_execution_is_not_reused_...and two 60 s timeouts intest_audit_test_quality.py. None touches the CLI. All 764 tests in those three files pass when re-run alone at the same commit.- Mutation run on
test_cli_routes.py: 51 mutants, 24 of which pass the file. The ones that matter are in the inline comment.
Checked, no issues
- Cost labels: I read the handler of every
freeleaf (benchmark preflight,repo tasks check,repo budget,eval grounding,ingest docling,novelty items|view, ...). None reaches an LLM, embeddings or harness call. Thepaidleaves with a no-model flag (--dry-run,--lexical-only) do call a model by default. - Table against parser:
LEAVESandROOTSmatch the parser tree exactly, includingrepo tasks check,data schema list|showand theproductalias. - Help output: a recursive help dump against the base differs only by the sections, the labels and the
datasubtree. Repeatedbuild_parser()calls do not label twice. - Commits: all four are signed off.
|
🔍 OpenCodeReview found 1 issue(s) in this PR. By severity: 1 medium
Review details
|
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
After merging main, `repo tasks replay` and `context consistency` are parser leaves the table did not list, so test_route_table_matches_the_parser_leaves_and_roots and the cost-label test failed on the merged tree. Both are free: replay reads a recorded threads file and writes tasks (no LLM, no GitHub), consistency reads local trace files. Sync with main for PR 284; not a review item. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
dokimi data schema show cli_routes printed a document stamped cli_routes.v1 that no schema defined, so schema_compat could not catch a renamed leaves[].path or a dropped roots[].cost. Add schemas/cli_routes.v1.json, its fixture, register the kind, and test that document() validates and that a drifted shape is rejected. Thread: PRRT_kwDOVBg7g86xg7_0 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
`dokimi data --help` promised "Schemas of the artifacts and the CLI routes" and `data schema` "an artifact or route schema", but cli_routes is the only kind: `data schema show eval` is an invalid choice. Say what is there; widen the text when artifact kinds are added (the test pins the pairing). Thread: PRRT_kwDOVBg7g86xg7_2 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…ntParser add_subparsers builds its children with type(self), so every `dokimi <cmd>` parser was a _RoutedParser that relied on the class default routed = False. Pass parser_class=argparse.ArgumentParser instead and remove the flag; only the top-level parser lists its commands by section. Thread: PRRT_kwDOVBg7g86xg7_4 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…rewrite to literals The cost-label, section and `data schema show` tests compared the output to cli_routes itself, so a wrong `[free]` passed. Mutations, each applied alone to cli_routes.py, all survived tests/test_cli_routes.py: evaluate and tools preference flipped to free, repo tasks check to paid, document() reporting every root free, no sections or no aliases, and moved_argv slicing by len(tomb.new). Now: the paid leaf paths are a literal set (the help labels are checked against it too), one root's section/aliases/cost and the sections are asserted from literals, and a tombstone whose old and new paths differ in length (old starting with `product`) is rewritten. All seven mutants now fail the file. Thread: PRRT_kwDOVBg7g86xh56h Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
… lines The cost-label test guarded with `checked >= len(LEAVES)`, but the walk also counts the root and group entries, which make up for a missing leaf; and a leaf parser added without help= is absent from _choices_actions, so it was skipped. Removing help= from `baseline save` left the file green (and `save` vanished from `dokimi baseline --help`). Compare the set of checked paths with the leaf paths instead; `run` and `compare`, whose help comes from the table's summary, are the exempt ones. Thread: PRRT_kwDOVBg7g86xlZDa Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Codecov listed line 190 of cli_routes.py (the empty-argv return in _canonical) as the patch lines without coverage. An empty argv matches no tombstone and argparse still asks for a command. Comment: IC_kwDOVBg7g88AAAABgsGHDA Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…r line comments Review bodies and the OpenCodeReview summary carry no claim of their own; their points are the line-comment threads fixed in the commits above (schema, data help, routed flag, test pins, help-less leaf), plus the Codecov line. Review: PRR_kwDOVBg7g88AAAABU4jUUQ Review: PRR_kwDOVBg7g88AAAABU5Daiw Review: PRR_kwDOVBg7g88AAAABU66xpw Comment: IC_kwDOVBg7g88AAAABg1oaiw Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
The three points you share with the first review are fixed in 55601ae, 1f26a76 and f97bb3e; the mutation findings in 49df9a8 (thread answered there). The CI failures you list (timing test, cell reuse, two audit timeouts, pip-audit |
|
Its one inline finding (the guard that counts instead of naming leaves) is fixed in fe1c6a7; answered in that thread. |
|
Line 190 of |
|
Informational: the diff lists exactly the new |
|
The one finding it posted inline is thread PRRT_kwDOVBg7g86xlZDa, fixed in fe1c6a7. |
| def test_run_and_compare_have_a_one_line_help_in_the_top_level_list(): | ||
| text = build_parser().format_help() |
There was a problem hiding this comment.
This test depends on the host terminal width. argparse sizes help from COLUMNS or the terminal, and falls back to 80. At 80 columns the help column is about 54 wide. "Run the static benchmark spec and save a snapshot [free]" is 56 characters, so [free] wraps onto a continuation line and the $-anchored regex fails. In a wide terminal the same test passes. A correct label can fail on a narrow host, and a label that is only on a wrapped line cannot be told apart from a missing one. Pin the width, for example monkeypatch.setenv("COLUMNS", "200") before format_help(). Do the same in test_help_lists_each_root_under_its_section, which also reads format_help() output.
Suggestion:
| def test_run_and_compare_have_a_one_line_help_in_the_top_level_list(): | |
| text = build_parser().format_help() | |
| def test_run_and_compare_have_a_one_line_help_in_the_top_level_list(monkeypatch): | |
| monkeypatch.setenv("COLUMNS", "200") # keep argparse from wrapping the cost label | |
| text = build_parser().format_help() |
There was a problem hiding this comment.
Confirmed, with one correction: the test passes at 80 columns and fails from 77 down.
At eb5e612, COLUMNS=79 and COLUMNS=80 pytest tests/test_cli_routes.py pass; COLUMNS=76, 74, 70 and 60 fail test_run_and_compare_have_a_one_line_help_in_the_top_level_list, because [free] wraps onto the next line of run. argparse reads the width from COLUMNS or the real terminal, so CI is fine and a narrow local terminal is not. test_help_lists_each_root_under_its_section still passes at 60 columns, so that one does not need the pin.
Suggestion: monkeypatch.setenv("COLUMNS", "200") in this test, as proposed above.
There was a problem hiding this comment.
Fixed in 50a9ab93: confirmed on head. test_run_and_compare_have_a_one_line_help_in_the_top_level_list now sets COLUMNS=200 before format_help(), so the [free] and [paid] labels are read unwrapped on any host. Before the change the test failed at COLUMNS=76 and COLUMNS=60 (the width that Vlad measured); it now passes at 60, 76, 80, 200 and unset.
Not applied to test_help_lists_each_root_under_its_section: on head it passes at COLUMNS 20, 30, 40 and 60. It reads only the section headings and the first word of each root line, and wrapping does not change either, so the pin would not change its result.
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
Review at eb5e612. This is a re-check, and all three points from the first round are fixed. cli_routes.v1 now has a JSON Schema and a fixture, and its kind is registered in SCHEMA_VERSIONS. The schemas help no longer promises artifact schemas. The routed flag is gone. The PR looks good to merge once the open line comment is settled.
What I ran, at eb5e612:
make ci-local --offline: 17 passed, 0 failed, 13 skipped; pytest 10,497 passed, 57 skipped;schema_compatgreen. I did not run the smoke CI, because the PR does not touch harnesses, process or repos.- I ran
tests/test_cli_routes.pywithCOLUMNSset to 80, 79, 76, 74, 70 and 60 to find where the help output starts to wrap.
Checked, no issues
- Route table schema: the new tests validate
document()againstschemas/cli_routes.v1.jsonand reject a changed document shape. - Help text: the
schemashelp now says it covers the CLI route table today, and a test pins that text. - Parser:
parser_class=argparse.ArgumentParserreplaces theroutedflag. Only the top-level help is printed by section, andrepo --helplooks as before. - Price labels: the paid leaves are now an explicit list in the test, not taken from the table under test. The tombstone case uses
oldandnewof different lengths. The leaf test compares the set of paths instead of counting help lines. - Routes from main:
repo tasks replayandcontext consistencyare correctly marked[free]. The first reads the recorded threads file with no LLM or GitHub call. The second reads stream-json traces. SCHEMA_VERSIONSreaders:artifactsanddatasets_exportlook entries up by kind, so the addedcli_routeskind does not affect them.- Other PRs: #255 conflicts in
dokimi/dokimi/cli.py. #281 and #279 conflict indokimi/dokimi/artifacts.py, where each PR adds a line at the end ofSCHEMA_VERSIONS, so the conflict is trivial. #285 and #254 sharetests/test_import_architecture.pyand merge cleanly.
argparse wraps help text at COLUMNS, or the terminal width, and 80 when neither is set. On a host narrower than about 77 columns the "[free]" label of `run` wraps onto a continuation line, so the one-line-help check fails although the label is there. Set COLUMNS=200 in that test, as test_bench_env does for the bench harness. Red: before this change the test fails at COLUMNS=76 and COLUMNS=60 (1 failed). Green: after it, the module passes at COLUMNS=60, 76, 80, 200 and unset. test_help_lists_each_root_under_its_section passes at COLUMNS 20-60 and is not changed. Review thread on dokimi/tests/test_cli_routes.py:142. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 10 selected item(s). Review details
|
| data_p = sub.add_parser("data", help="Schemas: today the CLI route table") | ||
| data_sub = data_p.add_subparsers(dest="data_cmd", required=True) | ||
|
|
||
| schema_p = data_sub.add_parser("schema", help="Print the CLI route table as JSON") |
There was a problem hiding this comment.
The schema group's help describes only schema show cli_routes, not the group. It also duplicates the show help and will be wrong once more kinds exist. Describe the group instead, e.g. "List and print schemas".
Suggestion:
| schema_p = data_sub.add_parser("schema", help="Print the CLI route table as JSON") | |
| schema_p = data_sub.add_parser("schema", help="List and print schemas") |
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
The comment block at the leaf check ran to three lines, which fails the Comment blocks CI gate (scripts/check_comment_blocks.py). Same reason, shorter: the leaf is named, not counted. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
| data_p = sub.add_parser("data", help="Schemas: today the CLI route table") | ||
| data_sub = data_p.add_subparsers(dest="data_cmd", required=True) | ||
|
|
||
| schema_p = data_sub.add_parser("schema", help="Print the CLI route table as JSON") |
There was a problem hiding this comment.
The schema group help says it prints the route table, but the group holds list and show KIND. This help line also appears in dokimi data --help with a [free] label. Describe the group, e.g. "List and print schemas". The data help ("Schemas: today the CLI route table") has the same problem.
Suggestion:
| schema_p = data_sub.add_parser("schema", help="Print the CLI route table as JSON") | |
| schema_p = data_sub.add_parser("schema", help="List schema kinds and print one as JSON") |
There was a problem hiding this comment.
Same change as the thread above, in f551d36: the schema group help describes list and show KIND and no longer duplicates the show help. The data help also names both sub-groups.
antonwolfy
left a comment
There was a problem hiding this comment.
The commits since my last review pin the paid leaves as a literal set, add the cli_routes.v1 schema and fixture, drop the routed flag and read the help labels at a fixed width. All four of my mutants and the extra ones from the earlier round now fail the file. One test gap on an exit code is worth closing before merge, and one nit, both inline.
What I ran, on a Linux review host at c0c3f15:
make ci-local: 29 passed, 0 failed, 7 skipped (network-only steps). 10,654 tests passed, 4 skipped;schema_compatand the changed-line coverage step passed.- Mutation run on
tests/test_cli_routes.py: 266 mutants, 38 pass the file. Every FREE/PAID flip of a leaf, every dropped leaf or root, the tombstone exit code, alias handling andtombstone_problemschecks are killed. The survivors are the two nits below and mutants of printed text. - Probes of
parse_args:dokimi --version,dokimi bogus,baseline --help,repo tasks --helpandlibrary --helpmatch the base apart from the sections and labels; twobuild_parser()calls give the same help.
Checked, no issues
- Cost labels: the
freehandlers I opened (context,dataset,ingest,dashboard,baseline,library,data,repo budget) reach no model or harness call. - Tombstones: an alias argv matches,
shlex.joinquotes the moved command, an empty or option-first old path is rejected, and the table is empty. - Repo rules: all 14 non-merge commits are signed off; the fragment, schema, fixture and
SCHEMA_VERSIONSentry are in the PR.
| assert {leaf["cost"] for leaf in doc["leaves"]} == {"free", "paid"} | ||
|
|
||
|
|
||
| def test_data_schema_list_names_the_kinds(capsys): |
There was a problem hiding this comment.
No test runs data schema show with an unknown kind, and its exit code depends on it.
show_p.add_argument("kind", choices=sorted(SCHEMA_KINDS)) (commands/data.py:41) is what turns dokimi data schema show nope into invalid choice: 'nope' and exit 2. Mutation check: changing it to choices=None passes the full file, and the command then raises KeyError from SCHEMA_KINDS[args.kind].
Suggestion: add
def test_data_schema_show_rejects_an_unknown_kind(capsys):
with pytest.raises(SystemExit) as exc:
build_parser().parse_args(["data", "schema", "show", "nope"])
assert exc.value.code == 2There was a problem hiding this comment.
Added in 1eeeae8 as test_data_schema_show_rejects_an_unknown_kind (exit code 2). Red: with choices= removed from show_p the test fails; green on the branch.
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
|
||
| def moved_text(argv: list[str]) -> str: | ||
| """The line a tombstone prints: the new command with the argv rewritten.""" | ||
| return "moved: " + shlex.join(["dokimi", *argv]) |
There was a problem hiding this comment.
Must-fix: shlex.join() formats a POSIX command even on Windows. For example, moved_text(["library", "show", r"C:\my files\input.json"]) produces moved: dokimi library show 'C:\my files\input.json'. In cmd.exe, single quotes do not protect spaces, so copying this replacement passes two arguments instead of the original path. Although the production tombstone table is currently empty, the new mechanism will give incorrect migration commands on that supported platform. Use platform/shell-appropriate command formatting and add a case covering a Windows path with spaces (the current tombstone tests only cover unquoted arguments).
There was a problem hiding this comment.
I would not hold the merge on this.
The tombstone table is empty, so no user sees this line yet. On Windows there is no single right quoting either: cmd.exe and PowerShell quote differently, and subprocess.list2cmdline is wrong for PowerShell. The other run hints dokimi prints are POSIX-style as well. This can be decided when the first tombstone lands in M1, together with the error.code: moved / next[0].argv JSON of #94 §2.7, which gives tools the argv as a list and needs no quoting.
There was a problem hiding this comment.
Not changed in this PR. The tombstone table is empty, so no user sees the line yet. Windows quoting has no single answer (cmd.exe, PowerShell and list2cmdline differ), so the tombstone move will carry argv as a JSON list (#94 §2.7) when the first tombstone lands in M1.
antonwolfy
left a comment
There was a problem hiding this comment.
I pushed a commit per nit, up to dd60110, which fix the nit from my review:
dd60110:dokimi/tests/test_cli_routes.py:74: the help test now compares the listed sections with a literal map of all 24 roots instead of the table that builds the help.
make ci-local at dd60110: 29 passed, 0 failed, 7 skipped.
The mypy job fails at CLI snapshot is current: docs/reference/cli-interface.json came with #254, which merged into main after my review, and this PR's new help sections and routes are not in it. The fix commit touches only tests/test_cli_routes.py. Fix: run make cli-snapshot in dokimi/ on top of current main and commit the result.
Not approving yet. Still open: the risk from my review.
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
Review at dd60110. All my earlier points are fixed: the help test now pins the width it reads the label at. Before merge, the CLI snapshot needs regenerating against current main, as @antonwolfy found.
What I ran, at dd60110:
make ci-local --offlineagainst the PR's merge-base: 10,601 passed, 0 failed, 57 skipped.- The PR merged into current
main(which now has #254):test_cli_flags.py::test_the_cli_interface_snapshot_is_currentfails, as @antonwolfy said.docs/reference/cli-interface.jsondoes not have thedatagroup or the labelled help yet. The merge itself is clean, andtest_cli_routes.pypasses on it.
Checked, no issues
- New tests: each root's section is now a literal map of all 24 roots, so a root moved to the wrong section fails the test. With
COLUMNS=200set in the test, the[free]/[paid]check passes at any terminal width.
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>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
LGTM
I checked 9a79713. Everything from the earlier rounds is fixed. The CLI snapshot is regenerated, data schema show with an unknown kind is tested, and the data/schema help describes the groups.
Merge: safe now. It merges cleanly into current main, 8 commits behind. main has changed docs/reference/cli-interface.json since, so I merged it and ran test_cli_flags.py, test_cli_routes.py and test_import_architecture.py on the merge: 65 passed. Once it is in, #307 and #255 conflict with it in cli.py, and #281 in artifacts.py; they need a rebase.
What I ran, at 9a79713:
Brings in intel#284 (route table), intel#254 (flag registry, CLI snapshot) and the cli_routes.v1 artifact from main. Resolved: - cli.py: runs and data both register; the table lists runs. - cli_routes.py: runs is a root in "Analysis and data" with runs list and runs show as free leaves. - runs/kinds.py: cli_routes.v1 gets its counted lists, so runs show and runs list handle the new artifact kind. - Tests: the expected route sections, the scan and show kind tables include cli_routes.v1. - cli-interface.json regenerated with make cli-snapshot. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Resolve conflicts in cli.py and llm.py against intel/main (72d7add). Keep both register lines (backends, data). Review fixes in this merge: - yJ-io, yJ-ir: backends command and claude-cli choices follow the intel#284 route table (cli_routes.py) and the F1a flag registry. - yKThl: judge model is refused at parse time for a CLI judge when the model is not a Claude model (exit 2 via parser.error). - yKvVP: docs say a settings-file login is a route label, not a successful credential check. - Structured 400 is not retried because its message names a retryable word; status-None branch still matches on text. - chat_completion refuses a CLI provider before any call (llm_cli.refuse_chat_completion). - Growth ratchet: llm.py, arm_runner.py and test_llm_cli.py kept under their caps; identity tests moved to test_llm_cli_identity.py. - CLI snapshot regenerated (docs/reference/cli-interface.json). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
The one-line help test can pass with no help text (the regex matches the command name plus the cost label). The fix is test-only, in #317, since this PR was merged before it could be pushed here. |
Summary
The top-level route list now comes from a table (
dokimi/cli_routes.py) instead of beingspread across the parsers. Each root sits in one section, and every route's help line ends in
[free]or[paid].paidmeans the route can make a model call in some flag combination.A root is
paidwhen any leaf under it is. This is item A1 of the CLI API v2 plan (#94 §5).sits in the section of the operation it will hold once the CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94 §4 renames land.
moved: dokimi <new command>and exits 2 without running anything. No command has moved yet, so the table is empty. The test
covers the mechanism with a test-only entry. The check treats a group, alias, or root as a live
route, so a tombstone cannot shadow the commands under it.
datais a new root withschema listandschema show KIND. M2 adds export, import and models.runandcompare, which have no parser help, takea one-line help from the table.
dokimi/changelog.d/20261028_120000_napetrov_cli-routes-table.md.Evidence
Before (tests written against the route table, behaviour not yet implemented):
After:
Self-review fixes
cf5166bc,a654a8b9and08ac435f: each adds tests that fail beforethe fix and pass after it (the alias case in
08ac435f, for example, fails ona654a8b9);the full suite was re-run after each fix.
Help diff
User-visible: yes. The top-level
dokimi --helpis regrouped into four sections, every routeline ends in
[free]or[paid],runandcompareget a help line, anddatais new. The samelabels also show in each parent's own subcommand list (for example
dokimi baseline --help). Acommand's own
--helptext does not change.Merge Danger
Door: two-way. The help layout and labels revert with one commit. The JSON printed by
data schema show cli_routes(schema_version: cli_routes.v1) becomes a public shape once released,so a later change to it should bump the version.
Blast radius: every
dokimi --helpand every parent's subcommand list. No handler, flag, or exitcode changes; the tombstone path has no entries.
Overlaps:
docs/reference/cli-interface.json) fails on the newdatagroup. WhicheverPR lands second regenerates the snapshot. Its
cli_flags.pyneeds a layer entry in the same tuple intests/test_import_architecture.pythat this PR edits, so expect a conflict there.dokimi/cli.pyand the commands.Open questions
claude-cliprovider (feat(llm): claude-cli provider: run the Q&A track on a logged-in Claude Code CLI #255) paid? The ruleused here is "paid if any model call is possible on some path".
runandcomparebelong in Subjects? Done here, per CLI API: the evaluation loop at the top level, subject and eval groups below, one enforced flag vocabulary (proposal v2.1) #94 §4.data schemascope: onlycli_routesnow. Do artifact schemas underdokimi/schemas/come inF2 or M2?
--jsonerror code: deferred to F2.Refs #94 (A1), #276.
🤖 Generated with Claude Code