Skip to content

feat(repos): repo scan counts an ignored claim apart from unresolved - #1497

Merged
antonwolfy merged 3 commits into
intel:mainfrom
antonwolfy:fix/ignored-count
Dec 2, 2026
Merged

antonwolfy merged 3 commits into
intel:mainfrom
antonwolfy:fix/ignored-count

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A repository marks the names it knows are external with [[ignore]] entries in .dokimi/scan.toml; a matching claim that is not ok becomes unresolved_ignored. On main every count still files it under unresolved, because status_class keeps the part of the status before the first _. A repository that declared all its external names shows the same unresolved N as one that declared none, and a new unresolved claim does not stand out.

On main, a tree whose AGENTS.md names sibling_pkg (matched by an ignore entry sibling_*, status unresolved_ignored) and old_helper (status unresolved_identifier) gives counts = {ok: 0, unresolved: 2, fail: 0, total: 2} and no key for the ignored claim, in counts, by_file, by_kind, by_source and summary.claims. The console line is claims: 2 (ok 0, unresolved 2, fail 0) and the report summary cell is claims.ok 0, claims.unresolved 2, claims.fail 0, claims.total 2, files 1, adapters none.

Option taken, the only one the issue proposes: count it apart without changing what the existing keys mean. counts and the same blocks per file, kind and source, plus summary.claims, gain ignored, how many of the unresolved claims are unresolved_ignored. unresolved keeps counting them, so ok + unresolved + fail == total still holds for a reader that does not know ignored. The key is absent when no claim is ignored, so a repository with no ignore entry gets the same report and output as before. A fourth class (unresolved no longer counting ignored claims) is rejected: it changes what unresolved means in a v1 report.

Closes #1489

Changes

  • dokimi/dokimi/repos/l0/__init__.py: _counts adds ignored when at least one claim has status unresolved_ignored; by_file, by_kind, by_source and summary.claims (a copy of counts) carry it.
  • dokimi/dokimi/commands/repo_scan.py: the console line reads unresolved 2 (1 ignored) when ignored is above 0.
  • report summary needed no change: it flattens summary.claims, so the cell now reads claims.ignored 1 after claims.total.
  • dokimi/dokimi/schemas/repo_readiness.v1.json: counts gains an optional ignored property (integer, minimum 0) in place (the definition allowed extra keys; every report already written stays valid, including one that carries ignored: 0).
  • dokimi/docs/repo-evaluation-contract.md: the [[ignore]] paragraph says ignored is a subset of unresolved.
  • New dokimi/tests/test_repo_scan_ignored_count.py; no existing test changed.
  • Changelog fragment (Added).

Risk

None for a repository without [[ignore]] matches: the output is unchanged. For one with matches, counts and its per-file, per-kind and per-source blocks have one more key, the console line has a parenthesis after unresolved N, and the report summary cell has claims.ignored N. A reader that sums the three classes is unaffected. A reader that rejects unknown keys in a counts block would see ignored.

Open PR #1413 also changes dokimi/dokimi/commands/repo_scan.py and conflicts with this branch there (the console claims: line); whichever merges second rebases. #1485, #1486 and #1467 change other paragraphs of the contract and merge cleanly with this branch.

Testing

On a Linux review host, at 46aad9b1 (on main 3ab27d8):

  • make ci-local: 38 passed, 0 failed, 16 skipped (docker, micromamba, semgrep, the Claude Code pin, jobs that do not run on a PR, the matrix legs). 32355 tests passed, 28 skipped.
  • The Python 3.14 check failed on tests/test_blank_inline.py::test_the_opener_of_each_link_of_one_row_is_found_without_reading_the_brackets_before_it (65.57 < 64). The PR changes neither that file nor the memory code; the file passes alone here (230 passed) and in the full run. The timing-ratio flake is tracked in Flaky on CI: tests/test_blank_inline.py::test_the_opener_of_each_link_of_one_row_is_found_without_reading_the_brackets_before_it #1520.
  • A counts.ignored of 0 validates against repo_readiness.v1; with the schema minimum put back to 1, test_a_v1_document_with_ignored_zero_still_validates fails (1 failed, 4 passed).
  • The new test on main's code: 3 failed, 1 passed (the first failure is KeyError: 'ignored' on counts).
  • Mutants: each assertion block of the new tests fails on a break of its line (4 of the 4 runs fail); scripts/mutate_changed.py on the changed lines: 6 mutants, 6 killed.
  • Not run: the matrix legs on Python 3.11, 3.12 and 3.14; the issue's repro through the shell (the test builds the same tree).

Open questions

None.

Revert

A plain revert restores the old counts. Nothing is stored: a report written with ignored stays valid under repo_readiness.v1 (the schema also allows the key before this change).

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
  • Each new raise/exit and test names the doc, contract or issue it traces to
  • No ad-hoc run artifacts committed
  • New files carry the SPDX license header (or are exempt in .github/.licenserc.yaml)

…ntel#1489)

An `[[ignore]]` entry in `.dokimi/scan.toml` turns a matching claim into `unresolved_ignored`, but every count put it back under `unresolved`, so a repository that declared all its external names showed the same `unresolved N` as one that declared none.

`counts`, `by_file`, `by_kind`, `by_source` and `summary.claims` now carry `ignored`, the number of `unresolved` claims that are `unresolved_ignored`. `unresolved` keeps counting them, so `ok + unresolved + fail == total` still holds. The key is absent when no claim is ignored, so reports and output of a repository with no ignores are unchanged. The console line reads `unresolved 2 (1 ignored)` and `report summary` shows `claims.ignored 1`. `repo_readiness.v1` widens in place with an optional `ignored`.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy
antonwolfy requested a review from a team as a code owner December 1, 2026 15:06
Copilot AI balanced review requested due to automatic review settings December 1, 2026 15:06
@antonwolfy antonwolfy self-assigned this Dec 1, 2026

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 change exposing ignored-claim counts separately in repository scan reports.

No open issues 🎉

What changed in this PR

0 new findings; nothing to fix.

This PR addresses #1489 by exposing ignored claims separately in repository scan reports while preserving their inclusion in unresolved and keeping existing totals unchanged.

Changes:

  • Adds an optional ignored count across report breakdowns and JSON summaries, omitted when zero.
  • Shows ignored counts in console output and documents the subset semantics in the schema and contract.
  • Adds regression tests for counts, output, schema validation, and scans without ignore entries.
File Description
dokimi/​tests/​test_repo_scan_ignored_count.py Tests ignored counts and unchanged output without ignores.
dokimi/​dokimi/​schemas/​repo_readiness.v1.json Defines the optional ignored count.
dokimi/​dokimi/​repos/​l0/​__init__.py Counts ignored claims as a subset of unresolved claims.
dokimi/​dokimi/​commands/​repo_scan.py Displays ignored counts alongside unresolved totals.
dokimi/​docs/​repo-evaluation-contract.md Documents counting and output behavior.
dokimi/​changelog.d/​20261201_150000_repo-scan-ignored-count.md Announces the new count and preserved totals.

Review effort: Balanced

@exai-bot

exai-bot commented Dec 1, 2026 •

Copy link
Copy Markdown

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

CI at 46aad9b: 26 passing, 4 skipped.

Review details
  • Commit reviewed: 46aad9b against merge base 3ab27d8
  • Coverage: 6 files in 1 groups
  • Engine: OpenCodeReview v1.13.5-exai.4.8f73eada, us.openai.gpt-6.1-sol
  • Usage: 141k tokens (82k from cache), 28s
  • Tool calls: 13 (8 file_read, 2 code_search, 1 ci_status, 1 local_check_results, 1 pr_threads)
  • Repository scan ignored-count implementation, schema, tests, and documentation: 6 files

@codecov-commenter

codecov-commenter commented Dec 1, 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.33%. Comparing base (049bc53) to head (46aad9b).
⚠️ Report is 9 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1497   +/-   ##
=======================================
  Coverage   96.32%   96.33%           
=======================================
  Files         515      517    +2     
  Lines       69017    69107   +90     
  Branches    11954    11970   +16     
=======================================
+ Hits        66482    66573   +91     
+ Misses       1560     1558    -2     
- Partials      975      976    +1     
Files with missing lines Coverage Δ
dokimi/dokimi/commands/repo_scan.py 89.16% <100.00%> (+0.05%) ⬆️
dokimi/dokimi/repos/l0/__init__.py 100.00% <100.00%> (ø)

... and 9 files with indirect coverage changes

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

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

Change class: CONTRACT (head 54d63c3)

  • Contract: changed. schema dokimi/dokimi/schemas/repo_readiness.v1.json
  • Responsibility: none
  • Dependency: none
  • Review depth: check the changed surface: callers, docs, tests pin new behaviour
  • Coverage gaps: none

Checked the count in the CLI, grouping and schema. Four focused tests passed. The v1 schema has a compatibility regression. Both CodeQL jobs failed while extracting the tool bundle.

The new `ignored` property had a minimum of 1, which rejected a v1 document that carries `counts.ignored: 0`; the counts object allowed extra keys before, so such a document was valid on main. The minimum is now 0 (the writer still omits the key when no claim is ignored), and a test validates a document with `ignored: 0`. Settles the blocking schema point of the review of intel#1497.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy

Copy link
Copy Markdown
Contributor Author

(commented) ### Change class: CONTRACT (head 54d63c3)

@napetrov (#1497 (review)): The compatibility regression is the schema point of thread 4757002158, fixed in 97bdde6. The CodeQL failures are the runner's tool-bundle extraction, covered by the ci concerns.

Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
@antonwolfy

Copy link
Copy Markdown
Contributor Author

Ready for another look at 46aad9b; 1 checks still pending (Windows smoke test (py3.13)); every other check passed.

@antonwolfy
antonwolfy requested a review from napetrov December 1, 2026 18:34

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

Approving 46aad9b.
What I checked: the 5 changed tests pass, and fail on main as expected; the full test suite passes with main merged in (33,498 tests), apart from failures main has too; it merges cleanly onto main; when I changed the code on purpose, the tests caught all 2 changes.

@antonwolfy
antonwolfy merged commit 00a761c into intel:main Dec 2, 2026
30 checks passed
@antonwolfy
antonwolfy deleted the fix/ignored-count branch December 2, 2026 10:18
antonwolfy added a commit to IntelPython/mkl-service that referenced this pull request Dec 3, 2026
Since intel/dokimi#1486 the reusable workflow installs the dokimi of its own commit when `dokimi-ref` is empty, so the `uses:` SHA is the only pin left. The new commit also counts an ignored claim apart from unresolved (intel/dokimi#1497).
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.

repo scan: counts and report summary file an ignored claim under unresolved, so a repository's known external names look open

6 participants