Skip to content

Rework AOI benchmark scoring around coverage and hallucination - #34

Merged
andreujuanc merged 2 commits into
masterfrom
feat/aoi-benchmark-rework
May 23, 2026
Merged

andreujuanc merged 2 commits into
masterfrom
feat/aoi-benchmark-rework

Conversation

@andreujuanc

Copy link
Copy Markdown
Owner

Summary

  • Replaces the false-positive penalty scoring (which contradicted the AOI scanner's recall-biased contract) with a three-way classifier (covered / aligned / hallucinated) plus an avg_line_offset precision metric.
  • Adds TestAOIBenchmarkFixturesValid as a CI-friendly sanity test that validates every ground-truth line range against the actual fixture diffs. Tightened 18 of the original GT entries to bug-precise single lines and surfaced 5 new entries via manual review of one model's previously-uncredited output.
  • New opencode provider (internal/ai/opencode.go) routes calls through the local opencode CLI; 11 new model entries registered. Added ReportedCostUSD to TokenUsage so providers with native cost reporting bypass per-1M-token estimates. Shadow pricing for claude-code models lets subscription-billed runs compare honestly against metered API providers.

Context

Tuning defaults from the empirical 3-rep variance sweep:

  • gemini-3.1-flash-lite temperature 0.1 → 0.3. Greedy decoding fell into a low-coverage attractor about 40% of the time on this fixture; 0.3 stays in the higher-coverage band consistently.
  • claude-opus-4-7 is now marked AOI: true and defaults to --effort xhigh when invoked through claude-code. Across low | medium | high | xhigh | max, xhigh gives the highest mean coverage (91%), tightest variance (4-point range across 3 reps), and roughly a third of the wall-clock and output tokens of max.

The methodology writeup, the variance findings (reasoning-class models swing 8 to 24 coverage points across reps of identical prompts; cheap deterministic models swing zero), and the two prompt gaps no model surfaces as AOIs (lockfile mismatch, UTF-8 byte-slice) are documented in docs/articles/evaluating-aoi-pre-filters.md.

Replaces the false-positive penalty (which contradicted the AOI
scanner's recall-biased contract) with a three-way classifier
(covered / aligned / hallucinated) plus an avg-line-offset precision
metric. Adds TestAOIBenchmarkFixturesValid as a CI sanity test that
validates every GT line range against the fixture diff; the audit
that came out of running it tightened 18 of the original GT entries
to bug-precise single lines and surfaced 5 new entries from a
manual review of one model's previously-uncredited output.

Provider work:
- New opencode provider (internal/ai/opencode.go) routes calls
  through the local opencode CLI, with 11 new model entries
  registered (3 native + 7 copilot + GPT-5.5).
- ReportedCostUSD added to TokenUsage so providers with native
  cost reporting bypass the per-1M-token estimate.
- Shadow pricing for claude-code models lets subscription-billed
  runs compare honestly against metered API providers.

Tuning defaults from the empirical 3-rep sweep:
- gemini-3.1-flash-lite temperature 0.1 -> 0.3 (greedy fell into a
  low-coverage attractor 40% of the time at this scale).
- claude-opus-4-7 marked AOI: true and defaults to --effort xhigh
  (best mean coverage, tightest variance, third the wall-clock of
  --effort max).

See docs/articles/evaluating-aoi-pre-filters.md for the methodology
writeup and the variance findings.
…ctation

CI feedback on the previous commit:

- internal/ai/opencode.go was not gofmt-clean.
- TestLoadModels_EmbeddedDefaults hardcoded Temperature: 0.1 for all
  models; gemini-3.1-flash-lite is now 0.3. Made the expected value
  per-row so the assertion matches each model's actual default.
@andreujuanc
andreujuanc merged commit 2377973 into master May 23, 2026
2 checks passed
@andreujuanc
andreujuanc deleted the feat/aoi-benchmark-rework branch May 23, 2026 12:14
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