From 94adc0c6e7cde7e900041d036cbae211b4168209 Mon Sep 17 00:00:00 2001 From: Jordan Winters Date: Fri, 24 Jul 2026 14:52:58 -0500 Subject: [PATCH 1/2] =?UTF-8?q?feat(ci):=20real=20dependency=20scanning=20?= =?UTF-8?q?=E2=80=94=20repo=20Trivy=20vuln=20scan=20+=20per-stack=20audit?= =?UTF-8?q?=20gates=20(U20/O7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit security.md's checklist claimed "automated dependency scanning" that existed nowhere in this repo's CI or stack packs. Make the claim true before commit 2 relabels it: - framework-invariants.yml: Trivy secret-scan job now runs `--scanners secret,vuln` (was secret-only), same blocking exit-code style. Trivially green today (no manifests in this repo); real for forks/adopters that add one. - Every stack-pack ci-gates.yml (TypeScript, Python, Go, Rust) gains one native dependency-audit step: `pnpm audit --audit-level high`, `uvx pip-audit`, `govulncheck ./...`, `cargo audit`. Each cites .claude/rules/security.md's Dependency Safety section rather than restating it. - Each pack's golden-path.skill.md "Gates Wiring" sentence corrected from "CI runs the identical gates" to name the new CI-only audit step — it has no local pre-commit-verification.sh equivalent, so the old claim would otherwise become a fresh instance of the exact false-claim pattern this unit exists to close. - MIGRATION.md (v4.0.x) and CHANGELOG.md document the change for adopters who already pasted a pack's ci-gates.yml block. Stack-pack README "Exemplar current as of" lines already read 2026-07 (current month); no edit needed since the granularity is monthly and no month boundary was crossed. Co-Authored-By: Claude Fable 5 --- .claude/templates/stack-packs/go/ci-gates.yml | 3 +++ .claude/templates/stack-packs/go/golden-path.skill.md | 2 +- .claude/templates/stack-packs/python/ci-gates.yml | 2 ++ .claude/templates/stack-packs/python/golden-path.skill.md | 2 +- .claude/templates/stack-packs/rust/ci-gates.yml | 2 ++ .claude/templates/stack-packs/rust/golden-path.skill.md | 2 +- .claude/templates/stack-packs/typescript/ci-gates.yml | 1 + .../templates/stack-packs/typescript/golden-path.skill.md | 2 +- .github/workflows/framework-invariants.yml | 3 ++- CHANGELOG.md | 1 + MIGRATION.md | 8 ++++++++ 11 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.claude/templates/stack-packs/go/ci-gates.yml b/.claude/templates/stack-packs/go/ci-gates.yml index 3465685..df8f702 100644 --- a/.claude/templates/stack-packs/go/ci-gates.yml +++ b/.claude/templates/stack-packs/go/ci-gates.yml @@ -19,6 +19,9 @@ gates: - uses: golangci/golangci-lint-action@v9.3.0 with: version: v2.12 + # dependency scan — .claude/rules/security.md Dependency Safety + - run: go install golang.org/x/vuln/cmd/govulncheck@latest + - run: govulncheck ./... - run: go test ./... - run: go vet ./... - run: go build ./... diff --git a/.claude/templates/stack-packs/go/golden-path.skill.md b/.claude/templates/stack-packs/go/golden-path.skill.md index 6358ee2..532e233 100644 --- a/.claude/templates/stack-packs/go/golden-path.skill.md +++ b/.claude/templates/stack-packs/go/golden-path.skill.md @@ -34,7 +34,7 @@ Regenerate `go.sum` with `go mod tidy` after every dependency change — never h ## Gates Wiring -`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `go.mod` and reminds you to run these commands before a commit lands. CI runs the identical gates — see this pack's `ci-gates.yml`. +`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `go.mod` and reminds you to run these commands before a commit lands. CI runs the same gates plus a dependency-audit step (`govulncheck ./...`) that has no local pre-commit equivalent — see this pack's `ci-gates.yml`. ## Related Skills diff --git a/.claude/templates/stack-packs/python/ci-gates.yml b/.claude/templates/stack-packs/python/ci-gates.yml index a3d52f7..6459017 100644 --- a/.claude/templates/stack-packs/python/ci-gates.yml +++ b/.claude/templates/stack-packs/python/ci-gates.yml @@ -15,6 +15,8 @@ gates: with: enable-cache: true - run: uv sync --locked + # dependency scan — .claude/rules/security.md Dependency Safety + - run: uvx pip-audit - run: uv run pytest - run: uv run ruff check . - run: uv run ruff format --check . diff --git a/.claude/templates/stack-packs/python/golden-path.skill.md b/.claude/templates/stack-packs/python/golden-path.skill.md index cd587b2..4f9fc70 100644 --- a/.claude/templates/stack-packs/python/golden-path.skill.md +++ b/.claude/templates/stack-packs/python/golden-path.skill.md @@ -33,7 +33,7 @@ Regenerate `uv.lock` with `uv lock` (`uv sync` regenerates it implicitly too) ## Gates Wiring -`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `pyproject.toml` and reminds you to run these commands before a commit lands. CI runs the identical four gates — see this pack's `ci-gates.yml`. +`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `pyproject.toml` and reminds you to run these commands before a commit lands. CI runs the same four gates plus a dependency-audit step (`uvx pip-audit`) that has no local pre-commit equivalent — see this pack's `ci-gates.yml`. ## Related Skills diff --git a/.claude/templates/stack-packs/rust/ci-gates.yml b/.claude/templates/stack-packs/rust/ci-gates.yml index e235126..2480279 100644 --- a/.claude/templates/stack-packs/rust/ci-gates.yml +++ b/.claude/templates/stack-packs/rust/ci-gates.yml @@ -15,6 +15,8 @@ gates: - uses: actions-rust-lang/setup-rust-toolchain@v1.17.0 with: components: clippy, rustfmt + - run: cargo install cargo-audit --locked # dependency scan — .claude/rules/security.md Dependency Safety + - run: cargo audit # vulnerability audit - run: cargo test # test suite - run: cargo clippy # lint - run: cargo fmt --check # format check diff --git a/.claude/templates/stack-packs/rust/golden-path.skill.md b/.claude/templates/stack-packs/rust/golden-path.skill.md index ae5ac42..d35c20a 100644 --- a/.claude/templates/stack-packs/rust/golden-path.skill.md +++ b/.claude/templates/stack-packs/rust/golden-path.skill.md @@ -34,7 +34,7 @@ Cargo regenerates `Cargo.lock` automatically on any command that resolves depend ## Gates Wiring -`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `Cargo.toml` and reminds you to run these commands before a commit lands. CI runs the identical gates — see this pack's `ci-gates.yml`. +`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `Cargo.toml` and reminds you to run these commands before a commit lands. CI runs the same gates plus a dependency-audit step (`cargo audit`) that has no local pre-commit equivalent — see this pack's `ci-gates.yml`. ## Related Skills diff --git a/.claude/templates/stack-packs/typescript/ci-gates.yml b/.claude/templates/stack-packs/typescript/ci-gates.yml index 53bfdb4..2e1aec4 100644 --- a/.claude/templates/stack-packs/typescript/ci-gates.yml +++ b/.claude/templates/stack-packs/typescript/ci-gates.yml @@ -16,6 +16,7 @@ gates: node-version: lts/* cache: pnpm - run: pnpm install --frozen-lockfile + - run: pnpm audit --audit-level high # dependency scan — .claude/rules/security.md Dependency Safety - run: pnpm test # vitest run - run: pnpm lint # biome check . - run: pnpm typecheck # tsc --noEmit diff --git a/.claude/templates/stack-packs/typescript/golden-path.skill.md b/.claude/templates/stack-packs/typescript/golden-path.skill.md index 53a9b9d..ba9373d 100644 --- a/.claude/templates/stack-packs/typescript/golden-path.skill.md +++ b/.claude/templates/stack-packs/typescript/golden-path.skill.md @@ -34,7 +34,7 @@ Regenerate `pnpm-lock.yaml` with `pnpm install` — never hand-edit it. Commit i ## Gates Wiring -`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `package.json` and reminds you to run these commands before a commit lands. CI runs the identical four gates — see this pack's `ci-gates.yml`. +`.claude/hooks/pre-commit-verification.sh` auto-detects this stack from `package.json` and reminds you to run these commands before a commit lands. CI runs the same four gates plus a dependency-audit step (`pnpm audit --audit-level high`) that has no local pre-commit equivalent — see this pack's `ci-gates.yml`. ## Related Skills diff --git a/.github/workflows/framework-invariants.yml b/.github/workflows/framework-invariants.yml index c5ce752..cb69c90 100644 --- a/.github/workflows/framework-invariants.yml +++ b/.github/workflows/framework-invariants.yml @@ -59,7 +59,8 @@ jobs: uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 (SHA-pins its own setup-trivy dependency; older releases referenced since-deleted setup-trivy tags) with: scan-type: fs - scanners: secret + # No manifests exist in this repo today, so vuln findings are trivially green here — the scanner is real for forks/adopters that add them. + scanners: secret,vuln exit-code: 1 diff-size: diff --git a/CHANGELOG.md b/CHANGELOG.md index dcf2bfc..56fe2cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `pre-commit-verification.sh` rewritten from advisory-only to enforcing (jq present): on `git commit`, runs every gate `gate-lib.sh` detects, each under `timeout "${CLAUDE_GATE_TIMEOUT_SECS:-120}"` from the project dir, logging to `.claude/hooks/.state/gate-