From ed175330e7db5771b03da5e0aa6f64b02b24da1a Mon Sep 17 00:00:00 2001 From: seyeong Date: Fri, 27 Nov 2026 05:22:56 +0900 Subject: [PATCH 1/2] Test removal of automatic ranking evidence from output contract --- .../projection-precedence/bird-manifest.json | 33 +++++ .../projection-precedence/protocol.json | 114 ++++++++++++++++++ src/lang2sql/harness/system_prompt.py | 1 - 3 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 bench/accuracy/experiments/projection-precedence/bird-manifest.json create mode 100644 bench/accuracy/experiments/projection-precedence/protocol.json diff --git a/bench/accuracy/experiments/projection-precedence/bird-manifest.json b/bench/accuracy/experiments/projection-precedence/bird-manifest.json new file mode 100644 index 00000000..f8dd9bb6 --- /dev/null +++ b/bench/accuracy/experiments/projection-precedence/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": "bird165", + "db": "european_football_2", + "question": "List the ten players taller than 180 cm with the highest mean recorded heading accuracy, highest first. Break mean ties by player API ID.", + "evidence": "" + } + ], + "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": [ + "bird165" + ], + "holdout_ids": [], + "split_seed": 20261126 +} diff --git a/bench/accuracy/experiments/projection-precedence/protocol.json b/bench/accuracy/experiments/projection-precedence/protocol.json new file mode 100644 index 00000000..b21318b5 --- /dev/null +++ b/bench/accuracy/experiments/projection-precedence/protocol.json @@ -0,0 +1,114 @@ +{ + "purpose": "Ablate conflicting automatic ranking-evidence projection rule; hypothesis test, not established cause", + "base_revision": "a97a713", + "removed_rule": "- When asked to identify entities by a ranking, aggregate threshold or period-over-period change, report the identifying fields together with the measure that justifies each selection, rather than names alone. For a change criterion, retain the compared period values and derived change; for an extremum, retain the winning value or count. Keep distinct ranking categories distinguishable. This applies to entity reports, not requests explicitly limited to a single measure or prescribed columns. Respect requested precision and do not invent unrelated diagnostic fields.", + "model": "gpt-6.2-sol", + "reasoning_effort": "high", + "review_source": null, + "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-integrated-20261127/bird-gpt-6.2-sol", + "source_scores_sha256": "b52f082479fe9b649940c6b0aa2af9c1000e7a88ff1d34614616395cbb21791a", + "cases": [ + "bird165" + ], + "selection": "Only a currently wrong extra-projection case; no already-passed cases rerun", + "metric": "Single-case diagnostic, not full accuracy or proof of regression freedom", + "known_risk": "Removed rule previously accompanied local210 repair; that passed case is not rerun per user instruction. Cannot claim no regressions.", + "sources": { + "src/lang2sql/__init__.py": "d20cbfc39f51f4466f82cde35d38189762e3481a3e6855073919f4bc7f132318", + "src/lang2sql/ingestion/__init__.py": "2def2216d0079184747baf7f521d162172b84a4c654b7bf6f8a5974081652375", + "src/lang2sql/ingestion/pipeline.py": "c7142e44a3f19db25ebaafab63739cc4210fe64d9d4f153b0ac113bfe664a217", + "src/lang2sql/tools/explore_schema.py": "86a50470ec674f2302f1f554af978a02d77322c8d96ef4ba6d2152517182eac5", + "src/lang2sql/tools/ingest_doc.py": "73a64a29fd7a3f3aac4722c1086ddac57c24c747f9fab0bf05cc0ebb05feb6ca", + "src/lang2sql/tools/confirm_ingest.py": "4ee700bf6d5a0147e5a2ba7ca738a9c6db723f96aa18465a45ba846c619a8334", + "src/lang2sql/tools/org_setup.py": "713a9b17773bdfffccdfdf5302bdb284ae6561b82d84b42908e706f0bad96aa0", + "src/lang2sql/tools/__init__.py": "f9d6961594c89943363727eb0f289bea24eb01cd439f8876a29b841dd24a6e5b", + "src/lang2sql/tools/ask_user.py": "ed1f7128187776c71b1787a8506532587423cd023d5aba6b4842a098a73f20f6", + "src/lang2sql/tools/run_sql.py": "3a7352d3ee31f07687944100e5c7b19c8362a9d8debd9f92402bf3a46fce46f6", + "src/lang2sql/tools/semantic_federation.py": "0d1e83a4f76b9d3d4b2ffec636dcaaec924e1526e2eeac47c06f662a7b15471b", + "src/lang2sql/tools/context_candidates.py": "ee758ae4fdeb34ab5dad65de9bd452c1831a063800c9ba2874912071b24c3965", + "src/lang2sql/tools/resolve_business_terms.py": "53acbcc3e13fd8b2f24eafde9d23439b6d8a792dd62651db0faad1bc53e5c23a", + "src/lang2sql/tools/bound_metric.py": "d95f13419806cf6e882141faabe1438daeac631532e6158f37917a4bcfa901a9", + "src/lang2sql/tools/remember.py": "db66e08d6185cbee655f8f5b673e80a41179998dc7648b83ca88c5326d0079c6", + "src/lang2sql/tools/recall_memory.py": "ec2b9b2fafe9964dd259fbf468fca8ece31aaece909bc6b77d7bc258b68a840a", + "src/lang2sql/tools/ping.py": "bf6d953e74c7d9844811ff1523c3d57c1f043ea320da00d8449bbd43700a5480", + "src/lang2sql/tools/enrich_schema.py": "5be7f39d9585da23e18ea3007b8983f3d2d74c5027e369b1b736d4a8f2151009", + "src/lang2sql/core/__init__.py": "59cbd8c3530f31cf76c088575daff17be9d1c85bfee67263ace3134125bfddab", + "src/lang2sql/core/types.py": "6f3cc279d62cf3e4ac8516c125083377762bf39fc65e5d2f0c7a2626a7d87883", + "src/lang2sql/core/identity.py": "0535134b5fd93746e4ed74bde3216df874d0acb2881d35061bbb580666f82bdc", + "src/lang2sql/memory/service.py": "ed57549ade7035d3004a3673bdefaa94e9d95928549ee6d5ba2d0421fbc4734e", + "src/lang2sql/memory/__init__.py": "7e33abdf9572504bf99b5d94028b2682ad2670e763b96ec6f86e5828129686bc", + "src/lang2sql/tenancy/__init__.py": "bcc9fcb0ffb57a859eeff2b8d52d3177f9d17d52d09c494c922a0e82e15b45e5", + "src/lang2sql/tenancy/tool_runtime.py": "9a3574f6654642b72f288e6fb5745bf33ae4ffcfb2415bdf84a982e6f2d48858", + "src/lang2sql/tenancy/concierge.py": "e2ab6e3843d4772bf00128e40214288b674972e149966d888991e5bfa6f8e9fa", + "src/lang2sql/tenancy/encrypted_secrets.py": "00e227d7c5f62a9fb32a3bf4df1051c4d6a0586247858abb9160e11bba2445bd", + "src/lang2sql/frontends/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "src/lang2sql/frontends/metadata_options.py": "be1b000cc1c0ef1c436fc14183cc05f73db1fd4dbe772763990e58877a1fc7ab", + "src/lang2sql/safety/__init__.py": "230c188e9ec443c75b649a2dd0b53bb06a41dc84564efad3b3ad0218808896ab", + "src/lang2sql/safety/pipeline.py": "8a75f6913c443d27a229e3f852e77807544f707daacc80122afe4162b78153b4", + "src/lang2sql/adapters/__init__.py": "09dba1b7e9efa2c1747bd631e3bb9b25b21bba7fd37ee12820b884ddf798c600", + "src/lang2sql/harness/tool_registry.py": "c0313d56c63da2382344755d6b5684b821219179984b1ea6d7c6a2addd69a486", + "src/lang2sql/harness/system_prompt.py": "6820b0ad53c658886235c3b6cdc9fe50b1f850077ac3a0146905547a1058500e", + "src/lang2sql/harness/session.py": "dae446ddcdbd5cb498fe5cd69984ccb8144de12dc19b3790d86afb5c48593330", + "src/lang2sql/harness/__init__.py": "f00c3d0fa8e7b08b0a967c95ef36a3422f35cbb13cbf4c1c2b70c2e894f8b108", + "src/lang2sql/harness/context.py": "7960927502b397544eb891074e3e65f72e4c8d2ba11d0dca3bf176b67d5349e2", + "src/lang2sql/harness/loop.py": "9941af684a573b1cb04b80211b8d2175a2aa20be23b028158b32e63fe3151736", + "src/lang2sql/semantic/__init__.py": "bbf42232e94bf022efc17e86524d3708c36b6d93cfd526b8b64900d689ac6eef", + "src/lang2sql/semantic/types.py": "709d8a40150d410db058cb62850dc092afc5b0006b40e6327f5b2575646d4af0", + "src/lang2sql/adapters/llm/fake.py": "ace77dca3c1a9e895981ae85deb1221c47178decb261b90c2a1038e2eeef018d", + "src/lang2sql/adapters/llm/__init__.py": "d960fe2dc214dec9aa22f2d6e4fffebb90c815690909cb703cb91fd267381783", + "src/lang2sql/adapters/llm/openai_.py": "538b8e603b6ddc1cc60e601bc55e0f5b438a05b581f7f1a4537282a3411efce2", + "src/lang2sql/adapters/storage/oracle_store.py": "50315049e241d35be2c76303251bf81e824599a7eec59d19d9835174b8c97787", + "src/lang2sql/adapters/storage/__init__.py": "3e323b08ae8bc8f840a0d4da096be4486d718d133497f5ebc23a757aa795fb6d", + "src/lang2sql/adapters/storage/sqlite_store.py": "7d3c612a7f649797da5012c4c5887a105166745b38a2242464704ccf7b454156", + "src/lang2sql/adapters/storage/okf_bundle.py": "b716df40e9b4bf5f6e0017389e77931c13f59ff5b1b720f78ad2fa68c2e4190b", + "src/lang2sql/adapters/storage/persistent_memory.py": "1a5fa263ab6e9fc17c62eccd5db0ff3cd34589ee8023c4edd4a839085cb96f40", + "src/lang2sql/adapters/db/d1_explorer.py": "547ff7e0e33ff94d9fb6662dcafd78aefc4fd65040ceecccc971bf049e84433a", + "src/lang2sql/adapters/db/__init__.py": "1692308cebe6d83309966f69882cd6b7674f5603ecf63d2b98ff81981171bbb9", + "src/lang2sql/adapters/db/dsn_builder.py": "e0d462d644cfef4fdad594bac059b65c57fb5233cd66f93f541945224438219b", + "src/lang2sql/adapters/db/factory.py": "af358be77a24879677236de81fc7d7f0a1f78e62f5471ffe79e0ea2dcb984c4b", + "src/lang2sql/adapters/db/oracle_view.py": "6e544be664c0ac5e6c32fce0d2780f400e52e5252bb3c1366753da4760cb0672", + "src/lang2sql/adapters/db/sqlalchemy_explorer.py": "cefba7994602e25c66a9134d4cb5243e32a713b72a50a733a187245298292839", + "src/lang2sql/adapters/db/postgres_explorer.py": "3309937b073c77c91a3a1352e74f5c78e9cbebe5671eeb27deb9e120c235ad87", + "src/lang2sql/safety/layers/whitelist.py": "6ae3ab7d2e4de5639bcd7be16a402d5cb9616eec9132252bfeedccbfafd9d35f", + "src/lang2sql/safety/layers/row_limit.py": "cb6ab7b0922059e1d9af0e1b2b2ead86590dfce9ffa7e5f27f60344d92ec5287", + "src/lang2sql/safety/layers/timeout.py": "9f04c8a18bb860f56fe8987477dd961b7041c5700a1589e47db0a438c7a1866e", + "src/lang2sql/safety/layers/__init__.py": "18e4e07626c56aa37e4b2c86b822f622ece4e9e1d275897005cb23beffc54797", + "src/lang2sql/frontends/discord/render.py": "ebc0d1a4544c6c2d03d3c1aad409df37b938dd343b0422722370edcba7438fe3", + "src/lang2sql/frontends/discord/__init__.py": "ce3131eb1702a3f1d18715de4b155706988192dca2b4ed483de63341f8a6de60", + "src/lang2sql/frontends/discord/setup_wizard.py": "f530876656916fe2da5726278fc9c9ac9805dbefdc192409459cf53af1c4c241", + "src/lang2sql/frontends/discord/bot.py": "41629ef351d6e1e1af14297fad076191c56291fb577effb3cb0dde4f9cceef97", + "src/lang2sql/frontends/discord/commands.py": "8369eabfb617bc74bd8c276cfea4827ffaeaa9eae109b21e10c6d785690e4e1e", + "src/lang2sql/frontends/discord/session_router.py": "e3459a59963d57f3c44fa113cbd372f6f24d58f7012f17405eb9c38bc3f64c46", + "src/lang2sql/frontends/discord/term_wizard.py": "22298a2b93d57b1537a76c5998ae7204dacee16d5ca46ffc220b98db33948a07", + "src/lang2sql/frontends/web/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb", + "src/lang2sql/frontends/mcp/__init__.py": "c4b763a246edae7bfe5e76bf61b81e416b6ef56fe80069b0b21ee2d03d7b4b17", + "src/lang2sql/frontends/cli/tools.py": "ee2e8d40003df65f0bcde00bc16ce4158ba8dfa6052dda809cb1570ae98d7818", + "src/lang2sql/frontends/cli/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "src/lang2sql/frontends/cli/app.py": "31fb34f648ad4df5fab996c9ffe96ef631f445dd5cec58e96c8368b48ce51b75", + "src/lang2sql/frontends/slack/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "src/lang2sql/memory/stores/__init__.py": "567c0208003e6309370af2dda9998d9ff915fe42156dcea29fb7fd36989ae08f", + "src/lang2sql/memory/stores/in_memory.py": "c1f24826872a88000ea10138979386df9c3013dcd3f74c66f628321a16505977", + "src/lang2sql/memory/recall/inject_all.py": "46652cde0d1863f80b805fd0b786ded74ff111cd2edec9608a654d34a451de66", + "src/lang2sql/memory/recall/__init__.py": "ab4a64d8ea78b3a455d730ec769a721c1a78dd9f2c5026af77dbaa1ca6fbe725", + "src/lang2sql/memory/extractors/__init__.py": "de126ed4f3bc931ecb7aa8a6c30cb788c8898e6bf88814afebe828c5ddf56aa9", + "src/lang2sql/memory/extractors/manual.py": "ba5bb4fb84c6150d8ac357b7f43800ccff23fa77d2671c18a846a116aeec6f05", + "src/lang2sql/core/ports/ingestion.py": "9679eee37db5b925246c46aabf821710ba34740a7b910651cc75352c3921e6d1", + "src/lang2sql/core/ports/metadata.py": "6f98ab915c0a483cba3c9c60ba6bc4910317e1af82342b89cc2ffc24867d5648", + "src/lang2sql/core/ports/audit.py": "caa6de80043f4514ee0b78212aa4a7ad909adb91cfc5f56156ed017b1ee3c3c4", + "src/lang2sql/core/ports/memory.py": "66e0529a2a2ff2baf8933d556d28eef3982bff622ead28918f7a2b20e52c8678", + "src/lang2sql/core/ports/semantic_scope.py": "6fd0cebd407cf5ec1f9067bcd37a3ae723f40250c117b7719f8e8390ab3b9d79", + "src/lang2sql/core/ports/frontend.py": "9742fae10353b76ef27c017f1f38fd8112b6ab102d54113676b1f26aa31ab715", + "src/lang2sql/core/ports/__init__.py": "9d55f36c80904fd6824ab4ac27bdafec3d7f119d0a09dd1920aaa140252740ac", + "src/lang2sql/core/ports/llm.py": "bbb5318234a268d65f88370726e6dca3d96898a9c57f151ec6effe7e3373676a", + "src/lang2sql/core/ports/explorer.py": "059e89e6b2731d61175a82fa95ad9d04a40477268d26c1365dae112fc8176584", + "src/lang2sql/core/ports/secrets.py": "bef215031fc1ade47256f55c18f3c7ff599be52fb73888c96774d96f154746c6", + "src/lang2sql/core/ports/safety.py": "4ca9716497bda4a8d3e09a1c0365966df6933af52f6d1e489f31ca204301c5fc", + "src/lang2sql/core/ports/session_store.py": "ac34f33175f30378ad3269a4b931fee8e4e073b8f52c20be3c5c229e21ad526d", + "src/lang2sql/core/ports/tool.py": "8ee910e7a5446f0ee0f1479a61a7a4017541ed062c6296bafb33c62bcc9242d2", + "src/lang2sql/ingestion/sources/file_source.py": "7a151ba64bbfb9e2117cee936c1bc47911be40adabfae5220df0717d4628612d", + "src/lang2sql/ingestion/sources/__init__.py": "67f4793e467bd9d07308bd3b7941781f49e9038d5000ba0a1f9e1a819f166f29", + "src/lang2sql/ingestion/extractors/__init__.py": "c52ac35a6ff7532e60fdcf7fdfd1785ea036460e7f851af0bac76a2afdfdf19e", + "src/lang2sql/ingestion/extractors/llm_extractor.py": "6a628c5edeb6b28de43fe88bf05285d42681ac52ecd1fdfd6ec6da1840419bec" + } +} diff --git a/src/lang2sql/harness/system_prompt.py b/src/lang2sql/harness/system_prompt.py index 0afcca95..9baaa9a3 100644 --- a/src/lang2sql/harness/system_prompt.py +++ b/src/lang2sql/harness/system_prompt.py @@ -42,7 +42,6 @@ - Keep eligibility predicates at their specified aggregation grain. When eligibility depends on an entity's overall total, filter that total first and retain its associated component rows for later attribution unless the request separately restricts components. A positive overall total does not imply that every component must be positive; adding that filter changes membership and downstream counts. - Quantile groups, equal-width numeric intervals, and percentile ranks are different operations. Follow the supplied definition; inspect ties and group sizes before treating NTILE, CUME_DIST, or arithmetic boundaries as interchangeable. If the requested policy remains materially ambiguous, clarify rather than choosing a rule just because it runs. - Trace monetary measures to their documented source. Item prices, payment amounts, freight, and refunds are not interchangeable. Verify source columns and join multiplicity before aggregating; do not silently switch the measure during query repair. -- When asked to identify entities by a ranking, aggregate threshold or period-over-period change, report the identifying fields together with the measure that justifies each selection, rather than names alone. For a change criterion, retain the compared period values and derived change; for an extremum, retain the winning value or count. Keep distinct ranking categories distinguishable. This applies to entity reports, not requests explicitly limited to a single measure or prescribed columns. Respect requested precision and do not invent unrelated diagnostic fields. Clarification rule: - The user's explicit question and supplied documentation can define a term; a missing semantic-layer entry alone is not a reason to ask for clarification. From 1501a97389ae1a3a64e60b1b1095dd0cd262354f Mon Sep 17 00:00:00 2001 From: seyeong Date: Fri, 27 Nov 2026 05:24:38 +0900 Subject: [PATCH 2/2] Preserve projection ablation result and paired trace --- .../projection-precedence/analysis.json | 17 + .../bird-comparison/comparison.json | 500 ++++++++++++++++++ .../bird-comparison/index.html | 476 +++++++++++++++++ .../bird/codex-mcp/csv/bird165.csv | 11 + .../bird/codex-mcp/events/bird165.answer.txt | 11 + .../bird/codex-mcp/events/bird165.jsonl | 17 + .../bird/codex-mcp/events/bird165.prompt.txt | 262 +++++++++ .../bird/codex-mcp/events/bird165.stderr | 0 .../bird/codex-mcp/records/bird165.json | 151 ++++++ .../bird/codex-mcp/scores.json | 7 + .../bird/codex-mcp/sql/bird165.sql | 9 + .../bird/codex-mcp/status.json | 4 + .../projection-precedence/bird/manifest.json | 33 ++ .../projection-precedence/bird/settings.json | 26 + .../projection-precedence/bird/summary.json | 8 + .../projection-precedence/sha256.json | 17 + 16 files changed, 1549 insertions(+) create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/analysis.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/comparison.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/index.html create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/csv/bird165.csv create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.answer.txt create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.jsonl create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.prompt.txt create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.stderr create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/records/bird165.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/scores.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/sql/bird165.sql create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/status.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/manifest.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/settings.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/bird/summary.json create mode 100644 bench/accuracy/mcp-review-results/projection-precedence/sha256.json diff --git a/bench/accuracy/mcp-review-results/projection-precedence/analysis.json b/bench/accuracy/mcp-review-results/projection-precedence/analysis.json new file mode 100644 index 00000000..3e2c9876 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/analysis.json @@ -0,0 +1,17 @@ +{ + "revision": "ed17533", + "model": "gpt-6.2-sol/high", + "source": "integrated correctness run 4d7f3a7", + "case": "bird165", + "previous_score": 0, + "current_score": 1, + "metric": "single selected prior failure; not full accuracy", + "change": "Remove one automatic ranking-evidence projection bullet; all other product source unchanged", + "observation": "Output now contains only player_name; AVG remains in ordering.", + "limitations": [ + "Single stochastic attempt; no causal isolation from sampling variance", + "Previously passed cases were not rerun; no regression-freedom claim", + "Removed rule previously accompanied local210 repair, so broad rollout remains unproven" + ], + "input_policy": "Fresh inference; no prior answer/grade/reference passed to model" +} diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/comparison.json b/bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/comparison.json new file mode 100644 index 00000000..a692a25f --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/comparison.json @@ -0,0 +1,500 @@ +{ + "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-integrated-20261127/bird-gpt-6.2-sol", + "manifest_sha256": "892185c34772ea9d34065bea7767745b45cd849537a6e20943877ef83202d68c", + "scores_sha256": "b52f082479fe9b649940c6b0aa2af9c1000e7a88ff1d34614616395cbb21791a", + "settings": { + "profiles": [ + { + "name": "codex-mcp", + "model": "gpt-6.2-sol", + "reasoning_effort": "high" + } + ], + "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP", + "revision": "4d7f3a707587fab01a706461719c7e23f58c8dfe", + "codex_version": "codex-cli 0.170.0", + "sources": { + "bench/accuracy/codex_mcp.py": "5b87250f7b0f92903647327e91e8effab7b092b403569d930413644f1c97a173", + "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb" + }, + "schema_document_sha256": "5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b", + "review_source": null, + "failure_selection": { + "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-prior-full-failures-20261127/bird-gpt-6.2-sol", + "manifest_sha256": "c6c2aa6d57836036c1986ff4ccb60daf4c2fbd69cb924004d21957ceae227e13", + "scores_sha256": "32ebf4704ef74a54b12221e18b457d9163c4eda1173df1321844cd94e95e3b98", + "excluded_passed_sources": [ + { + "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-rate-projection-20261127/bird-gpt-6.2-sol", + "manifest_sha256": "f25f02f2d97ffad616b9fee428baaaf54092ec32684b0cd4124e0460c5d18145", + "scores_sha256": "006b2f995300ef903c6be3faa93af23349d27a1b816278cbf13538298fee9d8c" + }, + { + "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-reasoning-control-20261127/bird-xhigh", + "manifest_sha256": "56d2b682e6498f7c34cb3daac20723a460aab2e5310714de49b8ae452807b1bb", + "scores_sha256": "667745f0a9bd9dd57c7f8a7d5d789a28d975aa0448db56526fc63fe4a21f83d1" + } + ], + "exclusion_policy": "any pass in explicitly supplied completed runs; not an aggregate accuracy score", + "metric": "repair rate on selected prior failures, not full benchmark accuracy" + }, + "split": "development", + "concurrency": 2, + "case_timeout": 600, + "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-projection-precedence-20261127/bird-gpt-6.2-sol", + "manifest_sha256": "395936fcc29e0990e3501063265fe134d0c2e6b9e0c9f91c257a022786a9fce8", + "scores_sha256": "9b6218728b28355fd15a4813aeb95275e424bdf196821ae84604ba20ce719a45", + "settings": { + "profiles": [ + { + "name": "codex-mcp", + "model": "gpt-6.2-sol", + "reasoning_effort": "high" + } + ], + "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP", + "revision": "ed175330e7db5771b03da5e0aa6f64b02b24da1a", + "codex_version": "codex-cli 0.170.0", + "sources": { + "bench/accuracy/codex_mcp.py": "568ac45e5181e96aef4dd7b678bf435cf5b71752d986ed6082b9cbd111174e83", + "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": "bird165", + "db": "european_football_2", + "question": "List the ten players taller than 180 cm with the highest mean recorded heading accuracy, highest first. Break mean ties by player API ID.", + "evidence": "" + }, + "transition": "0 -> 1", + "sql_diff": "--- before.sql\n+++ after.sql\n@@ -1,10 +1,9 @@\n-SELECT\n- p.player_name,\n- AVG(pa.heading_accuracy) AS mean_heading_accuracy\n-FROM Player AS p\n-JOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id\n+SELECT p.player_name\n+FROM main.Player AS p\n+JOIN main.Player_Attributes AS a\n+ ON a.player_api_id = p.player_api_id\n WHERE p.height > 180\n- AND pa.heading_accuracy IS NOT NULL\n+ AND a.heading_accuracy IS NOT NULL\n GROUP BY p.player_api_id, p.player_name\n-ORDER BY mean_heading_accuracy DESC, p.player_api_id ASC\n+ORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\n LIMIT 10", + "before": { + "score": 0, + "record_sha256": "525fccd81d25c6eb5b0d4fc9f9d34af0af524ed62e296f5113fe9dc550a9b442", + "record": { + "instance_id": "bird165", + "profile": "codex-mcp", + "model": "gpt-6.2-sol", + "status": "predicted", + "calls": [], + "events_sha256": "1818201602471abab3da5d400f3d10d4c8e93d03abf1ad2bdc774aed6628f90e", + "cli_exit_code": 0, + "cli_usage": [ + { + "input_tokens": 181146, + "cached_input_tokens": 153472, + "cache_write_input_tokens": 0, + "output_tokens": 951, + "reasoning_output_tokens": 184 + } + ], + "mcp_calls": [ + { + "id": "item_1", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "Player_Attributes" + }, + "result": { + "content": [ + { + "type": "text", + "text": "Player_Attributes (table)\n- id: INTEGER\n- player_fifa_api_id: INTEGER\n- player_api_id: INTEGER\n- date: TEXT\n- overall_rating: INTEGER\n- potential: INTEGER\n- preferred_foot: TEXT\n- attacking_work_rate: TEXT\n- defensive_work_rate: TEXT\n- crossing: INTEGER\n- finishing: INTEGER\n- heading_accuracy: INTEGER\n- short_passing: INTEGER\n- volleys: INTEGER\n- dribbling: INTEGER\n- curve: INTEGER\n- free_kick_accuracy: INTEGER\n- long_passing: INTEGER\n- ball_control: INTEGER\n- acceleration: INTEGER\n- sprint_speed: INTEGER\n- agility: INTEGER\n- reactions: INTEGER\n- balance: INTEGER\n- shot_power: INTEGER\n- jumping: INTEGER\n- stamina: INTEGER\n- strength: INTEGER\n- long_shots: INTEGER\n- aggression: INTEGER\n- interceptions: INTEGER\n- positioning: INTEGER\n- vision: INTEGER\n- penalties: INTEGER\n- marking: INTEGER\n- standing_tackle: INTEGER\n- sliding_tackle: INTEGER\n- gk_diving: INTEGER\n- gk_handling: INTEGER\n- gk_kicking: INTEGER\n- gk_positioning: INTEGER\n- gk_reflexes: INTEGER\nPRIMARY KEY (id)\nFOREIGN KEY (player_api_id) REFERENCES Player (player_api_id)\nFOREIGN KEY (player_fifa_api_id) REFERENCES Player (player_fifa_api_id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_2", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "Player" + }, + "result": { + "content": [ + { + "type": "text", + "text": "Player (table)\n- id: INTEGER\n- player_api_id: INTEGER\n- player_name: TEXT\n- player_fifa_api_id: INTEGER\n- birthday: TEXT\n- height: INTEGER\n- weight: INTEGER\nPRIMARY KEY (id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_3", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"7NyZzt83wmzpxUi2Zbc-ACZNVJv28-ieV1QlP3LVG1w\", \"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_4", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "7NyZzt83wmzpxUi2Zbc-ACZNVJv28-ieV1QlP3LVG1w", + "sql": "SELECT\n (SELECT COUNT(*) - COUNT(DISTINCT player_api_id) FROM Player) AS non_unique_or_null_player_ids,\n (SELECT COUNT(*) FROM Player WHERE height IS NOT NULL AND typeof(height) NOT IN ('integer', 'real')) AS nonnumeric_heights,\n COUNT(*) AS attribute_rows,\n COUNT(pa.heading_accuracy) AS recorded_heading_rows,\n COUNT(CASE WHEN pa.heading_accuracy IS NOT NULL AND typeof(pa.heading_accuracy) NOT IN ('integer', 'real') THEN 1 END) AS nonnumeric_heading_rows,\n COUNT(CASE WHEN p.player_api_id IS NOT NULL THEN 1 END) AS matched_attribute_rows\nFROM Player_Attributes AS pa\nLEFT JOIN Player AS p ON p.player_api_id = pa.player_api_id;" + }, + "result": { + "content": [ + { + "type": "text", + "text": "1 row(s):\nResult coverage: fetched_rows=1; displayed_rows=1; 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): non_unique_or_null_player_ids=int; nonnumeric_heights=int; attribute_rows=int; recorded_heading_rows=int; nonnumeric_heading_rows=int; matched_attribute_rows=int\nnon_unique_or_null_player_ids | nonnumeric_heights | attribute_rows | recorded_heading_rows | nonnumeric_heading_rows | matched_attribute_rows\n--- | --- | --- | --- | --- | ---\n0 | 0 | 183978 | 183142 | 0 | 183978\nSQL: SELECT\n (SELECT COUNT(*) - COUNT(DISTINCT player_api_id) FROM Player) AS non_unique_or_null_player_ids,\n (SELECT COUNT(*) FROM Player WHERE height IS NOT NULL AND typeof(height) NOT IN ('integer', 'real')) AS nonnumeric_heights,\n COUNT(*) AS attribute_rows,\n COUNT(pa.heading_accuracy) AS recorded_heading_rows,\n COUNT(CASE WHEN pa.heading_accuracy IS NOT NULL AND typeof(pa.heading_accuracy) NOT IN ('integer', 'real') THEN 1 END) AS nonnumeric_heading_rows,\n COUNT(CASE WHEN p.player_api_id IS NOT NULL THEN 1 END) AS matched_attribute_rows\nFROM Player_Attributes AS pa\nLEFT JOIN Player AS p ON p.player_api_id = pa.player_api_id\nLIMIT 1000" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_5", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"6c3LoaymXQgz1RllE7q8PIHDe6fzgcnhwBmFT28BtpE\", \"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_6", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "6c3LoaymXQgz1RllE7q8PIHDe6fzgcnhwBmFT28BtpE", + "expected_columns": [ + "player_name", + "mean_heading_accuracy" + ], + "sql": "SELECT\n p.player_name,\n AVG(pa.heading_accuracy) AS mean_heading_accuracy\nFROM Player AS p\nJOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND pa.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY mean_heading_accuracy DESC, p.player_api_id ASC\nLIMIT 10" + }, + "result": { + "content": [ + { + "type": "text", + "text": "10 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=10; displayed_rows=10; 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): player_name=str; mean_heading_accuracy=float\nplayer_name | mean_heading_accuracy\n--- | ---\nMichael Ballack | 91.8\nFernando Llorente | 91.52380952380952\nJohn Terry | 91.33333333333333\nNaldo | 90.39285714285714\nLuca Toni | 90.26470588235294\nPer Mertesacker | 90.26470588235294\nDidier Drogba | 90.23529411764706\nMiroslav Klose | 90.17647058823529\nDaniel van Buyten | 90.17647058823529\nFernando Morientes | 89.8\nSQL: SELECT\n p.player_name,\n AVG(pa.heading_accuracy) AS mean_heading_accuracy\nFROM Player AS p\nJOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND pa.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY mean_heading_accuracy DESC, p.player_api_id ASC\nLIMIT 10" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + } + ], + "answer": "```sql\nSELECT\n p.player_name,\n AVG(pa.heading_accuracy) AS mean_heading_accuracy\nFROM Player AS p\nJOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND pa.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY mean_heading_accuracy DESC, p.player_api_id ASC\nLIMIT 10\n```", + "rows": 10, + "sql": "SELECT\n p.player_name,\n AVG(pa.heading_accuracy) AS mean_heading_accuracy\nFROM Player AS p\nJOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND pa.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY mean_heading_accuracy DESC, p.player_api_id ASC\nLIMIT 10", + "seconds": 31.496399082941934 + }, + "result": { + "columns": [ + "player_name", + "mean_heading_accuracy" + ], + "row_count": 10, + "preview": [ + [ + "Michael Ballack", + "91.8" + ], + [ + "Fernando Llorente", + "91.52380952380952" + ], + [ + "John Terry", + "91.33333333333333" + ], + [ + "Naldo", + "90.39285714285714" + ], + [ + "Luca Toni", + "90.26470588235294" + ], + [ + "Per Mertesacker", + "90.26470588235294" + ], + [ + "Didier Drogba", + "90.23529411764706" + ], + [ + "Miroslav Klose", + "90.17647058823529" + ], + [ + "Daniel van Buyten", + "90.17647058823529" + ], + [ + "Fernando Morientes", + "89.8" + ] + ], + "preview_truncated": false, + "csv_sha256": "cbc20e9cdbd30d90b10e36cd716b12affe008c0697fb90051bb543d51aa9c446" + } + }, + "after": { + "score": 1, + "record_sha256": "85abdc2aebf2f258b26a00be99bb71bfa2457b53728fb23318481ef975fd545f", + "record": { + "instance_id": "bird165", + "profile": "codex-mcp", + "model": "gpt-6.2-sol", + "status": "predicted", + "calls": [], + "prompt_sha256": "16d3480a9ffc64a3f33d66a227260c09d32eab869ece0d73c00fb3deb546cf98", + "events_sha256": "b105940d0a2e7ef75956a64667bb81e615dd6d466b0e7e4eacf0de855d0cede2", + "cli_exit_code": 0, + "cli_usage": [ + { + "input_tokens": 179416, + "cached_input_tokens": 165248, + "cache_write_input_tokens": 0, + "output_tokens": 787, + "reasoning_output_tokens": 97 + } + ], + "mcp_calls": [ + { + "id": "item_1", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "Player" + }, + "result": { + "content": [ + { + "type": "text", + "text": "Player (table)\n- id: INTEGER\n- player_api_id: INTEGER\n- player_name: TEXT\n- player_fifa_api_id: INTEGER\n- birthday: TEXT\n- height: INTEGER\n- weight: INTEGER\nPRIMARY KEY (id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_2", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "Player_Attributes" + }, + "result": { + "content": [ + { + "type": "text", + "text": "Player_Attributes (table)\n- id: INTEGER\n- player_fifa_api_id: INTEGER\n- player_api_id: INTEGER\n- date: TEXT\n- overall_rating: INTEGER\n- potential: INTEGER\n- preferred_foot: TEXT\n- attacking_work_rate: TEXT\n- defensive_work_rate: TEXT\n- crossing: INTEGER\n- finishing: INTEGER\n- heading_accuracy: INTEGER\n- short_passing: INTEGER\n- volleys: INTEGER\n- dribbling: INTEGER\n- curve: INTEGER\n- free_kick_accuracy: INTEGER\n- long_passing: INTEGER\n- ball_control: INTEGER\n- acceleration: INTEGER\n- sprint_speed: INTEGER\n- agility: INTEGER\n- reactions: INTEGER\n- balance: INTEGER\n- shot_power: INTEGER\n- jumping: INTEGER\n- stamina: INTEGER\n- strength: INTEGER\n- long_shots: INTEGER\n- aggression: INTEGER\n- interceptions: INTEGER\n- positioning: INTEGER\n- vision: INTEGER\n- penalties: INTEGER\n- marking: INTEGER\n- standing_tackle: INTEGER\n- sliding_tackle: INTEGER\n- gk_diving: INTEGER\n- gk_handling: INTEGER\n- gk_kicking: INTEGER\n- gk_positioning: INTEGER\n- gk_reflexes: INTEGER\nPRIMARY KEY (id)\nFOREIGN KEY (player_api_id) REFERENCES Player (player_api_id)\nFOREIGN KEY (player_fifa_api_id) REFERENCES Player (player_fifa_api_id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_3", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg\", \"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_4", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg", + "sql": "SELECT\n (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores" + }, + "result": { + "content": [ + { + "type": "text", + "text": "1 row(s):\nResult coverage: fetched_rows=1; displayed_rows=1; 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): duplicate_player_api_ids=int; nonnumeric_heights=int; nonnumeric_heading_scores=int; missing_heading_scores=int; recorded_heading_scores=int; matched_heading_scores=int\nduplicate_player_api_ids | nonnumeric_heights | nonnumeric_heading_scores | missing_heading_scores | recorded_heading_scores | matched_heading_scores\n--- | --- | --- | --- | --- | ---\n0 | 0 | 0 | 836 | 183142 | 183142\nSQL: SELECT\n (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores\nLIMIT 1000" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_5", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8\", \"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_6", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8", + "expected_columns": [ + "player_name" + ], + "sql": "SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10" + }, + "result": { + "content": [ + { + "type": "text", + "text": "10 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=10; displayed_rows=10; 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): player_name=str\nplayer_name\n---\nMichael Ballack\nFernando Llorente\nJohn Terry\nNaldo\nLuca Toni\nPer Mertesacker\nDidier Drogba\nMiroslav Klose\nDaniel van Buyten\nFernando Morientes\nSQL: SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + } + ], + "answer": "```sql\nSELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10\n```", + "event_parse_errors": [], + "rows": 10, + "sql": "SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10", + "seconds": 27.069115000078455 + }, + "result": { + "columns": [ + "player_name" + ], + "row_count": 10, + "preview": [ + [ + "Michael Ballack" + ], + [ + "Fernando Llorente" + ], + [ + "John Terry" + ], + [ + "Naldo" + ], + [ + "Luca Toni" + ], + [ + "Per Mertesacker" + ], + [ + "Didier Drogba" + ], + [ + "Miroslav Klose" + ], + [ + "Daniel van Buyten" + ], + [ + "Fernando Morientes" + ] + ], + "preview_truncated": false, + "csv_sha256": "de8c7e4507a72874c03e3d9ac6538dbdfa306f8da26107de4675f16f716922a3" + } + } + } + ] +} diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/index.html b/bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/index.html new file mode 100644 index 00000000..11fee4a2 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird-comparison/index.html @@ -0,0 +1,476 @@ +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-integrated-20261127/bird-gpt-6.2-sol",
+    "manifest_sha256": "892185c34772ea9d34065bea7767745b45cd849537a6e20943877ef83202d68c",
+    "scores_sha256": "b52f082479fe9b649940c6b0aa2af9c1000e7a88ff1d34614616395cbb21791a",
+    "settings": {
+      "profiles": [
+        {
+          "name": "codex-mcp",
+          "model": "gpt-6.2-sol",
+          "reasoning_effort": "high"
+        }
+      ],
+      "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP",
+      "revision": "4d7f3a707587fab01a706461719c7e23f58c8dfe",
+      "codex_version": "codex-cli 0.170.0",
+      "sources": {
+        "bench/accuracy/codex_mcp.py": "5b87250f7b0f92903647327e91e8effab7b092b403569d930413644f1c97a173",
+        "src/lang2sql/frontends/mcp/server.py": "0836ca4631f321c3f3a2c7524e71f6f31e60ac77286633833af6810d3443ddcb"
+      },
+      "schema_document_sha256": "5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b",
+      "review_source": null,
+      "failure_selection": {
+        "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-prior-full-failures-20261127/bird-gpt-6.2-sol",
+        "manifest_sha256": "c6c2aa6d57836036c1986ff4ccb60daf4c2fbd69cb924004d21957ceae227e13",
+        "scores_sha256": "32ebf4704ef74a54b12221e18b457d9163c4eda1173df1321844cd94e95e3b98",
+        "excluded_passed_sources": [
+          {
+            "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-rate-projection-20261127/bird-gpt-6.2-sol",
+            "manifest_sha256": "f25f02f2d97ffad616b9fee428baaaf54092ec32684b0cd4124e0460c5d18145",
+            "scores_sha256": "006b2f995300ef903c6be3faa93af23349d27a1b816278cbf13538298fee9d8c"
+          },
+          {
+            "source": "/Users/seyoung/workspace/benchmarks/codex-mcp-reasoning-control-20261127/bird-xhigh",
+            "manifest_sha256": "56d2b682e6498f7c34cb3daac20723a460aab2e5310714de49b8ae452807b1bb",
+            "scores_sha256": "667745f0a9bd9dd57c7f8a7d5d789a28d975aa0448db56526fc63fe4a21f83d1"
+          }
+        ],
+        "exclusion_policy": "any pass in explicitly supplied completed runs; not an aggregate accuracy score",
+        "metric": "repair rate on selected prior failures, not full benchmark accuracy"
+      },
+      "split": "development",
+      "concurrency": 2,
+      "case_timeout": 600,
+      "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-projection-precedence-20261127/bird-gpt-6.2-sol",
+    "manifest_sha256": "395936fcc29e0990e3501063265fe134d0c2e6b9e0c9f91c257a022786a9fce8",
+    "scores_sha256": "9b6218728b28355fd15a4813aeb95275e424bdf196821ae84604ba20ce719a45",
+    "settings": {
+      "profiles": [
+        {
+          "name": "codex-mcp",
+          "model": "gpt-6.2-sol",
+          "reasoning_effort": "high"
+        }
+      ],
+      "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP",
+      "revision": "ed175330e7db5771b03da5e0aa6f64b02b24da1a",
+      "codex_version": "codex-cli 0.170.0",
+      "sources": {
+        "bench/accuracy/codex_mcp.py": "568ac45e5181e96aef4dd7b678bf435cf5b71752d986ed6082b9cbd111174e83",
+        "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"
+    }
+  }
+]
bird165: 0 -> 1
{
+  "instance_id": "bird165",
+  "db": "european_football_2",
+  "question": "List the ten players taller than 180 cm with the highest mean recorded heading accuracy, highest first. Break mean ties by player API ID.",
+  "evidence": ""
+}

SQL diff

--- before.sql
++++ after.sql
+@@ -1,10 +1,9 @@
+-SELECT
+-    p.player_name,
+-    AVG(pa.heading_accuracy) AS mean_heading_accuracy
+-FROM Player AS p
+-JOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id
++SELECT p.player_name
++FROM main.Player AS p
++JOIN main.Player_Attributes AS a
++    ON a.player_api_id = p.player_api_id
+ WHERE p.height > 180
+-  AND pa.heading_accuracy IS NOT NULL
++    AND a.heading_accuracy IS NOT NULL
+ GROUP BY p.player_api_id, p.player_name
+-ORDER BY mean_heading_accuracy DESC, p.player_api_id ASC
++ORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC
+ LIMIT 10

before: score 0

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

Final SQL / answer

SELECT
+    p.player_name,
+    AVG(pa.heading_accuracy) AS mean_heading_accuracy
+FROM Player AS p
+JOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id
+WHERE p.height > 180
+  AND pa.heading_accuracy IS NOT NULL
+GROUP BY p.player_api_id, p.player_name
+ORDER BY mean_heading_accuracy DESC, p.player_api_id ASC
+LIMIT 10

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

{
+  "columns": [
+    "player_name",
+    "mean_heading_accuracy"
+  ],
+  "row_count": 10,
+  "preview": [
+    [
+      "Michael Ballack",
+      "91.8"
+    ],
+    [
+      "Fernando Llorente",
+      "91.52380952380952"
+    ],
+    [
+      "John Terry",
+      "91.33333333333333"
+    ],
+    [
+      "Naldo",
+      "90.39285714285714"
+    ],
+    [
+      "Luca Toni",
+      "90.26470588235294"
+    ],
+    [
+      "Per Mertesacker",
+      "90.26470588235294"
+    ],
+    [
+      "Didier Drogba",
+      "90.23529411764706"
+    ],
+    [
+      "Miroslav Klose",
+      "90.17647058823529"
+    ],
+    [
+      "Daniel van Buyten",
+      "90.17647058823529"
+    ],
+    [
+      "Fernando Morientes",
+      "89.8"
+    ]
+  ],
+  "preview_truncated": false,
+  "csv_sha256": "cbc20e9cdbd30d90b10e36cd716b12affe008c0697fb90051bb543d51aa9c446"
+}
Every MCP call: arguments and results
[
+  {
+    "id": "item_1",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "explore_schema",
+    "arguments": {
+      "table": "Player_Attributes"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "Player_Attributes (table)\n- id: INTEGER\n- player_fifa_api_id: INTEGER\n- player_api_id: INTEGER\n- date: TEXT\n- overall_rating: INTEGER\n- potential: INTEGER\n- preferred_foot: TEXT\n- attacking_work_rate: TEXT\n- defensive_work_rate: TEXT\n- crossing: INTEGER\n- finishing: INTEGER\n- heading_accuracy: INTEGER\n- short_passing: INTEGER\n- volleys: INTEGER\n- dribbling: INTEGER\n- curve: INTEGER\n- free_kick_accuracy: INTEGER\n- long_passing: INTEGER\n- ball_control: INTEGER\n- acceleration: INTEGER\n- sprint_speed: INTEGER\n- agility: INTEGER\n- reactions: INTEGER\n- balance: INTEGER\n- shot_power: INTEGER\n- jumping: INTEGER\n- stamina: INTEGER\n- strength: INTEGER\n- long_shots: INTEGER\n- aggression: INTEGER\n- interceptions: INTEGER\n- positioning: INTEGER\n- vision: INTEGER\n- penalties: INTEGER\n- marking: INTEGER\n- standing_tackle: INTEGER\n- sliding_tackle: INTEGER\n- gk_diving: INTEGER\n- gk_handling: INTEGER\n- gk_kicking: INTEGER\n- gk_positioning: INTEGER\n- gk_reflexes: INTEGER\nPRIMARY KEY (id)\nFOREIGN KEY (player_api_id) REFERENCES Player (player_api_id)\nFOREIGN KEY (player_fifa_api_id) REFERENCES Player (player_fifa_api_id)"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_2",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "explore_schema",
+    "arguments": {
+      "table": "Player"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "Player (table)\n- id: INTEGER\n- player_api_id: INTEGER\n- player_name: TEXT\n- player_fifa_api_id: INTEGER\n- birthday: TEXT\n- height: INTEGER\n- weight: INTEGER\nPRIMARY KEY (id)"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_3",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"7NyZzt83wmzpxUi2Zbc-ACZNVJv28-ieV1QlP3LVG1w\", \"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_4",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "7NyZzt83wmzpxUi2Zbc-ACZNVJv28-ieV1QlP3LVG1w",
+      "sql": "SELECT\n    (SELECT COUNT(*) - COUNT(DISTINCT player_api_id) FROM Player) AS non_unique_or_null_player_ids,\n    (SELECT COUNT(*) FROM Player WHERE height IS NOT NULL AND typeof(height) NOT IN ('integer', 'real')) AS nonnumeric_heights,\n    COUNT(*) AS attribute_rows,\n    COUNT(pa.heading_accuracy) AS recorded_heading_rows,\n    COUNT(CASE WHEN pa.heading_accuracy IS NOT NULL AND typeof(pa.heading_accuracy) NOT IN ('integer', 'real') THEN 1 END) AS nonnumeric_heading_rows,\n    COUNT(CASE WHEN p.player_api_id IS NOT NULL THEN 1 END) AS matched_attribute_rows\nFROM Player_Attributes AS pa\nLEFT JOIN Player AS p ON p.player_api_id = pa.player_api_id;"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "1 row(s):\nResult coverage: fetched_rows=1; displayed_rows=1; 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): non_unique_or_null_player_ids=int; nonnumeric_heights=int; attribute_rows=int; recorded_heading_rows=int; nonnumeric_heading_rows=int; matched_attribute_rows=int\nnon_unique_or_null_player_ids | nonnumeric_heights | attribute_rows | recorded_heading_rows | nonnumeric_heading_rows | matched_attribute_rows\n--- | --- | --- | --- | --- | ---\n0 | 0 | 183978 | 183142 | 0 | 183978\nSQL: SELECT\n    (SELECT COUNT(*) - COUNT(DISTINCT player_api_id) FROM Player) AS non_unique_or_null_player_ids,\n    (SELECT COUNT(*) FROM Player WHERE height IS NOT NULL AND typeof(height) NOT IN ('integer', 'real')) AS nonnumeric_heights,\n    COUNT(*) AS attribute_rows,\n    COUNT(pa.heading_accuracy) AS recorded_heading_rows,\n    COUNT(CASE WHEN pa.heading_accuracy IS NOT NULL AND typeof(pa.heading_accuracy) NOT IN ('integer', 'real') THEN 1 END) AS nonnumeric_heading_rows,\n    COUNT(CASE WHEN p.player_api_id IS NOT NULL THEN 1 END) AS matched_attribute_rows\nFROM Player_Attributes AS pa\nLEFT JOIN Player AS p ON p.player_api_id = pa.player_api_id\nLIMIT 1000"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_5",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"6c3LoaymXQgz1RllE7q8PIHDe6fzgcnhwBmFT28BtpE\", \"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_6",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "6c3LoaymXQgz1RllE7q8PIHDe6fzgcnhwBmFT28BtpE",
+      "expected_columns": [
+        "player_name",
+        "mean_heading_accuracy"
+      ],
+      "sql": "SELECT\n    p.player_name,\n    AVG(pa.heading_accuracy) AS mean_heading_accuracy\nFROM Player AS p\nJOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id\nWHERE p.height > 180\n  AND pa.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY mean_heading_accuracy DESC, p.player_api_id ASC\nLIMIT 10"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "10 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=10; displayed_rows=10; 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): player_name=str; mean_heading_accuracy=float\nplayer_name | mean_heading_accuracy\n--- | ---\nMichael Ballack | 91.8\nFernando Llorente | 91.52380952380952\nJohn Terry | 91.33333333333333\nNaldo | 90.39285714285714\nLuca Toni | 90.26470588235294\nPer Mertesacker | 90.26470588235294\nDidier Drogba | 90.23529411764706\nMiroslav Klose | 90.17647058823529\nDaniel van Buyten | 90.17647058823529\nFernando Morientes | 89.8\nSQL: SELECT\n    p.player_name,\n    AVG(pa.heading_accuracy) AS mean_heading_accuracy\nFROM Player AS p\nJOIN Player_Attributes AS pa ON pa.player_api_id = p.player_api_id\nWHERE p.height > 180\n  AND pa.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY mean_heading_accuracy DESC, p.player_api_id ASC\nLIMIT 10"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  }
+]

after: score 1

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

Final SQL / answer

SELECT p.player_name
+FROM main.Player AS p
+JOIN main.Player_Attributes AS a
+    ON a.player_api_id = p.player_api_id
+WHERE p.height > 180
+    AND a.heading_accuracy IS NOT NULL
+GROUP BY p.player_api_id, p.player_name
+ORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC
+LIMIT 10

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

{
+  "columns": [
+    "player_name"
+  ],
+  "row_count": 10,
+  "preview": [
+    [
+      "Michael Ballack"
+    ],
+    [
+      "Fernando Llorente"
+    ],
+    [
+      "John Terry"
+    ],
+    [
+      "Naldo"
+    ],
+    [
+      "Luca Toni"
+    ],
+    [
+      "Per Mertesacker"
+    ],
+    [
+      "Didier Drogba"
+    ],
+    [
+      "Miroslav Klose"
+    ],
+    [
+      "Daniel van Buyten"
+    ],
+    [
+      "Fernando Morientes"
+    ]
+  ],
+  "preview_truncated": false,
+  "csv_sha256": "de8c7e4507a72874c03e3d9ac6538dbdfa306f8da26107de4675f16f716922a3"
+}
Every MCP call: arguments and results
[
+  {
+    "id": "item_1",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "explore_schema",
+    "arguments": {
+      "table": "Player"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "Player (table)\n- id: INTEGER\n- player_api_id: INTEGER\n- player_name: TEXT\n- player_fifa_api_id: INTEGER\n- birthday: TEXT\n- height: INTEGER\n- weight: INTEGER\nPRIMARY KEY (id)"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_2",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "explore_schema",
+    "arguments": {
+      "table": "Player_Attributes"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "Player_Attributes (table)\n- id: INTEGER\n- player_fifa_api_id: INTEGER\n- player_api_id: INTEGER\n- date: TEXT\n- overall_rating: INTEGER\n- potential: INTEGER\n- preferred_foot: TEXT\n- attacking_work_rate: TEXT\n- defensive_work_rate: TEXT\n- crossing: INTEGER\n- finishing: INTEGER\n- heading_accuracy: INTEGER\n- short_passing: INTEGER\n- volleys: INTEGER\n- dribbling: INTEGER\n- curve: INTEGER\n- free_kick_accuracy: INTEGER\n- long_passing: INTEGER\n- ball_control: INTEGER\n- acceleration: INTEGER\n- sprint_speed: INTEGER\n- agility: INTEGER\n- reactions: INTEGER\n- balance: INTEGER\n- shot_power: INTEGER\n- jumping: INTEGER\n- stamina: INTEGER\n- strength: INTEGER\n- long_shots: INTEGER\n- aggression: INTEGER\n- interceptions: INTEGER\n- positioning: INTEGER\n- vision: INTEGER\n- penalties: INTEGER\n- marking: INTEGER\n- standing_tackle: INTEGER\n- sliding_tackle: INTEGER\n- gk_diving: INTEGER\n- gk_handling: INTEGER\n- gk_kicking: INTEGER\n- gk_positioning: INTEGER\n- gk_reflexes: INTEGER\nPRIMARY KEY (id)\nFOREIGN KEY (player_api_id) REFERENCES Player (player_api_id)\nFOREIGN KEY (player_fifa_api_id) REFERENCES Player (player_fifa_api_id)"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_3",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg\", \"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_4",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg",
+      "sql": "SELECT\n    (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n    (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n    (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n    (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n    (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n    (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "1 row(s):\nResult coverage: fetched_rows=1; displayed_rows=1; 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): duplicate_player_api_ids=int; nonnumeric_heights=int; nonnumeric_heading_scores=int; missing_heading_scores=int; recorded_heading_scores=int; matched_heading_scores=int\nduplicate_player_api_ids | nonnumeric_heights | nonnumeric_heading_scores | missing_heading_scores | recorded_heading_scores | matched_heading_scores\n--- | --- | --- | --- | --- | ---\n0 | 0 | 0 | 836 | 183142 | 183142\nSQL: SELECT\n    (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n    (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n    (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n    (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n    (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n    (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores\nLIMIT 1000"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  },
+  {
+    "id": "item_5",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "resolve_business_terms",
+    "arguments": {
+      "terms": []
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "{\"definition_check_id\": \"0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8\", \"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_6",
+    "type": "mcp_tool_call",
+    "server": "lang2sql",
+    "tool": "run_sql",
+    "arguments": {
+      "definition_check_id": "0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8",
+      "expected_columns": [
+        "player_name"
+      ],
+      "sql": "SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n    ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n    AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10"
+    },
+    "result": {
+      "content": [
+        {
+          "type": "text",
+          "text": "10 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=10; displayed_rows=10; 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): player_name=str\nplayer_name\n---\nMichael Ballack\nFernando Llorente\nJohn Terry\nNaldo\nLuca Toni\nPer Mertesacker\nDidier Drogba\nMiroslav Klose\nDaniel van Buyten\nFernando Morientes\nSQL: SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n    ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n    AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10"
+        }
+      ],
+      "structured_content": null
+    },
+    "error": null,
+    "status": "completed"
+  }
+]
\ No newline at end of file diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/csv/bird165.csv b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/csv/bird165.csv new file mode 100644 index 00000000..31856d7e --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/csv/bird165.csv @@ -0,0 +1,11 @@ +player_name +Michael Ballack +Fernando Llorente +John Terry +Naldo +Luca Toni +Per Mertesacker +Didier Drogba +Miroslav Klose +Daniel van Buyten +Fernando Morientes diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.answer.txt b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.answer.txt new file mode 100644 index 00000000..3f0da88f --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.answer.txt @@ -0,0 +1,11 @@ +```sql +SELECT p.player_name +FROM main.Player AS p +JOIN main.Player_Attributes AS a + ON a.player_api_id = p.player_api_id +WHERE p.height > 180 + AND a.heading_accuracy IS NOT NULL +GROUP BY p.player_api_id, p.player_name +ORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC +LIMIT 10 +``` \ No newline at end of file diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.jsonl b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.jsonl new file mode 100644 index 00000000..c8f5852f --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.jsonl @@ -0,0 +1,17 @@ +{"type":"thread.started","thread_id":"01a21986-b717-7e70-ba96-46122946e05a"} +{"type":"turn.started"} +{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"I’ll verify the player and attribute columns in Lang2SQL, then run the ranking query and inspect the returned rows."}} +{"type":"item.started","item":{"id":"item_1","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"Player"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_1","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"Player"},"result":{"content":[{"type":"text","text":"Player (table)\n- id: INTEGER\n- player_api_id: INTEGER\n- player_name: TEXT\n- player_fifa_api_id: INTEGER\n- birthday: TEXT\n- height: INTEGER\n- weight: INTEGER\nPRIMARY KEY (id)"}],"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":"Player_Attributes"},"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":"Player_Attributes"},"result":{"content":[{"type":"text","text":"Player_Attributes (table)\n- id: INTEGER\n- player_fifa_api_id: INTEGER\n- player_api_id: INTEGER\n- date: TEXT\n- overall_rating: INTEGER\n- potential: INTEGER\n- preferred_foot: TEXT\n- attacking_work_rate: TEXT\n- defensive_work_rate: TEXT\n- crossing: INTEGER\n- finishing: INTEGER\n- heading_accuracy: INTEGER\n- short_passing: INTEGER\n- volleys: INTEGER\n- dribbling: INTEGER\n- curve: INTEGER\n- free_kick_accuracy: INTEGER\n- long_passing: INTEGER\n- ball_control: INTEGER\n- acceleration: INTEGER\n- sprint_speed: INTEGER\n- agility: INTEGER\n- reactions: INTEGER\n- balance: INTEGER\n- shot_power: INTEGER\n- jumping: INTEGER\n- stamina: INTEGER\n- strength: INTEGER\n- long_shots: INTEGER\n- aggression: INTEGER\n- interceptions: INTEGER\n- positioning: INTEGER\n- vision: INTEGER\n- penalties: INTEGER\n- marking: INTEGER\n- standing_tackle: INTEGER\n- sliding_tackle: INTEGER\n- gk_diving: INTEGER\n- gk_handling: INTEGER\n- gk_kicking: INTEGER\n- gk_positioning: INTEGER\n- gk_reflexes: INTEGER\nPRIMARY KEY (id)\nFOREIGN KEY (player_api_id) REFERENCES Player (player_api_id)\nFOREIGN KEY (player_fifa_api_id) REFERENCES Player (player_fifa_api_id)"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.started","item":{"id":"item_3","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_3","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg\", \"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_4","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg","sql":"SELECT\n (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_4","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg","sql":"SELECT\n (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores"},"result":{"content":[{"type":"text","text":"1 row(s):\nResult coverage: fetched_rows=1; displayed_rows=1; 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): duplicate_player_api_ids=int; nonnumeric_heights=int; nonnumeric_heading_scores=int; missing_heading_scores=int; recorded_heading_scores=int; matched_heading_scores=int\nduplicate_player_api_ids | nonnumeric_heights | nonnumeric_heading_scores | missing_heading_scores | recorded_heading_scores | matched_heading_scores\n--- | --- | --- | --- | --- | ---\n0 | 0 | 0 | 836 | 183142 | 183142\nSQL: SELECT\n (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores\nLIMIT 1000"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.started","item":{"id":"item_5","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_5","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8\", \"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_6","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8","expected_columns":["player_name"],"sql":"SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10"},"result":null,"error":null,"status":"in_progress"}} +{"type":"item.completed","item":{"id":"item_6","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8","expected_columns":["player_name"],"sql":"SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10"},"result":{"content":[{"type":"text","text":"10 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=10; displayed_rows=10; 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): player_name=str\nplayer_name\n---\nMichael Ballack\nFernando Llorente\nJohn Terry\nNaldo\nLuca Toni\nPer Mertesacker\nDidier Drogba\nMiroslav Klose\nDaniel van Buyten\nFernando Morientes\nSQL: SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10"}],"structured_content":null},"error":null,"status":"completed"}} +{"type":"item.completed","item":{"id":"item_7","type":"agent_message","text":"```sql\nSELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10\n```"}} +{"type":"turn.completed","usage":{"input_tokens":179416,"cached_input_tokens":165248,"cache_write_input_tokens":0,"output_tokens":787,"reasoning_output_tokens":97}} diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.prompt.txt b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.prompt.txt new file mode 100644 index 00000000..f094f214 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.prompt.txt @@ -0,0 +1,262 @@ +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. +List the ten players taller than 180 cm with the highest mean recorded heading accuracy, highest first. Break mean ties by player API ID. +Official schema metadata (examples are not exhaustive): +CREATE TABLE `Player_Attributes` ( + `id` INTEGER, -- the unique id for players; example: [1, 2] + `player_fifa_api_id` INTEGER, -- the id of the player fifa api; example: [218353] + `player_api_id` INTEGER, -- the id of the player api; example: [505942] + `date` TEXT, -- date; example: ['2016-02-18 00:00:00', '2015-11-19 00:00:00'] + `overall_rating` INTEGER, -- the overall rating of the player; example: [67, 62] + `potential` INTEGER, -- potential of the player; example: [71, 66] + `preferred_foot` TEXT, -- the player's preferred foot when attacking; example: ['right'] + `attacking_work_rate` TEXT, -- the player's attacking work rate; example: ['medium'] + `defensive_work_rate` TEXT, -- the player's defensive work rate; example: ['medium'] + `crossing` INTEGER, -- the player's crossing score; example: [49, 48] + `finishing` INTEGER, -- the player's finishing rate; example: [44, 43] + `heading_accuracy` INTEGER, -- the player's heading accuracy; example: [71, 70] + `short_passing` INTEGER, -- the player's short passing score; example: [61, 60] + `volleys` INTEGER, -- the player's volley score; example: [44, 43] + `dribbling` INTEGER, -- the player's dribbling score; example: [51, 50] + `curve` INTEGER, -- the player's curve score; example: [45, 44] + `free_kick_accuracy` INTEGER, -- the player's free kick accuracy; example: [39, 38] + `long_passing` INTEGER, -- the player's long passing score; example: [64, 63] + `ball_control` INTEGER, -- the player's ball control score; example: [49, 48] + `acceleration` INTEGER, -- the player's acceleration score; example: [60] + `sprint_speed` INTEGER, -- the player's sprint speed; example: [64] + `agility` INTEGER, -- the player's agility; example: [59] + `reactions` INTEGER, -- the player's reactions score; example: [47, 46] + `balance` INTEGER, -- the player's balance score; example: [65] + `shot_power` INTEGER, -- the player's shot power; example: [55, 54] + `jumping` INTEGER, -- the player's jumping score; example: [58] + `stamina` INTEGER, -- the player's stamina score; example: [54] + `strength` INTEGER, -- the player's strength score; example: [76] + `long_shots` INTEGER, -- the player's long shots score; example: [35, 34] + `aggression` INTEGER, -- the player's aggression score; example: [71, 63] + `interceptions` INTEGER, -- the player's interceptions score; example: [70, 41] + `positioning` INTEGER, -- the player's positioning score; example: [45, 44] + `vision` INTEGER, -- the player's vision score; example: [54, 53] + `penalties` INTEGER, -- the player's penalties score; example: [48, 47] + `marking` INTEGER, -- the player's markingscore; example: [65, 62] + `standing_tackle` INTEGER, -- the player's standing tackle score; example: [69, 66] + `sliding_tackle` INTEGER, -- the player's sliding tackle score; example: [69, 66] + `gk_diving` INTEGER, -- the player's goalkeep diving score; example: [6, 5] + `gk_handling` INTEGER, -- the player's goalkeep diving score; example: [11, 10] + `gk_kicking` INTEGER, -- the player's goalkeep kicking score; example: [10, 9] + `gk_positioning` INTEGER, -- the player's goalkeep positioning score; example: [8, 7] + `gk_reflexes` INTEGER, -- the player's goalkeep reflexes score; example: [8, 7] + PRIMARY KEY (`id`), + FOREIGN KEY (`player_api_id`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`player_fifa_api_id`) REFERENCES `Player` (`player_fifa_api_id`) +); + +CREATE TABLE `Player` ( + `id` INTEGER, -- the unique id for players; example: [1, 2] + `player_api_id` INTEGER, -- the id of the player api; example: [505942, 155782] + `player_name` TEXT, -- player name; example: ['Aaron Appindangoye', 'Aaron Cresswell'] + `player_fifa_api_id` INTEGER, -- the id of the player fifa api; example: [218353, 189615] + `birthday` TEXT, -- the player's birthday; example: ['1992-02-29 00:00:00', '1989-12-15 00:00:00'] + `height` INTEGER, -- the player's height; example: [182, 170] + `weight` INTEGER, -- the player's weight; example: [187, 146] + PRIMARY KEY (`id`) +); + +CREATE TABLE `League` ( + `id` INTEGER, -- the unique id for leagues; example: [1, 1729] + `country_id` INTEGER, -- the unique id for countries; example: [1, 1729] + `name` TEXT, -- league name; example: ['Belgium Jupiler League', 'England Premier League'] + PRIMARY KEY (`id`), + FOREIGN KEY (`country_id`) REFERENCES `Country` (`id`) +); + +CREATE TABLE `Country` ( + `id` INTEGER, -- the unique id for countries; example: [1, 1729] + `name` TEXT, -- country name; example: ['Belgium', 'England'] + PRIMARY KEY (`id`) +); + +CREATE TABLE `Team` ( + `id` INTEGER, -- the unique id for teams; example: [1, 2] + `team_api_id` INTEGER, -- the id of the team api; example: [9987, 9993] + `team_fifa_api_id` INTEGER, -- the id of the team fifa api; example: [673, 675] + `team_long_name` TEXT, -- the team's long name; example: ['KRC Genk', 'Beerschot AC'] + `team_short_name` TEXT, -- the team's short name; example: ['GEN', 'BAC'] + PRIMARY KEY (`id`) +); + +CREATE TABLE `Team_Attributes` ( + `id` INTEGER, -- the unique id for teams; example: [1, 2] + `team_fifa_api_id` INTEGER, -- the id of the team fifa api; example: [434, 77] + `team_api_id` INTEGER, -- the id of the team api; example: [9930, 8485] + `date` TEXT, -- Date; example: ['2010-02-22 00:00:00', '2014-09-19 00:00:00'] + `buildUpPlaySpeed` INTEGER, -- the speed in which attacks are put together; example: [60, 52] + `buildUpPlaySpeedClass` TEXT, -- the speed class; example: ['Balanced', 'Fast'] + `buildUpPlayDribbling` INTEGER, -- the tendency/ frequency of dribbling; example: [48, 41] + `buildUpPlayDribblingClass` TEXT, -- the dribbling class; example: ['Little', 'Normal'] + `buildUpPlayPassing` INTEGER, -- affects passing distance and support from teammates; example: [50, 56] + `buildUpPlayPassingClass` TEXT, -- the passing class; example: ['Mixed', 'Long'] + `buildUpPlayPositioningClass` TEXT, -- A team's freedom of movement in the 1st two thirds of the pitch; example: ['Organised'] + `chanceCreationPassing` INTEGER, -- Amount of risk in pass decision and run support; example: [60, 54] + `chanceCreationPassingClass` TEXT, -- the chance creation passing class; example: ['Normal', 'Risky'] + `chanceCreationCrossing` INTEGER, -- The tendency / frequency of crosses into the box; example: [65, 63] + `chanceCreationCrossingClass` TEXT, -- the chance creation crossing class; example: ['Normal', 'Lots'] + `chanceCreationShooting` INTEGER, -- The tendency / frequency of shots taken; example: [55, 64] + `chanceCreationShootingClass` TEXT, -- the chance creation shooting class; example: ['Normal', 'Lots'] + `chanceCreationPositioningClass` TEXT, -- A team�s freedom of movement in the final third of the pitch; example: ['Organised'] + `defencePressure` INTEGER, -- Affects how high up the pitch the team will start pressuring; example: [50, 47] + `defencePressureClass` TEXT, -- the defence pressure class; example: ['Medium'] + `defenceAggression` INTEGER, -- Affect the team�s approach to tackling the ball possessor; example: [55, 44] + `defenceAggressionClass` TEXT, -- the defence aggression class; example: ['Press', 'Double'] + `defenceTeamWidth` INTEGER, -- Affects how much the team will shift to the ball side; example: [45, 54] + `defenceTeamWidthClass` TEXT, -- the defence team width class; example: ['Normal', 'Wide'] + `defenceDefenderLineClass` TEXT, -- Affects the shape and strategy of the defence; example: ['Cover'] + PRIMARY KEY (`id`), + FOREIGN KEY (`team_api_id`) REFERENCES `Team` (`team_api_id`), + FOREIGN KEY (`team_fifa_api_id`) REFERENCES `Team` (`team_fifa_api_id`) +); + +CREATE TABLE `Match` ( + `id` INTEGER, -- the unique id for matches; example: [1, 2] + `country_id` INTEGER, -- country id; example: [1] + `league_id` INTEGER, -- league id; example: [1] + `season` TEXT, -- the season of the match; example: ['2008/2009'] + `stage` INTEGER, -- the stage of the match; example: [1] + `date` TEXT, -- the date of the match; example: ['2008-08-17 00:00:00', '2008-08-16 00:00:00'] + `match_api_id` INTEGER, -- the id of the match api; example: [492473, 492474] + `home_team_api_id` INTEGER, -- the id of the home team api; example: [9987, 10000] + `away_team_api_id` INTEGER, -- the id of the away team api; example: [9993, 9994] + `home_team_goal` INTEGER, -- the goal of the home team; example: [1, 0] + `away_team_goal` INTEGER, -- the goal of the away team; example: [1, 0] + `home_player_X1` INTEGER, -- example: [] + `home_player_X2` INTEGER, -- example: [] + `home_player_X3` INTEGER, -- example: [] + `home_player_X4` INTEGER, -- example: [] + `home_player_X5` INTEGER, -- example: [] + `home_player_X6` INTEGER, -- example: [] + `home_player_X7` INTEGER, -- example: [] + `home_player_X8` INTEGER, -- example: [] + `home_player_X9` INTEGER, -- example: [] + `home_player_X10` INTEGER, -- example: [] + `home_player_X11` INTEGER, -- example: [] + `away_player_X1` INTEGER, -- example: [] + `away_player_X2` INTEGER, -- example: [] + `away_player_X3` INTEGER, -- example: [] + `away_player_X4` INTEGER, -- example: [] + `away_player_X5` INTEGER, -- example: [] + `away_player_X6` INTEGER, -- example: [] + `away_player_X7` INTEGER, -- example: [] + `away_player_X8` INTEGER, -- example: [] + `away_player_X9` INTEGER, -- example: [] + `away_player_X10` INTEGER, -- example: [] + `away_player_X11` INTEGER, -- example: [] + `home_player_Y1` INTEGER, -- example: [] + `home_player_Y2` INTEGER, -- example: [] + `home_player_Y3` INTEGER, -- example: [] + `home_player_Y4` INTEGER, -- example: [] + `home_player_Y5` INTEGER, -- example: [] + `home_player_Y6` INTEGER, -- example: [] + `home_player_Y7` INTEGER, -- example: [] + `home_player_Y8` INTEGER, -- example: [] + `home_player_Y9` INTEGER, -- example: [] + `home_player_Y10` INTEGER, -- example: [] + `home_player_Y11` INTEGER, -- example: [] + `away_player_Y1` INTEGER, -- example: [] + `away_player_Y2` INTEGER, -- example: [] + `away_player_Y3` INTEGER, -- example: [] + `away_player_Y4` INTEGER, -- example: [] + `away_player_Y5` INTEGER, -- example: [] + `away_player_Y6` INTEGER, -- example: [] + `away_player_Y7` INTEGER, -- example: [] + `away_player_Y8` INTEGER, -- example: [] + `away_player_Y9` INTEGER, -- example: [] + `away_player_Y10` INTEGER, -- example: [] + `away_player_Y11` INTEGER, -- example: [] + `home_player_1` INTEGER, -- example: [] + `home_player_2` INTEGER, -- example: [] + `home_player_3` INTEGER, -- example: [] + `home_player_4` INTEGER, -- example: [] + `home_player_5` INTEGER, -- example: [] + `home_player_6` INTEGER, -- example: [] + `home_player_7` INTEGER, -- example: [] + `home_player_8` INTEGER, -- example: [] + `home_player_9` INTEGER, -- example: [] + `home_player_10` INTEGER, -- example: [] + `home_player_11` INTEGER, -- example: [] + `away_player_1` INTEGER, -- example: [] + `away_player_2` INTEGER, -- example: [] + `away_player_3` INTEGER, -- example: [] + `away_player_4` INTEGER, -- example: [] + `away_player_5` INTEGER, -- example: [] + `away_player_6` INTEGER, -- example: [] + `away_player_7` INTEGER, -- example: [] + `away_player_8` INTEGER, -- example: [] + `away_player_9` INTEGER, -- example: [] + `away_player_10` INTEGER, -- example: [] + `away_player_11` INTEGER, -- example: [] + `goal` TEXT, -- the goal of the match; example: [] + `shoton` TEXT, -- the shot on goal of the match; example: [] + `shotoff` TEXT, -- the shot off goal of the match, which is the opposite of shot on; example: [] + `foulcommit` TEXT, -- the fouls occurred in the match; example: [] + `card` TEXT, -- the cards given in the match; example: [] + `cross` TEXT, -- Balls sent into the opposition team's area from a wide position in the match; example: [] + `corner` TEXT, -- Ball goes out of play for a corner kick in the match; example: [] + `possession` TEXT, -- The duration from a player taking over the ball in the match; example: [] + `B365H` REAL, -- example: [1.73, 1.95] + `B365D` REAL, -- example: [3.4, 3.2] + `B365A` REAL, -- example: [5.0, 3.6] + `BWH` REAL, -- example: [1.75, 1.8] + `BWD` REAL, -- example: [3.35, 3.3] + `BWA` REAL, -- example: [4.2, 3.95] + `IWH` REAL, -- example: [1.85, 1.9] + `IWD` REAL, -- example: [3.2, 3.1] + `IWA` REAL, -- example: [3.5, 2.3] + `LBH` REAL, -- example: [1.8, 1.9] + `LBD` REAL, -- example: [3.3, 3.2] + `LBA` REAL, -- example: [3.75, 3.5] + `PSH` REAL, -- example: [] + `PSD` REAL, -- example: [] + `PSA` REAL, -- example: [] + `WHH` REAL, -- example: [1.7, 1.83] + `WHD` REAL, -- example: [3.3, 3.25] + `WHA` REAL, -- example: [4.33, 3.6] + `SJH` REAL, -- example: [1.9, 1.95] + `SJD` REAL, -- example: [3.3, 4.0] + `SJA` REAL, -- example: [4.0, 3.8] + `VCH` REAL, -- example: [1.65, 2.0] + `VCD` REAL, -- example: [3.4, 3.25] + `VCA` REAL, -- example: [4.5, 3.25] + `GBH` REAL, -- example: [1.78, 1.85] + `GBD` REAL, -- example: [3.25, 3.2] + `GBA` REAL, -- example: [4.0, 3.75] + `BSH` REAL, -- example: [1.73, 1.91] + `BSD` REAL, -- example: [3.4, 3.25] + `BSA` REAL, -- example: [4.2, 3.6] + PRIMARY KEY (`id`), + FOREIGN KEY (`away_player_11`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_10`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_9`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_8`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_7`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_6`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_5`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_4`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_3`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_2`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_player_1`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_11`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_10`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_9`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_8`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_7`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_6`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_5`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_4`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_3`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_2`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`home_player_1`) REFERENCES `Player` (`player_api_id`), + FOREIGN KEY (`away_team_api_id`) REFERENCES `Team` (`team_api_id`), + FOREIGN KEY (`home_team_api_id`) REFERENCES `Team` (`team_api_id`), + FOREIGN KEY (`country_id`) REFERENCES `Country` (`id`), + FOREIGN KEY (`league_id`) REFERENCES `League` (`id`) +); + +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/projection-precedence/bird/codex-mcp/events/bird165.stderr b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/events/bird165.stderr new file mode 100644 index 00000000..e69de29b diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/records/bird165.json b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/records/bird165.json new file mode 100644 index 00000000..6adf94d5 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/records/bird165.json @@ -0,0 +1,151 @@ +{ + "instance_id": "bird165", + "profile": "codex-mcp", + "model": "gpt-6.2-sol", + "status": "predicted", + "calls": [], + "prompt_sha256": "16d3480a9ffc64a3f33d66a227260c09d32eab869ece0d73c00fb3deb546cf98", + "events_sha256": "b105940d0a2e7ef75956a64667bb81e615dd6d466b0e7e4eacf0de855d0cede2", + "cli_exit_code": 0, + "cli_usage": [ + { + "input_tokens": 179416, + "cached_input_tokens": 165248, + "cache_write_input_tokens": 0, + "output_tokens": 787, + "reasoning_output_tokens": 97 + } + ], + "mcp_calls": [ + { + "id": "item_1", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "Player" + }, + "result": { + "content": [ + { + "type": "text", + "text": "Player (table)\n- id: INTEGER\n- player_api_id: INTEGER\n- player_name: TEXT\n- player_fifa_api_id: INTEGER\n- birthday: TEXT\n- height: INTEGER\n- weight: INTEGER\nPRIMARY KEY (id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_2", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "explore_schema", + "arguments": { + "table": "Player_Attributes" + }, + "result": { + "content": [ + { + "type": "text", + "text": "Player_Attributes (table)\n- id: INTEGER\n- player_fifa_api_id: INTEGER\n- player_api_id: INTEGER\n- date: TEXT\n- overall_rating: INTEGER\n- potential: INTEGER\n- preferred_foot: TEXT\n- attacking_work_rate: TEXT\n- defensive_work_rate: TEXT\n- crossing: INTEGER\n- finishing: INTEGER\n- heading_accuracy: INTEGER\n- short_passing: INTEGER\n- volleys: INTEGER\n- dribbling: INTEGER\n- curve: INTEGER\n- free_kick_accuracy: INTEGER\n- long_passing: INTEGER\n- ball_control: INTEGER\n- acceleration: INTEGER\n- sprint_speed: INTEGER\n- agility: INTEGER\n- reactions: INTEGER\n- balance: INTEGER\n- shot_power: INTEGER\n- jumping: INTEGER\n- stamina: INTEGER\n- strength: INTEGER\n- long_shots: INTEGER\n- aggression: INTEGER\n- interceptions: INTEGER\n- positioning: INTEGER\n- vision: INTEGER\n- penalties: INTEGER\n- marking: INTEGER\n- standing_tackle: INTEGER\n- sliding_tackle: INTEGER\n- gk_diving: INTEGER\n- gk_handling: INTEGER\n- gk_kicking: INTEGER\n- gk_positioning: INTEGER\n- gk_reflexes: INTEGER\nPRIMARY KEY (id)\nFOREIGN KEY (player_api_id) REFERENCES Player (player_api_id)\nFOREIGN KEY (player_fifa_api_id) REFERENCES Player (player_fifa_api_id)" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_3", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg\", \"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_4", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "2ga8R995GPweTtArS2G7tzjCHyuvviQZ4l1iy6PxYUg", + "sql": "SELECT\n (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores" + }, + "result": { + "content": [ + { + "type": "text", + "text": "1 row(s):\nResult coverage: fetched_rows=1; displayed_rows=1; 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): duplicate_player_api_ids=int; nonnumeric_heights=int; nonnumeric_heading_scores=int; missing_heading_scores=int; recorded_heading_scores=int; matched_heading_scores=int\nduplicate_player_api_ids | nonnumeric_heights | nonnumeric_heading_scores | missing_heading_scores | recorded_heading_scores | matched_heading_scores\n--- | --- | --- | --- | --- | ---\n0 | 0 | 0 | 836 | 183142 | 183142\nSQL: SELECT\n (SELECT COUNT(player_api_id) - COUNT(DISTINCT player_api_id) FROM main.Player) AS duplicate_player_api_ids,\n (SELECT COUNT(*) FROM main.Player WHERE typeof(height) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heights,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE typeof(heading_accuracy) NOT IN ('integer', 'real', 'null')) AS nonnumeric_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NULL) AS missing_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes WHERE heading_accuracy IS NOT NULL) AS recorded_heading_scores,\n (SELECT COUNT(*) FROM main.Player_Attributes AS a JOIN main.Player AS p ON p.player_api_id = a.player_api_id WHERE a.heading_accuracy IS NOT NULL) AS matched_heading_scores\nLIMIT 1000" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + }, + { + "id": "item_5", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "resolve_business_terms", + "arguments": { + "terms": [] + }, + "result": { + "content": [ + { + "type": "text", + "text": "{\"definition_check_id\": \"0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8\", \"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_6", + "type": "mcp_tool_call", + "server": "lang2sql", + "tool": "run_sql", + "arguments": { + "definition_check_id": "0HLR6G0fjDUujMYVsKu1Tqay7QTk2cWNeyaiSnFaRB8", + "expected_columns": [ + "player_name" + ], + "sql": "SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10" + }, + "result": { + "content": [ + { + "type": "text", + "text": "10 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=10; displayed_rows=10; 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): player_name=str\nplayer_name\n---\nMichael Ballack\nFernando Llorente\nJohn Terry\nNaldo\nLuca Toni\nPer Mertesacker\nDidier Drogba\nMiroslav Klose\nDaniel van Buyten\nFernando Morientes\nSQL: SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10" + } + ], + "structured_content": null + }, + "error": null, + "status": "completed" + } + ], + "answer": "```sql\nSELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10\n```", + "event_parse_errors": [], + "rows": 10, + "sql": "SELECT p.player_name\nFROM main.Player AS p\nJOIN main.Player_Attributes AS a\n ON a.player_api_id = p.player_api_id\nWHERE p.height > 180\n AND a.heading_accuracy IS NOT NULL\nGROUP BY p.player_api_id, p.player_name\nORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC\nLIMIT 10", + "seconds": 27.069115000078455 +} diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/scores.json b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/scores.json new file mode 100644 index 00000000..c78de560 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/scores.json @@ -0,0 +1,7 @@ +[ + { + "instance_id": "bird165", + "score": 1, + "status": "predicted" + } +] diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/sql/bird165.sql b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/sql/bird165.sql new file mode 100644 index 00000000..a1937cad --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/sql/bird165.sql @@ -0,0 +1,9 @@ +SELECT p.player_name +FROM main.Player AS p +JOIN main.Player_Attributes AS a + ON a.player_api_id = p.player_api_id +WHERE p.height > 180 + AND a.heading_accuracy IS NOT NULL +GROUP BY p.player_api_id, p.player_name +ORDER BY AVG(a.heading_accuracy) DESC, p.player_api_id ASC +LIMIT 10 diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/status.json b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/status.json new file mode 100644 index 00000000..23279d19 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/codex-mcp/status.json @@ -0,0 +1,4 @@ +{ + "status": "completed", + "wall_seconds": 27.069786416948773 +} diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/manifest.json b/bench/accuracy/mcp-review-results/projection-precedence/bird/manifest.json new file mode 100644 index 00000000..f8dd9bb6 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/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": "bird165", + "db": "european_football_2", + "question": "List the ten players taller than 180 cm with the highest mean recorded heading accuracy, highest first. Break mean ties by player API ID.", + "evidence": "" + } + ], + "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": [ + "bird165" + ], + "holdout_ids": [], + "split_seed": 20261126 +} diff --git a/bench/accuracy/mcp-review-results/projection-precedence/bird/settings.json b/bench/accuracy/mcp-review-results/projection-precedence/bird/settings.json new file mode 100644 index 00000000..eea24c21 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/settings.json @@ -0,0 +1,26 @@ +{ + "profiles": [ + { + "name": "codex-mcp", + "model": "gpt-6.2-sol", + "reasoning_effort": "high" + } + ], + "backend": "ChatGPT login -> Codex CLI -> production Lang2SQL MCP", + "revision": "ed175330e7db5771b03da5e0aa6f64b02b24da1a", + "codex_version": "codex-cli 0.170.0", + "sources": { + "bench/accuracy/codex_mcp.py": "568ac45e5181e96aef4dd7b678bf435cf5b71752d986ed6082b9cbd111174e83", + "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/projection-precedence/bird/summary.json b/bench/accuracy/mcp-review-results/projection-precedence/bird/summary.json new file mode 100644 index 00000000..6c4374a9 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/bird/summary.json @@ -0,0 +1,8 @@ +[ + { + "profile": "codex-mcp", + "correct": 1, + "total": 1, + "accuracy": 1.0 + } +] diff --git a/bench/accuracy/mcp-review-results/projection-precedence/sha256.json b/bench/accuracy/mcp-review-results/projection-precedence/sha256.json new file mode 100644 index 00000000..e780bc94 --- /dev/null +++ b/bench/accuracy/mcp-review-results/projection-precedence/sha256.json @@ -0,0 +1,17 @@ +{ + "analysis.json": "28cb692f095b44da0e7d0ab87db4b550bf9ce12ce07a4bcc33892c3c4d7cd57a", + "bird/codex-mcp/csv/bird165.csv": "de8c7e4507a72874c03e3d9ac6538dbdfa306f8da26107de4675f16f716922a3", + "bird/codex-mcp/events/bird165.answer.txt": "a053f1b4895ec7e27c304abae77c1392b6f9db46769eb4674940d05a1ebf16d5", + "bird/codex-mcp/events/bird165.jsonl": "b105940d0a2e7ef75956a64667bb81e615dd6d466b0e7e4eacf0de855d0cede2", + "bird/codex-mcp/events/bird165.prompt.txt": "16d3480a9ffc64a3f33d66a227260c09d32eab869ece0d73c00fb3deb546cf98", + "bird/codex-mcp/events/bird165.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "bird/codex-mcp/records/bird165.json": "85abdc2aebf2f258b26a00be99bb71bfa2457b53728fb23318481ef975fd545f", + "bird/codex-mcp/scores.json": "9b6218728b28355fd15a4813aeb95275e424bdf196821ae84604ba20ce719a45", + "bird/codex-mcp/sql/bird165.sql": "35c923b73db9996eecfff3c43a983351b6cb19e705e839a96ebdfd81b6dfa1d1", + "bird/codex-mcp/status.json": "fca738fe9c30a4804f383f78b36558a5a93317efaa5ab07ec85f3f3000a929c5", + "bird/manifest.json": "395936fcc29e0990e3501063265fe134d0c2e6b9e0c9f91c257a022786a9fce8", + "bird/settings.json": "4e3f13244ad1f56fbd20cd8f156c0e69a66c3fa777ee23b9a4bf718ab308e921", + "bird/summary.json": "c2e70d4a98f94e810170577bdc4875048efc680796036987c763c95e565e03fd", + "bird-comparison/comparison.json": "a0cbd1f2f8f70b85fc2911e8cdcdbb4b8824a096b2113c9f2ec4ee120fe0bda4", + "bird-comparison/index.html": "969f2fc276f52b4334095a7ccc75684b718946ff158b56ba61b564d5ddbfa606" +}