Stress fibers are contractile actomyosin bundles commonly observed in the cytoskeleton of metazoan cells. The spatial profile of the polarity of actin filaments inside contractile actomyosin bundles is either monotonic (graded) or periodic (alternating). In the framework of linear irreversible thermodynamics, we write the constitutive equations for a polar, active, elastic one-dimensional medium. An analysis of the resulting equations for the dynamics of polarity shows that the transition from graded to alternating polarity patterns is a nonequilibrium Lifshitz point. Active contractility is a necessary condition for the emergence of sarcomeric, alternating polarity patterns.