| 162 | |
| 163 | @dataclass |
| 164 | class AuditRecord: |
| 165 | audit_id: str |
| 166 | timestamp: str # ISO-8601 |
| 167 | prompt_hash: str |
| 168 | attempt: int |
| 169 | failure_mode: FailureMode |
| 170 | latency_ms: float |
| 171 | token_count: int |
| 172 | passed: bool |
| 173 | strategy: RetryStrategy = RetryStrategy.NONE |
| 174 | |
| 175 | def to_dict(self) -> dict: |
| 176 | return { |
| 177 | "audit_id": self.audit_id, |
| 178 | "timestamp": self.timestamp, |
| 179 | "prompt_hash": self.prompt_hash, |
| 180 | "attempt": self.attempt, |
| 181 | "failure_mode": self.failure_mode.value, |
| 182 | "latency_ms": round(self.latency_ms, 3), |
| 183 | "token_count": self.token_count, |
| 184 | "passed": self.passed, |
| 185 | "strategy": self.strategy.value, |
| 186 | } |
| 187 | |
| 188 | |
| 189 | @dataclass |
no outgoing calls