From 88f3d1ca2bbd0a011bb2a8775eb043f971a0a138 Mon Sep 17 00:00:00 2001 From: seyeong Date: Fri, 27 Nov 2026 06:44:09 +0900 Subject: [PATCH 1/2] Preserve selected value types when numeric casts are only for ordering --- .../sort-value-types/bird-manifest.json | 33 +++++++++++++++++++ .../sort-value-types/protocol.json | 14 ++++++++ src/lang2sql/harness/system_prompt.py | 2 +- 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 bench/accuracy/experiments/sort-value-types/bird-manifest.json create mode 100644 bench/accuracy/experiments/sort-value-types/protocol.json diff --git a/bench/accuracy/experiments/sort-value-types/bird-manifest.json b/bench/accuracy/experiments/sort-value-types/bird-manifest.json new file mode 100644 index 00000000..5610580a --- /dev/null +++ b/bench/accuracy/experiments/sort-value-types/bird-manifest.json @@ -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": "bird086", + "db": "card_games", + "question": "Among the Commander-leadable cards that the Card Kingdom catalog lists for both a foil printing and a regular non-foil printing \u2013 cards listed for only one of the two printings don't count \u2013 I want the single most recent card frame year (the latest calendar year among the frame versions), and the count of cards in that group whose frame version is that year. Please return just that one row: the frame year and its card count.", + "evidence": "A card 'may lead a Commander deck' if it can be the deck's commander \u2013 the one card that leads the deck and sets its color identity \u2013 not merely be included among the deck's other cards." + } + ], + "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": [ + "bird086" + ], + "holdout_ids": [], + "split_seed": 20261126 +} diff --git a/bench/accuracy/experiments/sort-value-types/protocol.json b/bench/accuracy/experiments/sort-value-types/protocol.json new file mode 100644 index 00000000..38dbc77f --- /dev/null +++ b/bench/accuracy/experiments/sort-value-types/protocol.json @@ -0,0 +1,14 @@ +{ + "purpose": "Keep numeric ordering conversions separate from original projected values", + "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-unobserved-20261127/checkpoints/004/bird", + "ids": [ + "bird086" + ], + "baseline_revision": "0c79539", + "model": "gpt-6.2-astra", + "reasoning_effort": "high", + "change": "One existing output-representation guidance bullet expanded. No tool, SQL execution, database or grader changes.", + "inference": "Original question/evidence/schema only; no prior answer, reference SQL/results or analyst diagnosis.", + "metric": "Selected failure repair only, not full accuracy or semantic-value correction.", + "source_record_sha256": "98c5370b6c2bf7baec7706f2e2c1d381286d898add83a34b7f89daf63c1048ca" +} diff --git a/src/lang2sql/harness/system_prompt.py b/src/lang2sql/harness/system_prompt.py index ecde3668..a7bc0a98 100644 --- a/src/lang2sql/harness/system_prompt.py +++ b/src/lang2sql/harness/system_prompt.py @@ -33,7 +33,7 @@ - A successful query is not proof of correctness. Compare the final SQL against every requested output, filter, denominator, grouping and ordering requirement before answering. - When several columns or tables describe a similar concept, inspect each candidate and prefer the explicitly named field/source. Do not silently substitute a convenient near-synonym. - Profile relevant stored values with small read-only queries before deciding numeric casts, date formats or missing-value handling. SQL NULL, empty strings, sentinel values and genuine zero are different; use documented meanings and observed values, not invented cleaning rules. -- For a requested rate or share, calculate it from the matching underlying numerator and denominator when available, with explicit non-integer division and appropriate zero-denominator handling. Use a precomputed rate instead only when the request or supplied definition specifically selects that stored measure. Stored percentages can differ from the requested calculation even when their displayed values look identical; round only at the requested stage and precision. Preserve requested identifiers and categorical strings verbatim; do not prettify their case or change types. +- For a requested rate or share, calculate it from the matching underlying numerator and denominator when available, with explicit non-integer division and appropriate zero-denominator handling. Use a precomputed rate instead only when the request or supplied definition specifically selects that stored measure. Stored percentages can differ from the requested calculation even when their displayed values look identical; round only at the requested stage and precision. Preserve stored output values in their original representation unless the request requires conversion. A numeric cast needed to sort a stored value belongs in the ordering expression, not automatically in its projected value. Preserve requested identifiers and categorical strings verbatim; do not prettify their case or change types. - Before running a correlated subquery over large tables, inspect join-key indexes or use a preaggregated/set-based join to avoid repeated full scans. - Check the effect of every join on row counts. Do not invent DISTINCT, extra legal/status restrictions, zero-filled groups, or implicit deduplication when the question does not request them. - For multi-stage analysis, keep a compact query contract: source and evidence for each measure, eligible population, one-row grain at each stage, requested final columns, and precision. Verify the final SELECT against this contract after executing it. From 58f99fb2ed096e12064e479e66da848bebbbcf29 Mon Sep 17 00:00:00 2001 From: seyeong Date: Fri, 27 Nov 2026 06:45:33 +0900 Subject: [PATCH 2/2] Record native result type repair and unchanged official scoring --- .../sort-value-types/analysis.json | 30 ++ .../baseline/events/bird086.answer.txt | 11 + .../baseline/events/bird086.jsonl | 15 + .../baseline/events/bird086.prompt.txt | 149 +++++++ .../baseline/events/bird086.stderr | 0 .../baseline/records/bird086.json | 132 ++++++ .../sort-value-types/baseline/sql/bird086.sql | 9 + .../codex-mcp/events/bird086.answer.txt | 11 + .../codex-mcp/events/bird086.jsonl | 15 + .../codex-mcp/events/bird086.prompt.txt | 149 +++++++ .../codex-mcp/events/bird086.stderr | 0 .../codex-mcp/records/bird086.json | 132 ++++++ .../sort-value-types/codex-mcp/scores.json | 7 + .../codex-mcp/sql/bird086.sql | 9 + .../sort-value-types/codex-mcp/status.json | 4 + .../comparison/comparison.json | 384 ++++++++++++++++++ .../sort-value-types/comparison/index.html | 358 ++++++++++++++++ .../sort-value-types/manifest.json | 33 ++ .../offline-diagnosis/audit.json | 37 ++ .../offline-diagnosis/counterfactual.sql | 9 + .../sort-value-types/settings.json | 26 ++ .../sort-value-types/sha256.json | 26 ++ .../sort-value-types/summary.json | 8 + 23 files changed, 1554 insertions(+) create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/analysis.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.answer.txt create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.jsonl create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.prompt.txt create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.stderr create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/baseline/records/bird086.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/baseline/sql/bird086.sql create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.answer.txt create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.jsonl create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.prompt.txt create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.stderr create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/records/bird086.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/scores.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/sql/bird086.sql create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/status.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/comparison/comparison.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/comparison/index.html create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/manifest.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/audit.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/counterfactual.sql create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/settings.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/sha256.json create mode 100644 bench/accuracy/mcp-review-results/sort-value-types/summary.json diff --git a/bench/accuracy/mcp-review-results/sort-value-types/analysis.json b/bench/accuracy/mcp-review-results/sort-value-types/analysis.json new file mode 100644 index 00000000..9124ff31 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/analysis.json @@ -0,0 +1,30 @@ +{ + "model": "gpt-6.2-astra/high", + "baseline_revision": "0c79539", + "current_revision": "88f3d1", + "case": "bird086", + "official_transition": [ + 0, + 1 + ], + "before_native_result": [ + [ + 2015, + 820 + ] + ], + "after_native_result": [ + [ + "2015", + 820 + ] + ], + "observation": "The new SQL selects original frameVersion and casts only the ORDER BY expression. It also expresses ID presence as non-empty checks; original profiling found no blank IDs.", + "scope": "One selected failure repair, not full accuracy or repeated reliability. The original94-case checkpoint stays92/94.", + "inference": "Original prompt bytes identical; only MCP output-representation instruction changed. No prior answer, references or analyst SQL supplied.", + "validation": "339passed/1skipped; scoped Ruff with pre-existing BLE001 excluded; diff checks pass.", + "limits": [ + "Prompt guidance does not deterministically enforce output types.", + "This repairs representation compatibility with unchanged native-tuple grading, not an incorrect numerical business result." + ] +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.answer.txt b/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.answer.txt new file mode 100644 index 00000000..8a321a95 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.answer.txt @@ -0,0 +1,11 @@ +```sql +SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count +FROM main.cards +WHERE INSTR(leadershipSkills, '''commander'': True') > 0 + AND cardKingdomFoilId IS NOT NULL + AND cardKingdomId IS NOT NULL + AND frameVersion GLOB '[0-9][0-9][0-9][0-9]' +GROUP BY frame_year +ORDER BY frame_year DESC +LIMIT 1 +``` \ No newline at end of file diff --git a/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.jsonl b/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.jsonl new file mode 100644 index 00000000..f9eef47e --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.jsonl @@ -0,0 +1,15 @@ +{"type":"thread.started","thread_id":"01a219c9-3a0e-7282-901e-5f713b111f62"} +{"type":"turn.started"} +{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"I’ll check the Commander eligibility and catalog fields in Lang2SQL, then execute the query and verify that it returns one row."}} +{"type":"item.started","item":{"id":"item_1","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_1","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg\", \"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_2","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"cards"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_2","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"cards"},"result":{"content":[{"type":"text","text":"cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.started","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg","sql":"SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg","sql":"SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills"},"result":{"content":[{"type":"text","text":"6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frames=str; rows=int; foil_ids=int; regular_ids=int; blank_ids=int\nleadershipSkills | frames | rows | foil_ids | regular_ids | blank_ids\n--- | --- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 26382 | 41047 | 0\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 554 | 297 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1643 | 1529 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 15 | 17 | 0\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 63 | 58 | 0\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 255 | 252 | 0\nSQL: SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills\nLIMIT 1000"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.started","item":{"id":"item_4","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_4","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM\", \"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_5","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM","expected_columns":["frame_year","card_count"],"sql":"SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_5","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM","expected_columns":["frame_year","card_count"],"sql":"SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1"},"result":{"content":[{"type":"text","text":"1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=int; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.completed","item":{"id":"item_6","type":"agent_message","text":"```sql\nSELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1\n```"}} +{"type":"turn.completed","usage":{"input_tokens":182488,"cached_input_tokens":168576,"cache_write_input_tokens":0,"output_tokens":669,"reasoning_output_tokens":0}} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.prompt.txt b/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.prompt.txt new file mode 100644 index 00000000..7fd3cad5 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.prompt.txt @@ -0,0 +1,149 @@ +You must use lang2sql MCP to inspect the schema and execute your final answer query, not merely write SQL. Call resolve_business_terms before run_sql; use terms=[] only for literal diagnostics or fully specified request criteria. Inspect the returned result and return the exact successfully executed final SQL in one fenced sql block. A result table alone or SQL that you have not executed does not complete this task. Do not use shell, files, web, or other servers. Do not invent missing business definitions; if essential meaning remains unresolved, ask for clarification instead of inventing SQL or placeholders. +Among the Commander-leadable cards that the Card Kingdom catalog lists for both a foil printing and a regular non-foil printing – cards listed for only one of the two printings don't count – I want the single most recent card frame year (the latest calendar year among the frame versions), and the count of cards in that group whose frame version is that year. Please return just that one row: the frame year and its card count. +Provided evidence: +A card 'may lead a Commander deck' if it can be the deck's commander – the one card that leads the deck and sets its color identity – not merely be included among the deck's other cards. +Official schema metadata (examples are not exhaustive): +CREATE TABLE `cards` ( + `id` INTEGER, -- unique id number identifying the cards; example: [1, 2] + `artist` TEXT, -- The name of the artist that illustrated the card art.; example: ['Pete Venters', 'Volkan Baǵa'] + `asciiName` TEXT, -- The ASCII(opens new window) (Basic/128) code formatted card name with no special unicode characters.; example: [] + `availability` TEXT, -- A list of the card's available printing types.; example: ['mtgo,paper'] + `borderColor` TEXT, -- The color of the card border.; example: ['black'] + `cardKingdomFoilId` TEXT, -- card Kingdom Foil Id; example: ['123094', '123095'] + `cardKingdomId` TEXT, -- card Kingdom Id; example: ['122719', '122720'] + `colorIdentity` TEXT, -- A list of all the colors found in manaCost, colorIndicator, and text; example: ['W'] + `colorIndicator` TEXT, -- A list of all the colors in the color indicator (The symbol prefixed to a card's types).; example: [] + `colors` TEXT, -- A list of all the colors in manaCost and colorIndicator.; example: ['W'] + `convertedManaCost` REAL, -- The converted mana cost of the card. Use the manaValue property.; example: [7.0, 5.0] + `duelDeck` TEXT, -- The indicator for which duel deck the card is in.; example: [] + `edhrecRank` INTEGER, -- The card rank on EDHRec; example: [15650, 12702] + `faceConvertedManaCost` REAL, -- The converted mana cost or mana value for the face for either half or part of the card.; example: [] + `faceName` TEXT, -- The name on the face of the card.; example: [] + `flavorName` TEXT, -- The promotional card name printed above the true card name on special cards that has no game function.; example: [] + `flavorText` TEXT, -- The italicized text found below the rules text that has no game function.; example: ['Every tear shed is a drop of immortality.', 'The perfect antidote for a tightly packed formation.'] + `frameEffects` TEXT, -- The visual frame effects.; example: [] + `frameVersion` TEXT, -- The version of the card frame style.; example: ['2003'] + `hand` TEXT, -- The starting maximum hand size total modifier.; example: [] + `hasAlternativeDeckLimit` INTEGER, -- If the card allows a value other than 4 copies in a deck.; example: [0] + `hasContentWarning` INTEGER, -- If the card marked by Wizards of the Coast (opens new window) for having sensitive content. See this official article (o; example: [0] + `hasFoil` INTEGER, -- If the card can be found in foil; example: [0, 1] + `hasNonFoil` INTEGER, -- If the card can be found in non-foil; example: [1] + `isAlternative` INTEGER, -- If the card is an alternate variation to an original printing; example: [0] + `isFullArt` INTEGER, -- If the card has full artwork.; example: [0] + `isOnlineOnly` INTEGER, -- If the card is only available in online game variations.; example: [0] + `isOversized` INTEGER, -- If the card is oversized.; example: [0] + `isPromo` INTEGER, -- If the card is a promotional printing.; example: [0] + `isReprint` INTEGER, -- If the card has been reprinted.; example: [1] + `isReserved` INTEGER, -- If the card is on the Magic: The Gathering Reserved List (opens new window); example: [0] + `isStarter` INTEGER, -- If the card is found in a starter deck such as Planeswalker/Brawl decks.; example: [0] + `isStorySpotlight` INTEGER, -- If the card is a Story Spotlight card.; example: [0] + `isTextless` INTEGER, -- If the card does not have a text box.; example: [0] + `isTimeshifted` INTEGER, -- If the card is time shifted; example: [0] + `keywords` TEXT, -- A list of keywords found on the card.; example: ['First strike', 'Flying'] + `layout` TEXT, -- The type of card layout. For a token card, this will be "token"; example: ['normal'] + `leadershipSkills` TEXT, -- A list of formats the card is legal to be a commander in; example: [] + `life` TEXT, -- The starting life total modifier. A plus or minus character precedes an integer.; example: [] + `loyalty` TEXT, -- The starting loyalty value of the card.; example: [] + `manaCost` TEXT, -- The mana cost of the card wrapped in brackets for each value.; example: ['{5}{W}{W}', '{4}{W}'] + `mcmId` TEXT, -- example: ['16165', '16166'] + `mcmMetaId` TEXT, -- example: ['156', '176'] + `mtgArenaId` TEXT, -- example: [] + `mtgjsonV4Id` TEXT, -- example: ['ad41be73-582f-58ed-abd4-a88c1f616ac3', '9eb2e54c-a12b-5e88-a9c0-d8c84c52d59c'] + `mtgoFoilId` TEXT, -- example: ['27501', '26993'] + `mtgoId` TEXT, -- example: ['27500', '26992'] + `multiverseId` TEXT, -- example: ['130550', '129465'] + `name` TEXT, -- The name of the card.; example: ["Ancestor's Chosen", 'Angel of Mercy'] + `number` TEXT, -- The number of the card; example: ['1', '2'] + `originalReleaseDate` TEXT, -- original Release Date; example: [] + `originalText` TEXT, -- original Text; example: ['First strike (This creature deals combat damage before creatures without first s', "Flying (This creature can't be blocked except by creatures with flying or reach."] + `originalType` TEXT, -- original Type; example: ['Creature - Human Cleric', 'Creature - Angel'] + `otherFaceIds` TEXT, -- other Face Ids; example: [] + `power` TEXT, -- The power of the card.; example: ['4', '3'] + `printings` TEXT, -- A list of set printing codes the card was printed in, formatted in uppercase.; example: ['10E,JUD,UMA', '10E,8ED,9ED,DDC,DVD,IMA,INV,JMP,MB1,P02,PS11,PSAL,S99'] + `promoTypes` TEXT, -- A list of promotional types for a card.; example: [] + `purchaseUrls` TEXT, -- Links that navigate to websites where the card can be purchased.; example: ["{'cardKingdom': 'https://mtgjson.com/links/9fb51af0ad6f0736', 'cardmarket': 'htt", "{'cardKingdom': 'https://mtgjson.com/links/027095d094e58f5b', 'cardmarket': 'htt"] + `rarity` TEXT, -- The card printing rarity.; example: ['uncommon', 'common'] + `scryfallId` TEXT, -- example: ['7a5cd03c-4227-4551-aa4b-7d119f0468b5', '8f7980d4-da43-4d6d-ad16-14b8a34ae91d'] + `scryfallIllustrationId` TEXT, -- example: ['be2f7173-c8b7-4172-a388-9b2c6b3c16e5', 'e4d6c53f-e936-4be8-8b70-47c2be863b20'] + `scryfallOracleId` TEXT, -- example: ['fc2ccab7-cab1-4463-b73d-898070136d74', 'a2daaf32-dbfe-4618-892e-0da24f63a44a'] + `setCode` TEXT, -- The set printing code that the card is from.; example: ['10E'] + `side` TEXT, -- The identifier of the card side.; example: [] + `subtypes` TEXT, -- A list of card subtypes found after em-dash.; example: ['Human,Cleric', 'Angel'] + `supertypes` TEXT, -- A list of card supertypes found before em-dash.; example: [] + `tcgplayerProductId` TEXT, -- tcg player ProductId; example: ['15032', '15033'] + `text` TEXT, -- The rules text of the card.; example: ['First strike (This creature deals combat damage before creatures without first s', 'Flying When Angel of Mercy enters the battlefield, you gain 3 life.'] + `toughness` TEXT, -- The toughness of the card.; example: ['4', '3'] + `type` TEXT, -- The type of the card as visible, including any supertypes and subtypes.; example: ['Creature — Human Cleric', 'Creature — Angel'] + `types` TEXT, -- A list of all card types of the card, including Un‑sets and gameplay variants.; example: ['Creature', 'Instant'] + `uuid` TEXT, -- The universal unique identifier (v5) generated by MTGJSON. Each entry is unique.; example: ['5f8287b1-5bb6-5f4c-ad17-316a40d5bb0c', '57aaebc1-850c-503d-9f6e-bb8d00d8bf7c'] + `variations` TEXT, -- example: ['b7c19924-b4bf-56fc-aa73-f586e940bd42', '8fd4e2eb-3eb4-50ea-856b-ef638fa47f8a'] + `watermark` TEXT, -- The name of the watermark on the card.; example: [] + PRIMARY KEY (`id`) +); + +CREATE TABLE `foreign_data` ( + `id` INTEGER, -- unique id number identifying this row of data; example: [1, 2] + `flavorText` TEXT, -- The foreign flavor text of the card.; example: ['„Es ist der Wille aller, und meine Hand, die ihn ausführt."', '"La voluntad de todos, realizada por mi mano."'] + `language` TEXT, -- The foreign language of card.; example: ['German', 'Spanish'] + `multiverseid` INTEGER, -- The foreign multiverse identifier of the card.; example: [148411, 150317] + `name` TEXT, -- The foreign name of the card.; example: ['Ausgewählter der Ahnfrau', 'Elegido de la Antepasada'] + `text` TEXT, -- The foreign text ruling of the card.; example: ['Erstschlag (Diese Kreatur fügt Kampfschaden vor Kreaturen ohne Erstschlag zu.) W', 'Daña primero. (Esta criatura hace daño de combate antes que las criaturas sin la'] + `type` TEXT, -- The foreign type of the card. Includes any supertypes and subtypes.; example: ['Kreatur — Mensch, Kleriker', 'Criatura — Clérigo humano'] + `uuid` TEXT, -- example: ['5f8287b1-5bb6-5f4c-ad17-316a40d5bb0c'] + PRIMARY KEY (`id`), + FOREIGN KEY (`uuid`) REFERENCES `cards` (`uuid`) +); + +CREATE TABLE `legalities` ( + `id` INTEGER, -- unique id identifying this legality; example: [1, 2] + `format` TEXT, -- format of play; example: ['commander', 'duel'] + `status` TEXT, -- example: ['Legal'] + `uuid` TEXT, -- example: ['5f8287b1-5bb6-5f4c-ad17-316a40d5bb0c'] + PRIMARY KEY (`id`), + FOREIGN KEY (`uuid`) REFERENCES `cards` (`uuid`) +); + +CREATE TABLE `sets` ( + `id` INTEGER, -- unique id identifying this set; example: [1, 2] + `baseSetSize` INTEGER, -- The number of cards in the set.; example: [383, 302] + `block` TEXT, -- The block name the set was in.; example: ['Core Set'] + `booster` TEXT, -- A breakdown of possibilities and weights of cards in a booster pack.; example: ["{'default': {'boosters': [{'contents': {'basic': 1, 'common': 10, 'rare': 1, 'un", "{'default': {'boosters': [{'contents': {'common': 11, 'rare': 1, 'uncommon': 3},"] + `code` TEXT, -- The set code for the set.; example: ['10E', '2ED'] + `isFoilOnly` INTEGER, -- If the set is only available in foil.; example: [0] + `isForeignOnly` INTEGER, -- If the set is available only outside the United States of America.; example: [0, 1] + `isNonFoilOnly` INTEGER, -- If the set is only available in non-foil.; example: [0, 1] + `isOnlineOnly` INTEGER, -- If the set is only available in online game variations.; example: [0] + `isPartialPreview` INTEGER, -- If the set is still in preview (spoiled). Preview sets do not have complete data.; example: [0] + `keyruneCode` TEXT, -- The matching Keyrune code for set image icons.; example: ['10E', '2ED'] + `mcmId` INTEGER, -- The Magic Card Marketset identifier.; example: [74, 3204] + `mcmIdExtras` INTEGER, -- The split Magic Card Market set identifier if a set is printed in two sets. This identifier represents the second set's ; example: [3209] + `mcmName` TEXT, -- magic card market name; example: ['Tenth Edition', 'Double Masters'] + `mtgoCode` TEXT, -- The set code for the set as it appears on Magic: The Gathering Online; example: ['10E', '2XM'] + `name` TEXT, -- The name of the set.; example: ['Tenth Edition', 'Unlimited Edition'] + `parentCode` TEXT, -- The parent set code for set variations like promotions, guild kits, etc.; example: [] + `releaseDate` DATE, -- The release date in ISO 8601 format for the set.; example: ['2007-07-13', '1993-12-01'] + `tcgplayerGroupId` INTEGER, -- The group identifier of the set on TCGplayer; example: [1, 115] + `totalSetSize` INTEGER, -- The total number of cards in the set, including promotional and related supplemental products but excluding Alchemy modi; example: [508, 302] + `type` TEXT, -- The expansion type of the set.; example: ['core', 'masters'] + PRIMARY KEY (`id`) +); + +CREATE TABLE `set_translations` ( + `id` INTEGER, -- unique id identifying this set; example: [1, 2] + `language` TEXT, -- language of this card; example: ['Chinese Simplified', 'Chinese Traditional'] + `setCode` TEXT, -- the set code for this set; example: ['10E'] + `translation` TEXT, -- translation of this card; example: ['核心系列第十版', 'Dixième édition'] + PRIMARY KEY (`id`), + FOREIGN KEY (`setCode`) REFERENCES `sets` (`code`) +); + +CREATE TABLE `rulings` ( + `id` INTEGER, -- unique id identifying this ruling; example: [1, 2] + `date` DATE, -- date; example: ['2007-07-15', '2007-02-01'] + `text` TEXT, -- description about this ruling; example: ['You draw the card when Bandage resolves, not when the damage is actually prevent', 'If you double a negative life total, you do the real math. A life total of -10 b'] + `uuid` TEXT, -- example: ['6d268c95-c176-5766-9a46-c14f739aba1c', '56f4935b-f6c5-59b9-88bf-9bcce20247ce'] + PRIMARY KEY (`id`), + FOREIGN KEY (`uuid`) REFERENCES `cards` (`uuid`) +); + +Return your final answer as exactly one fenced ```sql block containing the single read-only SQLite SELECT/WITH query that answers the question. Do not include exploratory SQL in the final answer. Use the supplied documentation; no user simulator is available. \ No newline at end of file diff --git a/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.stderr b/bench/accuracy/mcp-review-results/sort-value-types/baseline/events/bird086.stderr new file mode 100644 index 00000000..e69de29b diff --git a/bench/accuracy/mcp-review-results/sort-value-types/baseline/records/bird086.json b/bench/accuracy/mcp-review-results/sort-value-types/baseline/records/bird086.json new file mode 100644 index 00000000..a745a0d6 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/baseline/records/bird086.json @@ -0,0 +1,132 @@ +{ + "instance_id": "bird086", + "profile": "codex-mcp", + "model": "gpt-6.2-astra", + "status": "predicted", + "calls": [], + "prompt_sha256": "33f40d537fb344f148b43701ea5f214c96ab9a7314e6787677323ae84d8871c9", + "events_sha256": "e71f016c062f1a14b6990d3ac384f9cbf3487a0f9c237255c6f66d3bdf1cedf6", + "cli_exit_code": 0, + "cli_usage": [ + { + "input_tokens": 182488, + "cached_input_tokens": 168576, + "cache_write_input_tokens": 0, + "output_tokens": 669, + "reasoning_output_tokens": 0 + } + ], + "mcp_calls": [ + { + "id": "item_1", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg\", \"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" + }, + { + "id": "item_2", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "cards" + }, + "result": { + "content": [ + { + "type": "text", + "text": "cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_3", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg", + "sql": "SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills" + }, + "result": { + "content": [ + { + "type": "text", + "text": "6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frames=str; rows=int; foil_ids=int; regular_ids=int; blank_ids=int\nleadershipSkills | frames | rows | foil_ids | regular_ids | blank_ids\n--- | --- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 26382 | 41047 | 0\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 554 | 297 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1643 | 1529 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 15 | 17 | 0\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 63 | 58 | 0\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 255 | 252 | 0\nSQL: SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills\nLIMIT 1000" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_4", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM\", \"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" + }, + { + "id": "item_5", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM", + "expected_columns": [ + "frame_year", + "card_count" + ], + "sql": "SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1" + }, + "result": { + "content": [ + { + "type": "text", + "text": "1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=int; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + } + ], + "answer": "```sql\nSELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1\n```", + "event_parse_errors": [], + "rows": 1, + "sql": "SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1", + "seconds": 31.881061540916562 +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/baseline/sql/bird086.sql b/bench/accuracy/mcp-review-results/sort-value-types/baseline/sql/bird086.sql new file mode 100644 index 00000000..76a92429 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/baseline/sql/bird086.sql @@ -0,0 +1,9 @@ +SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count +FROM main.cards +WHERE INSTR(leadershipSkills, '''commander'': True') > 0 + AND cardKingdomFoilId IS NOT NULL + AND cardKingdomId IS NOT NULL + AND frameVersion GLOB '[0-9][0-9][0-9][0-9]' +GROUP BY frame_year +ORDER BY frame_year DESC +LIMIT 1 diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.answer.txt b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.answer.txt new file mode 100644 index 00000000..0dde2500 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.answer.txt @@ -0,0 +1,11 @@ +```sql +SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count +FROM main.cards AS c +WHERE INSTR(c.leadershipSkills, '''commander'': True') > 0 + AND c.cardKingdomFoilId <> '' + AND c.cardKingdomId <> '' + AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]' +GROUP BY c.frameVersion +ORDER BY CAST(c.frameVersion AS INTEGER) DESC +LIMIT 1 +``` \ No newline at end of file diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.jsonl b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.jsonl new file mode 100644 index 00000000..6f8cb082 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.jsonl @@ -0,0 +1,15 @@ +{"type":"thread.started","thread_id":"01a219d0-e42b-7212-a6fa-92df68932733"} +{"type":"turn.started"} +{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"I’ll check how the catalog stores Commander eligibility and frame versions, then run the query and verify that it returns one row."}} +{"type":"item.started","item":{"id":"item_1","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_1","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64\", \"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_2","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"cards"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_2","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"cards"},"result":{"content":[{"type":"text","text":"cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.started","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64","sql":"SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64","sql":"SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills"},"result":{"content":[{"type":"text","text":"6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frame_versions=str; records=int; regular_ids=int; foil_ids=int\nleadershipSkills | frame_versions | records | regular_ids | foil_ids\n--- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 41047 | 26382\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 297 | 554\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1529 | 1643\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 17 | 15\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 58 | 63\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 252 | 255\nSQL: SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills\nLIMIT 1000"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.started","item":{"id":"item_4","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_4","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE\", \"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_5","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE","expected_columns":["frame_year","card_count"],"sql":"SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_5","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE","expected_columns":["frame_year","card_count"],"sql":"SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1"},"result":{"content":[{"type":"text","text":"1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=str; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.completed","item":{"id":"item_6","type":"agent_message","text":"```sql\nSELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1\n```"}} +{"type":"turn.completed","usage":{"input_tokens":168747,"cached_input_tokens":151296,"cache_write_input_tokens":0,"output_tokens":672,"reasoning_output_tokens":0}} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.prompt.txt b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.prompt.txt new file mode 100644 index 00000000..7fd3cad5 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.prompt.txt @@ -0,0 +1,149 @@ +You must use lang2sql MCP to inspect the schema and execute your final answer query, not merely write SQL. Call resolve_business_terms before run_sql; use terms=[] only for literal diagnostics or fully specified request criteria. Inspect the returned result and return the exact successfully executed final SQL in one fenced sql block. A result table alone or SQL that you have not executed does not complete this task. Do not use shell, files, web, or other servers. Do not invent missing business definitions; if essential meaning remains unresolved, ask for clarification instead of inventing SQL or placeholders. +Among the Commander-leadable cards that the Card Kingdom catalog lists for both a foil printing and a regular non-foil printing – cards listed for only one of the two printings don't count – I want the single most recent card frame year (the latest calendar year among the frame versions), and the count of cards in that group whose frame version is that year. Please return just that one row: the frame year and its card count. +Provided evidence: +A card 'may lead a Commander deck' if it can be the deck's commander – the one card that leads the deck and sets its color identity – not merely be included among the deck's other cards. +Official schema metadata (examples are not exhaustive): +CREATE TABLE `cards` ( + `id` INTEGER, -- unique id number identifying the cards; example: [1, 2] + `artist` TEXT, -- The name of the artist that illustrated the card art.; example: ['Pete Venters', 'Volkan Baǵa'] + `asciiName` TEXT, -- The ASCII(opens new window) (Basic/128) code formatted card name with no special unicode characters.; example: [] + `availability` TEXT, -- A list of the card's available printing types.; example: ['mtgo,paper'] + `borderColor` TEXT, -- The color of the card border.; example: ['black'] + `cardKingdomFoilId` TEXT, -- card Kingdom Foil Id; example: ['123094', '123095'] + `cardKingdomId` TEXT, -- card Kingdom Id; example: ['122719', '122720'] + `colorIdentity` TEXT, -- A list of all the colors found in manaCost, colorIndicator, and text; example: ['W'] + `colorIndicator` TEXT, -- A list of all the colors in the color indicator (The symbol prefixed to a card's types).; example: [] + `colors` TEXT, -- A list of all the colors in manaCost and colorIndicator.; example: ['W'] + `convertedManaCost` REAL, -- The converted mana cost of the card. Use the manaValue property.; example: [7.0, 5.0] + `duelDeck` TEXT, -- The indicator for which duel deck the card is in.; example: [] + `edhrecRank` INTEGER, -- The card rank on EDHRec; example: [15650, 12702] + `faceConvertedManaCost` REAL, -- The converted mana cost or mana value for the face for either half or part of the card.; example: [] + `faceName` TEXT, -- The name on the face of the card.; example: [] + `flavorName` TEXT, -- The promotional card name printed above the true card name on special cards that has no game function.; example: [] + `flavorText` TEXT, -- The italicized text found below the rules text that has no game function.; example: ['Every tear shed is a drop of immortality.', 'The perfect antidote for a tightly packed formation.'] + `frameEffects` TEXT, -- The visual frame effects.; example: [] + `frameVersion` TEXT, -- The version of the card frame style.; example: ['2003'] + `hand` TEXT, -- The starting maximum hand size total modifier.; example: [] + `hasAlternativeDeckLimit` INTEGER, -- If the card allows a value other than 4 copies in a deck.; example: [0] + `hasContentWarning` INTEGER, -- If the card marked by Wizards of the Coast (opens new window) for having sensitive content. See this official article (o; example: [0] + `hasFoil` INTEGER, -- If the card can be found in foil; example: [0, 1] + `hasNonFoil` INTEGER, -- If the card can be found in non-foil; example: [1] + `isAlternative` INTEGER, -- If the card is an alternate variation to an original printing; example: [0] + `isFullArt` INTEGER, -- If the card has full artwork.; example: [0] + `isOnlineOnly` INTEGER, -- If the card is only available in online game variations.; example: [0] + `isOversized` INTEGER, -- If the card is oversized.; example: [0] + `isPromo` INTEGER, -- If the card is a promotional printing.; example: [0] + `isReprint` INTEGER, -- If the card has been reprinted.; example: [1] + `isReserved` INTEGER, -- If the card is on the Magic: The Gathering Reserved List (opens new window); example: [0] + `isStarter` INTEGER, -- If the card is found in a starter deck such as Planeswalker/Brawl decks.; example: [0] + `isStorySpotlight` INTEGER, -- If the card is a Story Spotlight card.; example: [0] + `isTextless` INTEGER, -- If the card does not have a text box.; example: [0] + `isTimeshifted` INTEGER, -- If the card is time shifted; example: [0] + `keywords` TEXT, -- A list of keywords found on the card.; example: ['First strike', 'Flying'] + `layout` TEXT, -- The type of card layout. For a token card, this will be "token"; example: ['normal'] + `leadershipSkills` TEXT, -- A list of formats the card is legal to be a commander in; example: [] + `life` TEXT, -- The starting life total modifier. A plus or minus character precedes an integer.; example: [] + `loyalty` TEXT, -- The starting loyalty value of the card.; example: [] + `manaCost` TEXT, -- The mana cost of the card wrapped in brackets for each value.; example: ['{5}{W}{W}', '{4}{W}'] + `mcmId` TEXT, -- example: ['16165', '16166'] + `mcmMetaId` TEXT, -- example: ['156', '176'] + `mtgArenaId` TEXT, -- example: [] + `mtgjsonV4Id` TEXT, -- example: ['ad41be73-582f-58ed-abd4-a88c1f616ac3', '9eb2e54c-a12b-5e88-a9c0-d8c84c52d59c'] + `mtgoFoilId` TEXT, -- example: ['27501', '26993'] + `mtgoId` TEXT, -- example: ['27500', '26992'] + `multiverseId` TEXT, -- example: ['130550', '129465'] + `name` TEXT, -- The name of the card.; example: ["Ancestor's Chosen", 'Angel of Mercy'] + `number` TEXT, -- The number of the card; example: ['1', '2'] + `originalReleaseDate` TEXT, -- original Release Date; example: [] + `originalText` TEXT, -- original Text; example: ['First strike (This creature deals combat damage before creatures without first s', "Flying (This creature can't be blocked except by creatures with flying or reach."] + `originalType` TEXT, -- original Type; example: ['Creature - Human Cleric', 'Creature - Angel'] + `otherFaceIds` TEXT, -- other Face Ids; example: [] + `power` TEXT, -- The power of the card.; example: ['4', '3'] + `printings` TEXT, -- A list of set printing codes the card was printed in, formatted in uppercase.; example: ['10E,JUD,UMA', '10E,8ED,9ED,DDC,DVD,IMA,INV,JMP,MB1,P02,PS11,PSAL,S99'] + `promoTypes` TEXT, -- A list of promotional types for a card.; example: [] + `purchaseUrls` TEXT, -- Links that navigate to websites where the card can be purchased.; example: ["{'cardKingdom': 'https://mtgjson.com/links/9fb51af0ad6f0736', 'cardmarket': 'htt", "{'cardKingdom': 'https://mtgjson.com/links/027095d094e58f5b', 'cardmarket': 'htt"] + `rarity` TEXT, -- The card printing rarity.; example: ['uncommon', 'common'] + `scryfallId` TEXT, -- example: ['7a5cd03c-4227-4551-aa4b-7d119f0468b5', '8f7980d4-da43-4d6d-ad16-14b8a34ae91d'] + `scryfallIllustrationId` TEXT, -- example: ['be2f7173-c8b7-4172-a388-9b2c6b3c16e5', 'e4d6c53f-e936-4be8-8b70-47c2be863b20'] + `scryfallOracleId` TEXT, -- example: ['fc2ccab7-cab1-4463-b73d-898070136d74', 'a2daaf32-dbfe-4618-892e-0da24f63a44a'] + `setCode` TEXT, -- The set printing code that the card is from.; example: ['10E'] + `side` TEXT, -- The identifier of the card side.; example: [] + `subtypes` TEXT, -- A list of card subtypes found after em-dash.; example: ['Human,Cleric', 'Angel'] + `supertypes` TEXT, -- A list of card supertypes found before em-dash.; example: [] + `tcgplayerProductId` TEXT, -- tcg player ProductId; example: ['15032', '15033'] + `text` TEXT, -- The rules text of the card.; example: ['First strike (This creature deals combat damage before creatures without first s', 'Flying When Angel of Mercy enters the battlefield, you gain 3 life.'] + `toughness` TEXT, -- The toughness of the card.; example: ['4', '3'] + `type` TEXT, -- The type of the card as visible, including any supertypes and subtypes.; example: ['Creature — Human Cleric', 'Creature — Angel'] + `types` TEXT, -- A list of all card types of the card, including Un‑sets and gameplay variants.; example: ['Creature', 'Instant'] + `uuid` TEXT, -- The universal unique identifier (v5) generated by MTGJSON. Each entry is unique.; example: ['5f8287b1-5bb6-5f4c-ad17-316a40d5bb0c', '57aaebc1-850c-503d-9f6e-bb8d00d8bf7c'] + `variations` TEXT, -- example: ['b7c19924-b4bf-56fc-aa73-f586e940bd42', '8fd4e2eb-3eb4-50ea-856b-ef638fa47f8a'] + `watermark` TEXT, -- The name of the watermark on the card.; example: [] + PRIMARY KEY (`id`) +); + +CREATE TABLE `foreign_data` ( + `id` INTEGER, -- unique id number identifying this row of data; example: [1, 2] + `flavorText` TEXT, -- The foreign flavor text of the card.; example: ['„Es ist der Wille aller, und meine Hand, die ihn ausführt."', '"La voluntad de todos, realizada por mi mano."'] + `language` TEXT, -- The foreign language of card.; example: ['German', 'Spanish'] + `multiverseid` INTEGER, -- The foreign multiverse identifier of the card.; example: [148411, 150317] + `name` TEXT, -- The foreign name of the card.; example: ['Ausgewählter der Ahnfrau', 'Elegido de la Antepasada'] + `text` TEXT, -- The foreign text ruling of the card.; example: ['Erstschlag (Diese Kreatur fügt Kampfschaden vor Kreaturen ohne Erstschlag zu.) W', 'Daña primero. (Esta criatura hace daño de combate antes que las criaturas sin la'] + `type` TEXT, -- The foreign type of the card. Includes any supertypes and subtypes.; example: ['Kreatur — Mensch, Kleriker', 'Criatura — Clérigo humano'] + `uuid` TEXT, -- example: ['5f8287b1-5bb6-5f4c-ad17-316a40d5bb0c'] + PRIMARY KEY (`id`), + FOREIGN KEY (`uuid`) REFERENCES `cards` (`uuid`) +); + +CREATE TABLE `legalities` ( + `id` INTEGER, -- unique id identifying this legality; example: [1, 2] + `format` TEXT, -- format of play; example: ['commander', 'duel'] + `status` TEXT, -- example: ['Legal'] + `uuid` TEXT, -- example: ['5f8287b1-5bb6-5f4c-ad17-316a40d5bb0c'] + PRIMARY KEY (`id`), + FOREIGN KEY (`uuid`) REFERENCES `cards` (`uuid`) +); + +CREATE TABLE `sets` ( + `id` INTEGER, -- unique id identifying this set; example: [1, 2] + `baseSetSize` INTEGER, -- The number of cards in the set.; example: [383, 302] + `block` TEXT, -- The block name the set was in.; example: ['Core Set'] + `booster` TEXT, -- A breakdown of possibilities and weights of cards in a booster pack.; example: ["{'default': {'boosters': [{'contents': {'basic': 1, 'common': 10, 'rare': 1, 'un", "{'default': {'boosters': [{'contents': {'common': 11, 'rare': 1, 'uncommon': 3},"] + `code` TEXT, -- The set code for the set.; example: ['10E', '2ED'] + `isFoilOnly` INTEGER, -- If the set is only available in foil.; example: [0] + `isForeignOnly` INTEGER, -- If the set is available only outside the United States of America.; example: [0, 1] + `isNonFoilOnly` INTEGER, -- If the set is only available in non-foil.; example: [0, 1] + `isOnlineOnly` INTEGER, -- If the set is only available in online game variations.; example: [0] + `isPartialPreview` INTEGER, -- If the set is still in preview (spoiled). Preview sets do not have complete data.; example: [0] + `keyruneCode` TEXT, -- The matching Keyrune code for set image icons.; example: ['10E', '2ED'] + `mcmId` INTEGER, -- The Magic Card Marketset identifier.; example: [74, 3204] + `mcmIdExtras` INTEGER, -- The split Magic Card Market set identifier if a set is printed in two sets. This identifier represents the second set's ; example: [3209] + `mcmName` TEXT, -- magic card market name; example: ['Tenth Edition', 'Double Masters'] + `mtgoCode` TEXT, -- The set code for the set as it appears on Magic: The Gathering Online; example: ['10E', '2XM'] + `name` TEXT, -- The name of the set.; example: ['Tenth Edition', 'Unlimited Edition'] + `parentCode` TEXT, -- The parent set code for set variations like promotions, guild kits, etc.; example: [] + `releaseDate` DATE, -- The release date in ISO 8601 format for the set.; example: ['2007-07-13', '1993-12-01'] + `tcgplayerGroupId` INTEGER, -- The group identifier of the set on TCGplayer; example: [1, 115] + `totalSetSize` INTEGER, -- The total number of cards in the set, including promotional and related supplemental products but excluding Alchemy modi; example: [508, 302] + `type` TEXT, -- The expansion type of the set.; example: ['core', 'masters'] + PRIMARY KEY (`id`) +); + +CREATE TABLE `set_translations` ( + `id` INTEGER, -- unique id identifying this set; example: [1, 2] + `language` TEXT, -- language of this card; example: ['Chinese Simplified', 'Chinese Traditional'] + `setCode` TEXT, -- the set code for this set; example: ['10E'] + `translation` TEXT, -- translation of this card; example: ['核心系列第十版', 'Dixième édition'] + PRIMARY KEY (`id`), + FOREIGN KEY (`setCode`) REFERENCES `sets` (`code`) +); + +CREATE TABLE `rulings` ( + `id` INTEGER, -- unique id identifying this ruling; example: [1, 2] + `date` DATE, -- date; example: ['2007-07-15', '2007-02-01'] + `text` TEXT, -- description about this ruling; example: ['You draw the card when Bandage resolves, not when the damage is actually prevent', 'If you double a negative life total, you do the real math. A life total of -10 b'] + `uuid` TEXT, -- example: ['6d268c95-c176-5766-9a46-c14f739aba1c', '56f4935b-f6c5-59b9-88bf-9bcce20247ce'] + PRIMARY KEY (`id`), + FOREIGN KEY (`uuid`) REFERENCES `cards` (`uuid`) +); + +Return your final answer as exactly one fenced ```sql block containing the single read-only SQLite SELECT/WITH query that answers the question. Do not include exploratory SQL in the final answer. Use the supplied documentation; no user simulator is available. \ No newline at end of file diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.stderr b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/events/bird086.stderr new file mode 100644 index 00000000..e69de29b diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/records/bird086.json b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/records/bird086.json new file mode 100644 index 00000000..b87c3a1a --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/records/bird086.json @@ -0,0 +1,132 @@ +{ + "instance_id": "bird086", + "profile": "codex-mcp", + "model": "gpt-6.2-astra", + "status": "predicted", + "calls": [], + "prompt_sha256": "33f40d537fb344f148b43701ea5f214c96ab9a7314e6787677323ae84d8871c9", + "events_sha256": "478efbd4a4900ed0cb383d69b1a836c646e2f59c8441566f8ef9d50ba2a477d5", + "cli_exit_code": 0, + "cli_usage": [ + { + "input_tokens": 168747, + "cached_input_tokens": 151296, + "cache_write_input_tokens": 0, + "output_tokens": 672, + "reasoning_output_tokens": 0 + } + ], + "mcp_calls": [ + { + "id": "item_1", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64\", \"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" + }, + { + "id": "item_2", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "cards" + }, + "result": { + "content": [ + { + "type": "text", + "text": "cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_3", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64", + "sql": "SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills" + }, + "result": { + "content": [ + { + "type": "text", + "text": "6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frame_versions=str; records=int; regular_ids=int; foil_ids=int\nleadershipSkills | frame_versions | records | regular_ids | foil_ids\n--- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 41047 | 26382\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 297 | 554\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1529 | 1643\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 17 | 15\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 58 | 63\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 252 | 255\nSQL: SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills\nLIMIT 1000" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_4", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE\", \"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" + }, + { + "id": "item_5", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE", + "expected_columns": [ + "frame_year", + "card_count" + ], + "sql": "SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1" + }, + "result": { + "content": [ + { + "type": "text", + "text": "1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=str; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + } + ], + "answer": "```sql\nSELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1\n```", + "event_parse_errors": [], + "rows": 1, + "sql": "SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1", + "seconds": 35.00169858301524 +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/scores.json b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/scores.json new file mode 100644 index 00000000..eed7c2dd --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/scores.json @@ -0,0 +1,7 @@ +[ + { + "instance_id": "bird086", + "score": 1, + "status": "predicted" + } +] diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/sql/bird086.sql b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/sql/bird086.sql new file mode 100644 index 00000000..06170613 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/sql/bird086.sql @@ -0,0 +1,9 @@ +SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count +FROM main.cards AS c +WHERE INSTR(c.leadershipSkills, '''commander'': True') > 0 + AND c.cardKingdomFoilId <> '' + AND c.cardKingdomId <> '' + AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]' +GROUP BY c.frameVersion +ORDER BY CAST(c.frameVersion AS INTEGER) DESC +LIMIT 1 diff --git a/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/status.json b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/status.json new file mode 100644 index 00000000..5c5a104f --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/codex-mcp/status.json @@ -0,0 +1,4 @@ +{ + "status": "completed", + "wall_seconds": 35.00241704110522 +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/comparison/comparison.json b/bench/accuracy/mcp-review-results/sort-value-types/comparison/comparison.json new file mode 100644 index 00000000..d47f6c62 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/comparison/comparison.json @@ -0,0 +1,384 @@ +{ + "scope": "Recorded score transitions on matched selected cases only; not full accuracy or proof of causality. CSV previews are text, not native SQL types. No semantic failure cause is inferred automatically.", + "sources": [ + { + "path": "/Users/seyoung/workspace/benchmarks/codex-mcp-unobserved-20261127/checkpoints/004/bird", + "manifest_sha256": "05ead9687035417b2bd703fe38c9de721ab383d34631a015761ecdb844db602c", + "scores_sha256": "051f8c7ad3447a2e8e12d275cf784dcc70b214b85076aca0dc6e53229021bd2b", + "settings": { + "profiles": [ + { + "name": "codex-mcp", + "model": "gpt-6.2-astra", + "reasoning_effort": "high" + } + ], + "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP", + "revision": "0c7953905ee455c7611652924cb341e596d7937a", + "codex_version": "codex-cli 0.170.0", + "sources": { + "bench/accuracy/codex_mcp.py": "561eded13c1b46c3e942ea3a2904da46c65629b4201d28f4fb7e75d12ccf58c0", + "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb" + }, + "schema_document_sha256": "5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b", + "review_source": null, + "failure_selection": null, + "split": "development", + "concurrency": 2, + "case_timeout": 600.0, + "sql_timeout": 30, + "max_rows": 100000, + "api_calls": null, + "usage_unit": "one Codex CLI invocation per question; internal model-call count unavailable" + } + }, + { + "path": "/Users/seyoung/workspace/benchmarks/codex-mcp-sort-value-types-20261127/bird-gpt-6.2-astra", + "manifest_sha256": "2b5d81a3c5a28e969092f1f3dd6c8ffdc812f9c2fa502a8ad43b6a5adb4fff3d", + "scores_sha256": "fc6a5ba2e31d947fae85f41de83be5149c8c38f76dd1276594a3c5b53196b6af", + "settings": { + "profiles": [ + { + "name": "codex-mcp", + "model": "gpt-6.2-astra", + "reasoning_effort": "high" + } + ], + "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP", + "revision": "88f3d1ca2bbd0a011bb2a8775eb043f971a0a138", + "codex_version": "codex-cli 0.170.0", + "sources": { + "bench/accuracy/codex_mcp.py": "561eded13c1b46c3e942ea3a2904da46c65629b4201d28f4fb7e75d12ccf58c0", + "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb" + }, + "schema_document_sha256": "5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b", + "review_source": null, + "failure_selection": null, + "split": "development", + "concurrency": 1, + "case_timeout": 600.0, + "sql_timeout": 30, + "max_rows": 100000, + "api_calls": null, + "usage_unit": "one Codex CLI invocation per question; internal model-call count unavailable" + } + } + ], + "transitions": { + "0 -> 1": 1 + }, + "cases": [ + { + "input": { + "instance_id": "bird086", + "db": "card_games", + "question": "Among the Commander-leadable cards that the Card Kingdom catalog lists for both a foil printing and a regular non-foil printing – cards listed for only one of the two printings don't count – I want the single most recent card frame year (the latest calendar year among the frame versions), and the count of cards in that group whose frame version is that year. Please return just that one row: the frame year and its card count.", + "evidence": "A card 'may lead a Commander deck' if it can be the deck's commander – the one card that leads the deck and sets its color identity – not merely be included among the deck's other cards." + }, + "transition": "0 -> 1", + "sql_diff": "--- before.sql\n+++ after.sql\n@@ -1,9 +1,9 @@\n-SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\n-FROM main.cards\n-WHERE INSTR(leadershipSkills, '''commander'': True') > 0\n- AND cardKingdomFoilId IS NOT NULL\n- AND cardKingdomId IS NOT NULL\n- AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\n-GROUP BY frame_year\n-ORDER BY frame_year DESC\n+SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\n+FROM main.cards AS c\n+WHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n+ AND c.cardKingdomFoilId <> ''\n+ AND c.cardKingdomId <> ''\n+ AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\n+GROUP BY c.frameVersion\n+ORDER BY CAST(c.frameVersion AS INTEGER) DESC\n LIMIT 1", + "before": { + "score": 0, + "record_sha256": "98c5370b6c2bf7baec7706f2e2c1d381286d898add83a34b7f89daf63c1048ca", + "record": { + "instance_id": "bird086", + "profile": "codex-mcp", + "model": "gpt-6.2-astra", + "status": "predicted", + "calls": [], + "prompt_sha256": "33f40d537fb344f148b43701ea5f214c96ab9a7314e6787677323ae84d8871c9", + "events_sha256": "e71f016c062f1a14b6990d3ac384f9cbf3487a0f9c237255c6f66d3bdf1cedf6", + "cli_exit_code": 0, + "cli_usage": [ + { + "input_tokens": 182488, + "cached_input_tokens": 168576, + "cache_write_input_tokens": 0, + "output_tokens": 669, + "reasoning_output_tokens": 0 + } + ], + "mcp_calls": [ + { + "id": "item_1", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg\", \"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" + }, + { + "id": "item_2", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "cards" + }, + "result": { + "content": [ + { + "type": "text", + "text": "cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_3", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg", + "sql": "SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills" + }, + "result": { + "content": [ + { + "type": "text", + "text": "6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frames=str; rows=int; foil_ids=int; regular_ids=int; blank_ids=int\nleadershipSkills | frames | rows | foil_ids | regular_ids | blank_ids\n--- | --- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 26382 | 41047 | 0\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 554 | 297 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1643 | 1529 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 15 | 17 | 0\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 63 | 58 | 0\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 255 | 252 | 0\nSQL: SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills\nLIMIT 1000" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_4", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM\", \"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" + }, + { + "id": "item_5", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM", + "expected_columns": [ + "frame_year", + "card_count" + ], + "sql": "SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1" + }, + "result": { + "content": [ + { + "type": "text", + "text": "1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=int; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + } + ], + "answer": "```sql\nSELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1\n```", + "event_parse_errors": [], + "rows": 1, + "sql": "SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n AND cardKingdomFoilId IS NOT NULL\n AND cardKingdomId IS NOT NULL\n AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1", + "seconds": 31.881061540916562 + }, + "result": { + "columns": [ + "frame_year", + "card_count" + ], + "row_count": 1, + "preview": [ + [ + "2015", + "820" + ] + ], + "preview_truncated": false, + "csv_sha256": "2fb5b03fd8493a067eac36aa380fa7fad76da43390fa0ae35c1b6996b098eee7" + } + }, + "after": { + "score": 1, + "record_sha256": "45e0e1780f0ecb1a9a1a02307df1ccc06bd09f5d1afe378daf878c5f87a8eb82", + "record": { + "instance_id": "bird086", + "profile": "codex-mcp", + "model": "gpt-6.2-astra", + "status": "predicted", + "calls": [], + "prompt_sha256": "33f40d537fb344f148b43701ea5f214c96ab9a7314e6787677323ae84d8871c9", + "events_sha256": "478efbd4a4900ed0cb383d69b1a836c646e2f59c8441566f8ef9d50ba2a477d5", + "cli_exit_code": 0, + "cli_usage": [ + { + "input_tokens": 168747, + "cached_input_tokens": 151296, + "cache_write_input_tokens": 0, + "output_tokens": 672, + "reasoning_output_tokens": 0 + } + ], + "mcp_calls": [ + { + "id": "item_1", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64\", \"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" + }, + { + "id": "item_2", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "cards" + }, + "result": { + "content": [ + { + "type": "text", + "text": "cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_3", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64", + "sql": "SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills" + }, + "result": { + "content": [ + { + "type": "text", + "text": "6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frame_versions=str; records=int; regular_ids=int; foil_ids=int\nleadershipSkills | frame_versions | records | regular_ids | foil_ids\n--- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 41047 | 26382\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 297 | 554\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1529 | 1643\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 17 | 15\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 58 | 63\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 252 | 255\nSQL: SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills\nLIMIT 1000" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_4", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE\", \"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" + }, + { + "id": "item_5", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE", + "expected_columns": [ + "frame_year", + "card_count" + ], + "sql": "SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1" + }, + "result": { + "content": [ + { + "type": "text", + "text": "1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=str; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + } + ], + "answer": "```sql\nSELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1\n```", + "event_parse_errors": [], + "rows": 1, + "sql": "SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n AND c.cardKingdomFoilId <> ''\n AND c.cardKingdomId <> ''\n AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1", + "seconds": 35.00169858301524 + }, + "result": { + "columns": [ + "frame_year", + "card_count" + ], + "row_count": 1, + "preview": [ + [ + "2015", + "820" + ] + ], + "preview_truncated": false, + "csv_sha256": "2fb5b03fd8493a067eac36aa380fa7fad76da43390fa0ae35c1b6996b098eee7" + } + } + } + ] +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/comparison/index.html b/bench/accuracy/mcp-review-results/sort-value-types/comparison/index.html new file mode 100644 index 00000000..0a247bea --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/comparison/index.html @@ -0,0 +1,358 @@ +Lang2SQL trace comparison

Lang2SQL trace comparison

Recorded score transitions on matched selected cases only; not full accuracy or proof of causality. CSV previews are text, not native SQL types. No semantic failure cause is inferred automatically.
{
+  "0 -> 1": 1
+}
Provenance and settings
[
+  {
+    "path": "/Users/seyoung/workspace/benchmarks/codex-mcp-unobserved-20261127/checkpoints/004/bird",
+    "manifest_sha256": "05ead9687035417b2bd703fe38c9de721ab383d34631a015761ecdb844db602c",
+    "scores_sha256": "051f8c7ad3447a2e8e12d275cf784dcc70b214b85076aca0dc6e53229021bd2b",
+    "settings": {
+      "profiles": [
+        {
+          "name": "codex-mcp",
+          "model": "gpt-6.2-astra",
+          "reasoning_effort": "high"
+        }
+      ],
+      "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP",
+      "revision": "0c7953905ee455c7611652924cb341e596d7937a",
+      "codex_version": "codex-cli 0.170.0",
+      "sources": {
+        "bench/accuracy/codex_mcp.py": "561eded13c1b46c3e942ea3a2904da46c65629b4201d28f4fb7e75d12ccf58c0",
+        "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb"
+      },
+      "schema_document_sha256": "5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b",
+      "review_source": null,
+      "failure_selection": null,
+      "split": "development",
+      "concurrency": 2,
+      "case_timeout": 600.0,
+      "sql_timeout": 30,
+      "max_rows": 100000,
+      "api_calls": null,
+      "usage_unit": "one Codex CLI invocation per question; internal model-call count unavailable"
+    }
+  },
+  {
+    "path": "/Users/seyoung/workspace/benchmarks/codex-mcp-sort-value-types-20261127/bird-gpt-6.2-astra",
+    "manifest_sha256": "2b5d81a3c5a28e969092f1f3dd6c8ffdc812f9c2fa502a8ad43b6a5adb4fff3d",
+    "scores_sha256": "fc6a5ba2e31d947fae85f41de83be5149c8c38f76dd1276594a3c5b53196b6af",
+    "settings": {
+      "profiles": [
+        {
+          "name": "codex-mcp",
+          "model": "gpt-6.2-astra",
+          "reasoning_effort": "high"
+        }
+      ],
+      "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP",
+      "revision": "88f3d1ca2bbd0a011bb2a8775eb043f971a0a138",
+      "codex_version": "codex-cli 0.170.0",
+      "sources": {
+        "bench/accuracy/codex_mcp.py": "561eded13c1b46c3e942ea3a2904da46c65629b4201d28f4fb7e75d12ccf58c0",
+        "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb"
+      },
+      "schema_document_sha256": "5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b",
+      "review_source": null,
+      "failure_selection": null,
+      "split": "development",
+      "concurrency": 1,
+      "case_timeout": 600.0,
+      "sql_timeout": 30,
+      "max_rows": 100000,
+      "api_calls": null,
+      "usage_unit": "one Codex CLI invocation per question; internal model-call count unavailable"
+    }
+  }
+]
bird086: 0 -> 1
{
+  "instance_id": "bird086",
+  "db": "card_games",
+  "question": "Among the Commander-leadable cards that the Card Kingdom catalog lists for both a foil printing and a regular non-foil printing – cards listed for only one of the two printings don't count – I want the single most recent card frame year (the latest calendar year among the frame versions), and the count of cards in that group whose frame version is that year. Please return just that one row: the frame year and its card count.",
+  "evidence": "A card 'may lead a Commander deck' if it can be the deck's commander – the one card that leads the deck and sets its color identity – not merely be included among the deck's other cards."
+}

SQL diff

--- before.sql
++++ after.sql
+@@ -1,9 +1,9 @@
+-SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count
+-FROM main.cards
+-WHERE INSTR(leadershipSkills, '''commander'': True') > 0
+-  AND cardKingdomFoilId IS NOT NULL
+-  AND cardKingdomId IS NOT NULL
+-  AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'
+-GROUP BY frame_year
+-ORDER BY frame_year DESC
++SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count
++FROM main.cards AS c
++WHERE INSTR(c.leadershipSkills, '''commander'': True') > 0
++  AND c.cardKingdomFoilId <> ''
++  AND c.cardKingdomId <> ''
++  AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'
++GROUP BY c.frameVersion
++ORDER BY CAST(c.frameVersion AS INTEGER) DESC
+ LIMIT 1

before: score 0

{
+  "status": "predicted",
+  "error_type": null,
+  "error_message": null,
+  "seconds": 31.881061540916562
+}

Final SQL / answer

SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count
+FROM main.cards
+WHERE INSTR(leadershipSkills, '''commander'': True') > 0
+  AND cardKingdomFoilId IS NOT NULL
+  AND cardKingdomId IS NOT NULL
+  AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'
+GROUP BY frame_year
+ORDER BY frame_year DESC
+LIMIT 1

Result preview (up to 20 rows; full row count below)

{
+  "columns": [
+    "frame_year",
+    "card_count"
+  ],
+  "row_count": 1,
+  "preview": [
+    [
+      "2015",
+      "820"
+    ]
+  ],
+  "preview_truncated": false,
+  "csv_sha256": "2fb5b03fd8493a067eac36aa380fa7fad76da43390fa0ae35c1b6996b098eee7"
+}
Every MCP call: arguments and results
[
+  {
+    "id": "item_1",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg\", \"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"
+  },
+  {
+    "id": "item_2",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "explore_schema",
+    "arguments": {
+      "table": "cards"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_3",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "I7a7CChCLf6PvYvkAX9jIY-XkHVb8Ll3A4wly8ABdDg",
+      "sql": "SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n       COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n       SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frames=str; rows=int; foil_ids=int; regular_ids=int; blank_ids=int\nleadershipSkills | frames | rows | foil_ids | regular_ids | blank_ids\n--- | --- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 26382 | 41047 | 0\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 554 | 297 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1643 | 1529 | 0\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 15 | 17 | 0\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 63 | 58 | 0\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 255 | 252 | 0\nSQL: SELECT leadershipSkills, GROUP_CONCAT(DISTINCT frameVersion) AS frames,\n       COUNT(*) AS rows, COUNT(cardKingdomFoilId) AS foil_ids, COUNT(cardKingdomId) AS regular_ids,\n       SUM(cardKingdomFoilId = '' OR cardKingdomId = '') AS blank_ids\nFROM main.cards\nGROUP BY leadershipSkills\nLIMIT 1000"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_4",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM\", \"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"
+  },
+  {
+    "id": "item_5",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "lIEgyDqTh0XzcRyJrrtHdRNg-cWcxFtCWcc4uMUIylM",
+      "expected_columns": [
+        "frame_year",
+        "card_count"
+      ],
+      "sql": "SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n  AND cardKingdomFoilId IS NOT NULL\n  AND cardKingdomId IS NOT NULL\n  AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=int; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT CAST(frameVersion AS INTEGER) AS frame_year, COUNT(*) AS card_count\nFROM main.cards\nWHERE INSTR(leadershipSkills, '''commander'': True') > 0\n  AND cardKingdomFoilId IS NOT NULL\n  AND cardKingdomId IS NOT NULL\n  AND frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY frame_year\nORDER BY frame_year DESC\nLIMIT 1"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  }
+]

after: score 1

{
+  "status": "predicted",
+  "error_type": null,
+  "error_message": null,
+  "seconds": 35.00169858301524
+}

Final SQL / answer

SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count
+FROM main.cards AS c
+WHERE INSTR(c.leadershipSkills, '''commander'': True') > 0
+  AND c.cardKingdomFoilId <> ''
+  AND c.cardKingdomId <> ''
+  AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'
+GROUP BY c.frameVersion
+ORDER BY CAST(c.frameVersion AS INTEGER) DESC
+LIMIT 1

Result preview (up to 20 rows; full row count below)

{
+  "columns": [
+    "frame_year",
+    "card_count"
+  ],
+  "row_count": 1,
+  "preview": [
+    [
+      "2015",
+      "820"
+    ]
+  ],
+  "preview_truncated": false,
+  "csv_sha256": "2fb5b03fd8493a067eac36aa380fa7fad76da43390fa0ae35c1b6996b098eee7"
+}
Every MCP call: arguments and results
[
+  {
+    "id": "item_1",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64\", \"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"
+  },
+  {
+    "id": "item_2",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "explore_schema",
+    "arguments": {
+      "table": "cards"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_3",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "2GaCv3dwhDvkoePw6e0oYqJoMhUi7Pd6cm7XDyXHQ64",
+      "sql": "SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n       COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n       COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "6 row(s):\nResult coverage: fetched_rows=6; displayed_rows=6; 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): leadershipSkills=NoneType,str; frame_versions=str; records=int; regular_ids=int; foil_ids=int\nleadershipSkills | frame_versions | records | regular_ids | foil_ids\n--- | --- | --- | --- | ---\nNone | 2003,1993,2015,1997,future | 53072 | 41047 | 26382\n{'brawl': False, 'commander': False, 'oathbreaker': True} | 2015,2003 | 724 | 297 | 554\n{'brawl': False, 'commander': True, 'oathbreaker': False} | 2003,2015,1993,1997,future | 2660 | 1529 | 1643\n{'brawl': False, 'commander': True, 'oathbreaker': True} | 2015 | 45 | 17 | 15\n{'brawl': True, 'commander': False, 'oathbreaker': True} | 2015 | 66 | 58 | 63\n{'brawl': True, 'commander': True, 'oathbreaker': False} | 2015 | 255 | 252 | 255\nSQL: SELECT c.leadershipSkills, GROUP_CONCAT(DISTINCT c.frameVersion) AS frame_versions,\n       COUNT(*) AS records, COUNT(NULLIF(c.cardKingdomId, '')) AS regular_ids,\n       COUNT(NULLIF(c.cardKingdomFoilId, '')) AS foil_ids\nFROM main.cards AS c\nGROUP BY c.leadershipSkills\nLIMIT 1000"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_4",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE\", \"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"
+  },
+  {
+    "id": "item_5",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "IY4O7NloJ14nBLpINKCp-36mdPieBvR20n3wkLDCDnE",
+      "expected_columns": [
+        "frame_year",
+        "card_count"
+      ],
+      "sql": "SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n  AND c.cardKingdomFoilId <> ''\n  AND c.cardKingdomId <> ''\n  AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; 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): frame_year=str; card_count=int\nframe_year | card_count\n--- | ---\n2015 | 820\nSQL: SELECT c.frameVersion AS frame_year, COUNT(*) AS card_count\nFROM main.cards AS c\nWHERE INSTR(c.leadershipSkills, '''commander'': True') > 0\n  AND c.cardKingdomFoilId <> ''\n  AND c.cardKingdomId <> ''\n  AND c.frameVersion GLOB '[0-9][0-9][0-9][0-9]'\nGROUP BY c.frameVersion\nORDER BY CAST(c.frameVersion AS INTEGER) DESC\nLIMIT 1"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  }
+]
\ No newline at end of file diff --git a/bench/accuracy/mcp-review-results/sort-value-types/manifest.json b/bench/accuracy/mcp-review-results/sort-value-types/manifest.json new file mode 100644 index 00000000..74efd9ce --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/manifest.json @@ -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": "bird086", + "db": "card_games", + "question": "Among the Commander-leadable cards that the Card Kingdom catalog lists for both a foil printing and a regular non-foil printing – cards listed for only one of the two printings don't count – I want the single most recent card frame year (the latest calendar year among the frame versions), and the count of cards in that group whose frame version is that year. Please return just that one row: the frame year and its card count.", + "evidence": "A card 'may lead a Commander deck' if it can be the deck's commander – the one card that leads the deck and sets its color identity – not merely be included among the deck's other cards." + } + ], + "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": [ + "bird086" + ], + "holdout_ids": [], + "split_seed": 20261126 +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/audit.json b/bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/audit.json new file mode 100644 index 00000000..2963bc50 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/audit.json @@ -0,0 +1,37 @@ +{ + "scope": "Offline native-result diagnosis only, never inference input or model repair score", + "before": [ + [ + 2015, + 820 + ] + ], + "reference": [ + [ + "2015", + 820 + ] + ], + "before_types": [ + [ + "int", + "int" + ] + ], + "reference_types": [ + [ + "str", + "int" + ] + ], + "only_projection_cast_removed": [ + [ + "2015", + 820 + ] + ], + "original_native_tuple_match": false, + "counterfactual_native_tuple_match": true, + "db_sha256": "c98bdb57fe7474da798b407785544b9af0daaad5d61fd21e2a73309493bc1227", + "question_file_sha256": "926af2a0d1b47e5d0d15a7aa8a34d4721007f4550a881555b6a89496b54a2606" +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/counterfactual.sql b/bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/counterfactual.sql new file mode 100644 index 00000000..0b435ddb --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/offline-diagnosis/counterfactual.sql @@ -0,0 +1,9 @@ +SELECT frameVersion AS frame_year, COUNT(*) AS card_count +FROM main.cards +WHERE INSTR(leadershipSkills, '''commander'': True') > 0 + AND cardKingdomFoilId IS NOT NULL + AND cardKingdomId IS NOT NULL + AND frameVersion GLOB '[0-9][0-9][0-9][0-9]' +GROUP BY frame_year +ORDER BY frame_year DESC +LIMIT 1 diff --git a/bench/accuracy/mcp-review-results/sort-value-types/settings.json b/bench/accuracy/mcp-review-results/sort-value-types/settings.json new file mode 100644 index 00000000..04ffac1d --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/settings.json @@ -0,0 +1,26 @@ +{ + "profiles": [ + { + "name": "codex-mcp", + "model": "gpt-6.2-astra", + "reasoning_effort": "high" + } + ], + "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP", + "revision": "88f3d1ca2bbd0a011bb2a8775eb043f971a0a138", + "codex_version": "codex-cli 0.170.0", + "sources": { + "bench/accuracy/codex_mcp.py": "561eded13c1b46c3e942ea3a2904da46c65629b4201d28f4fb7e75d12ccf58c0", + "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb" + }, + "schema_document_sha256": "5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b", + "review_source": null, + "failure_selection": null, + "split": "development", + "concurrency": 1, + "case_timeout": 600.0, + "sql_timeout": 30, + "max_rows": 100000, + "api_calls": null, + "usage_unit": "one Codex CLI invocation per question; internal model-call count unavailable" +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/sha256.json b/bench/accuracy/mcp-review-results/sort-value-types/sha256.json new file mode 100644 index 00000000..9f01c4b8 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/sha256.json @@ -0,0 +1,26 @@ +{ + "analysis.json": "3463673c5c87fed68b1a78aa967412a0ccf73a7490291e5cda1902c6a0e2abe7", + "baseline/csv/bird086.csv": "2fb5b03fd8493a067eac36aa380fa7fad76da43390fa0ae35c1b6996b098eee7", + "baseline/events/bird086.answer.txt": "4d348a47dce18a30d543e610a284b5ce716041eba1aaedb8a6583187378aed36", + "baseline/events/bird086.jsonl": "e71f016c062f1a14b6990d3ac384f9cbf3487a0f9c237255c6f66d3bdf1cedf6", + "baseline/events/bird086.prompt.txt": "33f40d537fb344f148b43701ea5f214c96ab9a7314e6787677323ae84d8871c9", + "baseline/events/bird086.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "baseline/records/bird086.json": "98c5370b6c2bf7baec7706f2e2c1d381286d898add83a34b7f89daf63c1048ca", + "baseline/sql/bird086.sql": "bc322b785e8477938a6b7371a1c7896453fe76cdd6885eb0b493723926b7bc18", + "codex-mcp/csv/bird086.csv": "2fb5b03fd8493a067eac36aa380fa7fad76da43390fa0ae35c1b6996b098eee7", + "codex-mcp/events/bird086.answer.txt": "cdded2d198a882bdb769a0c8e7627d3ce785e4c23a5b6692658ef1ac3a8496e4", + "codex-mcp/events/bird086.jsonl": "478efbd4a4900ed0cb383d69b1a836c646e2f59c8441566f8ef9d50ba2a477d5", + "codex-mcp/events/bird086.prompt.txt": "33f40d537fb344f148b43701ea5f214c96ab9a7314e6787677323ae84d8871c9", + "codex-mcp/events/bird086.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "codex-mcp/records/bird086.json": "45e0e1780f0ecb1a9a1a02307df1ccc06bd09f5d1afe378daf878c5f87a8eb82", + "codex-mcp/scores.json": "fc6a5ba2e31d947fae85f41de83be5149c8c38f76dd1276594a3c5b53196b6af", + "codex-mcp/sql/bird086.sql": "4aca8a748ee826d8772eda1c40a836c35690d8ceb25a690efcdcae243da70610", + "codex-mcp/status.json": "d72c06b6ee868aedc60280907b105719f2ad4e904fb1c9c7372f2ff3ae9dfbe0", + "comparison/comparison.json": "ab8195d975ad77c8e03a0d39bc8f3747789793827d0d45b0fdb7c25593f1e9e7", + "comparison/index.html": "dfbde952bb4cfbcc4f3383ae5b9efdb12a306701da7978eb867ef22e147902c0", + "manifest.json": "2b5d81a3c5a28e969092f1f3dd6c8ffdc812f9c2fa502a8ad43b6a5adb4fff3d", + "offline-diagnosis/audit.json": "eb18f744593d48fdc1fd2c2814ea28aeca2809b8252f9b58f9b39aedf8bd5624", + "offline-diagnosis/counterfactual.sql": "bf4aa1c24939926d2980d7e56654a48f5f419fa1f21f03b9f7e481fd8cc9032c", + "settings.json": "62c5486df898a749df862ecdd3b3327aed75dd631f7fc6715c5113b0c946eedc", + "summary.json": "c2e70d4a98f94e810170577bdc4875048efc680796036987c763c95e565e03fd" +} diff --git a/bench/accuracy/mcp-review-results/sort-value-types/summary.json b/bench/accuracy/mcp-review-results/sort-value-types/summary.json new file mode 100644 index 00000000..6c4374a9 --- /dev/null +++ b/bench/accuracy/mcp-review-results/sort-value-types/summary.json @@ -0,0 +1,8 @@ +[ + { + "profile": "codex-mcp", + "correct": 1, + "total": 1, + "accuracy": 1.0 + } +]