IIUC, the quality knob (not the effort knob) isn't relevant for lossless encoding.
Knobs are also less relevant for lossless decoding, where there's only one correct output for any given input.
In any case, my code (https://github.com/nigeltao/qoir/blob/main/adapter/jxl_adapt...) copy/pastes examples/encode_oneshot.cc from the libjxl repository, plus an additional JxlEncoderSetFrameLossless call.
So I'm using whatever knob values that the libjxl example uses, i.e. the default knob values. If there are better knob values for lossless, let me know.