Skip to content

Migration 0005: keep pre-rule-engine agentic controls as unsupported rules - #68

Open
avalyset wants to merge 2 commits into
SimulaMet:mainfrom
avalyset:fix/migrate-legacy-agentic-controls
Open

avalyset wants to merge 2 commits into
SimulaMet:mainfrom
avalyset:fix/migrate-legacy-agentic-controls

Conversation

@avalyset

@avalyset avalyset commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #67; merging #67 first keeps this diff to the migration and its test.

Builds on #67, whose commit is the first one here.

Before #65, scenario revisions stored agentic controls in the sections tools, retrieval, budgets, trajectory, policy, rerank, handoffs, approvals, guardrails and state. validate_agentic_metadata now rejects those keys ("Unknown metadata.agentic keys"), and migration 0004 converts only rules, so a revision saved before #65 keeps them. Its agentic evaluation ends in ERROR, and saving the scenario raises in _create_revision. All 12 agentic scenarios in infra/fixtures/agentic_demo_catalog_v3.json as it was before #65 are rejected after migration 0004 on main.
Migration 0005_convert_legacy_agentic_controls moves each such section, unchanged, into an unsupported rule of the shape 0004 writes ({"type": "check", "check": "unsupported", "legacy": {"type": <section>, <section>: <value>}}), after any rules already stored. The engine reports it as INCONCLUSIVE. Run through 0004 and 0005, all 12 of those scenarios validate, with every setting kept.
The tests in audits/agentic/tests/test_legacy_control_migration.py use scenario D04 from that catalog: it validates after the migration, each section is kept unchanged and evaluates INCONCLUSIVE, stored rules come first, and metadata in the current shape is unchanged.
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 1384 passed, 2 skipped with both commits; ruff check . is clean.

Design question: nothing is converted to a custom check, so these controls report INCONCLUSIVE until someone rewrites them as rules. If you would rather convert the sections whose meaning is exactly the same as a custom check (for example tools.forbidden by name), I can add that, section by section, with a test against the old check for each.

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.
…rules

Revisions saved before SimulaMet#65 hold their controls in the sections tools,
retrieval, budgets, trajectory, policy, rerank, handoffs, approvals,
guardrails and state. validate_agentic_metadata now rejects those
sections and migration 0004 converts only rules, so such a revision could
neither be evaluated (the agentic evaluation ended in ERROR) nor saved.
Move each section, unchanged, into an unsupported rule of the shape 0004
writes; the engine reports it as INCONCLUSIVE.

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