Skip to content

fix: drop unused cli_flags tables, pin checks from #155 and #238 - #303

Merged
antonwolfy merged 1 commit into
intel:mainfrom
antonwolfy:test/leftovers-2026-10-30
Oct 30, 2026
Merged

antonwolfy merged 1 commit into
intel:mainfrom
antonwolfy:test/leftovers-2026-10-30

Conversation

@antonwolfy

Copy link
Copy Markdown
Contributor

Summary

Follow-up to three reviews. Each left a point open that a mutant shows on main:

Mutant on main Tests run Result on main
_index() returns {}, {} tests/test_cli_flags.py 37 passed
perl removed from _SHELL_WRITERS context tests 443 passed
_SAFE_MAGNITUDE = 1e6 tests/test_repo_*.py, tests/test_run_compare_errors.py all pass

Changes

  • dokimi/dokimi/cli_flags.py: removes CANONICAL, BANNED, the _index() helper that built them (it had no other caller) and their two __all__ entries.
  • tests/test_context_consistency.py: new test test_perl_in_place_is_an_edit_of_its_file, next to the sed -i / tee matcher cases. A contract whose edit action is {tool: Edit, file_path: src/a\.py$} is satisfied by the Bash step perl -pi -e 's/a/b/' src/a.py. perl -Mstrict -e 'print 1' src/a.py is not an edit (requires: edit).
  • tests/test_repo_report_unreadable_cell.py: _NUMBERS_ACCEPTED gains a fixed cost of 1e100, far above ordinary costs and well below SCORE_BOUND (1e150). test_a_cost_at_the_bound_is_accepted now runs it through repo report --json. These accepted cases are not shared with the compare side, which keeps its own test at the bound.
  • Changelog fragment (Removed).

Risk

Code that imported dokimi.cli_flags.CANONICAL or BANNED now gets an ImportError. Nothing in this repo does. No command, flag, default or output changes. The other two changes only add tests.

Testing

On a Linux review host, at 9b15398 (on main e97ff7a):

  • make ci-local: 28 passed, 2 failed, 7 skipped. The two FAILs are ci.yml:static / Install gitleaks (curl: (22) The requested URL returned error: 504, four times) and ci.yml:static / Scan commits, which then found no gitleaks binary (exit 127). The gitleaks download could not be fetched, so the secret scan was not run here. Skipped: external-catalog-smoke (needs docker + network), test-latest, docs.yml:deploy and pip-audit.yml:report (job condition false on a PR), cli-surface / Package the result, conda-forge-deps (micromamba not on PATH), and semgrep secrets (offline).
    10653 tests passed, 4 skipped. Changed-line coverage: 0 measurable package lines changed (the package change is a deletion).
  • The touched test files plus test_cli_flags.py, test_context_shell.py and the guard tests (test_docs_code_refs.py, test_growth_ratchet.py, test_audit_test_quality.py, test_import_architecture.py): 745 passed. ruff check on the changed files and mypy on the whole package are clean.
  • Mutants. Each new case fails on the change it pins and passes without it:
    • perl removed from _SHELL_WRITERS: test_perl_in_place_is_an_edit_of_its_file fails (1 failed, 92 passed).
    • The perl in-place pattern loosened to any option (^-): the same test fails on its perl -Mstrict half.
    • _SAFE_MAGNITUDE = 1e6: test_a_cost_at_the_bound_is_accepted[large-but-within-the-bound] fails (1 failed, 155 passed). The two cases built from the constant still pass, which is the gap the review named.
  • Merged together with the other follow-up branch (fix/repo-run-unreadable-result) on main e97ff7a: pytest -n auto 10656 passed, 4 skipped; mypy and ruff check . clean.

Revert

git revert the commit. It restores the two tables and drops the two test cases. Nothing is stored or versioned.

Checklist

  • Tests added/updated and pytest passes
  • ruff, mypy, and schema checks pass
  • Docs updated (or N/A) — see the docs-drift checklist in CONTRIBUTING.md
  • Self-reviewed per "Before opening a PR" in AGENTS.md
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…l#238

Settles three review points that merged PRs left open.

intel#254 (review body B1, item 3): `dokimi.cli_flags.CANONICAL` and
`BANNED` were built at import by `_index()` and read by nothing; the
flag contract test builds its own index from `CONCEPTS`, so a mutant
that emptied them survived. The two tables, `_index()` and their
`__all__` entries are removed, with a Removed changelog fragment.

intel#155 (review body B3, item 1): no test had an Edit matcher meet a
`perl -pi` Bash step, so dropping `perl` from `_SHELL_WRITERS` left the
suite green. `test_perl_in_place_is_an_edit_of_its_file` checks that
`perl -pi -e 's/a/b/' src/a.py` satisfies an Edit action on `src/a.py`
and that a `perl` run without `-i` does not.

intel#238 (thread T22): the accepted costs in
`test_a_cost_at_the_bound_is_accepted` were built from `_SAFE_MAGNITUDE`
and moved with it, so lowering the bound to 1e6 passed. A fixed cost of
1e100 is now accepted too.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 12:32
@antonwolfy
antonwolfy requested a review from a team as a code owner October 30, 2026 12:32

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 unused CLI table cleanup and regression-test additions.

No open issues 🎉

What changed in this PR

0 new findings; nothing to fix.

This follow-up to #254, #155 and #238 removes unused CLI registry tables and strengthens regression tests without changing command behavior.

Changes:

  • Removes CANONICAL, BANNED and their unused _index() helper.
  • Tests that perl -pi satisfies an Edit contract while a non-editing Perl command does not.
  • Adds a fixed 1e100 cost case to guard against accidentally lowering the accepted magnitude.
File Description
dokimi/​tests/​test_repo_report_unreadable_cell.py Adds a fixed large-cost acceptance case.
dokimi/​tests/​test_context_consistency.py Tests Perl in-place editing against an Edit contract.
dokimi/​dokimi/​cli_flags.py Removes unused lookup tables, exports and helper.
dokimi/​changelog.d/​20261030_120000_antonwolfy_cli-flags-unused-tables.md Documents removal of the exported tables.

Review effort: Balanced

@antonwolfy antonwolfy self-assigned this Oct 30, 2026
@exai-bot

Copy link
Copy Markdown

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

Review details
  • Commit reviewed: 9b15398 against merge base e97ff7a
  • Coverage: 4 files in 1 groups
  • Engine: OpenCodeReview v1.13.3, us.openai.gpt-6.1-sol
  • Usage: 84k tokens (58k from cache), 15s
  • Tool calls: 11 (7 file_read, 4 code_search)
  • Remove unused CLI table flags and update consistency tests: 4 files

@codecov-commenter

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 93.55%. Comparing base (e97ff7a) to head (9b15398).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #303   +/-   ##
=======================================
  Coverage   93.54%   93.55%           
=======================================
  Files         275      275           
  Lines       35701    35691   -10     
  Branches     6053     6050    -3     
=======================================
- Hits        33398    33392    -6     
+ Misses       1486     1483    -3     
+ Partials      817      816    -1     
Files with missing lines Coverage Δ
dokimi/dokimi/cli_flags.py 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

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

@antonwolfy
antonwolfy merged commit cbb37b9 into intel:main Oct 30, 2026
17 checks passed
@antonwolfy
antonwolfy deleted the test/leftovers-2026-10-30 branch October 30, 2026 18:45
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.

5 participants