The move from regex replace to AST editing keyed off a stable node id is the right call, and the "Submit" example shows why: text matching has no way to tell a button from a test assertion or a prop name. The broader point about pushing pieces from probabilistic to deterministic wherever a wrong edit is expensive is one I wish more agent tooling took seriously. On the compositional drift across pages, that feels like exactly the thing you would want a check on at generation time, comparing spacing and structure against your component definitions rather than hoping the tokens hold.