Skip to content

refactor(disk-hygiene): simplify investigated catalog and ranking signals - #15150

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14453-42880124043-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14453-42880124043-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14453

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified two of the four listed disk-hygiene files without changing behavior. In investigated_catalog.py, three private helpers replace code that was written out twice: _identity_key builds the (device, inode, kind) lookup tuple, _scan_target_answer resolves another target's answer for the scan target itself (used by sync_catalog and annotate_entries), and _summary_line formats the unchanged-report line. In ranking_signals.py, annotate builds each path's distinct-signal set once and reuses it for ordering and for entries_by_signal. kill_switch_probe.py and python3_alias_probe.py are left unchanged: their module docstrings are the argparse --help text (description=doc), so editing them would change printed output, and their code is already a thin CLI with re-exports other files depend on (default_settings_path, probe). No eval, fixture, test or skill text changed.

Not verified

  • Python unit tests (test_investigated_catalog.py, test_ranking_signals.py) and a linter run were not executed: this lane's Bash runs only the named wrappers, so no interpreter or ruff was available. Left to the PR's CI.
  • ai-slop deterministic detector (detect.sh) did not run in the tidy markdown pass because the lane permits only the named wrappers; only the rubric read ran on the one-line fragment.
  • ci-status being green is a PR check, left to the PR's CI.
  • kill_switch_probe.py and python3_alias_probe.py were reviewed but not edited: their docstrings are argparse --help output and their remaining code is already minimal.
  • The working tree shows untracked dotfiles at the repo root (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) that this run did not create; they look like sandbox mount points and were left untouched. They are not part of this change.

Fix

  • plugins/disk-hygiene/skills/clean/scripts/investigated_catalog.py: added private helpers _identity_key, _scan_target_answer and _summary_line, and used them in _human_by_identity, _other_target_answer, sync_catalog, annotate_entries and _report; outputs, report lines and public names unchanged
  • plugins/disk-hygiene/skills/clean/scripts/ranking_signals.py: annotate builds the per-path distinct-signal set once and reuses it in order() and in the entries_by_signal count (same SIGNALS key order and int values)
  • .changes/disk-hygiene/work-resolve-issue-issue-14453-42880124043-1-1c3183a9.md: new patch fragment from new-changelog-fragment, with body '### Changed' and '- Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 60c991e:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments (run before and after tidy/review): All 4 changelog fragment(s) under .changes/ are valid
  • check-changed-skills (run twice): CHECK-SKILL clean: PASS, 0 errors, 3 warnings about the clean skill's existing SKILL.md size and description length, which this change does not touch
  • check-affected (run twice): 13 passed, 6 skipped over 3 changed files
  • Grep over plugins/disk-hygiene: no file or test imports any private helper of the changed modules; tests use the modules' public functions only
  • Fresh-context review subagent over the full diff: no bug or behavior change found. It confirmed identical report strings, unchanged evaluation order around snapshot.pop, unchanged entries_by_signal values and key order, and no lines over 88 characters; ruff.toml selects only E4/E7/E9/F
  • Tidy (code-tidying:tidy-diff over the 13 changed hunks): all five passes ran and none edited anything. Pass 1 found nothing more to simplify. Pass 2 found no class A comment (the one docstring in the listed lines is kept). Pass 3 found no residue. Pass 4 resolved the issue's mandated fragment…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42880124043

Left out: the items under Not verified.

Related

#14453

Merge-Risk: max=LOW demote=false head=60c991e9e05faec4434dc0133818e2d82231d4ed rubric=8.3.5 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 60c991e9e05faec4434dc0133818e2d82231d4ed: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read every hunk in all three changed files. No security issues found.

  • .changes/disk-hygiene/...-1c3183a9.md: a new changelog fragment (bump: patch, "Internal simplification, no behavior change."). It holds no instructions, and nothing runs from it.

  • plugins/disk-hygiene/skills/clean/scripts/investigated_catalog.py: three private helpers replace code that was written out twice:

    • _identity_key builds the (device, inode, kind) tuple.
    • _scan_target_answer keeps the same isinstance(identity, dict) guard and the same {**identity, "path": "."} lookup.
    • _summary_line produces the same report string.

    These helpers add no new input source, shell call, path build or file write. The order around snapshot.pop("target_prior_disposition", None) stays the same.

  • plugins/disk-hygiene/skills/clean/scripts/ranking_signals.py: annotate now builds each path's set of distinct signals once and reuses it for ordering and for entries_by_signal. This is in-memory computation only.

None of the changed files matches a trusted-path glob. The diff touches no trust control, merge hold, token, workflow, plugin manifest or standing instruction. Skip condition 2 applies: the change has no security-relevant surface.

The PR context holds no embedded directives aimed at this lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 60c991e9e05faec4434dc0133818e2d82231d4ed: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

I found nothing to flag in this refactor. I read every hunk of all 3 changed files.

Behavior equivalence (checked by reading the code; no tests were run in this lane)

  • investigated_catalog.py:
    • _identity_key builds the same (device, inode, kind) tuple as the two inline copies it replaces.
    • _scan_target_answer keeps the old isinstance(identity, dict) guard and passes the same {**identity, "path": "."} entry to _other_target_answer (local stays None).
    • In annotate_entries, snapshot.pop("target_prior_disposition") still runs before the lookup. In sync_catalog, target_answer is still computed before _uncataloged.
    • _summary_line produces the same strings, "<path> | <disposition> | <owner or 'unknown'>". The reused-answer line still ends in | answered under <target>.
  • ranking_signals.py:
    • distinct is built after the per-path sort. Sorting doesn't change which signals a path has, so order() gives the same keys.
    • by_signal keeps the same SIGNALS key order and the same int counts, because sum over bools returns an int.
    • A signal missing from SIGNALS could not reach the old += 1 path anyway: the earlier SIGNALS.index sort raises first.
  • Changelog fragment: bump: patch, with an ASCII ### Changed heading and the required line, as the issue asks. The full-width ### in the PR body looks like a rendering artifact; the diff has ASCII.

Closing issue #14453 acceptance criteria

  • Behavior unchanged: met, by the reading above. Existing tests check the affected outputs: test_investigated_catalog.py (target_prior_disposition, answered under lines) and test_ranking_signals.py (entries_by_signal).
  • Diff touches only listed files plus a fragment: met.
  • At most 400 lines and 15 files: met (3 files, about 60 lines).
  • ci-status green: the author says CI will check this; I have not confirmed it.
  • Fragment from new-changelog-fragment.sh with the required body: met.

The PR says kill_switch_probe.py and python3_alias_probe.py were left unchanged on purpose, because their docstrings are the argparse --help text. That fits the behavior-unchanged criterion.

Path-scoped rules: .claude/rules/skill-bodies-state-current-rules.md and .claude/rules/ruff-pin.md match these paths, but this change breaks neither.

The author's verification (check-affected, changelog checks, a subagent review) is author-claimed and unverified here.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 60c991e9e05faec4434dc0133818e2d82231d4ed, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 60c991e

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-15150-60c991e9e05faec4434dc0133818e2d82231d4ed, expires on 2026-12-10.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit e5c2b80 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14453-42880124043-1 branch November 10, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify the clean and setup disk-hygiene plugin code

0 participants