From 65bbf02a4c9164bb4718ed6592d80f94293785cd Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 06:38:28 +0000 Subject: [PATCH 1/2] Run SpotBugs early in CI code-style gate; suppress model-path PATH_TRAVERSAL_IN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit spotbugs:check is bound to the Maven verify phase, which only the publish deploy goal reaches, so SpotBugs ran only at snapshot/release publish — a PATH_TRAVERSAL_IN finding red a release after every jar had already built. Add a SpotBugs step to the existing fast code-style job (after Spotless, before the informational jdeps step) so it runs on every PR/push and gates publish (publish-* already needs: code-style). Mirrors the existing early Spotless gate; no needs: change required. Provisionally suppress the PATH_TRAVERSAL_IN finding in OfflineModelGuard / ModelParameters (operator-supplied --model path; same threat model as the existing LlamaLoader suppression) and track an open deep-check in TODO.md for whether it — and the LlamaLoader suppression — can be genuinely resolved. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_0137c1LhUbNvW3kt4eF9Kqyb --- .github/workflows/publish.yml | 2 ++ TODO.md | 13 +++++++++++++ spotbugs-exclude.xml | 23 +++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0f073ff1..0f63804e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -84,6 +84,8 @@ jobs: distribution: temurin - name: Spotless check (fail fast on format violations) run: mvn -B --no-transfer-progress spotless:check + - name: SpotBugs check (fail fast on static-analysis findings) + run: mvn -B --no-transfer-progress -DskipTests -Denforcer.skip=true compile spotbugs:check - name: Print internal package dependency graph (jdeps, informational) continue-on-error: true run: | diff --git a/TODO.md b/TODO.md index d28f1d1b..0e976eee 100644 --- a/TODO.md +++ b/TODO.md @@ -13,6 +13,19 @@ cross-cutting initiative. ## Open — jllama-specific +### PATH_TRAVERSAL_IN suppressions — deep-check whether they can be resolved (open) + +Two `PATH_TRAVERSAL_IN` suppressions live in `spotbugs-exclude.xml`: the long-standing +`LlamaLoader` (native-lib path resolved from three operator-controlled inputs) and the new +`OfflineModelGuard` / `ModelParameters` (`--model` GGUF path), added when SpotBugs moved from +the publish-only `verify` phase to the fast early `code-style` CI gate (so the finding now reds +every PR, not just a release). Both are currently justified as "operator-supplied path, no +meaningful allowed-root." **Deep-check whether a genuine fix is feasible** — e.g. canonicalize + +validate, reject `..` traversal where an expected root exists, or otherwise narrow the sink — +instead of suppressing. If it is, replace the suppression with code + a regression test; if it +genuinely is not, keep the suppression and record the finalized rationale here (and on the +`LlamaLoader` block). See [`../workspace/policies/spotbugs-suppressions.md`](../workspace/policies/spotbugs-suppressions.md). + ### PIT gate not hermetic — `value.ContentPart.audioFile(Path)` (open) The PIT mutation gate reaches 100% **only when the audio test fixture is present**. Without it the diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml index 94db590c..ccfbed28 100644 --- a/spotbugs-exclude.xml +++ b/spotbugs-exclude.xml @@ -147,6 +147,29 @@ SPDX-License-Identifier: MIT + + + + + + + + + - - - - - - +