Repository navigation
Description
Agent Brief
Type: Task
Summary: Move the PATH-tool probe() that four code-metrics collectors repeat into adapter_paths.py (part of restructuring pass #14774).
Current behavior:
probe() (10 lines) is identical in four collectors: plugins/code-metrics/scripts/collectors/lizard.py:48-57, radon.py:45-54, scc.py:35-44 and shellmetrics.py:51-60. Each runs shutil.which(NAME), prints "NAME not on PATH" and returns 1, then calls version_output and version_or_unknown, both from adapter_paths.py:131,136.
Desired behavior:
adapter_paths.path_probe(name) -> int sits next to version_output. The four collectors call it in place of their copy, through probe=lambda: path_probe(NAME) or a one-line probe. version_output and version_or_unknown leave the four import lists where nothing else uses them; shutil stays, because each collect calls shutil.which (for example lizard.py:120, radon.py:158). The other collectors' probes and every main() stay as they are.
Files:
plugins/code-metrics/scripts/collectors/adapter_paths.pyplugins/code-metrics/scripts/collectors/lizard.pyplugins/code-metrics/scripts/collectors/radon.pyplugins/code-metrics/scripts/collectors/scc.pyplugins/code-metrics/scripts/collectors/shellmetrics.py- a new
patchfragment in.changes/code-metrics/:### Changed, "Internal restructuring, no behavior change."
Key interfaces:
- Each collector's
probeverb: the same output, including "not on PATH", and the same exit code.
Acceptance criteria:
- The PATH probe exists once, in
adapter_paths.py, and the four collectors use it. - Behavior is unchanged: the same outputs, exit codes and printed results for the same inputs.
- The diff edits only the listed files and the lines of a test that assert on them when the change breaks that assertion.
- The pull request stays within 400 changed lines and 15 hand-edited files.
-
scripts/run-ruff.sh checkpasses on the changed files. -
test_lizard.py,test_radon.py,test_scc.py,test_shellmetrics.pyandtest_adapter_paths.pyinplugins/code-metrics/scripts/collectors/pass. - ci-status is green.
Out of scope:
- The other collectors' probes,
main(), other duplication, eval cases, fixtures, and skill and agent text.
Metadata
Metadata
Assignees
Labels
Type
Fields
Work status
Priority
Activity
melodic-automation-lanes commentedon Nov 12, 2026
{"v":1,"actor_id":337595936,"title_sha256":"59829c21c7bce4aa133f431c120953e4ecf7f8db603e113fa1bd0ffbc0b0f1b3","body_sha256":"4ed48f0fe4c353198cbdf972ece12d518124dff779e2f674e5acbeff16229e13"}
github-actions commentedon Nov 12, 2026
melodic-automation-lanes commentedon Nov 12, 2026
The work-resolve-issue run that
agent-readystarted failed or was cancelled before it reported, or it stopped or the token broker refused it because its workflow files differ from main's. work-unblock removed and addedagent-readyback to start a fresh run on main's workflow files. If this run ends the same way, it re-fires the issue again, waiting longer each time.github-actions commentedon Nov 12, 2026