Commit graph

167 commits

Author SHA1 Message Date
Kevin Turcios
d941f3645f ci: consolidate remaining 10 workflows into ci.yaml
Add all non-required-check E2E workflows and prek lint to the
consolidated ci.yaml:

- 4 standard Python E2Es (async, benchmark, coverage, init)
- 3 JS E2Es (cjs-function, esm-async, ts-class)
- 2 Java E2Es (fibonacci-nogit, tracer)
- prek lint

New change detection outputs:
- e2e_js: triggers JS E2Es when packages/ changes
- e2e_java: triggers Java E2Es when java runtime/fixtures change

Total: 17 jobs + determine-changes + gate = 19 jobs in one file.
Down from 22 workflow files to 7 (remaining are non-test: claude,
codeflash self-optimize, label-workflow-changes, publish, java-e2e).

Additional savings per irrelevant PR: ~$0.80 (10 jobs x ~$0.08).
Total per skipped PR: ~$1.85.
2026-04-09 06:35:55 -05:00
Kevin Turcios
7e40e944b1 ci: remove self-reference from change detection paths
ci.yaml was in all three check_paths calls, so creating/modifying
the workflow itself triggered all test jobs. Workflow-only PRs
should skip tests — the gate job still validates the pattern.
2026-04-09 05:47:02 -05:00
Kevin Turcios
5877864fc8 ci: consolidate required checks into single ci.yaml with gate job
Replace 7 individual required-check workflows (unit-tests, mypy,
5 E2E tests) with a single ci.yaml following the astral-sh/ruff
gate pattern:

- determine-changes job uses native git diff (no third-party deps)
- Each test job skipped at job level when paths don't match
- Single required-checks-passed gate job accepts success + skipped
- E2E security preserved: environment gating, author allowlists

This fixes the long-standing issue where workflow-level path filters
leave required checks "Pending" on PRs that don't touch code paths,
blocking merge without admin override.

Estimated savings: ~$1.05/skipped PR ($0.64 unit-tests + $0.01
type-check + $0.40 E2E), ~$50-100/yr in compute, plus eliminating
all admin-merge workarounds.
2026-04-09 05:43:16 -05:00
Kevin Turcios
46e4035b05 ci: bump astral-sh/setup-uv from v6 to v8.0.0
v8 uses immutable releases (no major/minor tags) for supply chain
security. Pinning to exact version tag per upstream recommendation.
2026-04-09 05:16:10 -05:00
Kevin Turcios
07e4566271 ci: remove self-references from workflow path filters
Editing a workflow YAML file should not trigger that same workflow
to run. Removes .github/workflows/<file> from its own paths filter
in mypy.yml, prek.yaml, and unit-tests.yaml.
2026-04-09 05:08:19 -05:00
Kevin Turcios
e2e8557958 ci: remove self-reference from codeflash-optimize paths
Editing the workflow config shouldn't trigger a full optimization run.
2026-04-09 05:04:32 -05:00
Kevin Turcios
b38cfd2186 ci: scope workflow triggers to relevant paths
- codeflash-optimize.yaml: replace paths: ['**'] wildcard with targeted filters
- mypy.yml: add path filters (was firing on every PR/push including docs)
- prek.yaml: add path filters (was firing on every PR)
- unit-tests.yaml: add path filters (was firing on every PR/push)

Docs-only, README, experiment, and LICENSE changes no longer trigger
these workflows. Saves ~20 workflow runs per docs-only PR.
2026-04-09 04:59:24 -05:00
Kevin Turcios
507319066a ci: temporarily disable automatic PR review job
Adds `false &&` guard to the pr-review job condition. The job will
be skipped on all triggers until this is reverted. The @claude mention
job is unaffected.
2026-04-09 04:33:11 -05:00
Kevin Turcios
3dc21bdec3 ci: pin claude-code-action to v1.0.89 to fix Bedrock auth
v1.0.90 broke Bedrock OIDC auth — all Claude Code runs have been
failing with 403 since Apr 8.

Root cause: anthropics/claude-code-action#1196
Pinning to v1.0.89 (last working version) until upstream fix lands.
2026-04-09 02:12:14 -05:00
Kevin Turcios
d344324325 ci: replace wildcard path triggers with targeted filters on E2E tests
All 12 E2E workflows used `paths: ['**']` which triggered on every file
change — docs, configs, experiments, etc. This caused ~140-200 min of
compute per push event (18+ parallel workflows).

Now E2E tests only trigger when relevant source code changes:
- Python E2E: codeflash/**, tests/**, pyproject.toml, uv.lock, workflow files
- JS E2E: same + packages/**
- Java E2E: already had proper path filters (no change needed)

Estimated savings: ~$150-200/mo in CI compute.
2026-04-09 02:06:28 -05:00
misrasaurabh1
0fc5bba763 fix: e2e java tracer runs on all codeflash changes and validates replay tests + speedups
- Trigger on any codeflash/** or tests/** changes (not just java subset)
- Validate replay test files are discovered per-function
- Already validates: replay test generation, global discovery count,
  optimization success, and minimum speedup percentage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 22:34:56 -07:00
Saurabh Misra
59031a145e
Merge pull request #1874 from codeflash-ai/java-tracer
feat: Java tracing agent with end-to-end optimization pipeline
2026-03-19 15:12:11 -07:00
misrasaurabh1
c699093a26 Initial e2e tracer implementation 2026-03-18 23:03:35 -07:00
Kevin Turcios
f4319aac67 fix: scale review depth to PR size, add scope boundaries
- Triage now classifies PRs as TRIVIAL/SMALL/LARGE based on lines changed
- SMALL PRs: focused correctness check, quick duplicate scan, skip coverage
- LARGE PRs: full review with design checks, deep duplicate detection, coverage
- Optimization PRs: concise correctness verdict instead of long essays
- Added explicit scope rules: only read files in the diff, don't explore broadly
2026-03-18 19:06:40 -06:00
Kevin Turcios
f1cf46ce6b fix: improve Claude GHA review behavior
- Stop closing PRs on unrelated CI failures (check base branch first)
- Remove age-only auto-close rule; require individual evaluation
- Prevent mass-closing without per-PR analysis
- Merge conflicts only close after 3 days (not immediately)
- Resolve stale threads silently (no " Fixed" reply noise)
- Add design review checks (module placement, root cause, config files)
- Flag accidental file inclusions (binaries, auto-generated versions)
- Request tests for untested new public functions
2026-03-18 19:01:18 -06: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
Kevin Turcios
3ba68c0288 fix: attempt to fix failing CI on codeflash optimization PRs before closing
Instead of immediately closing optimization PRs when CI fails, Claude
now checks out the branch, inspects failures, and attempts to fix them.
Only closes if unfixable, with a specific explanation of the failures.
2026-03-10 16:34:55 -06:00
Kevin Turcios
89faf1e2fd chore: use default testgen-review-turns in GHA 2026-03-06 17:05:01 -05:00
Kevin Turcios
70a410a656 feat: add --testgen-review-turns CLI flag to control repair cycles 2026-03-06 01:12:39 -05:00
Kevin Turcios
5c34cb994b chore: enable --testgen-review flag in CI optimization workflow 2026-03-06 00:45:23 -05:00
Kevin Turcios
eceac13fc3 Merge remote-tracking branch 'origin/main' into omni-java
# Conflicts:
#	.claude/rules/architecture.md
#	.claude/rules/code-style.md
#	.github/workflows/claude.yml
#	.github/workflows/duplicate-code-detector.yml
#	codeflash/api/aiservice.py
#	codeflash/cli_cmds/console.py
#	codeflash/cli_cmds/logging_config.py
#	codeflash/code_utils/deduplicate_code.py
#	codeflash/discovery/discover_unit_tests.py
#	codeflash/languages/base.py
#	codeflash/languages/code_replacer.py
#	codeflash/languages/javascript/mocha_runner.py
#	codeflash/languages/javascript/support.py
#	codeflash/languages/python/support.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/verification/parse_test_output.py
#	codeflash/verification/verification_utils.py
#	codeflash/verification/verifier.py
#	packages/codeflash/package-lock.json
#	packages/codeflash/package.json
#	tests/languages/javascript/test_support_dispatch.py
#	tests/test_codeflash_capture.py
#	tests/test_languages/test_javascript_test_runner.py
#	tests/test_multi_file_code_replacement.py
2026-03-04 01:52:32 -05:00
Kevin Turcios
bccc02aade merge: incorporate omni-main-java sync work
Merges the omni-main-java branch which synced main into omni-java,
including JavaFunctionOptimizer, removal of is_java()/is_python() guards,
protocol dispatch for parse_test_xml, and deletion of concolic_testing.py.
2026-03-03 23:42:39 -05:00
Kevin Turcios
c7854fb605 chore: remove simplify step from Claude PR review and add prek rule
Drop the /simplify step that caused unprompted refactors and scope
creep in PR reviews. Also add prek pre-commit rule to project config
so the PR bot and all contributors see it.
2026-03-03 22:21:55 -05:00
Kevin Turcios
8f50f31251 fix: add gh pr close permission to pr-review workflow
The merge_optimization_prs step needs to close stale PRs but
gh pr close was missing from the allowed tools list.
2026-03-03 21:04:14 -05:00
Kevin Turcios
dee1175acd chore: remove simplify step from Claude PR review and add prek rule
Drop the /simplify step that caused unprompted refactors and scope
creep in PR reviews. Also add prek pre-commit rule to project config
so the PR bot and all contributors see it.
2026-03-03 20:02:22 -05:00
Mohamed Ashraf
50ba89c6be ci: build codeflash-runtime JAR in unit-tests workflow
The unit-tests workflow relied on a pre-committed JAR binary in
resources/ which could become stale when Comparator.java changes.
Now the workflow builds the JAR from source and installs it to the
local Maven repo, matching what java-e2e and fibonacci-nogit already do.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 20:01:40 +00:00
Kevin Turcios
08dad4e6a4 chore: sync docs, rules, and workflows from main 2026-03-02 22:48:28 -05:00
Kevin Turcios
12b18de2d1 chore: limit claude workflow triggers to reduce spam
- Add paths-ignore to skip reviews for docs, config, CI, and non-production files
- Use github.event.sender.login instead of github.actor for reliable bot detection
- Add triage step to early-exit on trivial PRs
2026-03-02 22:01:11 -05:00
aseembits93
7ee1e7bd2f chore: switch claude workflow model from opus to sonnet 4.6
Use claude-sonnet-4-6 instead of claude-opus-4-6 for CI cost/speed savings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 08:08:28 +05:30
Kevin Turcios
ad4ebdb710 fix: merge duplicate detector into claude workflow and add concurrency
Consolidates duplicate-code-detector.yml into claude.yml as a step in
the pr-review job. Adds concurrency groups with cancel-in-progress to
prevent comment spam from racing workflow runs.
2026-03-02 16:36:35 -05:00
Kevin Turcios
a538722ff7 chore: sync docs, CI, config, and rules from main
Pulls latest changes for .claude/rules/, .github/workflows/, CLAUDE.md,
and docs/ — all main-only changes with no omni-java overlap.
2026-03-02 14:56:26 -05:00
Kevin Turcios
29d0d2cb48 fix: rewrite Claude Code PR review prompt for better instruction following
- Use XML structure instead of markdown for clearer step boundaries
- Resolve stale review threads via GraphQL instead of leaving them
- Positive framing instead of negation for instructions
- Replace aggressive language with calm direct instructions
- Add /simplify skill invocation for code quality pass
- Add verification checkpoint at the end
- Auto-close stale codeflash optimization PRs (age, conflicts, CI failures, deleted functions)
- Remove inline comment MCP tool, add Skill tool
2026-03-02 10:53:35 -05:00
aseembits93
efb5cd9987 reverting workflows to original state 2026-02-24 21:54:58 +05:30
aseembits93
bdd22afe20 chore: sync workflow files from main
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 21:49:11 +05:30
aseembits93
51028a6edf updating workflows to mains 2026-02-24 21:41:39 +05:30
Kevin Turcios
0c786840e7 rework duplicate-code-detector a bit. 2026-02-23 08:16:43 -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
85d1d4fbf6 Merge commit '6020c4fa' into sync-main-batch-3 2026-02-19 20:33:09 -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
Saurabh Misra
67c12bca07
Merge branch 'main' into cf-release-benchmark-0.2.0 2026-02-19 10:31:39 -08:00
Kevin Turcios
81997282d2 ci: consolidate Windows tests into main unit-tests workflow
Remove redundant windows-unit-tests.yml and add Windows Python 3.13 job
to the main unit-tests.yaml workflow. Add PYTHONIOENCODING env var for
Windows compatibility.
2026-02-19 01:36:11 -05:00
Kevin Turcios
d09fa5ceaa ci: add Windows to unit tests matrix
Run unit tests on Windows with Python 3.13 in addition to all Python
versions (3.9-3.14) on Ubuntu. This ensures cross-platform compatibility
is tested while keeping Windows test duration reasonable.
2026-02-19 01:33:52 -05:00
Kevin Turcios
a76f28f196 chore: bump codeflash-benchmark version to 0.3.0 2026-02-18 17:45:55 -05:00
Kevin Turcios
20c956c0e9 feat: add codeflash-benchmark automated release to publish workflow
Extend the publish workflow to handle both codeflash and codeflash-benchmark
releases from a single workflow file, triggered by their respective version
files. Also syncs benchmark __init__.py version to match pyproject.toml.
2026-02-18 17:39:36 -05:00
HeshamHM28
3359c9ab0d add JDK for windows 2026-02-18 03:57:09 +02:00
HeshamHM28
dc1083b3f9 add java jdk 2026-02-18 03:47:42 +02:00
aseembits93
09c026a7b9 fix: use correct Bedrock inference profile ID (no :0 suffix)
The cross-region inference profile for Claude Opus 4.6 on Bedrock is
`us.anthropic.claude-opus-4-6-v1`, not `us.anthropic.claude-opus-4-6-v1:0`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 20:34:49 +05:30
Aseem Saxena
0b9dc5d872
Merge branch 'main' into chore/claude-workflow-aws-bedrock 2026-02-17 20:04:47 +05:30
aseembits93
e1a45dd0c8 chore: switch Claude workflows from Foundry to AWS Bedrock
Replace Azure Foundry authentication with AWS Bedrock OIDC in all
Claude Code GitHub Actions workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 19:02:00 +05:30