Follow-up to #1909 — the npm package now installs into a dedicated venv
instead of using uv tool, but these references were missed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace plain logger output with a Live panel showing a function tree
and step-by-step progress. Handle KeyboardInterrupt gracefully with
cleanup. Remove --markdown CLI flag (format_markdown remains for
programmatic use).
The hook was silently swallowing all prek failures with || true,
including actual lint errors. Now it re-runs prek after the first
pass auto-fixes formatting — only real lint errors block.
Replace find_all_functions_in_file (libcst + metadata resolution) with
lightweight ast.parse + iter_child_nodes for top-level function discovery.
Since compare only instruments top-level functions, the full CST parse
with PositionProvider/ParentNodeProvider was unnecessary overhead.
Also fix pre-existing lint issues: move BenchmarkKey to TYPE_CHECKING,
use != instead of not ==, bind loop var in sort_key closure.
Adds `codeflash compare <base_ref> <head_ref>` — compares benchmark
performance between two git refs by auto-detecting changed functions
from the diff, creating worktrees, instrumenting with @codeflash_trace,
running benchmarks, and rendering a Rich side-by-side comparison table.
Supports --pr to resolve a PR number to its branch, --functions for
explicit function targeting, --svg for SVG export, and --timeout.
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.
Adds --rerun <trace_id> CLI flag that passes rerun_trace_id through all
AI service client methods, allowing endpoints to return stored LLM results
instead of making new calls.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>