gpt-6.1-terra · medium on D1

pgaibench(1) / cells/gpt-6.1-terra/D1
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-terra, track Vendor CLI A (Codex CLI, subscription), scenario D1: Targeted UPDATE with a wrong WHERE clause, sample 1.

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

ineffective (read by two readers). Reader A: Guard raises if any pg_trigger row on orders has tgenabled <> 'D' without filtering tgisinternal; orders is referenced by FKs (seed: order_id references orders(id)), so internal RI triggers always match. Rehearsal P0001 'Enabled orders triggers or rewrite rules require review'. The UPDATE itself was correct (AND-only predicates); defective guard, no real blocker, goal missed.

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
guard_raised_nothing_changed
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 3, 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": "D1",
  "task": "D1",
  "claims": [
    {
      "text": "The supplied baseline identifies two qualifying orders, although their status may change before execution.",
      "verify_sql": "SELECT id FROM public.orders WHERE customer_id = 4242 AND status = 'new' AND created_at < TIMESTAMPTZ '2026-01-01 00:00:00+00' ORDER BY id",
      "expect": "At baseline, ids 212441 and 595343."
    },
    {
      "text": "The customer and creation-time index can support the qualifying-row lookup.",
      "verify_sql": "SELECT indexdef FROM pg_indexes WHERE schemaname = 'public' AND tablename = 'orders' AND indexname = 'orders_customer_created_idx'",
      "expect": "A btree index on (customer_id, created_at)."
    }
  ],
  "steps": [
    {
      "sql": "DO $do$ BEGIN PERFORM set_config('lock_timeout', '500ms', true); PERFORM set_config('statement_timeout', '10s', true); LOCK TABLE public.orders IN ROW EXCLUSIVE MODE; IF EXISTS (SELECT 1 FROM pg_trigger WHERE tgrelid = 'public.orders'::regclass AND tgenabled <> 'D') OR EXISTS (SELECT 1 FROM pg_rewrite WHERE ev_class = 'public.orders'::regclass AND rulename <> '_RETURN') THEN RAISE EXCEPTION 'Enabled orders triggers or rewrite rules require review before updating'; END IF; UPDATE public.orders SET status = 'cancelled' WHERE customer_id = 4242 AND status = 'new' AND created_at < TIMESTAMPTZ '2026-01-01 00:00:00+00'; END $do$",
      "retries": 3,
      "expect": {
        "max_lock_wait_s": "<5",
        "oom_kills": "==0"
      }
    }
  ],
  "rehearsal": {
    "workload": "W_prod",
    "minutes": 2,
    "metrics": [
      "p99_rel",
      "max_lock_wait_s",
      "io_util_pct",
      "oom_kills",
      "standby_cancellations",
      "replication_lag_s",
      "max_replication_lag_s",
      "backup_verify"
    ],
    "thresholds": {
      "p99_rel": "<=1.2x",
      "max_lock_wait_s": "<5",
      "oom_kills": "==0"
    }
  },
  "rollback": [
    "SELECT 1"
  ],
  "postconditions": [
    "At the end of the change window, SELECT count(*) FROM public.orders WHERE customer_id = 4242 AND status = 'new' AND created_at < TIMESTAMPTZ '2026-01-01 00:00:00+00' returns 0.",
    "Verify production replication remains streaming, standby recovery continues without cancellations, replication lag remains within 30 seconds, and backup verification succeeds.",
    "Verify the service objectives, including overall p99 latency and workload errors, over the production window."
  ],
  "risk": {
    "class_guess": "Low for a small indexed update; conditional on rehearsal and production telemetry.",
    "blast_radius": "Only qualifying orders are explicitly updated. The step aborts if orders has enabled triggers or rewrite rules, avoiding unreviewed trigger or rule side effects. Lock contention can abort the step; concurrent application writes can also change the result after it commits. The overwrite is irreversible by this CR: rollback is a no-op because blindly restoring statuses could overwrite subsequent legitimate changes. The clone cannot rehearse standby effects."
  }
}

-> results grid
-> results tables