This is a follow-up to my feedback post.
As I continue to think about the debugging use case, I am increasingly struck by the parallels with texdebug.php.
Texdebug is a stand-alone script--you don't even need to be logged in to use it. When a user is having problems getting LaTeX markup to render, we tell them to point their browsers as texdebug.php and report back with the results. We ask them to paste the text output into a forum post. Either the user himself or an "expert" in the forums can usually spot the problem.
With roles, we have a similar situation. A user reports a problem like this one
from earlier today. I would love to be able to tell this user to point his browser at rolesdebug.php and report back with the results. But instead, we engage in a tedious game of "Twenty Questions."
So for the debugging case
I a lean toward a texdebug-sytle solution (with a require_login, of course, since a current user is required). Same three inputs as in my prototype (capability, context level, instance id). Same output table, but also a textbox with a text version of the output that the user could copy and paste into a forum post that would display in a reasonably presentable way.
Incidentally, in my version of rolesdebug.php, you do not have to specify a capability, but you must specify a context level and instance id. Doing this will show you all the role assignments and overrides in effect for the target context, and often this is enough to diagnose a problem -- or at least a good first step.