@cat-factory/node-server 0.18.6 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
1
+ CREATE SCHEMA IF NOT EXISTS "sandbox";
2
+ --> statement-breakpoint
3
+ CREATE TABLE "sandbox"."prompt_versions" (
4
+ "workspace_id" text NOT NULL,
5
+ "id" text NOT NULL,
6
+ "lineage_id" text NOT NULL,
7
+ "agent_kind" text NOT NULL,
8
+ "name" text NOT NULL,
9
+ "origin" text NOT NULL,
10
+ "system_text" text NOT NULL,
11
+ "base_prompt_id" text,
12
+ "version" integer NOT NULL,
13
+ "parent_id" text,
14
+ "labels" text DEFAULT '[]' NOT NULL,
15
+ "created_at" bigint NOT NULL,
16
+ "created_by" text,
17
+ "archived_at" bigint,
18
+ CONSTRAINT "prompt_versions_pkey" PRIMARY KEY("workspace_id","id")
19
+ );
20
+ --> statement-breakpoint
21
+ CREATE TABLE "sandbox"."fixtures" (
22
+ "workspace_id" text NOT NULL,
23
+ "id" text NOT NULL,
24
+ "kind" text NOT NULL,
25
+ "name" text NOT NULL,
26
+ "payload" text,
27
+ "repo_ref" text,
28
+ "objective" text,
29
+ "origin" text NOT NULL,
30
+ "created_at" bigint NOT NULL,
31
+ CONSTRAINT "fixtures_pkey" PRIMARY KEY("workspace_id","id")
32
+ );
33
+ --> statement-breakpoint
34
+ CREATE TABLE "sandbox"."experiments" (
35
+ "workspace_id" text NOT NULL,
36
+ "id" text NOT NULL,
37
+ "name" text NOT NULL,
38
+ "agent_kind" text NOT NULL,
39
+ "judge_model" text NOT NULL,
40
+ "repeats" integer NOT NULL,
41
+ "status" text NOT NULL,
42
+ "matrix" text NOT NULL,
43
+ "budget_tokens" bigint,
44
+ "created_at" bigint NOT NULL,
45
+ "created_by" text,
46
+ CONSTRAINT "experiments_pkey" PRIMARY KEY("workspace_id","id")
47
+ );
48
+ --> statement-breakpoint
49
+ CREATE TABLE "sandbox"."runs" (
50
+ "workspace_id" text NOT NULL,
51
+ "id" text NOT NULL,
52
+ "experiment_id" text NOT NULL,
53
+ "prompt_version_id" text NOT NULL,
54
+ "model" text NOT NULL,
55
+ "fixture_id" text NOT NULL,
56
+ "repeat_index" integer NOT NULL,
57
+ "status" text NOT NULL,
58
+ "output_text" text,
59
+ "usage" text,
60
+ "latency_ms" integer,
61
+ "branch" text,
62
+ "pr_url" text,
63
+ "diff" text,
64
+ "error" text,
65
+ "seed_sha" text,
66
+ "prompt_label" text NOT NULL,
67
+ "started_at" bigint,
68
+ "finished_at" bigint,
69
+ CONSTRAINT "runs_pkey" PRIMARY KEY("workspace_id","id")
70
+ );
71
+ --> statement-breakpoint
72
+ CREATE TABLE "sandbox"."grades" (
73
+ "workspace_id" text NOT NULL,
74
+ "id" text NOT NULL,
75
+ "run_id" text NOT NULL,
76
+ "judge_model" text NOT NULL,
77
+ "scores" text DEFAULT '[]' NOT NULL,
78
+ "weighted_total" double precision NOT NULL,
79
+ "objective" text,
80
+ "created_at" bigint NOT NULL,
81
+ CONSTRAINT "grades_pkey" PRIMARY KEY("workspace_id","id")
82
+ );
83
+ --> statement-breakpoint
84
+ CREATE INDEX "idx_sandbox_prompts_kind" ON "sandbox"."prompt_versions" USING btree ("workspace_id","agent_kind");
85
+ --> statement-breakpoint
86
+ CREATE INDEX "idx_sandbox_runs_experiment" ON "sandbox"."runs" USING btree ("workspace_id","experiment_id");
87
+ --> statement-breakpoint
88
+ CREATE INDEX "idx_sandbox_runs_queued" ON "sandbox"."runs" USING btree ("workspace_id","experiment_id","status");
89
+ --> statement-breakpoint
90
+ CREATE INDEX "idx_sandbox_grades_run" ON "sandbox"."grades" USING btree ("workspace_id","run_id");