Repository navigation
fix(report): report eval reads a golden id prefix with a hyphen as golden (#1585) - #1587
Conversation
…lden (intel#1585) detect_static_prefix matched only `^([a-zA-Z]+-Q)\d+$`, so a golden set such as `intel-performance-skills-Q001` never matched: all its questions were counted as generated, the Golden (static) row was 0, and the Dynamic vs Static breakdown and agreement line compared the wrong groups. The pattern is now `^(.+-Q)\d+$`, compiled once at module level, so any id ending in `-Q<digits>` is golden and its prefix is everything before the Q. Generated ids (`gen-1`) have no such suffix and stay generated; no generator in dokimi/dokimi emits one. The ASK handling is unchanged. single_condition_report.py shares the function and gets the fix. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 3 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 #1587 +/- ##
==========================================
- Coverage 96.50% 96.49% -0.01%
==========================================
Files 539 539
Lines 72177 72178 +1
Branches 12445 12445
==========================================
- Hits 69655 69649 -6
- Misses 1545 1549 +4
- Partials 977 980 +3
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
These assertions depend on exact markdown table row rendering (spacing/formatting, bolding, column… · New The statement “any id ending in-Q<digits>” is slightly broader than the implemented regex… · New_STATIC_IDis a compiled regex, so the name is easy to misread as a literal/static ID value.… · New
What changed in this PR
Fixes report eval misclassifying golden/static questions when the golden ID prefix contains a hyphen (e.g., intel-performance-skills-Q001), by broadening static-prefix detection and adding regression tests.
Changes:
- Update
detect_static_prefixto match hyphenated prefixes via a module-level compiled regex. - Add tests covering report splitting + Q&A JSON
sourcefor hyphenated and non-hyphenated golden sets. - Add a changelog fragment documenting the fix.
| File | Description |
|---|---|
| dokimi/dokimi/report/eval_report.py | Broadens static ID detection and avoids per-iteration regex compilation. |
| dokimi/tests/test_report_golden_prefix.py | Adds regression coverage for golden-prefix detection and report/Q&A outputs. |
| dokimi/changelog.d/20261203_140000_golden-prefix-hyphen.md | Documents the behavior change in report eval. |
Review effort: Lite
…ract, read table cells in the test Settles the three review threads on the PR. The compiled pattern is renamed _STATIC_ID_RE. The changelog fragment now states the contract as the regex `^(.+-Q)\d+$`: a non-empty prefix, then `-Q` and digits. The summary-row assertions of the test parse the row into cells and compare numbers, so a change of spacing or bolding does not fail it. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
napetrov
left a comment
There was a problem hiding this comment.
Change class: LOCAL (head 574759b)
- Contract: none
- Responsibility: none
- Dependency: none
- Review depth: skim: local change, check diff + tests
- Coverage gaps: none
No merge-blocking findings.
Checked ordinary and hyphenated golden sets, the Markdown split and the JSON sidecar. Ran 24 focused tests successfully. Two unrelated task harness tests failed identically on the merge base in the offline container. Required CI passed.


Summary
report evaltells golden (static) questions from generated ones by id only:detect_static_prefixtook the first id matching^([a-zA-Z]+-Q)\d+$. A golden set whose prefix has a hyphen never matched, so all its questions were reported as generated. With three golden questions<prefix>001..003(80/60) and three generatedgen-1..3(50/50):mainmainonetbb-Qintel-performance-skills-QThe Dynamic vs Static breakdown, the agreement line and the Q&A JSON
sourcefield compared the wrong groups. The pattern is now^(.+-Q)\d+$, the first option of the issue. The other option, a golden marker carried from the questions file into the eval record, changes a persisted format and every writer, so it is not part of this PR.A generated id must not match: none of the id generators in
dokimi/dokimi/emits an id ending in-Q<digits>(git grep -n 'Q[0-9]'finds only a comment), andgen-1has no such suffix.Closes #1585
Changes
dokimi/dokimi/report/eval_report.py:detect_static_prefixmatches^(.+-Q)\d+$, compiled once at module level as_STATIC_ID_RE(reis imported at module level instead of inside the loop). The ASK handling (a non-ASK match wins over an ASK one) is unchanged.single_condition_report.pycalls the same function and needs no change.dokimi/tests/test_report_golden_prefix.py:generate_reporton the issue's input foronetbb-Qandintel-performance-skills-Q(summary rows and Q&Asource), the one-condition page'ssource, anddetect_static_prefixon both ids and on non-matching ids.Risk
An id ending in
-Q<digits>with any non-empty prefix is now golden, where only a letters-only prefix was. An eval file whose generated ids end that way would now count them as golden; none of dokimi's generators writes such ids. Thereport evaloutput for a letters-only prefix is unchanged.Open #1523 changes
eval_report.pytoo, ingenerate_reportand a sidecar helper, not indetect_static_prefix. It conflicts withmainalone in that file, so it is its own to rebase; this branch adds no conflict of its own with it.Testing
On a Linux review host, at
574759b7(onmainbadfd39):make ci-local: 38 passed, 0 failed, 16 skipped (steps that need another job's matrix, micromamba, semgrep, docker or the network). 34480 tests passed, 28 skipped.main's code the new test file gives3 failed, 5 passed; the first failure is the Q&Asourceofintel-performance-skills-Q001:'dynamic'where'static'is expected.\d+$of the pattern fails thedetect_static_prefixcasesintel-performance-skills-Qxandintel-performance-skills-Q(2 failed); a pattern^(.+-?)\d+$fails the casesgen-1,onetbb-Q001andintel-performance-skills-Q001(3 failed).Open questions
None.
Revert
A plain revert restores the letters-only pattern. Nothing is stored.
Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.mdraise/exit and test names the doc, contract or issue it traces to.github/.licenserc.yaml)