Skip to content

wayglass policy test

Replay recent commits through the local policy, shadow rules included.

Classifies each recent commit on the current branch (first parent only) and decides it with the local policy file, so a rule can be tried before it is enforced: add it with mode: shadow, run this, and read what it would have decided. Nothing is recorded and the Worker is not contacted. Commits with a why note also show the decision recorded when they landed.

Terminal window
wayglass policy test [flags]
Terminal window
wayglass policy test
wayglass policy test --since v0.1.0
wayglass policy test --file ../drafts/policy.yaml --json
Flag Default Description
--file string policy file to try (default .wayglass/policy.yaml)
--jurisdiction string jurisdiction to tag changes with (default from .wayglass/config.yaml)
-n, --limit int 20 replay at most this many commits (max 500)
--rev string HEAD replay commits reachable from this revision
--since string replay commits after this revision (since..rev)
Flag Default Description
--json print a JSON envelope for agents (no colour, prompts or spinners)

Exit codes and the --json envelope are the same for every command; see For agents.