You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(flaky-unit-test-analysis): enhance snippet handling and output formatting
- Updated `finalize-schema.json` to include a detailed description for the `snippet` field, ensuring it captures the exact code being replaced.
- Modified `task-prompt.md` to clarify that the `snippet` must be verbatim and formatted correctly for rendering diffs.
- Refactored `flaky-sticky-comment.ts` to improve the rendering of suggested fixes, ensuring proper indentation and formatting for better readability in comments.
- Enhanced the findings section to include links to the analyzed file locations, improving context for reviewers.
Copy file name to clipboardExpand all lines: .ai-pr-analyzer/modes/flaky-unit-test-analysis/finalize-schema.json
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,10 @@
33
33
"type": "string",
34
34
"enum": ["critical", "high", "medium"]
35
35
},
36
-
"snippet": { "type": "string" },
36
+
"snippet": {
37
+
"type": "string",
38
+
"description": "The exact current code being replaced, covering the same lines/scope as `suggestedFix`, formatted as real TypeScript with line breaks (use \\n between lines and preserve indentation). Must line up with `suggestedFix` so the two can be rendered as a diff (removed vs added lines) — do not paraphrase or summarize it."
Copy file name to clipboardExpand all lines: .ai-pr-analyzer/modes/flaky-unit-test-analysis/task-prompt.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ For each file:
18
18
3. Check .ai-pr-analyzer/flaky-history.json (read_file) for a historical hint on this file.
19
19
4. Match against the J1-J10 patterns from the loaded skill.
20
20
5. For every match, record: file, line, patternId, patternName, severity, snippet, explanation, suggestedFix, and whether the historical hint was used.
21
+
-`snippet` MUST be the exact current code being replaced, copied verbatim from the file (no paraphrasing or summarizing), covering the same lines/scope as `suggestedFix` so the two can be rendered as a before/after diff.
21
22
-`suggestedFix` MUST be the corrected code snippet ONLY, formatted as real TypeScript with actual line breaks (`\n`) and indentation — never a single-line prose paragraph. Keep all reasoning and instructions in `explanation`.
22
23
23
24
If a file has no matches, do not invent findings — omit it from findings.
0 commit comments