Gates run in deterministic Python after every proposal. The model cannot reach or override them.
The regime is computed from the daily bars, never from the model. It sets the budget; in a range, the position of spot inside it decides which side may be sold.