What
Add an example script (examples/hooks_demo.py) showing how to use RuntimeHooks for observability.
Why
RuntimeHooks (on_decision, on_approval, on_execute) were added in v0.1.3 but don't have a standalone example. This is one of Aegis's most useful features for production monitoring.
Expected example
from aegis import Action, Policy, Runtime
from aegis.runtime.engine import RuntimeHooks
async def on_decision(decision):
print(f"[DECISION] {decision.action.type} → {decision.approval.value}")
async def on_execute(result):
print(f"[EXECUTED] {result.action.type} → {result.status.value}")
hooks = RuntimeHooks(on_decision=on_decision, on_execute=on_execute)
runtime = Runtime(executor=..., policy=..., hooks=hooks)
Acceptance criteria
Difficulty
Beginner — copy patterns from existing examples.
What
Add an example script (
examples/hooks_demo.py) showing how to useRuntimeHooksfor observability.Why
RuntimeHooks (
on_decision,on_approval,on_execute) were added in v0.1.3 but don't have a standalone example. This is one of Aegis's most useful features for production monitoring.Expected example
Acceptance criteria
examples/hooks_demo.pyruns without errorson_decision,on_approval,on_execute)examples/README.mdAutoApprovalHandlerso it runs non-interactivelyDifficulty
Beginner — copy patterns from existing examples.