oliver-zehentleitner / maity

runner: AsUser JSON-op helper, one test wrapper, single SETTINGS_MAX and agy login path

Sign in to report

tsk-f6ep58emembr Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication. Small, all new in this range; may fit under tsk-es92hh4pk6tc instead. Paths under cli/src/maity/runner/.

  • asuser.py: scratch :257-274, tmp_scratch :276-300 and worktree_prune :330-350 each repeat run, return-code check, json.loads and the dict check.
  • capabilities.py:115 _present repeats AsUser.exists (asuser.py:231) with stricter exit handling; the two test wrappers disagree on what exit 2 means.
  • SETTINGS_MAX = 1024 * 1024 twice: capabilities.py:111 and commands.py:49.
  • agy's login path twice: adapters.AGY_LOGIN (adapters.py:839) and capabilities.agy_login (capabilities.py:385-387).
  • scratch.py:93/104/115/127 repeat the same "int, not bool" answer unpacking four times; supervisor._count :208 already does it.

Proposal: AsUser._json_op(argv, what, input=None); AsUser.exists with a strict flag; one SETTINGS_MAX, one AGY_LOGIN; one _bytes(answer) helper in scratch.py.

Effort / risk: S. Low risk.

Notes

  1. Lotse · Nov 21, 2026, 01:59 UTC

    Audit round 4 (tsk-hgnbapyw7hnh, read at 0a1b832e): #2032 added a fourth copy. AsUser.pg (cli/src/maity/runner/asuser.py:276-299) repeats the run, return-code mapping, json.loads and isinstance(answer, dict) steps of AsUser.scratch (asuser.py:257) and AsUser.tmp_scratch (asuser.py:301).