Test code quality rubric with static datasets (Meta-Evals)#194
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive framework for evaluating AI agent skills, including a new run-evals skill, a test-rubric dummy skill for meta-evaluations, universal code quality rubrics, and a test suite to ensure structural consistency of evaluation files. Feedback focuses on making the newly added tests in skills_evals_test.dart more robust by dynamically resolving the package directory rather than relying directly on Directory.current, which can cause failures when tests are executed from the repository root.
| void main() { | ||
| group('Evals structure consistency', () { | ||
| // Ensures all evals.json files dynamically share the exact same JSON schema. | ||
| // Keys are not hardcoded to ensure enforcement remains schema-agnostic and flexible. | ||
| test('all evals.json files across skills share consistent structure and keys', () { | ||
| final List<File> evalsFiles = [ | ||
| ..._findEvalsFiles(Directory(p.join(Directory.current.path, 'skills'))), | ||
| ..._findEvalsFiles(Directory(p.join(Directory.current.path, '.agents', 'skills'))), | ||
| ]..sort((a, b) => a.path.compareTo(b.path)); |
There was a problem hiding this comment.
Using Directory.current directly can make tests fragile and fail when executed from the repository root (e.g., during CI/CD or monorepo tasks) rather than the package root (tool/dart_skills_lint).
We can resolve the package directory dynamically by checking if Directory.current points to the package root, and if not, appending the relative path.
| void main() { | |
| group('Evals structure consistency', () { | |
| // Ensures all evals.json files dynamically share the exact same JSON schema. | |
| // Keys are not hardcoded to ensure enforcement remains schema-agnostic and flexible. | |
| test('all evals.json files across skills share consistent structure and keys', () { | |
| final List<File> evalsFiles = [ | |
| ..._findEvalsFiles(Directory(p.join(Directory.current.path, 'skills'))), | |
| ..._findEvalsFiles(Directory(p.join(Directory.current.path, '.agents', 'skills'))), | |
| ]..sort((a, b) => a.path.compareTo(b.path)); | |
| void main() { | |
| final packageDir = Directory.current.path.endsWith('tool/dart_skills_lint') | |
| ? Directory.current | |
| : Directory(p.join(Directory.current.path, 'tool', 'dart_skills_lint')); | |
| group('Evals structure consistency', () { | |
| // Ensures all evals.json files dynamically share the exact same JSON schema. | |
| // Keys are not hardcoded to ensure enforcement remains schema-agnostic and flexible. | |
| test('all evals.json files across skills share consistent structure and keys', () { | |
| final List<File> evalsFiles = [ | |
| ..._findEvalsFiles(Directory(p.join(packageDir.path, 'skills'))), | |
| ..._findEvalsFiles(Directory(p.join(packageDir.path, '.agents', 'skills'))), | |
| ]..sort((a, b) => a.path.compareTo(b.path)); |
| // Note: We intentionally only require an evals.json file for published skills. | ||
| // Contributor skills in .agents/skills/ are not currently required to have one. | ||
| test('all published skills have an evals.json file', () { | ||
| final skillsDir = Directory(p.join(Directory.current.path, 'skills')); |
There was a problem hiding this comment.
| }); | ||
|
|
||
| test('all rubric JSON files in evals/ share consistent structure and keys', () { | ||
| final rubricsDir = Directory(p.join(Directory.current.path, 'evals')); |
There was a problem hiding this comment.
aa8c477 to
de6c96b
Compare
352023e to
3104642
Compare
Meta-Eval Run ResultsI've successfully run the 🔴 Eval 1: Negative Test Case (
|
Updated Meta-Eval Run ResultsAfter updating the 🔴 Eval 1: Negative Test Case (
|
|
/gemini-review |
| @@ -0,0 +1,15 @@ | |||
| // ignore_for_file: unused_local_variable, prefer_final_locals, avoid_print, use_raw_strings | |||
There was a problem hiding this comment.
This file needs a copyright statement.
| @@ -0,0 +1,15 @@ | |||
| import 'package:path/path.dart' as p; | |||
There was a problem hiding this comment.
This file needs a copyright statement.
Adds a static dataset of good and bad code and a meta-eval dummy skill to test that the code quality rubric successfully catches anti-patterns and permits clean code.
Addresses PR #189 feedback by moving to a static fixture approach instead of having the LLM generate bad code on the fly.