-
Notifications
You must be signed in to change notification settings - Fork 350
fix: eliminate writeCount double-counting #23078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,7 +164,10 @@ func detectTaskDomain(processedRun ProcessedRun, createdItems []CreatedItemRepor | |
|
|
||
| func buildBehaviorFingerprint(processedRun ProcessedRun, metrics MetricsData, toolUsage []ToolUsageInfo, createdItems []CreatedItemReport, awContext *AwContext) *BehaviorFingerprint { | ||
| toolTypes := len(toolUsage) | ||
| writeCount := len(createdItems) + processedRun.Run.SafeItemsCount | ||
| writeCount := processedRun.Run.SafeItemsCount | ||
| if writeCount == 0 { | ||
| writeCount = len(createdItems) | ||
| } | ||
|
Comment on lines
+167
to
+170
|
||
|
|
||
| executionStyle := "directed" | ||
| switch { | ||
|
|
@@ -223,7 +226,10 @@ func buildAgenticAssessments(processedRun ProcessedRun, metrics MetricsData, too | |
| assessments := make([]AgenticAssessment, 0, 4) | ||
| toolTypes := len(toolUsage) | ||
| frictionEvents := len(processedRun.MissingTools) + len(processedRun.MCPFailures) + len(processedRun.MissingData) | ||
| writeCount := len(createdItems) + processedRun.Run.SafeItemsCount | ||
| writeCount := processedRun.Run.SafeItemsCount | ||
| if writeCount == 0 { | ||
| writeCount = len(createdItems) | ||
| } | ||
|
|
||
| if fingerprint.ResourceProfile == "heavy" { | ||
| severity := "medium" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The writeCount “SafeItemsCount with fallback to len(createdItems)” logic is now duplicated here and again in buildAgenticAssessments. Consider extracting a small helper (e.g., deriveWriteCount(processedRun.Run.SafeItemsCount, createdItems)) so the classification logic stays consistent if this heuristic changes (and so other call sites like computeAgenticFraction can reuse the same definition of write actions).
This issue also appears on line 229 of the same file.
See below for a potential fix: