Adv. queries: grouping blocks from page with sub pages

Hi!

At my flow I have pages for projects and sub-pages for different project tracks.
Снимок экрана 2023-03-05 в 14.20.41
I leave my tasks at journal, but also have some at project pages.
Снимок экрана 2023-03-05 в 14.20.23
Снимок экрана 2023-03-05 в 14.20.18
I can have a list with all project tasks with the query:

#+BEGIN_QUERY
{
 :query [:find (pull ?b [*])
       :in $ ?current-page
       :where
       [?p :block/name ?current-page]
       (or [?b :block/page ?p] [?b :block/refs ?p])
       (task ?b #{"TODO" "LATER" "NOW" "DOING"})
]
 :inputs [:current-page]}
#+END_QUERY

Here is an example result:
Снимок экрана 2023-03-05 в 14.20.29

But during my review I would like to check each task in terms of tracks (sub-pages) which my blocks refers to, so I can have all blocks grouped by it at one place.

Is there any way with advanced queries to meet the intention?
Thank you in advance!

Something like this:
Снимок экрана 2023-03-05 в 14.28.19