feat(evaluator): add evaluator contract extension with model routing - #4390
Open
tbitcs wants to merge 3 commits into
Open
feat(evaluator): add evaluator contract extension with model routing#4390tbitcs wants to merge 3 commits into
tbitcs wants to merge 3 commits into
Conversation
added 3 commits
September 1, 2026 14:23
Implements the standard evaluator result contract proposed in github#4290. This is a provider-neutral protocol for extensions that evaluate artifact quality between Spec-Driven Development phases. Extension (extensions/evaluator/): - JSON Schema for evaluator results (6 outcomes, 14 finding kinds, 5 evidence kinds) - 4 commands: run, compose, report, route - 3 scripts: Python, Bash, PowerShell (parity across all runtimes) - 4 lifecycle hooks: after_specify, after_plan, after_tasks, after_implement - Model routing: recommends budget/standard/premium tier per phase - Composition: strict/majority/optimistic strategies with contradiction detection Tests (tests/extensions/evaluator/): - 70 tests: layout, catalog, install, compose logic, benchmarks, model routing - 0 regressions against full test suite (4296 passed) Benchmarks (benchmarks/evaluator/): - SDD workflow simulation with 8 evaluators across 4 phases - Composition at scale: up to 20 evaluators x 100 findings (2000 total) - Report generation in all 5 formats (terminal, markdown, JSON, CI, gate) - Token-economic simulation with Monte Carlo (500 runs/scenario) - Portfolio approach: budget for routine, premium for critical decisions Catalog: registered as bundled extension in extensions/catalog.json Assisted-by: GitHub Copilot (model: deepseek-v4-pro, autonomous)
All 17 files now comply with .editorconfig (insert_final_newline = true) and .pre-commit-config.yaml (end-of-file-fixer). No trailing whitespace. Assisted-by: GitHub Copilot (model: deepseek-v4-pro, autonomous)
Self-contained demo that creates 3 evaluator results for a realistic e-commerce checkout scenario, composes them, generates all 5 report formats, and shows model routing — all in one script with zero deps. Usage: python extensions/evaluator/examples/demo.py Assisted-by: GitHub Copilot (model: deepseek-v4-pro, autonomous)
Collaborator
|
Looks really nice! Can you host it on your own GitHub repo as per the extension publishing guide? See https://github.com/github/spec-kit/blob/main/extensions/EXTENSION-PUBLISHING-GUIDE.md |
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
Implements the standard evaluator result contract proposed in #4290. This is a provider-neutral protocol for extensions that evaluate artifact quality between Spec-Driven Development phases.
Extension (
extensions/evaluator/)speckit.evaluator.run,.compose,.report,.routeafter_specify,after_plan,after_tasks,after_implementpython extensions/evaluator/examples/demo.py— self-contained, zero depsTests (
tests/extensions/evaluator/)Benchmarks (
benchmarks/evaluator/)Catalog
Registered as bundled extension in
extensions/catalog.json.Description
This PR adds the evaluator contract extension — a standardized protocol for extensions that evaluate artifact quality between SDD phases. Currently, every evidence, provenance, factuality, security, or governance extension invents its own result format. This contract provides a shared schema and composition semantics so independently developed evaluators can interoperate.
The contract defines:
pass,warn,iterate,clarify,gather_evidence,blockobserved,inferred,asserted,contradicted,unsupportedKey Design Decisions
observedfrominferredfromassertedfromcontradictedfromunsupportedstateis preserved as an opaque objectBenchmark Validation
All benchmarks are reproducible via
python benchmarks/evaluator/run_benchmarks.py --scaleandpython benchmarks/evaluator/token_economics.py --monte-carlo 500.Composition Performance (Scale Mode)
Composition scales linearly. All findings retain evaluator origin tags. Contradictory findings are preserved, not collapsed.
Token-Economic Impact (Monte Carlo, 500 runs/scenario, p < 0.001)
Executive Summary:
Representative Scenario — Portfolio Tier × Large Platform:
Representative Scenario — Portfolio Tier × Small MVP:
Contradiction Detection Accuracy
Both viewpoints are always preserved — contradictions are never collapsed.
Report Generation Throughput
All formats render in sub-millisecond time per finding.
Methodology
Testing
uv run specify --helpuv sync && uv run pytestSample project:
specify init→extension add --dev evaluator→ 4 commands installed →extension remove evaluatorclean uninstall.Quick-Start Demo
Runs a self-contained e-commerce checkout scenario with 3 evaluators, 7 findings, composition, all 5 report formats, and model routing. Zero dependencies beyond Python 3.11+ stdlib.
AI Disclosure
This contribution was generated by GitHub Copilot (model: deepseek-v4-pro, autonomous). The AI generated the extension scaffolding, JSON Schema, all 4 command files, 3 parity scripts (Python/Bash/PowerShell), 70 tests across 3 test files, 2 benchmark modules (composition + token economics), the quick-start demo, and the catalog entry. All generated code was reviewed for correctness. Tests were run and verified with zero failures. The extension was validated end-to-end with
specify init→extension add→extension removein a sample project.Closes #4290