# [Wolfram Language (Mathematica)], <s>212</s> 170 bytes

    B[x_,y_]=Fold[Switch[{a,b}=#;#2,"f",{x,b},"F",{a,y},"e",{0,b},"E",{a,0},"p",#+{-1,1}Min[a,y-b],"P",#+{1,-1}Min[b,x-a],"o",Echo@a;#,"O",Echo@b;#,_,#]&,{0,0},Characters@#]&

[Try it online!][TIO-jz5v9ab2]

[Wolfram Language (Mathematica)]: https://www.wolfram.com/wolframscript/
[TIO-jz5v9ab2]: https://tio.run/##VY7BCoJAEEDvfcYudGkWtLqJEIXeIqHjssjstrJCpthCivjtNlkdvL33ZhimQu9shb40OE1H2eXQ5ypO6/tNXl@lN04OCHqMecS3wAoGQ0cKLCVC6IksUTC3ZG4BUcOAbwYRQjiey4ekRaEVsGzOIYhv1tAJpFwzSIyrDxhxYJefaJIcuFp/rtPNk8MWjbft80CRXt3BXklaV6s/p9nSbLYsRbOYk0xv "Wolfram Language (Mathematica) – Try It Online"

Calling `B[x,y]` returns an interpreter for the (x,y)-bucket system, which can be applied to a program with `B[x,y]["prog"]`.

Debugging is done by replacing `Fold` with `FoldList`.