{ "intent": "Bring python_pkg/wsg_grabber/cli.py under the 250-line file cap by extracting the `logs` subcommand's reporting functions into a sibling module, keeping cli.show_logs and cli.summarise working for existing callers and tests.", "scope": [ "python_pkg/wsg_grabber/cli.py", "python_pkg/wsg_grabber/_logs_report.py (new)", "refactor_claude_todo_resume.md (handoff: record the settled re-export form)", "Non-goal: no behaviour change, no test changes, no CLI surface change" ], "changes": [ "Moved show_logs() and summarise() plus their _emit helper into python_pkg/wsg_grabber/_logs_report.py; they are read-only reporting over the JSONL session logs and share nothing with the scrape/review flow.", "cli.py re-exports both names via __all__ so cli.show_logs / cli.summarise remain valid attributes for tests and the `logs` subcommand dispatch.", "Recorded the working re-export form in the handoff file: the `X as X` alias form is rejected by ruff PLC0414 and then stripped by F401, so __all__ is required.", "cli.py 282 -> 247 lines; _logs_report.py is 76 lines. Both under the 250-line cap." ], "verification": [ { "command": "python3 -m pytest python_pkg/wsg_grabber/tests/ -q", "result": "pass", "evidence": "277 passed in 15.00s, unchanged from before the split. test_cli.py calls cli.show_logs() and cli.summarise() directly, so these passing prove the re-export resolves through the old path." }, { "command": "pre-commit run --files python_pkg/wsg_grabber/cli.py python_pkg/wsg_grabber/_logs_report.py", "result": "pass", "evidence": "All hooks pass with no output after filtering Passed/Skipped, including ruff, ruff format, mypy, pylint and 'pytest with coverage enforcement'. An earlier run of this exact command with the `X as X` alias form failed with 2 x PLC0414 + 1 x F401; switching to __all__ fixed it without any suppression." } ], "risks": [ "ruff's F401 autofix can silently delete a re-export that is not covered by __all__, which would break cli.summarise at runtime while lint stays green. Mitigated by __all__ and by test_cli.py exercising both names.", "One transient test failure appeared in an earlier combined run and did not reproduce on two subsequent full runs of the package suite; it was in another package's tests, not wsg_grabber." ], "rollback": [ "git revert the commit; cli.py returns to its 282-line form and _logs_report.py is deleted.", "After rollback, run python3 -m pytest python_pkg/wsg_grabber/tests/ -q to confirm 277 tests still pass." ] }