Repository navigation
Description
Problem
block-root-delete-target drops an allowed root that is a filesystem root, so a / entry in block_root_delete_target_allowed_roots allows nothing on Linux. Under Git Bash the same entry is kept. The guard maps each entry with cygpath before the root check (plugins/guardrails/hooks/block-root-delete-target.sh:2164-2167), and under MSYS / maps to the Git install directory (cygpath -m / prints C:/Program Files/Git/). rdt_root_like (:1374-1376) does not see a root in that path, so the entry survives, and every path the guard maps under it, such as /opt/..., can be deleted recursively.
The owner decided on 2026-10-19 to drop a literal / entry on every host (Decision recorded comment on this issue).
Fix
In plugins/guardrails/hooks/block-root-delete-target.sh, judge the root before the Windows mapping as well as after it:
- In the allowed-roots loop (:2164-2167), also drop the entry when its resolved path before mapping,
${RDT_RES[$c]}, is/. Keep the existing checks on the mapped path. - Apply the same check in the name-prefix directory loop (:2168-2173), on
${RDT_RES[${pdir[k]}]}. - Add no
OSTYPEgate. The file's header (:40-46) forbids one, and the check is host-independent: on Linux the resolved path is/and is already dropped. - Update the comment above the loops (:2156-2157) to say a
/entry is dropped on every host, including where/maps to the Git install directory.
In plugins/guardrails/hooks/block-root-delete-target.test.sh:
- Replace the conditional at :1581-1586 with the one unconditional case
rdt_ar "the root '/' does not allow a top-level path" 2 'rm -rf /opt/rdt-allowed-x/y' /, and change the comment at :1580 to say the guard drops/even where it maps to the Git install directory.
Changelog: a guardrails fragment with scripts/new-changelog-fragment.sh.
Verification
scripts/check-changelog-fragments.sh --checkandscripts/check-affected.sh --uncommittedpass. The PR's CI runsblock-root-delete-target.test.shon Linux, where the changed case passes before and after the fix.- Merger check, outside the lane (this is a
plugins/*/hooks/**change, so a human merges it): runbash plugins/guardrails/hooks/block-root-delete-target.test.shon a Git Bash host and confirm the case that replaces :1581-1586 passes. Before the fix it fails there.pr-test-windows.ymldoes not run this file today.
Activity
github-actions commentedon Oct 19, 2026
Proposed work class: work-class: scoped
Basis: automated intake triage; the lanes App applied this class.
Size: Small
Complexity: Low
Uncertainty: Known
Flags: none
Blocked by: none
Understood: under Git Bash, a literal
/allowed-root maps to the Git install directory and so survives the root check. The guard should drop it on every host by also checking the pre-mapping resolved path. The test and a guardrails changelog fragment need matching updates.The recorded decision, "go w/ recommendations" (drop it), is at #8414 (comment). It settles the open question, so nothing further is asked.
The Git Bash test run is a check after merge on a Git Bash host. It does not block triage.
No duplicates found.
Automated triage, applied by the lanes App.
kyle-sexton commentedon Oct 19, 2026
Decision recorded.
Question: Should the literal
/be dropped from the allowed roots under Git Bash? Options: drop it, keep it, or make it per-platform.Owner's answer (2026-10-19): "go w/ recommendations", which was: drop it.
kyle-sexton commentedon Oct 31, 2026
Decision recorded.
The owner chose to drop a literal
/entry on every host on 2026-10-19 (decision), and at origin/main the guard still judges only the mapped path (plugins/guardrails/hooks/block-root-delete-target.sh:2694-2702) while the test still branches oncygpath -m /(block-root-delete-target.test.sh:1598-1604; these line numbers replace the body's). The body's Git Bash run stays a check after merge on a Git Bash host, outside the list below, and its "a human merges it" note does not apply. Agents decided this on evidence under standing direction §1.Done when
block-root-delete-target.sh:2694-2697), an entry is also dropped when its resolved path before mapping,${RDT_RES[$c]}, is/; the existing checks on the mapped path stay.:2698-2702) applies the same check to${RDT_RES[${pdir[k]}]}.OSTYPEgate is added.:2686-2687) says a/entry is dropped on every host, including where/maps to the Git install directory.block-root-delete-target.test.sh, the conditional at:1598-1604becomes the one unconditional caserdt_ar "the root '/' does not allow a top-level path" 2 'rm -rf /opt/rdt-allowed-x/y' /, and its comment says the guard drops/even where it maps to the Git install directory.scripts/check-changelog-fragments.sh --checkandscripts/check-affected.sh --uncommittedpass.melodic-automation-lanes commentedon Oct 31, 2026
Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.
Intended outcome: The guard drops a literal '/' allowed-root and name-prefix directory entry on every host by also judging the pre-mapping resolved path, with the test and a changelog fragment updated.
Acceptance criteria
External state: none
Related work
Sources read
Automated refinement by the lanes App. Intake triages the issue again with it.
github-actions commentedon Oct 31, 2026
github-actions commentedon Oct 31, 2026
melodic-automation-lanes commentedon Oct 31, 2026
This records a re-fire of an earlier refusal, not a new refusal. The lanes kill switch stopped run 41174105023, the work-resolve-issue run that
agent-readystarted, before it did any work; that run ended at 2026-10-31T06:07:35Z. work-unblock has now removed and addedagent-readyback to start a fresh run. A kill-switch refusal is no fault in this issue or the lanes, so it never counts against later re-fires; after limits.limit-stops-per-issue of them since a person last addedagent-readyor a run last reported, work-unblock waits longer before each one, up to 24 hours.github-actions commentedon Oct 31, 2026
github-actions commentedon Oct 31, 2026