@axiom-lattice/pg-stores 2.0.2 → 2.0.4

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.
package/dist/index.mjs CHANGED
@@ -3816,6 +3816,9 @@ var createEvalRunsTable = {
3816
3816
  failed_cases INTEGER NOT NULL DEFAULT 0,
3817
3817
  avg_score FLOAT NOT NULL DEFAULT 0,
3818
3818
  error TEXT,
3819
+ holdout BOOLEAN NOT NULL DEFAULT FALSE,
3820
+ env_project_id TEXT,
3821
+ env_workspace_id TEXT,
3819
3822
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
3820
3823
  started_at TIMESTAMPTZ,
3821
3824
  completed_at TIMESTAMPTZ
@@ -3882,12 +3885,47 @@ var createEvalRunResultsTable = {
3882
3885
  await client.query("DROP TABLE IF EXISTS lattice_eval_run_results");
3883
3886
  }
3884
3887
  };
3888
+ var addHoldoutToEvalRuns = {
3889
+ version: 109,
3890
+ name: "add_holdout_to_eval_runs",
3891
+ up: async (client) => {
3892
+ await client.query(`
3893
+ ALTER TABLE lattice_eval_runs
3894
+ ADD COLUMN IF NOT EXISTS holdout BOOLEAN NOT NULL DEFAULT FALSE
3895
+ `);
3896
+ },
3897
+ down: async (client) => {
3898
+ await client.query(`
3899
+ ALTER TABLE lattice_eval_runs DROP COLUMN IF EXISTS holdout
3900
+ `);
3901
+ }
3902
+ };
3903
+ var addEnvToEvalRuns = {
3904
+ version: 110,
3905
+ name: "add_env_to_eval_runs",
3906
+ up: async (client) => {
3907
+ await client.query(`
3908
+ ALTER TABLE lattice_eval_runs
3909
+ ADD COLUMN IF NOT EXISTS env_project_id TEXT,
3910
+ ADD COLUMN IF NOT EXISTS env_workspace_id TEXT
3911
+ `);
3912
+ },
3913
+ down: async (client) => {
3914
+ await client.query(`
3915
+ ALTER TABLE lattice_eval_runs
3916
+ DROP COLUMN IF EXISTS env_project_id,
3917
+ DROP COLUMN IF EXISTS env_workspace_id
3918
+ `);
3919
+ }
3920
+ };
3885
3921
  var evalMigrations = [
3886
3922
  createEvalProjectsTable,
3887
3923
  createEvalSuitesTable,
3888
3924
  createEvalCasesTable,
3889
3925
  createEvalRunsTable,
3890
- createEvalRunResultsTable
3926
+ createEvalRunResultsTable,
3927
+ addHoldoutToEvalRuns,
3928
+ addEnvToEvalRuns
3891
3929
  ];
3892
3930
 
3893
3931
  // src/stores/PostgreSQLEvalStore.ts
@@ -4010,6 +4048,9 @@ var PostgreSQLEvalStore = class {
4010
4048
  failedCases: row.failed_cases ?? 0,
4011
4049
  avgScore: row.avg_score ?? 0,
4012
4050
  error: row.error,
4051
+ holdout: row.holdout,
4052
+ envProjectId: row.env_project_id,
4053
+ envWorkspaceId: row.env_workspace_id,
4013
4054
  createdAt: new Date(row.created_at),
4014
4055
  startedAt: row.started_at ? new Date(row.started_at) : void 0,
4015
4056
  completedAt: row.completed_at ? new Date(row.completed_at) : void 0
@@ -4371,7 +4412,7 @@ var PostgreSQLEvalStore = class {
4371
4412
  `SELECT id, project_id, tenant_id,
4372
4413
  status, concurrency, total_cases,
4373
4414
  passed_cases, failed_cases, avg_score,
4374
- error, created_at, started_at, completed_at
4415
+ error, holdout, env_project_id, env_workspace_id, created_at, started_at, completed_at
4375
4416
  FROM lattice_eval_runs
4376
4417
  WHERE ${conditions.join(" AND ")}
4377
4418
  ORDER BY created_at DESC`,
@@ -4386,7 +4427,7 @@ var PostgreSQLEvalStore = class {
4386
4427
  `SELECT id, project_id, tenant_id,
4387
4428
  status, concurrency, total_cases,
4388
4429
  passed_cases, failed_cases, avg_score,
4389
- error, created_at, started_at, completed_at
4430
+ error, holdout, env_project_id, env_workspace_id, created_at, started_at, completed_at
4390
4431
  FROM lattice_eval_runs
4391
4432
  WHERE id = $1 AND tenant_id = $2`,
4392
4433
  [id, tenantId]
@@ -4399,12 +4440,12 @@ var PostgreSQLEvalStore = class {
4399
4440
  const actualId = id || uuidv4();
4400
4441
  const { rows } = await this.pool.query(
4401
4442
  `INSERT INTO lattice_eval_runs
4402
- (id, project_id, tenant_id, status, concurrency, total_cases, passed_cases, failed_cases, avg_score, started_at)
4403
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
4443
+ (id, project_id, tenant_id, status, concurrency, total_cases, passed_cases, failed_cases, avg_score, holdout, env_project_id, env_workspace_id, started_at)
4444
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
4404
4445
  RETURNING id, project_id, tenant_id,
4405
4446
  status, concurrency, total_cases,
4406
4447
  passed_cases, failed_cases, avg_score,
4407
- error, created_at, started_at, completed_at`,
4448
+ error, holdout, env_project_id, env_workspace_id, created_at, started_at, completed_at`,
4408
4449
  [
4409
4450
  actualId,
4410
4451
  projectId,
@@ -4415,6 +4456,9 @@ var PostgreSQLEvalStore = class {
4415
4456
  0,
4416
4457
  0,
4417
4458
  0,
4459
+ data.holdout ?? false,
4460
+ data.envProjectId || null,
4461
+ data.envWorkspaceId || null,
4418
4462
  /* @__PURE__ */ new Date()
4419
4463
  ]
4420
4464
  );
@@ -4458,7 +4502,7 @@ var PostgreSQLEvalStore = class {
4458
4502
  RETURNING id, project_id, tenant_id,
4459
4503
  status, concurrency, total_cases,
4460
4504
  passed_cases, failed_cases, avg_score,
4461
- error, created_at, started_at, completed_at`,
4505
+ error, holdout, env_project_id, env_workspace_id, created_at, started_at, completed_at`,
4462
4506
  vals
4463
4507
  );
4464
4508
  return rows.length ? this.mapRowToRun(rows[0]) : null;
@@ -8415,7 +8459,9 @@ export {
8415
8459
  PostgresSharedResourceStore,
8416
8460
  ThreadMessageQueueStore,
8417
8461
  addAssistantTenantId,
8462
+ addEnvToEvalRuns,
8418
8463
  addFileContentType,
8464
+ addHoldoutToEvalRuns,
8419
8465
  addProjectConfigColumn,
8420
8466
  addScheduleTenantId,
8421
8467
  addSkillTenantId,