Commit graph

205 commits

Author SHA1 Message Date
HeshamHM28
16b3c2f5e5 Merge branch 'main' into feat/gradle-executor-from-java 2026-03-16 23:45:14 +02: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
HeshamHM28
4d4e946db4 feat: initialize Java Gradle project with basic structure and Fibonacci implementation 2026-03-10 07:46:44 +02:00
Kevin Turcios
45fb07fad2 fix: upgrade dependencies to resolve Dependabot security alerts
Upgrade Python deps via uv sync --upgrade (werkzeug, filelock for py>=3.10,
and others). Run npm audit fix across JS test fixtures to patch minimatch
and rollup vulnerabilities.

Remaining unfixable:
- filelock <3.20.3 for py<3.10 (patched version requires py>=3.10)
- serialize-javascript in mocha ^10 (fix requires mocha 11 breaking change)
2026-03-07 03:48:38 -05:00
Sarthak Agarwal
f5d48841f0 fix mocha test runner 2026-03-03 20:50:50 -05:00
Sarthak Agarwal
bc5e3e878a fix mocha test runner 2026-03-04 03:42:10 +05:30
Kevin Turcios
506017970d fix: remove leftover codeflash_capture instrumentation from test fixture
bubble_sort_method.py was accidentally committed with a @codeflash_capture
decorator and hardcoded temp path from a local test run, breaking tests
in other environments.
2026-02-19 21:43:17 -05:00
Kevin Turcios
c74782757b Merge commit '6346c740' into sync-main-batch-4
# Conflicts:
#	.github/workflows/windows-unit-tests.yml
#	codeflash/code_utils/config_consts.py
#	codeflash/code_utils/instrument_existing_tests.py
#	codeflash/languages/python/context/unused_definition_remover.py
#	codeflash/languages/python/static_analysis/code_replacer.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/optimization/optimizer.py
#	pyproject.toml
2026-02-19 21:26:23 -05:00
Kevin Turcios
c66953d110 Merge commit 'd578d996' into sync-main-batch-2
# Conflicts:
#	codeflash/github/PrComment.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/tracer.py
#	codeflash/verification/parse_test_output.py
#	codeflash/verification/verification_utils.py
2026-02-19 20:27:14 -05:00
Kevin Turcios
7d7a2a21c0 Merge commit '3dd19c62' into sync-main-batch-1
# Conflicts:
#	codeflash/optimization/function_optimizer.py
#	codeflash/verification/verification_utils.py
#	codeflash/version.py
2026-02-19 20:10:05 -05:00
Kevin Turcios
3e282ee293 fix: address security vulnerabilities while maintaining Python 3.9 support
Resolve 12 Dependabot security alerts by constraining vulnerable packages
to Python 3.10+ where patches are available:

Python dependencies:
- filelock: Pin <3.20.3 for Python 3.9, >=3.20.3 for Python 3.10+
  (fixes TOCTOU symlink vulnerabilities CVE-2024-XXXXX)
- tensorflow: Only install on Python 3.10+ (brings keras >=3.12.1, pillow >=12.1.1)
  (fixes 8 high-severity keras vulnerabilities including arbitrary code execution,
   directory traversal, and 1 high-severity pillow out-of-bounds write)

JavaScript dependencies:
- vitest: Update to latest (4.0.18) in test fixture directory
  (fixes moderate-severity esbuild SSRF vulnerability GHSA-67mh-4wv8-2f99)

Python 3.9 notes:
- filelock 3.19.1 has known TOCTOU vulnerabilities (medium severity)
- tensorflow/keras/pillow excluded from Python 3.9 test dependencies
- Python 3.9 reached EOL in October 2025, vulnerabilities are expected

All high-severity vulnerabilities are resolved for Python 3.10+.
Python 3.9 users should upgrade to 3.10+ for full security patches.
2026-02-19 01:26:37 -05:00
ali
9937fe0967
fixes for unit tests 2026-02-12 19:30:46 +02:00
ali
6b77be56ef
ignore calls inside string litrals for instrumentation and fix e2e test 2026-02-12 18:14:33 +02:00
ali
175226bd20
fix: correct loop index calculation in JS performance benchmarking
Loop index now represents how many times all test files ran (batch count)
instead of per-invocation index. Also fixes Date.now() usage when random
seed is active and removes JS-specific workaround in number_of_loops.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 15:32:16 +02:00
ali
dcd9e2a502
some fixes for test runner and instrumentation 2026-02-11 20:27:02 +02:00
HeshamHM28
b7499583af fix pom.xml 2026-02-10 20:27:54 +02:00
ali
6c23255bca
version upgrade for cf package 2026-02-06 18:35:36 +02:00
mohammed ahmed
f800ae3d92
Merge branch 'main' into fix/js-jest30-loop-runner 2026-02-06 17:22:15 +02:00
ali
a6b936402d
fix: include same-class helper methods inside class wrapper for TypeScript
When optimizing TypeScript class methods that call other methods from the
same class, the helper methods were being appended OUTSIDE the class
definition. This caused syntax errors because class-specific keywords like
`private` are only valid inside a class body.

Changes:
- Add _find_same_class_helpers() method to identify helper methods belonging
  to the same class as the target method
- Modify extract_code_context() to include same-class helpers inside the
  class wrapper and filter them from the helpers list
- Fix all JavaScript/TypeScript tests by adding export keywords to test code
  so functions can be discovered by discover_functions()
- Add comprehensive tests for same-class helper extraction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 17:19:46 +02:00
Sarthak Agarwal
6808e467b0 adding package.json update- we shouldnt upload package lock file for tests as version will keep updating 2026-02-05 05:27:19 +05:30
Kevin Turcios
95cc60397d
Merge branch 'main' into omni-java 2026-02-04 03:22:37 -05:00
Mohamed Ashraf
1b911c0dbf fix: handle numbered suffixes in Java instrumented test files
Some instrumented test files have numeric suffixes like _2, _3:
- FibonacciSeriesTest__perfinstrumented_2.java
- KnapsackTest__perfonlyinstrumented_3.java

Updated regex to match optional numeric suffix: (?:_\d+)?
Updated test to verify files with suffixes are detected.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 23:44:17 +00:00
misrasaurabh1
c40798fa73 Merge branch 'omni-java' of github.com:codeflash-ai/codeflash into omni-java 2026-02-02 19:15:37 -08:00
misrasaurabh1
520a1ff08e fix: resolve merge conflict and standardize Java to use FunctionToOptimize
- Resolve merge conflict in code_replacer.py with Java-specific handling
- Update all Java modules to use FunctionToOptimize instead of FunctionInfo
- Add Language.JAVA to language_enum.py
- Update attribute names: name→function_name, start_line→starting_line, etc.
- Update all Java tests to use correct attribute names

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 19:08:09 -08:00
Saurabh Misra
a00eb39cd2 feat: add Java end-to-end tests and CI workflow
Add comprehensive e2e tests for the Java optimization pipeline:
- Function discovery (BubbleSort, Calculator)
- Code context extraction
- Code replacement
- Test discovery (JUnit 5)
- Project detection (Maven)
- Compilation and test execution

Also add:
- GitHub Actions workflow for Java e2e tests (java-e2e-tests.yml)
- Maven pom.xml for the Java sample project
- .gitignore exception for pom.xml

The e2e tests verify the full Java pipeline works correctly,
from function discovery through code replacement.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 01:17:17 +00:00
ali
348a6eccd3
fix: skip module conversion only for TypeScript projects with ts-jest
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:27:41 +02:00
Sarthak Agarwal
4bf664dc39 add vitest runner 2026-01-31 04:29:59 +05:30
Sarthak Agarwal
c56002f287 vitest support add to js/ts project 2026-01-31 01:09:52 +05:30
HeshamHM28
cbb532fcfd add Java code to optimize with tests 2026-01-30 17:34:16 +02:00
misrasaurabh1
29f266ee63 wip java support 2026-01-30 00:37:24 -08:00
misrasaurabh1
325534dbc2 extract class skeleton for optimization context 2026-01-28 23:28:59 -08:00
Sarthak Agarwal
2cc1fb2809 tests for extractor and replacer 2026-01-29 01:27:19 +05:30
Sarthak Agarwal
942bbac356 update to 0.2.0 2026-01-28 18:10:29 +05:30
Sarthak Agarwal
e9eaa4788a update package-lock files 2026-01-28 17:59:20 +05:30
Sarthak Agarwal
acf0423761 move package dependencies to codeflash 2026-01-28 11:34:44 +05:30
misrasaurabh1
54ef71090e add e2e test for CI 2026-01-27 20:54:01 -08:00
aseembits93
ee6872c317 tensorflow, jax, pytorch now working on mac metal 2026-01-15 19:04:31 -08:00
aseembits93
4d28c1779f almost ready 2026-01-15 18:58:13 -08:00
aseembits93
184b8533e0 some jit heavy functions 2026-01-15 17:37:52 -08:00
Aseem Saxena
00edfb1dd2
Apply suggestion from @aseembits93 2026-01-12 16:03:17 -08:00
Aseem Saxena
b5763e3b06
todo tf, jax later 2026-01-12 16:02:35 -08:00
Aseem Saxena
4c6f106ff6
Merge branch 'main' into gpu-sync-instrumentation 2026-01-12 15:46:27 -08:00
Aseem Saxena
0e93cb5ebb only the functions we need 2026-01-09 16:03:24 -08:00
Kevin Turcios
827c15acde update both of these 2026-01-09 02:07:25 -05:00
Kevin Turcios
70eb224d52 simplify E2E replay test 2026-01-09 02:01:12 -05:00
Aseem Saxena
d05f7bb059 detect framework from code 2026-01-07 13:52:40 -08:00
Codeflash Bot
f6302d0b32 newline 2025-11-06 14:05:01 -08:00
Aseem Saxena
dfd51285b0
Apply suggestion from @aseembits93 2025-11-06 14:04:12 -08:00
Codeflash Bot
18a260cab6 classmethod and staticmethod for testing 2025-11-06 13:57:50 -08:00
Codeflash Bot
53ebf4ba71 revert newline 2025-10-31 14:51:37 -07:00