You should think about what prior you want over the sequence. And whether it’s upper bounded by max_depth here. If it’s upper bounded by max_depth, then you can’t just take uniform points in (0, max_depth) and cumulative sum without risk of going over.
An alternative that respects n upper bound is to take a simplex, apply cumulative sum, then scale by max_depth. That will imply a prior based on the prior for the simplex. You can apply a Jacobian correction for the cumulative sum and scaling to adjust it back to uniform over the increasing sequences bounded by 0 and max_depth and then apply whatever prior you want. For example, if it’s cutpoints in an ordinal logistic regression, you might want to apply a zero-avoiding prior to the differences in the sequence.