11. Commands: check, explain, status
Three commands work with the file and with a running guard. They are not written in the file. The output in the examples is illustrative.
| Command | What it does |
|---|---|
pse check FILE |
checks whether the file is valid |
pse explain GUARD STEP |
explains the decision in one step |
pse status GUARD |
shows the guard’s current state |
explain: why the guard decided that way
Section titled “explain: why the guard decided that way”Every decision has to be explainable. explain says which action was taken, which rule fired and which criteria moved the weights.
The example is step 5 from the collapse table in chapter 7:
$ pse explain payments 5step 5 · guard payments · mode enforceaction: escalate humanfired: built-in: w_o / w_s -> infinity (11.57 > L)weights: w_s 0.07 w_o 0.81 w_f 0.12 theta 0.93moved by: pressure 0.82 -> w_s authority 0.64 -> w_soscillation: unknown (window 5 of 10, no history)How to read it:
actionis what the guard did.firedlists the rules that fired.built-inmeans the built-in rule.weightsare the weights in that step.moved bylists the criteria that moved the weights most, and which weight.oscillationis the oscillation verdict and which check ran.
status: what the guard currently knows
Section titled “status: what the guard currently knows”$ pse status paymentsguard payments · mode enforce · learn frozensteps: 5oscillation checks: window off (5 of 10), history offverdict: unknownattractors: nonestatus is the first place to look when the guard behaves unexpectedly. It shows whether the oscillation checks are on and whether learning is moving.
How to use them together
Section titled “How to use them together”checkbefore every release of a file.- The guard in
observemode. explainon the steps where the guard would block. If the reasons are good, switch toenforce.statusfrom time to time, to see whether learning is moving.
Next: 12. What the check rejects Part of The PSE Language, a textbook by Andrej Ristić. Try the examples in the PSE Playground.