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
5 changes: 4 additions & 1 deletion bench/accuracy/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"5176e324a72e80a8a37a12285596d123e0ba6c310dceaa9f13a1e413ee88ff5b",
"7f3a02f99f90eadd69974fe5f45ca5d4abf90a1549e4deb46ae24b0093bde9c6",
),
"spider2": ("195a0e722bb4e670fda45308e583203fccd7a4979b412a05215ca525e7aec5bf",),
"spider2": (
"195a0e722bb4e670fda45308e583203fccd7a4979b412a05215ca525e7aec5bf",
"c34d916119614b2c29dcff525952d3aa4d61cdd04987f30084180e0a5f819453",
),
}
SEED = 20261126
INPUT_KEYS = {
Expand Down
110 changes: 110 additions & 0 deletions bench/accuracy/mcp-review-results/ipl-boundary-audit/local259.json

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions bench/accuracy/mcp-review-results/ipl-boundary-audit/reproduce.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ast, hashlib, json, math, sqlite3
from pathlib import Path
import pandas as pd
root=Path('/Users/seyoung/workspace/benchmarks');source=root/'codex-mcp-spider-max-calculations-20261127/spider-gpt-6.2-astra';gold=root/'Spider2/spider2-lite/evaluation_suite/gold'; evaluator=gold.parent/'evaluate.py'; db=root/'spider2-databases/IPL.sqlite'
ns={'pd':pd,'math':math}
tree=ast.parse(evaluator.read_text()); fn=next(n for n in tree.body if isinstance(n,ast.FunctionDef) and n.name=='compare_pandas_table');exec(compile(ast.Module(body=[fn],type_ignores=[]),str(evaluator),'exec'),ns)
config=next(json.loads(s) for s in (gold/'spider2lite_eval.jsonl').read_text().splitlines() if json.loads(s)['instance_id']=='local259')
sql=(source/'codex-mcp/sql/local259.sql').read_text();drop=" WHERE kind_out <> 'retired hurt'\n";old="bw.wickets || '-' || bw.runs_given AS best_bowling_performance";new="CASE WHEN bw.total_wickets > 0 THEN bw.wickets || '-' || bw.runs_given END AS best_bowling_performance"
assert sql.count(drop)==1 and sql.count(old)==1
variants={'original':sql,'include_retired_hurt':sql.replace(drop,''),'null_for_zero_career_wickets':sql.replace(old,new),'both_reference_conventions':sql.replace(drop,'').replace(old,new)}
con=sqlite3.connect('file:'+str(db)+'?mode=ro',uri=True)
results={}
refs=sorted((gold/'exec_result').glob('local259_*.csv'))
for name,q in variants.items():
frame=pd.read_sql_query(q,con)
results[name]={'rows':len(frame),'sql':q,'reference_matches':{f.name:ns['compare_pandas_table'](frame,pd.read_csv(f),config['condition_cols'],config['ignore_order']) for f in refs}}
retired=con.execute("SELECT player_out,COUNT(*) FROM wicket_taken WHERE kind_out='retired hurt' GROUP BY player_out").fetchall();con.close()
report={'purpose':'Offline root-cause isolation, never supplied to inference; original official score remains zero.','source':str(source),'hashes':{str(p):hashlib.sha256(p.read_bytes()).hexdigest() for p in [source/'codex-mcp/records/local259.json',source/'codex-mcp/sql/local259.sql',db,evaluator,*refs]},'config':config,'retired_hurt_counts':retired,'variants':results,'findings':['Original and reference_b both contain 468 players and 18 columns.','Reference_b mismatches are confined to dismissals/batting average for six retired-hurt players and best-bowling text for 47 zero-career-wicket players.','All other columns match reference_b by player ID within the official numeric tolerance.'],'limits':['Question and provided glossary do not explicitly define retirement treatment or null best-performance output for a bowler with zero wickets.','Counterfactual reference compatibility is not model accuracy or evidence of an execution-tool bug.','Do not inject reference-derived conventions into product policy.']}
out=root/'codex-mcp-current-backlog-audit-20261127/local259-boundary-audit.json';out.write_text(json.dumps(report,indent=2)+'\n')
for name,r in results.items():print(name,r['reference_matches'])
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"local259.json": "8bc8c91a034810ab3224846b83e526139e7d6042e7829ea69802c27fb2c53940",
"reproduce.py": "782cf1547c97687e6523c539388bfbcb5936e452eee6f4396bde6a14e2606617"
}
14 changes: 14 additions & 0 deletions bench/accuracy/mcp-review-results/ipl-output-review/analysis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"official_transition": [
0,
0
],
"result": "Selected wrong-case self-review did not repair output projection. Same five names and batting averages; average runs per match remains only in ORDER BY.",
"tools": "All 12 MCP calls completed. Declared expected_columns=[player_name,batting_average] and expected_rows=5 correctly passed; self-declared contracts cannot establish that a user-intended metric is included.",
"inference_input": "Existing review-source whitelist only prior answer and tool observations. No grade, reference, analyst diagnosis or missing-column hint.",
"limits": [
"No full accuracy or successful repair claim.",
"Do not retry this condition unchanged.",
"Do not automatically append all ORDER BY expressions: ranking and requested output are not universally identical."
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
player_name,batting_average
CH Gayle,61.083333333333336
KP Pietersen,61.0
S Dhawan,40.642857142857146
CL White,43.54545454545455
SR Watson,42.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
```sql
WITH season_matches AS (
SELECT match_id
FROM main."match"
WHERE season_id = 5
),
runs_by_match AS (
SELECT b.match_id, b.striker AS player_id, SUM(s.runs_scored) AS runs
FROM season_matches AS m
JOIN main.ball_by_ball AS b ON b.match_id = m.match_id
JOIN main.batsman_scored AS s
ON s.match_id = b.match_id AND s.innings_no = b.innings_no
AND s.over_id = b.over_id AND s.ball_id = b.ball_id
GROUP BY b.match_id, b.striker
),
player_totals AS (
SELECT pm.player_id, COUNT(*) AS matches_played,
SUM(COALESCE(r.runs, 0)) AS total_runs
FROM season_matches AS m
JOIN main.player_match AS pm ON pm.match_id = m.match_id
LEFT JOIN runs_by_match AS r
ON r.match_id = pm.match_id AND r.player_id = pm.player_id
GROUP BY pm.player_id
),
dismissals AS (
SELECT w.player_out AS player_id, COUNT(*) AS times_out
FROM season_matches AS m
JOIN main.wicket_taken AS w ON w.match_id = m.match_id
WHERE w.kind_out <> 'retired hurt'
GROUP BY w.player_out
)
SELECT p.player_name,
1.0 * t.total_runs / NULLIF(d.times_out, 0) AS batting_average
FROM player_totals AS t
JOIN main.player AS p ON p.player_id = t.player_id
LEFT JOIN dismissals AS d ON d.player_id = t.player_id
ORDER BY 1.0 * t.total_runs / t.matches_played DESC
LIMIT 5
```

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading