Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .claude/skills/deep-code-review/references/tool-hub.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The agent sandbox denies installs and most network, so the owner provisions scan
- osv-scanner v2.7.0 stores the DB as `DIR/osv-scalibr/ECOSYSTEM/all.zip`; its offline-mode docs say `osv-scanner/`. Both count as warm. A lockfile whose ecosystem has no DB stays not-run; osv-scanner's `no offline version` message names the fix, `--print DIR` (a DIR always re-downloads: another ecosystem's zip already counts as warm).
- Trivy's DB download fails when `~/.docker/config.json` names a `credsStore` helper that is not installed (seen on one host, not in the docs); the owner line sets `DOCKER_CONFIG` to an empty dir for it.
- `pipx` and `uv tool` install into `~/.local/bin`, which a sandboxed PATH may lack: `review_checks.sh` appends it (`DCR_USER_BIN` overrides, empty disables). `DCR_CACHE_ROOT` overrides the user cache dir. `scrub_env.sh` pins both, so CI tests do not depend on what the host has installed.
- Pins in `provision_tools.sh` (the one place the versions live): pins checked against PyPI, RubyGems, npm, NuGet, Packagist and Hex on 2026-11-18 (every pipx, gem, npm, NuGet, Composer and Hex version exists); `skillspector` is the commit SHA of the `v2.13.6` tag (checked with `git ls-remote --tags` on 2026-11-18). Homebrew rows are unpinned; names are unverified, notably `scorecard`, `gosec`, `nuclei`, `codeql`. `brew info tflint` found no core formula, so `tflint` stays a `terraform-linters/tap` row (tap path unverified). `codeql` installs via `brew install --cask` on macOS only (unverified); on other OSes it prints BLOCKED. `--print` installs each package alone and prints `FAILED <name>` on failure.
- Every run ends with `review_checks: ran X / wired Y scanners; not run: ...; partial: ...; fixable: ...` and records it in `<git-common-dir>/review-checks-last.json`. Wired = had work this run (shellcheck, ruff/pyflakes and `--history` gitleaks too, never fixable); `partial` = ran with a narrower scope (trivy `secret-only`, trufflehog with files it could not scan, semgrep with errors or `bundled-only`: its `p/default` pack did not load, which a snapshot fixes). `perun_doctor.py` shows a WARN `review scanners` row while a wired tool had a fixable cause (osv-scanner's command names this repo as DIR) and INFO for a partial scope or an unfixable cause.

## CLI tools (run by `review_checks.sh`)
Expand Down Expand Up @@ -82,6 +83,7 @@ The agent sandbox denies installs and most network, so the owner provisions scan
| `mcp-scanner` | Not routed (Cisco mcp-scanner, https://github.com/cisco-ai-defense/mcp-scanner, Apache-2.0, tag 4.8.7, fetched 2026-11-14): `--analyzers yara` needs no key and `static --tools FILE` reads a pre-generated tools list, but the README does not define the `--format raw` output shape, and `--config-path` / known-configs scans connect to the listed MCP servers (not offline). Output shape and offline behavior of a config scan are `unverified`, so no row | not run | not routed | not routed |
| `snyk-agent-scan` | MCP and skill configs | not run | needs a `SNYK_TOKEN` and calls the Agent Scan API (no offline mode documented; it can also start MCP servers): never run by the hub (checked 2026-11-15, Apache-2.0, 0.6.11) | route-only |
| `opengrep` | SAST fallback: stands in for `semgrep` when `semgrep` is absent and `opengrep` is installed; same rules dir (repo config, else the bundled rules), never the registry pack; rows keep tool `semgrep` and the closing line says `opengrep` ran | `opengrep scan --config DIR --json --quiet -- FILES` (env `SEMGREP_SEND_METRICS=off`) | unverified (its README shows `scan` and `-f` only; `--config` and `--json` are inherited from semgrep, not confirmed); a crash is `not run`, never clean | route-only, local |
| `opengrep` install source | `provision_tools.sh` does not install it: no Homebrew formula, and the upstream installer is an unpinned script on `main` (no checksummed pin verified) | install it yourself from a release you verified; the route only uses it when present | blocked: no pinned, checksummed install route | route-only, local |
| `scorecard` | OpenSSF Scorecard for the `origin` GitHub repo; checks scoring 0-4 become rows (rule `scorecard-<Check>`, file `.`); -1 (inconclusive) is ignored; a report with no checks, or only -1 checks, is `not run` (`not-checked` row), never a clean score. Opt-in: `REVIEW_SCORECARD=1` plus `GITHUB_TOKEN`; no token is `not run` | `scorecard --repo=github.com/OWNER/REPO --format=json` (token passed as `GITHUB_AUTH_TOKEN`) | verified (`scorecard --help`, 2026-11-12) | route-only, opt-in, network |
| `nuclei` | Conservative, not passive: sends real requests to one running app. Opt-in `REVIEW_DAST_URL`, exact localhost origin only unless `REVIEW_DAST_ALLOW_REMOTE=1`. Allowlist: info and low http templates tagged `tech` or `exposure`, minus `default-login`, `xss`, `ssrf`, `oast`, `fuzz`, `fuzzing`, `takeover`, `cve`, `intrusive`, `dos`, `bruteforce`, `rce`, `sqli`. A failed `curl` probe of the target, or zero templates listed by `nuclei -tl`, is `NOT CHECKED` (an empty scan never reads as clean) | `nuclei -u URL -jsonl -silent -nc -ni -duc -rl 10 -s info,low -type http -tags tech,exposure -etags ...` | flags verified (`nuclei -h`, 2026-11-12); the tag choice is a conservative judgment, not a nuclei-certified safe set | route-only, opt-in, network |
| `zap-baseline.py` | ZAP baseline (a spider that sends real requests, plus passive rules; no active attack scan) against the same `REVIEW_DAST_URL`; uses the local script, else `docker run --pull=never --user "$(id -u)" ghcr.io/zaproxy/zaproxy:stable` only when docker is present and the image is already pulled (a missing image is `not run`, never auto-pulled) | `zap-baseline.py -t URL -J FILE -m 1`; exit 1 and 2 (fail, warn) are findings, 3 and others are `not run` | unverified (not run here; ZAP may follow redirects, so a redirect off the target is still requested and its scope is only what `-t` names; docker `--network host` does not reach the host's localhost on Docker Desktop) | route-only, opt-in, network |
Expand Down
83 changes: 64 additions & 19 deletions .claude/skills/deep-code-review/scripts/provision_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# the tools and their offline caches are provisioned ONCE by the owner, outside the sandbox.
# Default (dry run): list the scanner binaries not on PATH and the cold caches (trivy DB, osv-scanner offline DB, local semgrep p/default
# snapshot). Installs nothing, writes nothing, exit 0.
# --print: emit ONE copy-paste line (type it yourself outside the sandbox, with the `!` prefix) that installs what is missing (brew, pipx, gem;
# pipx pins are the PyPI versions checked 2026-10-29, brew formulae cannot be pinned) and warms the cold caches; it ends with this script's
# --print: emit ONE copy-paste line (type it yourself outside the sandbox, with the `!` prefix) that installs what is missing (brew, brew --cask on macOS only, pipx, gem;
# pins are unverified, see tool-hub.md; brew formulae cannot be pinned) and warms the cold caches; it ends with this script's
# dry run so the result is visible. Nothing missing or cold: a `# nothing to provision` comment. DIR (default: the current dir) is the
# project whose root lockfiles osv-scanner downloads offline databases for (one per ecosystem found there). A DIR given on the command line
# always re-downloads, so `--print OTHER_DIR` adds the ecosystems OTHER_DIR needs.
Expand Down Expand Up @@ -43,42 +43,83 @@ esac
dir=$(cd "$dir" && pwd)
exec 3>&1; [ "$pr" = 0 ] || exec 1>&2 # --print: stdout carries only the one owner line, the listing goes to stderr
self=$(cd "$(dirname "$0")" && pwd)/$(basename "$0")
# binary installer spec
# binary installer spec: BIN how SPEC. how = brew|cask|pipx|gem (SPEC is the package), cmd (SPEC is the whole install command: cargo, go, npm,
# dotnet, composer, mix, uv) or blocked (SPEC is the reason no install line is printed). Every review_checks.sh --list-tools name is covered here or listed with a reason in scripts/test-provision-covers-list-tools.sh.
tools='gitleaks brew gitleaks
trufflehog brew trufflehog
semgrep pipx semgrep==1.182.1
semgrep pipx semgrep==1.186.0
trivy brew trivy
osv-scanner brew osv-scanner
actionlint brew actionlint
zizmor pipx zizmor==1.31.1
zizmor pipx zizmor==1.32.0
bandit pipx bandit==1.9.4
scorecard brew scorecard
gosec brew gosec
grype brew grype
checkov pipx checkov==3.4.5
hadolint brew hadolint
ruff pipx ruff
ruff pipx ruff==0.17.5
syft brew syft
kube-linter brew kube-linter
kube-score brew kube-score
tflint brew tflint
tflint brew terraform-linters/tap/tflint
staticcheck brew staticcheck
brakeman gem brakeman
brakeman gem brakeman -v 8.1.0
kics brew kics
licensee gem licensee
licensee brew licensee
cosign brew cosign
opengrep brew opengrep
nuclei brew nuclei'
nuclei brew nuclei
ansible-lint pipx ansible-lint==26.11.0
cfn-lint pipx cfn-lint==1.60.1
detect-secrets pipx detect-secrets==1.5.0
flawfinder brew flawfinder
guarddog pipx guarddog==3.2.0
mobsfscan pipx mobsfscan==1.2.0
njsscan pipx njsscan==1.0.2
pyflakes pipx pyflakes==4.1.0
slither brew slither-analyzer
codeql cask codeql
cppcheck brew cppcheck
jq brew jq
kubescape brew kubescape
pmd brew pmd
shellcheck brew shellcheck
tfsec brew tfsec
node brew node
go brew go
bundler-audit gem bundler-audit -v 0.9.3
rubocop gem rubocop -v 1.92.3
cargo-audit brew cargo-audit
cargo-deny brew cargo-deny
govulncheck brew govulncheck
retire cmd npm install -g retire@6.1.1
solhint cmd npm install -g solhint@6.2.5
tsc cmd npm install -g typescript@7.0.2
devskim cmd dotnet tool install --global Microsoft.CST.DevSkim.CLI --version 1.0.103
psalm cmd composer global require vimeo/psalm:7.10.0
sobelow cmd mix escript.install --force hex sobelow 0.19.0
opengrep blocked no Homebrew formula and the upstream installer is an unpinned script on main with no checksummed release pin verified: install it yourself from a release you verified
uv brew uv
skillspector cmd uv tool install git+https://github.com/NVIDIA/skillspector.git@e2674da339b0bddc6e565d059c0577c6d9cd25da'
lb=${DCR_USER_BIN-${HOME:-/nonexistent}/.local/bin} # pipx and `uv tool` install here; a sandboxed PATH may lack it
miss=0 cold=0 brew=() pipx=() gem=() fix=()
# dotnet/composer/mix installs land in their own dirs; probe them too (same dirs review_checks.sh adds to PATH; empty DCR_USER_BIN disables all)
dirs=(); [ -z "$lb" ] || for d in "$lb" "${HOME:-/nonexistent}/.dotnet/tools" "${HOME:-/nonexistent}/.composer/vendor/bin" "${HOME:-/nonexistent}/.config/composer/vendor/bin" "${HOME:-/nonexistent}/.mix/escripts"; do [ -d "$d" ] && dirs+=("$d"); done
have() { local d; for d in ${dirs[@]+"${dirs[@]}"}; do [ -x "$d/$1" ] && { echo "$d"; return 0; }; done; return 1; }
miss=0 cold=0 brew=() cask=() pipx=() gem=() oth=() othb=() fix=()
while read -r bin how spec; do
if command -v "$bin" >/dev/null; then echo "ok $bin"; continue; fi
if [ -n "$lb" ] && [ -x "$lb/$bin" ]; then echo "ok $bin ($lb/$bin, not on PATH; review_checks.sh adds $lb)"; continue; fi
echo "MISSING $bin ($how install $spec)"; miss=$((miss + 1))
case $how in brew) brew+=("$spec") ;; gem) gem+=("$spec") ;; *) pipx+=("$spec") ;; esac
if d=$(have "$bin"); then echo "ok $bin ($d/$bin, not on PATH; review_checks.sh adds $d)"; continue; fi
# a cmd entry needs its own toolchain (first word of the command); without it the line would fail, so name the blocker instead
if [ "$how" = blocked ]; then echo "BLOCKED $bin ($spec)"; miss=$((miss + 1)); continue; fi
if [ "$how" = cask ] && [ "$(uname)" != Darwin ]; then echo "BLOCKED $bin (cask install is macOS-only: install it yourself)"; miss=$((miss + 1)); continue; fi
tc=${spec%% *}; [ "$tc" != npm ] || tc=node # npm ships with Homebrew's node
if [ "$how" = cmd ] && ! command -v "$tc" >/dev/null && ! have "$tc" >/dev/null && [[ " ${brew[*]-} " != *" $tc "* ]]; then echo "BLOCKED $bin (needs $tc: install it first, then re-run)"; miss=$((miss + 1)); continue; fi
if [ "$how" = cmd ]; then echo "MISSING $bin (run: $spec)"; else echo "MISSING $bin ($how install $spec)"; fi; miss=$((miss + 1))
case $how in brew) brew+=("$spec") ;; cask) cask+=("$spec") ;; gem) gem+=("$spec") ;; cmd) oth+=("$spec"); othb+=("$bin") ;; *) pipx+=("$spec") ;; esac
done <<<"$tools"
[ ${#gem[@]} -eq 0 ] || brew=(ruby ${brew[@]+"${brew[@]}"})
[ ${#pipx[@]} -eq 0 ] || command -v pipx >/dev/null || brew=(pipx ${brew[@]+"${brew[@]}"})
[ ${#brew[@]} -eq 0 ] || command -v brew >/dev/null || echo "note: brew not found; install Homebrew (https://brew.sh) or use each tool's own installer"
[ ${#brew[@]} -eq 0 ] && [ ${#cask[@]} -eq 0 ] || command -v brew >/dev/null || echo "note: brew not found; install Homebrew (https://brew.sh) or use each tool's own installer${gem[0]+"; without it the gem rows fall back to the system ruby, which is too old and may fail"}"
q() { printf '%q' "$1"; }
cache() { # NAME WARM-FN PATH COMMAND [FORCE]
if [ -z "${5:-}" ] && "$2"; then echo "warm $1 ($3)"; else echo "COLD $1 ($3)"; cold=$((cold + 1)); fix+=("$4"); fi
Expand All @@ -91,9 +132,13 @@ cache "semgrep p/default snapshot" sg_warm "$sgf" "mkdir -p $(q "$(dirname "$sgf
echo "provision_tools: $miss missing, $cold cold; nothing was installed or downloaded (--print emits the one line to run yourself)"
[ "$pr" = 1 ] || exit 0
cmd=()
[ ${#brew[@]} -eq 0 ] || cmd+=("brew install ${brew[*]}")
for p in ${pipx[@]+"${pipx[@]}"}; do cmd+=("pipx install $p"); done
for p in ${gem[@]+"${gem[@]}"}; do cmd+=("gem install $p"); done
# every package installs on its own, so one unknown name or failed install prints FAILED and does not stop the rest; groups join with ;
[ ${#brew[@]} -eq 0 ] || cmd+=("for f in ${brew[*]}; do brew install \"\$f\" || echo \"FAILED \$f\"; done")
[ ${#cask[@]} -eq 0 ] || cmd+=("if [ \"\$(uname)\" = Darwin ]; then for f in ${cask[*]}; do brew install --cask \"\$f\" || echo \"FAILED \$f\"; done; fi") # casks are macOS-only
[ ${#pipx[@]} -eq 0 ] || cmd+=("for f in ${pipx[*]}; do pipx install \"\$f\" || echo \"FAILED \$f\"; done")
# system ruby is too old for these gems: use Homebrew's when brew exists, installing into $DCR_USER_BIN (default ~/.local/bin, on review_checks.sh's PATH)
for p in ${gem[@]+"${gem[@]}"}; do cmd+=("\$(command -v brew >/dev/null && echo \$(brew --prefix ruby)/bin/)gem install $p${lb:+ -n $(q "$lb")} || echo FAILED ${p%% *}"); done
for i in ${!oth[@]}; do cmd+=("${oth[i]} || echo FAILED ${othb[i]}"); done
[ ${#fix[@]} -eq 0 ] || cmd+=("${fix[@]}")
[ ${#cmd[@]} -gt 0 ] || { echo "# nothing to provision" >&3; exit 0; }
cmd+=("bash $(q "$self")") # re-check at the end so the owner sees what is still missing
Expand Down
4 changes: 4 additions & 0 deletions .claude/skills/deep-code-review/scripts/review_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ set -euo pipefail
# pipx and `uv tool` install into ~/.local/bin, which a sandboxed shell's PATH may lack: append it so provisioned scanners are found (DCR_USER_BIN overrides; empty disables)
lb=${DCR_USER_BIN-${HOME:-/nonexistent}/.local/bin}
case ":$PATH:" in *":$lb:"*) ;; *) [ -z "$lb" ] || [ ! -d "$lb" ] || PATH=$PATH:$lb ;; esac
# dotnet/composer/mix tool installs (provision_tools.sh) land in their own dirs; add each that exists (empty DCR_USER_BIN disables)
for td in .dotnet/tools .composer/vendor/bin .config/composer/vendor/bin .mix/escripts; do
td=${HOME:-/nonexistent}/$td; [ -z "$lb" ] || [ ! -d "$td" ] || case ":$PATH:" in *":$td:"*) ;; *) PATH=$PATH:$td ;; esac
done

repo=. base=origin/main tests=0 fuzz=0 hist=0 hyg=0 tmo=60 ran="" nr="" failed="" missing="" gap="" dg="" w1="" nice19=0 lease=ok leased=0 full=0 wr=0 hmax= cov="" wired="" wiredx=""
while [ $# -gt 0 ]; do
Expand Down
2 changes: 2 additions & 0 deletions changelog.d/provision-cask-blocked.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Fixed
- scripts/test-provision-cask-blocked.sh now runs in CI: registered as scripts/ci-tests.d/provision-cask-blocked.sh (it was never executed).
7 changes: 7 additions & 0 deletions changelog.d/provision-covers-list-tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Added
- provision_tools.sh now covers all 55 external tools that `review_checks.sh --list-tools` prints (56 rows in its table; slither and scorecard added). pipx, gem, npm, NuGet, Packagist and Hex installs carry version pins, and skillspector is pinned to a commit SHA; pins unverified (not re-fetched), see tool-hub.md. `uv` is a brew row so the skillspector line works in one owner run. A tool whose toolchain (dotnet, composer, mix) is absent is reported as `BLOCKED (needs <toolchain>)` instead of printing an install line that would fail. opengrep has no Homebrew formula and its upstream installer is an unpinned script, so the dry run prints `BLOCKED opengrep (<reason>)` and no install line.
- The gem install line honors `DCR_USER_BIN` instead of a hardcoded `~/.local/bin`.
- The installed-tool probe in provision_tools.sh, and the PATH set up by review_checks.sh, also include `~/.dotnet/tools`, the composer global `vendor/bin` and `~/.mix/escripts` when they exist (an empty `DCR_USER_BIN` still disables all extra dirs).
- scripts/test-provision-covers-list-tools.sh fails when an external `--list-tools` name has no provision row and is not on an explicit no-install list with a reason; scripts/test-provision-toolchain-dirs.sh covers the extra tool dirs, the gem install dir and the opengrep blocker line.
- `--print` installs every brew formula, pipx package, gem and npm/other row on its own and prints `FAILED <name>` for a failure, so one bad name does not stop the rest; casks (codeql) install through a macOS-only `brew install --cask` call. The gem line falls back to plain `gem` when brew is absent, sobelow installs with `--force`, and tool-hub.md marks every pin and Homebrew name `unverified` (tflint has no core formula).
size-budget-raise: .claude/skills/deep-code-review/references/tool-hub.md 63930→64982 main gained tool-hub rows while this PR added its pin provenance note and opengrep blocker row; lazy reference, off every must-load set
2 changes: 2 additions & 0 deletions scripts/ci-tests.d/provision-cask-blocked.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Registers the cask-blocked provisioning test: a missing cask tool on a non-Darwin host prints BLOCKED and adds no cask install line.
bash scripts/test-provision-cask-blocked.sh
2 changes: 2 additions & 0 deletions scripts/ci-tests.d/provision-covers-list-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Registers the check that provision_tools.sh covers every external tool review_checks.sh --list-tools prints.
bash scripts/test-provision-covers-list-tools.sh
2 changes: 2 additions & 0 deletions scripts/ci-tests.d/provision-failed-names.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Registers the check that a failed install prints FAILED <name> and the no-brew gem note.
bash scripts/test-provision-failed-names.sh
2 changes: 2 additions & 0 deletions scripts/ci-tests.d/provision-toolchain-dirs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Registers the check that provision/review_checks probe dotnet, composer and mix tool dirs.
bash scripts/test-provision-toolchain-dirs.sh
2 changes: 1 addition & 1 deletion scripts/size-budgets.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ README.md 16118
.claude/skills/deep-code-review/references/small-diff-read-budget.md 526
.claude/skills/deep-code-review/references/app-pentest.md 8135
.claude/skills/deep-code-review/references/supply-chain-check.md 3646
.claude/skills/deep-code-review/references/tool-hub.md 63930
.claude/skills/deep-code-review/references/tool-hub.md 64982
.claude/skills/deep-code-review/references/desktop-native-appsec.md 4724
.claude/skills/deep-code-review/references/dynamic-probe.md 2095
.claude/skills/agentic-delivery/references/flow-guards.md 3171
Expand Down
14 changes: 14 additions & 0 deletions scripts/test-provision-cask-blocked.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# provision_tools.sh: on a non-Darwin host a missing cask tool (codeql) prints BLOCKED and adds no cask install to the --print line.
# Hermetic: stub uname=Linux, throwaway HOME/cache; nothing is installed.
set -euo pipefail
P=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/.claude/skills/deep-code-review/scripts/provision_tools.sh
t=$(mktemp -d "${TMPDIR:-/tmp}/dcr-test-cask.XXXXXX"); trap 'rm -rf "$t"' EXIT
mkdir "$t/bin" "$t/home"; fail=0
printf '#!/bin/sh\necho Linux\n' >"$t/bin/uname"; chmod +x "$t/bin/uname"
E=(env -i HOME="$t/home" PATH="$t/bin:/usr/bin:/bin" DCR_CACHE_ROOT="$t/cache" DCR_USER_BIN="$t/home/.local/bin" TMPDIR="$t")
out=$("${E[@]}" bash "$P" 2>&1 || true)
line=$("${E[@]}" bash "$P" --print 2>/dev/null)
grep -q '^BLOCKED codeql (cask install is macOS-only' <<<"$out" && echo "ok - codeql BLOCKED off macOS" || { echo "FAIL - no BLOCKED codeql"; fail=1; }
grep -q -- '--cask' <<<"$line" && { echo "FAIL - cask install line printed"; fail=1; } || echo "ok - no cask install line"
exit $fail
Loading
Loading