Cache Jedi refs_by_parent across calls, reuse RO results for identical TESTGEN
pruning, pre-filter imports by AST-collected referenced names, and skip
RemoveImportsVisitor when dst has no pre-existing imports.
The optimization introduced `@lru_cache(maxsize=8)` on a new `_get_pom_root_cached()` helper that parses `pom.xml` once and returns the root `ET.Element`, eliminating redundant file I/O and XML parsing when `detect_java_source_root` and `detect_java_test_root` are both called in `configure_java_project` (which happens on every invocation). The profiler confirms the original code spent ~1074 µs in `ET.parse(pom_path)` across both detection functions; caching reduced total parse overhead to a single ~1642 µs hit on first call, with subsequent lookups returning instantly. Additionally, hoisting the Maven namespace dict to a module-level constant `_MAVEN_NS` and inlining the default-value checks (`if source_root != "src/main/java":` instead of building a `defaults` dict) shaved off minor dictionary allocations. The 16% speedup (5.24 ms → 4.49 ms) comes almost entirely from the cache, with no functional regressions.
The build.gradle.kts had an absolute path to a Mac-local JAR with a
"codeflash-runtime" comment, causing add_codeflash_dependency to
short-circuit on every machine. Removed the line and stale JAR so
ensure_runtime handles it correctly at optimization time. Added Gradle
8.12 wrapper so the project builds without requiring system gradle.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace `uv tool install` (which installs globally into ~/.local/bin) with
a dedicated venv at an OS-specific cache directory (~/.cache/codeflash/venv
on Linux, ~/Library/Caches/codeflash/venv on macOS, %LOCALAPPDATA%\codeflash\venv
on Windows). The CLI entry point now invokes the binary directly from the venv
instead of via `uv tool run`. Also strips VIRTUAL_ENV/CONDA env vars from child
processes to avoid interference from activated environments.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pre-compiling the two regex patterns (`_RE_INCLUDE` and `_RE_QUOTED`) at module load time eliminates the per-call compilation overhead that `re.finditer` and `re.findall` incurred when given raw strings. Line profiler shows the inner loop's regex overhead dropped from ~3.4 ms to ~1.8 ms (47% reduction), and the outer loop regex from ~1.8 ms to ~1.1 ms (39% reduction), yielding a 21% overall speedup. The optimization is particularly effective in the realistic `_parse_gradle_settings_modules` caller, where the function may be invoked repeatedly across many project roots. No functional or behavioral changes; all tests pass with identical outputs.
Add JaCoCo runtime and CLI dependencies to Gradle build. Split Maven validation
skip properties into true/false groups so failOnViolation flags are set to false
instead of true. Add Gradle wrapper and integration tests for Java auto-config.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>