file.hasTag()is the solution regarding supporting nested tags in bases.
tags.contains only targets the tags property on the frontmatter as a list, which is what it is. So I don’t think we should We will not make contains have a special behavior just for tags.
You can open I opened a FR asking to extend List.contains() so that it also searches for substrings within an element of the List. This should address the specific use case highlighted in this thread (search only within the tag property in frontmatter).
Alternatively, this FR will also enable the same thing: