{
  "schemaVersion": 1,
  "skillId": "mattpocock-git-guardrails",
  "revision": "49dd158d1076134a641b33efb035946536778336",
  "runAt": "2026-10-19",
  "mode": "source-review",
  "summary": "Six source checks completed. Runtime attempted but blocked before Bash could initialize; zero hook cases executed. Literal-pattern and parser-failure concerns remain source findings.",
  "sourceManifest": [
    {
      "path": "skills/misc/git-guardrails-claude-code/SKILL.md",
      "sha256": "69b291d655626a01602b998a1836fcb93c058ede68dfafddfd71e87f17074764",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/SKILL.md"
    },
    {
      "path": "LICENSE",
      "sha256": "0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/LICENSE"
    },
    {
      "path": "skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh",
      "sha256": "234922b83c0a1737ee7300806c21ac0f389b07aaeb65c2d71ccedafbc5e1ea4b",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh"
    },
    {
      "path": "skills/misc/README.md",
      "sha256": "95f0b467b7f3a2bb27421c6536f35392b6846f5ad26b44ab7df00380ed02edf0",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/README.md"
    }
  ],
  "cases": [
    {
      "id": "settings-scope",
      "method": "source-review; exact source condition checked, no workflow executed",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/SKILL.md",
      "expected": "Ask the user: install for **this project only**",
      "observed": "The setup asks the operator to choose project or global scope; this review installed neither.",
      "passed": true
    },
    {
      "id": "bash-only-hook",
      "method": "source-review; exact source condition checked, no workflow executed",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/SKILL.md",
      "expected": "\"matcher\": \"Bash\"",
      "observed": "The documented hook matches Bash tool calls; it does not cover every host tool or execution path.",
      "passed": true
    },
    {
      "id": "merge-existing-settings",
      "method": "source-review; exact source condition checked, no workflow executed",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/SKILL.md",
      "expected": "Don't overwrite other settings.",
      "observed": "The source asks for a merge with existing PreToolUse hooks rather than replacing settings.",
      "passed": true
    },
    {
      "id": "literal-pattern-matching",
      "method": "source-review; exact source condition checked, no workflow executed",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh",
      "expected": "grep -qE \"$pattern\"",
      "observed": "The implementation searches literal regular-expression patterns instead of parsing Git command syntax.",
      "passed": true
    },
    {
      "id": "json-parser-dependency",
      "method": "source-review; exact source condition checked, no workflow executed",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh",
      "expected": "jq -r '.tool_input.command'",
      "observed": "The hook needs jq. The setup instructions do not install or verify that dependency.",
      "passed": true
    },
    {
      "id": "final-success-path",
      "method": "source-review; exact source condition checked, no workflow executed",
      "sourceUrl": "https://github.com/mattpocock/skills/blob/49dd158d1076134a641b33efb035946536778336/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh",
      "expected": "exit 0",
      "observed": "The hook ends successfully when no pattern matches and contains no explicit jq-status or JSON-schema validation. This is source analysis; execution was blocked by the environment.",
      "passed": true
    }
  ],
  "results": {
    "passed": 6,
    "failed": 0,
    "total": 6
  },
  "findings": [
    {
      "severity": "high",
      "title": "Substring patterns are not a Git permission boundary",
      "detail": "The script searches for literal phrases such as git push. By source inspection, global Git options, tabs or a quoted executable can avoid those exact phrases, while a harmless quoted description can match them. Treat this as a convenience warning, not repository protection."
    },
    {
      "severity": "high",
      "title": "Parser errors have no explicit deny path",
      "detail": "The script captures jq output but does not check jq exit status, validate the command field or stop on parser failure. Its final exit 0 means a missing parser or invalid JSON can reach an allow result by source inspection; runtime confirmation is still blocked."
    },
    {
      "severity": "attention",
      "title": "Coverage is limited to the Bash hook",
      "detail": "Other tool names, direct process APIs, host configuration changes and commands outside the listed patterns are not covered by the documented matcher. Keep version-control permissions and backups independent of this hook."
    },
    {
      "severity": "info",
      "title": "Current catalog placement is miscellaneous",
      "detail": "The current repository keeps this entry under misc, outside the promoted plugin set. A high directory install count does not establish active upstream use or maintenance quality."
    }
  ],
  "limitations": [
    "The hook did not execute: the host sandbox prevented Git Bash initialization before any test input could reach it. A scoped execution retry was not run because the automatic approval service reported a capacity error.",
    "Fifteen synthetic JSON cases are supplied in the reproduction harness, but none is counted as an executed hook test. No settings were changed and no represented Git command was executed.",
    "No installed host integration, alternate-shell coverage, exhaustive command parser analysis or security certification. Source review identifies concerns; it does not measure bypass frequency."
  ],
  "methodology": "Each source check records the exact source condition and the scoped observation it supports. Counts measure reviewed conditions, not completed user tasks, security assurance or model effectiveness.",
  "executionAttempts": [
    {
      "status": "environment-blocked",
      "stage": "bash-preflight",
      "exitCode": 3221225794,
      "observed": "Bash could not initialize its MSYS named object in the host sandbox; upstream hook was not executed.",
      "cases": [],
      "results": {
        "passed": 0,
        "failed": 0,
        "total": 0
      }
    },
    {
      "status": "approval-service-unavailable",
      "stage": "scoped-local-runtime-retry",
      "executed": false,
      "observed": "The later retry was not executed because automatic approval review again reported model capacity failure. This was not an unsafe-action determination."
    }
  ]
}
