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
Address PR feedback: remove 'other' label, add comment for unclassifiable issues, clean up
- Remove 'other' from classification labels; agent now leaves a comment
when an issue doesn't fit established categories
- Remove unused 'mode' and 'snapshot_text' workflow_dispatch inputs
- Add 'add-comment' safe-output for unclassifiable issue comments
- Reduce max labels from 3 to 2 (one classification + ai-triaged)
- Add scripts/corrections/README.md
- Clarify test timestamps relative to frozen clock
- Remove 'other' from CLASSIFICATION_LABELS constant
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
You are an AI agent that classifies newly opened issues in the copilot-sdk repository.
42
36
43
-
Your **only** job is to apply labels. You do not post comments, close issues, or modify issues in any other way.
37
+
Your **only** job is to apply labels and, when necessary, leave a brief comment. You do not close issues or modify them in any other way.
44
38
45
39
## Your Task
46
40
47
41
1. Fetch the full issue content using GitHub tools
48
42
2. Read the issue title, body, and author information
49
-
3. Follow the classification instructions below to determine the correct labels
50
-
4. Apply the labels
43
+
3. Follow the classification instructions below to determine the correct classification
44
+
4. Take action:
45
+
- If the issue fits one of the established categories (`bug`, `enhancement`, `question`, `documentation`): apply that label **and** the `ai-triaged` label
46
+
- If the issue does **not** clearly fit any category: do **not** apply a classification label. Instead, leave a brief comment explaining why the issue couldn't be classified and that a human will review it. Still apply the `ai-triaged` label.
51
47
52
-
You must apply:
53
-
-**Exactly one** classification label (`bug`, `enhancement`, `question`, `documentation`, or `other`)
54
-
-**The `ai-triaged` label** (always, alongside the classification label)
Copy file name to clipboardExpand all lines: .github/workflows/shared/triage-classification.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ You are classifying issues for the **copilot-sdk** repository — a multi-langua
4
4
5
5
## Classification Labels
6
6
7
-
Apply **exactly one** of these routing labels to each issue:
7
+
Apply **exactly one** of these routing labels to each issue. If none fit, see "Unclassifiable Issues" below.
8
8
9
9
### `bug`
10
10
Something isn't working correctly. The issue describes unexpected behavior, errors, crashes, or regressions in existing functionality.
@@ -38,13 +38,9 @@ Examples:
38
38
- "API reference for session.ui is outdated"
39
39
- "Add migration guide from v1 to v2"
40
40
41
-
### `other`
42
-
The issue doesn't clearly fit any of the above categories. Use this for meta discussions, process questions, infrastructure issues, or anything that doesn't map to a specific routing category.
41
+
## Unclassifiable Issues
43
42
44
-
Examples:
45
-
- "Proposal to restructure the monorepo"
46
-
- "CI is failing on the main branch"
47
-
- "License question about commercial use"
43
+
If the issue doesn't clearly fit any of the above categories (e.g., meta discussions, process questions, infrastructure issues, license questions), do **not** apply a classification label. Instead, leave a brief comment explaining why the issue couldn't be automatically classified and that a human will review it.
TypeScript scripts that detect and record human corrections to the AI triage agent's issue classifications.
4
+
5
+
## How it works
6
+
7
+
When the AI triage agent classifies an issue, it applies a classification label (`bug`, `enhancement`, `question`, `documentation`) plus `ai-triaged`. If a maintainer disagrees, they remove the agent's label and apply the correct one. This system detects that change and records it as a **correction**.
8
+
9
+
### Detection logic
10
+
11
+
-**Correction**: A classification label is added while `ai-triaged` is present, and the timeline shows the same actor removed a different classification label within the last 2 minutes.
12
+
-**Confirmation**: `ai-triaged` is removed without changing the classification label — the maintainer agrees with the agent.
13
+
-**Late comments**: If the corrector adds a follow-up comment, it's appended to the correction record as context.
14
+
15
+
### Where corrections go
16
+
17
+
Corrections are stored as JSON files (`evals/corrections/issue-{N}.json`) on a `triage-corrections` branch. A single PR accumulates all corrections for human review before merging.
18
+
19
+
### Guards
20
+
21
+
- Only users with `write`, `maintain`, or `admin` permission can record corrections
22
+
- Bot-triggered label events are ignored
23
+
- Non-classification labels (e.g., `priority/high`) are ignored
24
+
25
+
## Development
26
+
27
+
```bash
28
+
npm ci # install dependencies
29
+
npm run build # compile TypeScript → dist/
30
+
npm test# run tests (vitest)
31
+
npm run typecheck # type-check without emitting
32
+
```
33
+
34
+
Or from the repo root:
35
+
36
+
```bash
37
+
just install-corrections
38
+
just test-corrections
39
+
just lint-corrections
40
+
```
41
+
42
+
## Files
43
+
44
+
| File | Purpose |
45
+
|------|---------|
46
+
|`src/track-correction.ts`| Main detection logic (correction vs confirmation) |
|`src/update-context-comments.ts`| Appends late justification comments |
49
+
|`src/types.ts`| Shared interfaces and constants |
50
+
|`src/github-types.ts`| Type aliases for `actions/github-script` params |
51
+
|`src/test-helpers.ts`| Mock factories for unit tests |
52
+
|`src/integration.test.ts`| End-to-end scenarios with recording mock client |
53
+
54
+
## Workflow
55
+
56
+
These scripts are called by `.github/workflows/track-correction.yml`, which triggers on `issues.labeled`, `issues.unlabeled`, and `issue_comment.created` events. The workflow builds the TypeScript, then runs the compiled JS via `actions/github-script`.
0 commit comments