Skip to content

Commit ee43d44

Browse files
authored
agentics copy (#3924)
* add agentics * feat: add weekly research workflow and agentics management commands - Introduced a new GitHub Actions workflow for weekly research, scheduled to run every Monday at 9AM UTC. This workflow performs deep research on the repository and related industry, creating a discussion with findings. - Added `agentics-add` and `agentics-update` commands to the Makefile for managing agentics from the githubnext/agentics repository. * fix: update workflow source references in ci-doctor and technical-doc-writer files * Remove daily test coverage improver workflow and update technical doc writer action to maintain compatibility with GitHub Copilot.
1 parent ccf9e16 commit ee43d44

38 files changed

Lines changed: 72078 additions & 274 deletions

.github/aw/actions-lock.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"version": "v4",
1111
"sha": "0057852bfaa89a56745cba8c7296529d2fc39830"
1212
},
13+
"actions/checkout@v4": {
14+
"repo": "actions/checkout",
15+
"version": "v4",
16+
"sha": "08eba0b27e820071cde6df949e0beb9ba4906955"
17+
},
1318
"actions/checkout@v5": {
1419
"repo": "actions/checkout",
1520
"version": "v5",

.github/workflows/ci-doctor.lock.yml renamed to .github/workflows/agentics/ci-doctor.lock.yml

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# gh aw compile
44
# For more information: https://github.com/githubnext/gh-aw/blob/main/.github/instructions/github-agentic-workflows.instructions.md
55
#
6-
# Source: githubnext/agentics/workflows/ci-doctor.md
6+
# Source: githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5
7+
#
8+
# Effective stop-time: 2025-11-16 04:52:03
79
#
810
# Job Dependency Graph:
911
# ```mermaid
@@ -14,6 +16,8 @@
1416
# create_issue["create_issue"]
1517
# detection["detection"]
1618
# missing_tool["missing_tool"]
19+
# pre_activation["pre_activation"]
20+
# pre_activation --> activation
1721
# agent --> add_comment
1822
# create_issue --> add_comment
1923
# detection --> add_comment
@@ -50,11 +54,7 @@ name: "CI Failure Doctor"
5054
- Daily Perf Improver
5155
- Daily Test Coverage Improver
5256

53-
permissions:
54-
actions: read
55-
contents: read
56-
issues: read
57-
pull-requests: read
57+
permissions: read-all
5858

5959
concurrency:
6060
group: "gh-aw-${{ github.workflow }}"
@@ -63,8 +63,10 @@ run-name: "CI Failure Doctor"
6363

6464
jobs:
6565
activation:
66+
needs: pre_activation
6667
if: >
67-
(github.event.workflow_run.conclusion == 'failure') && ((github.event_name != 'workflow_run') || (github.event.workflow_run.repository.id == github.repository_id))
68+
((needs.pre_activation.outputs.activated == 'true') && (github.event.workflow_run.conclusion == 'failure')) &&
69+
((github.event_name != 'workflow_run') || (github.event.workflow_run.repository.id == github.repository_id))
6870
runs-on: ubuntu-slim
6971
permissions:
7072
contents: read
@@ -197,9 +199,8 @@ jobs:
197199
GH_AW_CREATED_ISSUE_URL: ${{ needs.create_issue.outputs.issue_url }}
198200
GH_AW_CREATED_ISSUE_NUMBER: ${{ needs.create_issue.outputs.issue_number }}
199201
GH_AW_WORKFLOW_NAME: "CI Failure Doctor"
200-
GH_AW_WORKFLOW_SOURCE: "githubnext/agentics/workflows/ci-doctor.md"
201-
GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/githubnext/agentics/tree/main/workflows/ci-doctor.md"
202-
GH_AW_CAMPAIGN: "ci-doctor-failures"
202+
GH_AW_WORKFLOW_SOURCE: "githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5"
203+
GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/githubnext/agentics/tree/9586b5fc47d008cd1cf42f6c298a46abfd774fb5/workflows/ci-doctor.md"
203204
with:
204205
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
205206
script: |
@@ -569,11 +570,7 @@ jobs:
569570
agent:
570571
needs: activation
571572
runs-on: ubuntu-latest
572-
permissions:
573-
actions: read
574-
contents: read
575-
issues: read
576-
pull-requests: read
573+
permissions: read-all
577574
concurrency:
578575
group: "gh-aw-copilot-${{ github.workflow }}"
579576
env:
@@ -1591,7 +1588,7 @@ jobs:
15911588
15921589
### Phase 3: Historical Context Analysis
15931590
1. **Search Investigation History**: Use file-based storage to search for similar failures:
1594-
- Read from cached investigation files in `/tmp/gh-aw/memory/investigations/`
1591+
- Read from cached investigation files in `/tmp/memory/investigations/`
15951592
- Parse previous failure patterns and solutions
15961593
- Look for recurring error signatures
15971594
2. **Issue History**: Search existing issues for related problems
@@ -1615,8 +1612,8 @@ jobs:
16151612
16161613
### Phase 5: Pattern Storage and Knowledge Building
16171614
1. **Store Investigation**: Save structured investigation data to files:
1618-
- Write investigation report to `/tmp/gh-aw/memory/investigations/<timestamp>-<run-id>.json`
1619-
- Store error patterns in `/tmp/gh-aw/memory/patterns/`
1615+
- Write investigation report to `/tmp/memory/investigations/<timestamp>-<run-id>.json`
1616+
- Store error patterns in `/tmp/memory/patterns/`
16201617
- Maintain an index file of all investigations for fast searching
16211618
2. **Update Pattern Database**: Enhance knowledge with new findings by updating pattern files
16221619
3. **Save Artifacts**: Store detailed logs and analysis in the cached directories
@@ -1699,8 +1696,8 @@ jobs:
16991696
17001697
## Cache Usage Strategy
17011698
1702-
- Store investigation database and knowledge patterns in `/tmp/gh-aw/memory/investigations/` and `/tmp/gh-aw/memory/patterns/`
1703-
- Cache detailed log analysis and artifacts in `/tmp/gh-aw/investigation/logs/` and `/tmp/gh-aw/investigation/reports/`
1699+
- Store investigation database and knowledge patterns in `/tmp/memory/investigations/` and `/tmp/memory/patterns/`
1700+
- Cache detailed log analysis and artifacts in `/tmp/investigation/logs/` and `/tmp/investigation/reports/`
17041701
- Persist findings across workflow runs using GitHub Actions cache
17051702
- Build cumulative knowledge about failure patterns and solutions using structured JSON files
17061703
- Use file-based indexing for fast pattern matching and similarity detection
@@ -4206,9 +4203,8 @@ jobs:
42064203
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
42074204
GH_AW_ISSUE_TITLE_PREFIX: "${{ github.workflow }}"
42084205
GH_AW_WORKFLOW_NAME: "CI Failure Doctor"
4209-
GH_AW_WORKFLOW_SOURCE: "githubnext/agentics/workflows/ci-doctor.md"
4210-
GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/githubnext/agentics/tree/main/workflows/ci-doctor.md"
4211-
GH_AW_CAMPAIGN: "ci-doctor-failures"
4206+
GH_AW_WORKFLOW_SOURCE: "githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5"
4207+
GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/githubnext/agentics/tree/9586b5fc47d008cd1cf42f6c298a46abfd774fb5/workflows/ci-doctor.md"
42124208
with:
42134209
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
42144210
script: |
@@ -4803,9 +4799,8 @@ jobs:
48034799
env:
48044800
GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
48054801
GH_AW_WORKFLOW_NAME: "CI Failure Doctor"
4806-
GH_AW_WORKFLOW_SOURCE: "githubnext/agentics/workflows/ci-doctor.md"
4807-
GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/githubnext/agentics/tree/main/workflows/ci-doctor.md"
4808-
GH_AW_CAMPAIGN: "ci-doctor-failures"
4802+
GH_AW_WORKFLOW_SOURCE: "githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5"
4803+
GH_AW_WORKFLOW_SOURCE_URL: "${{ github.server_url }}/githubnext/agentics/tree/9586b5fc47d008cd1cf42f6c298a46abfd774fb5/workflows/ci-doctor.md"
48094804
with:
48104805
github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
48114806
script: |
@@ -4909,3 +4904,46 @@ jobs:
49094904
core.setFailed(`Error processing missing-tool reports: ${error}`);
49104905
});
49114906
4907+
pre_activation:
4908+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
4909+
runs-on: ubuntu-slim
4910+
outputs:
4911+
activated: ${{ steps.check_stop_time.outputs.stop_time_ok == 'true' }}
4912+
steps:
4913+
- name: Check stop-time limit
4914+
id: check_stop_time
4915+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
4916+
env:
4917+
GH_AW_STOP_TIME: 2025-11-16 04:52:03
4918+
GH_AW_WORKFLOW_NAME: "CI Failure Doctor"
4919+
with:
4920+
script: |
4921+
async function main() {
4922+
const stopTime = process.env.GH_AW_STOP_TIME;
4923+
const workflowName = process.env.GH_AW_WORKFLOW_NAME;
4924+
if (!stopTime) {
4925+
core.setFailed("Configuration error: GH_AW_STOP_TIME not specified.");
4926+
return;
4927+
}
4928+
if (!workflowName) {
4929+
core.setFailed("Configuration error: GH_AW_WORKFLOW_NAME not specified.");
4930+
return;
4931+
}
4932+
core.info(`Checking stop-time limit: ${stopTime}`);
4933+
const stopTimeDate = new Date(stopTime);
4934+
if (isNaN(stopTimeDate.getTime())) {
4935+
core.setFailed(`Invalid stop-time format: ${stopTime}. Expected format: YYYY-MM-DD HH:MM:SS`);
4936+
return;
4937+
}
4938+
const currentTime = new Date();
4939+
core.info(`Current time: ${currentTime.toISOString()}`);
4940+
core.info(`Stop time: ${stopTimeDate.toISOString()}`);
4941+
if (currentTime >= stopTimeDate) {
4942+
core.warning(`⏰ Stop time reached. Workflow execution will be prevented by activation job.`);
4943+
core.setOutput("stop_time_ok", "false");
4944+
return;
4945+
}
4946+
core.setOutput("stop_time_ok", "true");
4947+
}
4948+
await main();
4949+
Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
---
2-
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
3-
network: defaults
42
on:
53
workflow_run:
4+
workflows: ["Daily Perf Improver", "Daily Test Coverage Improver"] # Monitor the CI workflow specifically
65
types:
7-
- completed
8-
workflows:
9-
- Daily Perf Improver
10-
- Daily Test Coverage Improver
6+
- completed
117
branches:
128
- main
13-
permissions:
14-
contents: read
15-
issues: read
16-
pull-requests: read
17-
actions: read
18-
campaign: ci-doctor-failures
9+
# This will trigger only when the CI workflow completes with failure
10+
# The condition is handled in the workflow body
11+
stop-after: +48h
12+
13+
# Only trigger for failures - check in the workflow body
14+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
15+
16+
permissions: read-all
17+
18+
network: defaults
19+
1920
safe-outputs:
20-
add-comment: null
2121
create-issue:
22-
title-prefix: ${{ github.workflow }}
23-
source: githubnext/agentics/workflows/ci-doctor.md
24-
timeout-minutes: 10
22+
title-prefix: "${{ github.workflow }}"
23+
add-comment:
24+
2525
tools:
2626
cache-memory: true
27-
web-fetch: null
28-
web-search: null
29-
strict: true
27+
web-fetch:
28+
web-search:
29+
30+
timeout-minutes: 10
31+
32+
source: githubnext/agentics/workflows/ci-doctor.md@9586b5fc47d008cd1cf42f6c298a46abfd774fb5
3033
---
3134
# CI Failure Doctor
3235

@@ -68,7 +71,7 @@ You are the CI Failure Doctor, an expert investigative agent that analyzes faile
6871

6972
### Phase 3: Historical Context Analysis
7073
1. **Search Investigation History**: Use file-based storage to search for similar failures:
71-
- Read from cached investigation files in `/tmp/gh-aw/memory/investigations/`
74+
- Read from cached investigation files in `/tmp/memory/investigations/`
7275
- Parse previous failure patterns and solutions
7376
- Look for recurring error signatures
7477
2. **Issue History**: Search existing issues for related problems
@@ -92,8 +95,8 @@ You are the CI Failure Doctor, an expert investigative agent that analyzes faile
9295

9396
### Phase 5: Pattern Storage and Knowledge Building
9497
1. **Store Investigation**: Save structured investigation data to files:
95-
- Write investigation report to `/tmp/gh-aw/memory/investigations/<timestamp>-<run-id>.json`
96-
- Store error patterns in `/tmp/gh-aw/memory/patterns/`
98+
- Write investigation report to `/tmp/memory/investigations/<timestamp>-<run-id>.json`
99+
- Store error patterns in `/tmp/memory/patterns/`
97100
- Maintain an index file of all investigations for fast searching
98101
2. **Update Pattern Database**: Enhance knowledge with new findings by updating pattern files
99102
3. **Save Artifacts**: Store detailed logs and analysis in the cached directories
@@ -176,8 +179,8 @@ When creating an investigation issue, use this structure:
176179

177180
## Cache Usage Strategy
178181

179-
- Store investigation database and knowledge patterns in `/tmp/gh-aw/memory/investigations/` and `/tmp/gh-aw/memory/patterns/`
180-
- Cache detailed log analysis and artifacts in `/tmp/gh-aw/investigation/logs/` and `/tmp/gh-aw/investigation/reports/`
182+
- Store investigation database and knowledge patterns in `/tmp/memory/investigations/` and `/tmp/memory/patterns/`
183+
- Cache detailed log analysis and artifacts in `/tmp/investigation/logs/` and `/tmp/investigation/reports/`
181184
- Persist findings across workflow runs using GitHub Actions cache
182185
- Build cumulative knowledge about failure patterns and solutions using structured JSON files
183-
- Use file-based indexing for fast pattern matching and similarity detection
186+
- Use file-based indexing for fast pattern matching and similarity detection

0 commit comments

Comments
 (0)