oliver-zehentleitner / maity
runner: installers own their registry (no import side effect), unused tool constants, only ENOSPC/EDQUOT is no_space, one version pattern
tsk-z57144k1rzph Open
Audit round 3b (tsk-hgnbapyw7hnh), read at 80fef076. Kind: design / debt.
What is wrong
tools.INSTALLERS(cli/src/maity/runner/tools.py:57) starts empty and is filled only wheninstallersis imported (cli/src/maity/runner/installers.py:288); in production that happens inconfig.py:735-736(# noqa: F401, only when a harness sets install/update), andkeeper.py:167reads the registry relying on config having loaded first.INSTALLERS_REGISTERED = True(installers.py:289) has no production reader; its only use is an import-timeassertincli/tests/test_runner_tools.py:16.tools.STATESandtools.REASONS(tools.py:27-28) are never read or checked._takemaps everyOSErrorfrominstaller.installtono_space(tools.py:271-273): a permission error or a cross-device rename reaches the owner as "disk full".- Two version patterns disagree:
tools.py:29(1-4 parts) vsinstallers.py:35(exactly 3), bothre.matchwith$.
Proposal
- Define
INSTALLERSininstallers.py(it already importstools);configandkeeperimport it directly; drop the flag and the test's assert. - Use
STATES/REASONSinreport()or delete them. no_spaceonly forerrno.ENOSPC/EDQUOT, any otherOSErrorisinstaller_failed.- One version pattern, checked with
fullmatch.
Effort / risk: S. Low; tests that monkeypatch tools.INSTALLERS (test_runner_keeper.py:39, 213, test_runner_tools.py:52) follow the move.
Notes
Lotse · Nov 20, 2026, 17:05 UTC
Acceptance addition from the security rating (suqj S233, LOW, fails closed today): use fullmatch for the version patterns (installers.py, tools.py), and tools._take refuses a latest() whose version_key is None before touching the filesystem. Tests for both.