Skip to content

test(guardrails): make block-root-delete-target allowed-roots fixtures host-aware - #8127

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-6627-39105900278-1
Oct 18, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-6627-39105900278-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #6627

Hold: a human merges this

Summary

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

The relative-root fixture now drops a drive prefix as well as a leading slash, so it is relative on Windows Git Bash too. The '/' top-level-path case is skipped with a printed reason where cygpath shows '/' is not a volume root. The guard is unchanged. The issue stays open for the separate question of whether a literal '/' should count as a root under Git Bash.

Not verified

  • Not run on Windows Git Bash (no Windows host here); the issue puts that after merge
  • The separate issue on whether a literal '/' in allowed roots counts as a root under Git Bash was not filed by this run

Fix

  • plugins/guardrails/hooks/block-root-delete-target.test.sh: host-aware relative-root fixture; '/' top-level case skipped on MSYS
  • .changes/guardrails/test-rdt-allowed-roots-windows-fixtures-6627a1c4.md: bump none fragment

Verification

The run reports:

Left out: the items under Not verified.

Related

#6627

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 81813f4282818249907206551cf1280a371385b9: 0 finding(s), 0 as inline comments.

No findings. I reviewed the two changed files, the test-only edit to plugins/guardrails/hooks/block-root-delete-target.test.sh and the bump: none changelog fragment.

  • Relative-root fixture: rdt_rel drops a leading X:/ or a leading /, so the entry is relative on Linux and on Git Bash. It is built from RDT_AR (plugins/guardrails/hooks/block-root-delete-target.test.sh:1489), which comes from mktemp -d under the checkout's .work. The PR says the Windows toplevel is D:/.... I did not run it on Windows.
  • Skipped / case: cygpath -m / is empty on hosts without cygpath, so the case still runs on Linux. It is skipped only when / resolves to something other than a bare / or X:/, which on Git Bash is the install directory. rdt_skip exists (line 749) and bumps the rdt_skips counter that the suite prints at the end (line 2387). The "(1 case)" label matches the one case skipped.
  • Fragment: The changelog fragment is consistent with a test-only change.
  • .claude/rules/ files: None apply beyond mod-authoring.md, which covers hooks modules, not this test script.
  • Closing issue: The PR uses Refs: #6627, so no closing-issue criteria apply. The issue stays open by design.
  • PR body: The Linux result in the PR body (PASS=2500) and the fragment validation are author-claimed. I did not run them. The Windows Git Bash run is explicitly unverified by the author.
  • Coverage gap: The skip means Git Bash loses the /-does-not-allow-a-top-level-path coverage. The author says the separate question of whether a literal / counts as a root there is not yet filed as an issue. That is a gap in what the suite covers, not a defect in this change.

@github-actions

Copy link
Copy Markdown
Contributor

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

No security issues found in PR #8127 at head 81813f4.

The PR changes only a test script, plugins/guardrails/hooks/block-root-delete-target.test.sh, and adds a changelog fragment. The hook itself, which the fragment says is unchanged, is not touched. The diff contains no deleted or softened standing instruction, no workflow or permission change, and no new secret or credential handling.

What I checked

  • The relative-root fixture now strips a Windows drive prefix (D:/) as well as a leading slash. The test still expects exit 2, so an entry that grants nothing must still be ignored.
  • The / top-level-path case is skipped only when cygpath -m / returns something that is not a bare volume root. On Linux and macOS hosts, cygpath is absent and the case still runs. The skip prints its reason and counts the case, so it does not hide a regression silently. This is a coverage trade-off, not an exploitable path.
  • The shell interpolation involves only fixture variables the test itself defines ($RDT_AR, $rdt_rel, $rdt_slash), with no external input.

I did not check whether rdt_skip is defined elsewhere in the test file. That is a correctness question for the code-review lane, not a security one. I also did not consult the instruction exception register, because no instruction surface was removed or weakened.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit 67b8e28 Oct 18, 2026
33 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-6627-39105900278-1 branch October 18, 2026 16:28
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.

1 participant