build(agent): jabba#56a767 iteration

This commit is contained in:
agent-56a7678c6cd71659 2026-04-29 17:26:12 +02:00
parent 9634a67dc0
commit 6734e8dcb5
2 changed files with 6 additions and 2 deletions

View File

@ -7,3 +7,4 @@
{"contract_id": "guard-001", "plan": {"action": "move", "costs": {"time": 2.0}, "speed": 0.8}, "state": {"speed": 0.8, "distance_to_obstacle": 5}, "decision": "allow"}
{"contract_id": "guard-001", "plan": {"action": "move", "costs": {"time": 2.0}, "speed": 0.8}, "state": {"speed": 0.8, "distance_to_obstacle": 5}, "decision": "allow"}
{"contract_id": "guard-001", "plan": {"action": "move", "costs": {"time": 2.0}, "speed": 0.8}, "state": {"speed": 0.8, "distance_to_obstacle": 5}, "decision": "allow"}
{"contract_id": "guard-001", "plan": {"action": "move", "costs": {"time": 2.0}, "speed": 0.8}, "state": {"speed": 0.8, "distance_to_obstacle": 5}, "decision": "allow"}

View File

@ -56,11 +56,14 @@ class SafetyContract:
def evaluate_pre(self, context: Dict[str, Any]) -> (bool, str):
engine = PolicyEngine(self)
# Pass a neutral action payload; tests use only context.
return engine.evaluate_pre({"action": None}, context)
ok, _reason = engine.evaluate_pre({"action": None}, context)
# Legacy API expected a boolean result.
return bool(ok)
def evaluate_post(self, action: Dict[str, Any], context: Dict[str, Any]) -> (bool, str):
engine = PolicyEngine(self)
return engine.evaluate_post(action, context)
ok, _reason = engine.evaluate_post(action, context)
return bool(ok)
def to_dict(self) -> Dict[str, Any]:
return {