oliver-zehentleitner / maity

cli + runner: small leftovers: /proc stat parsed twice, unused and test-only re-exports in codexd and watch, _state_dir_line pass-through

Sign in to report

tsk-86z6tacfrvvt Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: debt and small copies.

What is wrong

  • /proc/<pid>/stat is parsed twice in maity.runner, each slicing after the last ) and indexing on its own: cli/src/maity/runner/codexd.py:134-137 (state, start ticks) and loop.py:250-257 (state, pgrp).
  • cli/runner/src/maity_runner/codexd.py:18 re-exports STOP_TIMEOUT, which nothing reads; :19-21 re-export UPDATER_ARGV, UPDATER_DIR, UPDATER_PID only for cli/tests/test_codex_daemon.py (719, 748, 750, 818-837), which already imports the defining module as agents_codexd (:35).
  • cli/runner/src/maity_runner/watch.py:71 WIRE_FORMAT has no reader.
  • cli/src/maity/cli.py:2936-2938 _state_dir_line only forwards to state.state_dir_line; both forms are used side by side (cli.py:714, :729).

Proposal

  • One /proc stat helper returning the fields from field 3 on; delete the unused names and point the test at the defining module; call state.state_dir_line directly.

Effort / risk: S. None.