Repository navigation
fix(regress): do not report PASS for replays that could not check the rule (#159) - #161
Open
RupeshMaster wants to merge 1 commit into
Open
RupeshMaster wants to merge 1 commit into
RupeshMaster wants to merge 1 commit into
Conversation
… rule replay_regression returned PASS whenever no guarded rule fired, including when the rule could not have fired: - the guarded rule id is no longer in the policy (renamed or removed), so renaming a rule turned every saved regression green with exit 0 - the artifact lists no rules or no conversation - the target errored or timed out before the conversation finished These now raise RegressionInconclusiveError, which the CLI and Hosted already report as SKIPPED (nonzero exit in `mutiny test`). A violation observed before a timeout is still FAIL. `mutiny test` also prints the reason for each skipped case, which was only in the JSON report before.
|
@RupeshMaster is attempting to deploy a commit to the priyanshu's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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
Fixes #159.
replay_regressionreturned PASS whenever no guarded rule fired, including when the rule could not have fired.RegressionInconclusiveErrorinstead of returning PASS when:trace.status == "error") and no guarded rule had fired. A violation observed before the timeout is still FAIL.mutiny testand Hosted_run_one_testalready turn replay exceptions into SKIPPED, andmutiny testalready exits nonzero on unexpected skips (fix(cli): exit non-zero when tests have skipped cases unless --allow-skip (#71) #88).mutiny testnow prints the reason under the summary for each SKIPPED case (it was only in the JSON report), so a stale regression is actionable:Behavior change to review
A regression whose rule was intentionally removed now shows as SKIPPED (exit 1 unless
--allow-skipand another case passed) until the regression file is updated or deleted. That is the point of the fix, but it will surface in CI for projects that already have stale regressions. If you would rather report these as FAIL, or add a dedicated status, I can change it.Files
mutiny_core/regress/__init__.py:RegressionInconclusiveError+ checks inreplay_regression(exported frommutiny_core).mutiny_cli/test_cmd.py: print skip reasons.docs/CLI.md,CHANGELOG.md.tests/unit/test_regression.py(missing rule on vulnerable and fixed agents, partial missing,policy_rule_idsfallback, empty artifact, timeout before and after a violation) and 3 intests/unit/test_mutiny_cli_test.py.Type of change
Checklist
Fixes #N) or Discussion when applicableuv run pytest tests/unit -q)Test plan
uv run --locked ruff check→ all checks passeduv run pytest tests/unit tests/integration tests/reliability -q→ 859 passed. Run locally on Python 3.12 only (macOS,OPENAI_API_KEYunset); 3.11 is left for CI.examples/openai_support_agent,mutiny --help,mutiny init,mutiny runwithMUTINY_SAMPLE_OFFLINE=1and emptyOPENAI_API_KEY/FEATHERLESS_API_KEY→ violation found, regression saved.apps/webis not touched.tests/unit/test_package_release.pypassed as part of the unit run;./scripts/verify_release_artifacts.shnot run.Extra: the reproduction from #159 (rename
refund_limitin the sample policy, thenmutiny test) now reports SKIPPED with exit 1 instead of PASS with exit 0. The existing suite needed no changes.Notes