fix: deliver validated AI insight responses

This commit is contained in:
2026-08-22 15:47:38 +08:00
parent ca55c2fb3d
commit 3fba4261ee
68 changed files with 6870 additions and 493 deletions

View File

@@ -0,0 +1,19 @@
BEGIN;
UPDATE golden_steps
SET status = 'IN_PROGRESS',
completed_at = NULL,
updated_at = now()
WHERE action_type = 'METRIC'
AND status = 'COMPLETED'
AND (
current_value IS NULL
OR target IS NULL
OR metric_direction IS NULL
OR (metric_direction = 'INCREASE' AND current_value < target)
OR (metric_direction = 'DECREASE' AND current_value > target)
);
INSERT INTO schema_migrations(version) VALUES (6);
COMMIT;