Skip to content

Add daily detection analysis report workflow#41802

Merged
pelikhan merged 3 commits into
mainfrom
copilot/analyze-detection-jobs
Jun 26, 2026
Merged

Add daily detection analysis report workflow#41802
pelikhan merged 3 commits into
mainfrom
copilot/analyze-detection-jobs

Conversation

Copilot AI commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Introduces a daily agentic workflow that audits gh-aw-detection feature usage across all workflow runs, surfaces misconfigured workflows, and publishes a comparison chart of regular vs. detection-enabled runs.

New workflow: detection-analysis-report

  • Trigger: schedule: daily + workflow_dispatch
  • Data source: agentic-workflows MCP logs tool — reads features.gh-aw-detection from each run's aw_info.json
  • Classification: splits runs into detection-enabled (features.gh-aw-detection: true) vs. regular (absent/false)

Misconfiguration detection

Flags four patterns:

  • Detection explicitly disabled on workflows with >3 total runs in the last 7 days
  • Detection absent on workflows whose name signals audit/report/monitor/detector/inspector intent
  • Detection job step failures on detection-enabled runs
  • Inconsistent detection state (mixed enabled/disabled) within the same 24h window

Charts

  • Comparison chart: grouped bar (run counts) + success-rate line overlay — Regular vs. Detection-enabled runs
  • Trend chart: 30-day detection adoption line chart, rendered once ≥7 days of history exist in cache-memory/trending/detection-metrics/history.jsonl

Output

Publishes a GitHub Discussion via shared/daily-audit-charts.md with 3-day expiry and automatic cleanup of older reports.

Copilot AI and others added 3 commits June 26, 2026 21:11
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…count definition, and mkdir for cache-memory dir

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan June 26, 2026 21:17
@pelikhan pelikhan marked this pull request as ready for review June 26, 2026 22:04
Copilot AI review requested due to automatic review settings June 26, 2026 22:04
@pelikhan pelikhan merged commit c0394d9 into main Jun 26, 2026
@pelikhan pelikhan deleted the copilot/analyze-detection-jobs branch June 26, 2026 22:04

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.

Pull request overview

Adds a new scheduled agentic workflow (detection-analysis-report) intended to analyze recent workflow runs, detect gh-aw-detection misconfigurations, and publish a daily Discussion with comparison/trend charts.

Changes:

  • Added the detection-analysis-report workflow source (.md) with a prompt describing run classification, misconfiguration rules, and chart/report outputs.
  • Added the compiled workflow lockfile (detection-analysis-report.lock.yml) to run the agent + safe-outputs publication path on a daily schedule.
  • Regenerated metadata for pr-triage-agent.lock.yml (hash update).
Show a summary per file
File Description
.github/workflows/pr-triage-agent.lock.yml Regenerated lock metadata (hash update).
.github/workflows/detection-analysis-report.md New workflow prompt/spec for detection adoption + misconfiguration analysis and charted reporting.
.github/workflows/detection-analysis-report.lock.yml Compiled GitHub Actions workflow implementing the new daily report.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/3 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment on lines +64 to +70
Use the `agentic-workflows` MCP `logs` tool to download workflow runs from the last 24 hours:

```
Use the agentic-workflows MCP tool `logs` with parameters:
- start_date: "-1d"
Output is saved to: /tmp/gh-aw/aw-mcp/logs
```
Comment on lines +72 to +73
Each run directory contains `aw_info.json` with fields including `engine_id`, `workflow`, `status`, `tokens`, and feature flags. The `gh-aw-detection` feature flag is stored under the `features` key in `aw_info.json` (e.g., `features.gh-aw-detection: true`). Use this field directly — do not infer detection status by scanning `.lock.yml` files.

Comment on lines +76 to +85
For each run, classify it as:
- **Detection-enabled**: `features.gh-aw-detection` is `true` in the run metadata
- **Regular**: `features.gh-aw-detection` is `false`, absent, or unset

Collect per-run:
- `workflow_name`
- `status` (success / failure / cancelled / timed_out)
- `total_tokens` (from `aw_info.json`)
- `engine_id`
- `detection_enabled` (boolean)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants