Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions bench/accuracy/experiments/output-row-contract/bird-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"benchmark": "BIRD Mini-Dev SQLite 500 (2026-10-25)",
"upstream_commit": "5b256b5a9c17478f06ed6912612e9a14d17065c8",
"question_file_sha256": "926af2a0d1b47e5d0d15a7aa8a34d4721007f4550a881555b6a89496b54a2606",
"evaluator_sha256": "da1bbcd4530be83692d7c650c814ea9704bb710d0c953eb75d02ccb38233cf89",
"cases": [
{
"instance_id": "bird146",
"db": "codebase_community",
"question": "For each month of 2010, how many posts that have no more than two answers received a link during that month? A month with none counts as zero. Give me the average across all twelve months of 2010, rounded to two decimals.",
"evidence": "A link is a recorded connection that associates one post with another post of the site."
}
],
"db_sha256": {
"california_schools": "c0903eec662e63068fd1d14403d3d6c1d473287fc10c4356333ea58f878db983",
"card_games": "c98bdb57fe7474da798b407785544b9af0daaad5d61fd21e2a73309493bc1227",
"codebase_community": "92101be6d2a9f6adceea59d38f6d1c556087f9eea1432432a21268cb1348036d",
"debit_card_specializing": "b3d149ad05746dbbe5116e229e17e18f09c39db43cf117d9ef3441753608b691",
"european_football_2": "f72f5c9b990371417288a67b27a02e601ef904d45525c2c9f7931fb01001c536",
"financial": "d15d89cdb068a202b6f2b99342af44dffc1d52545b39ceaf62efdc0ba570101e",
"formula_1": "79770caf966707e35516fa566e24b40ae515c74ec1ec4631235245645b87b24d",
"student_club": "eb89bcfe97eefa386a27904ec5aa15159811a7eac894ec659a36e48fa9f76b77",
"superhero": "75e94a2c3236ee3bb2c01fb97a1c4b4c1c269bcefd4eab1d04be323d2d0825b1",
"thrombosis_prediction": "87583183c3dc472fba04de702965560a9d7c0a548836613f242317e0eeb83f00",
"toxicology": "4df4094208e0799d5e5f0e2b5bc5c415cf87b1208ebaf8f4c14c7af445b682c5"
},
"suite": "bird",
"development_ids": [
"bird146"
],
"holdout_ids": [],
"split_seed": 20261126
}
18 changes: 18 additions & 0 deletions bench/accuracy/experiments/output-row-contract/protocol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"purpose": "Test adoption of deterministic optional output cardinality checks before changing generation prompts",
"source": "/Users/seyoung/workspace/benchmarks/codex-mcp-integrated-pilot-backlog-20261127/bird-gpt-6.2-astra",
"ids": [
"bird146"
],
"model": "gpt-6.2-astra",
"reasoning_effort": "high",
"change": "RunSQL expected_rows optional contract; common output validation/audit/rendering and existing SQL execution reused. BASE_INSTRUCTIONS unchanged.",
"inference": "Fresh original question/evidence/schema only, no previous answer, reference, expected row count supplied by harness, analyst SQL or diagnosis. The model must select its own declared contract.",
"limits": [
"The declared row count does not prove correct question interpretation.",
"Join endpoint remains a separate semantic failure, so correcting cardinality alone may not repair official score.",
"Tool-only adoption probe, selected failure only; no full accuracy claim.",
"Checks apply to executed SQL after safety, not uncapped source table count."
],
"source_record_sha256": "dcf47fd031fe145c591b707797ccb9a15d5ecc38abc8403087015c30e53017f8"
}
11 changes: 11 additions & 0 deletions bench/accuracy/mcp-review-results/duration-output/analysis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"official_transition": [
0,
1
],
"case": "bird278",
"observation": "Final SQL orders/filters by milliseconds while projecting original duration text, retaining both tied winners. No type coercion in evaluator.",
"inference": "Identical original prompt bytes; no previous SQL/reference/grade/offline diagnosis supplied.",
"scope": "Integrated candidate0d7be046, no new code/prompt changes for this test. Multiple prior fixes mean not single-change causal attribution. Selected repair, not full accuracy.",
"checkpoint": "Original overlapping checkpoint008 remains230/239; repair is not substituted into its score."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```sql
WITH september_stops AS (
SELECT p.driverId, p.duration, p.milliseconds, r.name AS race_name, r.circuitId,
MIN(p.milliseconds) OVER () AS fastest_ms
FROM pitStops AS p
JOIN races AS r ON r.raceId = p.raceId
WHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'
)
SELECT d.forename || ' ' || d.surname AS driver_name,
s.duration AS pit_stop_time,
s.race_name,
c.name AS circuit_name,
c.location AS circuit_location
FROM september_stops AS s
JOIN drivers AS d ON d.driverId = s.driverId
JOIN circuits AS c ON c.circuitId = s.circuitId
WHERE s.milliseconds = s.fastest_ms
LIMIT 1000
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{"type":"thread.started","thread_id":"01a219f5-bbcf-75a1-896a-aaf923625b70"}
{"type":"turn.started"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"I’ll check how elapsed pit stop time is stored, then run the September query and verify whether any stops tied for fastest."}}
{"type":"item.started","item":{"id":"item_1","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"races"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_1","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"races"},"result":{"content":[{"type":"text","text":"races (table)\n- raceId: INTEGER\n- year: INTEGER NOT NULL\n- round: INTEGER NOT NULL\n- circuitId: INTEGER NOT NULL\n- name: TEXT NOT NULL\n- date: DATE NOT NULL\n- time: TEXT\n- url: TEXT\nPRIMARY KEY (raceId)\nFOREIGN KEY (year) REFERENCES seasons (year)\nFOREIGN KEY (circuitId) REFERENCES circuits (circuitId)"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_2","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_2","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"SNQ5dzLmMatjB7RU82JtadqoEgbbLL7uhpZwfliVqVA\", \"definitions\": [], \"instruction\": \"For oracle_view the operator has confirmed the contract: call run_sql with this definition_check_id, period_start and exclusive period_end, without sql. An explicit calendar year/month is sufficient to derive these dates. Ask only if the period or business meaning is actually unclear. For text definitions use SQL. Discover schema and use qualified table names before run_sql. A receipt is not proof of SQL semantic correctness.\"}"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"pitStops"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"pitStops"},"result":{"content":[{"type":"text","text":"pitStops (table)\n- raceId: INTEGER NOT NULL\n- driverId: INTEGER NOT NULL\n- stop: INTEGER NOT NULL\n- lap: INTEGER NOT NULL\n- time: TEXT NOT NULL\n- duration: TEXT\n- milliseconds: INTEGER\nPRIMARY KEY (raceId, driverId, stop)\nFOREIGN KEY (raceId) REFERENCES races (raceId)\nFOREIGN KEY (driverId) REFERENCES drivers (driverId)"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_4","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"circuits"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_4","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"circuits"},"result":{"content":[{"type":"text","text":"circuits (table)\n- circuitId: INTEGER\n- circuitRef: TEXT NOT NULL\n- name: TEXT NOT NULL\n- location: TEXT\n- country: TEXT\n- lat: REAL\n- lng: REAL\n- alt: INTEGER\n- url: TEXT NOT NULL\nPRIMARY KEY (circuitId)"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_5","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"drivers"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_5","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"drivers"},"result":{"content":[{"type":"text","text":"drivers (table)\n- driverId: INTEGER\n- driverRef: TEXT NOT NULL\n- number: INTEGER\n- code: TEXT\n- forename: TEXT NOT NULL\n- surname: TEXT NOT NULL\n- dob: DATE\n- nationality: TEXT\n- url: TEXT NOT NULL\nPRIMARY KEY (driverId)"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_6","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"SNQ5dzLmMatjB7RU82JtadqoEgbbLL7uhpZwfliVqVA","sql":"SELECT r.date, typeof(p.milliseconds) AS storage_type, COUNT(*) AS stops,\n COUNT(d.driverId) AS matched_drivers, COUNT(c.circuitId) AS matched_circuits,\n COUNT(p.duration) AS durations, MIN(p.milliseconds) AS fastest_ms\nFROM races AS r\nJOIN pitStops AS p ON p.raceId = r.raceId\nLEFT JOIN drivers AS d ON d.driverId = p.driverId\nLEFT JOIN circuits AS c ON c.circuitId = r.circuitId\nWHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'\nGROUP BY r.date, typeof(p.milliseconds)"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_6","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"SNQ5dzLmMatjB7RU82JtadqoEgbbLL7uhpZwfliVqVA","sql":"SELECT r.date, typeof(p.milliseconds) AS storage_type, COUNT(*) AS stops,\n COUNT(d.driverId) AS matched_drivers, COUNT(c.circuitId) AS matched_circuits,\n COUNT(p.duration) AS durations, MIN(p.milliseconds) AS fastest_ms\nFROM races AS r\nJOIN pitStops AS p ON p.raceId = r.raceId\nLEFT JOIN drivers AS d ON d.driverId = p.driverId\nLEFT JOIN circuits AS c ON c.circuitId = r.circuitId\nWHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'\nGROUP BY r.date, typeof(p.milliseconds)"},"result":{"content":[{"type":"text","text":"2 row(s):\nResult coverage: fetched_rows=2; displayed_rows=2; fetch_truncated=false; display_truncated=false; sql_rewritten=true; query_timeout_enforced=true; query_timeout_scope=sqlite_vm. Counts refer to the executed SQL, not the source table size.\nObserved value types (displayed rows): date=str; storage_type=str; stops=int; matched_drivers=int; matched_circuits=int; durations=int; fastest_ms=int\ndate | storage_type | stops | matched_drivers | matched_circuits | durations | fastest_ms\n--- | --- | --- | --- | --- | --- | ---\n2016-09-04 | integer | 39 | 39 | 39 | 39 | 23633\n2016-09-18 | integer | 68 | 68 | 68 | 68 | 24308\nSQL: SELECT r.date, typeof(p.milliseconds) AS storage_type, COUNT(*) AS stops,\n COUNT(d.driverId) AS matched_drivers, COUNT(c.circuitId) AS matched_circuits,\n COUNT(p.duration) AS durations, MIN(p.milliseconds) AS fastest_ms\nFROM races AS r\nJOIN pitStops AS p ON p.raceId = r.raceId\nLEFT JOIN drivers AS d ON d.driverId = p.driverId\nLEFT JOIN circuits AS c ON c.circuitId = r.circuitId\nWHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'\nGROUP BY r.date, typeof(p.milliseconds)\nLIMIT 1000"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_7","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_7","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"irh6NzgBP3foOAR21OaLluog2JedzDy1ECUBMzAJDFE\", \"definitions\": [], \"instruction\": \"For oracle_view the operator has confirmed the contract: call run_sql with this definition_check_id, period_start and exclusive period_end, without sql. An explicit calendar year/month is sufficient to derive these dates. Ask only if the period or business meaning is actually unclear. For text definitions use SQL. Discover schema and use qualified table names before run_sql. A receipt is not proof of SQL semantic correctness.\"}"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_8","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"irh6NzgBP3foOAR21OaLluog2JedzDy1ECUBMzAJDFE","expected_columns":["driver_name","pit_stop_time","race_name","circuit_name","circuit_location"],"sql":"WITH september_stops AS (\n SELECT p.driverId, p.duration, p.milliseconds, r.name AS race_name, r.circuitId,\n MIN(p.milliseconds) OVER () AS fastest_ms\n FROM pitStops AS p\n JOIN races AS r ON r.raceId = p.raceId\n WHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'\n)\nSELECT d.forename || ' ' || d.surname AS driver_name,\n s.duration AS pit_stop_time,\n s.race_name,\n c.name AS circuit_name,\n c.location AS circuit_location\nFROM september_stops AS s\nJOIN drivers AS d ON d.driverId = s.driverId\nJOIN circuits AS c ON c.circuitId = s.circuitId\nWHERE s.milliseconds = s.fastest_ms","limit":1000},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_8","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"irh6NzgBP3foOAR21OaLluog2JedzDy1ECUBMzAJDFE","expected_columns":["driver_name","pit_stop_time","race_name","circuit_name","circuit_location"],"sql":"WITH september_stops AS (\n SELECT p.driverId, p.duration, p.milliseconds, r.name AS race_name, r.circuitId,\n MIN(p.milliseconds) OVER () AS fastest_ms\n FROM pitStops AS p\n JOIN races AS r ON r.raceId = p.raceId\n WHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'\n)\nSELECT d.forename || ' ' || d.surname AS driver_name,\n s.duration AS pit_stop_time,\n s.race_name,\n c.name AS circuit_name,\n c.location AS circuit_location\nFROM september_stops AS s\nJOIN drivers AS d ON d.driverId = s.driverId\nJOIN circuits AS c ON c.circuitId = s.circuitId\nWHERE s.milliseconds = s.fastest_ms","limit":1000},"result":{"content":[{"type":"text","text":"2 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=2; displayed_rows=2; fetch_truncated=false; display_truncated=false; sql_rewritten=true; query_timeout_enforced=true; query_timeout_scope=sqlite_vm. Counts refer to the executed SQL, not the source table size.\nObserved value types (displayed rows): driver_name=str; pit_stop_time=str; race_name=str; circuit_name=str; circuit_location=str\ndriver_name | pit_stop_time | race_name | circuit_name | circuit_location\n--- | --- | --- | --- | ---\nLewis Hamilton | 23.633 | Italian Grand Prix | Autodromo Nazionale di Monza | Monza\nDaniel Ricciardo | 23.633 | Italian Grand Prix | Autodromo Nazionale di Monza | Monza\nSQL: WITH september_stops AS (\n SELECT p.driverId, p.duration, p.milliseconds, r.name AS race_name, r.circuitId,\n MIN(p.milliseconds) OVER () AS fastest_ms\n FROM pitStops AS p\n JOIN races AS r ON r.raceId = p.raceId\n WHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'\n)\nSELECT d.forename || ' ' || d.surname AS driver_name,\n s.duration AS pit_stop_time,\n s.race_name,\n c.name AS circuit_name,\n c.location AS circuit_location\nFROM september_stops AS s\nJOIN drivers AS d ON d.driverId = s.driverId\nJOIN circuits AS c ON c.circuitId = s.circuitId\nWHERE s.milliseconds = s.fastest_ms\nLIMIT 1000"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_9","type":"agent_message","text":"```sql\nWITH september_stops AS (\n SELECT p.driverId, p.duration, p.milliseconds, r.name AS race_name, r.circuitId,\n MIN(p.milliseconds) OVER () AS fastest_ms\n FROM pitStops AS p\n JOIN races AS r ON r.raceId = p.raceId\n WHERE r.date >= '2016-09-01' AND r.date < '2016-10-01'\n)\nSELECT d.forename || ' ' || d.surname AS driver_name,\n s.duration AS pit_stop_time,\n s.race_name,\n c.name AS circuit_name,\n c.location AS circuit_location\nFROM september_stops AS s\nJOIN drivers AS d ON d.driverId = s.driverId\nJOIN circuits AS c ON c.circuitId = s.circuitId\nWHERE s.milliseconds = s.fastest_ms\nLIMIT 1000\n```"}}
{"type":"turn.completed","usage":{"input_tokens":162673,"cached_input_tokens":150784,"cache_write_input_tokens":0,"output_tokens":934,"reasoning_output_tokens":56}}
Loading