Add prompt-eval-gate loop (LLMOps regression gate)#13
Merged
Conversation
Rank #4 from research deep-dive #3. An eval-set regression gate over prompts: - loops/prompt-eval-gate/: runs an injected eval set through the model, grades deterministically, and compares to a baseline in the durable StateStore. No baseline -> establish (comment); regressions -> blocking advisory comment (baseline unchanged); improvement -> human-Gated baseline promotion (comment until approved, then a PR writing evals/baseline.json + persisting the new baseline). Uses the comment + PR output channels. - CLI: model = the OpenRouter AI client, cases from LOOPY_EVAL_CASES_FILE, file-backed state; run() now resolves the PR number for event-triggered loops so comment output works. Shipped via the OpenSpec cycle (openspec/specs/prompt-eval-gate.md). Validated: typecheck, lint, 172 tests (+6), clean build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CrMioorha3QtPUgWbtDbR
DCCA
commented
Jun 23, 2026
DCCA
left a comment
Owner
Author
There was a problem hiding this comment.
Code review
CI green (build ~20s); locally typecheck, lint, 172 tests, build all pass.
Strengths
- Clean baseline-gate semantics, each covered by a test: no baseline → establish + persist; regression → blocking comment with the baseline never moved; improvement → human-gated, comment until approved, then a PR writing
evals/baseline.json+ persisting state; stable → no-work. - Right primitives: durable baseline in the
StateStore, promotion behind aGate, and it exercises both output channels (comment + PR) — the dual-output path is correctly driven by the runner'soutputKind. - Deterministic grading (substring + tolerance) sidesteps flaky LLM-judged thresholds; the model/eval-set are injected, so it's fully unit-tested with fakes.
- The
run()change to resolve the PR number for any event-triggered loop (not justoutput: "comment") is the correct fix so comment output works here.
Notes (non-blocking)
detectandactboth run the eval (the model boundary) — fine with the fake; for a real model this is 2× calls per run. An optimization (thread the scorecard from detect) is a reasonable follow-up; consistent with how other loops recompute inact.- Substring grading is intentionally simple; rubric/per-category scorecards are noted future work.
Recommend merge.
Generated by Claude Code
DCCA
pushed a commit
that referenced
this pull request
Jun 23, 2026
Adds loops/prompt-eval-gate/: an LLMOps regression gate that scores a prompt eval set through the model, grades deterministically, and compares to a baseline in the durable StateStore — establishing it when absent, posting a blocking comment on regression (baseline unchanged), and human-gating baseline promotion (comment until approved, then a PR writing evals/baseline.json). Wired into the catalog/run (model = OpenRouter client, cases from LOOPY_EVAL_CASES_FILE); run() resolves the PR number for event-triggered loops. Shipped via the OpenSpec cycle. Validated: typecheck, lint, 172 tests, clean build; CI green.
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.
Summary
Adds the prompt-eval-gate loop (rank #4 from deep-dive #3) — an LLMOps regression gate over a prompt eval set, on the durable
StateStore+ a humanGate. loopy dogfoods it on its own AI loops' prompts.On a
pull_requestit runs the eval set through the model, grades deterministically, and compares to a baseline in the StateStore:evals/baseline.json+ persisting the new baseline.Uses both output channels (comment + PR). The CLI builds the model from the OpenRouter AI client, reads cases from
LOOPY_EVAL_CASES_FILE, file-backed state;run()now resolves the PR number for event-triggered loops so comment output works.OpenSpec
Source of truth:
openspec/specs/prompt-eval-gate.md.Validation
npm test— 172 tests (+6: establish / regress / gated-promote / stable + helpers)npm run build— cleanNext from the ranking: model-upgrade-migration, then api-deprecation-rollout.
🤖 Generated with Claude Code
https://claude.ai/code/session_012CrMioorha3QtPUgWbtDbR
Generated by Claude Code