Skip to content

Rules: accept the unsupported rules migration 0004 stores - #67

Open
avalyset wants to merge 1 commit into
SimulaMet:mainfrom
avalyset:fix/accept-unsupported-rules
Open

avalyset wants to merge 1 commit into
SimulaMet:mainfrom
avalyset:fix/accept-unsupported-rules

Conversation

@avalyset

Copy link
Copy Markdown
Contributor

Migration 0004_convert_rules_to_primitives keeps rules that need order or grouping as {"type": "check", "check": "unsupported", "legacy": {...}}, and its docstring says the engine reports them as INCONCLUSIVE. validate_rules in audits/agentic/rules.py ran validate_check on that shape, which rejects the legacy key and the check value, so validate_agentic_metadata raised for every revision that holds such a rule. That function runs before the engine in infra/engine.py, in the post-hoc evaluation in infra/worker.py (which turns the exception into an ERROR evaluation) and in scenarios/services.py when a scenario is saved.
This skips validation for exactly the shape the migration writes: the keys type, check and legacy, with check set to unsupported and legacy an object. Any other rule is validated as before.
The new test in audits/agentic/tests/test_rule_migration.py converts a precedes rule with the migration, validates the metadata and evaluates the rule: it fails on main with Invalid metadata.agentic.rules and passes with the change, where the rule comes out INCONCLUSIVE. A second test checks that an unsupported rule with other keys is still rejected.
pytest -n 4 -m "not embedded_hatchet" (no API keys in the environment, the local-Ollama live test deselected) gave 1378 passed, 2 skipped on main and 1380 passed, 2 skipped with the change; ruff check . is clean.

AI disclosure: implemented with Claude Code.

Migration 0004 keeps rules that need order or grouping as
{"type": "check", "check": "unsupported", "legacy": {...}} and says
the engine reports them as INCONCLUSIVE. validate_rules rejected that
shape, so validate_agentic_metadata raised for every such revision: the
agentic evaluation ended in ERROR and the scenario could not be saved.
Skip validation for exactly that shape.

This branch has not been deployed

No deployments
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.

1 participant