Skip to content

Commit c9c5f9d

Browse files
Ubuntuclaude
andcommitted
Merge branch 'main' into java-config-redesign
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 parents aeeca5c + 2d2bdc7 commit c9c5f9d

41 files changed

Lines changed: 2962 additions & 2317 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/hooks/post-edit-lint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
# Everyone is on macOS so this should be fine, we don't account for Windows
3+
set -euo pipefail
4+
5+
input=$(cat)
6+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty')
7+
8+
if [[ -z "$file_path" || ! -f "$file_path" ]]; then
9+
exit 0
10+
fi
11+
12+
if [[ "$file_path" == *.py ]]; then
13+
# First run auto-fixes formatting; second run catches real lint errors
14+
uv run prek --files "$file_path" 2>/dev/null || uv run prek --files "$file_path"
15+
fi

.claude/rules/code-style.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@
1111
- **Paths**: Always use absolute paths
1212
- **Encoding**: Always pass `encoding="utf-8"` to `open()`, `read_text()`, `write_text()`, etc. in new or changed code — Windows defaults to `cp1252` which breaks on non-ASCII content. Don't flag pre-existing code that lacks it unless you're already modifying that line.
1313
- **Verification**: Use `uv run prek` to verify code — it handles ruff, ty, mypy in one pass. Don't run `ruff`, `mypy`, or `python -c "import ..."` separately; `prek` is the single verification command
14-
- **Pre-commit**: Run `uv run prek` before committing — fix any issues before creating the commit
15-
- **Pre-push**: Before pushing, run `uv run prek run --from-ref origin/<base>` to check all changed files against the PR base — this matches CI behavior and catches issues that per-commit prek misses. To detect the base branch: `gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo main`

.claude/rules/git.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
- Commit message body should be concise (1-2 sentences max)
1010
- Merge for simple syncs, rebase when branches have diverged significantly
1111
- When committing to an external/third-party repo, follow that repo's own conventions for versioning, changelog, and CI
12+
- Pre-commit: Run `uv run prek` before committing — fix any issues before creating the commit
13+
- Pre-push: Run `uv run prek run --from-ref origin/<base>` to check all changed files against the PR base — this matches CI behavior and catches issues that per-commit prek misses. To detect the base branch: `gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo main`
1214

1315
## Pull Requests
1416
- PR titles should use conventional format

.claude/rules/workflow.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Workflow
2+
3+
## Code Changes
4+
- Before making any changes, outline your approach in 3-5 numbered steps. Include which repo/branch you'll work in, what commands you'll run, and what success looks like. Wait for approval before starting
5+
6+
## Response Style
7+
- When listing items (PRs, functions, optimization targets), always provide the complete list ordered by priority on the first attempt. Do not give partial lists
8+
9+
## Commands
10+
- When running long-running commands (benchmarks, profiling, optimizers like codeflash), always run them in the foreground. Do not use background processes
11+
12+
## Debugging
13+
- When claiming something is a pre-existing issue (e.g., test failures on main), verify by checking out main and running the tests before making that claim

.claude/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"hooks": {
3+
"PostToolUse": [
4+
{
5+
"matcher": "Edit|Write",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": ".claude/hooks/post-edit-lint.sh",
10+
"timeout": 30
11+
}
12+
]
13+
}
14+
]
15+
}
16+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ tessl.json
269269
# Claude Code - track shared rules, ignore local config
270270
.claude/*
271271
!.claude/rules/
272+
!.claude/settings.json
273+
!.claude/hooks/
272274
**/node_modules/**
273275
**/dist-nuitka/**
274276
**/.npmrc

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.15.0
3+
rev: v0.15.8
44
hooks:
55
# Run the linter.
66
- id: ruff-check

CLAUDE.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ CodeFlash is an AI-powered code optimizer that automatically improves performanc
1010
Discovery → Ranking → Context Extraction → Test Gen + Optimization → Baseline → Candidate Evaluation → PR
1111
```
1212

13-
1. **Discovery** (`discovery/`): Find optimizable functions across the codebase
14-
2. **Ranking** (`benchmarking/function_ranker.py`): Rank functions by addressable time using trace data
15-
3. **Context** (`languages/<lang>/context/`): Extract code dependencies (read-writable code + read-only imports)
16-
4. **Optimization** (`optimization/`, `api/`): Generate candidates via AI service, run in parallel with test generation
17-
5. **Verification** (`verification/`): Run candidates against tests, compare outputs via custom pytest plugin
18-
6. **Benchmarking** (`benchmarking/`): Measure performance, select best candidate by speedup
19-
7. **Result** (`result/`, `github/`): Create PR with winning optimization
13+
See `.claude/rules/architecture.md` for directory mapping and entry points.
2014

2115
# Instructions
2216
- **Bug fix workflow** — follow these steps in order, do not skip ahead:

codeflash-java-runtime/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ tasks.shadowJar {
4747
archiveVersion.set("1.0.0")
4848
archiveClassifier.set("")
4949

50-
relocate("org.objectweb.asm", "com.codeflash.asm")
50+
relocate("org.objectweb.asm", "com.codeflash.shaded.org.objectweb.asm")
51+
relocate("com.google.gson", "com.codeflash.shaded.com.google.gson")
52+
relocate("com.esotericsoftware", "com.codeflash.shaded.com.esotericsoftware")
53+
relocate("org.objenesis", "com.codeflash.shaded.org.objenesis")
54+
relocate("org.slf4j", "com.codeflash.shaded.org.slf4j")
55+
relocate("org.jacoco", "com.codeflash.shaded.org.jacoco")
5156

5257
manifest {
5358
attributes(

codeflash-java-runtime/pom.xml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,35 @@
156156
<relocations>
157157
<relocation>
158158
<pattern>org.objectweb.asm</pattern>
159-
<shadedPattern>com.codeflash.asm</shadedPattern>
159+
<shadedPattern>com.codeflash.shaded.org.objectweb.asm</shadedPattern>
160+
</relocation>
161+
<relocation>
162+
<pattern>com.google.gson</pattern>
163+
<shadedPattern>com.codeflash.shaded.com.google.gson</shadedPattern>
164+
</relocation>
165+
<relocation>
166+
<pattern>com.esotericsoftware</pattern>
167+
<shadedPattern>com.codeflash.shaded.com.esotericsoftware</shadedPattern>
168+
</relocation>
169+
<relocation>
170+
<pattern>org.objenesis</pattern>
171+
<shadedPattern>com.codeflash.shaded.org.objenesis</shadedPattern>
172+
</relocation>
173+
<relocation>
174+
<pattern>org.slf4j</pattern>
175+
<shadedPattern>com.codeflash.shaded.org.slf4j</shadedPattern>
176+
</relocation>
177+
<relocation>
178+
<pattern>org.jacoco</pattern>
179+
<shadedPattern>com.codeflash.shaded.org.jacoco</shadedPattern>
180+
</relocation>
181+
<relocation>
182+
<pattern>org.kohsuke</pattern>
183+
<shadedPattern>com.codeflash.shaded.org.kohsuke</shadedPattern>
184+
</relocation>
185+
<relocation>
186+
<pattern>com.vladium</pattern>
187+
<shadedPattern>com.codeflash.shaded.com.vladium</shadedPattern>
160188
</relocation>
161189
</relocations>
162190
<transformers>

0 commit comments

Comments
 (0)