Skip to content

feat(planning): re-pin several interview-defenses digests in one repin.sh call - #10347

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-8756-40390438409-1
Oct 26, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #8756

Summary

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

repin.sh now takes \[--test-file <path>\] <pin-label>... <justification>: it resolves every label before any write, refuses the whole call with the file unchanged when a label matches no pin, several pins, or a pin an earlier label already named (exit 3), or when a named pin has nothing to re-pin (exit 4), then rewrites each pin, prints one old -> new line per pin, reruns the suite once and ends PASS or FAIL. Per the recorded decision on the issue (2026-10-26), the plan-time pin listing and the per-label prompt were dropped, so this PR builds only the multi-label form. Each pin's new digest is read from the failure line naming its label, so pins that share a stale literal each get their own digest.

Not verified

  • plugins/planning/tests/repin.test.sh and interview-defenses.test.sh were not executed in this run: this lane's Bash runs only the named wrappers, and check-affected with no arguments does not run test suites (its --tests mode does). The new repin.sh code and test cases were checked only by review, s
  • Shellcheck and the other CI-only scanners check-affected lists (e.g. purged-em-dashes, test-tmp-cleanup, editorconfig) were not run here; they are left to the PR's CI.
  • The fixture's inner sha_of in repin.test.sh calls sha256sum with no shasum fallback (unchanged code from before this PR), so the suite may not run on a Mac without sha256sum; not changed here.

Fix

  • plugins/planning/tests/repin.sh: accepts several labels before one justification; resolves all labels first (exit 3 on unknown, ambiguous or repeated pin, file unchanged); exit 4 with the file unchanged when any named pin has no new digest; reads each pin's new digest from the failure line naming it
  • plugins/planning/tests/repin.test.sh: adds a four-pin stand-in fixture and cases for a three-label call (exit 0, one PASS, three correct old -> new lines from a shared stale literal, nine differing lines, unnamed pin untouched, justification above each call, re-pinned file passes) and for several
  • plugins/planning/tests/interview-defenses.test.sh: header comment and REPIN_HINT name the multi-label form (comments and the hint string only; no pin or digest changed)
  • .changes/planning/feat-8756-repin-several-labels-3f9c1a72.md: new minor changelog fragment for the planning plugin

Verification

The runner ran each check from the base copy against 1579f0f:

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

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 5 fragments under .changes/ valid
  • .lane/checks/bin/check-affected (no arguments): 10 passed, 6 skipped, 0 failed over 4 changed files
  • .lane/verify/bin/cant-fail-scan --file plugins/planning/tests/repin.test.sh --check: PASS, no gating findings, 1 test file fully read
  • fresh-context subagent review of the whole diff (desk-check of every new and existing repin.test.sh case through repin.sh, heredoc escaping, awk rewrite, bash 3.2 and set -u): no confirmed bug; one likely risk found and fixed (the old-digest fallback could give one pin another's digest when pins sha
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40390438409

Left out: the items under Not verified.

Related

#8756

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

Copy link
Copy Markdown
Contributor

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

No security issues found in this pull request.

critical-findings: 0

Scope read. I read the whole diff and the PR context. The four changed files are plugins/planning/tests/repin.sh, repin.test.sh, interview-defenses.test.sh (a comment and the REPIN_HINT string only) and a changelog fragment. None matches a trusted-path glob, none is a trust control, and there is no plugin manifest change. I did not run the scripts.

repin.sh data flow.

  • Digest values. The old digest comes from a line already filtered to match ^\s*"[0-9a-f]+"\s*$ with a length of 66. The new digest is captured by [0-9a-f]\{64\}. Both are pure hex, so interpolating them into the sed patterns and the awk -v values adds no injection path.
  • Labels and justification. Labels reach awk through ENVIRON and are matched with index(), not as a regex. The justification also travels through ENVIRON and is only printed, never passed to sub(). Newlines and blank values are rejected before any write.
  • Line numbers. The line-number lists (call_lines, sha_lines) come from awk NR output and are not caller-controlled. They are space-joined and re-split inside awk, which is safe because every value is numeric.
  • All-or-nothing writes. All labels are resolved and all new digests are computed before the single write, and the exit 3 and exit 4 paths happen before the file is touched. The code gives no way for one pin to take another's digest, because the fallback to the old-digest line requires exactly one such line.
  • --test-file. The script runs bash "$test_file" and rewrites it. That is existing behavior, and the path is chosen by the invoker, not by untrusted PR content.

Not a hold. The change widens a developer convenience tool (one call, several digest re-pins). It does not touch any merge hold, token, kill switch or trusted-actor control. The repository already lets any session re-pin a digest, and the PR review still judges each re-pin against the guarded text. The change spends no billed resource.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 1579f0fea7d43ff2e50f4c301e775bb9890d2e5b: 0 finding(s), 0 as inline comments.

No findings. I read the whole diff and the PR context. I did not run repin.sh or either test suite, because this lane has no shell.

Closing issue #8756. All four acceptance criteria are met, and each has a test that could fail if it broke:

  • Three labels, one justification, ends PASS. The three-label case in repin.test.sh checks exit 0 and a single PASS, one old -> new line per pin, nine differing lines, the unnamed pin untouched, and the justification above each call. It also checks that the re-pinned file passes. The three stale pins share one literal, so the case also exercises per-pin digest selection.
  • One of several labels matches no pin: exit 3, file byte-identical. The alpha file / gamma / beta file case checks the exit code and compares the file with cmp.
  • Existing single-label cases pass unchanged. The diff only adds to repin.test.sh. From reading the diff, the single-label path should behave as before. The new code reads the pin's want X, got Y line by label, where the old code took the first line with the old digest.
  • Usage line and header name the multi-label form. Both do. REPIN_HINT and the suite header comment in interview-defenses.test.sh were updated too.

What I checked in repin.sh.

  • Every label is resolved before any write, so the exit 3 and exit 4 paths leave the file unchanged.
  • The awk rewrite keys on the original line numbers. Both the comment insertion and the sha replacement use the pre-edit NR, so inserting comments does not shift later pins.
  • A label that names the same pin twice exits 3 through the continue 2 duplicate check.
  • The empty-array guard ${call_lines[@]+...} and ${!#} are bash 3.2 safe under set -u.
  • I matched the per-pin digest lookup against the real failure messages in interview-defenses.test.sh (lines 256, 276, 294, 311, 331). Each message starts with $label —, and none of the real labels is a substring of another. The label-substring lookup therefore picks the right line for the real pins.

Not covered by a test. The fallback in repin.sh that takes the old-digest line when no failure line names the label has no test. Every real failure message includes the label, so I did not report it.

Cost. None. The change touches a test helper script and a changelog fragment (bump: minor, matching an added capability). No file matches the trusted paths.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 1579f0fea7d43ff2e50f4c301e775bb9890d2e5b.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit cd6aaf8 Oct 26, 2026
42 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-8756-40390438409-1 branch October 26, 2026 21:39
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.

perf(planning): surface digest re-pins at plan time and re-pin several labels in one repin.sh call

0 participants