Skip to content

Commit 7889ff7

Browse files
committed
Merge main into feature/update_lock, resolve conflicts
Resolve conflicts keeping ralph-orchestrator over ralph-claude-code: - pyproject.toml: keep ralph-orchestrator dependency, drop ralph-claude-code and gh - .gitignore: keep .ralph/ ignore, add .claude/settings.local.json from main - PROMPT.md: keep clean ralph-orchestrator template - .claude/README.md: keep ralph-orchestrator documentation - pixi.lock: regenerated with updated dependencies
2 parents e81e8bf + db84f21 commit 7889ff7

20 files changed

Lines changed: 630 additions & 114 deletions

.claude/commands/fix-issue.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Fix GitHub Issue
2+
3+
Fix the GitHub issue: $ARGUMENTS
4+
5+
## Steps
6+
7+
1. Fetch issue details: `pixi run gh issue view $ARGUMENTS`
8+
2. Extract the issue number from the URL for commit messages
9+
3. Understand the problem and locate relevant code
10+
4. Implement the fix
11+
5. Run `pixi run ci` to verify (format, lint, test, coverage)
12+
6. Commit with message referencing the issue (e.g., `Fixes #123`)
13+
7. Create PR: `pixi run gh pr create`
14+
15+
## Notes
16+
17+
- Input can be a GitHub URL (e.g., `https://github.com/owner/repo/issues/123`) or issue number
18+
- Keep changes minimal and focused on the issue
19+
- Add tests if fixing a bug
20+
- Run full CI before committing

.devcontainer/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04
22

3-
ARG PIXI_VERSION=v0.62.2
3+
ARG PIXI_VERSION=v0.63.1
44

55
RUN curl -L -o /usr/local/bin/pixi -fsSL --compressed "https://github.com/prefix-dev/pixi/releases/download/${PIXI_VERSION}/pixi-$(uname -m)-unknown-linux-musl" \
66
&& chmod +x /usr/local/bin/pixi \
@@ -17,3 +17,6 @@ RUN echo 'eval "$(pixi completion -s bash)"' >> /home/vscode/.bashrc \
1717

1818
# Create .ssh directory with proper permissions for SSH config mounts
1919
RUN mkdir -p /home/vscode/.ssh && chmod 700 /home/vscode/.ssh
20+
21+
# Create .config/gh directory for GitHub CLI config mounts
22+
RUN mkdir -p /home/vscode/.config/gh

.devcontainer/ci/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "python_template-build",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"context": "../.."
6+
},
7+
"features": {
8+
"../claude-code": {},
9+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
10+
"ghcr.io/devcontainers/features/common-utils:2": {}
11+
}
12+
}

.devcontainer/devcontainer.json

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
{
22
"name": "python_template",
3-
"build": {
4-
"dockerfile": "Dockerfile",
5-
"context": ".."
3+
4+
// Uses the template's prebuilt image by default for fast startup.
5+
// To build locally: pixi run dev-use-local
6+
// To use this repo's own prebuilt image: pixi run dev-use-prebuilt
7+
// "build": {
8+
// "dockerfile": "Dockerfile",
9+
// "context": ".."
10+
// },
11+
"image": "ghcr.io/blooop/python_template/devcontainer:latest",
12+
13+
"features": {
14+
"./claude-code": {},
15+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
16+
"ghcr.io/devcontainers/features/common-utils:2": {}
617
},
18+
719
"initializeCommand": ".devcontainer/claude-code/init-host.sh",
820
"customizations": {
921
"vscode": {
@@ -14,17 +26,10 @@
1426
"jjjermiah.pixi-vscode",
1527
"charliermarsh.ruff",
1628
"tamasfe.even-better-toml",
17-
"mhutchie.git-graph"
18-
]
29+
"mhutchie.git-graph",
30+
"anthropic.claude-code"
31+
]
1932
}
20-
},
21-
"features": {
22-
"./claude-code": {}
23-
24-
// "ghcr.io/devcontainers/features/docker-in-docker:2": {}
25-
// "ghcr.io/devcontainers/features/common-utils:2": {},
26-
// "ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {},
27-
// "ghcr.io/jsburckhardt/devcontainer-features/codex:latest": {}
2833
},
2934
"runArgs": [
3035
"--network=host"
@@ -34,13 +39,13 @@
3439
"XDG_CONFIG_HOME": "/home/vscode/.config",
3540
"XDG_CACHE_HOME": "/home/vscode/.cache",
3641
"XDG_DATA_HOME": "/home/vscode/.local/share",
37-
"SSH_AUTH_SOCK": "/ssh-agent"
42+
"SSH_AUTH_SOCK": "/home/vscode/.ssh/agent.sock"
3843
},
3944
"mounts": [
4045
"source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume",
41-
"source=${localEnv:HOME}/.ssh/known_hosts,target=/home/vscode/.ssh/known_hosts,type=bind,ro",
42-
"source=${localEnv:HOME}/.ssh/config,target=/home/vscode/.ssh/config,type=bind,ro",
43-
"source=${localEnv:SSH_AUTH_SOCK},target=/ssh-agent,type=bind"
46+
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind",
47+
"source=${localEnv:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind",
48+
"source=${localEnv:HOME}/.claude,target=/home/vscode/.claude,type=bind"
4449
],
4550
"postCreateCommand": "sudo chown vscode .pixi && pixi install"
4651
}

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ updates:
2525
#try to group all third party library updates into a single pr
2626
patterns:
2727
- "*"
28+
- package-ecosystem: "docker"
29+
directory: "/.devcontainer"
30+
schedule:
31+
interval: "monthly"
2832
- package-ecosystem: github-actions
2933
directory: /
3034
schedule:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v6
21-
- uses: prefix-dev/setup-pixi@v0.9.3
21+
- uses: prefix-dev/setup-pixi@v0.9.4
2222
with:
2323
cache: true
2424
frozen: true

.github/workflows/devcontainer.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Devcontainer Image
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
paths:
7+
- ".devcontainer/**"
8+
- ".github/workflows/devcontainer.yml"
9+
pull_request:
10+
branches: ["main"]
11+
paths:
12+
- ".devcontainer/**"
13+
- ".github/workflows/devcontainer.yml"
14+
workflow_dispatch:
15+
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
jobs:
21+
build-and-push:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v6
26+
27+
- name: Log in to GHCR
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Set image metadata
35+
id: meta
36+
run: |
37+
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
38+
DATE=$(date +%Y-%m-%d)
39+
echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
40+
echo "date=$DATE" >> "$GITHUB_OUTPUT"
41+
42+
- name: Build and push devcontainer image
43+
uses: devcontainers/ci@v0.3
44+
with:
45+
configFile: .devcontainer/ci/devcontainer.json
46+
imageName: ghcr.io/${{ github.repository }}/devcontainer
47+
imageTag: latest,sha-${{ steps.meta.outputs.short_sha }},${{ steps.meta.outputs.date }}
48+
cacheFrom: ghcr.io/${{ github.repository }}/devcontainer:latest
49+
push: ${{ github.event_name != 'pull_request' && 'always' || 'never' }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,6 @@ test_suite_analysis/metadata.json
174174
.devpod/
175175
.devpod-internal/
176176
.ralph/
177+
178+
# Claude Code local settings (personal, not shared)
179+
.claude/settings.local.json

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"ms-python.vscode-pylance",
66
"jjjermiah.pixi-vscode",
77
"charliermarsh.ruff",
8-
"tamasfe.even-better-toml",
8+
"tamasfe.even-better-toml"
99
]
1010
}

@AGENT.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# Agent Build Instructions
2+
3+
## Project Setup
4+
5+
This project uses **pixi** for environment and dependency management. All commands should be run from the project root.
6+
7+
```bash
8+
# Install dependencies (pixi handles everything)
9+
pixi install
10+
11+
# Activate the environment (optional, pixi run handles this automatically)
12+
pixi shell
13+
```
14+
15+
## Running Tests
16+
```bash
17+
# Run tests
18+
pixi run test
19+
20+
# Run tests with coverage
21+
pixi run coverage
22+
pixi run coverage-report
23+
```
24+
25+
## Linting and Formatting
26+
```bash
27+
# Format code with ruff
28+
pixi run format
29+
30+
# Run all linters (ruff, ty, pylint)
31+
pixi run lint
32+
33+
# Run both format and lint
34+
pixi run style
35+
36+
# Run full CI checks
37+
pixi run ci
38+
```
39+
40+
## Available Pixi Tasks
41+
```bash
42+
# View all available tasks
43+
pixi task list
44+
45+
# Common tasks:
46+
pixi run test # Run pytest
47+
pixi run coverage # Run tests with coverage
48+
pixi run format # Format code with ruff
49+
pixi run lint # Run all linters
50+
pixi run style # Format + lint
51+
pixi run ci # Full CI pipeline
52+
pixi run fix # Auto-fix common issues
53+
```
54+
55+
## GitHub CLI
56+
```bash
57+
# GitHub CLI is available via pixi
58+
pixi run gh <command>
59+
```
60+
61+
## Key Learnings
62+
- Update this section when you learn new build optimizations
63+
- Document any gotchas or special setup requirements
64+
- Keep track of the fastest test/build cycle
65+
66+
## Feature Development Quality Standards
67+
68+
**CRITICAL**: All new features MUST meet the following mandatory requirements before being considered complete.
69+
70+
### Testing Requirements
71+
72+
- **Minimum Coverage**: 85% code coverage ratio required for all new code
73+
- **Test Pass Rate**: 100% - all tests must pass, no exceptions
74+
- **Test Types Required**:
75+
- Unit tests for all business logic and services
76+
- Integration tests for API endpoints or main functionality
77+
- End-to-end tests for critical user workflows
78+
- **Coverage Validation**: Run coverage reports before marking features complete:
79+
```bash
80+
# Using pixi tasks
81+
pixi run coverage # Runs pytest with coverage
82+
pixi run coverage-report # Shows coverage report
83+
```
84+
- **Test Quality**: Tests must validate behavior, not just achieve coverage metrics
85+
- **Test Documentation**: Complex test scenarios must include comments explaining the test strategy
86+
87+
### Git Workflow Requirements
88+
89+
Before moving to the next feature, ALL changes must be:
90+
91+
1. **Committed with Clear Messages**:
92+
```bash
93+
git add .
94+
git commit -m "feat(module): descriptive message following conventional commits"
95+
```
96+
- Use conventional commit format: `feat:`, `fix:`, `docs:`, `test:`, `refactor:`, etc.
97+
- Include scope when applicable: `feat(api):`, `fix(ui):`, `test(auth):`
98+
- Write descriptive messages that explain WHAT changed and WHY
99+
100+
2. **Pushed to Remote Repository**:
101+
```bash
102+
git push origin <branch-name>
103+
```
104+
- Never leave completed features uncommitted
105+
- Push regularly to maintain backup and enable collaboration
106+
- Ensure CI/CD pipelines pass before considering feature complete
107+
108+
3. **Branch Hygiene**:
109+
- Work on feature branches, never directly on `main`
110+
- Branch naming convention: `feature/<feature-name>`, `fix/<issue-name>`, `docs/<doc-update>`
111+
- Create pull requests for all significant changes
112+
113+
4. **Ralph Integration**:
114+
- Update @fix_plan.md with new tasks before starting work
115+
- Mark items complete in @fix_plan.md upon completion
116+
- Update PROMPT.md if development patterns change
117+
- Test features work within Ralph's autonomous loop
118+
119+
### Documentation Requirements
120+
121+
**ALL implementation documentation MUST remain synchronized with the codebase**:
122+
123+
1. **Code Documentation**:
124+
- Language-appropriate documentation (JSDoc, docstrings, etc.)
125+
- Update inline comments when implementation changes
126+
- Remove outdated comments immediately
127+
128+
2. **Implementation Documentation**:
129+
- Update relevant sections in this AGENT.md file
130+
- Keep build and test commands current
131+
- Update configuration examples when defaults change
132+
- Document breaking changes prominently
133+
134+
3. **README Updates**:
135+
- Keep feature lists current
136+
- Update setup instructions when dependencies change
137+
- Maintain accurate command examples
138+
- Update version compatibility information
139+
140+
4. **AGENT.md Maintenance**:
141+
- Add new build patterns to relevant sections
142+
- Update "Key Learnings" with new insights
143+
- Keep command examples accurate and tested
144+
- Document new testing patterns or quality gates
145+
146+
### Feature Completion Checklist
147+
148+
Before marking ANY feature as complete, verify:
149+
150+
- [ ] All tests pass with appropriate framework command
151+
- [ ] Code coverage meets 85% minimum threshold
152+
- [ ] Coverage report reviewed for meaningful test quality
153+
- [ ] Code formatted according to project standards
154+
- [ ] Type checking passes (if applicable)
155+
- [ ] All changes committed with conventional commit messages
156+
- [ ] All commits pushed to remote repository
157+
- [ ] @fix_plan.md task marked as complete
158+
- [ ] Implementation documentation updated
159+
- [ ] Inline code comments updated or added
160+
- [ ] AGENT.md updated (if new patterns introduced)
161+
- [ ] Breaking changes documented
162+
- [ ] Features tested within Ralph loop (if applicable)
163+
- [ ] CI/CD pipeline passes
164+
165+
### Rationale
166+
167+
These standards ensure:
168+
- **Quality**: High test coverage and pass rates prevent regressions
169+
- **Traceability**: Git commits and @fix_plan.md provide clear history of changes
170+
- **Maintainability**: Current documentation reduces onboarding time and prevents knowledge loss
171+
- **Collaboration**: Pushed changes enable team visibility and code review
172+
- **Reliability**: Consistent quality gates maintain production stability
173+
- **Automation**: Ralph integration ensures continuous development practices
174+
175+
**Enforcement**: AI agents should automatically apply these standards to all feature development tasks without requiring explicit instruction for each task.

0 commit comments

Comments
 (0)