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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions bench/accuracy/bird-schema-with-frame-document.json

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions bench/accuracy/card-frame-document/db-linkage-audit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"scope": "Offline linkage check only; these query/results are not appended to inference context. No gold SQL/results used.",
"db_sha256": "c98bdb57fe7474da798b407785544b9af0daaad5d61fd21e2a73309493bc1227",
"observations": [
{
"sql": "SELECT name,frameVersion,setCode FROM cards WHERE name='Fleshwrither'",
"rows": [
[
"Fleshwrither",
"future",
"FUT"
]
]
},
{
"sql": "SELECT name,releaseDate FROM sets WHERE code IN ('FUT','M15')",
"rows": [
[
"Future Sight",
"2007-05-04"
],
[
"Magic 2015",
"2014-07-18"
]
]
}
],
"limits": [
"Historical example links the article to this dataset; not a complete frame chronology or proof of any benchmark answer.",
"Article publication date and actual set release date are distinct."
]
}
30 changes: 30 additions & 0 deletions bench/accuracy/card-frame-document/sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"accessed": "2026-11-27",
"sources": [
{
"url": "https://mtgjson.com/data-models/card/card-set/",
"title": "MTGJSON Card (Set) data model",
"summary": "frameVersion is a string property identifying the card frame style."
},
{
"url": "https://magic.wizards.com/en/news/making-magic/future-now-part-i-2007-04-09",
"title": "The Future Is Now, Part I",
"published": "2007-04-09",
"summary": "Wizards describes Future Sight timeshifted cards as using a specially designed futuristic frame. The article illustrates Fleshwrither and explains that this design represents a fictional future, rather than an announced replacement for normal frames."
},
{
"url": "https://magic.wizards.com/en/news/making-magic/days-core-part-2-2014-06-30",
"title": "Days of Core, Part 2",
"published": "2014-06-30",
"summary": "Wizards states that Magic 2015 premiered updated card faces as part of a card-frame change."
},
{
"url": "https://magic.wizards.com/en/news/feature/magic-2015-core-set-release-notes-2014-07-07",
"title": "Magic 2015 Core Set Release Notes",
"published": "2014-07-07",
"summary": "Wizards gives July 18, 2014 as the official release date of Magic 2015."
}
],
"text": "Supplemental publicly available domain documentation (analyst paraphrases of the cited primary sources; not original BIRD metadata):\nMTGJSON Card (Set) data model\nframeVersion is a string property identifying the card frame style.\nSource: https://mtgjson.com/data-models/card/card-set/\n\nThe Future Is Now, Part I (2007-04-09)\nWizards describes Future Sight timeshifted cards as using a specially designed futuristic frame. The article illustrates Fleshwrither and explains that this design represents a fictional future, rather than an announced replacement for normal frames.\nSource: https://magic.wizards.com/en/news/making-magic/future-now-part-i-2007-04-09\n\nDays of Core, Part 2 (2014-06-30)\nWizards states that Magic 2015 premiered updated card faces as part of a card-frame change.\nSource: https://magic.wizards.com/en/news/making-magic/days-core-part-2-2014-06-30\n\nMagic 2015 Core Set Release Notes (2014-07-07)\nWizards gives July 18, 2014 as the official release date of Magic 2015.\nSource: https://magic.wizards.com/en/news/feature/magic-2015-core-set-release-notes-2014-07-07",
"scope": "Database-level historical frame documentation. No question IDs, expected result, SQL or assumed customer-specific business policy. Not an official benchmark annotation."
}
4 changes: 3 additions & 1 deletion bench/accuracy/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"bird": (
"5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b",
"7f3a02f99f90eadd69974fe5f45ca5d4abf90a1549e4deb46ae24b0093bde9c6",
# Optional cited domain-document condition, not an official task annotation.
"68be30a7d9e1101d2373ecbf23966200e9cb0a13fb7fa48a3a6eac267e860d67",
),
"spider2": ("195a0e722bb4e670fda45308e583203fccd7a4979b412a05215ca525e7aec5bf",),
}
Expand Down Expand Up @@ -111,7 +113,7 @@ def load_schema_documents(path, suite):
return {}
schema_sha = digest(path)
if schema_sha not in SCHEMA_SHA.get(suite, ()):
raise ValueError("Schema documentation must match the pinned benchmark release")
raise ValueError("Schema documentation must match a pinned benchmark input variant")
documents = json.loads(path.read_text())
if not isinstance(documents, dict) or not all(
isinstance(db, str) and isinstance(doc, str) for db, doc in documents.items()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"correct": 1,
"total": 1,
"condition": "Public-document supplemental context, not original BIRD task metadata or an upstream baseline score.",
"transition": "Original current trial requested clarification about frame chronology; the documented-context trial executes SQL and passes.",
"finding": "Generated SQL distinguishes the frame label from introduction year (future2007,2015frame2014), counts all cards by eligible style and selects latest introduction. These constants appear only in model-generated SQL, not production policy.",
"controls": [
"Product src tree identical to baseline.",
"Input diff is exactly the cited appendix, not question/evidence changes.",
"No prior answer, grade, gold or offline DB-linkage audit supplied."
],
"limits": [
"One selected failure; no full accuracy, repeatability or broad regression claim.",
"Do not combine this result with original-input scores.",
"Do not rerun passed case during development."
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
frameVersion,card_count
2015,25500
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```sql
WITH eligible_frames AS (
SELECT
frameVersion,
COUNT(*) AS card_count,
CASE frameVersion
WHEN 'future' THEN 2007
WHEN '2015' THEN 2014
ELSE CAST(frameVersion AS INTEGER)
END AS introduction_year
FROM main.cards
GROUP BY frameVersion
HAVING COUNT(*) FILTER (WHERE convertedManaCost = 0) > 0
)
SELECT frameVersion, card_count
FROM eligible_frames
WHERE introduction_year = (SELECT MAX(introduction_year) FROM eligible_frames)
ORDER BY frameVersion
LIMIT 1000
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{"type":"thread.started","thread_id":"01a21a4c-b3ae-7550-835f-dad6bca6bfba"}
{"type":"turn.started"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"I’ll check the schema and frame chronology in Lang2SQL, then run the query and verify the count across all cards."}}
{"type":"item.started","item":{"id":"item_1","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"cards"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_1","type":"mcp_tool_call","server":"lang2sql","tool":"explore_schema","arguments":{"table":"cards"},"result":{"content":[{"type":"text","text":"cards (table)\n- id: INTEGER NOT NULL\n- artist: TEXT\n- asciiName: TEXT\n- availability: TEXT\n- borderColor: TEXT\n- cardKingdomFoilId: TEXT\n- cardKingdomId: TEXT\n- colorIdentity: TEXT\n- colorIndicator: TEXT\n- colors: TEXT\n- convertedManaCost: REAL\n- duelDeck: TEXT\n- edhrecRank: INTEGER\n- faceConvertedManaCost: REAL\n- faceName: TEXT\n- flavorName: TEXT\n- flavorText: TEXT\n- frameEffects: TEXT\n- frameVersion: TEXT\n- hand: TEXT\n- hasAlternativeDeckLimit: INTEGER NOT NULL\n- hasContentWarning: INTEGER NOT NULL\n- hasFoil: INTEGER NOT NULL\n- hasNonFoil: INTEGER NOT NULL\n- isAlternative: INTEGER NOT NULL\n- isFullArt: INTEGER NOT NULL\n- isOnlineOnly: INTEGER NOT NULL\n- isOversized: INTEGER NOT NULL\n- isPromo: INTEGER NOT NULL\n- isReprint: INTEGER NOT NULL\n- isReserved: INTEGER NOT NULL\n- isStarter: INTEGER NOT NULL\n- isStorySpotlight: INTEGER NOT NULL\n- isTextless: INTEGER NOT NULL\n- isTimeshifted: INTEGER NOT NULL\n- keywords: TEXT\n- layout: TEXT\n- leadershipSkills: TEXT\n- life: TEXT\n- loyalty: TEXT\n- manaCost: TEXT\n- mcmId: TEXT\n- mcmMetaId: TEXT\n- mtgArenaId: TEXT\n- mtgjsonV4Id: TEXT\n- mtgoFoilId: TEXT\n- mtgoId: TEXT\n- multiverseId: TEXT\n- name: TEXT\n- number: TEXT\n- originalReleaseDate: TEXT\n- originalText: TEXT\n- originalType: TEXT\n- otherFaceIds: TEXT\n- power: TEXT\n- printings: TEXT\n- promoTypes: TEXT\n- purchaseUrls: TEXT\n- rarity: TEXT\n- scryfallId: TEXT\n- scryfallIllustrationId: TEXT\n- scryfallOracleId: TEXT\n- setCode: TEXT\n- side: TEXT\n- subtypes: TEXT\n- supertypes: TEXT\n- tcgplayerProductId: TEXT\n- text: TEXT\n- toughness: TEXT\n- type: TEXT\n- types: TEXT\n- uuid: TEXT NOT NULL\n- variations: TEXT\n- watermark: TEXT\nPRIMARY KEY (id)"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_2","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_2","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"bNn9kqljbgP1aAf6YsraX68jFxsulWYRoRIWqBoy7UI\", \"definitions\": [], \"instruction\": \"For oracle_view the operator has confirmed the contract: call run_sql with this definition_check_id, period_start and exclusive period_end, without sql. An explicit calendar year/month is sufficient to derive these dates. Ask only if the period or business meaning is actually unclear. For text definitions use SQL. Discover schema and use qualified table names before run_sql. A receipt is not proof of SQL semantic correctness.\"}"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"bNn9kqljbgP1aAf6YsraX68jFxsulWYRoRIWqBoy7UI","sql":"SELECT frameVersion, COUNT(*) AS total, COUNT(*) FILTER (WHERE convertedManaCost = 0) AS zero_cost FROM main.cards GROUP BY frameVersion"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_3","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"bNn9kqljbgP1aAf6YsraX68jFxsulWYRoRIWqBoy7UI","sql":"SELECT frameVersion, COUNT(*) AS total, COUNT(*) FILTER (WHERE convertedManaCost = 0) AS zero_cost FROM main.cards GROUP BY frameVersion"},"result":{"content":[{"type":"text","text":"5 row(s):\nResult coverage: fetched_rows=5; displayed_rows=5; 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): frameVersion=str; total=int; zero_cost=int\nframeVersion | total | zero_cost\n--- | --- | ---\n1993 | 5510 | 577\n1997 | 9257 | 1032\n2003 | 16462 | 2351\n2015 | 25500 | 3359\nfuture | 93 | 8\nSQL: SELECT frameVersion, COUNT(*) AS total, COUNT(*) FILTER (WHERE convertedManaCost = 0) AS zero_cost FROM main.cards GROUP BY frameVersion\nLIMIT 1000"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_4","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_4","type":"mcp_tool_call","server":"lang2sql","tool":"resolve_business_terms","arguments":{"terms":[]},"result":{"content":[{"type":"text","text":"{\"definition_check_id\": \"g0k4Z8huSFdHct95IIEjjNeAGezWg-zzR8uTOicDhEE\", \"definitions\": [], \"instruction\": \"For oracle_view the operator has confirmed the contract: call run_sql with this definition_check_id, period_start and exclusive period_end, without sql. An explicit calendar year/month is sufficient to derive these dates. Ask only if the period or business meaning is actually unclear. For text definitions use SQL. Discover schema and use qualified table names before run_sql. A receipt is not proof of SQL semantic correctness.\"}"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.started","item":{"id":"item_5","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"g0k4Z8huSFdHct95IIEjjNeAGezWg-zzR8uTOicDhEE","expected_columns":["frameVersion","card_count"],"sql":"WITH eligible_frames AS (\n SELECT\n frameVersion,\n COUNT(*) AS card_count,\n CASE frameVersion\n WHEN 'future' THEN 2007\n WHEN '2015' THEN 2014\n ELSE CAST(frameVersion AS INTEGER)\n END AS introduction_year\n FROM main.cards\n GROUP BY frameVersion\n HAVING COUNT(*) FILTER (WHERE convertedManaCost = 0) > 0\n)\nSELECT frameVersion, card_count\nFROM eligible_frames\nWHERE introduction_year = (SELECT MAX(introduction_year) FROM eligible_frames)\nORDER BY frameVersion\nLIMIT 1000"},"result":null,"error":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_5","type":"mcp_tool_call","server":"lang2sql","tool":"run_sql","arguments":{"definition_check_id":"g0k4Z8huSFdHct95IIEjjNeAGezWg-zzR8uTOicDhEE","expected_columns":["frameVersion","card_count"],"sql":"WITH eligible_frames AS (\n SELECT\n frameVersion,\n COUNT(*) AS card_count,\n CASE frameVersion\n WHEN 'future' THEN 2007\n WHEN '2015' THEN 2014\n ELSE CAST(frameVersion AS INTEGER)\n END AS introduction_year\n FROM main.cards\n GROUP BY frameVersion\n HAVING COUNT(*) FILTER (WHERE convertedManaCost = 0) > 0\n)\nSELECT frameVersion, card_count\nFROM eligible_frames\nWHERE introduction_year = (SELECT MAX(introduction_year) FROM eligible_frames)\nORDER BY frameVersion\nLIMIT 1000"},"result":{"content":[{"type":"text","text":"1 row(s):\nOutput columns validated (projection only).\nResult coverage: fetched_rows=1; displayed_rows=1; fetch_truncated=false; display_truncated=false; sql_rewritten=false; query_timeout_enforced=true; query_timeout_scope=sqlite_vm. Counts refer to the executed SQL, not the source table size.\nObserved value types (displayed rows): frameVersion=str; card_count=int\nframeVersion | card_count\n--- | ---\n2015 | 25500\nSQL: WITH eligible_frames AS (\n SELECT\n frameVersion,\n COUNT(*) AS card_count,\n CASE frameVersion\n WHEN 'future' THEN 2007\n WHEN '2015' THEN 2014\n ELSE CAST(frameVersion AS INTEGER)\n END AS introduction_year\n FROM main.cards\n GROUP BY frameVersion\n HAVING COUNT(*) FILTER (WHERE convertedManaCost = 0) > 0\n)\nSELECT frameVersion, card_count\nFROM eligible_frames\nWHERE introduction_year = (SELECT MAX(introduction_year) FROM eligible_frames)\nORDER BY frameVersion\nLIMIT 1000"}],"structured_content":null},"error":null,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_6","type":"agent_message","text":"```sql\nWITH eligible_frames AS (\n SELECT\n frameVersion,\n COUNT(*) AS card_count,\n CASE frameVersion\n WHEN 'future' THEN 2007\n WHEN '2015' THEN 2014\n ELSE CAST(frameVersion AS INTEGER)\n END AS introduction_year\n FROM main.cards\n GROUP BY frameVersion\n HAVING COUNT(*) FILTER (WHERE convertedManaCost = 0) > 0\n)\nSELECT frameVersion, card_count\nFROM eligible_frames\nWHERE introduction_year = (SELECT MAX(introduction_year) FROM eligible_frames)\nORDER BY frameVersion\nLIMIT 1000\n```"}}
{"type":"turn.completed","usage":{"input_tokens":235769,"cached_input_tokens":214272,"cache_write_input_tokens":0,"output_tokens":657,"reasoning_output_tokens":0}}
Loading