Repository navigation
feat(repos): repo scan counts an ignored claim apart from unresolved - #1497
Conversation
…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>
There was a problem hiding this comment.
🟢 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
ignoredcount 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
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 6 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
napetrov
left a comment
There was a problem hiding this comment.
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>
@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>
|
Ready for another look at |
vchamarthi
left a comment
There was a problem hiding this comment.
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.
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).
Summary
A repository marks the names it knows are external with
[[ignore]]entries in.dokimi/scan.toml; a matching claim that is notokbecomesunresolved_ignored. Onmainevery count still files it underunresolved, becausestatus_classkeeps the part of the status before the first_. A repository that declared all its external names shows the sameunresolved Nas one that declared none, and a new unresolved claim does not stand out.On
main, a tree whoseAGENTS.mdnamessibling_pkg(matched by an ignore entrysibling_*, statusunresolved_ignored) andold_helper(statusunresolved_identifier) givescounts={ok: 0, unresolved: 2, fail: 0, total: 2}and no key for the ignored claim, incounts,by_file,by_kind,by_sourceandsummary.claims. The console line isclaims: 2 (ok 0, unresolved 2, fail 0)and thereport summarycell isclaims.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.
countsand the same blocks per file, kind and source, plussummary.claims, gainignored, how many of theunresolvedclaims areunresolved_ignored.unresolvedkeeps counting them, sook + unresolved + fail == totalstill holds for a reader that does not knowignored. 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 (unresolvedno longer counting ignored claims) is rejected: it changes whatunresolvedmeans in a v1 report.Closes #1489
Changes
dokimi/dokimi/repos/l0/__init__.py:_countsaddsignoredwhen at least one claim has statusunresolved_ignored;by_file,by_kind,by_sourceandsummary.claims(a copy ofcounts) carry it.dokimi/dokimi/commands/repo_scan.py: the console line readsunresolved 2 (1 ignored)whenignoredis above 0.report summaryneeded no change: it flattenssummary.claims, so the cell now readsclaims.ignored 1afterclaims.total.dokimi/dokimi/schemas/repo_readiness.v1.json:countsgains an optionalignoredproperty (integer, minimum 0) in place (the definition allowed extra keys; every report already written stays valid, including one that carriesignored: 0).dokimi/docs/repo-evaluation-contract.md: the[[ignore]]paragraph saysignoredis a subset ofunresolved.dokimi/tests/test_repo_scan_ignored_count.py; no existing test changed.Risk
None for a repository without
[[ignore]]matches: the output is unchanged. For one with matches,countsand its per-file, per-kind and per-source blocks have one more key, the console line has a parenthesis afterunresolved N, and thereport summarycell hasclaims.ignored N. A reader that sums the three classes is unaffected. A reader that rejects unknown keys in acountsblock would seeignored.Open PR #1413 also changes
dokimi/dokimi/commands/repo_scan.pyand conflicts with this branch there (the consoleclaims: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(onmain3ab27d8):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.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.counts.ignoredof 0 validates againstrepo_readiness.v1; with the schema minimum put back to 1,test_a_v1_document_with_ignored_zero_still_validatesfails (1 failed, 4 passed).main's code: 3 failed, 1 passed (the first failure isKeyError: 'ignored'oncounts).scripts/mutate_changed.pyon the changed lines: 6 mutants, 6 killed.Open questions
None.
Revert
A plain revert restores the old counts. Nothing is stored: a report written with
ignoredstays valid underrepo_readiness.v1(the schema also allows the key before this change).Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)