MCPcopy Create free account
hub / github.com/Emmimal/control-layer / AuditRecord

Class AuditRecord

control_layer.py:164–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163@dataclass
164class 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

Callers 6

test_log_and_retrieveMethod · 0.90
test_persists_to_fileMethod · 0.90
test_pass_rateMethod · 0.90
writeMethod · 0.90
_log_recordMethod · 0.85

Calls

no outgoing calls

Tested by 5

test_log_and_retrieveMethod · 0.72
test_persists_to_fileMethod · 0.72
test_pass_rateMethod · 0.72
writeMethod · 0.72