MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / annotateAndAudit

Method annotateAndAudit

internal/agent/screening.go:272–277  ·  view source on GitHub ↗

annotateAndAudit denormalizes the verdict onto the (already-created) message row and writes the audit rows. Used on the flag (sent) and review (held) paths once the row id is known.

(ctx context.Context, agent *identity.AgentIdentity, messageID string, req outbound.SendRequest, v outboundVerdict)

Source from the content-addressed store, hash-verified

270// row and writes the audit rows. Used on the flag (sent) and review (held) paths
271// once the row id is known.
272func (a *API) annotateAndAudit(ctx context.Context, agent *identity.AgentIdentity, messageID string, req outbound.SendRequest, v outboundVerdict) {
273 if err := a.store.SetMessageScreening(ctx, messageID, agent.ID, v.ReviewReason, v.ScanScore, string(v.Applied)); err != nil {
274 log.Printf("[mail:%s] set screening denorm failed: %v", messageID, err)
275 }
276 a.writeProtectionEvents(ctx, messageID, v.screeningEvents(messageID, agent))
277}
278
279// auditRowless writes the audit rows WITHOUT denormalizing a message row — for
280// outbound paths that persist no message row: a blocked (refused) send, and a

Callers 2

DeliverOutboundMethod · 0.95
SendTestCoreMethod · 0.95

Calls 3

writeProtectionEventsMethod · 0.95
SetMessageScreeningMethod · 0.80
screeningEventsMethod · 0.80

Tested by

no test coverage detected