fix(worktrees): reuse retained templates across base commit changes (#201597)

Keep four recent managed source generations per template identity and reuse the existing publication, reader-custody, and cleanup owners. Preserve one prepared-checkout slot per stable identity and defer invalid-generation retirement to maintenance.