Skip to content

Add prompt-eval-gate loop (LLMOps regression gate)#13

Merged
DCCA merged 1 commit into
mainfrom
claude/openspec-skills-import-4xj0qo
Jun 23, 2026
Merged

Add prompt-eval-gate loop (LLMOps regression gate)#13
DCCA merged 1 commit into
mainfrom
claude/openspec-skills-import-4xj0qo

Conversation

@DCCA

@DCCA DCCA commented Jun 23, 2026

Copy link
Copy Markdown
Owner

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 human Gate. loopy dogfoods it on its own AI loops' prompts.

On a pull_request it runs the eval set through the model, grades deterministically, and compares to a baseline in the StateStore:

  • no baseline → establish it (comment);
  • regression (a case that passed in baseline now fails) → blocking advisory comment, baseline unchanged;
  • improvement → human-gated promotion: a comment until approved, then a PR writing 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

  • typecheck / lint — clean
  • npm test172 tests (+6: establish / regress / gated-promote / stable + helpers)
  • npm run build — clean

Next from the ranking: model-upgrade-migration, then api-deprecation-rollout.

🤖 Generated with Claude Code

https://claude.ai/code/session_012CrMioorha3QtPUgWbtDbR


Generated by Claude Code

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 DCCA left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a Gate, and it exercises both output channels (comment + PR) — the dual-output path is correctly driven by the runner's outputKind.
  • 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 just output: "comment") is the correct fix so comment output works here.

Notes (non-blocking)

  • detect and act both 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 in act.
  • Substring grading is intentionally simple; rubric/per-category scorecards are noted future work.

Recommend merge.


Generated by Claude Code

@DCCA
DCCA merged commit aef47ff into main Jun 23, 2026
1 check passed
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.
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