Repository navigation
Include reported friction in agentic control assessments - #78134
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Specification Reviewer completed successfully! Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Detected threat types: prompt injection. Review the workflow run logs for details. PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the changes to session-friction handling and assessment evidence.
No open issues 🎉
What changed in this PR
Updates audit agentic-control assessments to consider session friction and clarify the counts used, addressing #77998.
Changes:
- Uses the larger of reported control signals and deduplicated friction occurrences when assessing poor agentic control.
- Shows both counts in assessment evidence, explicitly marking unavailable friction data.
- Adds regression tests for session tool failures and missing friction summaries.
| File | Description |
|---|---|
pkg/cli/audit_agentic_analysis.go |
Incorporates friction occurrences into control assessments and clarifies evidence labels. |
pkg/cli/audit_agentic_analysis_test.go |
Tests session-failure severity and evidence when friction data is unavailable. |
Review effort: Balanced (dynamic)
There was a problem hiding this comment.
The change improves friction visibility, but the new max-based aggregation can undercount when reported control signals and friction occurrences are independent. See the inline comment for the concrete severity impact and remediation options.
Review details
- One medium-severity correctness concern
- No test or build execution performed per static-review constraints
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K
Comment /review to run again
| frictionEvidence := fmt.Sprintf("control_events=%d reported_control_signals=%d friction_counted_occurrences=unavailable", frictionEvents, reportedControlSignals) | ||
| if processedRun.Friction != nil { | ||
| frictionOccurrences := processedRun.Friction.CountedOccurrences | ||
| frictionEvents = max(frictionEvents, frictionOccurrences) |
There was a problem hiding this comment.
Using max() here undercounts independent friction signals, so a run with two reported control signals and two counted friction occurrences is scored as two instead of four and may avoid the high-severity threshold.
💡 Why this matters
The two inputs are not guaranteed to describe the same events: reported missing tools/data and session friction can be distinct. max prevents double-counting only when they overlap, but drops non-overlapping occurrences. Either compute a true deduplicated union using available identifiers, or document this as a lower-bound metric and add coverage for disjoint signals.
There was a problem hiding this comment.
Documented the conservative max approximation and added a distinct-signals regression case in 28c2f9b.
Comment MemoryPeek at saved memory (spec-review-history)History |
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs, /tdd, /codebase-design and /grill-with-docs. No blocking issues. Four inline notes on the max() severity input and the evidence labels.
📋 Key Themes & Highlights
Key Themes
- Labelling:
unavailableis set whenFrictionis nil.deriveFrictionFromLogsalso returns nil for a run with no events, so a clean run can read as unavailable. This follows the PR rule ("unavailable when no friction summary exists"), but the author should confirm that is the intended meaning. - Severity scope:
CountedOccurrencesincludesintegrity_filterevents. Confirm that gateway filtering should raise severity. - Dedup trade-off:
max(reported, friction)avoids double-counting but does not add distinct signals. Document this next to the audit reference table. - Test gaps: the new tests cover friction above reported signals and the unavailable label. Missing: reported above friction, equal values, and a non-nil summary with
CountedOccurrences=0.
Positive Highlights
- ✅ Overlaps are deduplicated with
maxrather than summed, matching the stated intent. - ✅ Evidence shows both counts, so the severity input is auditable.
- ✅ The
appendPoorControlAssessmentsignature change has a single caller, and the targeted tests pass (go test ./pkg/cli -run TestBuildAgenticAssessments).gofmtis clean.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| frictionEvents := reportedControlSignals | ||
| frictionEvidence := fmt.Sprintf("control_events=%d reported_control_signals=%d friction_counted_occurrences=unavailable", frictionEvents, reportedControlSignals) | ||
| if processedRun.Friction != nil { | ||
| frictionOccurrences := processedRun.Friction.CountedOccurrences |
There was a problem hiding this comment.
[/grill-with-docs] CountedOccurrences includes integrity_filter events, which record responses the gateway blocked (TotalFiltered). That is a control working, yet it now feeds severity: one filtered response is enough to raise a write-heavy run with 3 or more writes to high. Confirm this is intended. If not, exclude the integrity_filter driver before taking the max.
@copilot please address this.
There was a problem hiding this comment.
Kept integrity filtering in the requested counted-friction total: it indicates execution friction, not a failed gateway control. Documented and tested its write-heavy severity in 28c2f9b.
| assert.True(t, found, "resource heavy assessment should be present") | ||
| } | ||
|
|
||
| func TestBuildAgenticAssessmentsIncludesSessionToolFailuresInControlAssessment(t *testing.T) { |
There was a problem hiding this comment.
[/tdd] The new tests cover friction above reported signals and the unavailable-friction label. Missing cases: reported signals above friction (max should pick reported), equal values, a clean run with no friction events, and a non-nil friction summary with CountedOccurrences=0 (all session failures suppressed), which should emit friction_counted_occurrences=0.
💡 Suggested test structure
Use one table-driven test with name, processedRun, and wantEvidence per row. Assert the exact control_events= string in each row, so a regression in the max logic fails visibly.
@copilot please address this.
There was a problem hiding this comment.
Added reported-greater, equal, suppressed-zero, clean-source, and unavailable-source cases in 28c2f9b.
| frictionEvidence := fmt.Sprintf("control_events=%d reported_control_signals=%d friction_counted_occurrences=unavailable", frictionEvents, reportedControlSignals) | ||
| if processedRun.Friction != nil { | ||
| frictionOccurrences := processedRun.Friction.CountedOccurrences | ||
| frictionEvents = max(frictionEvents, frictionOccurrences) |
There was a problem hiding this comment.
[/codebase-design] max(reported, friction) avoids double-counting overlaps, but it also stops distinct signals from adding up. A missing tool plus two session failures yields control_events=2, not 3. That matches the PR intent, but the trade-off should be explicit.
💡 Suggested change
Add a comment on this line stating that max is a deliberate dedup approximation. Rename frictionEvents to controlEvents, since it now holds the combined value and the evidence already calls it control_events. Note the max rule next to the agentic_poor_agentic_control row in docs/src/content/docs/reference/audit.md.
@copilot please address this.
There was a problem hiding this comment.
Renamed the combined count and documented the approximation in code and the audit reference in 28c2f9b.
| frictionEvents := len(processedRun.MissingTools) + len(processedRun.MCPFailures) + len(processedRun.MissingData) | ||
| reportedControlSignals := len(processedRun.MissingTools) + len(processedRun.MCPFailures) + len(processedRun.MissingData) | ||
| frictionEvents := reportedControlSignals | ||
| frictionEvidence := fmt.Sprintf("control_events=%d reported_control_signals=%d friction_counted_occurrences=unavailable", frictionEvents, reportedControlSignals) |
There was a problem hiding this comment.
[/diagnosing-bugs] The unavailable label is also emitted when friction was measured but found nothing. deriveFrictionFromLogs returns nil when there are no events, so a clean run in a triage or exploratory domain reports friction_counted_occurrences=unavailable instead of 0. That presents a measured zero as missing data.
💡 Suggested fix
Keep unavailable only for the case where no friction source was collected. When the source was collected and has no events, emit friction_counted_occurrences=0. A nil Friction alone cannot distinguish the two, so the caller needs to pass an availability signal. Add a test for each case.
@copilot please address this.
There was a problem hiding this comment.
Clean observed session or gateway sources now produce a derived zero; absent observations remain unavailable. The evidence marks derived counts as partial in 28c2f9b.
|
🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:
Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering. Structured data{
"completed_task": 0,
"head": "091e22df53b1597b57d0d530a1703661b38eeca7",
"kind": "requested",
"schema_version": "1",
"state": "40d2b0a3692ef872cce2328d1e3d84f7b659364701e51645d61d469e42cf38e2",
"work": [
"05f9cd94ad8de71caed1a7b99d9f7e4459d84c827088944ea43af88726427323",
"2aaed595f8e914127f6ff2a689d369fecf78a3d88ed77366c0aaaf1231f4564b",
"3d4fd62602fb4818a618aecac0cc6e81be96f0c07c095569d1222244e0494251",
"42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac",
"be745d09688f5e364f8bfae1f4ff65b6efc2c6e01e57e5679a0b9ef9971a6d34",
"c47aab8d6c850597886969ae71726c396e726af10867b4b5421708c39a35c6a6"
],
"workflow": "pr-sous-chef"
}
|
…t-audit-assessment-labels Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |
|
🍳 The prep is done, but CI needs another taste test. Copilot's assigned task has finished; these checks are still failing: Completed task
Please address the remaining CI failures on this PR's existing branch. No merging or CI triggering. Structured data{
"completed_task": 43764842471,
"head": "28c2f9b124fa04fc17e00cc6c16ee3def40c8fc4",
"kind": "ci-follow-up",
"schema_version": "1",
"state": "a52227b545e95b6f3a6f53fbe9f9065259718082ad179e933a78683db755086e",
"work": [
"42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac"
],
"workflow": "pr-sous-chef"
}
|
|
🎉 This pull request is included in a new release. Release: |
The
poor_agentic_controlassessment could reportfriction=0while the audit’s Friction section showed session tool failures. Its evidence did not clarify that it counted only reported control signals.