From 1de5d699062266be4dc6ae4e66558eb39a26a021 Mon Sep 17 00:00:00 2001 From: Deeman Date: Fri, 27 Feb 2026 15:49:38 +0100 Subject: [PATCH] fix(supervisor): use sqlmesh plan prod --auto-apply instead of run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'run' requires the prod environment to already exist and defaults to dev_ on first run. 'plan --auto-apply' initializes prod if missing and applies pending changes — fully self-healing. Co-Authored-By: Claude Sonnet 4.6 --- src/materia/supervisor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/materia/supervisor.py b/src/materia/supervisor.py index 531d033..fadfc25 100644 --- a/src/materia/supervisor.py +++ b/src/materia/supervisor.py @@ -240,7 +240,7 @@ def run_shell(cmd: str, timeout_seconds: int = SUBPROCESS_TIMEOUT_SECONDS) -> bo def run_transform() -> None: """Run SQLMesh — evaluates model staleness internally.""" logger.info("Running SQLMesh transform") - ok = run_shell("uv run sqlmesh -p transform/sqlmesh_materia run") + ok = run_shell("uv run sqlmesh -p transform/sqlmesh_materia plan prod --auto-apply") if not ok: send_alert("SQLMesh transform failed")