No publisher would want to sign a contract with an author that isn't likely to live much longer. It needs to be either a fixed amount, or Life + something.
It should be life of author or 40 years, whichever comes later.
Corporations and the like get 40 years.
That would not protect the author's family in case they died shortly after they wrote their final book "to help their family survive".
It also would encourage authors to have "unexpected deaths".
I'm a fan of 20 + 20.
Then make your children co-authors.
But then we'd get sob stories about how this condemns Walt Disney's great-great-grandchildren to starving in the street.
You also get sob stories about the children of a famous singer that just died in a plane accident at the top of their carrier.