prepare add_node: reachability and parent tracking

Signed-off-by: Andrey Rybalchenko <rybal@microsoft.com>