Commit graph

7572 commits

Author SHA1 Message Date
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
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
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
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
ali
56403d21aa
refactor: install Python CLI into isolated venv instead of uv tool
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>
2026-03-26 17:33:56 +02:00
mashraf-222
0849d153da
Merge pull request #1908 from codeflash-ai/codeflash/optimize-pr1906-2026-03-26T12.05.22
️ Speed up function `_extract_gradle_include_modules` by 22% in PR #1906 (`cf-java-zero-config-strategy`)
2026-03-26 15:46:16 +02:00
codeflash-ai[bot]
99c543ba25
Optimize _extract_gradle_include_modules
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.
2026-03-26 12:05:25 +00:00
HeshamHM28
3f85939e82 fix parse_java_project_config 2026-03-26 13:15:42 +02:00
HeshamHM28
fe17ad46df Fix multi-module config 2026-03-26 12:58:28 +02:00
claude[bot]
d5551a396c fix: resolve mypy type errors in maven_strategy.py (getroot() may return None) 2026-03-26 10:08:37 +00:00
claude[bot]
4102c69f40 style: auto-fix ruff-format line length in function_optimizer.py 2026-03-26 10:07:17 +00:00
HeshamHM28
ab0f914957 Class name regex fix (function_optimizer.py + instrumentation.py) 2026-03-26 12:00:26 +02:00
HeshamHM28
76fe0e13bc Class name regex fix (function_optimizer.py + instrumentation.py) 2026-03-26 12:00:21 +02:00
HeshamHM28
7151341026 remove left over files 2026-03-26 11:38:48 +02:00
HeshamHM28
0317d218de Fix imports 2026-03-26 11:04:50 +02:00
Ubuntu
d2e99e2f51 feat: add JaCoCo deps, fix checkstyle skip properties, and add auto-config integration tests
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>
2026-03-26 07:31:53 +00:00
claude[bot]
10f50b391c style: auto-fix ruff formatting in inject_validation_skip_properties 2026-03-26 06:45:00 +00:00
HeshamHM28
b67bf0b6a8 fix tests 2026-03-26 08:42:00 +02:00
HeshamHM28
0b700664a3 handle multi-module Java projects and disable checkstyle for generated tests 2026-03-26 08:40:23 +02:00
HeshamHM28
c21cf85aca Fix moduleRoot detecation 2026-03-26 08:34:42 +02:00
HeshamHM28
08edf66847 fix maven override the style validation 2026-03-26 08:29:54 +02:00
HeshamHM28
d49ac809e4 fix checkstyle validation 2026-03-26 08:19:05 +02:00
claude[bot]
dc20b7aee3 fix: use standard Maven paths as defaults when source dirs don't exist 2026-03-26 06:08:03 +00:00
claude[bot]
b0f949aa33 style: normalize f-string quotes in add_codeflash_dependency_multimodule 2026-03-26 06:06:12 +00:00