Skip to content

Commit bd80216

Browse files
authored
feat(sergo): create up to 3 labeled issues from top findings (#26534)
1 parent cb3de4e commit bd80216

File tree

2 files changed

+98
-27
lines changed

2 files changed

+98
-27
lines changed

.github/workflows/sergo.lock.yml

Lines changed: 51 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/sergo.md

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ imports:
3232
tools:
3333
cache-memory: true
3434
github:
35-
toolsets: [default]
35+
toolsets: [default, issues]
3636
edit:
3737
bash:
3838
- "cat go.mod"
@@ -44,6 +44,11 @@ tools:
4444

4545
timeout-minutes: 45
4646
strict: true
47+
safe-outputs:
48+
create-issue:
49+
max: 3
50+
labels: [sergo]
51+
expires: 7d
4752
---
4853
# Sergo 🔬 - The Serena Go Expert
4954

@@ -65,8 +70,9 @@ Each day, you will:
6570
4. **Explain** your strategy selection and reasoning
6671
5. **Execute** deep research using your chosen strategy and Serena tools
6772
6. **Generate** 1-3 improvement agentic tasks based on findings
68-
7. **Track** success metrics in cache
69-
8. **Create** a comprehensive discussion with your analysis
73+
7. **Create** up to 3 GitHub issues for the top findings (skip duplicates)
74+
8. **Track** success metrics in cache
75+
9. **Create** a comprehensive discussion with your analysis
7076

7177
## Step 1: Initialize Serena and Scan Available Tools
7278

@@ -353,24 +359,51 @@ Order your 1-3 tasks by:
353359
2. **Scope**: Broader patterns before isolated issues
354360
3. **Effort**: Quick wins before complex refactors
355361

356-
## Step 7: Track Success in Cache
362+
## Step 7: Create Up to 3 Issues for Top Findings
357363

358-
### 7.1 Calculate Success Score
364+
### 7.1 Find Existing Open Tracking Issues
365+
366+
Before creating any new issue, search for existing open tracking issues that already cover the finding:
367+
- Use GitHub issues search tools to check for open issues with similar scope
368+
- Prioritize open issues already labeled `sergo`
369+
- If a finding is already tracked by an open issue, **do not create a duplicate**
370+
371+
### 7.2 Select the Top Findings for Issue Creation
372+
373+
From your findings, select up to 3 that are:
374+
- High impact and actionable
375+
- Distinct (not overlapping with one another)
376+
- Not already tracked by an open issue
377+
378+
### 7.3 Create Issues Using Safe Outputs
379+
380+
Create issues using the safe output `create-issue` tool. Create **between 1 and 3** issues based on the number of actionable findings in this run (do not force 3 if fewer high-quality findings exist).
381+
382+
For each issue:
383+
- Include a concise title and a clear problem statement
384+
- Add file paths, line references, and severity
385+
- Include recommended next steps and validation guidance
386+
- Skip creation if an open tracking issue already exists
387+
- Note that `create-issue.expires: 7d` is configured, so generated tracking issues are expected to auto-close after 7 days unless updated
388+
389+
## Step 8: Track Success in Cache
390+
391+
### 8.1 Calculate Success Score
359392

360393
Rate your analysis run on a scale of 0-10 based on:
361394
- **Findings Quality** (0-4): How critical/actionable are the issues?
362395
- **Coverage** (0-3): How much of the codebase was analyzed?
363396
- **Task Generation** (0-3): Did you create 1-3 high-quality tasks?
364397

365-
### 7.2 Save Strategy Results
398+
### 8.2 Save Strategy Results
366399

367400
Append your results to the strategy history:
368401
```bash
369402
# Add new strategy execution to JSONL file
370403
echo '{"date": "2026-01-15", "strategy": "your-strategy-name", "tools": ["tool1", "tool2"], "findings": 5, "tasks_created": 2, "success_score": 8, "notes": "Additional context"}' >> /tmp/gh-aw/cache-memory/sergo-strategies.jsonl
371404
```
372405

373-
### 7.3 Update Statistics
406+
### 8.3 Update Statistics
374407

375408
Update aggregate statistics:
376409
```bash
@@ -387,9 +420,9 @@ cat > /tmp/gh-aw/cache-memory/sergo-stats.json << 'EOF'
387420
EOF
388421
```
389422

390-
## Step 8: Create Comprehensive Discussion
423+
## Step 9: Create Comprehensive Discussion
391424

392-
### 8.1 Discussion Structure
425+
### 9.1 Discussion Structure
393426

394427
**Title Format**: `Sergo Report: [Strategy Name] - [Date]`
395428

@@ -522,7 +555,7 @@ EOF
522555
*Strategy: [Your strategy name]*
523556
```
524557

525-
### 8.2 Discussion Quality Guidelines
558+
### 9.2 Discussion Quality Guidelines
526559

527560
Ensure your discussion:
528561
- **Is comprehensive**: Covers all aspects of your analysis
@@ -570,8 +603,9 @@ Your output MUST include:
570603
2. **Clear strategy explanation** with 50/50 split justification
571604
3. **Detailed findings** from your analysis
572605
4. **1-3 improvement tasks** with complete specifications
573-
5. **Success tracking** in cache files
574-
6. **Comprehensive discussion** with all findings and recommendations
606+
5. **Up to 3 created issues** from top findings (or explicit duplicate-skip rationale)
607+
6. **Success tracking** in cache files
608+
7. **Comprehensive discussion** with all findings and recommendations
575609

576610
## Success Criteria
577611

@@ -581,6 +615,7 @@ A successful Sergo run delivers:
581615
- ✅ Strategy clearly explained and justified
582616
- ✅ Deep analysis executed using Serena and selected strategy
583617
- ✅ 1-3 high-quality improvement tasks generated
618+
- ✅ Up to 3 issues created from top findings, with duplicates skipped
584619
- ✅ Success metrics calculated and saved to cache
585620
- ✅ Comprehensive discussion created with all findings
586621
- ✅ Cache files properly updated for next run

0 commit comments

Comments
 (0)