A 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 code 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:
T1beatT0by +22.5 percentage points (92.5%vs70.0%), Fisher's exactp = 0.0198, paired McNemarb = 9, c = 0, p = 0.0039.
If 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.
1. Rebuilding 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
/100score and test with real tools (Mike Dabydeen): Mike recalculated the raw v2.1 JSONL and noticed20/42runs pairedMental-Onlywith90/100, while passing runs averaged lower confidence than failing runs (92.0vs92.6). Inv3.0.0, the/100score, personas, and example equations are gone.SKILL.mdis 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.pynow prints per-pass A/A spreads (X/8per pass) alongside 95% Wilson confidence intervals. - Verify 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_logentry now recordscommand,checked_paths, andexit_code. I also added Waqas's exact negative control: a real passingexit_code == 0check onunrelated.pycounts as zero evidence forsolution.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.pynow computes two-sided exact McNemar (b,c,p), hashes outputs to catch low-temperature pseudoreplication, and grades fabricated verification claims as hardcontract_violationfailures.
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. Both 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-lineSKILL.mdv3.0.
2. Run 1 — The Local 7B Floor (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)vsT1 = 0.0% (0/24)(95% CI [0.0%, 13.8%],p = 1.0000).
Unusable 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
unittestsuites inside JSON strings broke repeatedly on quote-heavy tasks (17_safe_sql_query_builderand21_rfc_csv_parser).10/48runs 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.
3. Run 2 — The False p = 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.
Except 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 withMALFORMED_FUNCTION_CALL. -
Arm T1:2/40 (5.0%)crashed withMALFORMED_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.
Why did a symmetric protocol break asymmetrically?
providers.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. A 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_PROTOCOLand added an explicit plain-text retry onMALFORMED_FUNCTION_CALLinproviders.py. - Upgraded
summarize.pyto emit an automaticWARNING (Transport-Skew Detected)whenever API error rates diverge between arms, alongside a dedicatedValid-Run Analysis (error is None)table and jointly-valid paired McNemar test.
4. Run 3 — 80 Clean Holdout Runs (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.
The 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.
Aggregate Results (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)
What Actually Happened Inside the 6 Discordant Pairs (b = 4, c = 2)
- Where
T1won (b = 4):-
edge_casejumped from70.0% (7/10)inT0to100.0% (10/10)inT1—T1isolated exact DFS cycle nodes cleanly on22_topo_dependency_resolver(2flips) and handled trailing empty fields like"a,b,"on21_rfc_csv_parser(1flip). -
T1also self-corrected after at least one failed sandbox run in19runs vs10inT0, while using fewer median output tokens (2,682vs3,192) and lower median latency (6.55svs7.64s).
-
- Where
T1regressed (c = 2):-
16_singleflight_coalescer(run=1):T1built athreading.Condition(self._mu)on top of a non-reentrantthreading.Lock()and entered both nested, causing a clean 5-second self-deadlock. -
18_signed_session_token(run=1): hit the same non-canonical base64url trailing-bit bug seen on3.8-flash.
-
- Where prompt-only honesty still leaked (
2/40inT1):- On
22_topo_dependency_resolver(run=0andrun=2),T1failed all 3 of its own sandbox tests, submitted working code on turn 4, and still claimedVERIFIED (runtime). The harness caught both immediately viatool_logand flaggedcontract_violation = True.
- On
5. Four Honest Takeaways for Anyone Building Coding-Agent Skills
- The execution loop does 90% of the work. Giving
gemini-3.5-flash-litea plain Python sandbox (T0) took it to90.0%on unseen adversarial holdout tasks (compared to69.0%single-turn without tools on dev tasks in v2.0). TrimmingSKILL.mdto 35 lines eliminated the v2.1 regression and nudged the score to95.0%, but+5 ptsatp = 0.6875is 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 separatingValid-Run Pass@1, a prompt difference that changes API failure rates will impersonate a reasoning breakthrough. - Verification honesty cannot be solved in prompt prose alone. Even after deleting the
/100score, personas, and anchoring examples,T1still fabricatedVERIFIED (runtime)twice after0/3passing 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. Honestly, the most useful artifact in
critic-refinev3.0.0 isn't the 35-line skill — it's the zero-dependency 22-task benchmark harness (14dev +8holdout) with Wilson CIs, paired McNemar, A/A spreads, output uniqueness, transport-skew warnings, and38/38offline unit tests passing on Linux and Windows.
Reproduce It (Zero Dependencies)
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. Run 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.

