Skip to content

test(cli): the flag contract checks what a flag means, not only its spelling - #844

Merged
napetrov merged 25 commits into
intel:mainfrom
napetrov:arch/c12n
Nov 25, 2026
Merged

napetrov merged 25 commits into
intel:mainfrom
napetrov:arch/c12n

Conversation

@napetrov

@napetrov napetrov commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The flag contract (tests/test_cli_flags.py) now compares what a canonical flag means on every leaf, not only its spelling:

for each canonical spelling on each leaf (registry row vs parser)
  switch vs value        flag.kind == "flag"  vs  nargs == 0
  metavar                flag.value           vs  explicit metavar (including M [M ...] for nargs="+")
  choices                flag.kind == "choice" vs  action.choices
  type                   flag.kind            vs  action.type (int, float, usd)
known clashes            MEANING_EXCEPTIONS[(leaf, spelling, aspect)] = (observed value, reason)

Evidence

  • The contract, flag-move and documentation-reference suites passed after syncing with main at a9d73a27c2 (230 tests). Replacing the catalog trigger-probe timeout converter with str escaped detection before the fix and now fails the contract. Ruff and mypy both pass on the changed test.
  • Golden CLI capture (help text of every route and a parse grid) before and after: identical once the timestamped run_id is normalised. No parser, default or help change.

Merge Danger

Door: two-way. Registry data and a test; no runtime code path changes.

Blast Radius: contributors only. A new flag that clashes with its registry row now fails test_every_registered_flag_has_one_meaning_on_the_tree until it is fixed or listed in MEANING_EXCEPTIONS.

Follow-ups: --judge P/M (#94 F1b); the other clash rows (--from, --format, --arm, --cache, --network, --questions) are F1b work; repeatability and banned-spelling meaning are not checked yet.

🤖 Generated with Claude Code

…pelling

The registry compared option strings only. Each use of a canonical spelling
is now compared with its registry row: a switch or a value (kind), the
metavar when one is set, choices (kind `choice`), and the type for the
int, float and usd kinds. Known clashes are listed in MEANING_EXCEPTIONS
with a reason; a row that stops clashing fails, as the allowlist does.

--judge is a switch in arms run, arms matrix-run and subjects run and a
PROVIDER/MODEL elsewhere: the clash issue intel#94 names (sec. 2.4, D10),
allowlisted until F1b. --context-framing is declared as a choice, which its
parsers already are. No parser, default or help text changes.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov
napetrov requested a review from a team as a code owner November 16, 2026 21:55
@exai-bot

exai-bot commented Nov 16, 2026 •

Copy link
Copy Markdown

OpenCodeReview: Commit 24c091b was not reviewed. This PR has reached its review limit (6 reviews).

CI at `24c091b`: 10 still running, 2 passing, 2 skipped
Check Status
Build docs (strict) still running
CLI interface diff still running
CodeQL (actions) still running
CodeQL (python) still running
External catalog smoke test (uxlfoundation/skills) still running
Platforms and Python versions still running
Static checks (ruff, schema, zizmor, licenses, pre-commit, bandit, secrets, changelog, schema com... still running
Windows smoke test (py3.13) still running
benchmark still running
mypy still running

To review this commit: re-request review from exai-bot in the Reviewers list.

<details><summary>Last review (e21e925): no findings</summary>

Open threads from the bot: 0

</details>

@codecov-commenter

codecov-commenter commented Nov 16, 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.05%. Comparing base (c8eb518) to head (24c091b).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #844      +/-   ##
==========================================
- Coverage   96.06%   96.05%   -0.02%     
==========================================
  Files         475      475              
  Lines       62888    62888              
  Branches    10889    10889              
==========================================
- Hits        60414    60407       -7     
- Misses       1528     1531       +3     
- Partials      946      950       +4     
Files with missing lines Coverage Δ
dokimi/dokimi/cli_flags.py 100.00% <ø> (ø)

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

Review at 5f0fcf6. The meaning check works and runs on the real tree. Every clash it finds today is either fixed in the registry (--context-framing) or listed with a reason. The two gaps are in the line comments, and neither blocks the merge.

What I ran, at 5f0fcf6:

  • make ci-local --offline: 22,194 passed, 0 failed, 72 skipped; all checks pass.
  • tests/test_cli_flags.py on this branch merged into current main and then with each open PR that touches cli_flags.py (#489, #849, #838, #811, #783): 23 passed every time, so none of them adds a new clash.
  • I listed every use of a registry flag on the tree to see what each aspect checks.

Checked, no issues

  • Exceptions: each one matches a real clash on the tree. A stale row, a row with no reason and a clash with no row each fail the test.
  • Metavar: it is compared only when a leaf sets one, which avoids false clashes from argparse's default DEST metavar. The docstring says so.
  • Changelog: an internal-only change, under the right category; no CLI, default or help text changes.

Comment thread dokimi/tests/test_cli_flags.py Resolved
Comment thread dokimi/tests/test_cli_flags.py Resolved

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

🟡 Not approved yet · reviewed 5f0fcf6

Next: @napetrov: settle 1 open question (below). 3 nits optional.

Blocking

  • Open question for @napetrov: --timeout is declared text in dokimi/dokimi/cli_flags.py:239, but repo reach, repo run and repo skill-reach parse it as positive_int and catalog trigger-probe as float. Give the row the kind the four leaves share, or keep text and say in the tests/test_cli_flags.py docstring that text rows are not type-checked.

Nits

  • dokimi/CONTRIBUTING.md:275 – The contributor guide says the ratchet compares spellings only; the test now compares switch or value, metavar, choices and int, float and usd types.

    Input: the sentence at line 275, The ratchet compares spellings only: a reviewer checks that the option's type matches the kind of its concept. Head: meaning_clashes in tests/test_cli_flags.py also compares switch or value, metavar, choices, and the types of int, float and usd rows. Expected: the sentence names what the ratchet compares now and what a reviewer still checks.

    Suggestion: Replace the sentence with: The ratchet compares spellings, switch or value, metavar, choices, and the int, float and usd types; a reviewer checks the other kinds.

    Patch, run on 5f0fcf6: the quoted text is gone; tests are no worse.

    Patch
    --- a/dokimi/CONTRIBUTING.md
    +++ b/dokimi/CONTRIBUTING.md
    @@ -272,8 +272,10 @@
     - **Snapshot.** From `dokimi/`, after `make dev`, run `make cli-snapshot` and commit
       `docs/reference/cli-interface.json` with the change. CI's `typecheck` job and
       `tests/test_cli_flags.py` check it against the code, so a flag change without a
    -  regenerated snapshot fails the PR. The ratchet compares spellings only: a reviewer checks
    -  that the option's type matches the `kind` of its concept.
    +  regenerated snapshot fails the PR. The ratchet compares spellings, and for each use of a
    +  canonical spelling its switch or value, metavar, choices and, for `int`, `float` and `usd`
    +  kinds, its type. A reviewer checks that the type of every other kind matches the `kind` of
    +  its concept.
     - **Non-canonical spelling.** Only if the flag must keep it, add one row to
       `tests/data/cli_flags_allowlist.txt` with the reason after `#`, for example
       `--sample-size  # the spelling the external runner already passes`. An allowlist row

Verified on 5f0fcf6: ✅ changed tests: 23 passed, fail on main · ✅ full suite with main merged in: 22223 passed · ✅ merges onto main · 6 mutations tried · 3 edge inputs tried

16 checks behind it, each with its evidence
Area What holds How
Context-framing row --context-framing is declared choice, which its parser matches (choices on dokimi/commands/novelty.py:637); declaring it text fails the tree check broke the code, tests caught it
Int type aspect Narrowing the int kind to int alone fails the tree check on the positive_int rows broke the code, tests caught it
Switch aspect A switch where the kind takes a value, and a value where it takes a switch, is reported; with that check removed the suite fails broke the code, tests caught it
Stale exception row A MEANING_EXCEPTIONS row that no longer clashes fails; with that check removed the suite fails broke the code, tests caught it
Empty exception reason An exception row with a blank reason fails; with that check removed the suite fails broke the code, tests caught it
Exception count Eleven known clashes are listed in MEANING_EXCEPTIONS, as the description says ran it
Repeatability Use has no repeatability field, so a flag's repeatability is not compared, as the description says ran it
Metavar text A metavar is compared as exact text: "", " N", "N ", "N\r\n" and "n" each give one metavar clash against N, and "N" gives none ran it, edge input (text)
Unset metavar A use with no metavar set (None) gives no metavar clash, so the registry value is not compared for it ran it, edge input (none)
Tuple metavar A tuple metavar is joined with a space before the comparison, so ("PROVIDER", "MODEL") clashes with PROVIDER/MODEL ran it, edge input (tuple)
Banned spellings A banned spelling is not in the canonical map, so --max-tokens gives no meaning clash, as the description says ran it
Evidence count The three flag test files give 110 passed on the head, as the description says ran it
Changed tests The 23 tests of tests/test_cli_flags.py pass on the head, including the tree-wide meaning check, the leaf-scoped --judge case and the --context-framing row tests on the head
New tests on main The tree-wide meaning check and the leaf-scoped --judge case fail on main same tests on main
Full check run The full repository check run passes with the PR merged onto main, including the CLI snapshot and mypy, so no flag, default or help text changes full suite, main merged in
Merge The PR merges onto main with no conflict merge onto main

Comment thread dokimi/tests/test_cli_flags.py Resolved

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

Review at 5f0fcf6. I found no new problems in the diff. The merge waits for the author's answer to @vchamarthi's question on --timeout: the registry declares it text, four leaves parse it as positive_int or float, and the contract checks none of them.

@vlad-perevezentsev's point that choices is compared only for presence, not for the listed values, also waits for the author's choice between comparing the sets and documenting the gap.

I agree with @vchamarthi's points on the changelog wording, the missing usd/float type case, and the stale sentence at dokimi/CONTRIBUTING.md:275 (outside this diff), which still says the ratchet compares spellings only.

What I ran, on a Linux review host at 5f0fcf6:

  • make ci-local: 34 passed, 0 failed, 14 skipped; changed-line coverage measured 0 lines (registry data and tests only).
  • tests/test_cli_flags.py: 23 passed. With test_cli_flag_moves.py and test_cli_skill_catalog_moves.py: 110 passed, as the description says.

Checked, no issues

  • Commits: the one commit carries a Signed-off-by.
  • Behaviour: the CLI surface dump reports no user-facing change; --context-framing is declared choice and its parser already passes choices.
  • Exceptions: the tree check passes, so each of the eleven rows matches a real clash.

Main replaced usd_amount with cli_types.positive_usd on --max-usd (intel#872),
so on the merged tree the flag-meaning check flags eight leaves. Accept
positive_usd for the usd kind; usd_amount stays until this branch is on
main. The new test fails when positive_usd is dropped or a bare float passes.

Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
@xaleryb

xaleryb commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Adds a case where a float row with an int use reports a type clash, so
skipping the type comparison for non-int kinds fails the suite. The
changelog fragment and the cli_flags docstring say the type is compared
for int, float and usd rows only.

Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
@vchamarthi

Copy link
Copy Markdown
Contributor

🟡 Waiting on @napetrov · 1 commit on arch/c12n (2bf1951..7ae3cd5)

Next: @napetrov: answer the 2 questions below.

Changes

  • tests/test_cli_flags.py: a float row with an int use is reported as a type clash and pinned by a test.

Needs @napetrov

  1. For choices, should the contract compare the value set when the registry value names it (a|b or {a,b}), or only document that values are not compared? (dokimi/tests/test_cli_flags.py:217)
    A leaf with choices=["native", "none", "auto"] for --delegation (native|none), or one that drops neutral from --context-framing, passes today; only presence of choices is compared. Comparing sets needs a parser for the value text, so it is a scope choice.
    • A: Compare the set for a|b and {a,b} rows and keep FORMAT-style rows on the presence check.
    • B: Keep the presence check and say in the docstring and the changelog that values are not compared.
  2. For --timeout (registry kind text, value [PHASE=]SEC), which should the contract do: give it kind int and allow positive_int and float, or list catalog trigger-probe, repo reach, repo run and repo skill-reach in MEANING_EXCEPTIONS? (dokimi/tests/test_cli_flags.py:158)
    _TYPES_BY_KIND has no row for text, so the four leaves that parse --timeout as positive_int or float are not compared. Either way changes what the registry says about --timeout, which is the author's call.
    • A: Kind int with positive_int and float allowed: the contract checks the type, but PHASE=SEC stays undeclared.
    • B: Four MEANING_EXCEPTIONS rows with a reason: the clash is listed and F1b settles the kind.

Threads and comments

  • 2 fixed; each answered in its thread.
  • Not a defect (comment by @xaleryb): rebase on main so the checks see refactor(cli): one cli_types module for the copied argparse type= validators #872 – The branch merges with main without a conflict, so no merge commit is needed; test_a_usd_flag_takes_the_cli_usd_types_and_not_a_bare_float already accepts positive_usd.
  • Not a defect (comment by @xaleryb): drop the dead usd_amount after the rebase – On the head usd_amount is still the parser type in commands/skill_coverage.py:138 and commands/novelty_run.py:84, so the row is not dead here; it can go when the branch takes main.

Not this PR's

  • Outside this PR: dokimi/CONTRIBUTING.md:275 – Says "The ratchet compares spellings only", but the contract now also compares switch or value, metavar, choices and type.

Verified on the new head: ✅ tests of the fix: 1 passed · ⚠️ 1 answered as fixed without a test that shows it · ✅ full suite with main merged in: 23304 passed · ✅ second reader: nothing raised

What each test shows
  • float row with an int use reports a type clash; the code already did, the test is new and fails when the type comparison is limited to int rows: passes.
  • Left to GitHub's own checks: agent-quality.yml:external-catalog-smoke, ci.yml:static / pre-commit, ci.yml:static / Install gitleaks, ci.yml:static / Scan commits, ci.yml:fidelity / Install the pinned Claude Code, ci.yml:test-latest, ci.yml:package-smoke, ci.yml:windows-smoke.

@xaleryb

xaleryb commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Update at 7ae3cd5 (CI green):

  • Settled since our comment: 7ae3cd5 pins the float type clash (test_a_float_flag_takes_float_and_not_an_int), and the fragment and the cli_flags docstring now say the type is compared for int, float and usd rows only. Together with 2bf1951 (positive_usd in the usd kind) the merged tree is green on refactor(cli): one cli_types module for the copied argparse type= validators #872's types.
  • Still open, both from vlad-perevezentsev:
    • test_cli_flags.py:217: the choices aspect checks only that a leaf has choices, not that they are the ones the registry row lists (--delegation with an extra auto passes).
    • test_cli_flags.py:158: --timeout (kind text, value [PHASE=]SEC) is not type-checked on any leaf, and no leaf accepts PHASE=. Our earlier recommendation stands: kind int, with positive_int and float allowed.

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

Thread: PRR_kwDOVBg7g88AAAABYnuUlA.c

Thread: IC_kwDOVBg7g88AAAABn5X8Nw.c
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: IC_kwDOVBg7g88AAAABn2Ru9A
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g864am1y
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g864am1y
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by vlad-perevezentsev

The two gaps are in the line comments.
Explicit choice lists now compare as sets in e9d056a. Waiting on a decision before I change this: track the timeout leaves with F1b exceptions or give them a dedicated kind now? I recommend the exceptions.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by vchamarthi

Give the row the kind the four leaves share, or keep text and say in the docstring that text rows are not type-checked.
Waiting on a decision before I change this: keep the unchecked kind with explicit F1b tracking, or add a dedicated timeout kind? I recommend tracking it for F1b. The contributor guide now describes the checks in cbe1390.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by antonwolfy

The merge waits for the author's answer on --timeout.
Waiting on a decision before I change this: track the three integer leaves and the float leaf as F1b exceptions, or introduce a timeout kind now? I recommend tracking them. The guide now lists the checked aspects in cbe1390.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: comment by xaleryb

Then drop the dead usd_amount.
Merged main and removed usd_amount in 4dbf04e.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: comment by vchamarthi

Should the contract compare the value set when the registry names it?
It now compares explicit sets in e9d056a. The guide was updated in cbe1390. Waiting on a decision before I change this: track the four timeout leaves for F1b or model a dedicated kind now? I recommend tracking them.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: comment by xaleryb

--timeout is not type-checked on any leaf.
Waiting on a decision before I change this: should the numeric leaves get four F1b exceptions, or should the registry add a timeout kind now? I recommend the exceptions. The choices check now compares enumerated sets in e9d056a.

@napetrov

Copy link
Copy Markdown
Contributor Author
  • The flag ratchet compares explicit choice sets in e9d056a. Regression cases cover an extra value, a missing value and an empty set (9317cdd).
  • The contributor guide lists the checks in cbe1390. The USD type check now uses the converters present on main in 4dbf04e.
  • The open question is how to represent the four numeric --timeout uses for F1b. I recommend tracking them as exceptions until F1b settles the shared interface.

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

🔴 Changes needed: 1 must-fix (outside the diff), 1 earlier finding still fails, 1 nit · re-reviewed 9317cdd

Next: @napetrov: fix the 1 must-fix finding and the 1 earlier finding below and answer 1 open thread from vlad-perevezentsev; then push for a re-review. 1 nit optional.

Outside the diff (1): on lines this PR does not change, so GitHub takes no line comment there
  • 🔴 Must fix dokimi/CONTRIBUTING.md:273 – A count from 0 declared int with non_negative_int, the type this guide names, is reported as a type clash.

    Input: --n declared kind int with parser non_negative_int, and --r declared kind float with parser unit_interval, through meaning_clashes. Head: both give a type clash, kind int takes int or positive_int and kind float takes float. Expected: no clash, since this sentence says a count from 0 and a share take their type from dokimi/cli_types.py. The _TYPES_BY_KIND rows (tests/test_cli_flags.py:156-157) list only int, positive_int and float, so the guide and the contract disagree.

    Also at: dokimi/tests/test_cli_flags.py:156, dokimi/tests/test_cli_flags.py:157.

    Suggestion: Add non_negative_int to the int row and unit_interval and positive_fraction to the float row of _TYPES_BY_KIND, or reword this sentence to name only the types the contract takes.

    Patch, run on 9317cdd: the failing case passes; tests and lint are no worse.

    Patch
    --- a/dokimi/tests/test_cli_flags.py
    +++ b/dokimi/tests/test_cli_flags.py
    @@ -153,7 +153,7 @@
     
     # Types a parser may use for each registry kind. A kind not listed takes any type.
     _TYPES_BY_KIND: Mapping[str, frozenset[str]] = {
    -    "int": frozenset({"int", "positive_int"}),
    +    "int": frozenset({"int", "positive_int", "non_negative_int"}),
         "float": frozenset({"float"}),
         "usd": frozenset({"positive_usd", "_usd"}),
     }
    @@ -327,7 +327,7 @@
         text = [what for _leaf, _option, _aspect, what in meaning_clashes(found, concepts)]
         assert text == [
             "has metavar `SEED`, the registry says `N`",
    -        "has type `str`, kind `int` takes int or positive_int",
    +        "has type `str`, kind `int` takes int or non_negative_int or positive_int",
             "is a value here, but the registry kind is `flag`",
             "has no choices, but the registry kind is `choice`",
             "has choices, but the registry kind is `text`",

Blocking

  • Still fails: earlier finding – --timeout on repo reach with a positive_int parser still gives no type clash on the head, so the question on the --timeout row stays open.
  • Still holds on this head: thread by @vlad-perevezentsev – --timeout (kind text) with a positive_int parser on repo reach gives no type clash on the head, so the four numeric leaves are not checked.

Verified on 9317cdd: ✅ changed tests: 32 passed, fail on main · ✅ full suite with main merged in: 23561 passed · ✅ merges onto main · 2 mutations tried · 1 edge input tried

9 checks behind it, each with its evidence
Area What holds How
Changed tests on head The 32 tests in tests/test_cli_flags.py pass on the head, including the tree-wide meaning check and the leaf-scoped --judge case tests on the head
Changed tests on main On main, test_every_registered_flag_has_one_meaning_on_the_tree and test_a_new_use_that_clashes_fails_and_an_exception_is_leaf_scoped fail same tests on main
Merge The PR merges onto main with no conflict merge onto main
Full repository run The full repository check run with main merged in passes: 23561 passed, 0 failed full suite, main merged in
Context-framing choice set Changing the registry value of --context-framing to reference|neutra fails 2 tests, so the tree check pins the choice set broke the code, tests caught it
Registry value parsing _registered_choices gives an empty set for "" and " ", and the stripped sets for {ß, x} and native|none\r\n ran it, edge input (text)
Enumerated choice sets --delegation registered as native|none, with an extra auto choice on the parser, is reported as a choices clash ran it
Known clashes MEANING_EXCEPTIONS lists eleven known clashes ran it
Flag test files tests/test_cli_flags.py, tests/test_cli_flag_moves.py and tests/test_cli_skill_catalog_moves.py pass together on the head ran it

Comment thread dokimi/tests/test_cli_flags.py Resolved
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g865L_rR
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRR_kwDOVBg7g88AAAABY4Xo7w.a
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRR_kwDOVBg7g88AAAABY4Xo7w.a
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by vchamarthi

A count from 0 declared int with non_negative_int ... is reported as a type clash.
a397d8d covers all three constrained converters. Waiting on a decision before I change this: track the four numeric leaves as exceptions for F1b, or give --timeout a dedicated kind now? I recommend tracking the four exceptions.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by antonwolfy

The merge waits for the author's answer on --timeout.
The contributor guide lists the checked aspects. Waiting on a decision before I change this: track the four numeric leaves as exceptions for F1b, or give --timeout a dedicated kind now? I recommend tracking the four exceptions.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: comment by vchamarthi

Should the contract compare the value set when the registry names it?
Explicit value sets are checked in e9d056a. Waiting on a decision before I change this: track the four numeric leaves as exceptions for F1b, or give --timeout a dedicated kind now? I recommend tracking the four exceptions.

@napetrov

Copy link
Copy Markdown
Contributor Author

a397d8d recognizes the numeric converters for counts and shares. The choice regression covers whitespace. The existing author question concerns how to model the four numeric --timeout leaves.

Comment thread dokimi/tests/test_cli_flags.py Resolved
Thread: PRRT_kwDOVBg7g866bmqH

PRR_kwDOVBg7g88AAAABY4Xo7w.a: Verified that the accepted numeric converter cases still pass, including the recorded float exceptions. The separate timeout question remains open.

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.

@napetrov: fix the 1 earlier finding that still fails, fix what vlad-perevezentsev's thread on dokimi/tests/test_cli_flags.py:159 still finds and settle 1 open question, then push for a re-review. 1 nit in line comments is optional.

  1. Still fails: earlier finding: --timeout on repo reach with a positive_int parser gives no type clash and no exception row on the head.

Open threads and questions:

  • thread on dokimi/tests/test_cli_flags.py:159 by vlad-perevezentsev: still holds on this head. --timeout (kind text) is not type-checked on any leaf: repo reach with positive_int gives no type clash and has no exception row on the head.
  • Open question for napetrov: A choice row whose value starts with { but does not end with }, such as {warn,fail, gives an empty set, so no choices are compared and no clash is reported (dokimi/tests/test_cli_flags.py:210). Make such a value a registry_problems error, or document in a docstring on _registered_choices that a value which is neither {...} nor a|b is only checked for presence.

Also holding approval:

  • The type check reports new errors in the changed files.

Re-reviewed at e21e925: changed tests: 41 passed, fail on main; full suite with main merged in: 24541 passed, its only failures are main's too; merges onto main; 2 mutations and 3 edge inputs tried.

Comment thread dokimi/tests/test_cli_flags.py Resolved
…-844

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

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 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 · re-checked e21e925

To fix: merged with current main the meaning test fails on flags added there since the base (line comment). Also settle --timeout: I answered your question in its thread.

✅ make ci-local --offline: 24,453 passed · ⚠️ schema_compat fails from main's schema changes, not from this PR · ❌ test_cli_flags.py on the merge with main: 6 failed, 153 passed · ✅ --timeout as kind int with one trigger-probe row: 134 passed

The earlier points are fixed; exceptions now pin the value they cover, so a changed choice set is caught.

Agreed with @vchamarthi: an unclosed {warn,fail value is checked only for presence; the native | none trim case.

Comment thread dokimi/tests/test_cli_flags.py Resolved
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Three repo leaves parse positive integer seconds. The catalog probe accepts fractional seconds. Record that one exception so a changed converter on any of the four leaves fails.

Thread: PRRT_kwDOVBg7g864am17
PRR_kwDOVBg7g88AAAABZiMC4Q
PRR_kwDOVBg7g88AAAABZsl7Mg
PRR_kwDOVBg7g88AAAABYnuUlA
IC_kwDOVBg7g88AAAABn5X8Nw
IC_kwDOVBg7g88AAAABn6pPIw

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
c215547 interprets argparse repeated metavars and 07a0ae4 records the observed file-only repo scan baseline. Both survive the merge of current main.

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

Copy link
Copy Markdown
Contributor Author

Re: review by vchamarthi

The type check reports new errors in the changed files.
Mypy passes. All four timeout leaves and the spaced pipe value are covered.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by vlad-perevezentsev

Also settle --timeout
Current converter types are checked, with one float exception. The planned phase prefix in #94 is retained for F1b. Token budgets and the scan baseline pass on merged main.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: review by antonwolfy

The merge waits for the author's answer
The registry now checks integer seconds. catalog trigger-probe explicitly accepts fractional seconds. Enumerated choice rows check their listed values.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: comment by vchamarthi

Should the contract compare the value set
Yes. Enumerated rows compare sets. --timeout now checks integer seconds on the repo leaves, with one exception for fractional seconds on catalog trigger-probe.

@napetrov

Copy link
Copy Markdown
Contributor Author

Re: comment by xaleryb

--timeout is not type-checked on any leaf.
It is checked on all four leaves now. The three repo leaves use integer seconds. The catalog probe has a value-specific float exception.

@napetrov

Copy link
Copy Markdown
Contributor Author

a7dc23d checks the three integer timeout converters and the catalog probe’s fractional-seconds exception. c215547 and 07a0ae4 handle the repeatable token-budget metavar and the file-only repo scan baseline. The contract, flag-move and documentation-reference tests pass (230 tests).

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

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

🟢 LGTM · re-checked 24c091b · nothing required from @napetrov

🔀 Merge: safe now · merges cleanly into current main, 12 commits behind, and its tests pass on the merge · no open PR conflicts with it; with #1158, #1147 or #1132 on top the meaning test still passes

✅ make ci-local --offline: 27,097 passed · ✅ test_cli_flags.py, test_cli_flag_moves.py, test_docs_code_refs.py on the merge with main: 234 passed

The earlier points are fixed; each exception now pins the value it covers, --timeout included.

@napetrov
napetrov merged commit 6b3e3ac into intel:main Nov 25, 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