mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 20:07:04 +01:00
usage_report: import _fmt_h from its owner, not through the render module
The previous commit's message claimed "no re-export barrel". That was
wrong: usage_report.py still did
from _usage_report_render import _fmt_h, _render_report
and after the split _fmt_h lives in _usage_report_format - the render
module only re-imports it for _methodology_section. So the import reached
the owner through an intermediary, which is the exact pattern the brief
says was vetoed last session. Now each name comes from its own module.
Also untracks bucket_catch/packages/frontend/tsconfig.tsbuildinfo and
gitignores *.tsbuildinfo. It is a generated incremental-build cache
tracked in a repo that blocks binaries, and it has been dirty in every
commit this session, forcing pre-commit to stash each time.
143 tests pass; usage_report.py still generates a real report.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
This commit is contained in:
parent
ad646541ad
commit
efb471fc8b
3
.gitignore
vendored
3
.gitignore
vendored
@ -407,3 +407,6 @@ billsplit/ios/
|
||||
billsplit/macos/
|
||||
billsplit/windows/
|
||||
billsplit/linux/
|
||||
|
||||
# TypeScript incremental build cache - generated, never useful in a diff.
|
||||
*.tsbuildinfo
|
||||
|
||||
@ -1 +0,0 @@
|
||||
{"root":["./src/App.tsx","./src/main.tsx","./src/types.ts","./src/components/DropZone.tsx","./src/components/GameCanvas.tsx","./src/components/ModeSelect.tsx","./src/components/PuzzleCanvas.tsx","./src/components/PuzzleResult.tsx","./src/components/ScoreScreen.tsx","./src/hooks/useBasketControl.ts","./src/hooks/useGameLoop.ts","./src/hooks/usePuzzleGameLoop.ts","./src/lib/fileIcon.ts","./src/lib/sliceImage.ts","./src/lib/uploadFiles.ts","./src/lib/zipDownload.ts","./vite.config.ts"],"version":"5.8.3"}
|
||||
@ -0,0 +1,38 @@
|
||||
{
|
||||
"intent": "Make usage_report.py import _fmt_h from the module that actually owns it, instead of reaching it through _usage_report_render, and stop tracking a generated TypeScript build cache.",
|
||||
"scope": [
|
||||
"usage_report.py:43 - one import line split in two",
|
||||
".gitignore - ignore *.tsbuildinfo",
|
||||
"bucket_catch/packages/frontend/tsconfig.tsbuildinfo - removed from tracking (file left on disk)",
|
||||
"Non-goal: any behaviour change; no other module touched"
|
||||
],
|
||||
"changes": [
|
||||
"Split 'from _usage_report_render import _fmt_h, _render_report' into an import of _fmt_h from _usage_report_format and _render_report from _usage_report_render. After the previous commit's split, _fmt_h lives in the format module and the render module merely re-imports it for its own use in _methodology_section - so the old line made _usage_report_render a re-export barrel, which the brief explicitly rules out. The previous commit's message claimed no barrel existed; that claim was wrong and this commit makes it true.",
|
||||
"git rm --cached on bucket_catch/packages/frontend/tsconfig.tsbuildinfo and added *.tsbuildinfo to .gitignore. It is a generated incremental-build cache that was tracked in a repo which otherwise blocks binaries, and it had been showing as dirty in every commit this session, forcing pre-commit to stash on each one."
|
||||
],
|
||||
"verification": [
|
||||
{
|
||||
"command": "pytest linux_configuration/tests/",
|
||||
"result": "pass",
|
||||
"evidence": "143 passed, unchanged from before the import change."
|
||||
},
|
||||
{
|
||||
"command": "python usage_report.py --date <today> --top 1 --no-clipboard --no-update-state --quiet",
|
||||
"result": "pass",
|
||||
"evidence": "Generated a full report from today's real atop logs (28 samples). This is the check that matters for an import change: a wrong module path is a runtime ImportError that unit tests importing the modules directly would not necessarily surface."
|
||||
},
|
||||
{
|
||||
"command": "git check-ignore -v bucket_catch/packages/frontend/tsconfig.tsbuildinfo",
|
||||
"result": "pass",
|
||||
"evidence": "Reports '.gitignore:412:*.tsbuildinfo', so the new rule matches the file that was previously tracked."
|
||||
}
|
||||
],
|
||||
"risks": [
|
||||
"None for the import: _fmt_h is the same function object either way, and the module that defines it has no side effects at import time beyond two integer constants.",
|
||||
"Untracking tsbuildinfo means a fresh clone builds without a warm incremental cache. That is the intended behaviour for a build artifact and costs one slower first `tsc -b`."
|
||||
],
|
||||
"rollback": [
|
||||
"git revert the commit. usage_report.py returns to the single combined import (still functional, just routed through the barrel), and tsconfig.tsbuildinfo becomes tracked again.",
|
||||
"After rollback, confirm pytest linux_configuration/tests still reports 143 passed and that usage_report.py still runs."
|
||||
]
|
||||
}
|
||||
@ -33,6 +33,7 @@ import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from _usage_report_format import _fmt_h
|
||||
from _usage_report_parsing import (
|
||||
aggregate_atop,
|
||||
merge_gpu_aggs,
|
||||
@ -40,7 +41,7 @@ from _usage_report_parsing import (
|
||||
merge_windows,
|
||||
)
|
||||
from _usage_report_pmon import aggregate_pmon
|
||||
from _usage_report_render import _fmt_h, _render_report
|
||||
from _usage_report_render import _render_report
|
||||
from _usage_report_types import _PMON_INTERVAL_S, GpuAgg, ProcAgg, _Progress, _Window
|
||||
|
||||
_ATOP_LOG_DIR = Path("/var/log/atop")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user