Add Claude Code + LangChain behavioral patterns, adapter, health scor… #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| rust: | |
| name: Rust (test + clippy + fmt) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all --check | |
| - name: Clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: Run tests | |
| run: cargo test | |
| wasm: | |
| name: Build WASM | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack | |
| - name: Build WASM | |
| run: wasm-pack build crates/varpulis-agent-wasm --target bundler --out-dir ../../packages/npm/wasm | |
| - name: Remove wasm-pack gitignore | |
| run: rm -f packages/npm/wasm/.gitignore | |
| - name: Check bundle size | |
| run: | | |
| SIZE=$(du -k packages/npm/wasm/varpulis_agent_wasm_bg.wasm | cut -f1) | |
| echo "WASM bundle: ${SIZE}KB" | |
| if [ "$SIZE" -gt 2048 ]; then | |
| echo "::error::WASM bundle exceeds 2MB target (${SIZE}KB)" | |
| exit 1 | |
| fi | |
| - name: Upload WASM artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: wasm-bundle | |
| path: packages/npm/wasm/ | |
| typescript: | |
| name: TypeScript (unit tests) | |
| needs: wasm | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| - name: Download WASM artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: wasm-bundle | |
| path: packages/npm/wasm/ | |
| - name: Install dependencies | |
| working-directory: packages/npm | |
| run: npm ci | |
| - name: Type check | |
| working-directory: packages/npm | |
| run: npx tsc --noEmit | |
| - name: Unit tests | |
| working-directory: packages/npm | |
| run: npx vitest run | |
| e2e: | |
| name: E2E (Playwright) | |
| needs: wasm | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| - name: Download WASM artifact | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: wasm-bundle | |
| path: packages/npm/wasm/ | |
| - name: Install dependencies | |
| working-directory: packages/npm | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| working-directory: packages/npm | |
| run: npx playwright install chromium --with-deps | |
| - name: Run E2E tests | |
| working-directory: packages/npm | |
| run: npm run test:e2e | |
| python: | |
| name: Python (build + test) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install maturin | |
| run: pip install maturin | |
| - name: Create venv and build | |
| working-directory: packages/python | |
| run: | | |
| python -m venv .venv | |
| source .venv/bin/activate | |
| maturin develop | |
| - name: Smoke test | |
| working-directory: packages/python | |
| run: | | |
| source .venv/bin/activate | |
| python -c " | |
| from varpulis_agent_runtime import VarpulisAgentRuntime, Patterns | |
| rt = VarpulisAgentRuntime(patterns=[Patterns.retry_storm(min_repetitions=2)]) | |
| d = rt.observe(timestamp=1000, event_type={'type': 'ToolCall', 'name': 'a', 'params_hash': 1, 'duration_ms': 0}) | |
| assert len(d) == 0 | |
| d = rt.observe(timestamp=2000, event_type={'type': 'ToolCall', 'name': 'a', 'params_hash': 1, 'duration_ms': 0}) | |
| assert len(d) == 1 | |
| assert d[0]['pattern_name'] == 'retry_storm' | |
| print('Python smoke test passed') | |
| " |