-- 030_plan_step_replaced_reason.up.sql -- Add replaced_reason to session_plan_steps so the agent must explain why -- a step was replaced (wrong_diagnosis, scope_change, blocked, superseded, -- operator_override) rather than silently replacing entire plans. The column -- is also set by bulk-replace operations (proposePlan, setGoal, reopenSession) -- for auditability. ALTER TABLE session_plan_steps ADD COLUMN IF NOT EXISTS replaced_reason TEXT;