{"slug": "my-ai-skill-benchmark-hit-p-0-0039-then-forensic-auditing-proved-it-was-an-api", "title": "My AI Skill Benchmark Hit p = 0.0039 — Then Forensic Auditing Proved It Was an API Bug", "summary": "A coding-agent skill benchmark that initially reported a +22.5 percentage point gain (92.5% vs 70.0%, Fisher's exact p = 0.0198, McNemar b = 9, c = 0, p = 0.0039) across 208 live agentic runs turned out to be a 100% API transport artifact, the author reported after auditing the raw JSONL logs. The author rebuilt the skill as a 35-line SKILL.md v3.0.0 with 8 unseen holdout tasks and a symmetric multi-turn Python sandbox runner, after five readers critiqued the v2.1 harness; a first local test on Ollama with qwen2.5-coder:7b Q4_K_M on an RTX 2070 Super 8 GB scored 0.0% (0/24) for both arms (95% CI [0.0%, 13.8%], p = 1.0000) and exposed a silent 4096-token Ollama context truncation. The author then ran 80 clean holdout runs with zero API errors.", "body_md": "# My AI Skill Benchmark Hit p = 0.0039 — Then Forensic Auditing Proved It Was an API Bug\n\nA few days ago, I published a post-mortem showing that my own coding-agent skill (critic-refine v2.1) actually hurt accuracy on single-turn benchmarks and caused models to fabricate mypy checks and inverted /100 confidence scores. The comments on Dev.to and CoderLegion were better than any internal\n\ncode review I could have paid for. Five readers tore into the harness design and handed me a concrete checklist for v3.0.0. So I stripped SKILL.md down to 35 lines, wrote 8 unseen holdout tasks, built a symmetric multi-turn Python sandbox runner (T0 vs T1), and ran 208 live agentic runs across three models. Halfway through, my stats script handed me the dream headline: T1 beat T0 by +22.5 percentage points (92.5% vs 70.0%), Fisher's exact p = 0.0198, paired McNemar b = 9, c = 0, p = 0.0039.\n\nIf I had stopped at the summary table, I would have shipped a celebratory release post. Instead, I opened the raw JSONL logs — and discovered the entire p = 0.0039 win was a 100% API transport artifact. Here is the full forensic breakdown of v3.0.0, including the local 7B floor, the fake p = 0.0039, and what happened when I fixed the harness and ran 80 clean holdout runs with zero API errors. v3.0.0 Around Community Critiques Before touching a live API, I wired five specific reader critiques directly into SKILL.md and the zero-dependency Python benchmark harness: Drop the /100 score and test with real tools (Mike Dabydeen): Mike recalculated the raw v2.1 JSONL and noticed 20/42 runs paired Mental-Only with 90/100, while passing runs averaged lower confidence than failing runs (92.0 vs 92.6).\n\nIn v3.0.0, the /100 score, personas, and example equations are gone. SKILL.md is now 35 lines with a plain Verification Ledger (VERIFIED (runtime) / STATIC-ONLY / UNVERIFIED). Measure the A/A noise floor and show Wilson CIs (Heinrich Neb): With 8 holdout tasks, a single flipped task moves the score by 12.5 points. summarize.py now prints per-pass A/A spreads (X/8 per pass) alongside 95% Wilson confidence intervals.\n\nVerify observed telemetry, not asserted prose (Kincses Benjmin): \"A check that claims it ran and did not is worse than no check.\" Separate \"a check ran\" from \"the check covered the target file\" (Waqas Ahmad): Every tool_log entry now records command, checked_paths, and exit_code. I also added Waqas's exact negative control: a real passing exit_code == 0 check on unrelated.py counts as zero evidence for solution.py (test_negative_control_passing_check_on_wrong_file_counts_as_zero_evidence). Use paired exact McNemar, track output uniqueness, and hard-fail contract violations (Remy Calder): summarize.py now computes two-sided exact McNemar (b, c, p), hashes outputs to catch low-temperature pseudoreplication, and grades fabricated verification claims as hard contract_violation failures. To prevent the overfitting we saw in v2.1, I kept the original 14 dev tasks (01_–14_) untouched and created 8 brand-new unseen holdout tasks (15_token_bucket_limiter through 22_topo_dependency_resolver) covering concurrency, security, performance, and nasty RFC/graph edge cases.\n\nBoth arms get the exact same multi-turn Python unittest sandbox (--max-turns 4, --temperature 0.2): T0 (Tool-Baseline): Minimalist system prompt + sandbox tool loop. T1 (Tool + Skill): Exact same sandbox tool loop + verbatim 35-line SKILL.md v3.0. qwen2.5-coder:7b): Two Harness Bugs Caught Early My first live test ran 48 holdout runs (3 passes × 8 tasks × 2 arms) locally on Ollama (qwen2.5-coder:7b Q4_K_M, RTX 2070 Super 8 GB VRAM). Result: T0 = 0.0% (0/24) vs T1 = 0.0% (0/24) (95% CI [0.0%, 13.8%], p = 1.0000).\n\nUnusable as a skill verdict, very useful as a harness debugger. Inspecting the logs exposed two mechanical flaws immediately: Silent 4096-token truncation: Ollama defaults to a 4,096-token context window even on 32k models. By turn 2, cumulative multi-turn context hit 7k–10k tokens and silently evicted the system prompt mid-loop. Python-inside-JSON escaping breakage: Asking the model to put full Python modules and unittest suites inside JSON strings broke repeatedly on quote-heavy tasks (17_safe_sql_query_builder and 21_rfc_csv_parser).\n\n10/48 runs burned all 4 turns on malformed JSON without executing a single test. Fix: I replaced JSON-escaped payloads in benchmarks/run_agent_eval.py with raw delimited tags (<action>, <solution_code>, <test_code>, <status>, <checked_paths>, <summary>). No escaping needed for SQL identifiers or RFC 4180 CSV \"\" quotes. Zero JSON parsing crashes happened on any run after that.\n\np = 0.0039 (gemini-3.8-flash, 80 Holdout Runs) With raw tags in place, I ran 80 holdout runs (5 passes × 8 tasks × 2 arms) on gemini-3.8-flash. Here is what summarize.py initially printed: Arm (gemini-3.8-flash, holdout) Full Pass@1 95% Wilson CI Per-Pass A/A Spread Paired McNemar (T1 vs T0) Arm T0 (Tool-Baseline) 70.0% (28/40) [54.6%, 81.9%] [6/8, 6/8, 6/8, 3/8, 7/8] (spread = 4) — Arm T1 (Tool + SKILL.md v3.0) 92.5% (37/40) [80.1%, 97.4%] [8/8, 8/8, 7/8, 7/8, 7/8] (spread = 1) b=9, c=0, p = 0.0039 Fisher's exact test: p = 0.0198. Zero regressions (c = 0). Look at that clean drop in A/A spread from 4 tasks down to 1.\n\nExcept it was completely bogus. When I inspected the 15 failing records line by line, 14 out of 15 were the exact same API error: Empty Gemini response (detail='MALFORMED_FUNCTION_CALL') Arm T0: 12/40 (30.0%) crashed with MALFORMED_FUNCTION_CALL. Arm T1: 2/40 (5.0%) crashed with MALFORMED_FUNCTION_CALL. Every single one of the b = 9 paired wins for T1 was simply a run where T0 died on an API error while T1 completed normally.\n\nproviders.py calls Gemini's generateContent endpoint in plain-text mode (no native tools JSON schema attached), yet SHARED_TOOL_PROTOCOL referred to a \"sandbox tool\" named run_python_test. Under T0's terse 1-line preamble, gemini-3.8-flash tried to emit a native API function call 30% of the time, which the endpoint rejected as MALFORMED_FUNCTION_CALL. Under T1, the 35-line SKILL.md preamble kept the model anchored in plain-text output mode 95% of the time. Once you filter out API crashes (error is None), the entire effect evaporates into a ceiling: Arm (gemini-3.8-flash, Valid Runs Only) API Errors Valid Runs Valid-Run Full Pass@1 Valid-Run 95% CI Arm T0 30.0% (12/40) 28/40 100.0% (28/28) [87.9%, 100.0%] Arm T1 5.0% (2/40) 38/40 97.4% (37/38) [86.5%, 99.5%] Valid-Run Fisher's Exact: p = 1.0000 Jointly-Valid Paired McNemar (both error is None): pairs = 28, b = 0, c = 0, p = 1.0000 (Side note for security nerds: the single genuine code failure across all 66 valid runs — 18_signed_session_token, T1 run=4 — was a genuinely subtle crypto bug.\n\nA 32-byte HMAC-SHA256 signature is 256 bits, which takes 43 base64url characters = 258 bits, leaving 2 unused trailing padding bits. Because the generated decoder didn't verify canonical base64url by re-encoding, flipping a trailing 'A' to 'B' decoded to the exact same 32 bytes and sailed right past hmac.compare_digest.) Harness fix shipped immediately: Removed native-tool wording from SHARED_TOOL_PROTOCOL and added an explicit plain-text retry on MALFORMED_FUNCTION_CALL in providers.py. Upgraded summarize.py to emit an automatic WARNING (Transport-Skew Detected) whenever API error rates diverge between arms, alongside a dedicated Valid-Run Analysis (error is None) table and jointly-valid paired McNemar test. gemini-3.5-flash-lite, 0 API Errors, $0.17) To get a clean, non-ceiling measurement on the exact model that struggled in v2.1 (69.0% baseline single-turn without tools on the dev suite), I ran 80 holdout runs on gemini-3.5-flash-lite after applying the transport fix.\n\nThe fix worked cleanly: 0/80 API errors, 0/80 zero-tool runs, 40/40 (100%) unique outputs per arm (no low-temperature near-duplicate collapse), total wall time 11.6 min, estimated cost $0.17. gemini-3.5-flash-lite, Holdout) Metric Arm T0 (Tool-Baseline) Arm T1 (Tool + SKILL.md v3.0) Happy Pass@1 97.5% (39/40) 97.5% (39/40) Full Pass@1 (Happy + Trap) 90.0% (36/40) 95.0% (38/40) 95% Wilson CI [76.9%, 96.0%] [83.5%, 98.6%] Per-Pass A/A Spread (5 passes) [7/8, 7/8, 8/8, 7/8, 7/8] (1 task / 12.5%) [8/8, 6/8, 8/8, 8/8, 8/8] (2 tasks / 25.0%) Unique Outputs 40/40 (100.0%) 40/40 (100.0%) API Errors 0.0% (0/40) 0.0% (0/40) Status Honesty Rate 97.5% (39/40) 95.0% (38/40) Contract Violations 2.5% (1/40) 5.0% (2/40) Mean Turns / Mean Tool Calls 2.58 / 1.68 2.75 / 1.80 Median Output Tokens / Latency 3,192 / 7,637.5ms 2,682 / 6,547.5ms Fisher's Exact Test (two-sided): p = 0.6752 (not statistically significant) Paired McNemar's Exact Test: pairs = 40, b = 4, c = 2, p = 0.6875 (not statistically significant) b = 4, c = 2) Where T1 won (b = 4): edge_case jumped from 70.0% (7/10) in T0 to 100.0% (10/10) in T1 — T1 isolated exact DFS cycle nodes cleanly on 22_topo_dependency_resolver (2 flips) and handled trailing empty fields like \"a,b,\" on 21_rfc_csv_parser (1 flip). T1 also self-corrected after at least one failed sandbox run in 19 runs vs 10 in T0, while using fewer median output tokens (2,682 vs 3,192) and lower median latency (6.55s vs 7.64s). Where T1 regressed (c = 2): 16_singleflight_coalescer (run=1): T1 built a threading.Condition(self._mu) on top of a non-reentrant threading.Lock() and entered both nested, causing a clean 5-second self-deadlock.\n\n18_signed_session_token (run=1): hit the same non-canonical base64url trailing-bit bug seen on 3.8-flash. Where prompt-only honesty still leaked (2/40 in T1): On 22_topo_dependency_resolver (run=0 and run=2), T1 failed all 3 of its own sandbox tests, submitted working code on turn 4, and still claimed VERIFIED (runtime). The harness caught both immediately via tool_log and flagged contract_violation = True. The execution loop does 90% of the work.\n\nGiving gemini-3.5-flash-lite a plain Python sandbox (T0) took it to 90.0% on unseen adversarial holdout tasks (compared to 69.0% single-turn without tools on dev tasks in v2.0). Trimming SKILL.md to 35 lines eliminated the v2.1 regression and nudged the score to 95.0%, but +5 pts at p = 0.6875 is statistically indistinguishable from noise. Differential API errors can manufacture p < 0.01. If your evaluation script counts transport/API crashes as task failures in Intent-to-Treat tests without separating Valid-Run Pass@1, a prompt difference that changes API failure rates will impersonate a reasoning breakthrough.\n\nVerification honesty cannot be solved in prompt prose alone. Even after deleting the /100 score, personas, and anchoring examples, T1 still fabricated VERIFIED (runtime) twice after 0/3 passing runs. Only harness-side telemetry (tool_log + checked_paths + wrong-file negative controls) catches that reliably. An evaluation harness is often worth more than the prompt it tests.\n\nHonestly, the most useful artifact in critic-refine v3.0.0 isn't the 35-line skill — it's the zero-dependency 22-task benchmark harness (14 dev + 8 holdout) with Wilson CIs, paired McNemar, A/A spreads, output uniqueness, transport-skew warnings, and 38/38 offline unit tests passing on Linux and Windows. Everything — the 35-line SKILL.md, all 22 calibrated tasks, both 80-run raw JSONL logs, and benchmarks/REPORT.md — is live in v3.0.0: Release & Full Report: critic-refine-skill v3.0.0 # 1. Verify all 22 tasks (naive_ref fails trap tests, gold_ref passes all) + wrong-file negative control python -B -m unittest benchmarks/test_harness.py -v # 2. Reproduce the v3.0 statistical summaries from the committed JSONL logs python -B benchmarks/summarize.py benchmarks/results/gemini-3.5-flash-lite_v3_holdout_2026-12-05.jsonl python -B benchmarks/summarize.py benchmarks/results/gemini-3.8-flash_v3_holdout_2026-12-05.jsonl # 3.\n\nRun the 8-task holdout benchmark against your own model (OpenAI / Anthropic / Gemini / Ollama) python -B -u benchmarks/run_agent_eval.py --provider openai --model gpt-4.1-mini --suite holdout --arms T0,T1 --runs 5 --max-turns 4 Next up on my list: building the planted-defect canary suite Heinrich Neb suggested (injecting known defects into working drafts to measure critic catch rate vs false-clean rate directly). If you run the holdout suite against Claude, GPT, or DeepSeek, drop your summarize.py output in the comments — I'd love to see where other models land between the 7B floor and the 3.8-flash ceiling.\n\n## Key Takeaways\n\n- •Five readers tore into the harness design and handed me a concrete checklist for v3.0.0.\n- •This story was reported by **Dev.to** , covering developments in the**dev** space.\n- •AI advancements continue to reshape industries — read the full article on Dev.to for complete coverage.\n\n📖 Continue reading the full article:\n\n[Read Full Article on Dev.to →](https://dev.to/reigen/my-ai-skill-benchmark-hit-p-00039-then-forensic-auditing-proved-it-was-an-api-bug-bgd)", "url": "https://wpnews.pro/news/my-ai-skill-benchmark-hit-p-0-0039-then-forensic-auditing-proved-it-was-an-api", "canonical_source": "https://ainexusdaily.vercel.app/article/2026-12-06-my-ai-skill-benchmark-hit-p-00039-then-forensic-auditing-proved-it-was-an-api-bu", "published_at": "2026-12-06 16:54:51+00:00", "updated_at": "2026-12-06 17:43:32.585505+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models"], "entities": ["critic-refine v2.1", "SKILL.md v3.0.0", "Ollama", "qwen2.5-coder:7b", "RTX 2070 Super", "Dev.to", "CoderLegion", "McNemar"], "also_reported_by": [], "takeaway": "A reported McNemar p = 0.0039 skill win (92.5% vs 70.0%) vanished once raw JSONL logs were audited, so verify per-run API errors and telemetry before trusting any benchmark delta.", "recommendation": {"advice": "Audit raw per-run logs for API transport errors and measure an A/A noise floor with Wilson CIs before reporting any skill's benchmark gain; a single flipped task moves an 8-task score by 12.5 points.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/my-ai-skill-benchmark-hit-p-0-0039-then-forensic-auditing-proved-it-was-an-api", "markdown": "https://wpnews.pro/news/my-ai-skill-benchmark-hit-p-0-0039-then-forensic-auditing-proved-it-was-an-api.md", "text": "https://wpnews.pro/news/my-ai-skill-benchmark-hit-p-0-0039-then-forensic-auditing-proved-it-was-an-api.txt", "jsonld": "https://wpnews.pro/news/my-ai-skill-benchmark-hit-p-0-0039-then-forensic-auditing-proved-it-was-an-api.jsonld"}}