Skip to content

Commit 0e0a78a

Browse files
refactor(evaluators)!: split into builtin + extra packages for PyPI (#5)
BREAKING CHANGE: Evaluator reorganization with new package structure Package Structure: - agent-control-evaluators (v3.0.0): core + regex, list, json, sql - agent-control-evaluator-galileo (v3.0.0): Luna2 evaluator Key Changes: - Entry points for evaluator discovery (agent_control.evaluators) - Dot notation for external evaluators (galileo.luna2 not galileo/luna2) - Dynamic __version__ via importlib.metadata - Server uses evaluators as runtime dep (no longer vendored) - Release workflow publishes both packages to PyPI Bug Fixes: - JSON evaluator: field_constraints/field_patterns in extra-fields allow-list - SQL evaluator: LIMIT/OFFSET bypass fix Migration: - Import: agent_control_evaluator_galileo.luna2 (not agent_control_evaluators.galileo_luna2) - DB: UPDATE controls SET evaluator.name replace('/', '.')
1 parent a485f93 commit 0e0a78a

88 files changed

Lines changed: 2298 additions & 1420 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.githooks/pre-push‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@ make lint
1414

1515
echo "pre-push: running make typecheck"
1616
make typecheck
17+
18+
# Check extras if they exist and have changes
19+
if [ -d "evaluators/extra/galileo" ]; then
20+
echo "pre-push: checking evaluators/extra/galileo"
21+
cd evaluators/extra/galileo
22+
uv run --extra dev ruff check --config ../../../pyproject.toml src/
23+
uv run --extra dev mypy --config-file ../../../pyproject.toml src/
24+
cd "$REPO_ROOT"
25+
fi

‎.github/workflows/release.yaml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
uv sync
4343
uv run python scripts/build.py all
4444
45+
# Publish in dependency order: models -> evaluators -> sdk -> evaluator-galileo
4546
- name: Publish agent-control-models to PyPI
4647
if: steps.release.outputs.released == 'true'
4748
uses: pypa/gh-action-pypi-publish@release/v1
@@ -50,6 +51,14 @@ jobs:
5051
user: __token__
5152
password: ${{ secrets.PYPI_API_TOKEN }}
5253

54+
- name: Publish agent-control-evaluators to PyPI
55+
if: steps.release.outputs.released == 'true'
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
with:
58+
packages-dir: evaluators/builtin/dist/
59+
user: __token__
60+
password: ${{ secrets.PYPI_API_TOKEN }}
61+
5362
- name: Publish agent-control-sdk to PyPI
5463
if: steps.release.outputs.released == 'true'
5564
uses: pypa/gh-action-pypi-publish@release/v1
@@ -58,6 +67,14 @@ jobs:
5867
user: __token__
5968
password: ${{ secrets.PYPI_API_TOKEN }}
6069

70+
- name: Publish agent-control-evaluator-galileo to PyPI
71+
if: steps.release.outputs.released == 'true'
72+
uses: pypa/gh-action-pypi-publish@release/v1
73+
with:
74+
packages-dir: evaluators/extra/galileo/dist/
75+
user: __token__
76+
password: ${{ secrets.PYPI_API_TOKEN }}
77+
6178
- name: Upload to GitHub Release
6279
if: steps.release.outputs.released == 'true'
6380
uses: python-semantic-release/upload-to-gh-release@main
@@ -67,5 +84,7 @@ jobs:
6784
root_options: "-vv"
6885
dist_glob: |
6986
models/dist/*
87+
evaluators/builtin/dist/*
7088
sdks/python/dist/*
7189
server/dist/*
90+
evaluators/extra/galileo/dist/*

‎AGENTS.md‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Forwarded targets:
2626
- `engine/`: **control evaluation engine and evaluator system** — all evaluation logic, evaluator discovery, and evaluator orchestration lives here (`engine/src/agent_control_engine/`)
2727
- `server/`: FastAPI server (`server/src/agent_control_server/`)
2828
- `sdks/python/`: Python SDK — uses engine for evaluation (`sdks/python/src/agent_control/`)
29-
- `evaluators/`: evaluator implementations (`evaluators/src/agent_control_evaluators/`)
29+
- `evaluators/builtin/`: builtin evaluator implementations (`evaluators/builtin/src/agent_control_evaluators/`)
30+
- `evaluators/extra/`: optional evaluator packages (e.g., `evaluators/extra/galileo/`)
3031
- `ui/`: Nextjs based web app to manage agent controls
3132
- `examples/`: runnable examples (ruff has relaxed import rules here)
3233

@@ -66,13 +67,19 @@ All testing guidance (including “behavior changes require tests”) lives in `
6667
4) add SDK wrapper in `sdks/python/src/agent_control/`
6768
5) add tests (server + SDK) and update docs/examples if user-facing
6869

69-
- Add a new evaluator:
70-
1) implement evaluator class extending `Evaluator` in `evaluators/src/agent_control_evaluators/`
71-
2) use `@register_evaluator` decorator (from `agent_control_models`)
72-
3) add entry point in `evaluators/pyproject.toml` for auto-discovery
73-
4) add tests in the evaluators package
70+
- Add a new builtin evaluator:
71+
1) implement evaluator class extending `Evaluator` in `evaluators/builtin/src/agent_control_evaluators/`
72+
2) use `@register_evaluator` decorator (from `agent_control_evaluators`)
73+
3) add entry point in `evaluators/builtin/pyproject.toml` for auto-discovery
74+
4) add tests in the evaluators/builtin package
7475
5) evaluator is automatically available to server and SDK via `discover_evaluators()`
7576

77+
- Add an external evaluator package:
78+
1) copy `evaluators/extra/template/` as a starting point
79+
2) implement evaluator class extending `Evaluator` from `agent_control_evaluators`
80+
3) add entry point using `org.name` format (e.g., `galileo.luna2`)
81+
4) package is discovered automatically when installed alongside agent-control
82+
7683
## Git/PR workflow
7784

7885
- Branch naming: `feature/...`, `fix/...`, `refactor/...`

0 commit comments

Comments
 (0)