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

Method writeProtectionEvents

internal/agent/screening.go:261–267  ·  view source on GitHub ↗

writeProtectionEvents appends the audit rows best-effort (deterministic ids make it idempotent, so writing outside any message tx is safe).

(ctx context.Context, messageID string, events []identity.ProtectionEvent)

Source from the content-addressed store, hash-verified

259// writeProtectionEvents appends the audit rows best-effort (deterministic ids make
260// it idempotent, so writing outside any message tx is safe).
261func (a *API) writeProtectionEvents(ctx context.Context, messageID string, events []identity.ProtectionEvent) {
262 for _, ev := range events {
263 if err := a.store.CreateProtectionEvent(ctx, ev); err != nil {
264 log.Printf("[mail:%s] screening_event write failed (%s/%s): %v", messageID, ev.Source, ev.Reason, err)
265 }
266 }
267}
268
269// annotateAndAudit denormalizes the verdict onto the (already-created) message
270// row and writes the audit rows. Used on the flag (sent) and review (held) paths

Callers 2

annotateAndAuditMethod · 0.95
auditRowlessMethod · 0.95

Calls 1

CreateProtectionEventMethod · 0.80

Tested by

no test coverage detected