MCPcopy Create free account
hub / github.com/ByteYellow/AgentProvenance / recordEvent

Method recordEvent

internal/computerapi/service.go:233–249  ·  view source on GitHub ↗
(event security.Event, payload map[string]any)

Source from the content-addressed store, hash-verified

231}
232
233func (s Service) recordEvent(event security.Event, payload map[string]any) (security.DecisionRecord, error) {
234 payload["recorded_at"] = time.Now().UTC().Format(time.RFC3339Nano)
235 keys := make([]string, 0, len(payload))
236 for key := range payload {
237 keys = append(keys, key)
238 }
239 sort.Strings(keys)
240 ordered := make(map[string]any, len(payload))
241 for _, key := range keys {
242 ordered[key] = payload[key]
243 }
244 raw, err := json.Marshal(ordered)
245 if err != nil {
246 return security.DecisionRecord{}, err
247 }
248 return security.EvaluateAndPersist(s.DB, event, string(raw))
249}
250
251func ensureToolCallID(toolCallID string) string {
252 if strings.TrimSpace(toolCallID) != "" {

Callers 5

ReadFileMethod · 0.95
WriteFileMethod · 0.95
SearchMethod · 0.95
ExportArtifactMethod · 0.95
CallMethod · 0.95

Calls 1

EvaluateAndPersistFunction · 0.92

Tested by

no test coverage detected