loregrep 0.6.0

Repository indexing library for AI coding assistants. Tree-sitter parsing, fast in-memory indexing, and tool APIs for LLM integration.
Documentation
name: Rust CI

on:
  push:
    branches: [main, master]
  pull_request:
  workflow_dispatch:

# Cancel an in-progress run when new commits are pushed to the same PR/branch, so
# stale runs don't pile up (and burn minutes) behind the latest one.
concurrency:
  group: rust-ci-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  test:
    name: test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2

      - name: Format check
        run: cargo fmt --all --check

      # NOTE: We test with DEFAULT features, not --all-features.
      # The `python` feature pulls in pyo3's `extension-module`, which cannot link
      # as a standalone test/bin (it expects to be loaded into a Python interpreter).
      # Python bindings are validated separately via maturin (see CI.yml wheel builds).
      - name: Test
        run: cargo test

      - name: Build release
        run: cargo build --release

      # Layer 1 retrieval eval: runs the real exec-tool CLI against pinned fixtures
      # with gold answer sets and fails on any non-documented regression. Also
      # catches stdout-purity / exit-code regressions that break agents.
      - name: Retrieval eval (Layer 1)
        run: |
          python3 evals/retrieval/run.py --fixture rust-basic
          python3 evals/retrieval/run.py --fixture ts-basic
          python3 evals/retrieval/run.py --fixture py-basic

      # Clippy is currently INFORMATIONAL (continue-on-error) — the codebase has a
      # backlog of warnings, much of it in code slated for removal/rewrite in the
      # TUI-strip and dependency-upgrade phases. This gate is promoted to blocking
      # (`-D warnings`) once those phases land. See IMPLEMENTATION_PLAN.md.
      - name: Clippy (informational)
        continue-on-error: true
        run: cargo clippy --all-targets

  # Runtime-verify the PyO3 bindings. `cargo test` can't link the extension module,
  # so this is the only gate that actually exercises the Python API. Pinned to a
  # Python version PyO3 supports (not bleeding-edge 3.14).
  python:
    name: python bindings
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - name: Build extension module and run Python tests
        run: |
          python -m venv .venv
          . .venv/bin/activate
          pip install maturin pytest pytest-asyncio
          maturin develop --features python
          pytest python/tests -v