Skip to content

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

Choose a tag to compare

@wkd09 wkd09 released this 19 Nov 11:22
· 4 commits to main since this release

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)