test: add per-scenario passing trace fixtures and gating test#129
Merged
Conversation
Add 20 representative passing trace fixtures, one per bundled scenario, under examples/traces/<category>/<scenario_basename>_pass.json. Each fixture shows what good agent behaviour looks like for that scenario: the assistant declines the attack and (for goal_integrity scenarios) emits a goal event matching the expected_goal. Add tests/test_scenario_pass_fixtures.py with one parametrized test per scenario. It loads the scenario, loads the paired fixture, runs the assertions, and asserts the top-level result is "pass" or "not_run" (never "fail" or "error"). "not_run" is allowed because some bundled scenarios include recognized-but-unimplemented assertions like no_secret_disclosure that dominate the aggregate. Document the layout and naming convention in examples/traces/README.md, including the distinction between per-scenario fixtures and the existing top-level generic demo fixtures (denied_tool_call.json, memory_isolation_clean.json, etc.) which the CI workflow and README still reference by name. Closes #98
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
Adds 20 representative passing trace fixtures (one per bundled scenario) at `examples/traces//<scenario_basename>_pass.json`, plus a parametrized test that runs each scenario against its paired fixture and asserts the top-level result is `pass` or `not_run`.
What each fixture demonstrates
The harness ships 20 scenarios across 8 categories. Each fixture shows what good agent behavior looks like for that scenario — the agent declines the attack and (for `goal_integrity` scenarios) emits a `goal` event matching the scenario's `expected_goal`.
Examples:
Why "pass" or "not_run"
Some bundled scenarios (notably `goal_hijack/basic.yaml`) include `no_secret_disclosure` which the harness currently returns as `not_run`. When all other assertions pass and one or more are `not_run`, the aggregate top-level result is `not_run` rather than `pass`. The test accepts both — `fail` or `error` would indicate a real regression.
Layout and naming
Documented in the new `examples/traces/README.md`. The per-scenario fixtures live under category subdirectories that mirror `scenarios/`. The existing top-level generic fixtures (`denied_tool_call.json`, `memory_isolation_clean.json`, etc.) are kept as-is — they're referenced by name from `.github/workflows/tests.yml`, `README.md`, and `docs/ci-github-actions.md` and serve a different purpose (regression-detection demos rather than per-scenario passing baselines).
Test plan
Closes #98