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

Function programName

internal/intent/materialize.go:355–365  ·  view source on GitHub ↗

programName returns the lowercased basename of a command's leading token ("cat /a/b" -> "cat", "/usr/bin/python3 x" -> "python3"), for matching against a runtime event's process comm.

(command string)

Source from the content-addressed store, hash-verified

353// ("cat /a/b" -> "cat", "/usr/bin/python3 x" -> "python3"), for matching against
354// a runtime event's process comm.
355func programName(command string) string {
356 fields := strings.Fields(command)
357 if len(fields) == 0 {
358 return ""
359 }
360 prog := fields[0]
361 if i := strings.LastIndex(prog, "/"); i >= 0 {
362 prog = prog[i+1:]
363 }
364 return strings.ToLower(prog)
365}
366
367func persistDiffs(db *sql.DB, runID string, diffs []IntentRuntimeDiff) error {
368 tx, err := db.Begin()

Callers 2

loadToolCallWindowsFunction · 0.85
TestProgramNameFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestProgramNameFunction · 0.68