ci(eval): add eval gate workflow (mock default, live via dispatch)

Sprint 4 ADR-001 M4 enforcement in CI.

Triggers:
- pull_request on packages/{prompts,agents,evals,jurisdictions,
  schemas/clauses,llm-gateway}/** — always runs with --profile=mock
  (zero LLM creds in PR CI, no accidental cost)
- workflow_dispatch with choice [mock, cloud-cheap, cloud-premium] for
  manual live runs

local-data-sovereign profile is NOT available in CI by design (no
Ollama / GPU on GitHub runners) — run locally with
  uv run pytest packages/evals/tests/ -m eval --profile=local-data-sovereign

junit XML uploaded as artifact for regression triage. ANTHROPIC_API_KEY
passed from secrets but only consumed when profile != mock; harmless
when unset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
tobayah
2026-05-17 17:40:25 +02:00
co-authored by Claude Opus 4.7
parent f876883a47
commit 17f6bc1f62
+76
View File
@@ -0,0 +1,76 @@
name: eval
# Sprint 4 — eval gate per ADR-001 M4 (eval-driven prompts).
#
# PR-triggered runs always go to the deterministic mock provider — verifies
# pipeline wiring, schema invariants, jurisdiction post-extraction logic, etc.
# without burning LLM credits. Live runs (cloud-cheap baseline / cloud-premium
# critical) are manual via workflow_dispatch.
#
# local-data-sovereign profile is *not* available in CI — Bielik / Ollama
# require local GPU. Run it locally with
# ``uv run pytest packages/evals/tests/ -m eval --profile=local-data-sovereign``.
on:
pull_request:
paths:
- 'packages/prompts/**'
- 'packages/agents/**'
- 'packages/evals/**'
- 'packages/jurisdictions/**'
- 'packages/schemas/clauses/**'
- 'packages/llm-gateway/**'
- '.github/workflows/eval.yml'
workflow_dispatch:
inputs:
profile:
description: 'LLM profile to evaluate against'
type: choice
options:
- mock
- cloud-cheap
- cloud-premium
default: mock
permissions:
contents: read
pull-requests: write
jobs:
eval:
name: eval (${{ github.event.inputs.profile || 'mock' }})
runs-on: ubuntu-latest
timeout-minutes: 15
env:
LANGFUSE_ENABLED: 'false'
LLM_PROFILE: ${{ github.event.inputs.profile || 'mock' }}
# ANTHROPIC_API_KEY only consumed when profile != mock; harmless when unset.
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Sync workspace (all packages)
run: uv sync --all-packages
- name: Eval suite
run: |
uv run pytest packages/evals/tests/ \
-m eval \
--profile=${{ github.event.inputs.profile || 'mock' }} \
-v \
--tb=short \
--junitxml=eval-results.xml
- name: Upload eval results
if: always()
uses: actions/upload-artifact@v4
with:
name: eval-results-${{ github.event.inputs.profile || 'mock' }}
path: eval-results.xml
retention-days: 30