fix(sampling): compute rep cost from tokens (unblocks single_shot sampling) - #7
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_runnernow computes cost from tokens whencost_usdis 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