| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" |
| 5 | cd "${repo}" |
| 6 | |
| 7 | template=".github/ISSUE_TEMPLATE/agent-task.yml" |
| 8 | retired_workflows=( |
| 9 | ".github/workflows/v0868-milestone-sync.yml" |
| 10 | ".github/workflows/agent-task-labels.yml" |
| 11 | ) |
| 12 | |
| 13 | fail() { |
| 14 | echo "agent-task metadata contract failed: $*" >&2 |
| 15 | exit 1 |
| 16 | } |
| 17 | |
| 18 | [[ -f "${template}" ]] || fail "missing ${template}" |
| 19 | for retired in "${retired_workflows[@]}"; do |
| 20 | [[ ! -e "${retired}" ]] || fail "retired workflow still exists: ${retired}" |
| 21 | done |
| 22 | |
| 23 | if grep -nE '^(title|labels):.*v[0-9]+\.[0-9]+\.[0-9]+' "${template}"; then |
| 24 | fail "agent-task defaults must not pin a release version" |
| 25 | fi |
| 26 | |
| 27 | if grep -nE '^labels:.*agent-ready' "${template}"; then |
| 28 | fail "agent-task template must not self-apply agent-ready; a maintainer grants it during triage" |
| 29 | fi |
| 30 | |
| 31 | echo "Agent-task metadata is release-neutral, milestone-safe, and does not self-apply agent-ready." |
| 32 |