book: scaffold + ch00 (execution trail as spine) — evidence exp 8-31, round 3

This commit is contained in:
TradeAC Book Agent
2026-08-18 22:35:23 +00:00
commit c93424e76c
83 changed files with 17676 additions and 0 deletions
@@ -0,0 +1,23 @@
CREATE TABLE "rd_experiments" (
"id" bigserial PRIMARY KEY NOT NULL,
"experiment_name" text,
"rational" text NOT NULL,
"rational_embedding" vector(384),
"details" text,
"details_embedding" vector(384),
"evaluation" text,
"metrics" jsonb,
"evolved_from" bigint,
"start_ts" timestamp with time zone DEFAULT now() NOT NULL,
"end_ts" timestamp with time zone,
"git_branch" text NOT NULL,
"experiment_ref_id" text,
"mlruns_dir" text,
"status" text DEFAULT 'starting' NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "rd_experiments" ADD CONSTRAINT "rd_experiments_evolved_from_rd_experiments_id_fk" FOREIGN KEY ("evolved_from") REFERENCES "public"."rd_experiments"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "rd_experiments_ref_id_idx" ON "rd_experiments" USING btree ("experiment_ref_id");--> statement-breakpoint
CREATE INDEX "rd_experiments_evolved_from_idx" ON "rd_experiments" USING btree ("evolved_from");
@@ -0,0 +1,54 @@
CREATE TABLE "rd_models" (
"id" bigserial PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"description" text,
"experiment_name" text NOT NULL,
"run_id" text NOT NULL,
"model_path" text,
"universe" text,
"label" text,
"default_strategy" text,
"metrics" jsonb,
"status" text DEFAULT 'active' NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT "rd_models_name_unique" UNIQUE("name")
);
--> statement-breakpoint
CREATE TABLE "scheduler_jobs" (
"id" bigserial PRIMARY KEY NOT NULL,
"name" text,
"city" text DEFAULT 'new-york' NOT NULL,
"timezone" text DEFAULT 'America/New_York' NOT NULL,
"time" text NOT NULL,
"model_id" bigint NOT NULL,
"strategy" text DEFAULT 'workflow_lgb_sp5d_rankic.yaml' NOT NULL,
"enabled" boolean DEFAULT true NOT NULL,
"last_run_at" timestamp with time zone,
"last_status" text,
"last_error" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "scheduler_runs" (
"id" bigserial PRIMARY KEY NOT NULL,
"job_id" bigint,
"city" text NOT NULL,
"model_id" bigint NOT NULL,
"strategy" text NOT NULL,
"title" text NOT NULL,
"session_id" text,
"status" text DEFAULT 'pending' NOT NULL,
"error" text,
"triggered_at" timestamp with time zone DEFAULT now() NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "scheduler_jobs" ADD CONSTRAINT "scheduler_jobs_model_id_rd_models_id_fk" FOREIGN KEY ("model_id") REFERENCES "public"."rd_models"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "rd_models_run_id_idx" ON "rd_models" USING btree ("run_id");--> statement-breakpoint
CREATE INDEX "rd_models_name_idx" ON "rd_models" USING btree ("name");--> statement-breakpoint
CREATE INDEX "scheduler_jobs_model_id_idx" ON "scheduler_jobs" USING btree ("model_id");--> statement-breakpoint
CREATE INDEX "scheduler_jobs_enabled_idx" ON "scheduler_jobs" USING btree ("enabled");--> statement-breakpoint
CREATE INDEX "scheduler_runs_job_id_idx" ON "scheduler_runs" USING btree ("job_id");--> statement-breakpoint
CREATE INDEX "scheduler_runs_session_id_idx" ON "scheduler_runs" USING btree ("session_id");
@@ -0,0 +1,5 @@
ALTER TABLE "scheduler_jobs" ALTER COLUMN "model_id" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "scheduler_runs" ALTER COLUMN "model_id" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "scheduler_jobs" ADD COLUMN "days" text DEFAULT '1,2,3,4,5' NOT NULL;--> statement-breakpoint
ALTER TABLE "scheduler_jobs" ADD COLUMN "experiment_name" text;--> statement-breakpoint
ALTER TABLE "scheduler_jobs" ADD COLUMN "run_id" text;
+3
View File
@@ -0,0 +1,3 @@
ALTER TABLE "scheduler_jobs" ALTER COLUMN "strategy" DROP DEFAULT;--> statement-breakpoint
ALTER TABLE "scheduler_jobs" ALTER COLUMN "strategy" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "scheduler_runs" ALTER COLUMN "strategy" DROP NOT NULL;
@@ -0,0 +1 @@
ALTER TABLE "scheduler_runs" ADD COLUMN "source" text DEFAULT 'scheduled' NOT NULL;
@@ -0,0 +1,98 @@
CREATE TABLE "fact_events" (
"id" bigserial PRIMARY KEY NOT NULL,
"round_id" bigint NOT NULL,
"kind" text NOT NULL,
"symbol" text,
"payload" jsonb,
"source" text,
"at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "round_decisions" (
"id" bigserial PRIMARY KEY NOT NULL,
"round_id" bigint NOT NULL,
"intent_id" bigint,
"symbol" text NOT NULL,
"side" text NOT NULL,
"qty" numeric,
"order_type" text,
"expected_price" numeric,
"status" text DEFAULT 'intended' NOT NULL,
"reason" text,
"reason_detail" text,
"superseded_by_decision_id" bigint,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "round_intents" (
"id" bigserial PRIMARY KEY NOT NULL,
"round_id" bigint NOT NULL,
"version" bigint NOT NULL,
"supersedes_intent_id" bigint,
"target_portfolio" jsonb,
"raw_strategy_output" jsonb,
"reason" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "round_orders" (
"id" bigserial PRIMARY KEY NOT NULL,
"decision_id" bigint NOT NULL,
"round_id" bigint NOT NULL,
"alpaca_order_id" text,
"client_order_id" text,
"qty_intended" numeric,
"qty_filled" numeric DEFAULT '0' NOT NULL,
"avg_fill_price" numeric,
"status" text DEFAULT 'accepted' NOT NULL,
"superseded_by_order_id" bigint,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "trading_rounds" (
"id" bigserial PRIMARY KEY NOT NULL,
"source" text DEFAULT 'scheduled' NOT NULL,
"target_date" date NOT NULL,
"signal_date" date,
"scheduler_run_id" bigint,
"rd_experiment_id" bigint,
"experiment_name" text,
"run_id" text,
"model_path" text,
"strategy_snapshot" jsonb,
"account_equity_at_sizing" numeric,
"status" text DEFAULT 'open' NOT NULL,
"locked_intent_id" bigint,
"summary_metrics" jsonb,
"feedback_note" text,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "fact_events" ADD CONSTRAINT "fact_events_round_id_trading_rounds_id_fk" FOREIGN KEY ("round_id") REFERENCES "public"."trading_rounds"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_decisions" ADD CONSTRAINT "round_decisions_round_id_trading_rounds_id_fk" FOREIGN KEY ("round_id") REFERENCES "public"."trading_rounds"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_decisions" ADD CONSTRAINT "round_decisions_intent_id_round_intents_id_fk" FOREIGN KEY ("intent_id") REFERENCES "public"."round_intents"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_decisions" ADD CONSTRAINT "round_decisions_superseded_by_round_decisions_id_fk" FOREIGN KEY ("superseded_by_decision_id") REFERENCES "public"."round_decisions"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_intents" ADD CONSTRAINT "round_intents_round_id_trading_rounds_id_fk" FOREIGN KEY ("round_id") REFERENCES "public"."trading_rounds"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_intents" ADD CONSTRAINT "round_intents_supersedes_intent_id_round_intents_id_fk" FOREIGN KEY ("supersedes_intent_id") REFERENCES "public"."round_intents"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_orders" ADD CONSTRAINT "round_orders_round_id_trading_rounds_id_fk" FOREIGN KEY ("round_id") REFERENCES "public"."trading_rounds"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_orders" ADD CONSTRAINT "round_orders_decision_id_round_decisions_id_fk" FOREIGN KEY ("decision_id") REFERENCES "public"."round_decisions"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "round_orders" ADD CONSTRAINT "round_orders_superseded_by_round_orders_id_fk" FOREIGN KEY ("superseded_by_order_id") REFERENCES "public"."round_orders"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "trading_rounds" ADD CONSTRAINT "trading_rounds_scheduler_run_id_scheduler_runs_id_fk" FOREIGN KEY ("scheduler_run_id") REFERENCES "public"."scheduler_runs"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "trading_rounds" ADD CONSTRAINT "trading_rounds_rd_experiment_id_rd_experiments_id_fk" FOREIGN KEY ("rd_experiment_id") REFERENCES "public"."rd_experiments"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "fact_events_round_id_idx" ON "fact_events" USING btree ("round_id");--> statement-breakpoint
CREATE INDEX "fact_events_round_kind_idx" ON "fact_events" USING btree ("round_id","kind");--> statement-breakpoint
CREATE INDEX "round_decisions_round_id_idx" ON "round_decisions" USING btree ("round_id");--> statement-breakpoint
CREATE INDEX "round_decisions_round_symbol_idx" ON "round_decisions" USING btree ("round_id","symbol");--> statement-breakpoint
CREATE INDEX "round_decisions_intent_id_idx" ON "round_decisions" USING btree ("intent_id");--> statement-breakpoint
CREATE INDEX "round_intents_round_id_idx" ON "round_intents" USING btree ("round_id");--> statement-breakpoint
CREATE INDEX "round_intents_round_version_idx" ON "round_intents" USING btree ("round_id","version");--> statement-breakpoint
CREATE INDEX "round_orders_round_id_idx" ON "round_orders" USING btree ("round_id");--> statement-breakpoint
CREATE INDEX "round_orders_decision_id_idx" ON "round_orders" USING btree ("decision_id");--> statement-breakpoint
CREATE INDEX "round_orders_alpaca_order_id_idx" ON "round_orders" USING btree ("alpaca_order_id");--> statement-breakpoint
CREATE INDEX "trading_rounds_target_date_idx" ON "trading_rounds" USING btree ("target_date");--> statement-breakpoint
CREATE INDEX "trading_rounds_scheduler_run_id_idx" ON "trading_rounds" USING btree ("scheduler_run_id");--> statement-breakpoint
CREATE INDEX "trading_rounds_rd_experiment_id_idx" ON "trading_rounds" USING btree ("rd_experiment_id");--> statement-breakpoint
CREATE INDEX "trading_rounds_locked_intent_id_idx" ON "trading_rounds" USING btree ("locked_intent_id");
@@ -0,0 +1 @@
ALTER TABLE "rd_experiments" ADD COLUMN IF NOT EXISTS "session_id" text;
+183
View File
@@ -0,0 +1,183 @@
{
"id": "07d19100-254c-4adf-8b83-480fa6ffc00e",
"prevId": "00000000-0000-0000-0000-000000000000",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.rd_experiments": {
"name": "rd_experiments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rational": {
"name": "rational",
"type": "text",
"primaryKey": false,
"notNull": true
},
"rational_embedding": {
"name": "rational_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"details": {
"name": "details",
"type": "text",
"primaryKey": false,
"notNull": false
},
"details_embedding": {
"name": "details_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"evaluation": {
"name": "evaluation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"evolved_from": {
"name": "evolved_from",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"start_ts": {
"name": "start_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"end_ts": {
"name": "end_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"git_branch": {
"name": "git_branch",
"type": "text",
"primaryKey": false,
"notNull": true
},
"experiment_ref_id": {
"name": "experiment_ref_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"mlruns_dir": {
"name": "mlruns_dir",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'starting'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_experiments_ref_id_idx": {
"name": "rd_experiments_ref_id_idx",
"columns": [
{
"expression": "experiment_ref_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_experiments_evolved_from_idx": {
"name": "rd_experiments_evolved_from_idx",
"columns": [
{
"expression": "evolved_from",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"rd_experiments_evolved_from_rd_experiments_id_fk": {
"name": "rd_experiments_evolved_from_rd_experiments_id_fk",
"tableFrom": "rd_experiments",
"tableTo": "rd_experiments",
"columnsFrom": [
"evolved_from"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
+571
View File
@@ -0,0 +1,571 @@
{
"id": "e7722810-0b69-4a2d-a5b0-88df6939faa3",
"prevId": "07d19100-254c-4adf-8b83-480fa6ffc00e",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.rd_experiments": {
"name": "rd_experiments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rational": {
"name": "rational",
"type": "text",
"primaryKey": false,
"notNull": true
},
"rational_embedding": {
"name": "rational_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"details": {
"name": "details",
"type": "text",
"primaryKey": false,
"notNull": false
},
"details_embedding": {
"name": "details_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"evaluation": {
"name": "evaluation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"evolved_from": {
"name": "evolved_from",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"start_ts": {
"name": "start_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"end_ts": {
"name": "end_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"git_branch": {
"name": "git_branch",
"type": "text",
"primaryKey": false,
"notNull": true
},
"experiment_ref_id": {
"name": "experiment_ref_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"mlruns_dir": {
"name": "mlruns_dir",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'starting'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_experiments_ref_id_idx": {
"name": "rd_experiments_ref_id_idx",
"columns": [
{
"expression": "experiment_ref_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_experiments_evolved_from_idx": {
"name": "rd_experiments_evolved_from_idx",
"columns": [
{
"expression": "evolved_from",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"rd_experiments_evolved_from_rd_experiments_id_fk": {
"name": "rd_experiments_evolved_from_rd_experiments_id_fk",
"tableFrom": "rd_experiments",
"tableTo": "rd_experiments",
"columnsFrom": [
"evolved_from"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.rd_models": {
"name": "rd_models",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_path": {
"name": "model_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"universe": {
"name": "universe",
"type": "text",
"primaryKey": false,
"notNull": false
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": false
},
"default_strategy": {
"name": "default_strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_models_run_id_idx": {
"name": "rd_models_run_id_idx",
"columns": [
{
"expression": "run_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_models_name_idx": {
"name": "rd_models_name_idx",
"columns": [
{
"expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"rd_models_name_unique": {
"name": "rd_models_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_jobs": {
"name": "scheduler_jobs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'new-york'"
},
"timezone": {
"name": "timezone",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'America/New_York'"
},
"time": {
"name": "time",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'workflow_lgb_sp5d_rankic.yaml'"
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"last_run_at": {
"name": "last_run_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"last_status": {
"name": "last_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_jobs_model_id_idx": {
"name": "scheduler_jobs_model_id_idx",
"columns": [
{
"expression": "model_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_jobs_enabled_idx": {
"name": "scheduler_jobs_enabled_idx",
"columns": [
{
"expression": "enabled",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"scheduler_jobs_model_id_rd_models_id_fk": {
"name": "scheduler_jobs_model_id_rd_models_id_fk",
"tableFrom": "scheduler_jobs",
"tableTo": "rd_models",
"columnsFrom": [
"model_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_runs": {
"name": "scheduler_runs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"job_id": {
"name": "job_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": true
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"session_id": {
"name": "session_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"error": {
"name": "error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"triggered_at": {
"name": "triggered_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_runs_job_id_idx": {
"name": "scheduler_runs_job_id_idx",
"columns": [
{
"expression": "job_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_runs_session_id_idx": {
"name": "scheduler_runs_session_id_idx",
"columns": [
{
"expression": "session_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
+590
View File
@@ -0,0 +1,590 @@
{
"id": "1123264a-7a95-4474-9fab-68662142abf7",
"prevId": "e7722810-0b69-4a2d-a5b0-88df6939faa3",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.rd_experiments": {
"name": "rd_experiments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rational": {
"name": "rational",
"type": "text",
"primaryKey": false,
"notNull": true
},
"rational_embedding": {
"name": "rational_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"details": {
"name": "details",
"type": "text",
"primaryKey": false,
"notNull": false
},
"details_embedding": {
"name": "details_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"evaluation": {
"name": "evaluation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"evolved_from": {
"name": "evolved_from",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"start_ts": {
"name": "start_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"end_ts": {
"name": "end_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"git_branch": {
"name": "git_branch",
"type": "text",
"primaryKey": false,
"notNull": true
},
"experiment_ref_id": {
"name": "experiment_ref_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"mlruns_dir": {
"name": "mlruns_dir",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'starting'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_experiments_ref_id_idx": {
"name": "rd_experiments_ref_id_idx",
"columns": [
{
"expression": "experiment_ref_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_experiments_evolved_from_idx": {
"name": "rd_experiments_evolved_from_idx",
"columns": [
{
"expression": "evolved_from",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"rd_experiments_evolved_from_rd_experiments_id_fk": {
"name": "rd_experiments_evolved_from_rd_experiments_id_fk",
"tableFrom": "rd_experiments",
"tableTo": "rd_experiments",
"columnsFrom": [
"evolved_from"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.rd_models": {
"name": "rd_models",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_path": {
"name": "model_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"universe": {
"name": "universe",
"type": "text",
"primaryKey": false,
"notNull": false
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": false
},
"default_strategy": {
"name": "default_strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_models_run_id_idx": {
"name": "rd_models_run_id_idx",
"columns": [
{
"expression": "run_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_models_name_idx": {
"name": "rd_models_name_idx",
"columns": [
{
"expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"rd_models_name_unique": {
"name": "rd_models_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_jobs": {
"name": "scheduler_jobs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'new-york'"
},
"timezone": {
"name": "timezone",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'America/New_York'"
},
"time": {
"name": "time",
"type": "text",
"primaryKey": false,
"notNull": true
},
"days": {
"name": "days",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'1,2,3,4,5'"
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"run_id": {
"name": "run_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'workflow_lgb_sp5d_rankic.yaml'"
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"last_run_at": {
"name": "last_run_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"last_status": {
"name": "last_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_jobs_model_id_idx": {
"name": "scheduler_jobs_model_id_idx",
"columns": [
{
"expression": "model_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_jobs_enabled_idx": {
"name": "scheduler_jobs_enabled_idx",
"columns": [
{
"expression": "enabled",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"scheduler_jobs_model_id_rd_models_id_fk": {
"name": "scheduler_jobs_model_id_rd_models_id_fk",
"tableFrom": "scheduler_jobs",
"tableTo": "rd_models",
"columnsFrom": [
"model_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_runs": {
"name": "scheduler_runs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"job_id": {
"name": "job_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": true
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"session_id": {
"name": "session_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"error": {
"name": "error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"triggered_at": {
"name": "triggered_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_runs_job_id_idx": {
"name": "scheduler_runs_job_id_idx",
"columns": [
{
"expression": "job_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_runs_session_id_idx": {
"name": "scheduler_runs_session_id_idx",
"columns": [
{
"expression": "session_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
+589
View File
@@ -0,0 +1,589 @@
{
"id": "ef6bf221-a986-47ea-9dee-a7678df84502",
"prevId": "1123264a-7a95-4474-9fab-68662142abf7",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.rd_experiments": {
"name": "rd_experiments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rational": {
"name": "rational",
"type": "text",
"primaryKey": false,
"notNull": true
},
"rational_embedding": {
"name": "rational_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"details": {
"name": "details",
"type": "text",
"primaryKey": false,
"notNull": false
},
"details_embedding": {
"name": "details_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"evaluation": {
"name": "evaluation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"evolved_from": {
"name": "evolved_from",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"start_ts": {
"name": "start_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"end_ts": {
"name": "end_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"git_branch": {
"name": "git_branch",
"type": "text",
"primaryKey": false,
"notNull": true
},
"experiment_ref_id": {
"name": "experiment_ref_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"mlruns_dir": {
"name": "mlruns_dir",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'starting'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_experiments_ref_id_idx": {
"name": "rd_experiments_ref_id_idx",
"columns": [
{
"expression": "experiment_ref_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_experiments_evolved_from_idx": {
"name": "rd_experiments_evolved_from_idx",
"columns": [
{
"expression": "evolved_from",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"rd_experiments_evolved_from_rd_experiments_id_fk": {
"name": "rd_experiments_evolved_from_rd_experiments_id_fk",
"tableFrom": "rd_experiments",
"tableTo": "rd_experiments",
"columnsFrom": [
"evolved_from"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.rd_models": {
"name": "rd_models",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_path": {
"name": "model_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"universe": {
"name": "universe",
"type": "text",
"primaryKey": false,
"notNull": false
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": false
},
"default_strategy": {
"name": "default_strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_models_run_id_idx": {
"name": "rd_models_run_id_idx",
"columns": [
{
"expression": "run_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_models_name_idx": {
"name": "rd_models_name_idx",
"columns": [
{
"expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"rd_models_name_unique": {
"name": "rd_models_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_jobs": {
"name": "scheduler_jobs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'new-york'"
},
"timezone": {
"name": "timezone",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'America/New_York'"
},
"time": {
"name": "time",
"type": "text",
"primaryKey": false,
"notNull": true
},
"days": {
"name": "days",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'1,2,3,4,5'"
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"run_id": {
"name": "run_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"last_run_at": {
"name": "last_run_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"last_status": {
"name": "last_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_jobs_model_id_idx": {
"name": "scheduler_jobs_model_id_idx",
"columns": [
{
"expression": "model_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_jobs_enabled_idx": {
"name": "scheduler_jobs_enabled_idx",
"columns": [
{
"expression": "enabled",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"scheduler_jobs_model_id_rd_models_id_fk": {
"name": "scheduler_jobs_model_id_rd_models_id_fk",
"tableFrom": "scheduler_jobs",
"tableTo": "rd_models",
"columnsFrom": [
"model_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_runs": {
"name": "scheduler_runs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"job_id": {
"name": "job_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"session_id": {
"name": "session_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"error": {
"name": "error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"triggered_at": {
"name": "triggered_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_runs_job_id_idx": {
"name": "scheduler_runs_job_id_idx",
"columns": [
{
"expression": "job_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_runs_session_id_idx": {
"name": "scheduler_runs_session_id_idx",
"columns": [
{
"expression": "session_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
+596
View File
@@ -0,0 +1,596 @@
{
"id": "ac54b5f9-a7b6-4ffa-8da1-adab67393980",
"prevId": "ef6bf221-a986-47ea-9dee-a7678df84502",
"version": "7",
"dialect": "postgresql",
"tables": {
"public.rd_experiments": {
"name": "rd_experiments",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"rational": {
"name": "rational",
"type": "text",
"primaryKey": false,
"notNull": true
},
"rational_embedding": {
"name": "rational_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"details": {
"name": "details",
"type": "text",
"primaryKey": false,
"notNull": false
},
"details_embedding": {
"name": "details_embedding",
"type": "vector(384)",
"primaryKey": false,
"notNull": false
},
"evaluation": {
"name": "evaluation",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"evolved_from": {
"name": "evolved_from",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"start_ts": {
"name": "start_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"end_ts": {
"name": "end_ts",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"git_branch": {
"name": "git_branch",
"type": "text",
"primaryKey": false,
"notNull": true
},
"experiment_ref_id": {
"name": "experiment_ref_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"mlruns_dir": {
"name": "mlruns_dir",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'starting'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_experiments_ref_id_idx": {
"name": "rd_experiments_ref_id_idx",
"columns": [
{
"expression": "experiment_ref_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_experiments_evolved_from_idx": {
"name": "rd_experiments_evolved_from_idx",
"columns": [
{
"expression": "evolved_from",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"rd_experiments_evolved_from_rd_experiments_id_fk": {
"name": "rd_experiments_evolved_from_rd_experiments_id_fk",
"tableFrom": "rd_experiments",
"tableTo": "rd_experiments",
"columnsFrom": [
"evolved_from"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.rd_models": {
"name": "rd_models",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"description": {
"name": "description",
"type": "text",
"primaryKey": false,
"notNull": false
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"run_id": {
"name": "run_id",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_path": {
"name": "model_path",
"type": "text",
"primaryKey": false,
"notNull": false
},
"universe": {
"name": "universe",
"type": "text",
"primaryKey": false,
"notNull": false
},
"label": {
"name": "label",
"type": "text",
"primaryKey": false,
"notNull": false
},
"default_strategy": {
"name": "default_strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"metrics": {
"name": "metrics",
"type": "jsonb",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"rd_models_run_id_idx": {
"name": "rd_models_run_id_idx",
"columns": [
{
"expression": "run_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"rd_models_name_idx": {
"name": "rd_models_name_idx",
"columns": [
{
"expression": "name",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {
"rd_models_name_unique": {
"name": "rd_models_name_unique",
"nullsNotDistinct": false,
"columns": [
"name"
]
}
},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_jobs": {
"name": "scheduler_jobs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'new-york'"
},
"timezone": {
"name": "timezone",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'America/New_York'"
},
"time": {
"name": "time",
"type": "text",
"primaryKey": false,
"notNull": true
},
"days": {
"name": "days",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'1,2,3,4,5'"
},
"experiment_name": {
"name": "experiment_name",
"type": "text",
"primaryKey": false,
"notNull": false
},
"run_id": {
"name": "run_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"last_run_at": {
"name": "last_run_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": false
},
"last_status": {
"name": "last_status",
"type": "text",
"primaryKey": false,
"notNull": false
},
"last_error": {
"name": "last_error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"updated_at": {
"name": "updated_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_jobs_model_id_idx": {
"name": "scheduler_jobs_model_id_idx",
"columns": [
{
"expression": "model_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_jobs_enabled_idx": {
"name": "scheduler_jobs_enabled_idx",
"columns": [
{
"expression": "enabled",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {
"scheduler_jobs_model_id_rd_models_id_fk": {
"name": "scheduler_jobs_model_id_rd_models_id_fk",
"tableFrom": "scheduler_jobs",
"tableTo": "rd_models",
"columnsFrom": [
"model_id"
],
"columnsTo": [
"id"
],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.scheduler_runs": {
"name": "scheduler_runs",
"schema": "",
"columns": {
"id": {
"name": "id",
"type": "bigserial",
"primaryKey": true,
"notNull": true
},
"job_id": {
"name": "job_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"city": {
"name": "city",
"type": "text",
"primaryKey": false,
"notNull": true
},
"model_id": {
"name": "model_id",
"type": "bigint",
"primaryKey": false,
"notNull": false
},
"strategy": {
"name": "strategy",
"type": "text",
"primaryKey": false,
"notNull": false
},
"title": {
"name": "title",
"type": "text",
"primaryKey": false,
"notNull": true
},
"session_id": {
"name": "session_id",
"type": "text",
"primaryKey": false,
"notNull": false
},
"status": {
"name": "status",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'pending'"
},
"error": {
"name": "error",
"type": "text",
"primaryKey": false,
"notNull": false
},
"source": {
"name": "source",
"type": "text",
"primaryKey": false,
"notNull": true,
"default": "'scheduled'"
},
"triggered_at": {
"name": "triggered_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
},
"created_at": {
"name": "created_at",
"type": "timestamp with time zone",
"primaryKey": false,
"notNull": true,
"default": "now()"
}
},
"indexes": {
"scheduler_runs_job_id_idx": {
"name": "scheduler_runs_job_id_idx",
"columns": [
{
"expression": "job_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
},
"scheduler_runs_session_id_idx": {
"name": "scheduler_runs_session_id_idx",
"columns": [
{
"expression": "session_id",
"isExpression": false,
"asc": true,
"nulls": "last"
}
],
"isUnique": false,
"concurrently": false,
"method": "btree",
"with": {}
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {},
"schemas": {},
"sequences": {},
"roles": {},
"policies": {},
"views": {},
"_meta": {
"columns": {},
"schemas": {},
"tables": {}
}
}
File diff suppressed because it is too large Load Diff
+55
View File
@@ -0,0 +1,55 @@
{
"version": "7",
"dialect": "postgresql",
"entries": [
{
"idx": 0,
"version": "7",
"when": 1786550810655,
"tag": "0000_dizzy_mister_fear",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1786598670922,
"tag": "0001_models_and_scheduler",
"breakpoints": true
},
{
"idx": 2,
"version": "7",
"when": 1786608356247,
"tag": "0002_even_mister_sinister",
"breakpoints": true
},
{
"idx": 3,
"version": "7",
"when": 1786609840569,
"tag": "0003_large_lifeguard",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1786691576848,
"tag": "0004_mature_pepper_potts",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1786792501818,
"tag": "0005_trading-round-book",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1786881100668,
"tag": "0006_rd_experiments_session_id",
"breakpoints": true
}
]
}
+59
View File
@@ -0,0 +1,59 @@
import { existsSync, readFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const workspaceRoot = path.resolve(__dirname, "..");
// Load the single repo-root `.env` into process.env for dev/build/start.
//
// This must live in next.config (not `node --env-file=...`): Next forwards the
// original node CLI flags to its worker processes via NODE_OPTIONS, where
// `--env-file`/`--env-file-if-exists` are rejected. process.env set here is
// inherited by the server workers instead.
//
// Existing process env always wins (e.g. Coolify or `docker --env-file`), and
// unknown keys (e.g. SERVER_TLS) are loaded too so the runtime entrypoint and
// the rest of the app can read them.
const envPath = path.join(workspaceRoot, ".env");
if (existsSync(envPath)) {
for (const raw of readFileSync(envPath, "utf8").split("\n")) {
const line = raw.trim();
if (!line || line.startsWith("#")) continue;
const eq = line.indexOf("=");
if (eq === -1) continue;
const key = line.slice(0, eq).trim();
let value = line.slice(eq + 1).trim();
if (
(value.startsWith('"') && value.endsWith('"')) ||
(value.startsWith("'") && value.endsWith("'"))
) {
value = value.slice(1, -1);
}
if (key && !(key in process.env)) {
process.env[key] = value;
}
}
}
/** @type {import('next').NextConfig} */
const nextConfig = {
reactCompiler: true,
// Keep the pure-JS Postgres driver external so Turbopack doesn't re-bundle it.
serverExternalPackages: ["pg"],
compiler: {
removeConsole: process.env.NODE_ENV === "production",
},
// Allow LAN / custom host access (e.g. http://h.lizhao.net:3000) in `next dev`.
allowedDevOrigins: ["h.lizhao.net", "tradeac-dev.h.lizhao.net"],
experimental: {
serverActions: {
allowedOrigins: ["h.lizhao.net", "tradeac-dev.h.lizhao.net", "localhost", "127.0.0.1"],
},
},
turbopack: {
root: workspaceRoot,
},
};
export default nextConfig;
+97
View File
@@ -0,0 +1,97 @@
{
"name": "studio-admin",
"version": "2.2.0",
"private": true,
"scripts": {
"build:engine": "cargo build --release --locked --manifest-path ../tac-engine/Cargo.toml --target-dir ../tac-engine/target",
"build:engine:dev": "cargo build --release --locked --manifest-path ../tac-engine/Cargo.toml --target-dir ../tac-engine/target",
"engine:ensure": "node scripts/ensure-engine.mjs",
"dev": "pnpm engine:ensure && next dev --experimental-https",
"build": "pnpm build:engine && next build",
"start": "next start",
"lint": "biome lint",
"format": "biome format --write",
"check": "biome check",
"check:fix": "biome check --write",
"prepare": "husky",
"generate:presets": "ts-node -P tsconfig.scripts.json src/scripts/generate-theme-presets.ts"
},
"lint-staged": {
"*.{js,ts,jsx,tsx}": [
"biome check --write --no-errors-on-unmatched"
]
},
"dependencies": {
"@assistant-ui/react": "^0.15.4",
"@assistant-ui/react-markdown": "^0.14.8",
"@assistant-ui/react-opencode": "^0.2.17",
"@base-ui/react": "^1.6.0",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/modifiers": "^9.0.0",
"@dnd-kit/sortable": "^10.0.0",
"@fullcalendar/react": "^7.0.2",
"@gitgraph/react": "^1.6.0",
"@hookform/resolvers": "^5.7.1",
"@opencode-ai/sdk": "^1.18.14",
"@shadcn/react": "^0.1.0",
"@tanstack/react-table": "^8.21.3",
"@vercel/analytics": "^2.0.1",
"@xyflow/react": "^12.11.3",
"better-auth": "^1.6.25",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"d3-geo": "^3.1.1",
"date-fns": "^4.4.0",
"drizzle-orm": "^0.45.2",
"echarts": "^6.1.0",
"echarts-for-react": "^3.0.6",
"embla-carousel-react": "^8.6.0",
"geist": "^1.7.2",
"input-otp": "^1.4.2",
"kysely": "^0.29.4",
"lucide-react": "^1.28.0",
"next": "^16.2.12",
"next-themes": "^0.4.6",
"pg": "^8.22.0",
"radix-ui": "^1.6.7",
"react": "^19.2.8",
"react-day-picker": "^10.0.1",
"react-dom": "^19.2.8",
"react-hook-form": "^7.84.0",
"react-markdown": "^10.1.0",
"react-resizable-panels": "^4.12.2",
"recharts": "^3.8.0",
"remark-gfm": "^4.0.1",
"shadcn": "^4.16.1",
"simple-icons": "^16.28.0",
"sonner": "^2.0.7",
"tailwind-merge": "^3.6.0",
"temporal-polyfill": "^1.0.3",
"topojson-client": "^3.1.0",
"tw-shimmer": "^0.4.12",
"vaul": "^1.1.2",
"yaml": "^2.9.0",
"zod": "^4.4.3",
"zustand": "^5.0.14"
},
"devDependencies": {
"@biomejs/biome": "^2.5.6",
"@tailwindcss/postcss": "^4.3.3",
"@types/d3-geo": "^3.1.1",
"@types/node": "^22.20.1",
"@types/pg": "^8.20.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.4",
"@types/topojson-client": "^3.1.5",
"babel-plugin-react-compiler": "^1.0.0",
"drizzle-kit": "^0.31.10",
"husky": "^9.1.7",
"lint-staged": "^16.4.0",
"postcss": "^8.5.25",
"tailwindcss": "^4.1.5",
"ts-node": "^10.9.2",
"tw-animate-css": "^1.4.0",
"typescript": "^5.9.3"
}
}