1 import Base 2 import ./Console.bend as Console 3 import ./CrashPointPolicy.bend as Policy 4 5 # Irreducible host boundary: emit an unbuffered marker and stop this process. 6 def stop(name: String) -> IO(Result<&1, &1, U32 & String, Unit>): 7 import "./effs/crash_point.c" 8 import "./effs/crash_point.js" 9 10 # Resolve the hit for decision for the crash injection interface. 11 def hit_decision(active: Bool, name: String) -> IO(Result<&1, &1, U32 & String, Unit>): 12 match active: 13 case True{}: 14 stop(name) 15 case False{}: 16 IO.pure(Result<&1, &1, U32 & String, Unit>, Done{Unit{}}) 17 18 # Test-only checkpoint. Environment lookup and activation policy stay in Bend; 19 # only marker emission and SIGSTOP remain in the host twins. 20 def hit(+name: String) -> IO(Result<&1, &1, U32 & String, Unit>): 21 do IO>: 22 configured : String <- IO.try(String, Console.get_env("MYLSM_CRASH_POINT")) 23 hit_decision(Policy.enabled(configured, name), name)