Operations

CI/CD 적용

PR에서는 jam-lite를 빠르게 실행하고, 릴리스나 야간 job에서는 jam-full로 test/security 증적을 합성하는 구성을 권장합니다.

Pull request gate

기본 PR job은 빌드 툴체인 없이도 동작하는 jam-lite로 두고, SARIF를 code scanning에 업로드합니다.

jam-lite.ymlpull_request
name: jam-lite

on:
  pull_request:

permissions:
  contents: read
  security-events: write

jobs:
  jam:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install JAM
        run: curl -fsSL https://jhl-labs.github.io/jam/install.sh | sudo bash
      - name: Run JAM
        run: jam lite . --json --sarif --strict --fail-under 80 --out reports/jam
      - name: Upload SARIF
        if: always()
        uses: github/codeql-action/upload-sarif@v4
        with:
          sarif_file: reports/jam/jam.sarif
      - name: Upload report
        if: always()
        uses: actions/upload-artifact@v7
        with:
          name: jam-lite
          path: reports/jam

독립 라벨 benchmark gate

.github/workflows/labeled-benchmark.yml은 점수 회귀 코퍼스와 별도로 OWASP BenchmarkJava의 고정 commit과 label SHA-256을 검증하고, 사전 선언한 CWE-78/89/327 1,001개 사례의 TP/FN/TN/FP 기준선을 재현합니다.

local validationindependent labels
go run ./tools/labeled-benchmark --validate-only
go run ./tools/labeled-benchmark \
  --jam ./bin/jam \
  --cache-dir .cache/jam-validation/repos \
  --out-dir reports/labeled-benchmark

Full gate

full gate는 test-cli/security-cli 준비가 필요하므로 release runner, nightly runner, 또는 toolchain image에서 실행하는 편이 안정적입니다.

jam-full.ymlrelease
name: jam-full

on:
  workflow_dispatch:

jobs:
  full:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install JAM
        run: curl -fsSL https://jhl-labs.github.io/jam/install.sh | sudo bash
      - name: Install companion tools
        run: |
          # Install test-cli from your internal distribution or runner image.
          curl -fsSL https://jhl-labs.github.io/security-cli/install.sh | sudo bash
          security-cli tools install
          security-cli tools update-db
      - name: Run full score
        run: jam full . --json --sarif --fail-under 80 --full-timeout 30m --out reports/jam-full
      - name: Upload reports
        if: always()
        uses: actions/upload-artifact@v7
        with:
          name: jam-full
          path: reports/jam-full

JAM 자체 pinned corpus gate

JAM 저장소는 .github/workflows/e2e-corpus.yml에서 16개 외부 저장소를 고정 SHA로 clone하고 4개 cache shard로 나눠 exact score/grade, expected integrity, Git provenance와 5종 산출물 계약을 검증합니다. 이 코퍼스는 독립 타당화 표본이 아니라 partition=regression으로 표시됩니다.

local corpus smokemanifest + selected sample
go run ./tools/e2e-corpus --validate-only
go run ./tools/e2e-corpus \
  --jam ./bin/jam \
  --sample go-cleanhttp-best \
  --cache-dir .cache/jam-e2e/repos \
  --out-dir reports/e2e-corpus

Release workflow for JAM itself

이 저장소는 security-cli와 같은 dist 배포 구조를 사용합니다. v* 태그가 push되면 Linux/macOS/Windows amd64/arm64 바이너리와 archive, SHA256SUMS를 생성하고 jhl-labs/distjam-v* release에 업로드합니다.

운영 기준

  • PR은 jam lite --strict --sarif를 기본으로 두고, fail-under는 팀의 baseline 이후 올립니다.
  • full은 외부 toolchain 영향이 있으므로 리포트 artifact를 항상 업로드합니다.
  • exit 1은 품질 실패, exit 4는 측정 인프라 실패로 triage queue를 나눕니다.
  • baseline 회귀 관리는 jam diff --fail-on-added로 finding ID 기준 비교를 사용합니다.