drep-ai 3.0.0

A local commit gate: runs the linters your repo configures, and sends changed code to an LLM for review
Documentation
name: mutants

# This repository is public. Routine trusted pushes mutate their complete diff
# in rust.yml after validation. The exhaustive 1,490-mutant sweep runs weekly
# or by explicit dispatch, and only for the default branch.
on:
  workflow_dispatch:
  schedule:
    - cron: '17 9 * * 0'

permissions:
  contents: read

concurrency:
  group: mutants-full
  cancel-in-progress: false

env:
  CARGO_TERM_COLOR: always

jobs:
  # A full sweep catches coverage weakened by test-only changes outside a
  # production diff. Manual dispatches on any other branch fail closed before
  # consuming the self-hosted runner.
  mutants:
    if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
    runs-on: [self-hosted, linux, x64, homelab-legion, drep-mutants]
    # Mutation has its own bounded runner. Validation and release retain the
    # drep-linux owner on homelab-1, so a full sweep cannot occupy their only
    # runner or compete with production workloads.
    timeout-minutes: 420
    steps:
      # Keeping target/ makes the mutation-host run take minutes instead of
      # hours. Everything else must still be an exact checkout: unexpected
      # ignored or untracked state fails closed rather than influencing a sweep.
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          clean: false
          persist-credentials: false
          ref: ${{ github.sha }}

      - name: Verify persistent workspace hygiene
        shell: bash
        run: |
          set -euo pipefail
          unexpected="$(
            git status --porcelain=v1 --untracked-files=all --ignored=matching |
              grep -Ev '^!! target/$' || true
          )"
          if [ -n "$unexpected" ]; then
            echo "unexpected persistent runner state:" >&2
            echo "$unexpected" >&2
            exit 1
          fi

      - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
        with:
          toolchain: stable
          components: clippy

      - uses: taiki-e/install-action@1ed6d7be6168f6c9046541087ff549b6bc581fdf # v2.87.2
        with:
          tool: cargo-mutants@27.1.0

      # scripts/mutants-run.sh owns the verdict, including the distinction
      # between a detected timeout and a genuinely missed mutant.
      - run: ./scripts/mutants-run.sh