Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
41ccd26
feat: add control template support
lan17 Apr 1, 2026
1dfb7f5
fix: wire runtime parsing and template round-tripping
lan17 Apr 1, 2026
19aa096
fix: tighten template control API contracts
lan17 Apr 1, 2026
3fcdd92
test: add behavioral coverage for control templates
lan17 Apr 1, 2026
0773358
test: add template control edge case coverage
lan17 Apr 1, 2026
8bc76a0
fix: tighten template control validation ergonomics
lan17 Apr 1, 2026
d1ee234
refactor: harden template control runtime helpers
lan17 Apr 1, 2026
9695c82
test: cover remaining template control api cases
lan17 Apr 1, 2026
0b4dc5d
refactor: derive raw control parser fields
lan17 Apr 1, 2026
d344f54
test: cover remaining template control server flows
lan17 Apr 1, 2026
1a94638
fix: cover remaining template control edge cases
lan17 Apr 1, 2026
90906d0
fix: satisfy lint in control input parser
lan17 Apr 1, 2026
97f20c9
test: add given-when-then comments to template coverage
lan17 Apr 1, 2026
a06c83f
test: add preview to persistence template flow coverage
lan17 Apr 1, 2026
ef13298
test: add negative template control failure coverage
lan17 Apr 1, 2026
b343fce
refactor: simplify template control server flow
lan17 Apr 1, 2026
058cb06
feat: support unrendered template controls
lan17 Apr 1, 2026
b2e940d
fix: harden unrendered template controls
lan17 Apr 1, 2026
817c3db
fix: close remaining unrendered template validation gaps
lan17 Apr 1, 2026
124aaac
chore: regenerate TypeScript SDK for unrendered template types
lan17 Apr 1, 2026
5b0a530
fix: validate partial template values and polish unrendered paths
lan17 Apr 1, 2026
045530a
fix: handle corrupted unrendered template data gracefully
lan17 Apr 1, 2026
52604c8
fix(sdk): skip unrendered templates in local evaluation and reshape h…
lan17 Apr 1, 2026
33069ac
fix: align validate endpoint and list filters with unrendered templates
lan17 Apr 1, 2026
1c8628f
fix: don't count list elements as nesting depth in template validation
lan17 Apr 2, 2026
18d7e1f
Merge remote-tracking branch 'origin/main' into lev/controltemplates
lan17 Apr 2, 2026
f7fa1ba
test: align template action assertions with observe
lan17 Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions engine/src/agent_control_engine/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
from agent_control_evaluators import get_evaluator_instance
from agent_control_models import (
ConditionNode,
ControlDefinition,
ControlAction,
ControlMatch,
ControlScope,
EvaluationRequest,
EvaluationResponse,
EvaluatorResult,
Expand All @@ -42,12 +43,30 @@ def _compile_regex(pattern: str) -> Any:
return re2.compile(pattern)


class ControlDefinitionLike(Protocol):
"""Runtime control shape required by the engine."""

enabled: bool
execution: Literal["server", "sdk"]
scope: ControlScope
condition: ConditionNode
action: ControlAction


class ControlWithIdentity(Protocol):
"""Protocol for a control with identity information."""

id: int
name: str
control: ControlDefinition
@property
def id(self) -> int:
"""Database identity for the control."""

@property
def name(self) -> str:
"""Human-readable name for the control."""

@property
def control(self) -> ControlDefinitionLike:
"""Runtime control payload used during evaluation."""


@dataclass
Expand Down
30 changes: 30 additions & 0 deletions models/src/agent_control_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,28 @@
StepSchema,
)
from .controls import (
BooleanTemplateParameter,
ConditionNode,
ControlAction,
ControlDefinition,
ControlDefinitionRuntime,
ControlMatch,
ControlScope,
ControlSelector,
EnumTemplateParameter,
EvaluatorResult,
EvaluatorSpec,
JsonValue,
RegexTemplateParameter,
SteeringContext,
StringListTemplateParameter,
StringTemplateParameter,
TemplateControlInput,
TemplateDefinition,
TemplateParameterBase,
TemplateParameterDefinition,
TemplateValue,
UnrenderedTemplateControl,
)
from .errors import (
ERROR_TITLES,
Expand Down Expand Up @@ -80,6 +93,8 @@
PaginationInfo,
PatchControlRequest,
PatchControlResponse,
RenderControlTemplateRequest,
RenderControlTemplateResponse,
StepKey,
ValidateControlDataRequest,
ValidateControlDataResponse,
Expand Down Expand Up @@ -111,9 +126,22 @@
"ControlMatch",
"ControlScope",
"ControlSelector",
"ControlDefinitionRuntime",
"EvaluatorSpec",
"EvaluatorResult",
"SteeringContext",
"JsonValue",
"TemplateValue",
"TemplateParameterBase",
"StringTemplateParameter",
"StringListTemplateParameter",
"EnumTemplateParameter",
"BooleanTemplateParameter",
"RegexTemplateParameter",
"TemplateParameterDefinition",
"TemplateDefinition",
"TemplateControlInput",
"UnrenderedTemplateControl",
"normalize_action",
"normalize_action_list",
"expand_action_filter",
Expand Down Expand Up @@ -142,6 +170,8 @@
"PaginationInfo",
"PatchControlRequest",
"PatchControlResponse",
"RenderControlTemplateRequest",
"RenderControlTemplateResponse",
"StepKey",
"ValidateControlDataRequest",
"ValidateControlDataResponse",
Expand Down
Loading
Loading