feat(agentics): add daily performance-scan agentic workflow#2125
Open
sergio-sisternes-epam wants to merge 5 commits into
Open
feat(agentics): add daily performance-scan agentic workflow#2125sergio-sisternes-epam wants to merge 5 commits into
sergio-sisternes-epam wants to merge 5 commits into
Conversation
…ss ref resolution - dependency_graph.py: Replace O(n) has_dependency() linear scan with O(1) set lookup via _repo_url_index maintained on add_node() - http_cache.py: Add tracked size fast-path to _enforce_size_cap() so the full directory scan is skipped when total cache is under the 100MB cap (the common case on every store() call) - marketplace/builder.py: Replace triple sequential iteration over git refs list (tags, full refnames, branches) with a single-pass dict index built once per resolution, reducing O(3n) to O(n) + O(1) lookups - github_host.py: Extract repeated os.environ.get + strip + lower + split chains into shared helpers (_get_ghes_host, _get_gitlab_single_host, _get_gitlab_hosts_list) to eliminate redundant string processing on every host classification call Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cover the three main optimisation areas: - has_dependency() O(1) index vs O(n) scan scaling - HttpCache size-cap fast-path (linear scaling, no quadratic rescan) - github_host env-var helpers throughput Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ivation Add Big O analysis, missing-index detection, unconditional-expensive-op flagging, import-cost awareness, and scaling-guard recommendations to the performance-expert agent. Create references/algorithmic-patterns.md as a lazy-loaded catalogue of the six core anti-patterns. Broaden the panel activation rules to fire on utils/, marketplace/, compilation/ paths and on diffs that introduce loops over collections or repeated I/O calls. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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 'performance' and 'automated'. 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.80.9). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
294959c to
28f2b29
Compare
Contributor
There was a problem hiding this comment.
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.mdwith the scan procedure and issue-format contract. - Adds the compiled workflow
.github/workflows/perf-scan.lock.yml. - Adds
.github/agents/workflows/perf-scan.mdas 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 on lines
+190
to
+193
| (The `[perf-scan] ` prefix is added automatically by the safe-output.) | ||
|
|
||
| Create the issue using the `create-issue` safe-output tool with the body below. | ||
| All text must be ASCII-only. |
Comment on lines
+15
to
+26
| # This file was automatically generated by gh-aw (v0.65.6). DO NOT EDIT. | ||
| # | ||
| # To update this file, edit the corresponding .md file and run: | ||
| # gh aw compile | ||
| # Not all edits will cause changes to this file. | ||
| # | ||
| # For more information: https://github.github.com/gh-aw/introduction/overview/ | ||
| # | ||
| # Scans src/apm_cli/ daily for algorithmic performance anti-patterns and opens a GitHub Issue with findings | ||
| # | ||
| # gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"9540b93dbcfcc84ddf0ca18c81b0a736840a9a6517bfc634c0258941a709831e","compiler_version":"v0.65.6","strict":true,"agent_id":"copilot"} | ||
|
|
Comment on lines
+99
to
+100
| grep -rn --include="*.py" -E "if .+ in \[|\.count\(|\.index\(" src/apm_cli/ | \ | ||
| grep -v "test_\|#\|isinstance" | head -60 |
Comment on lines
+15
to
+18
| create-issue: | ||
| expires: 7d | ||
| title-prefix: "[perf-scan] " | ||
| labels: [performance, automated] |
Comment on lines
+985
to
+989
| runs-on: ubuntu-slim | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| timeout-minutes: 15 |
Comment on lines
+40
to
+45
| Every run creates exactly one GitHub Issue: | ||
| - Found findings: `[perf-scan] YYYY-MM-DD -- performance opportunities found` | ||
| - No findings: `[perf-scan] YYYY-MM-DD -- no issues found` | ||
|
|
||
| Labels applied: `performance`, `automated`. | ||
|
|
029b93e to
c5c3fd1
Compare
Base automatically changed from
sergio-sisternes-epam-perf-audit-and-fixes
to
main
July 12, 2026 05:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Adds a daily agentic workflow (
perf-scan) that scanssrc/apm_cli/foralgorithmic 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-expertagentwith a full algorithmic lens. Without a recurring automated scan, new regressions
will silently accumulate between manual audits.
Approach (WHAT)
A GitHub Agentic Workflow that:
workflow_dispatch.src/apm_cli/.Implementation (HOW)
Files added
.github/workflows/perf-scan.md.github/workflows/perf-scan.lock.ymlgh aw compile v0.80.9).github/agents/workflows/perf-scan.mdAnti-patterns scanned (A-F)
x in list)Schedule and output
0 1 * * *(01:00 UTC daily) +workflow_dispatch.[perf-scan] YYYY-MM-DD -- performance opportunities foundor-- no issues foundperformance,automated. ASCII-only body.Security
Issue creation via
safe-outputs: create-issueonly. Noissues: writedirect permission.Validation
One expected warning: fixed 01:00 UTC cron (intentional --
dailyfuzzy schedule fires at a random time).How to test
performance+automatedappears in the tracker.