|
1 | | -# Evaluator Template |
| 1 | +# Contrib Evaluator Template |
2 | 2 |
|
3 | | -Starter template for creating a custom evaluator package. |
| 3 | +This directory is scaffolding for a new contrib evaluator package. |
| 4 | + |
| 5 | +It is intentionally excluded from repo automation until you convert it into a real package. In |
| 6 | +particular, `template/` does not participate in root `make check`, CI, semantic-release, or |
| 7 | +publishing because it ships a `pyproject.toml.template` placeholder instead of a real |
| 8 | +`pyproject.toml`. |
| 9 | + |
| 10 | +## Naming contract |
| 11 | + |
| 12 | +Pick `<name>` as a short lowercase single-word identifier such as `galileo`, `cisco`, or |
| 13 | +`budget`. That same value should appear in the steady-state package shape: |
| 14 | + |
| 15 | +- directory: `evaluators/contrib/<name>/` |
| 16 | +- pip package: `agent-control-evaluator-<name>` |
| 17 | +- Python module: `agent_control_evaluator_<name>` |
| 18 | +- extra name: `agent-control-evaluators[<name>]` |
| 19 | +- entry-point namespace: `<name>.<evaluator_id>` |
| 20 | + |
| 21 | +The template uses `{{NAME}}` for that package identifier. It does not use `{{ORG}}`. |
| 22 | + |
| 23 | +## Scaffold a new contrib package |
| 24 | + |
| 25 | +1. Copy the template and rename the manifest: |
| 26 | + |
| 27 | + ```bash |
| 28 | + cp -r evaluators/contrib/template evaluators/contrib/<name> |
| 29 | + mv evaluators/contrib/<name>/pyproject.toml.template \ |
| 30 | + evaluators/contrib/<name>/pyproject.toml |
| 31 | + ``` |
| 32 | + |
| 33 | +2. Replace placeholders in `pyproject.toml`: |
| 34 | + |
| 35 | + - `{{NAME}}` -> contrib package identifier |
| 36 | + - `{{EVALUATOR}}` -> evaluator snake_case id |
| 37 | + - `{{CLASS}}` -> evaluator class name |
| 38 | + - `{{AUTHOR}}` -> authoring team |
| 39 | + |
| 40 | +3. Add package code and tests: |
| 41 | + |
| 42 | + - `src/agent_control_evaluator_<name>/` |
| 43 | + - `tests/` |
| 44 | + |
| 45 | +4. Validate the package locally: |
| 46 | + |
| 47 | + ```bash |
| 48 | + make lint |
| 49 | + make lint-fix |
| 50 | + make typecheck |
| 51 | + make test |
| 52 | + make check |
| 53 | + make build |
| 54 | + ``` |
| 55 | + |
| 56 | +## Canonical install docs |
| 57 | + |
| 58 | +Contributor-facing and user-facing package docs should treat this as the canonical install path: |
| 59 | + |
| 60 | +```bash |
| 61 | +pip install "agent-control-evaluators[<name>]" |
| 62 | +``` |
| 63 | + |
| 64 | +Direct wheel installs such as `pip install agent-control-evaluator-<name>` can still be |
| 65 | +documented, but they are secondary to the extra on `agent-control-evaluators`. |
| 66 | + |
| 67 | +## Expected repo wiring |
| 68 | + |
| 69 | +After the new package exists as a real contrib package, wire it into the repo contract: |
| 70 | + |
| 71 | +1. Add the extra to `evaluators/builtin/pyproject.toml`: |
| 72 | + |
| 73 | + ```toml |
| 74 | + [project.optional-dependencies] |
| 75 | + <name> = ["agent-control-evaluator-<name>>=<current-version>"] |
| 76 | + ``` |
| 77 | + |
| 78 | +2. Add the workspace source pin to `evaluators/builtin/pyproject.toml`: |
| 79 | + |
| 80 | + ```toml |
| 81 | + [tool.uv.sources] |
| 82 | + agent-control-evaluator-<name> = { path = "../contrib/<name>", editable = true } |
| 83 | + ``` |
| 84 | + |
| 85 | +3. Add the package to the root semantic-release version train in `pyproject.toml`: |
| 86 | + |
| 87 | + ```toml |
| 88 | + "evaluators/contrib/<name>/pyproject.toml:project.version", |
| 89 | + ``` |
| 90 | + |
| 91 | +Until those steps are done, the package is still scaffolding rather than a real contrib package. |
4 | 92 |
|
5 | 93 | Docs: https://docs.agentcontrol.dev/concepts/evaluators/contributing-evaluator |
0 commit comments