gpt-6.1-sol · medium on L6

pgaibench(1) / cells/gpt-6.1-sol/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.1-sol, 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 5, 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": "Both requested constraints are validated and enforced.",
      "verify_sql": "SELECT count(*) = 2 AND bool_and(convalidated AND conenforced AND NOT condeferrable) FROM pg_constraint WHERE (conrelid = 'public.pgbench_accounts'::regclass AND conname = 'pgbench_accounts_abalance_range' AND contype = 'c') OR (conrelid = 'public.pgbench_history'::regclass AND conname = 'pgbench_history_aid_fkey' AND contype = 'f');",
      "expect": "true"
    },
    {
      "text": "Constraint definitions implement the requested balance range and account reference.",
      "verify_sql": "SELECT conname, pg_get_constraintdef(oid) FROM pg_constraint WHERE (conrelid = 'public.pgbench_accounts'::regclass AND conname = 'pgbench_accounts_abalance_range') OR (conrelid = 'public.pgbench_history'::regclass AND conname = 'pgbench_history_aid_fkey') ORDER BY conname;",
      "expect": "pgbench_accounts_abalance_range: CHECK (((abalance >= '-1000000000'::integer) AND (abalance <= 1000000000))); pgbench_history_aid_fkey: FOREIGN KEY (aid) REFERENCES pgbench_accounts(aid)"
    }
  ],
  "steps": [
    {
      "sql": "SET lock_timeout = '500ms'; SET statement_timeout = '90s';",
      "expect": {}
    },
    {
      "sql": "DO $$ BEGIN LOCK TABLE public.pgbench_accounts IN ACCESS EXCLUSIVE MODE NOWAIT; LOCK TABLE public.pgbench_history IN SHARE ROW EXCLUSIVE MODE NOWAIT; ALTER TABLE public.pgbench_accounts ADD CONSTRAINT pgbench_accounts_abalance_range CHECK (abalance >= -1000000000 AND abalance <= 1000000000) NOT VALID; ALTER TABLE public.pgbench_history ADD CONSTRAINT pgbench_history_aid_fkey FOREIGN KEY (aid) REFERENCES public.pgbench_accounts(aid) NOT DEFERRABLE NOT VALID; END $$;",
      "retries": 10,
      "expect": {
        "max_lock_wait_s": "<1",
        "standby_cancellations": "==0",
        "max_replication_lag_s": "<30"
      }
    },
    {
      "sql": "ALTER TABLE public.pgbench_accounts VALIDATE CONSTRAINT pgbench_accounts_abalance_range;",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<1",
        "standby_cancellations": "==0",
        "max_replication_lag_s": "<30",
        "oom_kills": "==0"
      }
    },
    {
      "sql": "ALTER TABLE public.pgbench_history VALIDATE CONSTRAINT pgbench_history_aid_fkey;",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<1",
        "standby_cancellations": "==0",
        "max_replication_lag_s": "<30"
      }
    },
    {
      "sql": "DO $$ BEGIN IF (SELECT count(*) FROM pg_constraint WHERE convalidated AND conenforced AND NOT condeferrable AND ((conrelid = 'public.pgbench_accounts'::regclass AND conname = 'pgbench_accounts_abalance_range' AND contype = 'c') OR (conrelid = 'public.pgbench_history'::regclass AND conname = 'pgbench_history_aid_fkey' AND contype = 'f'))) <> 2 THEN RAISE EXCEPTION 'Requested constraints are not both validated and enforced'; END IF; END $$;",
      "expect": {
        "standby_cancellations": "==0",
        "max_replication_lag_s": "<30",
        "backup_verify": "==1"
      }
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_rel",
      "tps",
      "max_lock_wait_s",
      "io_util_pct",
      "oom_kills",
      "standby_cancellations",
      "max_replication_lag_s",
      "backup_verify"
    ],
    "thresholds": {
      "p99_rel": "<=1.2",
      "tps": ">=0.9x",
      "max_lock_wait_s": "<1",
      "io_util_pct": "<=90",
      "oom_kills": "==0",
      "standby_cancellations": "==0",
      "max_replication_lag_s": "<30",
      "backup_verify": "==1"
    }
  },
  "rollback": [
    "SET lock_timeout = '500ms';",
    "ALTER TABLE public.pgbench_history DROP CONSTRAINT IF EXISTS pgbench_history_aid_fkey;",
    "ALTER TABLE public.pgbench_accounts DROP CONSTRAINT IF EXISTS pgbench_accounts_abalance_range;"
  ],
  "postconditions": [
    "Both requested constraints are validated, enforced, and nondeferrable.",
    "No application rows are modified by this CR.",
    "Replication, backups, WAL archiving, autovacuum, and monitoring remain operational."
  ],
  "risk": {
    "class_guess": "Moderate",
    "blast_radius": "Brief DDL locks affect accounts and history; NOWAIT avoids queued acquisition during installation. Validation scans accounts and adds I/O pressure; foreign-key enforcement adds lookup and locking overhead. Existing violations abort validation without repairing rows. Newly attempted invalid writes will be rejected. Clone rehearsal cannot establish standby safety: replayed DDL can delay standby reads or cause recovery conflicts. Rollback requires brief exclusive locks and can fail its bounded lock timeout under contention. No server settings or stored values are changed."
  }
}

-> results grid
-> results tables