According to this page, submarine swaps allow us to use onchain funds to pay a third party to fulfill any lightning invoice (and trustlessly get our money back if the payment fails for any reason), OR do the same in reverse, and use lightning funds to pay a third party to send bitcoins to any onchain address (with a similar trustless way to get our money back if the payment fails). However, only the first part has been coded up (at submarineswaps.org). My question is about the second part: how does the trustless reimbursement work over lightning if the bitcoin transaction never gets broadcast, or if it only gets broadcast to the mempool and never gets mined? Is there any place I can get more information about that?
On a related note, how would the payer trustlessly enforce a policy regarding how many confirmations the onchain transaction needs before the swap provider finally gets the lightning payment, and how would the swap provider trustlessly ensure that the payer actually pays once the onchain transaction has the agreed-upon number of confirmations?