Skip to content

feat(disk-hygiene): rank scan entries by sibling-mtime and size-collision signals - #10537

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-3858-40587656008-1
Oct 27, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-3858-40587656008-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #3858

Summary

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

The disk-hygiene scan now ranks entries for review by three signals computed only from fields every snapshot entry already records: discovery-hint (hints), sibling-mtime-cluster (path, kind, mtime_ns: siblings written within a chained 2 s window) and size-collision (path, kind, stat_size, device, inode: equal-size non-empty files in one directory or sibling directories, hard links excepted). Each entry gets review_rank, either ranked with a position and the signals and groups that placed it, or unranked with a null position. The snapshot gains review_ranking (counts, groups with detail, what each signal reads) and scan-complete gains ranked_entries, unranked_entries and entries_by_signal. No eligibility, tick or blocker decision reads the rank. Over a 76-entry fixture built to match the audit's described shapes, coverage goes from 1 of 76 entries hinted (the audit's figure) to 25 of 76 reached by a signal.

Not verified

  • No Python test suite was run in this lane (no interpreter allowed): test_ranking_signals.py, test_hygiene.py (hygiene.test.sh) and test_investigated_catalog.py, and so the criterion that scripts/affected-tests.sh --run selects and passes the mapped suites, are left to the PR's CI. The fixture figure
  • The before/after coverage figures come from a synthetic 76-entry fixture built to match the shapes the audit describes, not from the audit's own snapshot: issue #3347 does not publish it and says it is on the auditing machine. No real-home scan was measured.
  • check-affected skipped changed-skills (skill-quality gate for clean/SKILL.md and audit/SKILL.md), typos, and three validate-plugins sub-steps; they run on the PR's CI. clean/SKILL.md stays at 498 lines, under the 500-line hard cap.
  • No eval cases were added for the SKILL.md additions in clean and audit; CI's evals-quality gate runs on the PR.
  • Reviewer concerns left as they are: protected entries (for example a .git directory) can still receive signals and a position, since a signal is provenance evidence and protection is reported separately. ScanOutputVerbosityTests now compares ranked_entries across two fixtures built moments apart; th

Fix

  • plugins/disk-hygiene/skills/clean/scripts/ranking_signals.py: new module with hint_groups, mtime_cluster_groups, size_collision_groups and annotate. No filesystem access; writes only review_rank on entries and returns the review_ranking summary.
  • plugins/disk-hygiene/skills/clean/scripts/hygiene.py: imports ranking_signals; scan_tree calls annotate last (after rules, in-flight refs and stdlib shadowing, never in sizes-only mode) and stores review_ranking; scan_complete_payload reports ranked_entries, unranked_entries and entries_by_signal; t
  • plugins/disk-hygiene/skills/clean/scripts/test_ranking_signals.py: new tests for each signal (cluster window, lone entry, links, sibling scope, root-file scope, empty files, hard links); legible signals and null-position unranked entries; ordering; annotate writes nothing but review_rank; ranking wi
  • plugins/disk-hygiene/skills/clean/scripts/test_hygiene.py: the pinned scan-complete key set gains ranked_entries, unranked_entries and entries_by_signal.
  • plugins/disk-hygiene/skills/clean/reference/safety-model.md: new 'Review ranking' section (signal table with the fields each reads, review_rank shape, unranked semantics, evidence-not-proof and no-eligibility rule, approval-digest note, which of the audit's other worked examples cannot be signals an
  • plugins/disk-hygiene/skills/clean/reference/scan-flags.md: the Coverage and hint fields section points to the new fields and section.
  • plugins/disk-hygiene/skills/clean/SKILL.md: step 3 says to order review by review_rank position, name each row's signals and group, show unranked entries as unranked, and quote ranked_entries of entries. Added to an existing line because the file is at 498 of its 500-line cap.
  • plugins/disk-hygiene/skills/audit/SKILL.md: the report step adds the same ordering and unranked-presentation rule.
  • plugins/disk-hygiene/README.md: Safety contract bullet describing the review ranking and that no eligibility decision reads it.
  • .changes/disk-hygiene/feat-3858-review-ranking-signals-7c41e9a2.md: minor changelog fragment (Added). Written by hand because new-changelog-fragment refused on a detached HEAD.

Verification

The runner ran each check from the base copy against ab85466:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: all 35 fragments valid, run after the final edits
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 12 passed, 6 skipped, 0 failed over 10 changed files, run after the final edits (passed includes markdown, ruff, comment-hygiene, machine-specific-paths, changelog-fragments, changelog-parity, plugin-options-d
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/verify/bin/cant-fail-scan --file plugins/disk-hygiene/skills/clean/scripts/test_ranking_signals.py --check --strict: PASS, 16 test blocks parsed, no gating findings
  • Local review by one fresh-context subagent over the whole diff: no failing-test or logic bug found. It hand-checked the fixture counts (76 entries, 1 hinted, 25 ranked, per-signal 1/18/6) and that preview passes with the mocks. Fixed every confirmed finding: docs overstated group adjacency, said 'pr
  • read https: //github.com/melodic-software/claude-code-plugins/issues /3347: F5 says provenance and ranking are mandated with no mechanism, measures hint coverage at 1 of 76 entries, says sibling-mtime clustering and size-collision detection are computable today, and paraphrases five ad-hoc audit sig
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40587656008

Left out: the items under Not verified.

Related

#3858

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

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 9109abfdde5fd83be644df8c2ca69f7157495bf8: 0 finding(s), 0 as inline comments.

Incremental review of plugins/disk-hygiene/skills/clean/scripts/ranking_signals.py since 6c8ed0f. The only change is a comment spelling edit (neighbour → neighbor) on the MTIME_CLUSTER_WINDOW_NS comment. It changes no executable code, constant, trust control, instruction surface or manifest. It has no security-relevant surface.

No security findings.

critical-findings: 0

No spend to note, and no hold.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 9109abfdde5fd83be644df8c2ca69f7157495bf8: 0 finding(s), 0 as inline comments.

Incremental review of 9109abf against 6c8ed0f: the only change is in plugins/disk-hygiene/skills/clean/scripts/ranking_signals.py. It is a comment edit ("neighbour" → "neighbor") above MTIME_CLUSTER_WINDOW_NS. No code, constant value or behavior changed, so there is nothing to flag.

The file is not on the trusted-paths list. No manifest files changed, and the change adds no spend or billing. I did not re-review the other nine files; they are unchanged since the last review of this lane. I did not read the PR context file, so I did not check the PR's closing-issue criteria against this change.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head ab8546642e3812910d9daebdb7deea2b60d7afa8. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 9109abfdde5fd83be644df8c2ca69f7157495bf8.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit ce4fdb4 Oct 27, 2026
38 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-3858-40587656008-1 branch October 27, 2026 22:54
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.

disk-hygiene: implement the ranking signals the provenance mandate currently rests on nothing

0 participants