Skip to content

[OPIK-8186] opik-instrument: eval harness (verify coverage + no false success) - #174

Merged
aswynz merged 2 commits into
mainfrom
aswynz/OPIK-8186/instrument-evals-harness
Sep 1, 2026
Merged

[OPIK-8186] opik-instrument: eval harness (verify coverage + no false success)#174
aswynz merged 2 commits into
mainfrom
aswynz/OPIK-8186/instrument-evals-harness

Conversation

@aswynz

@aswynz aswynz commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What

Adds an eval harness for the opik-instrument skill — it had none (unlike opik-diagnose / opik-explain), so the verify-coverage ability added in OPIK-8185 (#173) was untested beyond CI spec/build checks. Mirrors the opik-diagnose/evals/ layout.

Cases

  • Triggering — "add opik tracing" selects opik-instrument, not diagnose/explain/evaluate (judge panel → selection_accuracy).
  • Functional / clean — an uninstrumented app (entrypoint → LLM → tool). The skill must instrument, run, and report verified with span-level coverage (all three types present, every span well-formed, code changed).
  • Functional / missing_flush (adversarial) — an already-instrumented app with the flush removed, so no complete trace lands. Decisive check no_false_success: the skill must not claim verified / already_verified without a real, complete trace behind it. Passes whether it fixes the flush and verifies, or blocks with a flush next-step; a skill that trusts the decorators and reports success fails.

Run it

cd src/opik_mcp/skills/opik-instrument/evals
uv run --with pyyaml python run_evals.py prepare   # stage fixture apps under _work/
# run /opik-instrument in each _work/<case> dir; it writes result.json there
uv run --with pyyaml python run_evals.py grade     # deterministic scoring

Grading is offline; an optional integrity re-read hits Opik only when a trace_id is present.

Self-tested: correct outputs pass 2/2; a false already_verified with no trace is caught by no_false_success.

Follow-up to #173. HARNESS.md notes a planned partial_trace fixture (batching-race arrives-but-incomplete) as a TODO.

Closes OPIK-8186.

🤖 Generated with Claude Code

…alse success)

Mirrors the opik-diagnose/evals pattern. Two functional fixtures:
- clean: uninstrumented app; the skill must instrument, run, and verify a
  complete 3-span trace with reported span coverage.
- missing_flush: already instrumented but no flush, so no complete trace lands;
  the skill must not claim success without a real trace (no_false_success) — the
  decisive test of OPIK-8185's coverage check.
Plus triggering (selection_accuracy), a deterministic grader, and metrics.
Self-tested: correct outputs pass 2/2; a false already_verified is caught.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wrap the three long lines flagged by `ruff check` in grader.py and run_evals.py
and apply `ruff format`. No behavior change — self-test still passes correct
outputs and still catches a false `already_verified`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aswynz
aswynz merged commit 26a6631 into main Sep 1, 2026
6 checks passed
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.

2 participants