Fail closed on invalid Glas profiles
Assistant: codex Assistant-Model: gpt-5.6-sol Assistant-Session: 01a028de-e2c8-7732-8521-46a7fc5db82f
This commit is contained in:
parent
561538c95e
commit
b933cf52c8
12 changed files with 455 additions and 9 deletions
|
|
@ -80,10 +80,31 @@ def _task_spec_for_rule(rule: dict, event: Any, context: dict) -> dict:
|
|||
source_id=rule.get("id", ""),
|
||||
)
|
||||
result = asdict(spec)
|
||||
for key in ("approach_hint", "harness_profile_ref"):
|
||||
if key in action:
|
||||
result[key] = _string_or_none(
|
||||
_render_value(action.get(key), event, context)
|
||||
)
|
||||
if "execution_refs" in action:
|
||||
result["execution_refs"] = _render_execution_refs(
|
||||
action.get("execution_refs"), event, context
|
||||
)
|
||||
result["condition"] = rule.get("condition", "")
|
||||
return result
|
||||
|
||||
|
||||
def _render_execution_refs(value: Any, event: Any, context: dict) -> dict[str, Any]:
|
||||
if not isinstance(value, dict):
|
||||
return {}
|
||||
rendered: dict[str, Any] = {}
|
||||
for key, raw in value.items():
|
||||
if isinstance(raw, list):
|
||||
rendered[key] = [_render_value(item, event, context) for item in raw]
|
||||
else:
|
||||
rendered[key] = _render_value(raw, event, context)
|
||||
return rendered
|
||||
|
||||
|
||||
def _render_labels(value: Any, event: Any, context: dict) -> list[str]:
|
||||
if not isinstance(value, list):
|
||||
return []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue