“What is rule 586 in the Pennsylvania crime code?”
Rule 586 is entitled Dismissal Upon Satisfaction or Agreement. It applies to any non-violent philadelphia criminal defense lawyer. (There is a similar rule, Rule 546, which applies to misdemeanors.) Essentially, the rule stands for the proposition that the district attorney can decide to dismiss a case if the defendant has agreed to pay restitution or otherwise satisfy the victim of the crime.
You see this most often in forgery or theft cases. If the defendant apologizes and returns all of the money, and everyone agrees, the DA can dismiss the case under this rule.
It is important to remember that the District Attorney must agree to dismiss the case. Nobody has any right to have a case dismissed under this rule.