Another option for how this may be detected is via crew testing. Most cruise lines including
DCL are doing periodic testing of crew members without symptoms just to monitor things on board. One CM on DCL said they get tested every two weeks. If a crew member tested positive, it stands to reason the cruise line might requires guests with documented close contact to the crew member to undergo testing (e.g., guests served by a dining team member, people who had a massage from a spa worker, families whose kids had contact with a kids club staff member etc.).