MCPcopy Create free account
hub / github.com/github/gh-aw / deriveRunAgenticAnalysis

Function deriveRunAgenticAnalysis

pkg/cli/audit_agentic_analysis.go:180–208  ·  view source on GitHub ↗
(processedRun ProcessedRun, metrics LogMetrics)

Source from the content-addressed store, hash-verified

178}
179
180func deriveRunAgenticAnalysis(processedRun ProcessedRun, metrics LogMetrics) (*AwContext, []ToolUsageInfo, []CreatedItemReport, *TaskDomainInfo, *BehaviorFingerprint, []AgenticAssessment) {
181 auditAgenticLog.Printf("Deriving agentic analysis for run: id=%d workflow=%s", processedRun.Run.DatabaseID, processedRun.Run.WorkflowName)
182 var awContext *AwContext
183 if processedRun.AwContext != nil {
184 awContext = processedRun.AwContext
185 } else if processedRun.Run.LogsPath != "" {
186 awInfoPath := filepath.Join(processedRun.Run.LogsPath, "aw_info.json")
187 if info, err := parseAwInfo(awInfoPath, false); err == nil && info != nil {
188 awContext = info.Context
189 }
190 }
191
192 toolUsage := buildToolUsageInfo(metrics)
193 createdItems := extractCreatedItemsFromManifest(processedRun.Run.LogsPath)
194 metricsData := MetricsData{
195 TokenUsage: processedRun.Run.TokenUsage,
196 ActionMinutes: processedRun.Run.ActionMinutes,
197 Turns: processedRun.Run.Turns,
198 ErrorCount: processedRun.Run.ErrorCount,
199 WarningCount: processedRun.Run.WarningCount,
200 }
201
202 taskDomain := detectTaskDomain(processedRun, createdItems, toolUsage, awContext)
203 behaviorFingerprint := buildBehaviorFingerprint(processedRun, metricsData, toolUsage, createdItems, awContext)
204 agenticAssessments := buildAgenticAssessments(processedRun, metricsData, toolUsage, createdItems, taskDomain, behaviorFingerprint, awContext)
205
206 auditAgenticLog.Printf("Agentic analysis complete: tool_types=%d created_items=%d assessments=%d", len(toolUsage), len(createdItems), len(agenticAssessments))
207 return awContext, toolUsage, createdItems, taskDomain, behaviorFingerprint, agenticAssessments
208}
209
210func detectTaskDomain(processedRun ProcessedRun, createdItems []CreatedItemReport, toolUsage []ToolUsageInfo, awContext *AwContext) *TaskDomainInfo {
211 auditAgenticLog.Printf("Detecting task domain for run: workflow=%s event=%s", processedRun.Run.WorkflowName, processedRun.Run.Event)

Calls 7

parseAwInfoFunction · 0.85
buildToolUsageInfoFunction · 0.85
detectTaskDomainFunction · 0.85
buildBehaviorFingerprintFunction · 0.85
buildAgenticAssessmentsFunction · 0.85
PrintfMethod · 0.45