feat(tree): optional commit validation (#27977)