mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 17:14:08 +01:00
Lifts the atop subprocess machinery into _usage_report_atop.py: running atop, streaming its parseable output, building/caching the atop_agg C helper, and reading its TSV. What stays is record parsing, epoch windows and per-day merging. Verified by the 100%-coverage tests from the previous commit. An AST comparison of all 16 functions against HEAD reports 16 identical, 0 mismatches. _usage_report_render.py imported _run from the parsing module; it now imports from the module that owns it. That is the same re-export barrel the last split shipped and had to fix in a follow-up - caught in the same commit this time. usage_report.py needed no edit at all. Both modules hold 100% line+branch (94/28 and 130/34, 0 missed). 179 tests before and after; the five new test files collect 8+6+4+14+5 = 37, which is last commit's 36 plus the one re-homed out of test_usage_report_modes.py, where it referenced a constant that had moved out from under it. The two test files added last commit were themselves over cap (373, 272) so they are split five ways here - the DropZone lesson from earlier today, where a lint fix silently added an over-cap file. Ran the program: a real report from today's logs, through the native atop_agg path, which is precisely the code this commit moved. Over-cap 39 -> 38. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
19 lines
1.8 KiB
JSON
19 lines
1.8 KiB
JSON
{
|
|
"title": "Split _usage_report_parsing.py at the subprocess seam",
|
|
"objective": "_usage_report_parsing.py was 425 lines against a 250-line cap, and the 61% of it that was uncovered was almost exactly the half a split would extract - the atop subprocess plumbing and the native atop_agg helper. The preceding commit took it to 100% coverage so this split could be verified against tests that predate the seam. Success means the file drops under the cap, every moved function is provably unchanged, both resulting modules stay at 100%, the test count is identical, and the program still generates a real report through the native path.",
|
|
"acceptance_criteria": [
|
|
"_usage_report_parsing.py is under 250 lines and the over-cap total drops (39 -> 38)",
|
|
"Every moved function is AST-identical to its HEAD version",
|
|
"Both _usage_report_parsing.py and _usage_report_atop.py hold 100% line and branch coverage",
|
|
"The test count is 179 both before and after, and no test file exceeds the cap either",
|
|
"No re-export barrel: every import site names the module that owns the symbol, including _usage_report_render.py's _run import",
|
|
"usage_report.py generates a report from the machine's real atop logs after the change"
|
|
],
|
|
"out_of_scope": [
|
|
"usage_report.py itself, still 426 lines and over cap - it needs its own coverage-first commit",
|
|
"meta/scripts/optimize_vscode.py and the three transcribe_* files, also over cap and untested",
|
|
"Any behaviour change to the report output or the atop field indices"
|
|
],
|
|
"verifier": "An AST comparison script for the verbatim-move claim; pytest with --cov of both modules and --cov-branch for coverage; pytest --collect-only per file for the test count; check_file_length.sh --all for the cap; python usage_report.py --date <today> for the runtime check; pre-commit run --files for lint."
|
|
}
|