diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35d7d80..abf53f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,9 @@ jobs: - name: Validate tag and source version run: python scripts/validate_release.py --tag "$GITHUB_REF_NAME" - name: Install release tooling - run: python -m pip install --upgrade build twine + run: | + python -m pip install --upgrade build twine + python -m pip install -c requirements-dev.lock ruff - name: Build wheel and source distribution run: python -m build - name: Validate distributions diff --git a/CHANGELOG.md b/CHANGELOG.md index cb7351f..0d50a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +## 1.3.1 - 2026-10-20 + +- Fix #111: Ship the measured check-duration correction missing from 1.3.0 and + verify a real non-cached Ruff invocation through the installed release wheel. +- Include untracked source files in context and restore strict typing (#109). + - Fix #110: Reject invalid context token budgets with a concise usage error and exit code 2, including supported categories, before generating artifacts. diff --git a/pyproject.toml b/pyproject.toml index 27479ca..67f4d34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "ai-dev-cli-tools" -version = "1.3.0" +version = "1.3.1" description = "Cross-platform CLI helpers that give AI coding agents concise, deterministic development reports." readme = "README.md" requires-python = ">=3.11" diff --git a/scripts/test_installed_package.py b/scripts/test_installed_package.py index 144d3e4..a93565f 100644 --- a/scripts/test_installed_package.py +++ b/scripts/test_installed_package.py @@ -121,6 +121,39 @@ def _smoke_entrypoint(entrypoint: Path, cwd: Path) -> None: mcp_response = json.loads(mcp_result.stdout) if mcp_response.get("result", {}).get("serverInfo", {}).get("name") != "ai-dev-cli-tools": raise SmokeError("installed MCP entrypoint did not initialize") + _smoke_check_duration(entrypoint, cwd) + + +def _smoke_check_duration(entrypoint: Path, cwd: Path) -> None: + # Run real Ruff from the development environment through the installed wheel. + # The wheel's venv remains independent and contains no editable source install. + (cwd / "sample.py").write_text("value = 1\n", encoding="utf-8") + (cwd / ".ai-dev-tools.toml").write_text( + '[commands]\nlint = "python -m ruff check sample.py"\n', encoding="utf-8" + ) + result = _run( + [str(entrypoint), "--json", "check", "--mode", "fast", "--no-cache"], cwd, + env={ + **os.environ, + "PATH": str(Path(sys.executable).parent) + os.pathsep + os.environ.get("PATH", ""), + }, + ) + _assert_report_json(result.stdout, "check") + payload = json.loads(result.stdout) + checks = payload["summary"]["results"] + if len(checks) != 1: + raise SmokeError(f"expected one installed Ruff check, found {len(checks)}") + check = checks[0] + duration = check.get("duration_seconds", 0) + if check.get("cached") is not False or duration <= 0: + raise SmokeError("installed non-cached Ruff check lost measured subprocess duration") + aggregate = payload["summary"]["execution"]["aggregate_subprocess_seconds"] + if duration != aggregate: + raise SmokeError("installed per-check duration differs from subprocess aggregate") + saved = json.loads((cwd / ".ai/reports/check-fast-latest.json").read_text(encoding="utf-8")) + if saved["summary"]["results"][0]["duration_seconds"] != duration: + raise SmokeError("saved report lost installed check duration") + print(f"Installed Ruff duration verified: {duration}s") def _assert_report_json(output: str, command: str) -> None: @@ -137,7 +170,8 @@ def _assert_report_json(output: str, command: str) -> None: def _run( - command: list[str], cwd: Path, *, input_text: str | None = None + command: list[str], cwd: Path, *, input_text: str | None = None, + env: dict[str, str] | None = None, ) -> subprocess.CompletedProcess[str]: result = subprocess.run( command, @@ -147,6 +181,7 @@ def _run( errors="replace", capture_output=True, input=input_text, + env=env, shell=False, timeout=180, ) diff --git a/src/ai_dev_tools/__init__.py b/src/ai_dev_tools/__init__.py index 07b1de0..9ee8e51 100644 --- a/src/ai_dev_tools/__init__.py +++ b/src/ai_dev_tools/__init__.py @@ -1,3 +1,3 @@ """AI Dev CLI Tools.""" -__version__ = "1.3.0" +__version__ = "1.3.1" diff --git a/tests/unit/test_report.py b/tests/unit/test_report.py index 356f51c..20e0935 100644 --- a/tests/unit/test_report.py +++ b/tests/unit/test_report.py @@ -11,7 +11,7 @@ def test_report_schema_contains_required_fields(tmp_path: Path) -> None: ).finish() data = report.to_dict() assert data["schema_version"] == "1.1" - assert data["tool_version"] == "1.3.0" + assert data["tool_version"] == "1.3.1" assert data["status"] == "success" assert data["command"] == "scan" assert data["summary"] == {}