Still unclear. Isn't
child-foo an executable different than grandchild-foo? But you seem not to want to stop here. What are the rules then? Or do you need us to create the rules? If so, what is the usage case? What do you need information about the "initial process" for?