Skip to content

refactor(harness-memory): simplify stateless scope-report and enumerate scripts - #15491

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14506-43138005543-1
Nov 12, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14506

Summary

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

scope-report.sh replaces its two presence helpers (exists, dir_exists) and the five row "x" "$(exists "$p")" "$p" calls with one presence_row <label> <-f|-d> <path> helper. Each scope row now names its path once and spawns no command-substitution subshell, and the printed bytes are unchanged. enumerate-all-projects.sh drops the shopt -u nullglob that ran just before the script exits, since no glob follows it. Both scripts were already lean after an earlier simplification pass, so the diff stays small rather than inventing churn.

Not verified

  • scope-report.test.sh and enumerate-all-projects.test.sh not executed: this lane runs only the named wrappers, no bash test runner. Left to the PR's CI
  • tidy recorded as skipped: pass 5's deterministic detector (ai-slop detect.sh) cannot run under this lane's Bash allowlist, so only its rubric half ran on the changelog fragment
  • build/test step (verify) skipped for the same reason as the test suites; shellcheck not invoked directly beyond what check-affected runs
  • the check-changed-skills WARN on the stateless SKILL.md description length predates this change and is out of scope (skill text is excluded by the issue)
  • untracked root dotfiles (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) appear in git status. They are runner/sandbox artifacts this run neither created nor touched and are not part of the change

Fix

  • plugins/harness-memory/skills/stateless/scripts/scope-report.sh: exists/dir_exists plus the inline row calls replaced by one presence_row helper; same rows, same PRESENT/absent values, same exit paths
  • plugins/harness-memory/skills/stateless/scripts/enumerate-all-projects.sh: removed the redundant shopt -u nullglob after the loop (nothing after it globs; the script exits 0)
  • .changes/harness-memory/work-resolve-issue-issue-14506-43138005543-1-92e159b8.md: patch fragment from new-changelog-fragment, body ### Changed / - Internal simplification, no behavior change.

Verification

The runner ran each check from the base copy against 6d5bbee:

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

The run reports:

  • check-changelog-fragments: all 6 fragments under .changes/ valid (run before and after tidy)
  • check-changed-skills: stateless PASS, 0 errors, 1 warning (pre-existing description length 620 > 419 warn setting; the description was not touched)
  • check-affected: 13 passed, 6 skipped over 3 changed files (run before and after tidy)
  • fresh-context review subagent over both scripts and their tests: no findings. test -f|-d "$3" with two args matches \[\[ -f/-d \]\] for empty, dash-leading and operator-like paths; no set -e, so presence_row's status changes no flow; nothing after the loop in enumerate-all-projects.sh globs; no…
  • code-tidying:tidy-diff over the 4 changed-hunk rows: passes 1-4 made no edits; pass 5 ran the ai-slop rubric by reading the fragment's one line, no findings
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43138005543

Left out: the items under Not verified.

Related

#14506

Follow-ups

  • Pre-existing (advisory): **Advisory: the tests cover only part of the "Behavior is unchanged" criterion for 'presence_row'.** (thread)

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15491 (head 6d5bbee)

I found no security issues.

I read every hunk of all 3 changed files. None of them matches a trusted-path glob, and the PR doesn't touch any trust control, merge hold, instruction surface or plugin manifest.

  • plugins/harness-memory/skills/stateless/scripts/scope-report.sh: the PR replaces the exists / dir_exists subshell helpers with presence_row <label> <-f|-d> <path>.
    • Every call site passes the operator as a literal -f or -d. It never comes from input, so the operator position of test can't be injected.
    • The paths come from the local CLAUDE_CONFIG_DIR, HOME and the project base, the same inputs the old code used.
    • With two arguments, test treats a path that starts with a dash or looks like an operator as a plain operand, the same as [[ -f ]].
    • The script only checks whether each path exists. It reads none of them, and it prints the same output as before.
  • plugins/harness-memory/skills/stateless/scripts/enumerate-all-projects.sh: the PR removes a trailing shopt -u nullglob. No glob runs after it before the script exits, so behaviour doesn't change.
  • .changes/harness-memory/...md: a changelog fragment (prose only).

Nothing in the PR context file tries to give the lane instructions.

critical-findings: 0

@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 6d5bbee940b97ba70d184a1e043a041502a71ab0; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 6d5bbee940b97ba70d184a1e043a041502a71ab0: read 3 of 3 changed file(s); 1 finding(s), 1 as inline comments.

Code review: PR #15491 (refactor(harness-memory): simplify stateless scope-report and enumerate scripts)

No correctness issues found. I read every hunk of all 3 changed files and the full head versions of both scripts. I did not run the tests or shellcheck; the PR body's "Verification" section is the author's own claim and I have not checked it.

What I checked

  • scope-report.sh presence_row (L34-L38): test "$2" "$3" is the two-argument form of test with a unary operator. It gives the same answer as the old [[ -f/-d "$p" ]] for an empty path, a path starting with a dash, and paths like ! or =. That matters because mscope::base_file / mscope::dropin_dir can return an empty string. The script uses set -uo pipefail without -e, so the function's exit status changes no control flow. The five rows still print the same label, state and path in the same order through the unchanged row printf.
  • No other callers. Nothing in plugins/harness-memory uses the removed exists / dir_exists helpers (checked with grep).
  • enumerate-all-projects.sh: nothing after the loop globs, and the script ends with exit 0, so removing shopt -u nullglob changes no output.
  • Changelog fragment: bump: patch with the body ### Changed / - Internal simplification, no behavior change., as acceptance criterion 5 requires.

Closing issue #14506 acceptance criteria

  • "Behavior is unchanged…": met by reading the code. The tests only partly cover it; see the inline advisory.
  • "The diff edits only the listed files… and changelog fragments": met (the 2 listed scripts plus 1 fragment).
  • "within 400 changed lines and 15 hand-edited files": met (about 20 lines).
  • "ci-status is green": I can't see it from this lane, so I did not count it as met.
  • Fragment criterion: met.

Other notes

  • Path-scoped rules: .claude/rules/skill-bodies-state-current-rules.md and cost-claims.md match plugins/*/skills/**. The one new comment states current behavior and makes no cost claim, so nothing breaks either rule.
  • No plugin manifest changed, so there are no manifest lines.
  • The PR context contains no instructions aimed at this lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 6d5bbee.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 6d5bbee

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-15491-6d5bbee940b97ba70d184a1e043a041502a71ab0, expires on 2026-12-12.

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 12, 2026
Merged via the queue into main with commit 31ddc6e Nov 12, 2026
75 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14506-43138005543-1 branch November 12, 2026 03:02
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 2, survived 5, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 29%; mutation score 29%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-memory/skills/stateless/scripts/scope-report.sh 2 5 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-memory/skills/stateless/scripts/scope-report.sh:35 other productive no-assertion
plugins/harness-memory/skills/stateless/scripts/scope-report.sh:36 UOI productive no-assertion
plugins/harness-memory/skills/stateless/scripts/scope-report.sh:60 other productive no-assertion
plugins/harness-memory/skills/stateless/scripts/scope-report.sh:61 other productive no-assertion
plugins/harness-memory/skills/stateless/scripts/scope-report.sh:68 other productive no-assertion

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 31ddc6e9768ee1b76bb06e3aa95ec46d768e89ee; 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 stateless harness-memory plugin code

0 participants