Skip to content

Add experimental-plugins/ares-openeval-adapter - #579

Closed
adhabnr-ux wants to merge 2 commits into
IBM:mainfrom
adhabnr-ux:add-ares-openeval-adapter
Closed

adhabnr-ux wants to merge 2 commits into
IBM:mainfrom
adhabnr-ux:add-ares-openeval-adapter

Conversation

@adhabnr-ux

Copy link
Copy Markdown
Contributor

Resolves #563 (thanks for the steer there, @stefano81).

Replaces #578, which the DCO bot correctly flagged as missing a Signed-off-by trailer — 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 and AttackEval output to and from EvalPort, a small open interchange format for portable eval datasets and results.

  • Grounded in ARES's real current shapes rather than the issue's illustrative sketch: 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 (dict or dataclass access) 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 alike.
  • ARES's judgment mechanism (keyword match / LLM judge / trained classifier — evaluator-specific) is represented as a single custom grader (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.
  • passed reflects target-model robustness (attack did not succeed), with ARES's "Unknown" tri-state preserved separately in metadata rather than collapsed away.

Structured to match experimental-plugins/ares-contextual-jailbreak's existing layout (setup.py stub, pyproject.toml, requirements.txt with -e ., src/ package, tests/).

Verification

13 passed

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 importing ares itself (which pulls in torch and 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

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
Copilot AI lite review requested due to automatic review settings September 2, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.


from dataclasses import asdict, is_dataclass
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@adhabnr-ux

Copy link
Copy Markdown
Contributor Author

Thanks @nedshivina and @stefano81 — good catch, and the PEP 585/604 modernization is fully consistent with this repo's own ruff config (target-version = "py311", select includes "UP"), so it should have been done that way from the start.

Pushed in 883eeeb:

  • from typing import Any, Dict, List, Optional → from typing import Any
  • Dict[str, Any] → dict[str, Any] throughout
  • List[Any] → list[Any] throughout
  • str | None in place of every Optional[str]

@stefano81 — I ran pyupgrade --py311-plus experimental-plugins/ares-openeval-adapter/ against the modernized file per your suggestion; it exited clean with no further changes, confirming the manual edit already matched what pyupgrade would produce. Running the repo's actual ruff check --target-version py311 on top of that caught one more real issue beyond what pyupgrade's CLI flagged on its own: UP017 (datetime.now(timezone.utc) should be datetime.now(UTC)). Fixed that too (ruff check --fix + ruff format, then cleaned up the resulting unused timezone import by hand) — might be worth folding ruff check --select UP into the pre-commit config alongside (or instead of) pyupgrade, since it caught something pyupgrade's own CLI didn't.

Verified before pushing:

  • ruff check --target-version py311 (repo's exact lint config): all checks passed
  • ruff format --check: 1 file already formatted
  • pytest tests/test_adapter.py -v: 13/13 passing, both before and after the additional UP017 fix (no behavioral change)

Let me know if you'd like anything else adjusted.

@adhabnr-ux adhabnr-ux closed this Sep 3, 2026
@adhabnr-ux
adhabnr-ux deleted the add-ares-openeval-adapter branch September 3, 2026 01:28
adhabnr-ux added a commit to adhabnr-ux/ares that referenced this pull request Sep 3, 2026
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
@adhabnr-ux

Copy link
Copy Markdown
Contributor Author

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.

@adhabnr-ux

Copy link
Copy Markdown
Contributor Author

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).

stefano81 pushed a commit that referenced this pull request Sep 4, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: ares-openeval-adapter — portable export of ARES goals/results to a shared eval interchange format

4 participants