key_commit: api now writes a raw file for debugging