feat: add 4 agentic code quality workflows - #2417
Conversation
- duplicate-code-detector.md: weekly scan for near-duplicate code blocks, files issues for high-impact deduplication opportunities - test-coverage-reporter.md: weekly + on push to main, reports coverage trends as GitHub Discussions - refactoring-scanner.md: weekly scan for oversized/mixed-responsibility files, files refactoring issues - export-audit.md: on push to main, detects unused exports, naming inconsistencies, circular deps, wrong test imports All compiled to .lock.yml via gh aw compile and post-processed. Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/28e98601-c6b6-425c-9141-a0d0c455ec04
This comment has been minimized.
This comment has been minimized.
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
|
@copilot update duplicate-code-detector.md, refactoring-scanner.md, and test-coverage-reporter.md to run on a daily basis |
…age-reporter to daily schedule Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/6bcb659e-1e94-4f2d-9d14-4071b8c26f60 Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Done in f866d3c. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds four new agentic code-quality workflows to continuously surface duplication, refactoring candidates, unused exports/cycles, and coverage regressions as the TypeScript + container JS codebase grows.
Changes:
- Introduces scheduled/on-demand workflows for duplicate detection, refactoring scanning, export auditing, and coverage reporting.
- Adds corresponding compiled
.lock.ymlworkflow files for each new workflow.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/test-coverage-reporter.md | New workflow definition + prompt for generating a coverage trend discussion. |
| .github/workflows/test-coverage-reporter.lock.yml | Compiled/locked GitHub Actions workflow for coverage reporter. |
| .github/workflows/refactoring-scanner.md | New workflow definition + prompt for identifying refactoring candidates. |
| .github/workflows/refactoring-scanner.lock.yml | Compiled/locked workflow for refactoring scanner. |
| .github/workflows/export-audit.md | New workflow definition + prompt for unused exports / naming / circular deps audit. |
| .github/workflows/export-audit.lock.yml | Compiled/locked workflow for export audit. |
| .github/workflows/duplicate-code-detector.md | New workflow definition + prompt for jscpd + pattern-based duplication scanning. |
| .github/workflows/duplicate-code-detector.lock.yml | Compiled/locked workflow for duplicate-code detector. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 11
| description: | | ||
| Workflow triggered on every push to main that audits the TypeScript and JavaScript | ||
| surface of the codebase: unused exports, inconsistent naming conventions, circular | ||
| dependencies, and test files importing from incorrect modules. files actionable issues |
| description: | | ||
| Daily workflow that scans the codebase for duplicate and near-duplicate code blocks, | ||
| copy-paste patterns, and repeated logic sequences in TypeScript source and JavaScript | ||
| container code. files actionable issues for high-impact deduplication opportunities |
| network: | ||
| allowed: | ||
| - node | ||
|
|
||
| tools: | ||
| github: | ||
| toolsets: [issues] | ||
| bash: true | ||
|
|
| run: npm ci 2>&1 | tail -5 | ||
|
|
||
| - name: Build TypeScript | ||
| id: build | ||
| run: npm run build 2>&1 | tail -10 |
| grep -rn "^export\s\+\(function\|class\|const\|let\|var\|type\|interface\|enum\)" src/ --include="*.ts" | \ | ||
| grep -v "\.test\.ts" | \ | ||
| sed 's|.*export\s\+\(function\|class\|const\|let\|var\|type\|interface\|enum\)\s\+\([a-zA-Z_][a-zA-Z0-9_]*\).*|\2|' | \ |
| run: npm ci 2>&1 | tail -5 | ||
|
|
||
| - name: Build | ||
| run: npm run build 2>&1 | tail -5 | ||
|
|
||
| - name: Run coverage | ||
| id: coverage | ||
| run: npm run test:coverage 2>&1 | tail -20 |
| tools: | ||
| github: | ||
| toolsets: [repos, actions] | ||
| bash: true |
| network: | ||
| allowed: | ||
| - node | ||
|
|
||
| tools: | ||
| github: | ||
| toolsets: [issues] | ||
| bash: true |
| echo "FUNCTION_COUNTS<<EOF" | ||
| for f in src/*.ts; do | ||
| [ -f "$f" ] || continue | ||
| count=$(grep -c "^\s*\(export \)\?\(async \)\?function\|^\s*\(export \)\?const [a-zA-Z].*=\s*\(async \)\?(" "$f" 2>/dev/null || echo 0) |
| network: | ||
| allowed: | ||
| - node | ||
|
|
||
| tools: | ||
| github: | ||
| toolsets: [issues] | ||
| bash: true | ||
|
|
|
@copilot address the review feedback on .md files. ignore any feedback on .lock.yml files |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/f49cc459-e3d0-4f79-8c1e-f157a23d6a9b Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Done in b12804a. Changes made to the
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This comment has been minimized.
This comment has been minimized.
|
Smoke Test Results: ✅ GitHub MCP: #2401, #2398 Status: PASS
|
This comment has been minimized.
This comment has been minimized.
|
PR titles:
Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results — Services Connectivity
Overall: FAIL
|
🔬 Smoke Test Results
Overall: FAIL — pre-step template variables ( PR: "feat: add 4 agentic code quality workflows" — author
|
|
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Author: Overall: PASS (core BYOK path verified ✅)
|
As
src/docker-manager.ts(3,900+ lines),src/cli.ts(1,700+ lines), and related files grow, duplication, dead exports, and coverage gaps accumulate silently. This adds four scheduled agentic workflows to catch these issues continuously.New workflows
duplicate-code-detector.md— Daily + on-demand. Runsjscpd+ grep-based pattern analysis acrosssrc/**/*.tsandcontainers/**/*.js. Files issues with side-by-side evidence and concrete extraction suggestions (≤5 issues/run, expires 30d).test-coverage-reporter.md— Daily + on push tomain. Runsnpm run test:coverage, builds a per-file table, and separately flags security-critical paths (host-iptables.ts,squid-config.ts,domain-patterns.ts). Posts a GitHub Discussion with trends and prioritized recommendations. Complements the existingtest-coverage-improver(which writes tests); this one reports only.refactoring-scanner.md— Daily + on-demand. Classifies files by line count (>2,000 = must split), analyzes logical sections in oversized files for mixed responsibilities, and flags deeply nested / overly long functions. Files issues with proposed split plans (≤5/run, expires 60d).export-audit.md— On push tomain+ on-demand. Usests-prune+ grep to find unused exports, validates naming conventions (PascalCase types, camelCase functions), runsmadgefor circular deps, and checks test import paths. Files issues with specific symbol names and recommended fixes (≤5/run, expires 30d).Design notes
All four workflows use read-only permissions; write operations go through
safe-outputs. Each checks for existing open issues/discussions before creating new ones to stay idempotent. All compiled to.lock.ymlviagh aw compile+postprocess-smoke-workflows.ts.