From 675f17da9bbc44d8daabf24530b05a0801138d14 Mon Sep 17 00:00:00 2001 From: Remi Antczak <140408771+remigiusz-antczak@users.noreply.github.com> Date: Fri, 13 Nov 2026 04:49:16 +0100 Subject: [PATCH] Tool hub: route flawfinder, cppcheck, devskim; detekt and security-code-scan not routed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds flawfinder, cppcheck and devskim to review_checks.sh with verified flags and SARIF/XML parsing, and documents detekt and security-code-scan as not routed with their evidence. Rebased onto the sobelow change, with both tools' rows kept, and the tool-hub.md size raise documented. Tests: 18/18 (test-review-checks-hub-c 13/13, test-review-checks-hub-kd 5/5) size-budget-raise: .claude/skills/deep-code-review/references/tool-hub.md 45343→49707 flawfinder, cppcheck, devskim, detekt and security-code-scan rows with evidence, merged over the sobelow row Co-Authored-By: Claude Sonnet 5.5 # Conflicts: # SHA256SUMS # scripts/size-budgets.tsv --- .claude/skills/deep-code-review/INDEX.md | 2 +- .../deep-code-review/references/tool-hub.md | 5 ++ .../deep-code-review/scripts/review_checks.sh | 30 +++++-- SHA256SUMS | 6 +- changelog.d/hub-c.md | 4 + changelog.d/hub-kotlin-dotnet.md | 7 ++ docs/INDEX.md | 2 +- docs/standards-index.md | 7 ++ scripts/ci-tests.d/review-checks-hub-c.sh | 2 + scripts/ci-tests.d/review-checks-hub-kd.sh | 2 + scripts/size-budgets.tsv | 2 +- scripts/test-review-checks-hub-c.sh | 89 +++++++++++++++++++ scripts/test-review-checks-hub-kd.sh | 36 ++++++++ 13 files changed, 182 insertions(+), 12 deletions(-) create mode 100644 changelog.d/hub-c.md create mode 100644 changelog.d/hub-kotlin-dotnet.md create mode 100644 scripts/ci-tests.d/review-checks-hub-c.sh create mode 100644 scripts/ci-tests.d/review-checks-hub-kd.sh create mode 100644 scripts/test-review-checks-hub-c.sh create mode 100755 scripts/test-review-checks-hub-kd.sh diff --git a/.claude/skills/deep-code-review/INDEX.md b/.claude/skills/deep-code-review/INDEX.md index 574096e84..4c8269edd 100644 --- a/.claude/skills/deep-code-review/INDEX.md +++ b/.claude/skills/deep-code-review/INDEX.md @@ -138,7 +138,7 @@ Generated by `scripts/skill_index.py` (do not hand-edit; rerun it after changing | `references/testing-ui.md` | the target renders a UI or ships browser / E2E specs. | 4868 | | `references/threat-modeling.md` | a change adds a trust boundary, an auth path, a data flow to a new party, an agent or tool capabili… | 2574 | | `references/time-date-correctness.md` | reviewing anything that stores, computes, schedules, or renders timestamps, durations, recurring ev… | 4809 | -| `references/tool-hub.md` | a review should lean on external scanners via the tool hub (workflows, Python, Go, SBOM/lockfiles,… | 11335 | +| `references/tool-hub.md` | a review should lean on external scanners via the tool hub (workflows, Python, Go, SBOM/lockfiles,… | 12426 | | `references/ux-components.md` | the target or diff renders one concept in more than one place: a shared component or design token,… | 7235 | | `references/ux-dataviz.md` | the target or diff renders a chart, sparkline, heat-map or calendar grid, a KPI / metric delta, a c… | 2787 | | `references/ux-gates.md` | a UI change is claimed verified on screenshot evidence, the project's auto-merge or CI policy gates… | 3756 | diff --git a/.claude/skills/deep-code-review/references/tool-hub.md b/.claude/skills/deep-code-review/references/tool-hub.md index 863318569..6cec7e828 100644 --- a/.claude/skills/deep-code-review/references/tool-hub.md +++ b/.claude/skills/deep-code-review/references/tool-hub.md @@ -60,7 +60,12 @@ The agent sandbox denies installs and most network, so the owner provisions scan | `detect-secrets` | Potential secrets in any changed file, no baseline: one scan of the changed files, one row per hit (rule = the plugin type, message = `potential secret (value not printed)`). The `hashed_secret` and any value are never copied into a row, the log or the report. Skips non-JSON log lines around the report. Empty or whitespace output, a crash, any nonzero exit (`scan` exits 0 whatever it finds, so a nonzero exit is a failure) or a report without a `results` object is `not run`, never clean. A heuristic detector beside `gitleaks`, so expect an overlap and some false positives | `detect-secrets scan --no-verify FILE...` (`--no-verify` turns off the additional network verification; no baseline is read or written; the JSON report goes to stdout) | verified (README: `scan [path ...]`, `--no-verify`, `--all-files`; `main.py`: the scan action never returns nonzero; `secrets_collection.py` and `potential_secret.py`: results keyed by filename, each hit with `type`, `filename`, `hashed_secret`, `is_verified`, `line_number`; `baseline.py`: `results` is a top-level key), fetched 2026-11-12 | route-only | | `njsscan` | Node.js source: a changed `.js`, `.jsx`, `.mjs` or `.cjs` file. ERROR and WARNING rules in both the `nodejs` and `templates` sections become rows (rule = rule id, message = severity and description, line = first `match_lines` entry), INFO rules are dropped. Skips non-JSON log lines around the report. A report without `nodejs`, `templates` and `errors`, a non-empty `errors` list, empty or whitespace output, a crash, exit 0 with an ERROR row, or exit 1 with no ERROR row is `not run`, never clean. The README says nothing about network use; `__main__.py` imports no network module, which is not a claim about the scan modules | `njsscan --json FILE...` (JSON to stdout when `-o` is omitted; `-w` is not used, so WARNING rules do not change the exit code). Exit 1 = an ERROR rule matched or files were not scanned | verified (README: `--json`, `-o`, `-w`, `path ...`, result keys `nodejs`, `templates`, `errors` with `files` and `metadata`; `__main__.py` `handle_exit`: exit 1 on errors or an ERROR rule; `json_out.py`: `print` to stdout without `-o`), fetched 2026-11-12 | route-only | | `sobelow` | Elixir Phoenix apps: a changed `.ex`, `.exs`, `.eex`, `.heex` or `.leex` file, only when the root `mix.exs` names `{:phoenix,` and neither `mix.exs` nor `.sobelow-conf` is changed in the diff (a project config is code: that run is NOT CHECKED). Scans the whole app and keeps rows on changed files; the confidence tier (high, medium, low) is the message, rule = the finding type. Skips non-JSON log lines around the report. Empty or whitespace output, a crash, a report whose lists or `total_findings` are missing or disagree, exit 0 with a finding, or exit 1 with none is `not run`, never clean. A non-Phoenix project prints text and exits 0 with no JSON, so it is `not run`. `--private` skips the update check (the tool otherwise fetches a version file from its own site); no other network use was found in `lib/sobelow.ex` | `sobelow --format json --private --exit low` (JSON to stdout; `--exit low` returns 1 when any finding exists) | verified (README: `--format`, `--exit`, `--private`, "All `json` formatted findings contain a `type`, `file`, and `line` key", escript install; `lib/sobelow.ex`: `exit_with_status` halts 1 when high, medium or low findings exist, the non-Phoenix path prints text and halts 0, the update check is skipped when `private`; `lib/sobelow/finding_log.ex`: `json` emits `findings` with `high_confidence`, `medium_confidence`, `low_confidence`, plus `total_findings`; `mix.exs`: Apache-2.0), fetched 2026-11-12; unverified: the findings' other keys | route-only | +| `flawfinder` | C/C++ source (`.c .h .cc .cpp .cxx .hpp .hh .hxx`), changed files in one call; rows from the SARIF results (rule, file, line; the snippet is never read); wired only once installed | `flawfinder --sarif --quiet FILES`; `main()` returns 0, or 1 only with `--error-level` (not passed), or 15 on encoding errors, so any non-zero exit, empty output or a document without `runs[].results` is not run; a clean scan prints the document with `"results": []` | verified (man page: `--sarif`, `--quiet`, `--error-level`; source at c4216b74cf: `output_sarif`, `flawfind()` and the exit values; GPLv2+, the OSI list has GPL v2). Egress: the source imports no network module (only `urllib.parse.quote`); the SARIF holds schema and taxonomy URLs as text, never fetched | route-only | +| `cppcheck` | C/C++ source, changed files in one call, no project build and no include paths, so default checks only (no `--enable`: its values were not verified here); `information` notes (missing includes) are dropped, any other finding needs a file and line; wired only once installed | `cppcheck --xml-version=2 --quiet FILES`; the XML goes to stderr (`cppcheck.1.xml`: "Write results in XML to error stream"), which the runner merges into its capture; no `--error-exitcode`, so the exit is 0 (`settings.exitCode`) and any other exit, missing `` or crash is not run. The primary location is the first `` (manual: "The primary location is listed first"; `toXML` writes the call stack reversed), later ones are context | verified (manual and man page; source at 103143dcb6: `--xml-version` accepts 2 or 3, `ErrorMessage::toXML`, `--error-exitcode`; COPYING is GPLv3, on the OSI list). Egress: no curl, socket or HTTP client call in `cli/`, `lib/` or `frontend/` (grep of the cloned source); the `--xml` sample is the manual's | route-only | +| `devskim` | Multi-language source (Microsoft DevSkim, MIT), one changed file per run (`analyze --source-code` takes a file: `AnalyzeCommand.cs` has a single-file branch); rows from the SARIF results; wired only once installed | `devskim analyze --source-code FILE --file-format sarif`; SARIF to stdout (`-O` unset, `Console.Out`); without `-E` the exit is 0 whatever it finds, and `ExitCode.cs` makes errors negative (`CriticalError` -2, `ArgumentParsingError` -3), so any non-zero exit, empty output or a document without `runs[].results` is not run. `--file-format` is passed because the writer factory falls back to `text` when it is empty | verified for flags, exit codes and license (wiki Analyze Command; source at 7f8e5e24f6: options in `BaseAnalyzeCommandOptions.cs`, exit codes, `SarifWriter.cs`; README: MIT), not for the SARIF shape. Egress: no HTTP client, update or telemetry code in `DevSkim-DotNet` `*.cs` (grep); its NuGet dependencies (CommandLineParser, LibGit2Sharp, Sarif.Sdk, ApplicationInspector, Newtonsoft.Json) were not audited, so egress by a dependency is `unverified`; the SARIF help URIs are text. The SARIF shape (`runs[].results[]`) is stub-tested only, not verified: no real DevSkim output was fetched or run, so a real report may differ | route-only | | `guarddog` | npm packages a changed `package-lock.json` newly adds (name@version absent from the merge-base lock; a bump counts) and that are installed under `node_modules` at the locked version (the installed `package.json` says so); `hasInstallScript` ones first, then at most 25 and about 300 s in all (`REVIEW_GUARDDOG_BUDGET`), the rest named in a `not-checked` row; not under `--full`; not a `hub=` row | `guarddog npm scan --output-format json DIR` on existing in-repo dirs only (it fetches a non-directory argument as a registry name), only when `guarddog --version` says 3.x; `--no-sandbox` (behind a dead proxy) only after its sandbox fails to start (nested); never `verify`; leads: `threat-*` rules only, each tagged `[heuristic]`; a rule that errors is a `not-checked` row and the other rules' hits stay; a newly added lock entry with `hasInstallScript` is a `package-lock` lead of its own | verified (`--help`, 3.2.0 source, real run 2026-10-30); the install-hook rules (`threat-npm-preinstall-script`, `threat-process-hooks`) match `*/package.json`, a nested one, so a package's own root `package.json` hook is never flagged | route-only | +| `detekt` | Not routed: Kotlin static analysis, Apache-2.0 (https://github.com/detekt/detekt LICENSE, on the OSI list at https://opensource.org/license/apache-2-0, fetched 2026-11-12). The CLI docs (https://detekt.dev/docs/gettingstarted/cli, fetched 2026-11-12) give `--input`, `--report sarif:PATH` (the XML-like format is `checkstyle`) and exits 0 clean, 1 unexpected error, 2 issues found, 3 invalid config. `Main.kt` and `CliArgs.kt` hold no HTTP, update or telemetry code, but the analysis core, the Kotlin compiler and plugin loading were not read, so its network-free behavior is `unverified` (not checked = not routed); it is also a code-quality linter whose default rule sets are not security rules | not run | not routed | not routed | +| `security-code-scan` | Not routed: a Roslyn analyzer (NuGet package or Visual Studio extension, LGPL-3.0 per the repository page, https://github.com/security-code-scan/security-code-scan, fetched 2026-11-12) that runs inside a project build; the stand-alone runner was not verified here and a build needs a NuGet restore (network). It cannot scan changed files only, so it is not routed; `devskim` is the routed .NET source scanner | not run | not routed | not routed | | `bearer` | Not routed: Bearer CLI is under the Elastic License 2.0, which forbids offering the software to third parties as a hosted or managed service (https://github.com/Bearer/bearer, fetched 2026-11-12), and that license is not on the OSI approved-licenses list (https://opensource.org/licenses, fetched 2026-11-12), so it is not routed | not run | not routed | not routed | | `snyk-agent-scan` | MCP and skill configs | not run | unverified: docs show no offline mode (it calls the Agent Scan API and can start MCP servers) | 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 | diff --git a/.claude/skills/deep-code-review/scripts/review_checks.sh b/.claude/skills/deep-code-review/scripts/review_checks.sh index 355f62564..e908d3ef3 100755 --- a/.claude/skills/deep-code-review/scripts/review_checks.sh +++ b/.claude/skills/deep-code-review/scripts/review_checks.sh @@ -14,7 +14,7 @@ # If that pack errors or hangs to the timeout, that 200-file chunk reruns with the bundled rules alone (the later chunks too, unless an earlier pack run succeeded) and the run says so, so it never reads as a # full clean: `semgrep(bundled-only)` under analyzers ran (and under partial and fixable in the closing line), `semgrep p/default pack ()` under NOT RUN and a not-checked row, with the fix named (a warm # snapshot: provision_tools.sh --print). That is the only report of the gap: no separate "missing tools" row. -# Tool hub: zizmor, actionlint, bandit, ruff-security (ruff check --select S), gosec, govulncheck, grype, syft (SBOM inventory, counted not scored), checkov, hadolint, kube-linter, kube-score, tflint, staticcheck (Go, offline), cargo-deny and cargo-audit (Rust, offline, local advisory DB only), brakeman, mobsfscan (Android/iOS source), psalm (PHP taint, local psalm.xml only), detect-secrets (changed files, no baseline, no verification, values never printed), njsscan (Node.js), sobelow (Elixir Phoenix, local source, no update check), eslint-security (the project's own local eslint only), kics (IaC), licensee (license inventory, counted not scored), cosign (verify-blob offline against a repo cosign.pub) (snyk-agent-scan is unverified, skipped) run from one registry +# Tool hub: zizmor, actionlint, bandit, ruff-security (ruff check --select S), gosec, govulncheck, grype, syft (SBOM inventory, counted not scored), checkov, hadolint, kube-linter, kube-score, tflint, staticcheck (Go, offline), cargo-deny and cargo-audit (Rust, offline, local advisory DB only), brakeman, mobsfscan (Android/iOS source), psalm (PHP taint, local psalm.xml only), detect-secrets (changed files, no baseline, no verification, values never printed), njsscan (Node.js), sobelow (Elixir Phoenix, local source, no update check), flawfinder, cppcheck (C/C++, no build) and devskim (multi-language), eslint-security (the project's own local eslint only), kics (IaC), licensee (license inventory, counted not scored), cosign (verify-blob offline against a repo cosign.pub) (snyk-agent-scan is unverified, skipped) run from one registry # (`hub=`); a matching changed file with the tool missing prints "NOT CHECKED: (install: )" on stderr, never a silent clean. # Built-in, always on, no install: invisible_chars.py flags NUL/C0 control characters and bidi/zero-width/tag characters in changed text files (tool `invisible-chars`, with line and col; # rows under fixture/test paths carry `[likely-fixture]`; third_party/, Pods/, bower_components/ and *.min.js are skipped; a `not-checked` row is unchecked surface). @@ -305,7 +305,19 @@ def nf(f): # scanners echo the path they were given ("./.github/..."); rows mus cl = lambda s: "".join(c if c.isprintable() else "?" for c in str(s)) or "?" # a package or file can be named with a \r: it would split the row and the closing summary drops it, so control characters become "?", never vanish t = open(sys.argv[2], encoding="utf-8", errors="replace").read() # The JSON starts a line. A log line before it can hold a bracket of its own (zizmor logs each audited path: x/[]/action.yml, and "[]" would read as no findings). -m = re.search(r"^\{" if kind in ("cargo-audit", "cargo-deny", "mobsfscan", "njsscan", "detect-secrets", "sobelow") else r"^\[\s*[\{\]]" if kind == "psalm" else r"^[\[{]", t, re.M) # cargo-audit, cargo-deny and mobsfscan, njsscan and detect-secrets: stderr log lines can start with "[", the report is an object; psalm: the report is a list, so "[" must be followed by an issue or "]" (a "[INFO] ..." log line is skipped) +if kind == "cppcheck": # XML, not JSON: ; the tool writes it to stderr, which the runner merges. Anything else is damaged output + import xml.etree.ElementTree as ET + try: root = ET.fromstring(t[t.index(" hits; errors: rule -> why it did not run (its key stays in results, empty). A rule error costs that rule only: the other hits stay and a not-checked row names it @@ -568,7 +580,7 @@ elif kind == "semgrep": ps = sorted({pfx(f) for f in fs} - {""}, key=len, reverse=True) cid = lambda i: next((i[len(q):] for q in ps if isinstance(i, str) and i.startswith(q)), i) rows = [(r["path"], r["start"]["line"], cid(r.get("check_id")), (r.get("extra") or {}).get("message", "")) for r in d["results"]] -elif kind == "codeql": # SARIF: ruleId, uri, startLine and the query's message text (never source); results with no location raise: unparseable, never dropped +elif kind in ("codeql", "flawfinder", "devskim"): # SARIF: ruleId, uri, startLine and the query's message text (never source); results with no location raise: unparseable, never dropped for run in d["runs"]: for r in run["results"]: p = r["locations"][0]["physicalLocation"] @@ -907,6 +919,9 @@ hub=( 'mobsfscan;verified;batch;(^|/)(AndroidManifest\.xml|[^/]+\.(java|kt|swift|m|mm|plist))$;route-only;pipx install mobsfscan' # only in a repo with a mobile marker (AndroidManifest.xml, Info.plist, Podfile, project.pbxproj); rows for ERROR and WARNING rules; exit 1 = an ERROR rule matched 'detect-secrets;verified;batch;.;route-only;pipx install detect-secrets' # changed files only, no baseline, --no-verify (no network); one row per potential secret, the value is never printed 'sobelow;verified;batch;\.(exs?|eex|heex|leex)$;route-only;mix escript.install hex sobelow' # only when the root mix.exs names :phoenix and is unchanged in the diff; scans the whole app (--private: no update check), rows kept for changed files; --exit low makes exit 1 mean findings + 'flawfinder;verified;batch;\.(c|h|cc|cpp|cxx|hpp|hh|hxx)$;route-only;pipx install flawfinder' # C/C++ source, --sarif --quiet, no --error-level: exit 0 whatever it finds, so any other exit is a crash + 'cppcheck;verified;batch;\.(c|h|cc|cpp|cxx|hpp|hh|hxx)$;route-only;brew install cppcheck' # C/C++ source without a project build; --xml-version=2 (written to stderr) --quiet, default checks; no --error-exitcode, so any non-zero exit is a crash + 'devskim;verified;each;\.(c|h|cc|cpp|cs|java|js|jsx|ts|tsx|py|rb|php|go|rs|swift|kt|sh|ps1|sql)$;route-only;dotnet tool install --global Microsoft.CST.DevSkim.CLI' # one file per run (-I takes one path), SARIF to stdout (--file-format sarif is the default), no -E: exit 0 whatever it finds 'njsscan;verified;batch;\.(jsx?|mjs|cjs)$;route-only;pipx install njsscan' # Node.js source; rows for ERROR and WARNING rules in nodejs and templates; exit 1 = an ERROR rule matched or a file was not scanned 'psalm;verified;batch;\.php$;route-only;composer global require vimeo/psalm' # taint analysis, whole project per the root psalm.xml, rows kept for changed files; psalm.xml is code: not run when the diff changes it or composer.json 'cosign;verified;each;(^|/)[^/]+\.(sig|bundle)$|(^|/)\.sigstore(/|$);route-only;brew install cosign' # verify-blob offline, no finding rows: only a .bundle with a cosign.pub beside it or at the root and its signed blob is checked, else NOT CHECKED @@ -943,6 +958,9 @@ hubcmd() { licensee) cmd=(licensee detect --json "$1") ;; mobsfscan) cmd=(mobsfscan --json "$@"); okrc="1" ;; # JSON to stdout without -o; exit 1 = an ERROR-severity rule matched (-w would add WARNING; not used) detect-secrets) cmd=(detect-secrets scan --no-verify "$@") ;; # explicit files, no baseline; --no-verify turns off the network verification; scan exits 0 whatever it finds, so any other exit is a crash + flawfinder) cmd=(flawfinder --sarif --quiet "$@") ;; + cppcheck) cmd=(cppcheck --xml-version=2 --quiet "$@") ;; + devskim) cmd=(devskim analyze --source-code "$@" --file-format sarif) ;; njsscan) cmd=(njsscan --json "$@"); okrc="1" ;; # JSON to stdout without -o; exit 1 = an ERROR rule matched or errors (-w would add WARNING; not used) sobelow) cmd=(sobelow --format json --private --exit low); okrc="1" ;; # JSON to stdout; exit 1 = at least one finding (Sobelow.exit_with_status), not-Phoenix text exits 0 with no JSON psalm) cmd=(psalm --taint-analysis --output-format=json --no-cache --no-progress); okrc="2" ;; # exit 0 clean, 2 issues found, 1 problem running (psalm docs) @@ -967,13 +985,13 @@ while IFS=';' read -r hn hs hm hre _ hh; do brakeman) grep -qiE "^[[:space:]]*gem[[:space:]]+['\"]rails['\"]" Gemfile 2>/dev/null || hf= ;; esac [ -n "$hf" ] || continue - [ "$hs" != verified ] || case $hn in syft|licensee|detect-secrets|njsscan|sobelow) ;; *) wired+=" $hn" ;; esac # syft and licensee are inventories, not scanners: never wired or ran; detect-secrets (matches every file) and njsscan are wired only once installed (below), as provision_tools.sh does not install them, so a missing one is NOT CHECKED, never "fixable" + [ "$hs" != verified ] || case $hn in syft|licensee|detect-secrets|njsscan|sobelow|flawfinder|cppcheck|devskim) ;; *) wired+=" $hn" ;; esac # syft and licensee are inventories, not scanners: never wired or ran; detect-secrets (matches every file) and njsscan are wired only once installed (below), as provision_tools.sh does not install them, so a missing one is NOT CHECKED, never "fixable" nc() { echo "NOT CHECKED: $hn ($1)" >&2; add "$hn" "" 0 not-checked "$1"; } if [ "$hs" != verified ]; then nc "$hs flags: skipped by default"; continue; fi hb=$hn; [ "$hn" != ruff-security ] || hb=ruff; [ "$hn" != eslint-security ] || hb=./node_modules/.bin/eslint command -v "$hb" >/dev/null || { nc "install: $hh"; missing+=" $hn"; miss "$hn" "install: $hh"; continue; } hubtool=$hn - case $hn in detect-secrets|njsscan|sobelow) wired+=" $hn" ;; esac + case $hn in detect-secrets|njsscan|sobelow|flawfinder|cppcheck|devskim) wired+=" $hn" ;; esac if [ "$hn" = sobelow ] && [ "$full" = 0 ] && [ -n "$(changed '(^|/)(mix\.exs|\.sobelow-conf)$')" ]; then nc "mix.exs or .sobelow-conf changed in this diff: its config is code, not run"; continue; fi # zizmor, actionlint, bandit and hadolint are light (single-file static checks), so they are intentionally unleased. case $hn in grype|checkov|gosec|govulncheck|staticcheck|kics) lease_take || { skip "$hn" "heavy lease full"; continue; } ;; esac diff --git a/SHA256SUMS b/SHA256SUMS index 479c9f3c9..673c922d0 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -206,7 +206,7 @@ d98f3e4380da3496061ba63be7beebe75017ab4ee1734eda9a3e798e19007b0e .claude/skills 92d22cc5d0a60ba6bdb1f4a9b597823dec5b8412cec09a5be6cf93b3973f4226 .claude/skills/contribution/scripts/prefile_check.sh 18f20db537ab784460ad33cf218f7a01ac0a172fc38413f14c0e19e1ce6821cc .claude/skills/contribution/scripts/share_learning.py 8f0f9f0e2714befe6eb815489ed05c96cb3f0b7c3bfe964be1f2d04f1d914dca .claude/skills/deep-code-review/INDEX-scripts.md -6553566f3d8930f8134095abcf60a3a02961a77985e5c875c5e0e420dce37796 .claude/skills/deep-code-review/INDEX.md +662fec40644477047108b6c746fcf47d6908186e94dbe622e37b36de674fcca7 .claude/skills/deep-code-review/INDEX.md c409fd76bcf137e160bf9bbe07ab54dba186db2857d07e47fed82e53fef877ad .claude/skills/deep-code-review/SKILL.md 1da2bea6a03e0da49cc3323745a49bc7b1085c61d9dc6afa9fcc06e890349131 .claude/skills/deep-code-review/VERSION f79acffb8481dcdd30278614ab18cc3895ddec4f65c60957a1b6f1b6ae28c6ae .claude/skills/deep-code-review/evals/evals.json @@ -343,7 +343,7 @@ a0ed7ad061b7e60230601ee9b38a00400841d6ddf3af386edbd4b34a981c9798 .claude/skills 8581f0023aedc9e0a4dece61cb2ea876ca9ab57f6acda63ed16c9b54494a1bc8 .claude/skills/deep-code-review/references/testing-ui.md 68df4819a34cbe23756eb19e9b513b9edcd675ad55da7d8c7624d95b124a9744 .claude/skills/deep-code-review/references/threat-modeling.md cf5218579b77d07ca49349165ab6d64c94b0145f61a4438cb09898a414793c68 .claude/skills/deep-code-review/references/time-date-correctness.md -ea01f856453248a9f0fe7a849d6cfb8469ae5f1ed56b7278a5be9a00825514f5 .claude/skills/deep-code-review/references/tool-hub.md +3dc2c79affcc822b445a6c10f693c76e666607e8fbc6858015d842c46d8db63a .claude/skills/deep-code-review/references/tool-hub.md bfda9dd8f0d1718725e0fb8c2d6890f4fc2742c9a0d7993112ecf459a3af9f9c .claude/skills/deep-code-review/references/ux-components.md 5e69c5a0c0ab8d94079f2f08e026bc0e700369c76cd7dfeee6e5c7c5c2f020bb .claude/skills/deep-code-review/references/ux-dataviz.md 68c40fe7134afac5fae125f107726136a911c67c1d4abdf0e4c627aee6751713 .claude/skills/deep-code-review/references/ux-gates.md @@ -414,7 +414,7 @@ fc322d684cd388d211b34e6c896f4aea05e0fef451d984dd11edab2e7a2082bb .claude/skills 1a61b499457ec5739350f0d1cd1c506e787406fa11be2a1520977cdcc727748a .claude/skills/deep-code-review/scripts/provision_tools.sh e1d1d2eab715ef280b8c211a9da15ebe6b87969de89d7028d7f1cc82d64fc1f0 .claude/skills/deep-code-review/scripts/reaper_lint.py 7849fac82d7d6bb3f8e178ebf3149504feec70ea09c6ef8e21c8ce294c290b5d .claude/skills/deep-code-review/scripts/report_contract_lint.py -32112242dda1b919ba815ba9427067c928dcff6081ee0fdf14f0c46fb148b535 .claude/skills/deep-code-review/scripts/review_checks.sh +109408f71bb005f686f755446e5747731429dea70e9d9055d72d24c866cf7a4b .claude/skills/deep-code-review/scripts/review_checks.sh 8c87c02a050a975e453b52ecacbaf01481c7134466a9c67feaf409d22e36d9f7 .claude/skills/deep-code-review/scripts/review_feedback.py fc5a897a11098726503bd003ec21a2c4fa873a11408c11490981ac1db5a0f382 .claude/skills/deep-code-review/scripts/route_auth_map.py 859c67d6a6a781c873f47d5662d403da2321da53e6994ca3d0ccdbf74afd39ac .claude/skills/deep-code-review/scripts/score_review.py diff --git a/changelog.d/hub-c.md b/changelog.d/hub-c.md new file mode 100644 index 000000000..fef69f9bf --- /dev/null +++ b/changelog.d/hub-c.md @@ -0,0 +1,4 @@ +### Added +- review_checks.sh routes flawfinder (C/C++, SARIF), cppcheck (C/C++ without a project build, XML read from its stderr, primary location first) and devskim (multi-language, one file per run, SARIF) through the tool hub. Each is NOT CHECKED with an install hint when missing, counts as wired only once installed, and is not run on a crash, empty output, wrong-shape output or a non-zero exit. Changed files only. Flags, exit codes and licenses (GPLv2+, GPLv3, MIT) were checked against man pages, manuals and cloned source fetched 2026-11-12; no network code was found in any of the three (DevSkim's NuGet dependencies were not audited, marked unverified in tool-hub.md). + +size-budget-raise: .claude/skills/deep-code-review/references/tool-hub.md 43180→46217 three hub rows with their verification and egress evidence diff --git a/changelog.d/hub-kotlin-dotnet.md b/changelog.d/hub-kotlin-dotnet.md new file mode 100644 index 000000000..b0cf06e8b --- /dev/null +++ b/changelog.d/hub-kotlin-dotnet.md @@ -0,0 +1,7 @@ +### Added +- Tool hub: detekt (Kotlin, Apache-2.0) and security-code-scan (.NET Roslyn analyzer, LGPL-3.0) get explicit not-routed rows in tool-hub.md with their evidence, and a test shows stub binaries of both are never run. detekt's CLI source shows no network code but the analysis core was not read; security-code-scan runs inside a project build, not on changed files. Sources and license checks fetched 2026-11-12 are logged in docs/standards-index.md. + +### Changed +- tool-hub.md: the devskim row now says its SARIF shape is stub-tested only, not verified. + +size-budget-raise: .claude/skills/deep-code-review/references/tool-hub.md 45343→49707 flawfinder, cppcheck, devskim, detekt and security-code-scan rows with evidence, merged over the sobelow row diff --git a/docs/INDEX.md b/docs/INDEX.md index 2fe1084de..fb44c13d0 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -23,7 +23,7 @@ Generated by `python3 .claude/skills/agentic-delivery/scripts/focus_kit.py docs- | `docs/scoreboard.md` | Perun scoreboard: Generated by scripts/scoreboard.py from committed results | 5143 | | `docs/security-heldout-table-1026/table.md` | Security held-out table, 2026-10-26: Generated by results.py (offline, $0, byte-identical on rerun). | 1847 | | `docs/self-improvement.md` | How Perun improves itself: Perun is improved by running Perun on Perun: its own review skill (deep-code-review), idea attack (idea-critic),… | 1268 | -| `docs/standards-index.md` | Standards index: Every standard the skill relies on, split into what was verified by direct fetch for this release and what is referenced b… | 106814 | +| `docs/standards-index.md` | Standards index: Every standard the skill relies on, split into what was verified by direct fetch for this release and what is referenced b… | 107419 | | `docs/team-install.md` | Team-wide install through a Claude Code plugin marketplace: This repository is its own marketplace (.claude-plugin/marketplace.json, name p… | 478 | | `docs/technical-overview.md` | Technical overview: you want the engineering detail that used to sit in the top-level README.md: the mechanisms table, the full "what you g… | 2288 | | `docs/token-cost-tips.md` | Token cost tips for teams: the biggest savings come from sending less context, using the cheapest model tier that clears its own gate, and… | 2127 | diff --git a/docs/standards-index.md b/docs/standards-index.md index f0cabaa1b..e808a7cd2 100644 --- a/docs/standards-index.md +++ b/docs/standards-index.md @@ -1995,3 +1995,10 @@ Verification date: **2026-11-05**. Raw-byte sha256 of each fetch and the item id | Semgrep Secrets — getting started | https://docs.semgrep.dev/semgrep-secrets/getting-started.md | Fetched 2026-11-12: enabled by signing in to the AppSec Platform (Settings > General > Secrets); "Contact sales for a trial license of Semgrep Secrets"; silent on `semgrep ci` tokens and the Community Edition. Not routed. | | PMD — LICENSE | https://raw.githubusercontent.com/pmd/pmd/main/LICENSE | Fetched 2026-11-12: a BSD-style text (acknowledgement clause) followed by the Apache-2.0 text. Not confirmed OSI-approved (OSI row), so pmd is not routed. | | OSI — approved licenses list (re-fetched) | https://opensource.org/licenses | Fetched 2026-11-12: names Apache-2.0, BSD-1-Clause, BSD-2-Clause, BSD-3-Clause and other BSD variants; no BSD-4-Clause or acknowledgement-clause entry. | +| flawfinder — man page and source | https://raw.githubusercontent.com/david-a-wheeler/flawfinder/master/flawfinder.1 | Fetched 2026-11-12 (man page; source cloned the same day at c4216b74cf: flawfinder.py `output_sarif`, `flawfind()`): `--sarif`, `--quiet`, `--error-level`, GPLv2+; exit 0, 1 with `--error-level`, 15 on encoding errors; no network import; a clean SARIF run prints an empty `results`. | +| cppcheck — manual, man page and source | https://raw.githubusercontent.com/danmar/cppcheck/main/man/manual.md | Fetched 2026-11-12 (man/cppcheck.1.xml and COPYING from the same repo; source cloned the same day at 103143dcb6): `--xml` and `--xml-version=2` (source accepts 2 or 3), XML to stderr, the sample report, "The primary location is listed first", `--error-exitcode`; GPLv3; no network call found in cli, lib or frontend. | +| DevSkim — README, Analyze Command wiki and source | https://github.com/microsoft/DevSkim/wiki/Analyze-Command | Fetched 2026-11-12 (README raw.githubusercontent.com/microsoft/DevSkim/main/README.md: MIT, dotnet tool install; source cloned the same day at 7f8e5e24f6: AnalyzeCommand.cs, ExitCode.cs, BaseAnalyzeCommandOptions.cs, SarifWriter.cs): `-I/--source-code` takes a file or directory, `-f/--file-format [text\|sarif\|vs]` default sarif, `-E`, exit codes, no HTTP code in the repo's own source; dependency egress not audited. | +| OSI — approved licenses list (re-fetched) | https://opensource.org/licenses | Fetched 2026-11-12: lists GNU General Public License version 2, version 3 and The MIT License. | +| detekt — license, CLI docs and CLI source | https://detekt.dev/docs/gettingstarted/cli | Fetched 2026-11-12 (https://raw.githubusercontent.com/detekt/detekt/main/LICENSE: Apache License 2.0; detekt-cli `Main.kt`, `CliArgs.kt` via raw.githubusercontent.com): options, report ids (`checkstyle`, `html`, `md`, `sarif`), exits 0-3; no network code in those two files, the rest of the tool not read, so detekt is not routed. | +| security-code-scan — repository page | https://github.com/security-code-scan/security-code-scan | Fetched 2026-11-12: Roslyn analyzer shipped as a NuGet package, a Visual Studio extension and a stand-alone runner package; LGPL-3.0. Not a changed-files CLI, so not routed. | +| OSI — Apache License 2.0 | https://opensource.org/license/apache-2-0 | Fetched 2026-11-12: "Open Source Initiative Approved License", SPDX Apache-2.0. | diff --git a/scripts/ci-tests.d/review-checks-hub-c.sh b/scripts/ci-tests.d/review-checks-hub-c.sh new file mode 100644 index 000000000..77542d06e --- /dev/null +++ b/scripts/ci-tests.d/review-checks-hub-c.sh @@ -0,0 +1,2 @@ +# review_checks.sh hub routing for flawfinder, cppcheck and devskim; stub binaries. +bash scripts/test-review-checks-hub-c.sh diff --git a/scripts/ci-tests.d/review-checks-hub-kd.sh b/scripts/ci-tests.d/review-checks-hub-kd.sh new file mode 100644 index 000000000..96172f666 --- /dev/null +++ b/scripts/ci-tests.d/review-checks-hub-kd.sh @@ -0,0 +1,2 @@ +# review_checks.sh: detekt and security-code-scan stay not routed (stub binaries never run); devskim control. +bash scripts/test-review-checks-hub-kd.sh diff --git a/scripts/size-budgets.tsv b/scripts/size-budgets.tsv index 7513397ea..380b1a286 100644 --- a/scripts/size-budgets.tsv +++ b/scripts/size-budgets.tsv @@ -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 45343 +.claude/skills/deep-code-review/references/tool-hub.md 49707 .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 diff --git a/scripts/test-review-checks-hub-c.sh b/scripts/test-review-checks-hub-c.sh new file mode 100644 index 000000000..58d76edb8 --- /dev/null +++ b/scripts/test-review-checks-hub-c.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# review_checks.sh hub routing for flawfinder, cppcheck (C/C++, XML on stderr) and devskim (SARIF) with stub binaries on a hermetic PATH +# (no real tool, no network; fixtures: the cppcheck XML is the manual's own sample plus a two-location case, the flawfinder SARIF follows its output_sarif source, the devskim SARIF is stub-only: no sample was found): rows keep findings, a missing tool is "NOT CHECKED", and a crash, empty output, wrong shape or a bad exit is "not run", never clean. +set -euo pipefail +ROOT=$(cd "$(dirname "$0")/.." && pwd) +RC=${REVIEW_CHECKS:-$ROOT/.claude/skills/deep-code-review/scripts/review_checks.sh} +T=$(mktemp -d "${TMPDIR:-/tmp}/hubc.XXXXXX") && [ -n "$T" ] && [ -d "$T" ] || { echo "no temp dir" >&2; exit 1; } +trap 'cd /; rm -r -- "$T"' EXIT; fail=0 +ok() { echo "ok - $1"; }; bad() { echo "FAIL - $1"; fail=1; } +export PERUN_HEAVY_DIR="$T/heavy" HUB_LOG="$T/hub.log" DCR_CACHE_ROOT="$T/nocache" DCR_USER_BIN= TMPDIR="$T/tmp" +mkdir -p "$T/repo" "$T/bin" "$T/base" "$T/sys" "$T/tmp" "$T/keep" && cd "$T/repo" +git init -q . && case "$(git rev-parse --show-toplevel)" in "$(cd "$T" && pwd -P)"/*) ;; *) echo "refusing: repo not under temp dir" >&2; exit 1 ;; esac +G() { git -c user.email=t@example.com -c user.name=t "$@"; } +printf 'x\n' >README.md; G add . && G commit -q -m base && git branch base +printf 'int main(void){return 0;}\n' >a.c; printf 'int x;\n' >other.c; printf 'class A {}\n' >B.java; printf 'int y;\n' >file.h; G add . && G commit -q -m code +cat >"$T/bin/flawfinder" <<'S' +#!/usr/bin/env bash +echo "flawfinder $*" >>"$HUB_LOG" +[ "${HUB_MODE:-}" != crash ] || exit 9 +printf '%s' "$J_ff"; exit "${FF_RC:-0}" +S +cat >"$T/bin/cppcheck" <<'S' +#!/usr/bin/env bash +echo "cppcheck $*" >>"$HUB_LOG" +[ "${HUB_MODE:-}" != crash ] || exit 9 +printf '%s' "$X_cpp" >&2; exit "${CPP_RC:-0}" +S +cat >"$T/bin/devskim" <<'S' +#!/usr/bin/env bash +echo "devskim $*" >>"$HUB_LOG" +[ "${HUB_MODE:-}" != crash ] || exit 9 +printf '%s' "$J_dev"; exit "${DEV_RC:-0}" +S +chmod +x "$T/bin/"*; cp "$T/bin/"* "$T/keep/" +printf '#!/bin/sh\necho %s\n' "'{\"results\":[],\"errors\":[]}'" >"$T/base/semgrep" +printf '#!/bin/sh\necho %s\n' "'{\"Results\":[]}'" >"$T/base/trivy" +printf '#!/bin/sh\nexit 0\n' >"$T/base/gitleaks" +chmod +x "$T/base/semgrep" "$T/base/trivy" "$T/base/gitleaks" +for b in bash env git grep sed head tail cat rm mkdir mktemp dirname basename python3 perl timeout gtimeout jq true sort uniq paste tr cut wc awk date cp mv ls find touch tee readlink sleep; do + p=$(type -P "$b") || continue; ln -s "$p" "$T/sys/$b" +done +sarif() { printf '{"version":"2.1.0","runs":[{"tool":{"driver":{"name":"x"}},"results":[%s]}]}' "$1"; } +res() { printf '{"ruleId":"%s","message":{"text":"m"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"%s"},"region":{"startLine":%s}}}]}' "$1" "$2" "$3"; } +FF=$(sarif "$(res FF.strcpy a.c 3),$(res FF.gets other.c 1)") +DEV=$(sarif "$(res DS.weak-hash a.c 2)") +XH=' + + + +' +XT=' +' +# the manual's sample error (man/manual.md), then a two-location error whose primary (first) location is a.c and whose second is an unchanged file +CPP="$XH"' + + + + +'"$XT" +CPPE="$XH$XT" +export J_ff=$'[INFO]\n'"$FF" X_cpp=$CPP J_dev=$'log line\n'"$DEV" +run() { PATH="$T/bin:$T/base:$T/sys" bash "$RC" --base base 2>"$T/err" >"$T/out"; } +row() { jq -e --arg t "$1" --arg f "$2" --arg r "$3" 'any(.[]; .tool==$t and .file==$f and .rule==$r)' "$T/out" >/dev/null; } +ran() { grep -qE "analyzers ran:.*\b$1\b" "$T/err"; } +notrun() { grep -q "not run: $1" "$T/err" && ! ran "$1"; } +: >"$HUB_LOG"; run +row flawfinder a.c FF.strcpy && row flawfinder other.c FF.gets && ok "flawfinder: SARIF rows, leading log line skipped" || bad "ff rows: $(jq -c '[.[]|select(.tool=="flawfinder")|.rule]' "$T/out")" +row cppcheck file.h someError && row cppcheck a.c nullPointer && ! row cppcheck gone.c nullPointer && ! row cppcheck "" missingInclude && ok "cppcheck: manual-sample row, primary (first) location used, information note dropped" || bad "cpp rows: $(jq -c '[.[]|select(.tool=="cppcheck")|.rule]' "$T/out")" +row devskim a.c DS.weak-hash && grep -q 'devskim analyze --source-code ./B.java' "$HUB_LOG" && grep -q 'devskim analyze --source-code ./a.c --file-format sarif' "$HUB_LOG" && ok "devskim: one file per run, SARIF row" || bad "dev rows" +grep -q 'cppcheck --xml-version=2 --quiet ' "$HUB_LOG" && grep -q 'flawfinder --sarif --quiet ' "$HUB_LOG" && ok "flags as documented, no network flag needed" || bad "flags" +# never clean: empty, wrong shape, bad exit, crash +J_ff= X_cpp= J_dev= run +notrun flawfinder && notrun cppcheck && notrun devskim && ok "empty output: not run" || bad "empty" +J_ff='{"x":1}' X_cpp='' J_dev='{"runs":[]}' run +notrun flawfinder && notrun cppcheck && notrun devskim && ok "wrong shape: not run" || bad "wrong shape" +X_cpp="$XH"''"$XT" run +notrun cppcheck && ok "cppcheck finding without location: not run" || bad "cpp no location" +FF_RC=2 CPP_RC=2 DEV_RC=2 run +notrun flawfinder && notrun cppcheck && notrun devskim && ok "non-zero exit: not run" || bad "exit" +J_ff=$FF X_cpp=$CPPE run +ran cppcheck && ! row cppcheck a.c nullPointer && ok "cppcheck clean XML: ran, no rows" || bad "cpp clean" +HUB_MODE=crash run +notrun flawfinder && notrun cppcheck && notrun devskim && ok "crash: not run" || bad "crash" +rm "$T/bin/"*; run +for t in flawfinder cppcheck devskim; do + grep -q "NOT CHECKED: $t (install: " "$T/err" && jq -e --arg t $t 'any(.[]; .tool==$t and .rule=="not-checked")' "$T/out" >/dev/null && ok "$t missing: NOT CHECKED with install hint" || bad "$t missing" +done +exit $fail diff --git a/scripts/test-review-checks-hub-kd.sh b/scripts/test-review-checks-hub-kd.sh new file mode 100755 index 000000000..0f44ac5a4 --- /dev/null +++ b/scripts/test-review-checks-hub-kd.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# review_checks.sh never routes detekt or security-code-scan (not-routed rows in tool-hub.md): with stub binaries that would emit findings on PATH +# and changed .kt / .cs files, neither stub is run and no row appears. Control: the routed devskim stub IS run on the same .cs file, so the harness is live. +set -euo pipefail +ROOT=$(cd "$(dirname "$0")/.." && pwd) +RC=${REVIEW_CHECKS:-$ROOT/.claude/skills/deep-code-review/scripts/review_checks.sh} +T=$(mktemp -d "${TMPDIR:-/tmp}/hubkd.XXXXXX") && [ -n "$T" ] && [ -d "$T" ] || { echo "no temp dir" >&2; exit 1; } +trap 'cd /; rm -r -- "$T"' EXIT; fail=0 +ok() { echo "ok - $1"; }; bad() { echo "FAIL - $1"; fail=1; } +export PERUN_HEAVY_DIR="$T/heavy" HUB_LOG="$T/hub.log" DCR_CACHE_ROOT="$T/nocache" DCR_USER_BIN= TMPDIR="$T/tmp" +mkdir -p "$T/repo" "$T/bin" "$T/base" "$T/sys" "$T/tmp" && cd "$T/repo" +git init -q . && case "$(git rev-parse --show-toplevel)" in "$(cd "$T" && pwd -P)"/*) ;; *) echo "refusing: repo not under temp dir" >&2; exit 1 ;; esac +G() { git -c user.email=t@example.com -c user.name=t "$@"; } +printf 'x\n' >README.md; G add . && G commit -q -m base && git branch base +printf 'fun main() {}\n' >A.kt; printf 'class B {}\n' >B.cs; G add . && G commit -q -m code +SARIF='{"version":"2.1.0","runs":[{"tool":{"driver":{"name":"x"}},"results":[{"ruleId":"R1","message":{"text":"m"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"B.cs"},"region":{"startLine":1}}}]}]}]}' +for b in detekt security-scan security-code-scan devskim; do + printf '#!/usr/bin/env bash\necho "%s $*" >>"$HUB_LOG"\nprintf %%s "$J"\n' "$b" >"$T/bin/$b" +done +chmod +x "$T/bin/"* +printf '#!/bin/sh\necho %s\n' "'{\"results\":[],\"errors\":[]}'" >"$T/base/semgrep" +printf '#!/bin/sh\necho %s\n' "'{\"Results\":[]}'" >"$T/base/trivy" +printf '#!/bin/sh\nexit 0\n' >"$T/base/gitleaks" +chmod +x "$T/base/"* +for b in bash env git grep sed head tail cat rm mkdir mktemp dirname basename python3 perl timeout gtimeout jq true sort uniq paste tr cut wc awk date cp mv ls find touch tee readlink sleep; do + p=$(type -P "$b") || continue; ln -s "$p" "$T/sys/$b" +done +: >"$HUB_LOG"; export J="$SARIF" +PATH="$T/bin:$T/base:$T/sys" bash "$RC" --base base 2>"$T/err" >"$T/out" || true +grep -q '^devskim analyze --source-code ./B.cs ' "$HUB_LOG" && ok "control: routed devskim runs on the changed .cs file" || bad "control did not run" +! grep -qE '^(detekt|security-scan|security-code-scan) ' "$HUB_LOG" && ok "detekt and security-code-scan stubs are never run" || bad "not-routed tool ran: $(cat "$HUB_LOG")" +jq -e . "$T/out" >/dev/null && ! grep -qiE 'detekt|security-?code-?scan|security-scan' "$T/err" && ! jq -e 'any(.[]; (.tool // "") | test("detekt|security-code-scan|security-scan"))' "$T/out" >/dev/null && ok "no row, no NOT CHECKED line for them" || bad "unexpected mention" +TH=${TOOL_HUB:-$ROOT/.claude/skills/deep-code-review/references/tool-hub.md} +grep -q '^| `detekt` | Not routed' "$TH" && ok "tool-hub.md has the detekt Not-routed row" || bad "tool-hub.md lacks the detekt Not-routed row" +grep -q '^| `security-code-scan` | Not routed' "$TH" && ok "tool-hub.md has the security-code-scan Not-routed row" || bad "tool-hub.md lacks the security-code-scan Not-routed row" +exit $fail