goal: hy_goal_write_debugdata() takes target dir parameter.