# `mix ash_grant.verify`
[🔗](https://github.com/jhlee111/ash_grant/blob/v0.22.0/lib/mix/tasks/ash_grant.verify.ex#L1)

Runs policy configuration tests.

## Usage

    # Run all policy tests in default location
    mix ash_grant.verify

    # Run tests from specific directory
    mix ash_grant.verify test/policy_tests/

    # Run tests from a YAML file
    mix ash_grant.verify priv/policy_tests/document.yaml

    # Run with verbose output
    mix ash_grant.verify --verbose

## Options

  * `--verbose` - Show detailed output for each test
  * `--format` - Output format: text (default), json

## Permission syntax warnings

After running the tests, this task resolves each policy test actor's permissions and
reports deprecated or dead grant syntax — see `AshGrant.Permission.diagnostics/1` for
the full list of codes.

This only sees grants held by the actors your policy tests declare, so a clean run is
**not** proof that your permission store is clean. Permission strings live in your own
database or seeds, which AshGrant cannot reach; to audit all of them, run
`AshGrant.Permission.diagnostics/1` over your own data:

    MyApp.Role
    |> MyApp.Repo.all()
    |> Enum.flat_map(& &1.permissions)
    |> Enum.flat_map(&AshGrant.Permission.diagnostics/1)

`diagnostics/1` reports spelling only. To also check that each stored string names a
resource, action, scope and field group that exist, use
`mix ash_grant.check_permissions` (or `AshGrant.PermissionValidation.check_all/2`).

YAML tests carry their permissions inline rather than through policy test modules and
are not scanned. Warnings never affect the exit code.

## Exit Codes

  * 0 - All tests passed
  * 1 - One or more tests failed

---

*Consult [api-reference.md](api-reference.md) for complete listing*
