Repository navigation
refactor(report): split generate_report and render_task_runs_report into section helpers - #1403
Conversation
…nto section helpers Each report section is its own helper over a shared context; the top-level functions keep their signatures and call the sections in the same order. Output is byte-identical (checked by a differential probe over fixtures and random inputs). Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 6 selected item(s). CI at Review details
|
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1403 +/- ##
==========================================
+ Coverage 96.25% 96.27% +0.01%
==========================================
Files 512 513 +1
Lines 68234 68533 +299
Branches 11844 11882 +38
==========================================
+ Hits 65680 65978 +298
- Misses 1568 1570 +2
+ Partials 986 985 -1
🚀 New features to boost your workflow:
|
Mutation of changed lines80 mutants of the lines this PR changes, at 3364aa6: 66 killed, 14 survived, 0 waived, 0 inconclusive, 0 timed out, 0 errors, 0 not run. The mutant cap left out 129 more mutants of covered changed lines. A survivor is a change to that line that the tests covering it do not notice: add an assertion that fails on it or, if the change cannot alter behaviour, put
Warn-only: a survivor does not fail the job yet. Updated on every push; the full report is in the ci run summary. |
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…nd sidecar Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟢 LGTM · checked 3364aa6 · nothing required from @napetrov
🔀 Merge: safe now · merges cleanly into current main, 8 commits behind; growth and duplicate gates and the report tests pass on the merge · after it, #1406 needs a rebase (report/eval_report.py)
✅ make ci-local --offline: 30,977 passed, 100% of changed lines covered · ✅ old vs new output on 600 random task_runs artifacts and 600 random evals: identical Markdown, sidecar and stdout · ✅ changed-line mutants: 14 of 80 survive, down from 27
A clean split: both reports come out exactly as before, and the baselines shrink as they should.
Fixed in this branch, up to 3364aa6:
Summary
Pure extraction: each report section becomes a helper over a shared context. The top-level functions keep their signatures and call the sections in the same order.
Nested
_valand_answer_textmove to module level; the Top/Bottom 15 and the two Q&A tables each share one helper.Evidence
Before:
generate_report310 lines, cyclomatic 51;render_task_runs_report190 lines, cyclomatic 64.After: longest section helper is under 60 lines; both entry points are short sequencers.
Before / after, differential probe (
old= pristine module,new= this branch, same inputs, report timestamp frozen; compares Markdown bytes, Q&A sidecar bytes, stdout, stderr, return value, and raised exception class and message):eval.v1fixture + 150 random files, incl. stopped runs, NaN/overflow deltas, significance refusals)task_runs.v1fixture, the test module's own builders over their parameter grid, 150 random artifacts)Tests:
pytestover every test file importing either module plustests/test_report*.py: 1116 passed.make ci-local: static checks green; the only failures were two Ctrl-C timeouts intest_docker_cmd.pyandtest_repo_host.pyunder full-suite load, both pass when rerun alone.Merge Danger
Door: two-way (pure refactor; revert restores the old bodies).
Blast Radius: report output only. Public names, signatures and the sidecar schema are unchanged. Ratchet baselines (
scripts/growth_baseline.json,scripts/duplicates_baseline.json) are lowered to match the smaller functions.Internal refactor, so the
skip-changeloglabel is set; a shortchangelog.dfragment is included for the local pre-push hook.🤖 Generated with Claude Code