elastic / elastic/ai-github-actions

[autonomy-atomicity] Scheduled audit/fix dedup uses shared /tmp/previous-findings.json path

Open
#1,752 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. Scheduled audit/fix dedup snapshot uses a global temp file
**Category:** Global state
**File(s):**
- `.github/workflows/gh-aw-scheduled-audit.md`
- `.github/workflows/gh-aw-scheduled-fix.md`
- `.github/workflows/gh-aw-fragments/previous-findings.md`

**Problem:**
Both scheduled base workflows write previous-findings data to the same fixed path, `/tmp/previous-findings.json`, and prompts instruct agents to read that same global file. On shared runners or overlapping jobs in one host namespace, concurrent runs can overwrite each other’s dedup snapshot, causing false duplicate suppression or duplicate issue creation.

**Evidence:**
- `.github/workflows/gh-aw-scheduled-audit.md:102` writes `> /tmp/previous-findings.json`.
- `.github/workflows/gh-aw-scheduled-audit.md:114-117` instructs reading `cat /tmp/previous-findings.json` for dedup.
- `.github/workflows/gh-aw-scheduled-fix.md:104` writes `> /tmp/previous-findings.json`.
- `.github/workflows/gh-aw-scheduled-fix.md:116-120` instructs reading the same file.
- `.github/workflows/gh-aw-fragments/previous-findings.md:15` writes `> /tmp/previous-findings.json`.
- `.github/workflows/gh-aw-fragments/previous-findings.md:20-23` codifies the same read path.

**Suggested fix:**
Use a run-scoped path and pass it explicitly through step env/prompt text, for example:
- `${RUNNER_TEMP}/previous-findings-${GITHUB_RUN_ID}-${GITHUB_JOB}.json`

Then update all prompt instructions to read that run-scoped path instead of `/tmp/previous-findings.json`.

## Suggested Actions
- [ ] Replace fixed `/tmp/previous-findings.json` writes in scheduled audit/fix and `previous-findings.md` with a run-scoped file path.
- [ ] Thread the computed path into downstream prompt instructions so dedup reads the same scoped file.
- [ ] Add a regression check (or script-level assertion) that prevents reintroducing a fixed shared previous-findings path.

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

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

Contributor guide

Open the contributing guide

Research direction

Start with the cited write and read sections in .github/workflows/gh-aw-scheduled-audit.md and gh-aw-scheduled-fix.md, then compare them with .github/workflows/gh-aw-fragments/previous-findings.md. Trace how the previous-findings path reaches downstream prompt text. Done means each workflow uses the same run-scoped path for writing and reading, and a regression check or assertion prevents the fixed shared path from returning.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, markdown, shell
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.