Skip to content

guardrails: block-noncanonical-commit remediation is bash-heredoc-only — unusable from PowerShell #1047

Description

@kyle-sexton

Parent

Refs #912 (audit umbrella; finding F3).

What to build

block-noncanonical-commit.sh's BLOCKED remediation text tells the caller to use git commit -F - --cleanup=verbatim <<'EOF' … EOF — a bash heredoc that does not run in PowerShell or cmd. On Windows-primary machines (PowerShell tool primary; and after #915 broadens the matcher, PowerShell-tool traffic hits this guard directly) the remediation is unusable as pasted.

Make the remediation shell-agnostic or shell-aware: either present both forms (bash heredoc + PowerShell pipeline equivalent, e.g. a here-string piped to git commit -F - --cleanup=verbatim), or detect the invoking tool (tool_name in the hook payload) and tailor the snippet. Keep the /commit-skill pointer first — it is shell-neutral.

Acceptance criteria

  • A blocked PowerShell-tool (or Windows) caller receives a remediation snippet that runs in PowerShell
  • Bash callers still receive the working heredoc form
  • Test asserts remediation content per invoking-tool context
  • Guardrails version bump + CHANGELOG entry (may batch with sibling guardrails fixes in one wave)

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowNice-to-have, cosmetic, or speculative; opportunistic.status: readyTriaged, unblocked, and fully specified; eligible to pick up.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions