Repository navigation
Conversation
… F1a) Data and tests only; no flag, default or output changes. - dokimi/cli_flags.py: each flag concept of intel#94 section 2.4 with its canonical spellings, type and banned synonyms. Nothing reads it yet (F1b moves leaves). - tests/test_cli_flags.py: walks dokimi.cli.build_parser() in ratchet mode. A spelling that is neither canonical nor allowlisted fails, a banned synonym fails with the canonical spelling named, and allowlist rows that are unused or already canonical fail, so the allowlist only shrinks. An allowlist row exempts its spelling on every command. - tests/data/cli_flags_allowlist.txt: today's non-canonical spellings, one reason per row where it is not obvious. - docs/reference/cli-interface.json: the intel#88 surface dump, regenerated by `make cli-snapshot` (venv Python). The content check runs on Python 3.13, the pinned version: the dumper hashes validators with ast.dump, which differs by version. CI's typecheck job runs it on every PR (a PR runs no 3.13 test leg); the ratchet and structural checks run on every test leg of the matrix. - tests/test_import_architecture.py: cli_flags sits in the foundation layer. - docs/contributing-cli-flags.md: how to add or rename a flag. - Internal changelog fragment. Refs intel#94 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 #254 +/- ##
=======================================
Coverage 93.48% 93.49%
=======================================
Files 272 273 +1
Lines 35363 35419 +56
Branches 6001 6013 +12
=======================================
+ Hits 33060 33114 +54
- Misses 1489 1491 +2
Partials 814 814
🚀 New features to boost your workflow:
|
antonwolfy
left a comment
There was a problem hiding this comment.
The registry, the ratchet and the snapshot step hold up, but the PR adds a docs page that pushes the docs benchmark over its cap, so make ci-local fails on the benchmark step. One bug inline (the page that crosses the cap), one nit on the registry self-check test.
What I ran, on a Linux review host at ada2d05:
make ci-local: 28 passed, 1 failed, 7 skipped. The failure isagent-quality.yml: Run benchmark(below). The newCLI snapshot is currentstep,mypy,deptry,mkdocs buildand the wheel smoke tests pass.- 9,043 tests passed, 3 skipped; changed-line coverage 90% (
cli_flags.pylines 312, 314, 320, 322, 325 are not covered). - A mutation run over the new test file and registry: 30 mutants, the ratchet and walker mutants are all killed; the five
registry_problemschecks and theCANONICAL/BANNEDtables survive.
Checked, no issues
- Snapshot: the dumper run twice gives byte-identical output, equal to the committed
cli-interface.json, with no host paths in it. The CI step's working directory,PYTHONPATHand Python 3.13 match the snapshot'sast.dumphashing. - Ratchet: every option on
build_parser()is canonical or allowlisted; all 194 allowlist rows are used, none duplicated; unused and now-canonical rows fail, as do banned synonyms that are not allowlisted. - Layering and docs:
dokimi.cli_flagssits in the foundation layer andtest_import_architecture.pypasses; the new page is inmkdocs.ymlnav anddocs/README.md.
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
antonwolfy
left a comment
There was a problem hiding this comment.
I pushed a commit per nit, up to f309ca5, which fix the nit from my review:
f309ca5:dokimi/dokimi/cli_flags.py:305:registry_problemstakes the concepts as an argument (defaultCONCEPTS), anddokimi/tests/test_cli_flags.pyadds one case per check asserting the message.
make ci-local at f309ca5: 28 passed, 1 failed, 7 skipped.
GitHub CI has not run on these commits: the branch conflicts with main, and Actions runs no workflow on a conflicting PR. CI will check them once main is merged in.
Not approving yet. Still open: the bug from my review.
…flag-registry Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> # Conflicts: # dokimi/tests/test_import_architecture.py
The new page made the 33rd Markdown file under docs/, past the docs benchmark's max_docs of 32. The how-to now lives in a section of CONTRIBUTING.md under "Adding things"; the page, its nav entry and its docs/README.md entry are removed. max_docs is unchanged. Thread: PRRT_kwDOVBg7g86xE1Df Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…obe strict Main now has flags the registry does not know: catalog trigger-probe's --claude, --sealed, --listing-budget-fraction and --trials (intel#217), and novelty routing's --all-vs-all, --include-disabled and --queries-by-skill (intel#172). Each gets an allowlist row with its reason. --trials is a banned synonym of reps; renaming it would change a shipped command, so it waits for the F1b migration. The banned-synonym probe in test_cli_flags.py used --trials, which is now allowlisted, so the probe would pass for the wrong reason. It runs with that row removed instead. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Written by make cli-snapshot on the pinned interpreter; no hand edits. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
There is no Internal category in scriv's configuration; the fragment now uses Documentation, the existing category for contributor-facing docs. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
f309ca5 makes registry_problems take the concepts and adds one case per check (tests/test_cli_flags.py), so each of the five checks is shown to fail. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
catalog trigger-probe's own --trials produces the same message, so the probe passed whether or not the injected dokimi run leaf was walked. The assertion now requires the message to name dokimi run. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
vchamarthi
left a comment
There was a problem hiding this comment.
Review: Needs fixes before merge
Adds a CLI flag registry (concepts, canonical spellings, banned synonyms) and a ratchet contract test over the CLI tree, plus the #88 interface snapshot regenerated. Data only: no command reads the registry yet.
Blocking
dokimi/benchmarks/spec.v1.yaml:83: this PR adds a 33rd markdown page underdocs/whilegolden_manifest.max_docsstays at 32, so the benchmark step raisesgolden_manifest violation: matched 33 document(s) ... more than max_docs=32on the file's own stated rule (raise max_docs in the same commit that adds the doc). Fix: bumpmax_docsto 33 in this PR.- merge conflict with
main: this PR cannot merge as is and needs a rebase or merge-conflict resolution against the currentmainbranch, independent of the review findings below.
Earlier review threads
| Status | Count | Threads |
|---|---|---|
| Fixed, with a test | 1 | untested registry_problems branches (now parametrized, 5 cases) |
| Still open | 1 | docs golden_manifest max_docs vs 33rd doc |
CI
| Check | Result | Cause |
|---|---|---|
| benchmark / Run benchmark | fail | introduced (max_docs, same as the open thread above) |
| static / schema_compat vs the PR base | fail | pre-existing on the merge base (no schema file in this PR's diff) |
| test / Run tests | fail | pre-existing (3 failures, none in files this PR touches: two need an optional dependency not installed, one is a flaky timeout) |
| pip-audit | fail | pre-existing (known CVEs in a transitively pinned package, unrelated to this PR) |
| everything else (lint, type check, CLI snapshot check, coverage, package/install smoke, docs build, CLI surface diff) | pass |
This PR also has a merge conflict against main that must be resolved before it can land.
Lines outside the diff, so listed here:
dokimi/benchmarks/spec.v1.yaml:83: blocking (still open from @antonwolfy): max_docs is still 32 while this PR's new page (docs/contributing-cli-flags.md) brings the matched set to 33.
This line's own comment (above, line 80) says to raise max_docs in the same commit that adds a doc. The benchmark step fails with golden_manifest violation: matched 33 document(s) under .../dokimi, more than max_docs=32. include=['docs/**/*.md'] exclude=['docs/archive/**'].
Suggested fix:
max_docs: 33
dokimi/tests/test_cli_flags.py:144: Fixed (was raised by @antonwolfy): registry_problems now takes a concepts argument (default CONCEPTS), and test_registry_problems_flags_each_inconsistency exercises each of the 5 inconsistency checks with a two-concept fixture, asserting the exact message. The earlier gap (only the real registry was exercised, so a dropped check still passed) is closed.
|
Re the review "Not approving yet" by antonwolfy: the one open item was the docs-page cap. It is fixed in 46bed29: the page is removed, its how-to is a section of Declined: raising |
|
Reply to the "Needs fixes" review, on head 393b7a5. Blocking: Blocking: merge conflict with Earlier thread: untested |
…flag-registry Signed-off-by: Petrov, Nikolay A <nikolay.a.petrov@intel.com>
The nit this review reports (registry_problems takes the concepts) is in f309ca5. Signed-off-by: Petrov, Nikolay A <nikolay.a.petrov@intel.com>
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. The docs page that crossed max_docs is gone, its how-to is a section of CONTRIBUTING.md, and the golden set is back at 32 documents against max_docs: 32. The new allowlist rows and the regenerated snapshot match the tree after the merge of main.
What I ran, on a Linux review host at 33d8ff2:
make ci-local: 27 passed, 2 failed, 7 skipped.tests/test_cli_flags.pyandtests/test_import_architecture.pypass.pip-auditfails onfilelock==3.32.7in the lock files, which this PR does not touch.Run testshas one failure,tests/test_reference_checks.py::test_the_regex_limit_is_shared_by_every_pattern_of_one_check, a wall-clock bound (4695.04 - 4693.45 < 1.5) that passes when run alone; the PR does not touch that file.- A mutation run over
cli_flags.pyand the new test file: 21 mutants. Theregistry_problemschecks, canonical renames and the walker are killed. - The snapshot dumper on Python 3.13, run on a clean export of the head: byte-identical to the committed
cli-interface.json.
Checked, no issues
- Docs cap:
docs/**/*.mdwithoutdocs/archivecounts 32; nothing in the tree still namescontributing-cli-flags.md. - Banned-synonym probe: it now runs with the
--trialsrow removed and requires the message to start withdokimi run:, so catalog trigger-probe's own--trialscannot satisfy it. - Sign-off: every non-merge commit carries a
Signed-off-by.
|
@napetrov merged into the current
The PR's checks ran before |
Dismissing until the failure above is fixed: merged into the current main (0a63f4e) this PR fails 2 test(s). I'll review again after that.
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 8 selected item(s). Review details
|
…apshot After main moved to 0a63f4e and then f0f95a2, the ratchet saw seven spellings that are neither canonical nor allowlisted (--outcomes, --contract, --shell of context consistency; --pass-k, --path-stability of repo compare; --threads, --prompt-file of repo tasks replay), and the committed cli-interface.json was stale. Add one allowlist row per spelling with its reason and run `make cli-snapshot`. Both tests were red on the merged tree and are green. Thread: IC_kwDOVBg7g88AAAABgzGjEw Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
Re "Needs fixes before merge". (a) |
|
Thanks. Nothing in this review asks for a change. The snapshot and allowlist state after |
|
Codecov report (IC_kwDOVBg7g88AAAABf5EGHA): it reports no problem, so no change. |
|
Reproduced after merging |
|
OpenCodeReview summary (IC_kwDOVBg7g88AAAABg1-kkg): 0 findings, so no change. |
Refs #94 (§5 stage F1a). Draft: D10 is still under review. No flag, default or output changes; the numbers are unchanged.
Summary
Scope is the registry and its checks only.
cli_flags.pyis read by no command; F1b moves each leaf onto it and tombstones old spellings.Review round (f309ca5 → this head)
docs/contributing-cli-flags.md(the 33rd Markdown file underdocs/, pastmax_docs: 32) is now a section ofCONTRIBUTING.md. The page, itsmkdocs.ymlnav entry and itsdocs/README.mdentry are gone.max_docsis unchanged:docs/**/*.mdcounts 32.intel/mainis merged in. Main gained flags the registry did not know:catalog trigger-probe(--claude,--sealed,--listing-budget-fraction,--trials, feat(catalog): trigger-probe in real Claude Code; payload leak audit #217) andnovelty routing(--all-vs-all,--include-disabled,--queries-by-skill, feat(novelty): routing takes the catalog field, skips disabled and mirrored skills, adds all-vs-all #172). Each has an allowlist row with its reason. The snapshot is regenerated withmake cli-snapshot.--trialsis a banned synonym ofreps. The earlier table here asked for a rename to--reps; this PR does not do it, because renaming a shipped flag changes the CLI. It stays on the allowlist until F1b.test_a_new_banned_synonym_fails_and_names_the_registry_spellingused--trials, which is now allowlisted, so it runs with that row removed.registry_problemsuntested per check) was fixed in f309ca5 and is pinned by one test per check.Friction for flag-adding PRs
make cli-snapshotand commit the JSON.An allowlist row exempts its spelling on every command, not only the one it was added for. A new command may therefore use an allowlisted banned spelling without failing. F1a accepts this: the check does not stop an allowlisted banned spelling from spreading to new commands. Keying the allowlist on (command, option) would close that gap; it is left for F1b. Adding an allowlist row is a review decision; the test does not check that a new row has a reason.
Open PRs that add flags (#155 is the only one still open; #172 and #217 merged and are now on the allowlist): #155 adds
--arm --contract --json --outcomes --pass-k --path-stability --shell --threshold.--outcomes,--contract,--shell,--pass-kand--path-stabilityneed one allowlist row each when #155 rebases onto this branch.Evidence
Temporary edit to
dokimi repo scan(reverted):--probe-flag(not in the registry) and--trials(banned forreps). Excerpt of the failing run (messages wrapped here, otherwise verbatim):After merging main and before this round's fixes, the ratchet failed on the seven flags above and the snapshot was stale (
2 failed, 9 passed). With the rows added and the snapshot regenerated, the banned-synonym probe still failed (1 failed, 15 passed), because--trialsis now allowlisted; the probe now runs without that row. After this round:pytest tests/test_cli_flags.py tests/test_import_architecture.pygives37 passed.make ci-localon 393b7a5 (box run,TMPDIR=/tmp/...): every gate passes except two.pip-audit: CVEs againstfilelock==3.32.7, which main pins; this PR changes no dependency file, so it is inherited. The test step:2 failedon the first run (AF_UNIX path too longunder this box's long scratch path, and an unraisable socket warning), and both pass alone. The full suite on this head,pytest -n auto, gives9707 passed, 5 skipped.Merge Danger
Door: two-way. Test, data, docs and CI-step only; no runtime path imports
cli_flags. Reverting the commits removes the registry, the snapshot and the typecheck step.Blast Radius: CI. A PR that changes the CLI surface must regenerate the snapshot (the
typecheckstep fails it otherwise). Two open PRs that each change the surface can both pass CI against an older main and merge one after the other: main then holds a stale snapshot and thetypecheckstep goes red until someone regenerates it. Nearby edits to the 13k-line JSON also conflict. Branch protection with "require branches to be up to date" closes the first gap; it is not configured here. Thecli-interfaceworkflow (#88) is unchanged and report-only.Changelog: the fragment is filed under
Documentation, the existing category for contributor-facing docs. scriv's configured categories (pyproject.toml) have noInternal. Thechangelog.d/README.mdroute for internal changes is theskip-changeloglabel; a maintainer may prefer that.🤖 Generated with Claude Code