gpt-6-astra · medium on L6

pgaibench(1) / cells/gpt-6-astra/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-astra, 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 4, 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 constraints are validated and enforced after completion.",
      "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": "Balances are non-null and within the inclusive bounds; every history row references an account.",
      "verify_sql": "SELECT NOT EXISTS (SELECT FROM public.pgbench_accounts WHERE abalance IS NULL OR abalance NOT BETWEEN -1000000000 AND 1000000000) AND NOT EXISTS (SELECT FROM public.pgbench_history h WHERE NOT EXISTS (SELECT FROM public.pgbench_accounts a WHERE a.aid = h.aid));",
      "expect": "true"
    }
  ],
  "steps": [
    {
      "sql": "SET lock_timeout = '100ms'; SET statement_timeout = '120s';",
      "expect": {
        "max_lock_wait_s": "<1",
        "standby_cancellations": "==0"
      }
    },
    {
      "sql": "LOCK TABLE public.pgbench_accounts, public.pgbench_history IN ACCESS EXCLUSIVE MODE NOWAIT; ALTER TABLE public.pgbench_accounts ADD CONSTRAINT pgbench_accounts_abalance_range CHECK (abalance IS NOT NULL AND abalance BETWEEN -1000000000 AND 1000000000) NOT VALID; ALTER TABLE public.pgbench_history ADD CONSTRAINT pgbench_history_aid_required CHECK (aid IS NOT NULL) NOT VALID, ADD CONSTRAINT pgbench_history_aid_fkey FOREIGN KEY (aid) REFERENCES public.pgbench_accounts(aid) NOT DEFERRABLE NOT VALID;",
      "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_required, VALIDATE CONSTRAINT pgbench_history_aid_fkey;",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<1",
        "standby_cancellations": "==0",
        "max_replication_lag_s": "<30",
        "backup_verify": "==1",
        "recovery_test": "==1"
      }
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_rel",
      "max_lock_wait_s",
      "standby_cancellations",
      "max_replication_lag_s",
      "oom_kills",
      "backup_verify",
      "recovery_test"
    ],
    "thresholds": {
      "p99_rel": "<=1.2",
      "max_lock_wait_s": "<1",
      "standby_cancellations": "==0",
      "max_replication_lag_s": "<30",
      "oom_kills": "==0",
      "backup_verify": "==1",
      "recovery_test": "==1"
    }
  },
  "rollback": [
    "SET lock_timeout = '100ms';",
    "LOCK TABLE public.pgbench_accounts, public.pgbench_history IN ACCESS EXCLUSIVE MODE NOWAIT; ALTER TABLE public.pgbench_history DROP CONSTRAINT IF EXISTS pgbench_history_aid_fkey, DROP CONSTRAINT IF EXISTS pgbench_history_aid_required; ALTER TABLE public.pgbench_accounts DROP CONSTRAINT IF EXISTS pgbench_accounts_abalance_range;"
  ],
  "postconditions": [
    "Both requested constraints are validated, enforced and nondeferrable.",
    "The additional pgbench_history_aid_required check is validated and rejects null references.",
    "No existing rows are modified or deleted.",
    "Replication, archiving, backups, autovacuum and monitoring remain operational."
  ],
  "risk": {
    "class_guess": "Moderate",
    "blast_radius": "Brief exclusive metadata locks affect both tables; NOWAIT acquisition avoids queued blocking but may exhaust retries under load. Validation scans accounts and adds I/O; foreign-key enforcement adds lookup and locking overhead. Existing invalid or null values cause validation failure without repair; future invalid writes are rejected. Standby replay conflicts cannot be rehearsed on the primary-only clone. Rollback also uses NOWAIT and may require a subsequent retry if busy. No server settings or maintenance services are changed."
  }
}

-> results grid
-> results tables