From d170d29fc55b9775a0184b258eb56f154fc76078 Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 19:48:43 +0300 Subject: [PATCH 1/5] spec: requirements.txt cleanup design Co-Authored-By: Claude Opus 4.7 --- .../2026-06-06-requirements-cleanup-design.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md diff --git a/docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md b/docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md new file mode 100644 index 0000000..2df9cae --- /dev/null +++ b/docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md @@ -0,0 +1,48 @@ +# Requirements.txt Cleanup Design + +**Date:** 2026-06-06 +**Status:** Approved + +## Problem + +`requirements.txt` is a raw `pip freeze` dump of all 144 packages (direct + transitive) with exact version pins. This is redundant because `pyproject.toml` already declares direct dependencies with proper version ranges. The frozen file is fragile — updating any dependency requires regenerating the entire file. + +Additionally, `pydantic` is imported directly in the codebase but not declared in `pyproject.toml` (it works only as a transitive dependency of `mcp`). Dev tools (`pytest`, `ruff`) are also undeclared. + +## Solution + +Make `pyproject.toml` the single source of truth. Delete `requirements.txt` entirely. + +### Changes + +1. **Delete `requirements.txt`** + +2. **Add `pydantic` to `dependencies`** — the codebase uses Pydantic v2 APIs (`BaseModel`, `model_validator`, `validate_call`, `TypeAdapter`, `ValidationError`) in `java_codebase_rag/config.py` and elsewhere. Declare it explicitly: + ``` + "pydantic>=2.0,<3", + ``` + +3. **Add `[project.optional-dependencies]` with `dev` group** — for development-only tools: + ```toml + [project.optional-dependencies] + dev = [ + "pytest>=7", + "ruff>=0.4", + ] + ``` + +### Developer workflow after change + +```bash +python -m venv .venv +source .venv/bin/activate +pip install -e ".[dev]" +``` + +One command installs the package (with all declared deps) plus dev tools. + +## Scope + +- No tool changes (stays with pip + venv) +- No lock file (no CI reproducibility requirements identified) +- No import audit tooling From 74384d97da3333971f0fdcf08834dea0e5557d10 Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 20:14:52 +0300 Subject: [PATCH 2/5] remove requirements.txt, declare all deps in pyproject.toml pip freeze dump was redundant with pyproject.toml. Add missing pydantic direct dependency and dev extras (pytest, ruff). Co-Authored-By: Claude Opus 4.7 --- .../2026-06-06-requirements-cleanup-design.md | 48 ------ pyproject.toml | 7 + requirements.txt | 144 ------------------ 3 files changed, 7 insertions(+), 192 deletions(-) delete mode 100644 docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md delete mode 100644 requirements.txt diff --git a/docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md b/docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md deleted file mode 100644 index 2df9cae..0000000 --- a/docs/superpowers/specs/2026-06-06-requirements-cleanup-design.md +++ /dev/null @@ -1,48 +0,0 @@ -# Requirements.txt Cleanup Design - -**Date:** 2026-06-06 -**Status:** Approved - -## Problem - -`requirements.txt` is a raw `pip freeze` dump of all 144 packages (direct + transitive) with exact version pins. This is redundant because `pyproject.toml` already declares direct dependencies with proper version ranges. The frozen file is fragile — updating any dependency requires regenerating the entire file. - -Additionally, `pydantic` is imported directly in the codebase but not declared in `pyproject.toml` (it works only as a transitive dependency of `mcp`). Dev tools (`pytest`, `ruff`) are also undeclared. - -## Solution - -Make `pyproject.toml` the single source of truth. Delete `requirements.txt` entirely. - -### Changes - -1. **Delete `requirements.txt`** - -2. **Add `pydantic` to `dependencies`** — the codebase uses Pydantic v2 APIs (`BaseModel`, `model_validator`, `validate_call`, `TypeAdapter`, `ValidationError`) in `java_codebase_rag/config.py` and elsewhere. Declare it explicitly: - ``` - "pydantic>=2.0,<3", - ``` - -3. **Add `[project.optional-dependencies]` with `dev` group** — for development-only tools: - ```toml - [project.optional-dependencies] - dev = [ - "pytest>=7", - "ruff>=0.4", - ] - ``` - -### Developer workflow after change - -```bash -python -m venv .venv -source .venv/bin/activate -pip install -e ".[dev]" -``` - -One command installs the package (with all declared deps) plus dev tools. - -## Scope - -- No tool changes (stays with pip + venv) -- No lock file (no CI reproducibility requirements identified) -- No import audit tooling diff --git a/pyproject.toml b/pyproject.toml index 2cf7ce8..2c885c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,9 +34,16 @@ dependencies = [ "sentence-transformers>=5.4.0,<6", "tree-sitter>=0.25.2,<0.26", "tree-sitter-java>=0.23.5,<0.24", + "pydantic>=2.0,<3", "unidiff>=0.7.3,<1", ] +[project.optional-dependencies] +dev = [ + "pytest>=7", + "ruff>=0.4", +] + [project.urls] Homepage = "https://github.com/HumanBean17/java-codebase-rag" Repository = "https://github.com/HumanBean17/java-codebase-rag" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 5787062..0000000 --- a/requirements.txt +++ /dev/null @@ -1,144 +0,0 @@ -aiofile==3.9.0 -aiohappyeyeballs==2.6.1 -aiohttp==3.13.5 -aiosignal==1.4.0 -annotated-doc==0.0.4 -annotated-types==0.7.0 -anyio==4.13.0 -asyncpg==0.31.0 -attrs==26.1.0 -Authlib==1.7.0 -backports.tarfile==1.2.0 -beartype==0.22.9 -cachetools==7.0.6 -caio==0.9.25 -certifi==2026.2.25 -cffi==2.0.0 -charset-normalizer==3.4.7 -click==8.3.2 -cocoindex==1.0.0a43 -cocoindex-code==0.2.22 -cryptography==46.0.7 -cyclopts==4.11.0 -deprecation==2.1.0 -distro==1.9.0 -dnspython==2.8.0 -docstring_parser==0.18.0 -docutils==0.22.4 -einops==0.8.2 -email-validator==2.3.0 -exceptiongroup==1.3.1 -fastmcp==3.2.4 -fastuuid==0.14.0 -filelock==3.25.2 -frozenlist==1.8.0 -fsspec==2026.3.0 -griffelib==2.0.2 -grpcio==1.80.0 -h11==0.16.0 -h2==4.3.0 -hf-xet>=1.1.10,<=1.4.3 -hpack==4.1.0 -httpcore==1.0.9 -httpx==0.28.1 -httpx-sse==0.4.3 -huggingface_hub>=0.36.0,<=1.10.1 -hyperframe==6.1.0 -idna==3.11 -importlib_metadata==8.7.1 -iniconfig==2.3.0 -jaraco.classes==3.4.0 -jaraco.context==6.1.2 -jaraco.functools==4.4.0 -Jinja2==3.1.6 -jiter==0.14.0 -joblib==1.5.3 -joserfc==1.6.4 -jsonref==1.1.0 -jsonschema==4.26.0 -jsonschema-path==0.4.5 -jsonschema-specifications==2025.9.1 -keyring==25.7.0 -kuzu==0.11.3 -lance-namespace==0.6.1 -lance-namespace-urllib3-client==0.6.1 -lancedb>=0.25.3,<=0.30.2 -litellm==1.82.6 -markdown-it-py==4.0.0 -MarkupSafe==3.0.3 -mcp==1.27.0 -mdurl==0.1.2 -more-itertools==11.0.2 -mpmath==1.3.0 -msgspec==0.21.0 -multidict==6.7.1 -networkx==3.6.1 -numpy>=1.26.4,<=2.4.4 -openai==2.31.0 -openapi-pydantic==0.5.1 -opentelemetry-api==1.41.1 -overrides==7.7.0 -packaging==26.0 -pathable==0.5.0 -pathspec==1.0.4 -pgvector==0.4.2 -platformdirs==4.9.6 -pluggy==1.6.0 -portalocker==3.2.0 -propcache==0.4.1 -protobuf==7.34.1 -psutil==7.2.2 -psycopg2-binary==2.9.11 -py-key-value-aio==0.4.4 -pyarrow==23.0.1 -pycparser==3.0 -pydantic==2.12.5 -pydantic-settings==2.13.1 -pydantic_core==2.41.5 -Pygments==2.20.0 -PyJWT==2.12.1 -pyperclip==1.11.0 -pytest==9.0.3 -pytest-asyncio==1.3.0 -python-dateutil==2.9.0.post0 -python-dotenv==1.2.2 -python-multipart==0.0.26 -PyYAML==6.0.3 -qdrant-client==1.17.1 -referencing==0.37.0 -regex==2026.4.4 -requests==2.33.1 -rich==14.3.4 -rich-rst==1.3.2 -rpds-py==0.30.0 -ruff==0.15.10 -safetensors==0.7.0 -scikit-learn==1.8.0 -scipy==1.17.1 -sentence-transformers==5.4.0 -shellingham==1.5.4 -six==1.17.0 -sniffio==1.3.1 -sqlite-vec==0.1.9 -sse-starlette==3.3.4 -starlette==1.0.0 -sympy==1.14.0 -threadpoolctl==3.6.0 -tiktoken==0.12.0 -tokenizers>=0.21.4,<=0.22.2 -torch>=2.2.2,<=2.11.0 -tqdm==4.67.3 -transformers>=4.48.3,<=5.5.3 -tree-sitter==0.25.2 -tree-sitter-java==0.23.5 -typer==0.24.1 -typing-inspection==0.4.2 -typing_extensions==4.15.0 -uncalled-for==0.3.1 -unidiff==0.7.5 -urllib3==2.6.3 -uvicorn==0.44.0 -watchfiles==1.1.1 -websockets==16.0 -yarl==1.23.0 -zipp==3.23.0 From e8f38c52c09dcd1e85308b162ff7b7bbacb9a9e6 Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 20:20:50 +0300 Subject: [PATCH 3/5] fix ci: install from pyproject.toml instead of deleted requirements.txt Co-Authored-By: Claude Opus 4.7 --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c124436..7b5f956 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,6 @@ jobs: - '.github/CODEOWNERS' code: - '**/*.py' - - 'requirements.txt' - 'pyproject.toml' - 'pytest.ini' - 'mcp.json.example' @@ -48,8 +47,7 @@ jobs: if: steps.changes.outputs.code == 'true' run: | python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -e . + pip install -e ".[dev]" - name: Check generated edge navigation doc if: steps.changes.outputs.code == 'true' run: python scripts/generate_edge_navigation.py --check From 7569244cc45999f8c7c6eecc4ed884b2251192bf Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 20:32:30 +0300 Subject: [PATCH 4/5] fix ci: add pytest-asyncio to dev extras Was in requirements.txt before but missed during migration. Co-Authored-By: Claude Opus 4.7 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 2c885c9..2ea3c0b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ dependencies = [ [project.optional-dependencies] dev = [ "pytest>=7", + "pytest-asyncio>=0.21", "ruff>=0.4", ] From 59280db57478b2cacc6c4cbbd5cbe3b7d33eb6ff Mon Sep 17 00:00:00 2001 From: Dmitry Teryaev Date: Sat, 6 Jun 2026 20:47:53 +0300 Subject: [PATCH 5/5] fix test: update skill section headings to match reworked SKILL.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 584db63 renamed sections in SKILL.md but tests were skipped (docs-only PR). Update assertions to match new headings: - Canonical workflow → Workflow Patterns - Decision tree → Decision Framework - Recovery playbook → Recovery Playbook (case fix) - Common navigation patterns → Workflow Patterns (merged) + added Tool Inventory check Co-Authored-By: Claude Opus 4.7 --- tests/test_agent_skills_static.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_agent_skills_static.py b/tests/test_agent_skills_static.py index 9fdabc4..13bf69b 100644 --- a/tests/test_agent_skills_static.py +++ b/tests/test_agent_skills_static.py @@ -167,25 +167,25 @@ def test_edge_type_refs_are_valid(self): class TestBodyStructure: """Skill body must contain key sections.""" - def test_has_canonical_workflow(self): + def test_has_workflow_patterns(self): _, body = _read_skill() - assert "## Canonical workflow" in body, "SKILL.md missing '## Canonical workflow'" + assert "## Workflow Patterns" in body, "SKILL.md missing '## Workflow Patterns'" - def test_has_decision_tree(self): + def test_has_decision_framework(self): _, body = _read_skill() - assert "## Decision tree" in body, "SKILL.md missing '## Decision tree'" + assert "## Decision Framework" in body, "SKILL.md missing '## Decision Framework'" def test_has_recovery_playbook(self): _, body = _read_skill() - assert "## Recovery playbook" in body, "SKILL.md missing '## Recovery playbook'" + assert "## Recovery Playbook" in body, "SKILL.md missing '## Recovery Playbook'" def test_has_edge_taxonomy(self): _, body = _read_skill() assert "## Edge taxonomy" in body, "SKILL.md missing '## Edge taxonomy'" - def test_has_navigation_patterns(self): + def test_has_tool_inventory(self): _, body = _read_skill() - assert "## Common navigation patterns" in body, "SKILL.md missing '## Common navigation patterns'" + assert "## Tool Inventory" in body, "SKILL.md missing '## Tool Inventory'" def test_has_reasoning_preamble(self): _, body = _read_skill()