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

Method _log_record

control_layer.py:1026–1045  ·  view source on GitHub ↗
(
        self,
        audit_id: str,
        attempt: int,
        validation: ValidationResult,
        latency_ms: float,
        token_count: int,
        strategy: RetryStrategy,
    )

Source from the content-addressed store, hash-verified

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,

Callers 1

runMethod · 0.95

Calls 3

_hashMethod · 0.95
AuditRecordClass · 0.85
logMethod · 0.80

Tested by

no test coverage detected