Skip to content

Include reported friction in agentic control assessments - #78134

Merged
pelikhan merged 4 commits into
mainfrom
copilot/cli-tools-test-audit-assessment-labels
Nov 15, 2026
Merged

pelikhan merged 4 commits into
mainfrom
copilot/cli-tools-test-audit-assessment-labels

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

The poor_agentic_control assessment could report friction=0 while the audit’s Friction section showed session tool failures. Its evidence did not clarify that it counted only reported control signals.

  • Severity input: Use the larger of reported control signals and deduplicated friction occurrences, so session failures can affect severity without double-counting overlaps.
  • Evidence scope: Show both counts; mark friction as unavailable when no friction summary exists.
control_events=max(reported_control_signals=0, friction_counted_occurrences=1)=1

@pelikhan pelikhan changed the title [WIP] Fix audit assessment labels for friction count interpretation Include reported friction in agentic control assessments Nov 15, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 15, 2026 21:04
Copilot AI adaptive review requested due to automatic review settings November 15, 2026 21:04
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ 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: reported_no_action

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.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 8.6K · ◷

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

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.

Generated by Ponytail Reviewer for #78134 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

PR Specification Reviewer

Outcome: reported_action

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.

Generated by PR Specification Reviewer for #78134 · copilot · gpt56 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

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.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-15T21:08:13Z
review_event: COMMENT
top_themes: [friction aggregation undercounting independent signals]
files_reviewed: [pkg/cli/audit_agentic_analysis.go, pkg/cli/audit_agentic_analysis_test.go]
comment_count: 1
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.5K · ◷
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread pkg/cli/audit_agentic_analysis.go Outdated
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documented the conservative max approximation and added a distinct-signals regression case in 28c2f9b.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-e8183316-7f42-49d3-a3a0-b1b977d84206","parents":[],"payload":{"id":"ldg-e5383fd4-a5b8-43b3-8108-a5547791c7e8","operation":"append","value":{"finding_count":0,"head_sha":"091e22df53b1597b57d0d530a1703661b38eeca7","outcome":"aligned"}},"sha":"sha256:f032eaa58452720fe8eca5b542f162ab457a2e640c04c3336813f9ed42cb7a8f","timestamp":"2026-11-15T21:13:13.035Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-6848ccc3-06f5-4f9b-8f8a-103e9d147e8a","parents":[],"payload":{"id":"ldg-93474134-a200-4135-a602-968248713163","operation":"append","value":{"finding_count":1,"head_sha":"091e22df53b1597b57d0d530a1703661b38eeca7","outcome":"findings"}},"sha":"sha256:5941e376912b8d08e2e9426c9249b512779b2a408baad86353ab2f63d4367497","timestamp":"2026-11-15T21:13:58.765Z","type":"ledger_append","version":1}
History

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: unavailable is set when Friction is nil. deriveFrictionFromLogs also 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: CountedOccurrences includes integrity_filter events. 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 max rather than summed, matching the stated intent.
  • ✅ Evidence shows both counts, so the severity input is auditable.
  • ✅ The appendPoorControlAssessment signature change has a single caller, and the targeted tests pass (go test ./pkg/cli -run TestBuildAgenticAssessments). gofmt is 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added reported-greater, equal, suppressed-zero, clean-source, and unavailable-source cases in 28c2f9b.

Comment thread pkg/cli/audit_agentic_analysis.go Outdated
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the combined count and documented the approximation in code and the audit reference in 28c2f9b.

Comment thread pkg/cli/audit_agentic_analysis.go Outdated
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean observed session or gateway sources now produce a derived zero; absent observations remain unavailable. The evidence marks derived counts as partial in 28c2f9b.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/cli/audit_agentic_analysis.go:335): address unresolved feedback - Review comment
  3. Review (pkg/cli/audit_agentic_analysis.go:334): address unresolved feedback - Review comment
  4. Review (pkg/cli/audit_agentic_analysis_test.go:95): address unresolved feedback - Review comment
  5. Review (pkg/cli/audit_agentic_analysis.go:335): address unresolved feedback - Review comment
  6. Review (pkg/cli/audit_agentic_analysis.go:332): address unresolved feedback - Review comment
  7. Fix failing check impacted-go-tests (FAILURE): Check run.

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"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 15, 2026 21:44

Copilot AI commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged main in 9afa8c6 and addressed the review and failing attribution test in 28c2f9b. Focused tests pass; the final local lint gate is still running. Full workflow recompilation stalled, and CodeQL timed out. No workflow was dispatched.

Copilot AI requested a review from gh-aw-bot November 15, 2026 22:02
@pelikhan
pelikhan merged commit b984c52 into main Nov 15, 2026
95 of 96 checks passed
@pelikhan
pelikhan deleted the copilot/cli-tools-test-audit-assessment-labels branch November 15, 2026 22:18
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 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"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cli-tools-test] Audit assessment labels a narrower failure count as friction

4 participants