Repository navigation
Commit 2ff4c12
authored
feat(server)!: implement recursive control condition trees (#115)
corresponding docs update:
agentcontrol/docs-agent-control#28
## Summary
- replace flat control predicates with recursive `condition` trees
across the shared models, engine, server, SDKs, and UI contracts
- add pre-upgrade control migration tooling plus safe `condition_trace`
metadata for composite evaluation
- bump package majors and regenerate the TypeScript SDK/API types for
the new contract
## Scope
- User-facing/API changes:
- `ControlDefinition` now uses a top-level `condition` tree instead of
top-level `selector` / `evaluator`
- controls now support nested `and` / `or` / `not` composition with a
hard API depth limit of `6`
- `/api/v1` stays the same, but this is a major-version wire break for
the canonical contract and old SDK majors are unsupported against the
new server
- added `make server-migrate-control-conditions MIGRATE_ARGS=--dry-run`
and `make server-migrate-control-conditions MIGRATE_ARGS=--apply`
- Internal changes:
- recursive engine evaluation with short-circuiting and
`metadata.condition_trace`
- recursive server-side validation with nested field paths
- Python SDK recursive leaf checks plus non-blocking server-version
mismatch warnings
- UI keeps the existing single-condition editor behavior for leaf
conditions; composite trees are shown but preserved on save rather than
fully edited in this PR
- Rollout compatibility notes:
- server/models still canonicalize legacy flat control payloads
(`selector` + `evaluator`) into `condition` during rollout
- strict runtime rejection of legacy flat payloads is deferred until
after the migration window closes
- Out of scope:
- full condition-tree editing in the current UI modal
- runtime strict rejection of legacy flat control payloads
- drag-and-drop tree editing
## Risk and Rollout
- Risk level: high
- Rollback plan:
- take a database backup before running the migration apply step
- if rollout fails before migration, revert to the previous server/SDK
major
- if rollout fails after migration, restore the pre-migration database
snapshot before rolling back the server major
## Testing
- [x] Added or updated automated tests
- [x] Ran `make check`
- [ ] Manually verified behavior
`make check` passed, which covered:
- `make server-test`
- `make engine-test`
- `make sdk-test`
- `make evaluators-test`
- repo linting
- repo typechecking
Notes:
- the run emitted a few existing third-party warnings (`sqlglot[rs]`
deprecation, Strands resource/deprecation warnings), but the full target
passed cleanly
## Checklist
- [x] Linked issue/spec: sc-57582, sc-58429
- [x] Updated docs/examples for user-facing changes
- [x] Included any required follow-up tasks1 parent 2c55d27 commit 2ff4c12
82 files changed
Lines changed: 5009 additions & 1296 deletions
File tree
- .github/workflows
- engine
- src/agent_control_engine
- tests
- evaluators/contrib/cisco
- examples
- agent_control_demo
- cisco_ai_defense
- crewai
- customer_support_agent
- deepeval
- google_adk_callbacks
- google_adk_decorator
- google_adk_plugin
- langchain
- steer_action_demo
- strands_agents
- interactive_demo
- steering_demo
- models
- src/agent_control_models
- tests
- sdks
- python
- src/agent_control
- tests
- typescript/src/generated
- lib
- models
- server
- alembic
- versions
- src/agent_control_server
- endpoints
- scripts
- services
- tests
- unit_tests
- ui
- src/core
- api
- generated
- evaluators/list
- page-components/agent-detail/modals
- add-new-control
- edit-control
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
| 187 | + | |
| 188 | + | |
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| |||
0 commit comments