Repository navigation
chore(scanner): delete the unused transcript reader, refuse a non-path (#591) - #593
Conversation
#591) scanner.iter_tool_uses streamed the same assistant tool_use blocks as infrastructure/transcript_activity.py and had no caller anywhere in the repository, in any layer, script or benchmark. It also carried the two crashes the review of PR #592 closed in the new module: an unguarded .get on a record and on its message field. Deleting it puts scanner.py back under the 300-line cap, so the baseline loses that entry. transcript_activity returns its empty result for a transcript_path that is neither text nor an os.PathLike, where it raised TypeError. The value comes from the SessionEnd event's untyped JSON envelope and runs in a path with no exception handler (ADR-1073). Seven new cases cover the path types and a Path object; the type ones raise on the previous code. Full suite: 8736 passed, 8 skipped. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH
|
ZETETIC-REVIEW: APPROVE SummaryTwo independent, well-scoped follow-ups from #592's review: delete dead code ( StakesMedium: touches Move 0: ledger / seen-defect checkNo unmapped branches; no "pre-existing/unrelated/out of scope" rationalization anywhere in the PR body or commit message. Proceeds normally. (1) Is
|
Summary
The two follow-ups the review of #592 left open.
scanner.iter_tool_uses(ADR-0595) streamed the same assistanttool_useblocks asinfrastructure/transcript_activity.py, whole file, line by line. Nothing called it: no layer, no script, no benchmark, andgit log -Sshows it arriving in the bulk commitdc6876c9and never referenced since. It also carried the two crashes the three review rounds of #592 closed in the new module, an unguarded.geton a record and on itsmessage. Deleting it putsscanner.pyat 271 lines, back under the 300-line cap, so.craftsmanship-baseline.jsonloses that entry.transcript_activityraisedTypeErroratPath(transcript_path)for a truthy argument that is neither text nor a path. The signature saysstr | Path | None, but the value arrives from the SessionEnd event's JSON envelope, where nothing is typed, and the call runs in a hook path with no exception handler. It now returns the empty result, as it does for a missing file (ADR-1073).Follow-up to #591.
Type of change
Test plan
tests_py/infrastructure/test_transcript_activity.py: a number, a float, a bool, a list and a dict as the path, all refused; aPathobject still read. The five type cases raiseTypeErroron the previous code.ruff check,ruff format --check: clean.pyright mcp_server/: 0 errors.scripts/check_doc_claims.py: OK.scripts/check_craftsmanship.py --base origin/main: OK, with the baseline shrinking by one entry.Audit notes
{"name", "input", "line"}per call, whichtranscript_activitydoes not. ADR-0595 keeps the record of what it was and git keeps the code; a future caller that needs the inputs or line numbers extends the one reader rather than reviving a second.Coding-standards compliance
scanner.pyis now under the cap rather than baselined over it.Breaking changes
None.
iter_tool_useswas never imported.Reviewer checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH