basemind 0.22.1

Full AI context layer over MCP — tree-sitter code-map, document RAG (PDF/Office/HTML/email + OCR + reranker), shared agent memory, on-demand web crawl, git history + blame + per-symbol diff. 300+ languages, 10+ coding-agent harnesses, content-addressed Fjall + LanceDB.
name: ci

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: "0 4 * * *"
  workflow_dispatch: {}

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  # ~keep The `full` feature build (ONNX + lancedb + vendored stack-graphs) produces huge debug objects
  # ~keep that exhaust the standard runners' disk — surfacing as an `ld` bus error (truncated object) on
  # ~keep Linux and an explicit ENOSPC on macOS. Level 1 keeps panic file:line (so backtraces stay useful)
  # ~keep while dropping the variable/type DWARF that dominates the size.
  CARGO_PROFILE_DEV_DEBUG: "1"
  CARGO_PROFILE_TEST_DEBUG: "1"

jobs:
  validate:
    uses: xberg-io/actions/.github/workflows/reusable-validate.yml@v1
    with:
      setup-rust: true

  test:
    name: test / ${{ matrix.os }} / ${{ matrix.features }}
    runs-on: ${{ matrix.os }}
    timeout-minutes: ${{ matrix.timeout_minutes }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            features: ""
            timeout_minutes: 30
          - os: ubuntu-latest
            features: "full"
            timeout_minutes: 60
          - os: macos-latest
            features: ""
            timeout_minutes: 30
          - os: macos-14
            features: "full"
            timeout_minutes: 90
          - os: windows-latest
            features: "comms shells"
            timeout_minutes: 30
    steps:
      - uses: actions/checkout@v4

      # ~keep The `full` build is disk-heavy; reclaim space up front on the legs that build it so the
      # ~keep debug + release target dirs and the downloaded ONNX models don't hit ENOSPC.
      - name: Free disk space (Linux)
        if: runner.os == 'Linux' && matrix.features == 'full'
        run: |
          sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
            /opt/hostedtoolcache/CodeQL /usr/local/share/boost "$AGENT_TOOLSDIRECTORY" || true
          sudo docker image prune --all --force || true
          df -h /
      - name: Free disk space (macOS)
        if: runner.os == 'macOS' && matrix.features == 'full'
        run: |
          sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/* || true
          sudo rm -rf /Library/Developer/CoreSimulator/Profiles/Runtimes/* || true
          df -h /

      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Install system dependencies
        if: matrix.features == 'full'
        uses: ./.github/actions/install-system-deps

      - name: Install protoc (Linux, default-features)
        if: runner.os == 'Linux' && matrix.features == ''
        run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
      - name: Install protoc (macOS, default-features)
        if: runner.os == 'macOS' && matrix.features == ''
        run: brew install protobuf

      - uses: Swatinem/rust-cache@v2
        with:
          key: ${{ matrix.os }}-${{ matrix.features }}

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

      - name: cargo clippy
        run: cargo clippy --workspace --all-targets --tests --features "${{ matrix.features }}" -- -D warnings

      - name: cargo test
        run: cargo test --workspace --features "${{ matrix.features }}" --quiet

      - name: cargo build --release
        run: cargo build --release --quiet --bin basemind --features "${{ matrix.features }}"

  deny:
    name: cargo-deny
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - uses: EmbarkStudios/cargo-deny-action@v2
        with:
          command: check

  hardening:
    name: hardening harness (nightly)
    runs-on: ubuntu-latest
    if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - name: Install system dependencies
        uses: ./.github/actions/install-system-deps

      - uses: Swatinem/rust-cache@v2

      - name: run harden.sh
        run: ./scripts/harden.sh

      - name: upload results
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: harden-results
          path: /tmp/basemind-harden/results.ndjson