GPT-5 finding
State file updates are not synchronized; concurrent runs can clobber each other
- scripts/postprocess-admanage-create.sh:102-107
- scripts/postprocess-admanage-create.sh:166-171
Two instances running in parallel (e.g., separate queues or retries) can both read the same STATE_FILE, each compute a new version, and the last mv wins, dropping the other's updates. While the pipeline likely runs one postprocess at a time, the code has no locking to prevent lost updates.
Recommendation
Use a file lock (flock) around state read-modify-write sections or perform updates via jq with in-place atomic append guarded by a lock file. Alternatively, serialize via CI or ensure the workflow prevents concurrent invocations.