elastic / elastic/ai-github-actions
[autonomy-atomicity] Shared /tmp/prompt-audit workspace causes cross-run clobbering
- Dominant language
- Python
- Stars
- 11
- Forks
- 16
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 31
Description
## Autonomy / Atomicity Findings
### 1. Shared prompt-audit extraction path is a cross-run global mutable state
**Category:** Global state
**File(s):**
- `scripts/extract-lockfile-prompts.sh` (lines 6, 15, 28, 107)
- `.github/workflows/trigger-prompt-audit.yml` (lines 21, 25, 29)
**Problem:**
The prompt extraction script defaults to a fixed output directory (`/tmp/prompt-audit`) and writes deterministic filenames (`$OUTPUT_DIR/${name}.prompt.md`) plus a shared manifest (`$OUTPUT_DIR/README.md`). The prompt-audit trigger calls this script without an output-dir override and then instructs the agent to read from that same fixed path.
When two runs execute concurrently (for example overlapping schedule/manual runs, or local and CI runs on the same runner), both runs write to the same directory and same filenames. This creates interleaving/overwrite risk, yielding mixed manifests and nondeterministic audit inputs.
**Suggested fix:**
Use a run-scoped output directory and thread it through both setup and instructions, e.g. under `$RUNNER_TEMP` (or another run-unique path) using `GITHUB_RUN_ID`/`GITHUB_RUN_ATTEMPT`.
## Suggested Actions
- [ ] Update `scripts/extract-lockfile-prompts.sh` to default to a run-scoped temp directory instead of `/tmp/prompt-audit`.
- [ ] Update `trigger-prompt-audit.yml` to pass an explicit unique output directory to the script.
- [ ] Update prompt-audit instructions to read the manifest and prompt files from that injected run-scoped path, not a fixed global 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/31408359963)
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Contributor guide
Research direction
Start with scripts/extract-lockfile-prompts.sh at the listed output-path and filename handling, then inspect .github/workflows/trigger-prompt-audit.yml where the script and agent instructions use the workspace. Trace how the output directory is passed through both steps. Done means concurrent runs use separate directories and the manifest and prompt files are read from the same run-scoped path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, shell
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100