Refinement Without Specification
Summary
The post investigates evolving a database schema with preservation of external properties through refinement mappings, starting from a non-null is_activated flag to a nullable activated_at, then to an event-sourced user_events model. It shows how to define mappings to translate new_user or newer_user into the old_user so legacy code continues to work, with concrete expressions for activated_at. It introduces mutability constraints C1 and C2 to reason about when refinements preserve behavior, showing that some evolutions are not refinements if constraints are violated. The piece concludes that refinement is a powerful but challenging concept best taught via concrete database examples, and it links to related posts and subscription options.