Commit graph

7592 commits

Author SHA1 Message Date
Aseem Saxena
0db48fa894
Merge pull request #1929 from codeflash-ai/bump-version-0.20.4
chore: release v0.20.4
2026-03-30 15:49:29 -07:00
Aseem Saxena
d31f6075f5
Merge pull request #1930 from codeflash-ai/cf-remove-uv-tool-install-refs
fix: replace remaining uv tool install refs with uv pip install
2026-03-30 15:42:35 -07:00
aseembits93
ec302cc596 fix: replace remaining uv tool install refs with uv pip install
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>
2026-03-30 15:26:07 -07:00
aseembits93
d0425304e5 chore: bump version to 0.20.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 14:12:41 -07:00
Sarthak Agarwal
14dafe08fd
Merge pull request #1919 from codeflash-ai/cf-feat-rerun-trace
feat: add --rerun flag to rerun optimization from stored trace
2026-03-29 18:09:33 +05:30
Kevin Turcios
ab7e1f40a7
Merge pull request #1922 from codeflash-ai/feat/compare-command
feat: add `codeflash compare` CLI command
2026-03-28 02:51:24 -05:00
Kevin Turcios
7c38d1761a Update compare.py 2026-03-28 02:25:57 -05:00
Kevin Turcios
e552ded044 fix: address PR review — resolve refs to SHAs, deduplicate worktree/project_root utils 2026-03-28 02:22:27 -05:00
Sarthak Agarwal
73eeb86e7a
Merge pull request #1857 from codeflash-ai/docs/cc-plugin-documentation
docs: add comprehensive documentation for codeflash-cc-plugin
2026-03-28 12:07:44 +05:30
Kevin Turcios
5c2956cd29 style: auto-size and center result tables in compare output 2026-03-27 19:16:46 -05:00
claude[bot]
07533298d0 fix: resolve mypy type errors in compare.py
Co-authored-by: Kevin Turcios <undefined@users.noreply.github.com>
2026-03-28 00:13:12 +00:00
Kevin Turcios
f91f3e0954 fix: add type annotations and mypy fixes for compare command 2026-03-27 19:10:08 -05:00
Kevin Turcios
0b1e5817f6 feat: add Rich Live panel with tree display for compare progress
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).
2026-03-27 19:03:38 -05:00
Kevin Turcios
fb8c542874 feat: add markdown output with progress bars for compare command
Replace PNG export with GitHub-flavored markdown tables. Add unicode
progress bars for improvement and share-of-time columns, remove image
dependencies (pillow, cairosvg, svglib, reportlab).
2026-03-27 18:30:11 -05:00
Kevin Turcios
7e9b4477be feat: replace --svg with --png output for compare command
Use cairosvg to convert Rich SVG output to PNG at 144 DPI.
Renames the CLI flag from --svg to --png across all touchpoints.
2026-03-27 18:05:10 -05:00
Kevin Turcios
14d81ec3f7 fix: make post-edit lint hook surface real errors
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.
2026-03-27 18:01:16 -05:00
Kevin Turcios
68e633adfe style: fix ruff format in cli.py compare parser args 2026-03-27 17:58:33 -05:00
Kevin Turcios
30f241b031 perf: use stdlib ast instead of libcst for function discovery in compare
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.
2026-03-27 17:56:47 -05:00
Kevin Turcios
f169e862ea
Merge pull request #1921 from codeflash-ai/cf-deep-context-extraction
perf: optimize context extraction with caching and import pre-filtering
2026-03-27 17:37:57 -05:00
Kevin Turcios
fb1381e01f
Merge pull request #1920 from codeflash-ai/cf-cpu-context-extraction
perf: optimize context extraction pipeline (~2x speedup)
2026-03-27 17:37:26 -05:00
claude[bot]
dd32f3023e style: fix ruff lint issues in compare command
- Move BenchmarkKey to TYPE_CHECKING block (TC001)
- Move argparse.Namespace to TYPE_CHECKING block (TC003)
- Fix negated equality check (SIM201)
- Fix loop variable capture in nested function (B023)

Co-authored-by: Kevin Turcios <undefined@users.noreply.github.com>
2026-03-27 22:32:07 +00:00
Kevin Turcios
3a570b0a39 feat: add codeflash compare CLI command for cross-branch benchmark comparison
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.
2026-03-27 17:27:35 -05:00
Kevin Turcios
85eafaaf2d docs: add benchmark comparison image for PRs #1920/#1921 2026-03-27 16:22:13 -05:00
Kevin Turcios
229f5f483c fix: add type params to bare list annotations for mypy 2026-03-27 16:01:06 -05:00
Kevin Turcios
0593723919 perf: optimize context extraction with caching and import pre-filtering (~42% faster)
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.
2026-03-27 15:57:44 -05:00
Kevin Turcios
03e2fff295 refactor: simplify _has_aliased_future_imports check
cst.Attribute branch was dead code since __future__ imports always use
a plain Name node.
2026-03-27 15:57:37 -05:00
Kevin Turcios
f180c3f854 fix: use tuple syntax for isinstance check (Python 3.9 compat) 2026-03-27 15:56:29 -05:00
aseembits93
9ff8190e9d restore install.md 2026-03-27 13:42:56 -07:00
aseembits93
8a24c86922 refinement 2026-03-27 13:42:08 -07:00
Kevin Turcios
8a07c5e263 perf: optimize context extraction pipeline (~2x speedup)
Eliminate redundant CST traversals in code context extraction by caching
dependency data, skipping unnecessary transforms, and removing MetadataWrapper.
2026-03-27 14:27:52 -05:00
ali
3b859d310a
feat: add --rerun flag to replay optimization from stored trace results
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>
2026-03-27 18:11:58 +02:00
Kevin Turcios
2c4989c645
Merge pull request #1917 from codeflash-ai/cf-claude-code-hooks
feat: add Claude Code post-edit lint hook
2026-03-27 09:56:00 -05:00
Kevin Turcios
2e9ce93324 chore: reorganize Claude rules and add workflow guidelines
Move pre-commit/pre-push prek rules from code-style.md to git.md,
deduplicate pipeline docs in CLAUDE.md, and add shared workflow rules.
2026-03-27 09:43:53 -05:00
Kevin Turcios
beb6df99e3 chore: bump ruff-pre-commit to v0.15.8 and update lockfile 2026-03-27 09:06:42 -05:00
Kevin Turcios
c2e37fceb0 feat: add Claude Code post-edit lint hook using prek
Automatically runs `uv run prek` on Python files after Edit/Write
tool usage to catch lint and formatting issues at edit time.
2026-03-27 08:25:36 -05:00
mashraf-222
928cbfbcb8
Merge pull request #1906 from codeflash-ai/cf-java-zero-config-strategy
[Feat] Java Auto Config
2026-03-27 12:16:10 +02:00
Kevin Turcios
1c5404f156
Merge pull request #1915 from codeflash-ai/cf-remove-codeflash-core
chore: remove src/codeflash_core package
2026-03-27 04:21:20 -05:00
Kevin Turcios
93dd88124e chore: remove src/codeflash_core package
Remove the unused codeflash_core package and clean up the sdist include in pyproject.toml.
2026-03-27 04:03:16 -05:00
Kevin Turcios
44cbc00d15
Merge pull request #1914 from codeflash-ai/remove-python-version-field
Remove python_version from API payloads, use language_version
2026-03-27 03:51:41 -05:00
claude[bot]
06a191fbfc
Merge pull request #1912 from codeflash-ai/codeflash/optimize-pr1906-2026-03-27T05.15.59
️ Speed up function `configure_java_project` by 17% in PR #1906 (`cf-java-zero-config-strategy`)
2026-03-27 08:06:43 +00:00
claude[bot]
33d92809d0 fix: remove unused platform import from aiservice.py
Co-authored-by: Kevin Turcios <undefined@users.noreply.github.com>
2026-03-27 08:06:08 +00:00
Kevin Turcios
9183ffa044 Fix language_version for non-Python in optimization_review
Use current_language_support().language_version instead of
hardcoded Python-only detection, so Java/JS/TS get their
version populated correctly.
2026-03-27 02:57:26 -05:00
Kevin Turcios
66f1dab2ba Remove python_version from API payloads
Use language_version exclusively — the backend now resolves
python_version from language_version for backward compatibility.
2026-03-27 02:53:22 -05:00
claude[bot]
002acbcbf6 fix: remove duplicate _get_pom_root_cached definition and stale comments 2026-03-27 05:18:31 +00:00
codeflash-ai[bot]
dd3264fd38
Optimize configure_java_project
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.
2026-03-27 05:16:03 +00:00
Ubuntu
39ce696c3f fix: remove hardcoded Mac path from java-gradle test project and add Gradle wrapper
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>
2026-03-27 04:57:01 +00:00
Sarthak Agarwal
32575780bd
Merge pull request #1898 from codeflash-ai/cf-fix-skip-object-literal-methods
fix: skip object literal methods during JS/TS function discovery
2026-03-26 23:53:05 +05:30
Sarthak Agarwal
41f64e9459
Merge pull request #1899 from codeflash-ai/cf-fix-v8-serializer-cross-context
fix: use cross-context type detection in V8 serializer self-test
2026-03-26 23:52:17 +05:30
Sarthak Agarwal
11632e75ae
Merge pull request #1901 from codeflash-ai/cf-fix-imports-inside-blocks
fix: convert import statements inside function bodies to require() calls
2026-03-26 23:51:26 +05:30
Sarthak Agarwal
45203b5235
Merge pull request #1909 from codeflash-ai/cf-npm-isolated-venv-install
refactor: install Python CLI into isolated venv instead of uv tool
2026-03-26 23:50:42 +05:30