Proposal: fix architecture-guard and bug-hunter — use org-level label IDs instead of creating repo-level duplicate labels #5763

Open
opened 2026-04-09 09:12:20 +00:00 by HAL9000 · 0 comments
Owner

Agent Improvement Proposal

Pattern Detected

Type: workflow_fix
Affected Agents: architecture-guard, bug-hunter, test-infra-improver
Evidence: Issues #5672 ([AUTO-GUARD] Code Analysis Report Cycle 10), #5715 ([AUTO-BUG-POOL] Bug Detection Pool Status Cycle 1), and #5745 ([AUTO-INF-POOL] Infrastructure Analysis Report Cycle 1) all have DUPLICATE labels — both org-level labels (IDs 1397-1398, 843, 860) AND repo-level labels (IDs 1402-1405) with different colors and descriptions.

Detailed Evidence

Issue #5672 labels:

  • 1402 (repo-level "Automation Tracking", black #000000) — DUPLICATE
  • 1398 (org-level "Automation Tracking", purple #d4c5f9) — CORRECT
  • 1405 (repo-level "Priority/Medium", blue #0000ff) — DUPLICATE
  • 860 (org-level "Priority/Medium", orange #e64a19) — CORRECT
  • 1404 (repo-level "State/In Progress", green #00ff00) — DUPLICATE
  • 843 (org-level "State/In Progress", blue #0492c2) — CORRECT
  • 1403 (repo-level "Type/Automation", red #ff0000) — DUPLICATE
  • 1397 (org-level "Type/Automation", purple #7c5295) — CORRECT

The agents are creating new repo-level labels when they cannot find the org-level labels by name. This happens because:

  1. The agents use label names (strings) in their API calls
  2. The Forgejo API creates new repo-level labels when it can't find matching org-level labels
  3. This results in duplicate labels with different colors/descriptions

Impact:

  • Issues have duplicate labels causing visual confusion
  • Automation tracking queries may match on wrong label IDs
  • The backlog groomer may not correctly identify issues with repo-level labels
  • Label management becomes inconsistent across the system

Proposed Change

Update the affected agent definitions to use numeric label IDs instead of label names when applying labels via the Forgejo API. The org-level label IDs are stable and should be used directly:

Org-level label IDs (use these, NOT label names):
- Automation Tracking: 1398
- Type/Automation: 1397
- State/In Progress: 843
- Priority/Medium: 860
- State/Unverified: 846
- State/Verified: 847
- Needs Feedback: 1401
- Type/Task: 857
- Type/Bug: 849
- Priority/High: 859
- Priority/Critical: 858
- Priority/Backlog: 862

Specific changes needed:

  1. In architecture-guard.md: Replace label name strings with numeric IDs in all forgejo_add_issue_labels calls
  2. In bug-hunter.md: Same fix
  3. In test-infra-improver.md: Same fix

Example fix:

# WRONG (creates repo-level labels):
forgejo_add_issue_labels(labels="Automation Tracking,Type/Automation,State/In Progress,Priority/Medium")

# CORRECT (uses org-level label IDs):
forgejo_add_issue_labels(labels="1398,1397,843,860")

Expected Impact

  • No more duplicate labels: Issues will only have org-level labels
  • Consistent label colors: All automation tracking issues will have the same label appearance
  • Correct automation tracking queries: Queries filtering by label ID will work correctly
  • Cleaner backlog: The backlog groomer won't need to fix duplicate labels

Risk Assessment

  • Low risk: This is a pure label ID fix — the behavior remains the same, only the label IDs change
  • Potential concern: If org-level label IDs change, the hardcoded IDs will break. Mitigation: org-level label IDs are stable and rarely change
  • Potential concern: Existing issues with repo-level labels will still have duplicates. Mitigation: the backlog groomer can clean up existing duplicate labels

This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the needs feedback label, add State/Verified, or comment with approval.


Automated by CleverAgents Bot
Supervisor: Agent Evolver | Agent: agent-evolver

## Agent Improvement Proposal ### Pattern Detected **Type**: workflow_fix **Affected Agents**: `architecture-guard`, `bug-hunter`, `test-infra-improver` **Evidence**: Issues #5672 ([AUTO-GUARD] Code Analysis Report Cycle 10), #5715 ([AUTO-BUG-POOL] Bug Detection Pool Status Cycle 1), and #5745 ([AUTO-INF-POOL] Infrastructure Analysis Report Cycle 1) all have DUPLICATE labels — both org-level labels (IDs 1397-1398, 843, 860) AND repo-level labels (IDs 1402-1405) with different colors and descriptions. ### Detailed Evidence Issue #5672 labels: - `1402` (repo-level "Automation Tracking", black #000000) — DUPLICATE - `1398` (org-level "Automation Tracking", purple #d4c5f9) — CORRECT - `1405` (repo-level "Priority/Medium", blue #0000ff) — DUPLICATE - `860` (org-level "Priority/Medium", orange #e64a19) — CORRECT - `1404` (repo-level "State/In Progress", green #00ff00) — DUPLICATE - `843` (org-level "State/In Progress", blue #0492c2) — CORRECT - `1403` (repo-level "Type/Automation", red #ff0000) — DUPLICATE - `1397` (org-level "Type/Automation", purple #7c5295) — CORRECT The agents are creating new repo-level labels when they cannot find the org-level labels by name. This happens because: 1. The agents use label names (strings) in their API calls 2. The Forgejo API creates new repo-level labels when it can't find matching org-level labels 3. This results in duplicate labels with different colors/descriptions **Impact**: - Issues have duplicate labels causing visual confusion - Automation tracking queries may match on wrong label IDs - The backlog groomer may not correctly identify issues with repo-level labels - Label management becomes inconsistent across the system ### Proposed Change Update the affected agent definitions to use **numeric label IDs** instead of label names when applying labels via the Forgejo API. The org-level label IDs are stable and should be used directly: ``` Org-level label IDs (use these, NOT label names): - Automation Tracking: 1398 - Type/Automation: 1397 - State/In Progress: 843 - Priority/Medium: 860 - State/Unverified: 846 - State/Verified: 847 - Needs Feedback: 1401 - Type/Task: 857 - Type/Bug: 849 - Priority/High: 859 - Priority/Critical: 858 - Priority/Backlog: 862 ``` **Specific changes needed:** 1. In `architecture-guard.md`: Replace label name strings with numeric IDs in all `forgejo_add_issue_labels` calls 2. In `bug-hunter.md`: Same fix 3. In `test-infra-improver.md`: Same fix **Example fix:** ``` # WRONG (creates repo-level labels): forgejo_add_issue_labels(labels="Automation Tracking,Type/Automation,State/In Progress,Priority/Medium") # CORRECT (uses org-level label IDs): forgejo_add_issue_labels(labels="1398,1397,843,860") ``` ### Expected Impact - **No more duplicate labels**: Issues will only have org-level labels - **Consistent label colors**: All automation tracking issues will have the same label appearance - **Correct automation tracking queries**: Queries filtering by label ID will work correctly - **Cleaner backlog**: The backlog groomer won't need to fix duplicate labels ### Risk Assessment - **Low risk**: This is a pure label ID fix — the behavior remains the same, only the label IDs change - **Potential concern**: If org-level label IDs change, the hardcoded IDs will break. Mitigation: org-level label IDs are stable and rarely change - **Potential concern**: Existing issues with repo-level labels will still have duplicates. Mitigation: the backlog groomer can clean up existing duplicate labels --- *This is a proposal from the agent evolver. A human must approve this issue before the change will be implemented. To approve: remove the `needs feedback` label, add `State/Verified`, or comment with approval.* --- **Automated by CleverAgents Bot** Supervisor: Agent Evolver | Agent: agent-evolver
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#5763
No description provided.