Skip to content

refactor(harness-config): simplify lib scope, report and pattern helpers - #15428

Merged
melodic-automation-lanes[bot] merged 2 commits into
mainfrom
work-resolve-issue/issue-14493-43092729825-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14493

Summary

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

Simplified three of the four listed harness-config lib files without changing behavior. resolve-scopes.sh collapses the user-dir and installed-registry if/elif ladders into one parameter-expansion default chain each (same order: non-empty override, then env or user dir, else empty; safe under set -u and bash 3.2) and drops the override local in project_root_to. persist-report.sh drops the *_GIVEN flags, which were redundant because each value starts empty and the -z checks alone reach the same die messages and exit 2. permission-patterns.sh merges two comment paragraphs that repeated the runner-separator and nested-parentheses notes, keeping every fact; the regex values are byte-identical. jq-install-hint.sh was reviewed under the same four checks and left unchanged: it is already minimal and builtins-only by design.

Not verified

  • Did not run the harness-config bash test suites (lib/persist-report.test.sh, lib/permission-patterns.test.sh and the audit-script suites that source resolve-scopes.sh) directly: this lane's Bash runs only the named wrappers. Left to the PR's CI.
  • ai-slop:audit fix ran as a rubric read only: detect.sh and digest-guard.sh cannot run under this lane's Bash allowlist, so the deterministic detector and the fix-flow run directory were skipped for the one-line changelog fragment.
  • Changes left uncommitted in the working tree per the lane instructions; the runner turns them into a patch.
  • ci-status green is checked on the pull request by CI.

Fix

  • plugins/harness-config/lib/resolve-scopes.sh: user_dir_to and installed_registry_to are each one printf -v over a nested default expansion; project_root_to reads ${2:-} directly instead of through a local
  • plugins/harness-config/lib/persist-report.sh: removed the PLUGIN_DATA_GIVEN, COMPONENT_GIVEN and REPORT_GIVEN flags and their redundant checks
  • plugins/harness-config/lib/permission-patterns.sh: comment-only; folded the duplicated RUNNER-separator and one-level-parentheses paragraphs into the alternative list and the specifier paragraph, and shortened the SC2034 note
  • .changes/harness-config/work-resolve-issue-issue-14493-43092729825-1-4774d0b8.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 8722b77:

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

The run reports:

  • check-changelog-fragments: all 15 fragments valid (run before and after tidy and review)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 13 passed, 6 skipped over 4 changed files, run before and after the review fix
  • fresh-context review subagent over the full diff: no behavior or lint problems; one dropped comment fact (parentheses inside the specifier are literal), restored in permission-patterns.sh
  • grep across plugins/harness-config: no file references the removed _GIVEN variables; scopes:: callers pass the same arguments and get the same values
  • tidy-diff over the changed lines: passes 1-3 found nothing further to edit; write-for-humans found nothing to change in the mandated fragment line; ai-slop rubric read of the fragment found no tells
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43092729825

Left out: the items under Not verified.

Related

#14493

Merge-Risk: max=MEDIUM demote=false head=5da1e889e528b6f7fd1ae071d63bbde0455d5385 rubric=8.4.5 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #15428 (head 5da1e88)

No security issues found. I read every hunk of all 4 changed files. This review was blocking only: the lane already reviewed an earlier head (8722b77), so only CRITICAL and IMPORTANT findings would be reported. That earlier review posted no findings, so nothing carries over.

  • plugins/harness-config/lib/resolve-scopes.sh: the new parameter-expansion chains give the same results as the old if/elif ladders.
    • ${2:-…} and ${CLAUDE_CONFIG_DIR:-…} fall through when the value is unset or empty, as the old -n tests did.
    • ${HOME:+$HOME/.claude} and ${3:+$3/plugins/installed_plugins.json} come out empty when the input is unset or empty, as the old else branches did.
    • Each value is still written with printf -v "$1" '%s' …, so nothing is run as code or used as a format string. project_root_to now reads ${2:-} and $2 directly; the non-empty check guards $2, so this is safe under set -u.
  • plugins/harness-config/lib/persist-report.sh: the *_GIVEN flags it drops were redundant.
    • Each variable is set to "" before the parse loop, and need_value still rejects a flag given with no value.
    • A flag given with an explicit empty value still fails the -z check and gets the same die as before.
    • The checks after it all still run: the --plugin-data case, the --component regex, and the --report file-and-readable check. Nothing gets through that the base rejected.
  • plugins/harness-config/lib/permission-patterns.sh: only comments changed. The regex values (CCPERM_BALANCED_ERE, CCPERM_P1_*) are byte-identical, so the drop-vocabulary detector matches exactly what it matched before.
  • .changes/harness-config/...md: a changelog fragment with no executable content.
  • permission-patterns.sh and resolve-scopes.sh change file mode from 100644 to 100755. Both are define-only libraries that are sourced, not run, so the new mode grants nothing.

No changed file matches a trusted-path glob. The PR changes no trust control, plugin manifest or standing instruction (CLAUDE.md, AGENTS.md, a rules file, or a skill or agent body). The PR context holds no embedded instructions.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review: PR #15428, simplify the harness-config lib helpers

Blocking-only review. This lane already reviewed an earlier head (8722b77), so this pass reports blocking findings only. I read every hunk of all 4 changed files. I found nothing that blocks the merge.

Behavior check (read by hand, no tests run):

  • resolve-scopes.sh user_dir_to: ${2:-${CLAUDE_CONFIG_DIR:-${HOME:+$HOME/.claude}}} checks the same things in the same order as the old ladder: the override if non-empty, then CLAUDE_CONFIG_DIR if non-empty, then $HOME/.claude if HOME is non-empty, else empty. set -u does not fail on it.
  • installed_registry_to keeps the same result. project_root_to now reads ${2:-} directly, with the same result.
  • persist-report.sh: L81-L84 sets each value to "" before the parse loop, so the -z checks alone reach the same die messages and exit code 2. Dropping the *_GIVEN flags changes no behavior.
  • permission-patterns.sh: only comments change, the regex assignments are unchanged context lines, and the merged comments still say everything the old ones did.
  • Changelog fragment: bump: patch, ### Changed, and the exact line the issue asks for.

Closing issue #14493 acceptance criteria: the behavior, scope, size and fragment criteria are met. "ci-status is green" is left to CI. The PR body's verification results are the author's claims; I did not check them.

Earlier advisory finding, not repeated: the earlier review's advisory note (comment) still applies at this head. permission-patterns.sh and resolve-scopes.sh change mode from 100644 to 100755, and nothing in the PR mentions it. A blocking-only review drops advisory findings, so it is not posted or counted here.

There are no plugin manifest changes and no matching .claude/rules/ path rules. I found no embedded instructions in the PR context. Spend: none beyond normal CI review runs.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 8722b7738d6818a0acd5c954a0b72028a30816c6. 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)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 5da1e88

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-15428-5da1e889e528b6f7fd1ae071d63bbde0455d5385, 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 646c8b1 Nov 11, 2026
60 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14493-43092729825-1 branch November 11, 2026 23:24
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 2, survived 4, timeout 1, no coverage 0, invalid 0, not run 0.
Covered-code score 43%; mutation score 43%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-config/lib/persist-report.sh 0 3 0 0 0 0
plugins/harness-config/lib/resolve-scopes.sh 2 1 1 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-config/lib/persist-report.sh:118 SBR productive no-assertion
plugins/harness-config/lib/persist-report.sh:131 SBR productive no-assertion
plugins/harness-config/lib/persist-report.sh:142 SBR productive no-assertion
plugins/harness-config/lib/resolve-scopes.sh:55 other productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 646c8b162ab4b317da37ede6e74d35512634d146; 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 lib harness-config plugin code

1 participant