Algorithm we can trust that wont break for theme app extension presence on template

It is important that merchants add our theme app extension to the correct template.

We need a algorithm we can trust that wont break to test presence of the theme app extension presence on the template.

We used to loop over file names obtained by doing:

query {
        theme(id: "gid://shopify/OnlineStoreTheme/${actualTheme.id}") {
          id
          name
          role
          files(filenames: [
              "templates/index.json",
              "templates/product*.json",
              "templates/collection*.json",
            ], first: 20) {
            nodes {
              filename
              body {
                ... on OnlineStoreThemeFileBodyText {
                  content
                }
              }
            }

Then we ran checks to see if our extension was added to the files:

if (filename === "templates/index.json" && fileContainsExtensionKeyword) {
          homepageAppBlockStatus = true;
}

But recently we found templates/product.checks.json . Are there any other such files like .checks that we need to an exception for?

Better, what is the right code to use to find our theme app extension presence?