Feature: Automation Tracking Manager applies mandatory labels to tracking issues

  Background:
    Given a Forgejo repository is available
    And the automation-tracking-manager agent is configured

  Scenario: CREATE_TRACKING_ISSUE applies mandatory labels to status tracking issues
    When the automation-tracking-manager creates a status tracking issue with:
      | name                   | value                    |
      | agent-prefix           | AUTO-TEST-SUP            |
      | tracking-type          | Test Status              |
      | body                   | Test tracking issue body |
      | sleep-interval-default | 60                       |
    Then the created tracking issue should have the following mandatory labels:
      | label |
      | Automation Tracking |
      | Priority/Medium |
    And the issue title should match the pattern "[AUTO-TEST-SUP] Status: Test Status (Cycle N)"

  Scenario: CREATE_ANNOUNCEMENT_ISSUE applies mandatory labels to announcement issues
    When the automation-tracking-manager creates an announcement issue with:
      | name         | value                  |
      | agent-prefix | AUTO-TEST-SUP          |
      | message      | Test Announcement      |
      | priority     | Priority/Critical      |
      | body         | Test announcement body |
    Then the created announcement issue should have the following mandatory labels:
      | label |
      | Automation Tracking |
      | Priority/Critical |
    And the issue title should match the pattern "[AUTO-TEST-SUP] Announce: Test Announcement"

  Scenario: CREATE_TRACKING_ISSUE fails gracefully if labels cannot be applied
    When the automation-tracking-manager attempts to create a status tracking issue
    And the forgejo-label-manager fails to apply labels
    Then the created issue should be deleted
    And an error message should be returned explaining the label application failure
