A couple of comments:
You’re running a “sub-suite” - which is a suite inside another suite’s task.
If the sub-suite is supposed to be launched in every cycle, the usual thing to do is start it with
cylc run --no-detach. This stops the suite server program from daemonising (detaching from the parent process, sort of) so that the launching task will remain in the running state so long as the sub-suite is running.
However, if you’re just launching a one-off monitoring suite and checking if it is still alive in every cycle (and relaunching it if not) then a normal detaching suite is fine (in which case the top-suite task will be running only while launching the sub-suite, not for the duration of the sub-suite run). But then I’d still ask: why do you have to check the sub-suite is running in every cycle? (is there something wrong with it so that it often dies unexpectedly?). And it is very strange that the sub-suite is not seen by
cylc scan - are you sure it really is running when it is not seen? And finally, you have figured out a valid way of determining if a suite is running (check for a contact file) but it isn’t entirely foolproof: if the suite got killed it might leave behind a contact file. Better to use
cylc ping my-suite, which will return success status if my-suite is running, otherwise an error message.