-
Notifications
You must be signed in to change notification settings - Fork 2
feat(evals): Tier 0 static lint + Tier 1 activation evals for all 18 skills #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1ab0ecd
feat(evals): Tier 0 static lint for all plugins + fix the drift it found
jordanrburger 5fef7b0
feat(evals): Tier 1 activation evals for all 18 skills + CI workflow
jordanrburger 88f99cb
feat(evals): 45 activation cases derived from real Kai conversations
jordanrburger 3d79875
fix(evals): address PR #89 review — recall gate, composite keys, pars…
jordanrburger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Skill evals | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| tier0-lint: | ||
| name: "Tier 0: static lint + case validation" | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup uv | ||
| uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - name: Install Python | ||
| run: uv python install 3.12 | ||
|
|
||
| - name: Run static lint + offline activation-case validation | ||
| working-directory: evals | ||
| run: uv run --group dev pytest -q | ||
|
|
||
| tier1-activation: | ||
| name: "Tier 1: skill activation routing" | ||
| runs-on: ubuntu-latest | ||
| # The paid tier only runs once the free deterministic tier is green. | ||
| needs: tier0-lint | ||
| # Needs an LLM classifier; runs only where the secret is available | ||
| # (skipped on forks). Deterministic grading, temperature 0. | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup uv | ||
| uses: astral-sh/setup-uv@v5 | ||
|
|
||
| - name: Install Python | ||
| run: uv python install 3.12 | ||
|
|
||
| - name: Run activation evals | ||
| working-directory: evals | ||
| env: | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| run: | | ||
| if [ -z "$ANTHROPIC_API_KEY" ]; then | ||
| echo "ANTHROPIC_API_KEY secret not available — skipping Tier 1 (fork PR?)" | ||
| exit 0 | ||
| fi | ||
| uv run python activation/run_activation.py --ci | ||
|
|
||
| - name: Upload activation summary | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: activation-summary | ||
| path: evals/activation/results/summary.json | ||
| if-no-files-found: ignore | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| activation/results/ | ||
| .venv/ | ||
| __pycache__/ |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Skill evals | ||
|
|
||
| Empirical quality gates for ai-kit skills: edit a skill → CI measures whether | ||
| an equipped agent behaves better → regressions block the PR. | ||
|
|
||
| This is the fast half (Tiers 0–1) of the four-tier design shared with | ||
| [keboola/KaiBench](https://github.com/keboola/KaiBench) (see its | ||
| `docs/skill-evals.md`). The heavy tiers — Tier 2 behavior evals (agent runs a | ||
| case with only the target skill loaded, graded by KaiBench's graders) and | ||
| Tier 3 live E2E — run from KaiBench, which supports `skill`-tagged cases, | ||
| `--skill-dir` skill loading, and per-skill metrics. | ||
|
|
||
| | Tier | What | Cost | Where | | ||
| |------|------|------|-------| | ||
| | **0 — Static lint** | Frontmatter validity, name↔directory, manifest/version consistency, dangling references, script conventions | Seconds, no LLM | here, every PR | | ||
| | **1 — Activation** | Routing precision/recall of each skill's `description:` against labeled utterances | ~200 cheap classifier calls | here, every PR (needs `ANTHROPIC_API_KEY`) | | ||
| | 2 — Behavior | Agent + isolated skill on graded cases (`outcome_score` / `process_score`) | Medium | KaiBench | | ||
| | 3 — Live E2E | Live Keboola project ops on the full harness | Slow | KaiBench, nightly | | ||
|
|
||
| ## Running locally | ||
|
|
||
| ```bash | ||
| cd evals | ||
|
|
||
| # Tier 0 + offline case validation (no API key) | ||
| uv run --group dev pytest -q | ||
|
|
||
| # Tier 1 — activation routing (needs ANTHROPIC_API_KEY) | ||
| uv run python activation/run_activation.py # report only | ||
| uv run python activation/run_activation.py --ci # gate on thresholds | ||
| uv run python activation/run_activation.py --skill get-started | ||
| uv run python activation/run_activation.py --dry-run # list cases, no API | ||
| ``` | ||
|
|
||
| The activation run writes `activation/results/summary.json` (overall accuracy, | ||
| per-skill precision/recall, every misroute with the router's actual pick). | ||
|
|
||
| ## How Tier 1 works | ||
|
|
||
| The classifier (Claude Haiku, temperature 0) is shown the **full list of the | ||
| marketplace's skill descriptions** — the same surface the real harness routes | ||
| on — plus one user utterance, and asked which skills it would invoke. Grading | ||
| is deterministic: the skill under test must appear iff the case says | ||
| `should_trigger`. Perfect recall with some co-activation false positives is | ||
| the common failure texture; the misroute list is the backlog for sharpening | ||
| `description:` fields. | ||
|
|
||
| CI thresholds (see `--min-accuracy` / `--min-skill-accuracy`): ≥85% overall, | ||
| ≥60% per skill. | ||
|
|
||
| ## Adding cases | ||
|
|
||
| Every skill must have `plugins/<plugin>/evals/<skill-dir>/trigger-evals.json` | ||
| (enforced by Tier 0). Format: | ||
|
|
||
| ```json | ||
| [ | ||
| {"query": "brand new component for the github api, where do i start", "should_trigger": true}, | ||
| {"query": "my component job fails with exit code 2", "should_trigger": false} | ||
| ] | ||
| ``` | ||
|
|
||
| Guidelines: | ||
|
|
||
| - ≥6 cases, ≥2 positive and ≥2 negative (enforced). | ||
| - Write **hard negatives**: utterances that belong to a *sibling* skill | ||
| (e.g. debug-component vs develop-component), not obviously unrelated ones. | ||
| - Positives should paraphrase real user phrasing, including the trigger | ||
| phrases the description promises to catch. | ||
| - When you edit a `description:`, re-run Tier 1 and check the skill's | ||
| precision/recall — that is the whole point of the loop. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]
tier1-activationdoesn't depend ontier0-lint— a red lint still burns a paid API runThe two jobs run in parallel, so if Tier 0 (the cheap, deterministic gate) fails, Tier 1 still fires ~194 Haiku calls on an already-failing PR. Adding
needs: tier0-lintto this job means the paid tier only runs once the free tier is green.