# Static checks

> Abstract: ShellCheck and actionlint run on every reviewed head. Hadolint, zizmor and OSV-Scanner run on requested forge reviews, from a trusted CI report where one matches the commit and locally otherwise. None of them spends model tokens.

## What runs, and when

| Tool | Checks | Runs | Model tokens |
|---|---|---|---|
| ShellCheck | Changed `.sh` and `.bash` files | Locally, on every review | None |
| actionlint | Files under `.github/workflows/` | Locally, on every review | None |
| Hadolint | Dockerfiles and Containerfiles, such as `Dockerfile.release` and `build.dockerfile` | From CI or locally, on a requested forge review | None |
| zizmor | GitHub Actions workflow and action files, including those kept in GitLab repositories | From CI or locally, on a requested forge review | None |
| OSV-Scanner | Dependency files such as `go.mod`, `Cargo.lock`, `uv.lock`, `requirements.txt` and `package-lock.json` | From CI or locally, on a requested forge review | None |
| Go analysis | Assay's Go lint report, imported from a CI job you name | From CI | None |

Deleted files are never scanned. Findings are scoped to the files a change touches, and can include a problem on a line the change did not alter.

> The three CI-capable scanners look first for a finished report at the reviewed **source commit**. Anything a report does not cover falls back to a local scan. [CI reports](ci-reports.md) covers the reuse.

## Local checks

Local checks read regular Git blobs at the reviewed commit, in temporary directories. They have no forge credential, no model credential, and no provider key in their environment.

ShellCheck and actionlint run on the reviewed head's Git blobs. The runner feeds each file on stdin with the tool's defaults. actionlint's embedded ShellCheck integration is switched off, so a shell problem inside a workflow is reported once, by ShellCheck.

> Each of the two has 20 seconds, and a file over one million bytes is not scanned. If the reviewed head is absent from the checkout, an applicable scanner reports `could-not-check` rather than nothing.

Hadolint, zizmor and OSV-Scanner run locally with these commands, sharing a 180-second budget with 90 seconds for any one of them. The OSV-Scanner line also carries `--download-offline-databases` unless you switch downloads off:

```sh
hadolint --format json --no-fail ./Dockerfile
zizmor --offline --no-exit-codes --format sarif ./.github/workflows/ci.yml
osv-scanner scan source --offline --format json --lockfile ./uv.lock
```

## When a scanner could not check

A scanner that cannot run says so. Its reason appears in the JSON report, and in the posted comment, as `could not check`.

| Reason written | Meaning |
|---|---|
| `tool unavailable` | ShellCheck or actionlint was not on the `PATH`. The image ships both, so this appears outside the container. |
| `immutable source unavailable or scanner failed` | The file at the reviewed head is missing or too large, or the tool failed. |
| `source unavailable or scanner failed` | The path is not a regular file at that commit, a report is oversized or in the wrong place, or the exit status was unexpected. |
| `source, scanner or advisory database unavailable` | OSV-Scanner could not read its advisory database. |
| `static check time budget exhausted` | An earlier scanner used up the shared budget. |

Missing scanner evidence stays visible even when the model finds nothing, and it turns the exit status to 2.

## What the model sees of it

The two kinds of check are kept apart.

Findings from ShellCheck, actionlint and the Go analysis, when they sit on a line the patch shows, are placed in the prompt as scanner evidence. They count toward the token estimate. A finding elsewhere in the file stays in the report and out of the prompt.

Hadolint, zizmor and OSV-Scanner never enter the prompt, the estimate or the cache key. Their findings go straight into the report and the posted comment.

> An over-budget review, or one where the model fails, still publishes the static checks. The quoted review on the [overview](index.md) is exactly that case.

## Dependency scanning offline

OSV-Scanner compares dependencies locally and caches public advisory databases under `/state/osv-db`. By default it may download and refresh them.

To run with no network, prepopulate `/state/osv-db/osv-scalibr/<ecosystem>/all.zip` for each ecosystem you need, and set `REVIEW_OSV_DOWNLOAD_DATABASES=0` on the reviewer. A database that cannot be read, a missing file or a timeout is reported as incomplete coverage. The [OSV-Scanner offline guide](https://google.github.io/osv-scanner/usage/offline-mode/) describes the layout.

---

Source of this page: https://pr-agent.assay.guide/checks
