elastic / elastic/ai-github-actions

[autonomy-atomicity] Agent Deep Dive rotation skips most workflows

Open
#1,453 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11
Forks
16
Avg merge
22h 9m
Merged PRs (30d)
31

Description

## Autonomy / Atomicity Findings

### 1. Agent Deep Dive auto-selection only reaches the first seven sorted workflows
**Category:** Ordering dependency
**File(s):** `.github/workflows/agent-deep-dive.md`

**Problem:** The daily auto-selection is based only on day-of-week. The workflow builds a sorted list of matching workflow files, but then computes the index as `IDX=$(( (DAY - 1) % COUNT ))` where `DAY=$(date +%u)`. Because `DAY` is always 1-7, repositories with more than seven matching workflows can only select indexes 0-6 on scheduled runs.

**Evidence:**
- `.github/workflows/agent-deep-dive.md:18-19` schedules the workflow on weekdays.
- `.github/workflows/agent-deep-dive.md:79-82` builds the sorted `WORKFLOWS` list from paths matching `trigger-|gh-aw-`.
- `.github/workflows/agent-deep-dive.md:89-91` selects `TARGET_WORKFLOW` using only the weekday-derived index.
- Local verification found 93 matching `.github/workflows` files. The first eight sorted entries are `gh-aw-agent-suggestions.lock.yml`, `gh-aw-autonomy-atomicity-analyzer.lock.yml`, `gh-aw-branch-actions-detective.lock.yml`, `gh-aw-breaking-change-detect.lock.yml`, `gh-aw-breaking-change-detector.lock.yml`, `gh-aw-bug-hunter.lock.yml`, `gh-aw-code-complexity-detector.lock.yml`, and `gh-aw-code-duplication-detector.lock.yml`; index 7 and later are unreachable by the scheduled rotation.

**Suggested fix:** Use a rotation value whose range grows over time, such as day-of-year or `github.run_number` modulo `COUNT`, or persist/derive a least-recently-analyzed workflow. If the intent is to analyze only trigger workflows, narrow the filter explicitly before rotating.

## Suggested Actions
- [ ] Replace the weekday-only index with a modulo over a monotonically changing value that can reach every entry in `WORKFLOWS`.
- [ ] Add a test or lint check that simulates `COUNT > 7` and verifies auto-selection can cover indexes beyond 6.
- [ ] Decide whether compiled `gh-aw-*.lock.yml` workflows should be eligible; if not, filter the candidate list to triggers only before selection.

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Autonomy Atomicity Analyzer](https://github.com/elastic/ai-github-actions/actions/runs/28389410835)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Contributor guide

Open the contributing guide

Research direction

Start in .github/workflows/agent-deep-dive.md, especially the WORKFLOWS construction at lines 79-82 and target selection at lines 89-91. Review the weekday-based index and decide how compiled gh-aw workflows should be treated. Done means the rotation can reach entries beyond index 6 when COUNT exceeds seven, with a test or lint check covering that case.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.