Commit graph

7358 commits

Author SHA1 Message Date
aseembits93
95d4863ff2 docs: convert to Mintlify .mdx format with navigation
Move docs into claude-code-plugin/ subdirectory as .mdx files with
Mintlify frontmatter (title, description, icon, sidebarTitle). Add
Claude Code Plugin group to docs.json navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 15:59:03 -07:00
aseembits93
9cc2b949cc docs: add comprehensive documentation for codeflash-cc-plugin
Six documents covering getting started, usage, configuration, architecture,
hook lifecycle, and troubleshooting for the Claude Code plugin.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 15:54:05 -07:00
mohammed ahmed
1e92f3d2ed
Merge pull request #1814 from codeflash-ai/fix/js-replacement-stale-line-numbers-after-global-declarations
fix: re-discover function position after add_global_declarations shifts line numbers
2026-03-17 17:17:51 +02:00
Sarthak Agarwal
d10f18a4bb
Merge pull request #1836 from codeflash-ai/fix/symlink-node-modules-in-worktree
fix: symlink node_modules in worktree for JS/TS projects
2026-03-17 20:42:18 +05:30
ali
3bbaf26008
test: add unit tests for node_modules symlink in JS worktree setup
Covers setup_test_config symlinking node_modules from original repo
to worktree, including edge cases (no worktree, missing node_modules,
already existing node_modules).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 16:54:34 +02:00
ali
52a04e820c
Merge branch 'main' of github.com:codeflash-ai/codeflash into fix/symlink-node-modules-in-worktree 2026-03-17 16:41:21 +02:00
ali
040d19bf29
handle overload methods 2026-03-17 15:35:31 +02:00
ali
1282a103cd
Merge branch 'main' of github.com:codeflash-ai/codeflash into fix/js-replacement-stale-line-numbers-after-global-declarations 2026-03-17 15:11:40 +02:00
mohammed ahmed
6e867c959c
Merge pull request #1525 from codeflash-ai/feat/enable-coverage-check-all-languages
feat: enable coverage check for js/ts
2026-03-17 15:09:36 +02:00
ali
7a3808a230
enable coverage check for js/ts 2026-03-17 14:35:20 +02:00
ali
1bce740190
Merge branch 'main' of github.com:codeflash-ai/codeflash into feat/enable-coverage-check-all-languages 2026-03-17 14:35:03 +02:00
Kevin Turcios
d6c8a0a5f7
Merge pull request #1854 from codeflash-ai/cleanup/remove-dead-code
remove dead code
2026-03-17 02:35:44 -06:00
claude[bot]
b2ccf4cb40 fix: remove deleted cli_common.py from mypy_allowlist.txt
Co-authored-by: Kevin Turcios <KRRT7@users.noreply.github.com>
2026-03-17 08:18:45 +00:00
claude[bot]
8f571ccd0f fix: resolve mypy "Name _ already defined" error in registry.py
Replace three `from X import support as _` patterns with a loop using
`importlib.import_module()`, eliminating the duplicate name binding.

Co-authored-by: Kevin Turcios <KRRT7@users.noreply.github.com>
2026-03-17 08:13:04 +00:00
claude[bot]
8dc6d9eeda fix: remove test for deleted create_pyproject_toml function
The function was removed in the dead code cleanup but the test file still
imported it and had a TestCreatePyprojectToml class, causing ImportError.

Co-authored-by: Kevin Turcios <undefined@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 07:48:19 +00:00
claude[bot]
d1a128dcda style: auto-fix ruff import sorting and remove redundant noqa comments
- Merge duplicate `from codeflash.cli_cmds.console import` lines (I001)
- Remove unused `# noqa: F401` from `support as _` imports in registry.py (RUF100)

Co-authored-by: Kevin Turcios <undefined@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 07:44:13 +00:00
Kevin Turcios
8f060237dd Move apologize_and_exit to console.py, delete cli_common.py
Function now lives alongside the console/logger it depends on.
Updated all 8 callers to import from cli_cmds.console instead.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-03-17 01:38:43 -06:00
Kevin Turcios
dd87a37db8 Remove dead inquirer wrapper functions from cli_common.py
inquirer_wrapper, inquirer_wrapper_path, split_string_to_cli_width,
and split_string_to_fit_width were replaced by direct inquirer usage
with CodeflashTheme and rich.prompt.Confirm. Only apologize_and_exit
remains.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-03-17 01:09:56 -06:00
Kevin Turcios
185ebbd348 Remove dead code identified by Skylos static analysis
- Remove orphaned api/schemas.py entirely (unused schema layer)
- Remove aiservice.py: optimize_python_code, get_jit_rewritten_code, optimize_python_code_refinement alias
- Remove CodeNormalizer ABC tombstone from normalizer.py
- Remove TestFiles.get_by_type, TestResults.get_all_ids from models.py
- Remove create_pyproject_toml from config_writer.py
- Remove markdown_pattern_python_only from models.py
- Remove LOGGING_FORMAT from logging_config.py
- Fix self-referential import in treesitter.extract_calling_function_source
- Add # noqa: F401 to side-effect support imports in registry.py

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-03-17 01:01:20 -06:00
Kevin Turcios
a0a2a85020
Merge pull request #1660 from codeflash-ai/unstructured-inference
feat: improve function ranking with reference graph and test-based boosting
2026-03-16 23:05:28 -06:00
Kevin Turcios
8af7fdc093 fix: address review items — type annotation, optimize _find_class_node_by_name and ancestors
- Fix duplicate type annotation for test_count_cache in optimizer.py
- Replace ast.walk() with stack-based traversal in _find_class_node_by_name (21x speedup)
- Use list instead of deque in CallGraph.ancestors (34% speedup, order doesn't matter for set result)
2026-03-16 22:48:46 -06:00
Kevin Turcios
4822d1a890
Merge pull request #1851 from codeflash-ai/cf-update-claude-rules
docs: improve Claude rules based on eval results
2026-03-16 22:05:34 -06:00
Kevin Turcios
e5a487c608 docs: strengthen Claude rules based on eval results
Eval showed docstrings, tmp_path, and .resolve() rules were being
ignored. Made phrasing more explicit and added concrete examples.
2026-03-16 21:48:53 -06:00
Kevin Turcios
b809cb3463
Merge pull request #1850 from codeflash-ai/codeflash/optimize-pr1660-2026-03-17T03.31.35
️ Speed up function `_expr_matches_name` by 26% in PR #1660 (`unstructured-inference`)
2026-03-16 21:45:39 -06:00
codeflash-ai[bot]
d87b6ad9c7
Optimize _expr_matches_name
The optimization replaced recursive calls in `_get_expr_name` with an iterative loop that walks attribute chains once, collecting parts into a list and reversing them only at the end, eliminating function-call overhead that dominated 46% of original runtime (line profiler shows recursive calls at 1154 ns/hit vs. the new loop iterations at ~300 ns/hit). Additionally, `_expr_matches_name` now precomputes `"." + suffix` once instead of building it twice per invocation via f-strings, cutting redundant string allocations. The net 26% runtime improvement comes primarily from avoiding Python's recursion stack and reducing temporary object creation in the hot path, with all tests passing and only minor per-test slowdowns (typically 10–25%) offset by dramatic wins on deep attribute chains (up to 393% faster for 100-level nesting).
2026-03-17 03:31:39 +00:00
Kevin Turcios
46dd0be9a7 docs: improve Claude rules based on eval results
Expanded bug fix workflow to explicit 5-step sequence with subagent delegation, aligned type annotation rule with codebase conventions, simplified verification rule to reference prek, and expanded git/PR guidelines.
2026-03-16 20:45:32 -06:00
Saurabh Misra
e5980c1f2a
Merge pull request #1848 from codeflash-ai/java-runtime-annotations-fix
fix: filter Java runtime annotations by class name and fix ordering
2026-03-16 19:33:18 -07:00
misrasaurabh1
6c3f626c9e fix: filter Java runtime annotations by class name and fix ordering
Runtime annotations in PR descriptions were broken in two ways:
1. add_runtime_comments() ignored class/method prefixes in keys, causing
   annotations from unrelated test classes to leak across files and sum
   incorrectly at the same line number. Now filters by class names found
   in each test source file.
2. Test functions were removed before annotations were added, shifting
   line numbers so annotations landed on wrong lines. Swapped ordering
   so annotations are applied first, then function removal carries them
   along correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 17:51:57 -07:00
Saurabh Misra
f73b9a3713
Merge pull request #1847 from codeflash-ai/fix-some-files
revert config
2026-03-16 19:59:21 -04:00
claude[bot]
c0577e5732
Merge pull request #1845 from codeflash-ai/codeflash/optimize-pr1660-2026-03-16T23.30.46
️ Speed up function `collect_existing_class_names` by 109% in PR #1660 (`unstructured-inference`)
2026-03-16 23:59:16 +00:00
misrasaurabh1
e565b5f49c revert 2026-03-16 16:58:57 -07:00
claude[bot]
a508ef6a6c fix: add explicit list[ast.AST] type annotation for stack in collect_existing_class_names 2026-03-16 23:33:30 +00:00
codeflash-ai[bot]
3994f255a9
Optimize collect_existing_class_names
The optimization replaced a large multi-type `isinstance()` check (13 AST node types constructed into a tuple on every iteration) with a single `hasattr(node, "body")` test, then conditionally checked for `orelse`, `finalbody`, and `handlers` only when `body` exists. Line profiler shows the original `isinstance` block consumed ~40% of runtime across 7327 calls, while the new `hasattr` checks are ~3× cheaper per call. The nested conditionals avoid calling `getattr` with default values when attributes are absent (e.g., `orelse` is missing in 85% of nodes), cutting wasted attribute lookups from four unconditional `getattr` calls to typically one or two `hasattr` checks plus direct accesses. Across 59 test runs processing ~7300 AST nodes each, this yields a 109% speedup with identical correctness.
2026-03-16 23:30:49 +00:00
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
Kevin Turcios
85d0d7c526 fix: normalize HASHING context in re_extract_from_cache
re_extract_from_cache was always calling add_needed_imports_from_module,
but HASHING context should use ast.unparse(ast.parse()) to normalize
whitespace for consistent hashing, matching extract_all_contexts_from_files.
2026-03-16 14:59:01 -06:00
Kevin Turcios
2cafadb980 fix: deduplicate test count calls, guard None, and log effort escalation
Build test_count_cache once before ranking instead of calling
existing_unit_test_count O(2N) times. Guard for None function_to_tests
and add debug logging when effort is escalated from medium to high.
2026-03-16 14:41:55 -06:00
Kevin Turcios
1d1d183075 fix: move Path import into TYPE_CHECKING block in code_extractor.py
Fixes ruff TC003 — Path is only used in annotations which are strings
at runtime due to `from __future__ import annotations`.
2026-03-16 14:04:27 -06:00
Kevin Turcios
e55e552698
Merge pull request #1840 from codeflash-ai/codeflash/optimize-pr1837-2026-03-16T19.38.09
️ Speed up function `_should_use_raw_project_class_context` by 42% in PR #1837 (`codeflash/optimize-pr1660-2026-03-16T18.33.59`)
2026-03-16 14:01:31 -06:00
Kevin Turcios
c7e34264dd
Merge pull request #1837 from codeflash-ai/codeflash/optimize-pr1660-2026-03-16T18.33.59
️ Speed up function `_parse_and_collect_imports` by 12% in PR #1660 (`unstructured-inference`)
2026-03-16 13:59:18 -06:00
Kevin Turcios
299853b684
Merge pull request #1838 from codeflash-ai/codeflash/optimize-pr1660-2026-03-16T19.13.06
️ Speed up function `collect_existing_class_names` by 188% in PR #1660 (`unstructured-inference`)
2026-03-16 13:59:09 -06:00
Saurabh Misra
eadb3a280c
Merge pull request #1839 from codeflash-ai/codeflash/optimize-pr1838-2026-03-16T19.35.10
️ Speed up function `_should_use_raw_project_class_context` by 51% in PR #1838 (`codeflash/optimize-pr1660-2026-03-16T19.13.06`)
2026-03-16 15:58:36 -04:00
claude[bot]
f7d0e79b3b style: fix trailing whitespace on blank lines (W293) 2026-03-16 19:41:58 +00:00
claude[bot]
f9732eea6f style: auto-fix ruff SIM110 linting issue in _is_namedtuple_class 2026-03-16 19:38:14 +00:00
codeflash-ai[bot]
63ff5756c1
Optimize _should_use_raw_project_class_context
The optimization reorders checks in `_should_use_raw_project_class_context` to perform cheap O(1) checks before expensive body iterations. Moving the `decorator_list` check from near the end to the very start eliminates ~60% of body scans when decorators are present (line profiler shows the single-pass loop dropped from 2.84ms to 2.60ms per hit). Folding the manual `_class_has_explicit_init` and `_has_descriptor_like_class_fields` calls into one body traversal with early returns cuts redundant iterations, and checking for namedtuple/dataclass before computing size metrics avoids the `_get_class_start_line` computation in ~15% of cases. This achieves a 42% runtime improvement (737µs → 518µs) with no functional regressions.
2026-03-16 19:38:13 +00:00
codeflash-ai[bot]
2d5eec2949
Optimize _should_use_raw_project_class_context
The optimization replaced `any()` generator expressions with explicit early-return for-loops in four helper functions (`_is_namedtuple_class`, `_class_has_explicit_init`, `_has_descriptor_like_class_fields`, and `_has_non_property_method_decorator`), eliminating the overhead of building generator objects and calling the `any()` builtin. Line profiler data shows `_class_has_explicit_init` dropped from 1.85 ms to 0.96 ms (48% faster), and `_is_namedtuple_class` improved from 97 µs to 53 µs (46% faster), because the optimized code avoids allocating iterator state and returns immediately upon finding a match instead of completing the generator. The 51% overall runtime improvement (1.43 ms → 948 µs) comes from these cumulative reductions in per-call overhead across thousands of invocations during AST traversal. Test suite confirms no behavioral changes across all edge cases including dataclasses, decorators, and size-limit boundaries.
2026-03-16 19:35:14 +00:00
claude[bot]
de334f725e fix: resolve TC003 and mypy operator error in code_context_extractor 2026-03-16 19:23:46 +00:00