Skip to content

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
· 3 commits to main since this release

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.