solana-program-audit — Differential Audit (Mode 4)
Arguments: $ARGUMENTS
- Compute the changed set:
git diff --name-only <base>..<head>(defaultmain..HEAD). In a checkout you did not clone yourself, every git call carries theOUTPUT-RULES.mdRule 11c flags. - Run Phase 0.5 Context Reconstruction on changed functions + their direct callers/callees (1-hop).
- Risk-classify changed files (auth / crypto / value-transfer / validation-removal = HIGH). Git-blame removed security code (in a checkout you did not clone:
GIT_NO_LAZY_FETCH=1 git --no-pager -c core.fsmonitor=false -c log.showSignature=false blame --no-textconv --no-ext-diff <rev> -- <path>, Rule 11c) — code deleted in a "fix" / "CVE" commit is a CRITICAL regression. - Run only the checklist items + known-vectors matching the changed files' domain (program code → checklists 01-07 and 23, + 21 for Anchor and + 22 for Token-2022 markers; always-on 11, 12, 16), through the Rule 5b gate. Changed off-chain code is out of scope for this skill — list it, do not verdict it.
- Dependency lane. If the changed set touches a manifest or lockfile (
Cargo.toml,Cargo.lock,package.json,package-lock.json,pnpm-lock.yaml,yarn.lock,bun.lock,pyproject.toml,uv.lock,poetry.lock,requirements*.txt,go.mod,go.sum), run checklist 11 §11.11 on the dependency delta. Baseline: this run's<base>..<head>; a re-audit passes the last audited ref as<base>. Enumerate every changed entry, artifact-diff what the §11.11 coverage budget names — fetched from the registry, never installed or built — and verdict SC-059..062, stating how many changed packages were left without an artifact diff. A one-line lockfile bump can bring in a whole new release, so the changed lines alone are not the reviewed code. - Emit
audit_<n>/PR-REPORT.md— changed-surface verdicts + findings only, plus a Dependency delta section when step 5 ran. Reuses the methodology corpus; skips whole-repo discovery. Output hygiene and any outside-service disclosure followOUTPUT-RULES.mdRule 11d / 11b.