Skip to content

fix(sampling): compute rep cost from tokens (unblocks single_shot sampling) - #7

Merged
anthonyadame merged 3 commits into
mainfrom
fix/sampling-cost-from-tokens
Jun 7, 2026
Merged

fix(sampling): compute rep cost from tokens (unblocks single_shot sampling)#7
anthonyadame merged 3 commits into
mainfrom
fix/sampling-cost-from-tokens

Conversation

@anthonyadame

Copy link
Copy Markdown
Contributor

Tier-1 pilot caught the valid-rep gate false-rejecting single_shot (records tokens, not totals.cost_usd → read as cost=0 → gated invalid despite 215 collected). repeat_runner now computes cost from tokens when cost_usd is absent.

Validated (Tier-1 pilot, ~$1.6): single_shot cachetools K=5 → 5/5 valid, 87.0% [75,98]; aider 100% [100,100]; value-add +13.0pp [+2,+25], significant (BH-FDR) — the agent-value-add significance pipeline works end-to-end.

🤖 Generated with Claude Code

anthonyadame and others added 3 commits June 7, 2026 12:38
Tier-1 pilot caught this: single_shot records TOKENS but not totals.cost_usd, so
repeat_runner read cost=0 and the valid-rep gate (cost<=0 -> invalid) wrongly discarded
8 legit single_shot runs (each 215 collected). Added _cost_from_runner_json() — uses
cost_usd if recorded, else computes from input/output/cached tokens (mirrors
value_add_fingerprint pricing). After the fix: single_shot cachetools K=5 -> 5/5 valid,
87.0% [75,98]; aider 100% [100,100]; value-add +13.0pp [+2,+25], significant (BH-FDR).

This is the first successful sampling run — the value-add significance pipeline works.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extends runner_cmd (run_lite_kaizen_delta / run_lite_reflexion[_openai]) + branch_of
(reflexion_{sonnet,openai}) + --arch choices, so the headline value-add cells (KD, B3)
can be sampled for per-claim CIs, not just aider/smolagents/single_shot.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
K=5 value-add CIs (OpenAI, ~$17.5). Headline: aider unlocks voluptuous +82.6pp
[+70,+90], SIGNIFICANT (BH-FDR). Sampling corrects two over-claims a single run would
have made: smolagents/reflexion voluptuous 'unlocks' are BIMODAL (crack-or-crash ->
n.s.), and KD does NOT unlock voluptuous on OpenAI (Sonnet-only claim). cachetools:
complementary pattern but n.s. at K=5 (small effects, noisy baseline); agentic archs
cut variance vs single-shot. Demonstrates calibrated, honest significance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
EOF
@anthonyadame
anthonyadame merged commit e86f9a7 into main Jun 7, 2026
1 check passed
@anthonyadame
anthonyadame deleted the fix/sampling-cost-from-tokens branch June 7, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant