termaxa 0.19.3

A cooperative gate for the shell commands AI coding agents run — command previews, automatic backups, allow/ask/deny policy, and audit logging.
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: test / ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-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
      # Blocking since v0.16. It was advisory "until it passes green", and it
      # has now passed green on three platforms across ten merges - but the
      # reason to flip it is sharper than that: clippy VERSIONS DIFFER between
      # a developer machine and CI, and an advisory warning is only caught if
      # someone reads the scrollback. A `format_in_format_args` lint fired on
      # Windows clippy 1.96 and not on the newer toolchain the change was
      # written against; it reached a pushed branch because nothing failed.
      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings
      - name: Test
        run: cargo test --all
      - name: Build release
        run: cargo build --release
      - name: Smoke test (the gate actually gates)
        shell: bash
        run: |

          cd "$(mktemp -d)"
          BIN="$GITHUB_WORKSPACE/target/release/termaxa"
          "$BIN" init
          # a benign command is allowed
          "$BIN" check "git status"
          # the trench-coat bypass is denied (exit 4)
          set +e
          "$BIN" check "git status && rm -rf /"
          code=$?
          set -e
          if [ "$code" != "4" ]; then
            echo "expected deny (exit 4) for compound destructive command, got $code"
            exit 1
          fi
          echo "smoke test passed: benign allowed, destructive denied"

  # The privilege boundary, proved by a second real user.
  #
  # Unit tests cannot prove a boundary: every test in the Rust suite runs as
  # one user, so "the agent cannot write the policy" is an assertion about code
  # paths. This job creates a real account and has it TRY, asserting each
  # attempt fails at the OS.
  #
  # BLOCKING as of this commit: the rig is 18/18. It was continue-on-error
  # while two assertions failed for a real reason, on the argument that
  # blocking every PR on a known gap means fixing it under time pressure or
  # deleting the assertion. The gap is fixed, so the exemption goes with it -
  # an allowance that outlives its reason is how a rig becomes decorative.
  musl:
    name: linux asset (musl, static)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: x86_64-unknown-linux-musl
      - uses: Swatinem/rust-cache@v2
      - name: musl toolchain
        run: sudo apt-get update && sudo apt-get install -y musl-tools
      - name: Build the asset the release ships
        run: cargo build --release --target x86_64-unknown-linux-musl
      - name: It is static and it runs
        run: |

          file target/x86_64-unknown-linux-musl/release/termaxa | grep -q static
          target/x86_64-unknown-linux-musl/release/termaxa --version
  boundary:
    name: privilege boundary (second real user)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: Build
        run: cargo build
      - name: Run the boundary rig
        run: sudo bash tests/boundary/rig.sh "$PWD/target/debug/termaxa"