Commit graph

7285 commits

Author SHA1 Message Date
Kevin Turcios
6c82fad943
Merge pull request #1844 from codeflash-ai/bump-version-0.20.3
chore: release v0.20.3
2026-03-16 17:14:52 -06:00
aseembits93
92adcb0ca5 chore: bump version to 0.20.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 16:12:57 -07:00
Saurabh Misra
4e55159d04
Merge pull request #1842 from codeflash-ai/remove-optimizer-tag-subagent
refactor: remove optimized-code tag from subagent XML output
2026-03-16 19:03:00 -04:00
aseembits93
56e19a3589 cleaning up 2026-03-16 16:01:20 -07:00
aseembits93
c544ce6fc7 refactor: remove optimized-code tag from subagent XML output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 15:58:06 -07:00
Saurabh Misra
89dc5fed73
Merge pull request #1835 from codeflash-ai/update-claude-md
update claude.md
2026-03-16 00:42:24 -04:00
misrasaurabh1
ad329cfe4c update 2026-03-15 21:41:26 -07:00
Kevin Turcios
5cef345a14
Merge pull request #1832 from codeflash-ai/fix/restore-version-after-merge
fix: restore version to 0.20.2 after omni-java merge
2026-03-13 18:51:59 -06:00
Mohamed Ashraf
a8a1995292 fix: restore version to 0.20.2 after omni-java merge
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 00:49:18 +00:00
mashraf-222
d08f6627a2
Merge pull request #1199 from codeflash-ai/omni-java
codeflash-omni-java
2026-03-14 02:40:55 +02:00
claude[bot]
188b09fd80
Merge pull request #1830 from codeflash-ai/fix/java-support-mypy-fixes
fix: resolve mypy errors and None concatenation bug in JavaSupport
2026-03-13 02:48:17 +00:00
claude[bot]
6ffff93a1a
Merge pull request #1827 from codeflash-ai/codeflash/optimize-pr1199-2026-03-13T01.44.29
️ Speed up function `_prompt_custom_directory` by 363% in PR #1199 (`omni-java`)
2026-03-13 02:42:12 +00:00
claude[bot]
079dee027a fix: resolve mypy errors and None concatenation bug in JavaSupport
- Fix TypeError in _build_runtime_map when test_function_name is None
- Add missing abstract method stubs (find_references, extract_calling_function_source, load_coverage, setup_test_config)
- Fix Language import to come from language_enum instead of base (which doesn't re-export it)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 02:42:07 +00:00
mashraf-222
6da33f8044
Merge pull request #1829 from codeflash-ai/fix/config-resolution-codeflash-toml
fix: include codeflash.toml in config resolution depth comparison
2026-03-13 04:35:12 +02:00
Mohamed Ashraf
d22d74e112 fix: include codeflash.toml in config resolution depth comparison
When both package.json and codeflash.toml exist in the directory tree,
parse_config_file() only compared package.json against pyproject.toml.
Java projects use codeflash.toml, which was never checked — so any
package.json in a parent directory would always win, setting the wrong
module_root and project_root.

Now we find the closest toml config (pyproject.toml or codeflash.toml)
and compare its depth against package.json, so a closer codeflash.toml
correctly takes priority.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 02:25:37 +00:00
claude[bot]
13fcb048a4
Merge pull request #1826 from codeflash-ai/codeflash/optimize-pr1199-2026-03-13T01.03.06
️ Speed up method `TestGenRequest.to_payload` by 20% in PR #1199 (`omni-java`)
2026-03-13 01:58:50 +00:00
claude[bot]
e1081d4365
Merge pull request #1825 from codeflash-ai/codeflash/optimize-pr1199-2026-03-13T00.56.31
️ Speed up method `OptimizeRequest.to_payload` by 33% in PR #1199 (`omni-java`)
2026-03-13 01:58:37 +00:00
codeflash-ai[bot]
10a6ecb363
Optimize _prompt_custom_directory
The optimization moved the `inquirer.Path` question construction out of the while-loop and added `@lru_cache(maxsize=1)` to `_get_theme()`, eliminating repeated imports and instantiations of `CodeflashTheme` on every prompt iteration. The profiler shows `_get_theme()` was called 1247 times in the original, each time re-importing `init_config` (~2.2% overhead) and constructing a new theme object (~97.8% overhead, 323 µs per call). Moving the question object outside the loop avoids ~13 µs of reconstruction per iteration, and caching the theme cuts 1246 redundant constructions, yielding a 363% speedup with no functional trade-offs.
2026-03-13 01:44:32 +00:00
claude[bot]
ee6749fbfb style: auto-fix ruff formatting in schemas.py 2026-03-13 01:04:35 +00:00
codeflash-ai[bot]
900de505b4
Optimize TestGenRequest.to_payload
The optimization hoists `platform.python_version()` out of the per-call loop by caching it at module import time as `_PLATFORM_PYTHON_VERSION`, eliminating a 500+ns system call on every invocation when the language is not Python. The original code imported `platform` and called `platform.python_version()` inside `to_payload`, incurring repeated overhead even though the value never changes within a process. Line profiler shows the `import platform` statement itself consumed 6.6% of runtime, and the conditional evaluation another 7%. The payload dict construction was also reordered to compute `python_version` upfront, reducing incremental dict updates. This yields a 20% speedup (1.97ms → 1.64ms) with no correctness trade-offs.
2026-03-13 01:03:10 +00:00
codeflash-ai[bot]
588a3a94d6
Optimize OptimizeRequest.to_payload
The optimization hoists `import platform` to module-level (eliminating repeated import overhead on every call) and caches `self.language_info` in a local variable `lang`, cutting repeated attribute lookups from ~11 to ~3 per invocation. The single-dict construction merges what were previously separate assignments for `language_version` and `python_version` into the initial literal, reducing interpreter overhead for dict operations. Line profiler shows the original import cost ~381 ns per call and each `self.language_info.*` access ~150–300 ns; batching these accesses yields the observed 32% runtime improvement with no functional changes.
2026-03-13 00:56:35 +00:00
claude[bot]
9022f9ee43 fix: set original_pass=False when Java comparator scope is exception
When scope_str == "exception", the original code threw an exception and
should not be marked as passed. Consistent with the Python fallback path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 00:25:12 +00:00
Mohamed Ashraf
fa9d32f1c4 Merge branch 'main' into omni-java
Resolve 7 merge conflicts from main's modular refactoring + JS improvements:

- aiservice.py: combine multi-language metadata (omni-java) with main's structure
- cmd_init.py: adopt main's modular split (init_config, init_auth, github_workflow) + add Java import
- code_replacer.py: main's clean early-return style + omni-java's non-Python single-block fallback
- version.py, test_support_dispatch.py, test_javascript_test_runner.py: take main's versions
- uv.lock: regenerated

Port Java into main's modular structure:
- Fix init_java.py lazy imports to point to new modules (init_config, init_auth, github_workflow)
- Add Java workflow support to github_workflow.py (detection, template, customization)
- Fix broken Java imports (function_optimizer, line_profiler) after main's module moves

Add safety tests for merge-critical functions:
- test_add_language_metadata.py: 10 tests covering per-language payload correctness
- test_code_replacer_matching.py: 8 tests covering fallback chain

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 00:15:19 +00:00
mashraf-222
d7ab5a9816
Merge pull request #1818 from codeflash-ai/fix/java-init-flow
fix: complete Java init flow (enum, detection, config)
2026-03-12 06:32:24 +02:00
Mohamed Ashraf
068c1a73d0 test: add unit tests for detect_project_language
Cover all detection paths: Java (pom.xml, build.gradle, build.gradle.kts),
TypeScript, JavaScript, Python, empty directory fallback, and priority
resolution when multiple build system markers coexist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 04:01:49 +00:00
Mohamed Ashraf
cc5b562574 fix: write language field to codeflash.toml for Java projects
configure_java_project() wrote module-root and tests-root but not
language. Downstream, process_pyproject_config() checks
config.get("language") == "java" to set is_java_project, so without
this field the pipeline couldn't identify the project as Java.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 03:22:59 +00:00
Mohamed Ashraf
21142a5d97 fix: add Java project detection to detect_project_language
The function only checked for Python and JS/TS markers. Java projects
(with pom.xml or build.gradle) always fell through to the PYTHON default.
Added Java detection before TypeScript check since build tool files are
definitive markers, mirroring setup/detector.py logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 03:22:45 +00:00
Mohamed Ashraf
8f8d4340d1 fix: add JAVA member to ProjectLanguage enum
The enum only had PYTHON, JAVASCRIPT, TYPESCRIPT but cmd_init.py
references ProjectLanguage.JAVA, causing an AttributeError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 03:22:25 +00:00
mashraf-222
d75ccd0141
Merge pull request #1817 from codeflash-ai/feat/mvn-central-runtime-resolution
feat: resolve codeflash-runtime from Maven Central
2026-03-12 04:15:19 +02:00
Mohamed Ashraf
66e8060d2c refactor: remove dev build fallback from runtime resolution chain
The dev build fallback (codeflash-java-runtime/target/) in
_ensure_codeflash_runtime() was dead code for production users
since that directory only exists in source checkouts. The resolution
chain is now:

1. ~/.m2 cache (instant)
2. Maven Central (primary)
3. GitHub Releases download (production fallback)

_find_runtime_jar() is kept for build_jacoco_agent_arg() and
generate_jacoco_report() which need to locate the JAR by path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 00:05:35 +00:00
Mohamed Ashraf
7f7ce7de91 feat: add GitHub Releases fallback for codeflash-runtime JAR
Adds a download_from_github_releases() fallback between Maven Central
and the dev-build-only local path. This gives pip users a working
fallback when Maven Central is unreachable. Downloads to ~/.cache/codeflash/
and caches for subsequent runs.

Resolution chain is now:
1. ~/.m2 cache (instant)
2. Maven Central (primary)
3. GitHub Releases download (production fallback)
4. Dev build directory (development only)

The GitHub Releases fallback will activate once a release tagged
'runtime-v1.0.0' is published with the JAR as an asset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:56:46 +00:00
Mohamed Ashraf
6e8cf410f2 feat: resolve codeflash-runtime from Maven Central
Maven Central is now the primary resolution path for the codeflash-runtime
JAR. Falls back to local dev build install for development workflows.
Excludes the bundled JAR from the PyPI wheel to save ~15MB.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 23:12:26 +00:00
mashraf-222
f3e36fe409
Merge pull request #1816 from codeflash-ai/feat/maven-central-publishing-setup
Feat/maven central publishing setup
2026-03-12 00:57:22 +02:00
Aseem Saxena
4b8effa07b
Merge pull request #1661 from codeflash-ai/chore/docstring-updates
chore: add docstring to banner helper
2026-03-11 15:30:25 -07:00
Aseem Saxena
5dab68613c
Merge branch 'main' into chore/docstring-updates 2026-03-11 15:21:33 -07:00
Mohamed Ashraf
e2f2d946d9 fix: align ComparatorCorrectnessTest schema with Comparator and fix javadoc config
The test was creating SQLite tables with the old schema (iteration_id,
loop_index, return_value) but Comparator.readTestResults() now expects
test_module_path, test_class_name, and test_function_name columns.

Also configure javadoc plugin with doclint=none and failOnError=false
to prevent malformed HTML in comments from blocking the release build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:34:38 +00:00
Mohamed Ashraf
5150b4feed feat: add Maven Central publishing configuration
Add central-publishing-maven-plugin to the release profile and developer
ID for Sonatype namespace verification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:02:48 +00:00
mohammed ahmed
d616501871
Merge pull request #1808 from codeflash-ai/fix/jest-runtime-config-for-external-tests
fix: use runtime Jest config for test files outside project root
2026-03-11 22:34:10 +02:00
mashraf-222
10a0e1417a
Merge pull request #1775 from codeflash-ai/feat/java-infra-improvements
feat: Java infrastructure — version centralization, pom.xml safety, JaCoCo bundling, Maven Central prep
2026-03-11 16:56:49 +02:00
Saurabh Misra
7f7591cf29
Merge pull request #1813 from codeflash-ai/fix/detect-deletion-only-diffs
fix: detect functions in deletion-only git diffs
2026-03-11 01:19:21 -04:00
Mohamed Ashraf
8bd170ca57 fix: apply 300s timeout for standalone JaCoCo coverage path
The standalone JaCoCo agent path was using a 60s minimum timeout
instead of 300s, causing behavioral tests to be killed before
completion. The JaCoCo agent adds instrumentation overhead regardless
of whether it runs via mvn verify or standalone -javaagent injection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 01:16:52 +00:00
aseembits93
b5a01457d2 test: add unit tests for deletion-only git diff detection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:33:40 -07:00
aseembits93
12b7173388 revert: restore console.py to main branch version
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:13:42 -07:00
aseembits93
4f2a8ff0d8 fix: detect functions in deletion-only git diffs
When a commit only deletes lines (e.g., removing a docstring), get_git_diff
returned an empty add_line_no list, causing no functions to be discovered.
Fall back to hunk target start lines so the surrounding function is still
matched against the current file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:10:29 -07:00
Kevin Turcios
055103da46
Merge pull request #1789 from codeflash-ai/fix-dependabot-vulns
fix: upgrade dependencies to resolve Dependabot security alerts
2026-03-10 17:18:15 -06:00
Kevin Turcios
d77d14be09 chore: upgrade filelock, numpy, posthog, prek, smmap 2026-03-10 16:55:48 -06:00
Kevin Turcios
748094c7e0 Merge remote-tracking branch 'origin/main' into fix-dependabot-vulns 2026-03-10 16:54:29 -06:00
Kevin Turcios
15f8e6f7be
Merge pull request #1811 from codeflash-ai/fix/ci-review-fix-before-close
fix: attempt to fix failing CI on codeflash optimization PRs before closing
2026-03-10 16:48:32 -06:00
aseembits93
59c131a63e Merge remote-tracking branch 'origin/fix/subagent-diff-worktree-paths' into feat/subagent-native-diff-output 2026-03-10 15:47:30 -07:00
aseembits93
9e22a6616f feat: instruct subagent to apply optimized code directly via Edit tool for native diff
Instead of presenting the diff via AskUserQuestion with markdown preview,
the subagent now applies the code directly so the user sees Claude's native inline diff.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:46:15 -07:00