Knowing when a rule almost fires and why it didn't?

There is

Windows InteropServices for libswipl.dll

but as the topic notes the code is not production quality. If InteropServices, API wrappers, etc. are not in your regular vocabulary then don’t consider this, it is a very deep rabbit hole because you might get some early positive results but then run into a memory leak bug or something and no one will be around to help.

Also this will get you only part of the way there, you still have to write the interop code for the other things you wish to call.