(
self,
audit_id: str,
attempt: int,
validation: ValidationResult,
latency_ms: float,
token_count: int,
strategy: RetryStrategy,
)
| 1024 | # ── Helpers ───────────────────────────────────────────────────────────── |
| 1025 | |
| 1026 | def _log_record( |
| 1027 | self, |
| 1028 | audit_id: str, |
| 1029 | attempt: int, |
| 1030 | validation: ValidationResult, |
| 1031 | latency_ms: float, |
| 1032 | token_count: int, |
| 1033 | strategy: RetryStrategy, |
| 1034 | ) -> None: |
| 1035 | self.audit.log(AuditRecord( |
| 1036 | audit_id=audit_id, |
| 1037 | timestamp=datetime.now(timezone.utc).isoformat(), |
| 1038 | prompt_hash=self._hash(audit_id), |
| 1039 | attempt=attempt, |
| 1040 | failure_mode=validation.failure_mode, |
| 1041 | latency_ms=latency_ms, |
| 1042 | token_count=token_count, |
| 1043 | passed=validation.passed, |
| 1044 | strategy=strategy, |
| 1045 | )) |
| 1046 | |
| 1047 | def _packet( |
| 1048 | self, |
no test coverage detected