Skip to content

refactor(corrections): simplify findings-buffer and prove-check scripts - #15312

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14437-42989260257-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14437

Summary

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

Simplified five of the nine listed corrections files without changing what they print, return or write. findings-buffer.mjs now reuses its existing physical() helper in checkAdapter and names the adapter verb list once. prove-check.sh routes its exit-2 messages through die/usage_error and drops a redundant env -u, since the script already unsets those GIT_* variables at the top. group-findings.mjs, buffer.sh and conformance.sh get smaller one-line simplifications. codify-settings.mjs, append.sh, read.sh and redact_rows.py are left as they were: none had a simplification that both stays inside its own file and is clearly behavior-preserving. The shared sayErrors/conventionHome code in codify-settings.mjs and findings-buffer.mjs, and the --since validation in buffer.sh and read.sh, are cross-file dedupes, which the issue leaves to the restructuring pass.

Not verified

  • Unit/regression suites (prove-check.test.sh, findings-buffer tests, conformance.sh) were not executed: this lane cannot run interpreters; left to the PR's CI
  • tidy: passes 1-3 ran and changed nothing; passes 4-5 (markdown) were skipped because the fragment's only line is the text the issue's acceptance criteria require word for word
  • build/lint beyond check-affected (typos not installed; validate-plugins sub-checks that run code from the checked tree were skipped by check-affected)
  • ci-status green: left to the PR's CI
  • The working tree has untracked files this run did not create (.bash_profile, .bashrc, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc), apparently from the runner environment; they are not part of this change and should not go into the patch

Fix

  • plugins/corrections/scripts/findings-buffer.mjs: checkAdapter resolves paths through the existing physical() helper instead of inline try/realpathSync blocks; a VERBS constant replaces two copies of the append.sh/read.sh list
  • plugins/corrections/scripts/group-findings.mjs: show() escapes code units with c.split("") instead of indexing over Array(c.length).keys()
  • plugins/corrections/scripts/prove-check.sh: die and usage_error helpers replace eight repeated printf/usage/exit 2 blocks; run_check drops env -u GIT_*, which line 17's unset already covers
  • plugins/corrections/tools/findings-buffer/buffer.sh: the redaction failure exit is one arithmetic exit
  • plugins/corrections/tools/findings-buffer/conformance.sh: grep -c reads a here-string instead of a printf pipe
  • .changes/corrections/work-resolve-issue-issue-14437-42989260257-1-20d47772.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 887bc14:

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

The run reports:

  • check-changelog-fragments: all 6 fragments valid (run twice, before and after tidy)
  • check-changed-skills: no changed skills, nothing to gate (run twice)
  • check-affected: 13 passed, 6 skipped, over 6 changed files (run twice)
  • fresh-context review subagent over the whole diff: no observable behavior change in any hunk (byte-identical messages, same exit codes, split("") matches charCodeAt iteration for surrogate pairs, the here-string adds the same trailing newline as printf '%s\n'); no new lint findings expected
  • plugins/corrections/scripts/prove-check.test.sh read: asserts only exit codes and the 'exit N' stdout lines, which this change does not touch
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42989260257

Left out: the items under Not verified.

Related

#14437

Merge-Risk: max=MEDIUM demote=false head=887bc14b5183c9801c3552df3bfa276079cc726b rubric=8.4.2 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-review reviewed 887bc14b5183c9801c3552df3bfa276079cc726b: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings. I read every hunk of all 6 changed files and checked each rewrite against the head code it depends on.

  • findings-buffer.mjs: checkAdapter now calls the existing physical() helper (L124-L130). That helper also uses realpathSync (not .native) and returns null where the old code caught an error, so the why messages and the order of checks stay the same. VERBS replaces two copies of the same list.
  • group-findings.mjs: UNSAFE has the u flag (L25). An astral match is two UTF-16 code units, and c.split("") returns the same two units in the same order as the old index loop, so the output is unchanged.
  • prove-check.sh: the die and usage_error messages match the old text byte for byte. The values now go through %s arguments, so a % in a ref can't change the format string. Every path still exits 2. Removing env -u in run_check is safe: the unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_CONFIG at L17 already removes those variables from the environment, and nothing sets them again before the subshell runs.
  • buffer.sh: exit $((RC == 2 ? 2 : 1)) gives the same exit codes as the old two lines.
  • conformance.sh: a here-string adds one trailing newline, just like printf '%s\n', empty OUT included. The script runs set -uo pipefail without -e, so a grep -c with no matches still assigns cnt/total as before.
  • Changelog fragment: bump: patch, ### Changed, and the exact line the issue requires. This patch fits a behavior-preserving internal change.

Closing issue #14437, acceptance criteria:

  • Behavior unchanged: met, by my reading of the code above. I did not run anything; the PR's suite results are author-claimed and unverified.
  • Diff edits only listed files plus fragments: met.
  • Within 400 lines and 15 files: met (6 files, small diff).
  • "ci-status is green": not visible to this lane; CI has to confirm it.
  • Fragment for corrections with the required body: met.

The PR edits no plugin manifest, so no manifest lines apply. No .claude/rules/ file's paths: covers these files, and the PR context contains no embedded instructions.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 887bc14b5183c9801c3552df3bfa276079cc726b: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15312 (refactor(corrections): simplify findings-buffer and prove-check scripts)

No security issues found. I read every hunk of all 6 changed files. None of them matches a trusted path, and the PR changes no plugin manifests.

What I checked:

  • plugins/corrections/scripts/prove-check.sh. run_check no longer wraps the check in env -u GIT_DIR -u GIT_WORK_TREE -u GIT_INDEX_FILE -u GIT_CONFIG. That env guard kept a caller's git environment out of a check, so I confirmed something else still does that job. Line 17 unsets exactly those four variables at script start. Nothing between that line and run_check sets or exports a GIT_* variable again. The subshell's bash -c "$check" therefore gets the same environment as before. The new die and usage_error helpers print the same messages and still exit with code 2. $check was already run through bash -c by design, so this change adds no new injection surface.
  • plugins/corrections/scripts/findings-buffer.mjs. checkAdapter now calls the existing physical() helper (L124-L130). That helper wraps realpathSync and returns null on error, so the containment checks are unchanged:
    • resolving each path to its real location;
    • startsWith(root + sep);
    • the regular-file and executable checks;
    • the nested-repository ownership loop.
      VERBS lists the same two files as before.
  • plugins/corrections/scripts/group-findings.mjs. c.split("") returns UTF-16 code units, the same values as charCodeAt(i) over c.length. The escaping of control, bidirectional and zero-width characters is unchanged.
  • buffer.sh (exit $((RC == 2 ? 2 : 1))) and conformance.sh (a here-string in place of printf piped to grep) behave the same as before.
  • .changes/ fragment. Changelog text only.

No standing instruction is deleted or softened, and no trust control, token scope or merge hold is touched. Nothing in the PR text asks the lane to pass the PR, skip a check or drop a finding.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 887bc14

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-15312-887bc14b5183c9801c3552df3bfa276079cc726b, expires on 2026-12-11.

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 11, 2026
Merged via the queue into main with commit 5996285 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14437-42989260257-1 branch November 11, 2026 09:30
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 59962856d439af1b14f174beaf6bb2e9d8f23bc7; later checks count it verified from this comment.

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 scripts, local-file, findings-buffer and 1 more corrections plugin code

0 participants