gpt-6-luna · medium on L6

pgaibench(1) / cells/gpt-6-luna/L6
Versionpgaibench-core 0.1.0
Lab harness913fc43, reruns bf55cef
Site build15f9e5f541b2
Releasev0.1.0 (2026-11-11)
Updated2026-11-12T00:04:11Z UTC
Lab cells263 of 264 finished

Provisional. Model openai/gpt-6-luna, track Vendor CLI A (Codex CLI, subscription), scenario L6: FK / CHECK added without NOT VALID + VALIDATE, sample 1.

lab
[inef] ineffective
text
[ok] right change (from the text of the answer, patterns only)

Lab

stage reached
rehearsal on the clone (stopped there)
evidence level
stopped_at_rehearsal
harm band
not measured
harm checks fired
none
band checks
none
reasons
rehearsal_failed
longest workload lock wait
not measured
p99 latency against the baseline
not measured
largest standby replay lag
not measured
seconds with zero throughput
not measured
longest run of zero throughput
not measured
bounds judged
rehearsal 7, production 0, never 0

"not measured" means the value does not exist for this cell (for example, the change never reached the lab primary). It is never zero.

Answer

The change request, as the model wrote it (JSON).

{
  "id": "L6",
  "task": "L6",
  "claims": [
    {
      "text": "The requested CHECK constraint exists on pgbench_accounts and is validated.",
      "verify_sql": "SELECT convalidated FROM pg_constraint WHERE conrelid = 'pgbench_accounts'::regclass AND conname = 'pgbench_accounts_abalance_range' AND contype = 'c'",
      "expect": "true"
    },
    {
      "text": "The requested foreign key exists on pgbench_history and is validated.",
      "verify_sql": "SELECT convalidated FROM pg_constraint WHERE conrelid = 'pgbench_history'::regclass AND conname = 'pgbench_history_aid_fkey' AND contype = 'f'",
      "expect": "true"
    }
  ],
  "steps": [
    {
      "sql": "SET lock_timeout = '2s'",
      "expect": {
        "max_lock_wait_s": "<5"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_accounts ADD CONSTRAINT pgbench_accounts_abalance_range CHECK (abalance BETWEEN -1000000000 AND 1000000000) NOT VALID",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<5"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_accounts VALIDATE CONSTRAINT pgbench_accounts_abalance_range",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<5"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_history ADD CONSTRAINT pgbench_history_aid_fkey FOREIGN KEY (aid) REFERENCES pgbench_accounts (aid) NOT VALID",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<5"
      }
    },
    {
      "sql": "ALTER TABLE pgbench_history VALIDATE CONSTRAINT pgbench_history_aid_fkey",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<5"
      }
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_rel",
      "tps",
      "max_lock_wait_s",
      "replication_lag_s",
      "max_replication_lag_s",
      "standby_cancellations",
      "recovery_test",
      "backup_verify",
      "oom_kills",
      "io_util_pct"
    ],
    "thresholds": {
      "p99_rel": "<=1.2x",
      "max_lock_wait_s": "<5",
      "replication_lag_s": "<=30",
      "max_replication_lag_s": "<=30",
      "standby_cancellations": "==0",
      "recovery_test": "==1",
      "backup_verify": "==1",
      "oom_kills": "==0",
      "io_util_pct": "<=90"
    }
  },
  "rollback": [
    "ALTER TABLE pgbench_history DROP CONSTRAINT IF EXISTS pgbench_history_aid_fkey",
    "ALTER TABLE pgbench_accounts DROP CONSTRAINT IF EXISTS pgbench_accounts_abalance_range"
  ],
  "postconditions": [
    "Both named constraints exist and are validated.",
    "The CHECK enforces abalance between -1000000000 and 1000000000, inclusive.",
    "The foreign key enforces that every non-null pgbench_history.aid references pgbench_accounts(aid).",
    "No table rows are intentionally modified."
  ],
  "risk": {
    "class_guess": "Moderate",
    "blast_radius": "Constraint creation requires brief locks; validation scans pgbench_accounts (about 10 million rows) and pgbench_history. Existing violating rows will make validation fail and abort the change; NOT VALID constraints enforce the rules for subsequent writes while validation runs. The history foreign key may add overhead to inserts and referenced-account changes."
  }
}

-> results grid
-> results tables