Skip to content

Commit 31fd6f9

Browse files
deps: bump all dependencies to latest major versions, require Python 3.14 (#4161)
## Summary - Bump `requires-python` from `>=3.12` to `>=3.14` - Bump all Python dependencies to latest major versions (numpy 2.x, pandas 3.x, fastmcp 2.x, cachetools 7.x, google-cloud-storage 3.x, plotly 6.x, kaleido 1.x, etc.) - Bump frontend ESLint from 9 to 10, TypeScript 5.9.3 - Add 21 new tests for upgrade safety: - `test_images.py`: 4 GCS font download tests (mock client/bucket/blob) - `test_tools.py`: 4 fastmcp protocol-level tests (real server, no mocks) - `test_data_deps.py`: 12 numpy/pandas API compatibility smoke tests - `test_cache.py`: 1 cachetools maxsize overflow edge-case ## Test plan - [x] All 1011 unit tests pass (`uv run pytest tests/unit -v`) - [x] Ruff lint + format clean - [x] Frontend: 19 tests pass, lint clean, build succeeds - [x] Backend API tested: `/health`, `/stats`, `/specs`, `/libraries`, `/plots/filter` - [x] Frontend tested in browser: homepage, spec detail page, 0 console errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3fc8e9e commit 31fd6f9

22 files changed

+1263
-2163
lines changed

.github/copilot-instructions.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,13 @@ Examples: `scatter-basic`, `scatter-color-mapped`, `bar-grouped-horizontal`, `he
108108

109109
- **`plots/{spec-id}/`**: Plot-centric directories (spec + metadata + implementations)
110110
- **`prompts/`**: AI agent prompts for code generation and quality evaluation
111-
- **`core/`**: Shared business logic (database, repositories, config)
111+
- **`core/`**: Shared business logic (database, repositories, config, utils, images)
112112
- **`core/database/types.py`**: Custom SQLAlchemy types (PostgreSQL + SQLite compatibility)
113-
- **`api/`**: FastAPI backend (routers, schemas, dependencies)
114-
- **`app/`**: React frontend (React 19 + TypeScript + Vite 7 + MUI 7)
113+
- **`core/database/repositories.py`**: Data access layer
114+
- **`api/`**: FastAPI backend (routers, schemas, dependencies, cache, analytics, MCP server)
115+
- **`app/`**: React frontend (React 19 + TypeScript 5 + Vite 7 + MUI 7)
116+
- **`agentic/`**: AI workflow layer (composable phases, prompt templates, runtime state)
117+
- **`automation/`**: CI/CD helper scripts (workflow_cli, label_manager, sync_to_postgres)
115118
- **`tests/unit/`**: Unit tests with mocked dependencies
116119
- **`tests/integration/`**: Integration tests with SQLite in-memory database
117120
- **`tests/e2e/`**: End-to-end tests with full FastAPI stack
@@ -210,10 +213,10 @@ plt.savefig('plot.png', dpi=300, bbox_inches='tight')
210213

211214
## Tech Stack
212215

213-
- **Backend**: FastAPI, SQLAlchemy (async), PostgreSQL, Python 3.10+
214-
- **Frontend**: React 19, TypeScript, Vite 7, MUI 7
216+
- **Backend**: FastAPI, SQLAlchemy (async), PostgreSQL, Python 3.14+
217+
- **Frontend**: React 19, TypeScript 5, Vite 7, MUI 7
215218
- **Package Manager**: uv (Python), yarn (Node.js)
216-
- **Linting**: Ruff (Python)
219+
- **Linting**: Ruff (Python), ESLint (TypeScript)
217220

218221
## Deployment
219222

.github/workflows/ci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
if: steps.check.outputs.should_lint == 'true'
5656
uses: actions/setup-python@v6
5757
with:
58-
python-version: '3.13'
58+
python-version: '3.14'
5959

6060
- name: Install uv
6161
if: steps.check.outputs.should_lint == 'true'

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
if: steps.check.outputs.should_test == 'true'
7676
uses: actions/setup-python@v6
7777
with:
78-
python-version: '3.13'
78+
python-version: '3.14'
7979

8080
- name: Install uv
8181
if: steps.check.outputs.should_test == 'true'

.github/workflows/impl-generate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
- name: Set up Python
186186
uses: actions/setup-python@v6
187187
with:
188-
python-version: '3.13'
188+
python-version: '3.14'
189189

190190
- name: Install uv
191191
uses: astral-sh/setup-uv@v7

.github/workflows/impl-repair.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Set up Python
6464
uses: actions/setup-python@v6
6565
with:
66-
python-version: '3.13'
66+
python-version: '3.14'
6767

6868
- name: Install uv
6969
uses: astral-sh/setup-uv@v7

.github/workflows/sync-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Python
3535
uses: actions/setup-python@v6
3636
with:
37-
python-version: '3.13'
37+
python-version: '3.14'
3838

3939
- name: Install uv
4040
uses: astral-sh/setup-uv@v7

.serena/memories/code_style.md

Lines changed: 42 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,64 @@
11
# Code Style and Conventions
22

3-
## Python Style (API, Core, Tests)
4-
- **Linter/Formatter**: Ruff (enforces PEP 8)
5-
- **Line Length**: 120 characters
3+
## Python (API, Core, Tests)
4+
- **Linter/Formatter**: Ruff (line-length=120, target=py314)
5+
- **Rules**: E, F, W, I, C, B (ignores E501, C901, B008)
6+
- **Excludes**: plots/, scripts/, .git, .venv, __pycache__, dist, temp
67
- **Type Hints**: Required for all functions
7-
- **Docstrings**: Google style for all public functions
8-
- **Import Order**: Standard library → Third-party → Local
9-
10-
### Example (for API/core code):
11-
```python
12-
def get_spec_by_id(spec_id: str, db: Session) -> Spec:
13-
"""
14-
Retrieve a spec by its ID.
15-
16-
Args:
17-
spec_id: The unique spec identifier
18-
db: Database session
19-
20-
Returns:
21-
Spec object if found
22-
23-
Raises:
24-
NotFoundError: If spec doesn't exist
25-
"""
26-
pass
27-
```
8+
- **Docstrings**: Google style for public functions
9+
- **Import Order**: stdlib → third-party → local (enforced by ruff I)
10+
- **Async**: SQLAlchemy async, pytest-asyncio (auto mode)
11+
12+
## TypeScript (Frontend)
13+
- **Linter**: ESLint 10 with typescript-eslint
14+
- **Strict mode**: Enabled in tsconfig
15+
- **Target**: ES2020, bundler module resolution
16+
- **Path alias**: `@/``./src/`
17+
- **Components**: PascalCase files (e.g., `PlotCard.tsx`), function components only
18+
- **Hooks**: camelCase with `use` prefix (e.g., `useSpecs.ts`)
19+
- **Utils/Types**: camelCase files (e.g., `api.ts`)
20+
- **Exports**: Named exports (no default exports)
21+
- **Styling**: MUI `sx` prop + Emotion `styled()`, no CSS modules
22+
- **State**: Local state + custom hooks (no Redux/Zustand)
23+
- **API calls**: Plain `fetch()` in `utils/api.ts`
24+
25+
## Agentic Layer Conventions
26+
- **Script headers**: uv inline script metadata (dependencies declared in-file)
27+
- **CLI**: Click for all workflow scripts
28+
- **Console output**: Rich library, stderr for UI, stdout for state JSON
29+
- **State**: `WorkflowState` persisted at `agentic/runs/{run_id}/state.json`
30+
- **Templates**: `agentic/commands/*.md` with `$1`, `$2`, `$ARGUMENTS` placeholders
31+
- **Execution**: `prompt_claude_code_with_retry()` in `agent.py`
32+
- **Data types**: `TestResult`, `ReviewResult`, `ReviewIssue` in `agent.py`
33+
- **JSON parsing**: `parse_json()` handles markdown-fenced JSON from LLM output
2834

2935
## Plot Implementation Style (KISS)
30-
Plot implementations should be simple, readable scripts - like matplotlib gallery examples:
31-
3236
```python
3337
"""
34-
scatter-basic: Basic Scatter Plot
35-
Library: matplotlib
38+
spec-id: Plot Title
39+
Library: library-name
3640
"""
37-
3841
import matplotlib.pyplot as plt
3942
import numpy as np
4043

4144
# Data
4245
np.random.seed(42)
4346
x = np.random.randn(100)
44-
y = x * 0.8 + np.random.randn(100) * 0.5
4547

4648
# Plot
4749
fig, ax = plt.subplots(figsize=(16, 9))
48-
ax.scatter(x, y, alpha=0.7, s=50, color='#306998')
49-
50-
ax.set_xlabel('X Value')
51-
ax.set_ylabel('Y Value')
52-
ax.set_title('Basic Scatter Plot')
53-
ax.grid(True, alpha=0.3)
54-
50+
ax.scatter(x, y)
51+
ax.set_title('Title')
5552
plt.tight_layout()
5653
plt.savefig('plot.png', dpi=300, bbox_inches='tight')
5754
```
58-
59-
### Plot Code Rules:
60-
- No functions, no classes
61-
- No `if __name__ == '__main__':`
62-
- No type hints or docstrings (in plot code)
63-
- Just: imports → data → plot → save
55+
- No functions, no classes, no `if __name__`
56+
- No type hints or docstrings in plot code
57+
- Flow: imports → data → plot → save
6458

6559
## Naming Conventions
66-
67-
### Spec IDs
68-
Format: `{plot-type}-{variant}-{modifier}` (lowercase, hyphens only)
69-
- `scatter-basic` - Simple 2D scatter plot
70-
- `bar-grouped-horizontal` - Horizontal grouped bars
71-
- `heatmap-correlation` - Correlation matrix heatmap
72-
73-
### Files
74-
- Implementation files: `{library}.py` (e.g., `matplotlib.py`)
75-
- Metadata files: `{library}.yaml`
76-
77-
## General Rules
78-
- Always write in English
79-
- Testing coverage target: 90%+
80-
- Test naming: `test_{what_it_does}`
60+
- **Spec IDs**: `{plot-type}-{variant}-{modifier}` (lowercase, hyphens)
61+
- **Implementation files**: `{library}.py`
62+
- **Metadata files**: `{library}.yaml`
63+
- **Test naming**: `test_{what_it_does}`
64+
- **All output**: English only (comments, commits, docs, PRs)

.serena/memories/commands.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Commands Reference
2+
3+
## Development Setup
4+
```bash
5+
uv sync --all-extras # Install Python dependencies
6+
cd app && yarn install # Install frontend dependencies
7+
uv run alembic upgrade head # Run DB migrations
8+
```
9+
10+
## Running Services
11+
```bash
12+
uv run uvicorn api.main:app --reload --port 8000 # Backend API
13+
cd app && yarn dev # Frontend dev server
14+
docker-compose up # All services
15+
```
16+
17+
## Code Quality (REQUIRED before commits)
18+
```bash
19+
uv run ruff check <files> # Lint check
20+
uv run ruff check <files> --fix # Auto-fix lint
21+
uv run ruff format <files> # Format code
22+
cd app && yarn lint # Frontend lint
23+
```
24+
25+
## Testing
26+
```bash
27+
uv run pytest # All tests
28+
uv run pytest tests/unit # Unit tests only
29+
uv run pytest tests/integration # Integration tests
30+
uv run pytest --cov=. --cov-report=html # With coverage
31+
uv run pytest tests/unit/api/test_routers.py::test_name # Specific test
32+
```
33+
34+
## Database
35+
```bash
36+
uv run alembic upgrade head # Apply migrations
37+
uv run alembic revision --autogenerate -m "description" # Create migration
38+
uv run alembic current # Check current revision
39+
```
40+
41+
## Frontend
42+
```bash
43+
cd app && yarn dev # Dev server
44+
cd app && yarn build # Production build (tsc + vite)
45+
cd app && yarn preview # Preview prod build
46+
cd app && yarn lint # ESLint check
47+
cd app && yarn type-check # TypeScript type check only
48+
cd app && yarn test # Run vitest
49+
cd app && yarn test:watch # Watch mode tests
50+
```
51+
52+
## Agentic Workflows
53+
```bash
54+
# Individual phases (all use Click CLI)
55+
uv run agentic/workflows/plan.py --spec-id <id> --library <lib>
56+
uv run agentic/workflows/build.py --run-id <id>
57+
uv run agentic/workflows/test.py --run-id <id>
58+
uv run agentic/workflows/review.py --run-id <id>
59+
60+
# Orchestrators
61+
uv run agentic/workflows/plan_build.py --spec-id <id> --library <lib>
62+
uv run agentic/workflows/plan_build_test.py --spec-id <id> --library <lib>
63+
uv run agentic/workflows/plan_build_test_review.py --spec-id <id> --library <lib>
64+
```
65+
66+
## GitHub Actions (via gh CLI)
67+
```bash
68+
# Spec workflow
69+
gh issue create --title "Plot Name" --label "spec-request" --body "Description"
70+
# After review: add 'approved' label to ISSUE (not PR!)
71+
72+
# Implementation workflow
73+
gh workflow run bulk-generate.yml -f specification_id=<spec-id> -f library=all
74+
75+
# Monitor
76+
gh run list --workflow=impl-generate.yml
77+
gh run list --workflow=impl-review.yml
78+
gh run list --workflow=impl-merge.yml
79+
80+
# Sync to DB
81+
gh workflow run sync-postgres.yml
82+
```
83+
84+
## Important Notes
85+
- Use `uv run` for all Python commands (no system python)
86+
- Use `yarn` (not npm) for frontend
87+
- Never manually merge impl PRs - let `impl-merge.yml` handle it

.serena/memories/directory_structure.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)