Ad hoc signatures change on every build, so macOS asks for the keychain password again after each rebuild or update. A self-signed certificate keeps the designated requirement stable; Gatekeeper behavior is unchanged.