I have made some progress thanks to your suggestions.
I installed the application in a clean 11.5.2 system on a VM. I waited until mdimport -L showed my importer, then saved a document. I then did a Spotlight search and the new document was successfully found!
The remaining issues:
Although I added logging using os_log as you suggested, I have yet to see any log messages in system.log. Any ideas on what might be going wrong? I double checked the importer binary to be sure that it contained my message strings, which it did.
For example:
os_log_t LOG = os_log_create("org.violetlib.valerie", "metadata");
os_log_info(LOG, "Metadata requested for %{public}@", pathToFile);
Should I expect to see this output in Console's system.log?
I would really like this importer to work on my development system, but I have no desire to do a fresh OS install. Do you have any suggestions on how to get it working or how to find out which bit of persistent state is causing the problem?
Thanks!