oliver-zehentleitner / maity

runner: one Harness.managed rule and one managed-binary lookup (keeper, adapters, capabilities, commands, config)

Sign in to report

tsk-xhwgzka5htbh Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication.

What is wrong: the rule install or update != "never" (new in this range; it decides "never look up on PATH") is written six times: cli/src/maity/runner/keeper.py:46-47 managed(harness), runner/adapters.py:575-577 managed(ctx) (same name, same rule), runner/capabilities.py:216 and :264 (each also repeating the tools.binary(...)/str() lookup at :217-218 and :265-266), runner/commands.py:952, runner/config.py:734. A change in one copy lets the probe, the adapter and the keeper disagree about which binary a session uses.

Proposal: a Harness.managed property in config.Harness, plus one capabilities._managed_binary(harness, tools_dir) used by probe and sandbox_available.

Effort / risk: S. Low risk.