Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .agents/scripts/circuit-breaker-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -573,13 +573,18 @@ Supervisor dispatch is **paused**. No new tasks will be dispatched until the cir
--description "Supervisor circuit breaker tripped — dispatch paused" \
--color "D93F0B" \
--force || true
gh label create "source:circuit-breaker" \
--repo "$repo_slug" \
--description "Auto-created by circuit-breaker-helper.sh" \
--color "C2E0C6" \
--force || true

local issue_url
issue_url=$(gh issue create \
--repo "$repo_slug" \
--title "Supervisor circuit breaker tripped — ${failure_count} consecutive failures" \
--body "$body" \
--label "circuit-breaker") || {
--label "circuit-breaker" --label "source:circuit-breaker") || {
_cb_log_warn "failed to create GitHub issue"
return 1
}
Expand Down
2 changes: 1 addition & 1 deletion .agents/scripts/findings-to-tasks-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ normalize_label_list() {
local source="${2:-$DEFAULT_SOURCE}"
local severity="${3:-$DEFAULT_SEVERITY}"

local out="actionable-finding,${source},severity:${severity}"
local out="actionable-finding,${source},severity:${severity},source:findings-to-tasks"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The source:findings-to-tasks label is added here, but the script is missing the corresponding gh label create command to ensure the label exists. This is inconsistent with other scripts in this PR and may result in issues being created without the intended source label. Please add the label creation logic before the issue is created. It should look something like this:

gh label create "source:findings-to-tasks" --repo "$repo_slug" \
    --description "Auto-created by findings-to-tasks-helper.sh" \
    --color "C2E0C6" --force || true

You'll need to ensure a variable like $repo_slug is available in the scope where you add this.

local token=""
local token_trimmed=""

Expand Down
12 changes: 11 additions & 1 deletion .agents/scripts/gh-failure-miner-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,16 @@
candidate_file=$(mktemp)
printf '%s\n' "$clusters_json" | jq --argjson min_count "$systemic_threshold" '[.[] | select(.count >= $min_count)]' >"$candidate_file"

# Ensure source label exists on repos that will receive issues
if [[ "$dry_run" != "true" ]]; then
local seen_repos=""

Check warning on line 548 in .agents/scripts/gh-failure-miner-helper.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused local variable 'seen_repos'.

See more on https://sonarcloud.io/project/issues?id=marcusquinn_aidevops&issues=AZzzMydXa2oXHuy7xpB6&open=AZzzMydXa2oXHuy7xpB6&pullRequest=4955

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The variable seen_repos is initialized but never used. It can be removed to improve code clarity.

local repo_entry
for repo_entry in $(printf '%s\n' "$clusters_json" | jq -r '.[].repo' | sort -u); do
gh label create "source:ci-failure-miner" --repo "$repo_entry" \
--description "Auto-created by gh-failure-miner-helper.sh" --color "C2E0C6" --force 2>/dev/null || true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The gh label create command uses 2>/dev/null || true. While this works, it suppresses any potential error messages from gh, such as authentication or permission issues. Other scripts in this PR use just || true, which is slightly safer as it allows errors to be logged while still preventing the script from exiting. For consistency and better error visibility, consider using just || true here and in other places where 2>/dev/null is used for gh label create (e.g., milestone-validation-worker.sh, stats-functions.sh).

Suggested change
--description "Auto-created by gh-failure-miner-helper.sh" --color "C2E0C6" --force 2>/dev/null || true
--description "Auto-created by gh-failure-miner-helper.sh" --color "C2E0C6" --force || true
References
  1. Avoid using '2>/dev/null' for blanket suppression of command errors in shell scripts to ensure that authentication, syntax, or system issues remain visible for debugging.
  2. In shell scripts with 'set -e' enabled, use '|| true' to prevent the script from exiting when a command fails on an optional lookup, but do not suppress stderr with '2>/dev/null' so that actual syntax or system errors remain visible for debugging.

done
fi

local candidate_count
candidate_count=$(jq 'length' "$candidate_file")
if [[ "$candidate_count" -eq 0 ]]; then
Expand Down Expand Up @@ -585,7 +595,7 @@
if [[ "$dry_run" == "true" ]]; then
echo "DRY RUN: would create issue: ${title}"
else
local create_cmd=(gh issue create --repo "$repo_slug" --title "$title" --body "$body" --label bug)
local create_cmd=(gh issue create --repo "$repo_slug" --title "$title" --body "$body" --label bug --label "source:ci-failure-miner")
local label
for label in "${extra_labels[@]}"; do
if [[ -n "$label" ]]; then
Expand Down
5 changes: 4 additions & 1 deletion .agents/scripts/milestone-validation-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1026,10 +1026,13 @@ create_fix_tasks() {
**Validation criteria:** Re-run milestone validation after fix to confirm resolution."

local issue_url
gh label create "source:mission-validation" --repo "$repo_slug" \
--description "Auto-created by milestone-validation-worker.sh" \
--color "C2E0C6" --force 2>/dev/null || true
issue_url=$(gh issue create --repo "$repo_slug" \
--title "$fix_title" \
--body "$issue_body" \
--label "bug,mission:$mission_id" 2>/dev/null || echo "")
--label "bug,mission:$mission_id,source:mission-validation" 2>/dev/null || echo "")

if [[ -n "$issue_url" ]]; then
log_success "Created fix issue: $issue_url"
Expand Down
4 changes: 3 additions & 1 deletion .agents/scripts/post-merge-review-scanner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ create_issue() {
fi
gh label create "$SCANNER_LABEL" --repo "$repo" \
--description "Unaddressed review bot feedback" --color "D4C5F9" || true
gh label create "source:review-scanner" --repo "$repo" \
--description "Auto-created by post-merge-review-scanner.sh" --color "C2E0C6" --force || true
local body
body="## Unaddressed review bot suggestions

Expand All @@ -75,7 +77,7 @@ PR #${pr} was merged with unaddressed review bot feedback.
${summary}
---
*Auto-created by post-merge-review-scanner.sh (t1386)*"
gh issue create --repo "$repo" --title "$title" --label "$SCANNER_LABEL" --body "$body"
gh issue create --repo "$repo" --title "$title" --label "$SCANNER_LABEL,source:review-scanner" --body "$body"
}

do_scan() {
Expand Down
8 changes: 5 additions & 3 deletions .agents/scripts/quality-feedback-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1395,9 +1395,11 @@
return 0
fi

# Ensure labels exist (quality-debt + priority labels for dispatch ordering, t1413)
# Ensure labels exist (quality-debt + source + priority labels for dispatch ordering, t1413)
gh label create "quality-debt" --repo "$repo_slug" --color "D93F0B" \
--description "Unactioned review feedback from merged PRs" --force || true
gh label create "source:review-feedback" --repo "$repo_slug" --color "C2E0C6" \
--description "Auto-created by quality-feedback-helper.sh" --force || true
gh label create "priority:critical" --repo "$repo_slug" --color "B60205" \
--description "Critical severity — security or data loss risk" --force || true
gh label create "priority:high" --repo "$repo_slug" --color "D93F0B" \
Expand All @@ -1409,7 +1411,7 @@
# Fetch title/number/state so we can dedupe against both open and closed history.
local existing_issues_json
existing_issues_json=$(gh issue list --repo "$repo_slug" \
--label "quality-debt" --state all --limit 1000 \

Check warning on line 1414 in .agents/scripts/quality-feedback-helper.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of using the literal 'quality-debt' 4 times.

See more on https://sonarcloud.io/project/issues?id=marcusquinn_aidevops&issues=AZzzMyaXa2oXHuy7xpB5&open=AZzzMyaXa2oXHuy7xpB5&pullRequest=4955
--json title,number,state || echo "[]")

local existing_open_issues_json
Expand Down Expand Up @@ -1545,8 +1547,8 @@
*) priority_label="" ;;
esac

# Create the issue with severity-based priority label
local label_args="quality-debt"
# Create the issue with severity-based priority label and source provenance
local label_args="quality-debt,source:review-feedback"
[[ -n "$priority_label" ]] && label_args="${label_args},${priority_label}"

local new_issue
Expand Down
2 changes: 1 addition & 1 deletion .agents/scripts/self-evolution-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ Gap lifecycle: detected → todo_created → resolved"
--repo-path "$repo_path" \
--title "Self-evolution: ${description}" \
--description "$issue_body" \
--labels "self-evolution,auto-dispatch" 2>&1) || {
--labels "self-evolution,auto-dispatch,source:self-evolution" 2>&1) || {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The source:self-evolution label is added here, but the script is missing the corresponding gh label create command. This is inconsistent with other scripts in this PR and may result in issues being created without the intended source label. Please add the label creation logic before calling claim-task-id.sh. It should look something like this:

gh label create "source:self-evolution" --repo "$repo_slug" \
    --description "Auto-created by self-evolution-helper.sh" \
    --color "C2E0C6" --force || true

You'll need to ensure a variable like $repo_slug is available. I see --repo-path "$repo_path" is used, so you might need to derive the repo slug from the path if it's not already available.

log_warn "claim-task-id.sh failed — recording gap without TODO"
log_warn "Output: $claim_output"
# Still update the gap status to avoid re-processing
Expand Down
13 changes: 10 additions & 3 deletions .agents/scripts/stats-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,13 @@
--description "$role_label_desc" --force 2>/dev/null || true
gh label create "$runner_user" --repo "$repo_slug" --color "0E8A16" \
--description "${role_display} runner: ${runner_user}" --force 2>/dev/null || true
gh label create "source:health-dashboard" --repo "$repo_slug" --color "C2E0C6" \
--description "Auto-created by stats-functions.sh health dashboard" --force 2>/dev/null || true

health_issue_number=$(gh issue create --repo "$repo_slug" \
--title "${runner_prefix} starting..." \
--body "Live ${runner_role} status for **${runner_user}**. Updated each pulse. Pin this issue for at-a-glance monitoring." \
--label "$role_label" --label "$runner_user" 2>/dev/null | grep -oE '[0-9]+$' || echo "")
--label "$role_label" --label "$runner_user" --label "source:health-dashboard" 2>/dev/null | grep -oE '[0-9]+$' || echo "")

if [[ -z "$health_issue_number" ]]; then
echo "[stats] Health issue: could not create for ${repo_slug}" >>"$LOGFILE"
Expand Down Expand Up @@ -983,11 +985,13 @@
--description "Daily code quality review" --force 2>/dev/null || true
gh label create "persistent" --repo "$repo_slug" --color "FBCA04" \
--description "Persistent issue — do not close" --force 2>/dev/null || true
gh label create "source:quality-sweep" --repo "$repo_slug" --color "C2E0C6" \
--description "Auto-created by stats-functions.sh quality sweep" --force 2>/dev/null || true

issue_number=$(gh issue create --repo "$repo_slug" \
--title "Daily Code Quality Review" \
--body "Persistent issue for daily code quality sweeps across multiple tools (CodeRabbit, Qlty, ShellCheck, Codacy, SonarCloud). The supervisor posts findings here and creates actionable issues from them. **Do not close this issue.**" \
--label "quality-review" --label "persistent" 2>/dev/null | grep -oE '[0-9]+$' || echo "")
--label "quality-review" --label "persistent" --label "source:quality-sweep" 2>/dev/null | grep -oE '[0-9]+$' || echo "")

if [[ -z "$issue_number" ]]; then
echo "[stats] Quality sweep: could not create issue for ${repo_slug}" >>"$LOGFILE"
Expand Down Expand Up @@ -1107,6 +1111,9 @@
gh label create "needs-maintainer-review" --repo "$repo_slug" \
--description "Requires maintainer approval before automated dispatch" \
--color "FBCA04" 2>/dev/null || true
gh label create "source:quality-sweep" --repo "$repo_slug" \
--description "Auto-created by stats-functions.sh quality sweep" \
--color "C2E0C6" --force 2>/dev/null || true

# Extract files with smell count > threshold, sorted by count descending
local high_smell_files
Expand Down Expand Up @@ -1185,7 +1192,7 @@

if gh issue create --repo "$repo_slug" \
--title "$issue_title" \
--label "simplification-debt" --label "needs-maintainer-review" \
--label "simplification-debt" --label "needs-maintainer-review" --label "source:quality-sweep" \

Check warning on line 1195 in .agents/scripts/stats-functions.sh

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of using the literal 'source:quality-sweep' 4 times.

See more on https://sonarcloud.io/project/issues?id=marcusquinn_aidevops&issues=AZzzMyeAa2oXHuy7xpB7&open=AZzzMyeAa2oXHuy7xpB7&pullRequest=4955
--assignee "$maintainer" \
--body "$issue_body" >/dev/null 2>&1; then
issues_created=$((issues_created + 1))
Expand Down
Loading