From 77200b36494dbf8f7aa1500fbf5976585fffdb66 Mon Sep 17 00:00:00 2001
From: Dmitry Vyukov <dvyukov@google.com>
Date: Wed, 19 Nov 2025 18:38:25 +0100
Subject: dashboard/app: add support for AI workflows

Support for:
 - polling for AI jobs
 - handling completion of AI jobs
 - submitting job trajectory logs
 - basic visualization for AI jobs
---
 dashboard/app/aidb/migrations/1_initialize.up.sql | 41 ++++++++++++++++++++++-
 1 file changed, 40 insertions(+), 1 deletion(-)

(limited to 'dashboard/app/aidb/migrations/1_initialize.up.sql')

diff --git a/dashboard/app/aidb/migrations/1_initialize.up.sql b/dashboard/app/aidb/migrations/1_initialize.up.sql
index 981cd8d3a..4448242b1 100644
--- a/dashboard/app/aidb/migrations/1_initialize.up.sql
+++ b/dashboard/app/aidb/migrations/1_initialize.up.sql
@@ -1,3 +1,42 @@
-CREATE TABLE Test (
+CREATE TABLE Workflows (
 	Name			STRING(1000) NOT NULL,
+	Type			STRING(1000) NOT NULL,
+	LastActive		TIMESTAMP NOT NULL,
 ) PRIMARY KEY (Name);
+
+CREATE TABLE Jobs (
+	ID			STRING(36) NOT NULL,
+	Type			STRING(1000) NOT NULL,
+	Workflow		STRING(1000) NOT NULL,
+	Namespace		STRING(1000) NOT NULL,
+	BugID			STRING(1000),
+	Description		STRING(1000) NOT NULL,
+	Link			STRING(1000) NOT NULL,
+	Created			TIMESTAMP NOT NULL,
+	Started			TIMESTAMP,
+	Finished		TIMESTAMP,
+	LLMModel		STRING(1000),
+	CodeRevision		STRING(1000),
+	Error			STRING(MAX),
+	Args			JSON,
+	Results			JSON,
+) PRIMARY KEY (ID);
+
+CREATE TABLE TrajectorySpans (
+	JobID			STRING(36) NOT NULL,
+	Seq			INT64 NOT NULL,
+	Nesting 		INT64 NOT NULL,
+	Type 			STRING(1000) NOT NULL,
+	Name			STRING(1000) NOT NULL,
+	Started			TIMESTAMP NOT NULL,
+	Finished		TIMESTAMP,
+	Error			STRING(MAX),
+	Args			JSON,
+	Results			JSON,
+	Instruction		STRING(MAX),
+	Prompt			STRING(MAX),
+	Reply			STRING(MAX),
+	Thoughts		STRING(MAX),
+
+	CONSTRAINT FK_EventJob FOREIGN KEY (JobID) REFERENCES Jobs (ID),
+) PRIMARY KEY (JobID, Seq);
-- 
cgit mrf-deployment

