Repository navigation
Add experimental-plugins/ares-openeval-adapter - #579
adhabnr-ux wants to merge 2 commits into
Conversation
Adds a standalone, optional plugin converting ARES attack goals and AttackEval output to/from EvalPort (https://github.com/adhabnr-ux/evalport), a small open interchange format for portable eval datasets and results. Scoped in issue IBM#563 (maintainer @stefano81 confirmed experimental-plugins/ as the right home). Grounded in ARES's real current shapes, not the illustrative sketch from the issue: ares.utils.ConnectorResponse/Status (src/ares/utils/__init__.py), AttackEval.validate_evaluation()/ interpret_prediction() (src/ares/evals/attack_eval.py), and AttackGoal.run()'s goal-dict shape (src/ares/goals/attack_goal.py, file_attack_goals.py). Every accessor is duck-typed against these shapes rather than importing `ares` directly, so the plugin has no hard `ares` dependency and works against real ARES objects or plain dicts of the same shape (e.g. loaded back from a saved goals/results JSON file) alike. ARES's judgment mechanism (keyword match / LLM judge / trained classifier, evaluator-specific) is represented as a single `custom` grader per the spec's own custom-grader mechanism, not force-fit into one of EvalPort's standard grader types. 13/13 tests passing, validated against evalport-sdk's real validate_suite()/validate_result_set(). Signed-off-by: adhabnr-ux <[email protected]> Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RtocdH3tKifGdkiCZxxV3F
|
|
||
| from dataclasses import asdict, is_dataclass | ||
| from datetime import datetime, timezone | ||
| from typing import Any, Dict, List, Optional |
There was a problem hiding this comment.
| from typing import Any, Dict, List, Optional | |
| from typing import Any |
Dict --> dict
List --> list
Optional[str] --> str | None
as per https://peps.python.org/pep-0585/. and https://peps.python.org/pep-0604/
There was a problem hiding this comment.
Using pyupgrade one can fix this type of issues.
Example:
pyupgrade --py311-plus experimental-plugins/ares-openeval-adapter/We will probably add it to the pre-commit configuration.
Addresses @nedshivina and @stefano81's review comments on PR IBM#579 -- Dict/List/Optional -> dict/list/X | None throughout, plus one UP017 hit ruff caught (datetime.timezone.utc -> datetime.UTC) that pyupgrade's CLI didn't flag on its own. Verified: `ruff check --target-version py311` clean, `ruff format --check` clean (this repo's exact tool.ruff config), and the existing 13-test suite still 13/13 passing after the change. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RtocdH3tKifGdkiCZxxV3F
|
Thanks @nedshivina and @stefano81 — good catch, and the PEP 585/604 modernization is fully consistent with this repo's own Pushed in
@stefano81 — I ran Verified before pushing:
Let me know if you'd like anything else adjusted. |
Addresses @nedshivina and @stefano81's review comments on PR IBM#579 -- Dict/List/Optional -> dict/list/X | None throughout, plus one UP017 hit ruff caught (datetime.timezone.utc -> datetime.UTC) that pyupgrade's CLI didn't flag on its own. Also fixes the two remaining ruff findings (import sort + unused `pytest` import in tests/test_adapter.py, docstring-code formatting in README.md) so `ruff check`/`ruff format --check` are fully clean against this repo's own tool.ruff config, not just the reviewed file. Verified: `ruff check`/`ruff format --check` clean, 13/13 tests passing. This replaces the previous top commit (883eeeb), which had the same content but was missing its DCO sign-off -- recreated here with it included so the DCO check passes. Signed-off-by: adhabnr-ux <[email protected]> Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RtocdH3tKifGdkiCZxxV3F
|
Correction: GitHub won't allow reopening once a closed PR's branch has been force-pushed/recreated, so I'll open a fresh PR with this same (now DCO-clean, review-comment-addressed) content instead of reopening this one — closing this out in favor of that, same as #578 → #579. Will link it here once it's up. Apologies for the churn.Sorry for the noise — GitHub auto-closed this when I deleted the branch to rewrite its history (needed to fix a DCO sign-off gap on the second commit, which also let me apply @nedshivina/@stefano81's typing-modernization suggestion properly). Reopening now; the branch is back with the same content, the requested fix, and a valid Signed-off-by trailer on every commit. |
|
New PR is up: #583 — same content, DCO sign-off fixed, and the typing-modernization feedback from @nedshivina and @stefano81 applied throughout (plus a couple of pre-existing, unrelated ruff findings cleaned up along the way). |
Addresses @nedshivina and @stefano81's review comments on PR #579 -- Dict/List/Optional -> dict/list/X | None throughout, plus one UP017 hit ruff caught (datetime.timezone.utc -> datetime.UTC) that pyupgrade's CLI didn't flag on its own. Also fixes the two remaining ruff findings (import sort + unused `pytest` import in tests/test_adapter.py, docstring-code formatting in README.md) so `ruff check`/`ruff format --check` are fully clean against this repo's own tool.ruff config, not just the reviewed file. Verified: `ruff check`/`ruff format --check` clean, 13/13 tests passing. This replaces the previous top commit (883eeeb), which had the same content but was missing its DCO sign-off -- recreated here with it included so the DCO check passes. Signed-off-by: adhabnr-ux <[email protected]> Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RtocdH3tKifGdkiCZxxV3F
Resolves #563 (thanks for the steer there, @stefano81).
Replaces #578, which the DCO bot correctly flagged as missing a
Signed-off-bytrailer — that commit's ref was deleted and recreated below with the sign-off included. Content is otherwise identical.What this adds
A standalone, optional plugin at
experimental-plugins/ares-openeval-adapter/converting ARES attack goals andAttackEvaloutput to and from EvalPort, a small open interchange format for portable eval datasets and results.ares.utils.ConnectorResponse/Status(src/ares/utils/__init__.py),AttackEval.validate_evaluation()/interpret_prediction()(src/ares/evals/attack_eval.py), andAttackGoal.run()'s goal-dict shape (src/ares/goals/attack_goal.py,file_attack_goals.py).aresdirectly, so the plugin has no hardaresdependency and works against real ARES objects or plain dicts of the same shape alike.customgrader (gr_ares_attack_eval,params.handler = "ares:attack_eval") per the spec's own custom-grader mechanism, rather than force-fit into one of EvalPort's standard grader types.passedreflects target-model robustness (attack did not succeed), with ARES's"Unknown"tri-state preserved separately inmetadatarather than collapsed away.Structured to match
experimental-plugins/ares-contextual-jailbreak's existing layout (setup.pystub,pyproject.toml,requirements.txtwith-e .,src/package,tests/).Verification
against a fresh install, with
openeval.validate.validate_suite()/validate_result_set()both passing on everything the plugin produces. Fixtures mirror ARES's real dataclass/dict shapes (ConnectorResponse,AttackGoal.run()output) directly rather than importingaresitself (which pulls intorchand isn't yet on PyPI) — same approach the plugin's own runtime code takes.Background
Built and tested first, then initially shipped as a standalone package in EvalPort's own repo while I worked out write access here (see the issue thread), then opened directly as #578. This PR is that same content with the DCO sign-off fixed.
— Sahi, independent contributor (not affiliated with IBM)
🤖 Generated with Claude Code
https://claude.ai/code/session_01RtocdH3tKifGdkiCZxxV3F