Skip to content

Releases

v0.4.0 — All-Version Spring Boot Production Guardrail (3-Pillar Architecture)

Choose a tag to compare

@wkd09 wkd09 released this 05 Dec 16:01

What's New in v0.4.0

modern-java-guidance (mjg) evolves from a Java 21 / Boot 3 modernization linter into an all-version (Java 8–25, Spring Boot 2.7–3.4+) Spring Boot production guardrail across 3 pillars—still with zero third-party Python dependencies.

Pillar 1 — 14 Version-Independent Production Footguns

Catches real outage & security causes that javac compiles with zero warnings (works on Boot 2.7 through Boot 3.4+):

  • AOP & Transactions: TX-001 (@Transactional on private/final), TX-002 (JDK checked throws without rollbackFor), CONC-001 (@Async on private/final)
  • JPA / Hibernate: JPA-001 (Lombok @Data on @Entity), JPA-002 (@ManyToOne/@OneToOne missing FetchType.LAZY)
  • Spring & Precision: SPRING-001 (new ObjectMapper() in services), JAVA-020 (new BigDecimal(0.1) double literal), OPS-001 (e.printStackTrace())
  • Security & WebFlux: SEC-001 (SQL string concatenation in JdbcTemplate/createNativeQuery, ignoring literal+literal concat), SEC-002 (CORS allowedOrigins("*") + allowCredentials(true) startup crash), REACT-001 (.block() in WebFlux-only apps)
  • Spring Config (application*.yml/.properties): CFG-001 (Actuator * wildcard), CFG-002 (prod ddl-auto: update/create/create-drop), CFG-003 (explicit open-in-view: true)

Pillar 2 — 6 Bidirectional Version Compatibility Guards (COMPAT-001..006)

Protects teams on older Java 8/11/17 or Spring Boot 2.7/3.0–3.3 repos from AI-hallucinated future APIs (activates only when build files declare explicit versions):

  • COMPAT-001: Blocks jakarta.* EE imports on Spring Boot 2.x
  • COMPAT-002: Blocks RestClient / @HttpExchange on Spring Boot < 3.2
  • COMPAT-003: Blocks @MockitoBean / @MockitoSpyBean on Spring Boot < 3.4
  • COMPAT-004: Blocks Virtual Threads / SequencedCollection on Java < 21 (never false-positives on LinkedList.getLast() / Comparator.reversed())
  • COMPAT-005: Blocks record (< 16) and sealed (< 17)
  • COMPAT-006: Blocks .formatted() (< 15) and .stream()...toList() (< 16)

Pillar 3 — Team Config (.mjg.toml), --profile prod, ARCH-001 & mjg init

  • Zero-dependency .mjg.toml loader via Python 3.11+ stdlib tomllib
  • --profile prod (and profile: prod in action.yml) skips pure style rules (JAVA-003, JAVA-004, BOOT-010) so enterprise teams only see real bugs, security, JPA/TX footguns, and version safety
  • mjg init [--profile prod] auto-generates .mjg.toml and suggests ARCH-001 (forbid_controller_repository = true) when a *Service layer exists
  • Supports disable, severity overrides, and [[custom_rules]]

Verification

  • unittest (Python 3.11, 3.12, 3.13): 16/16 passed
  • A/B eval suite: 8/8 passed (100.0%, +87.5 pp vs. 12.5% unguided baseline)
  • Semgrep CI job: 20/20 Java AST rules (semgrep --validate 0 errors, semgrep --test 20/20 passed)
  • GitHub Action E2E job (47539452922): all 5 CI jobs passed

v0.3.0 — GitHub Action (SARIF 2.1.0), Animated Demo & PyPI Publishing Pipeline

Choose a tag to compare

@wkd09 wkd09 released this 05 Dec 15:23

What's New in v0.3.0

modern-java-guidance (mjg) now works seamlessly for both AI coding agents and standard Java / Spring Boot CI teams, with native GitHub Code Scanning (SARIF 2.1.0) and a zero-dependency Composite GitHub Action.

Highlights

  • Composite GitHub Action (action.yml) + SARIF 2.1.0 Code Scanning:
    • Run mjg on every PR with a single workflow step—no AI agent required:
      - uses: wkd09/modern-java-guidance@v0.3.0
        with:
          path: .
          upload-sarif: "true"
    • Generate OASIS SARIF 2.1.0 locally via mjg check . --sarif mjg-results.sarif (repo-relative POSIX URIs, caught_by_javac metadata, zero third-party deps).
  • Animated Terminal Demo (assets/demo.svg):
    • Added a lightweight CSS-animated terminal walkthrough at the top of English, Korean, and Simplified Chinese READMEs showing the 38 ms PostToolUse guardrail catching and correcting legacy Boot 2.x patterns before Maven/Gradle runs.
  • PyPI OIDC Trusted Publishing Workflow (.github/workflows/publish.yml):
    • Complete PyPI metadata (pyproject.toml) + automated sdist/wheel build (twine check + bundled skill assertion) + OIDC publishing workflow.
  • GitHub Discovery:
    • Expanded repository topics (java, spring-boot-3, spring-security, semgrep, sarif, github-action, linter, code-quality).

Verification

  • unittest (Python 3.11, 3.12, 3.13): 13/13 passed (including SARIF 2.1.0 schema & CLI tests)
  • A/B eval suite: 6/6 passed (100.0%, +83.3 pp, 0 false positives on Java 8 / Boot 2.7)
  • Semgrep CI job: diff -u YAML sync, diff -ru bundled skill sync, semgrep --validate (0 errors, 13 rules), semgrep --test (13/13 passed)
  • GitHub Action E2E job (47535735487): Composite uses: ./ verified on ubuntu-latest with SARIF 2.1.0 output validation

v0.2.1 — Wheel-Bundled Skill, Multi-Module Detector, Scanner Hardening & Boot 3.4 Rules

Choose a tag to compare

@wkd09 wkd09 released this 19 Nov 13:31

What's New in v0.2.1

A major reliability, accuracy, and rule-coverage hardening release fixing every P0/P1 edge case found during full codebase & edge-case auditing, plus new Java 16+ / Spring Boot 3.3–3.4+ rules.

P0 Reliability Fixes

  • Wheel-Bundled Skill Assets: Bundled skills/modern-java-guidance inside the Python package (bundled_skill/ via package-data), so install.sh (uv tool install / pip install) + mjg setup now reliably installs skills for both Antigravity and Claude Code (.claude/skills/modern-java-guidance).
  • Gradle JavaVersion.VERSION_1_8 Fix: Fixed regex parsing so Gradle Java 8 projects are accurately detected as Java 8 (0 false positives) instead of falling back to Java 21.
  • Multi-Module Maven / Gradle & Maven BOM Support: detect_project() now walks upward across child → parent pom.xml, Maven <dependencyManagement> BOM (spring-boot-dependencies with ${...} property resolution), and ancestor gradle/libs.versions.toml (including camelCase keys like springBoot / javaVersion).

P1 Scanner & Hook Hardening

  • String Literal & Text-Block Sanitization: Strips //, /* ... */, "..." (properly handling escaped backslashes like "\\"), '...', and Java 15+ """...""" text blocks before scanning—eliminating false positives in log messages and docs.
  • Smart BOOT-004 (@Autowired) Detection: Distinguishes field injection (both multi-line and inline @Autowired private Foo foo;) from constructor/method @Autowired, and skips test files (src/test/, *Test.java, *IT.java).
  • Explicit Locale Exclusion on JAVA-003: String.format(Locale.US, ...) no longer triggers false positives (full parity with Semgrep).
  • Multiline BOOT-006 Detection: Catches multiline .csrf()\n.disable() chains.
  • Inline Suppression & Smart Claude Hook Severity:
    • Suppress intentional exceptions with // mjg:ignore JAVA-010 or // mjg:ignore (inline or preceding line).
    • Claude Code PostToolUse hooks now hard-block ("decision": "block") only on error findings and return non-blocking additionalContext for warning/info (pass --strict to block all).
    • Updated Antigravity hook matcher to include write_file|edit_file.

P2 New Rules, Guides & CLI Polish

  • JAVA-001 & BOOT-001 Expanded: Added Calendar.getInstance() and javax.{inject,mail,xml.bind,ws.rs}.* (both mjg and Semgrep).
  • JAVA-004 (Java 16+): .collect(Collectors.toList()) → Stream.toList() (scanner + guide + Semgrep).
  • BOOT-008 (Spring Boot 3.4+): Deprecated @MockBean / @SpyBean → @MockitoBean / @MockitoSpyBean (scanner + guide + Semgrep).
  • BOOT-009 (Spring Boot 3.0+, build files): Flags incompatible spring-cloud-starter-sleuth → Micrometer Tracing + OpenTelemetry OTLP (#1).
  • BOOT-010 (Spring Boot 3.3+, Dockerfile): Flags unextracted fat-JAR java -jar containers → -Djarmode=tools ... extract, Buildpacks, or AppCDS (#1).
  • CLI Polish: Added mjg --version / -V and strict validation for invalid --boot values.

Verification

  • unittest (Python 3.11, 3.12, 3.13): 12/12 passed
  • A/B eval suite: 6/6 passed (100.0%, +83.3 pp, 0 false positives on Java 8 / Boot 2.7)
  • Semgrep CI job (44530722886): diff -u YAML sync, diff -ru bundled skill sync, semgrep --validate (0 errors, 13 rules), semgrep --test (13/13 passed)
  • Wheel inspection (uv build --wheel): verified modern_java_guidance/bundled_skill/SKILL.md and references/*.md packaged inside wheel.

v0.2.0 — Semgrep Java AST Export & Compiler Overlap Clarity

Choose a tag to compare

@wkd09 wkd09 released this 19 Nov 11:22

What's New in v0.2.0

Driven by community feedback from r/SpringBoot, this release clarifies how mjg complements javac/IDEs and lets teams reuse the exact same version-gated rules in Semgrep CI pipelines.

Highlights

  • Semgrep Java AST Ruleset (rules/semgrep/modern-java-boot3.yaml):
    • Run directly without installing mjg:
      semgrep --config https://raw.githubusercontent.com/wkd09/modern-java-guidance/main/rules/semgrep/modern-java-boot3.yaml .
    • Export a version-gated ruleset matched to your repo's pom.xml / build.gradle(.kts):
      mjg export --format semgrep --path . -o .semgrep/modern-java.yaml
    • All 11 rules are validated (semgrep --validate) and unit-tested (semgrep --test against rules/semgrep/modern-java-boot3.java) in CI on every push.
  • Compiler (javac) Overlap Metadata (caught_by_javac):
    • Every Rule and JSON Finding now reports caught_by_javac (no, compile-error, deprecated).
    • Documented clearly across English, Korean, and Chinese READMEs: 7 of 11 rules are completely silent in javac (new Date(), RestTemplate, @Autowired field injection, Executors.newFixedThreadPool, etc.), while the other 4 catch breakages in ~31 ms inside the AI agent's edit loop before a 10–30 s Maven/Gradle build.
  • Zero Third-Party Dependencies Preserved:
    • mjg still runs on the Python 3.11+ standard library alone (exporters.py emits valid YAML with zero external packages).
  • Roadmap Opened:
    • Tracked Spring Boot 3.x deployment (Layered JAR / AppCDS) and observability (Micrometer / OTLP) rules in #1.

Verification

  • unittest (Python 3.11, 3.12, 3.13): 7/7 passed
  • A/B eval suite: 6/6 passed (100.0%, +83.3 pp vs. unguided baseline, 0 false positives on Java 8 / Boot 2.7)
  • Semgrep CI job: diff -u sync check, semgrep --validate (0 errors, 11 rules), and semgrep --test (11/11 passed)

v0.1.0 — Initial Release (CLI, PostToolUse Hook & Agent Skill)

Choose a tag to compare

@wkd09 wkd09 released this 17 Nov 18:50

Highlights

  • Version-Aware Detection (mjg detect): Parses pom.xml, build.gradle(.kts), gradle/libs.versions.toml, and .java-version so Java 8/11 and Spring Boot 2.x repos never get false-positive warnings.
  • Zero-Dependency Scanner & PostToolUse Hook (mjg check, mjg hook): 11 version-gated rules covering Java 17/21+ (record, sealed, SequencedCollection, Virtual Threads, java.time) and Spring Boot 3.x+ (jakarta.*, SecurityFilterChain, RestClient, constructor injection, Lambda DSL).
  • On-Demand Lookup (mjg search, mjg retrieve): 13 Before/After guides with caveats while keeping SKILL.md at 4.1 KB.
  • One-Line Setup: curl -fsSL https://raw.githubusercontent.com/wkd09/modern-java-guidance/main/install.sh | bash or try without installing via uvx.
  • Verified: 6/6 unit tests pass, 16.7% → 100.0% (+83.3 pp) on the A/B assertion eval suite, 1,000 Java files scanned in 183.4 ms, and ~31 ms median PostToolUse CLI E2E latency.