test(security): evaluate layered reviewer actions - #602
Open
rakeshutekar wants to merge 1 commit into
Open
Conversation
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
The layered reviewer corpus documents 121 action-review scenarios, but the public reviewer evaluation harness could not select or score it.
Structured provenance was also discarded during loading, leaving provenance and transformed-injection scenarios without the context they were designed to evaluate.
This change adds an explicit evaluator path for
reviewer_actions.jsonl, safely renders its structured provenance, and applies mixed-corpus safety and utility gates.Behavior
Run the layered evaluator with:
The development run evaluates 101 rows.
--include-holdoutevaluates all 121 rows.The layered corpus passes only when:
askordenyrowsalloware correctly allowedrecommended_gateremains advisory routing metadata. It is reported separately and does not alter the reviewer output score.Reports include breakdowns by tool family, OS, provenance, and tag.
Implementation
reviewer_actionsas an explicit--corpusselectionrecommended_gatemetadataCompatibility
The default evaluation remains unchanged:
benigndangerousinjectionThe layered corpus is opt-in, so existing evaluation cost and release workflows do not change.
This PR does not modify production reviewer behavior, public runtime APIs, or corpus data.
Verification
pytest -qpython scripts/validate_layered_corpora.pypython -m compileall -q scripts/eval_reviewer.py tests/test_shadow_eval.pygit diff --checkIndependent review found no remaining medium- or high-severity findings.
Coordination
This PR is independent of #587 and #601.
#598 adds reviewer-action scenarios and changes reviewer instructions. If it merges first, this branch should be rebased and the corpus counts and evaluation output refreshed before merging.
Out of scope
This PR does not:
recommended_gatepolicy changesaction_sequences.jsonl