Skip to content

feat(agentics): add daily performance-scan agentic workflow#2125

Open
sergio-sisternes-epam wants to merge 1 commit into
mainfrom
sergio-sisternes-epam-daily-perf-scan-workflow
Open

feat(agentics): add daily performance-scan agentic workflow#2125
sergio-sisternes-epam wants to merge 1 commit into
mainfrom
sergio-sisternes-epam-daily-perf-scan-workflow

Conversation

@sergio-sisternes-epam

@sergio-sisternes-epam sergio-sisternes-epam commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

TL;DR

Adds a daily agentic workflow (perf-scan) that scans src/apm_cli/ for
algorithmic performance anti-patterns and opens a GitHub Issue with findings
every morning at 01:00 UTC.

Problem (WHY)

PR #2124 landed four algorithmic perf fixes and a performance-expert agent
with a full algorithmic lens. Without a recurring automated scan, new regressions
will silently accumulate between manual audits.

Approach (WHAT)

A GitHub Agentic Workflow that:

  • Runs daily at 01:00 UTC (results ready before 6-7am UK/CET) and on workflow_dispatch.
  • Scans six anti-pattern categories in src/apm_cli/.
  • Always creates a GitHub Issue (findings or clean) so the run is always visible.

Implementation (HOW)

Files added

File Purpose
.github/workflows/perf-scan.md Agentic workflow: frontmatter + agent instructions
.github/workflows/perf-scan.lock.yml Compiled YAML (generated by gh aw compile v0.81.6)
.github/agents/workflows/perf-scan.md Companion reference: scope, output contract, finding format

Anti-patterns scanned

ID Pattern Typical impact
A Quadratic loop nesting O(n) -> O(n^2) as package count grows
B Linear scan in loop (x in list or x in var) O(n) per iteration vs. O(1) with set/dict
C Unconditional expensive ops on hot paths Avoidable I/O / serialisation per call
D Redundant env-var / config parsing Repeated syscalls per invocation
E Heavy top-level imports in command modules Startup latency regardless of sub-command
F Sequential independent I/O Wall-time parallelism opportunity

Schedule and output

  • Schedule: 0 1 * * * (01:00 UTC daily) + workflow_dispatch.
  • Issue titles:
    • [perf-scan] YYYY-MM-DD -- performance opportunities found
    • [perf-scan] YYYY-MM-DD -- no issues found
  • Labels: type/performance, type/automation (existing repo labels).
  • ASCII-only output (repository encoding rule: no emojis, no Unicode box-drawing).

Security

Issue creation is routed through safe-outputs: create-issue (no direct issues: write
on the main job). The compiled lock file's safe_outputs job does hold issues: write
internally -- that is normal and expected for all agentic workflows that create issues;
it is scoped only to that job and is not granted to the agent itself.

Validation evidence

gh aw compile perf-scan
[+] .github/workflows/perf-scan.md (98.5 KB)
[!] Schedule uses fixed daily time (1:0 UTC). Consider using fuzzy schedule 'daily'...
[!] Compiled 1 workflow(s): 0 error(s), 1 warning(s)

One expected warning: fixed 01:00 UTC cron (intentional -- results ready before morning
standup; fuzzy daily alternative would deliver them at a random time).

How to test

  1. Navigate to Actions > Daily Performance Scanner.
  2. Click Run workflow (manual dispatch).
  3. Confirm a new issue labelled type/performance + type/automation appears in the issue tracker.

Copilot AI review requested due to automatic review settings July 10, 2026 14:40
@sergio-sisternes-epam sergio-sisternes-epam force-pushed the sergio-sisternes-epam-daily-perf-scan-workflow branch from 294959c to 28f2b29 Compare July 10, 2026 14:41
@sergio-sisternes-epam sergio-sisternes-epam changed the base branch from main to sergio-sisternes-epam-perf-audit-and-fixes July 10, 2026 14:41

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 gh-aw agentic workflow (perf-scan) scheduled daily at 01:00 UTC to scan src/apm_cli/ for algorithmic performance anti-patterns and open a tracking issue per run, plus a companion reference doc.

Changes:

  • Introduces .github/workflows/perf-scan.md with the scan procedure and issue-format contract.
  • Adds the compiled workflow .github/workflows/perf-scan.lock.yml.
  • Adds .github/agents/workflows/perf-scan.md as a standalone reference for scope and output contract.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
.github/workflows/perf-scan.md Defines the scheduled agent instructions + safe-output issue creation contract.
.github/workflows/perf-scan.lock.yml Generated workflow YAML used by GitHub Actions to execute the agentic workflow.
.github/agents/workflows/perf-scan.md Companion reference describing scope, output contract, and finding format.

Comment thread .github/workflows/perf-scan.md
Comment thread .github/workflows/perf-scan.lock.yml Outdated
Comment thread .github/workflows/perf-scan.md Outdated
Comment thread .github/workflows/perf-scan.md Outdated
Comment thread .github/workflows/perf-scan.lock.yml Outdated
Comment thread .github/agents/workflows/perf-scan.md
@sergio-sisternes-epam sergio-sisternes-epam force-pushed the sergio-sisternes-epam-perf-audit-and-fixes branch from 029b93e to c5c3fd1 Compare July 12, 2026 05:33
Base automatically changed from sergio-sisternes-epam-perf-audit-and-fixes to main July 12, 2026 05:46
Add perf-scan.md agentic workflow that runs daily at 01:00 UTC and scans
src/apm_cli/ for six algorithmic performance anti-patterns:

  A. Quadratic or worse loop nesting
  B. Linear scan inside a loop (set/dict opportunity)
  C. Unconditional expensive operations on hot paths
  D. Redundant env-var / config parsing in sequence
  E. Heavy top-level imports on CLI command modules
  F. Sequential I/O with no data dependency (parallelism opportunity)

Each run creates a GitHub Issue titled:
  [perf-scan] YYYY-MM-DD -- performance opportunities found
  [perf-scan] YYYY-MM-DD -- no issues found  (when clean)

Issues are labelled 'type/performance' and 'type/automation'. Output is
ASCII-only per the repository encoding rule.

The companion instructions file at .github/agents/workflows/perf-scan.md
documents the agent prompt, scan scope, and output contract for reference.

The .lock.yml was generated with gh aw compile (v0.81.6).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sergio-sisternes-epam sergio-sisternes-epam force-pushed the sergio-sisternes-epam-daily-perf-scan-workflow branch from 28f2b29 to cf4042d Compare July 12, 2026 15:22
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.

2 participants