Skip to content

refactor(disk-hygiene): simplify lib and scripts helpers without behavior change - #15148

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14447-42880094466-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14447-42880094466-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14447

Summary

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

Simplified five of the six listed disk-hygiene files without changing behavior. The biggest change: engine_grammar.match_invocation now returns explain_mismatch(...) is None instead of repeating the same grammar walk, so the two can no longer drift apart. explain_mismatch now builds its message text only when it refuses a value. The rest are small cleanups: early returns collapsed, conditions folded, a dict lookup in place of an if chain, getattr for O_CLOEXEC, and break in place of an inner return. plugin_cache_versions.py is left unchanged because it is a byte-identical shared copy of plugins/harness-ops/lib/plugin_cache_versions.py (scripts/cross-plugin-source-registry.txt). Editing it would mean editing the canonical copy in another plugin, which is outside this issue's file list.

Not verified

  • plugins/disk-hygiene/lib/plugin_cache_versions.py not simplified: it must stay byte-identical to the canonical plugins/harness-ops/lib/plugin_cache_versions.py, which is outside this issue's file list
  • Python unit suites (plugins/disk-hygiene/lib/test_*.py, skills/clean/scripts/test_hygiene.py) not run directly here: this lane runs no interpreter, and check-affected does not name which suites its 14 passes cover. Left to the PR's CI
  • Review note: when match_invocation refuses an input it now also formats a message. A non-string word would now raise TypeError where the old code returned False. Both callers pass parsed shell string tokens, so no caller can reach this
  • Tidy passes 4 and 5 (write-for-humans, ai-slop fix) skipped on the changelog fragment: the issue's acceptance criteria fix its text word for word. Passes 1-3 ran on the code lines and found nothing further to change
  • ci-status green is checked on the PR's CI

Fix

  • plugins/disk-hygiene/lib/engine_grammar.py: match_invocation delegates to explain_mismatch, removing the duplicate walk; value_problem builds its refusal message lazily through an elif chain and an external_ok helper; the explain_mismatch docstring now states the relationship
  • plugins/disk-hygiene/lib/guard_decision_log.py: _clip uses str(value); build_record iterates (extra or {}).items(); _open_append folds O_CLOEXEC in with getattr
  • plugins/disk-hygiene/lib/hook_telemetry.py: emit() collapses its two early returns and the multi-line envelope call
  • plugins/disk-hygiene/lib/killswitch_config.py: _interpret uses a dict lookup; _is_trusted_managed_file combines its stat checks into one condition and returns the final access check directly, keeping the same evaluation order
  • plugins/disk-hygiene/scripts/test-wrapper-lib.sh: interpreter_to breaks out of the loop instead of an inner return 0; the trailing return 0 still sets the exit status
  • .changes/disk-hygiene/work-resolve-issue-issue-14447-42880094466-1-6a952f36.md: new patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 71c994c:

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

The run reports:

  • check-changelog-fragments: all 4 fragments under .changes/ valid (run before and after review)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 14 passed, 5 skipped (typos not installed; three validate-plugins steps that run checked-tree code; changed-skills with no skill file), over 6 changed files
  • fresh-context review subagent compared each file against HEAD: no reachable behavior change. It confirmed match_invocation agrees with the old walk for the required head, optional tail, repeatable, requires, one_of, external checks and unknown subcommands; message text is identical;…
  • git-read diff --numstat HEAD: 37 added, 89 removed lines across 5 code files, plus a 7-line fragment
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42880094466

Left out: the items under Not verified.

Related

#14447

Merge-Risk: max=HIGH demote=true head=5f8ac0af9ecc60a606bda7f21e0263b84a672f0d rubric=8.3.5 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 71c994c4476bb0d15b03f55ca6611b9115745c79. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

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

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 5f8ac0af9ecc60a606bda7f21e0263b84a672f0d: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15148, incremental since 71c994c4

I found no security issues in this push.

critical-findings: 0

This was a blocking-only review, because this lane already reviewed an earlier head, so I would only have reported CRITICAL or IMPORTANT findings.

What changed: One file is in scope, plugins/disk-hygiene/scripts/test-wrapper-lib.sh. The API returned no patch for it, so I read the file at head. The full diff's index line for this file now reads 100644 on both sides (pr.diff header). The executable bit (100644 → 100755) noted in the last review is gone, and this push appears to change only that mode bit. The content still matches the reviewed change: inside test_wrapper::interpreter_to, return 0 became break, followed by the function's existing trailing return 0 (L45-L56). The file is a library that wrappers source and is never run on its own, so removing the executable bit has no security impact.

Scope checks: This push touches no trust control, plugin manifest, workflow, token scope, instruction file or trusted path. Nothing it spends needs a hold.

The last review's summary comment (no line anchor) reported no findings, so there is nothing to restate.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 71c994c4476bb0d15b03f55ca6611b9115745c79; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 5f8ac0af9ecc60a606bda7f21e0263b84a672f0d: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #15148

Scope. This pass covers only what changed since 71c994c4, which is one file: plugins/disk-hygiene/scripts/test-wrapper-lib.sh. The incremental diff has no patch for it, so I read the file at head and the full PR diff to see what changed.

Result: 0 findings.

  • The mode change is reverted. The full PR diff now shows index d4c8a559..7a6eb1af 100644 for this file, with no old mode/new mode lines. The file is back to 100644, the same as on the base. That fixes my earlier finding about the unexplained 100644 → 100755 change. Its thread is resolved, and the fix commit is this head.
  • The content did not change. The only edit in this file is still return 0 → break inside test_wrapper::interpreter_to, with the trailing return 0 kept (L49-L55). It behaves the same as the old inner return.

Closing issue #14447. With the revert, nothing is left against "Behavior unchanged". The other criteria stand as assessed in the last review. I have not verified that ci-status is green; the author says the PR's CI will check it.

This review was blocking only, because this lane already reviewed an earlier head. No manifest, paved-path or .claude/rules items apply.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM613KlH
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 5f8ac0a.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 5f8ac0a

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-15148-5f8ac0af9ecc60a606bda7f21e0263b84a672f0d, 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 aeafe2d Nov 10, 2026
64 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14447-42880094466-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 lib and scripts disk-hygiene plugin code

0 participants