Correct audit engagement and idempotent fixture setup

Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a0260c-4067-7052-9647-ad000d576e38
This commit is contained in:
tegwick 2026-08-22 00:05:15 +02:00
parent edc9df0491
commit 8a97fac17f
5 changed files with 34 additions and 10 deletions

View file

@ -42,6 +42,8 @@ class Engagement:
end = _timestamp(self.raw["window_end"])
expiry = _timestamp(self.raw["expires_at"])
approved = _timestamp(self.raw["approved_at"])
if not self.raw["target_owner_acknowledged_at"]:
raise AuthorizationError("target-owner acknowledgement is pending")
acknowledged = _timestamp(self.raw["target_owner_acknowledged_at"])
if not approved <= current <= min(end, expiry):
raise AuthorizationError("engagement is outside its approved time/expiry window")