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,20 @@
BEGIN;
UPDATE golden_steps AS action
SET status = 'IN_PROGRESS',
completed_at = NULL,
updated_at = now()
WHERE action.action_type = 'MANUAL'
AND action.status = 'COMPLETED'
AND NOT EXISTS (
SELECT 1
FROM growth_coach_events AS event
WHERE event.entity_type = 'ACTION'
AND event.entity_id = action.id
AND event.event_type = 'action.transitioned'
AND event.payload ->> 'status' = 'COMPLETED'
);
INSERT INTO schema_migrations(version) VALUES (7);
COMMIT;