Clean JSON for autonomous agents: normalize malformed JSON and agent-generated JSON into canonical JSON, then independently verify the result is stable and idempotent.