runner: AsUser JSON-op helper, one test wrapper, single SETTINGS_MAX and agy login path
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 andworktree_prune:330-350 each repeat run, return-code check,json.loadsand the dict check.capabilities.py:115_presentrepeatsAsUser.exists(asuser.py:231) with stricter exit handling; the twotestwrappers disagree on what exit 2 means.SETTINGS_MAX = 1024 * 1024twice:capabilities.py:111andcommands.py:49.- agy's login path twice:
adapters.AGY_LOGIN(adapters.py:839) andcapabilities.agy_login(capabilities.py:385-387). scratch.py:93/104/115/127repeat 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
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.loadsandisinstance(answer, dict)steps ofAsUser.scratch(asuser.py:257) andAsUser.tmp_scratch(asuser.py:301).