From 2ed74b5cd3d1a2eda06a2c698244fde2a086ff8d Mon Sep 17 00:00:00 2001 From: Trecek Date: Thu, 7 May 2026 07:57:30 -0700 Subject: [PATCH 1/2] ci: add api-simulator cache diagnostics for issue #2135 Add diagnostic steps to the test workflow to capture evidence of whether the api-simulator Rust/PyO3 wheel is being cached or recompiled on each CI run. Captures pre-install cache state, verbose uv sync output with compilation/cache-hit pattern matching, and post-install cache contents. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/tests.yml | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c561c4188d..578f37a578 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,6 +58,7 @@ jobs: - uses: actions/checkout@v4 - name: Install uv + id: setup-uv uses: astral-sh/setup-uv@v7 with: uv-version: "0.9.21" @@ -81,8 +82,42 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable + - name: Check api-simulator cache status (diagnostic - issue 2135) + run: | + echo "=== uv cache-hit output ===" + echo "Cache hit: ${{ steps.setup-uv.outputs.cache-hit }}" + echo "" + echo "=== uv cache dir ===" + uv cache dir + echo "" + echo "=== Looking for api-simulator in uv cache ===" + find "$(uv cache dir)" -path "*simulator*" -type f 2>/dev/null || echo "api-simulator NOT found in uv cache (will need Rust compilation)" + echo "" + echo "=== uv cache size ===" + du -sh "$(uv cache dir)" 2>/dev/null || echo "cache dir not found" + - name: Install dependencies - run: uv sync --locked --extra dev + run: | + echo "=== Starting uv sync (timestamp: $(date -u +%H:%M:%S)) ===" + uv sync --locked --extra dev -v 2>&1 | tee /tmp/uv-sync.log + echo "=== Finished uv sync (timestamp: $(date -u +%H:%M:%S)) ===" + echo "" + echo "=== Rust/maturin compilation evidence ===" + grep -i "building\|compiling\|maturin\|cargo\|rustc\|Built api" /tmp/uv-sync.log || echo "No Rust compilation detected" + echo "" + echo "=== Cache/wheel reuse evidence ===" + grep -i "cached\|using cached\|found cached\|Installed.*api.simulator" /tmp/uv-sync.log || echo "No cache hit detected for api-simulator" + + - name: Post-install api-simulator cache status (diagnostic - issue 2135) + run: | + echo "=== api-simulator in uv cache AFTER install ===" + find "$(uv cache dir)" -path "*simulator*" -type f 2>/dev/null | head -20 + echo "" + echo "=== uv cache size AFTER install ===" + du -sh "$(uv cache dir)" 2>/dev/null || echo "cache dir not found" + echo "" + echo "=== Wheel file details ===" + find "$(uv cache dir)" -path "*simulator*" -name "*.whl" -exec ls -lh {} \; 2>/dev/null || echo "No wheel found" - name: Generate recipe diagrams run: uv run autoskillit recipes render From ded766f1f86b8947abb80c2bbff8033eb45e382f Mon Sep 17 00:00:00 2001 From: Trecek Date: Thu, 7 May 2026 08:07:07 -0700 Subject: [PATCH 2/2] docs: add .github/CLAUDE.md with CI workflow constraints Concise agent-facing instructions for setup-uv cache behavior, Rust toolchain requirements, and api-simulator dependency constraints. Agents editing .github/workflows/ will pick these up automatically via CLAUDE.md hierarchy. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/CLAUDE.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/CLAUDE.md diff --git a/.github/CLAUDE.md b/.github/CLAUDE.md new file mode 100644 index 0000000000..d580a15e66 --- /dev/null +++ b/.github/CLAUDE.md @@ -0,0 +1,17 @@ +# GitHub Actions CI — Agent Instructions + +## `setup-uv@v7` Cache Behavior + +- **Parameter name**: Use `version:` not `uv-version:` — the old name is silently ignored. +- **Cache key**: Exact hash of `uv.lock` + `pyproject.toml` + `*requirements*.txt` + arch/OS/Python. No `restore-keys` fallback — any `uv.lock` change is a total miss. +- **Cache save rule**: GitHub Actions skips save when the key already exists. If job A saves a cache and job B restores it with the same key, job B's changes are never persisted. The first job to complete with a given key "wins." +- **`prune-cache: true` (default)**: Runs `uv cache prune --ci` before save. Source-built wheels survive pruning; pre-built PyPI wheels do not. +- **Implication for source-built deps**: If a job that only validates (e.g. `uv lock --check`) saves the cache before a job that installs (e.g. `uv sync`), the compiled wheel never enters the persisted cache. Either disable caching on the validation job or use a separate `actions/cache` step with a different key. + +## `dtolnay/rust-toolchain` + +Only needed in jobs that run `uv sync`/`uv pip install` with Rust/PyO3 source deps. Not needed for `uv lock --check` (lockfile validation doesn't build packages). + +## `api-simulator` Dependency + +Private Rust/PyO3 crate at `TalonT-Org/api-simulator`, built via maturin. Requires `dtolnay/rust-toolchain@stable` and git auth (`GH_USER`/`GH_PAT` secrets via URL rewrite). Gated to `sys_platform == 'linux'` — not built on macOS CI targets.