fix(ci): isolate audit and validation gate temp files#362
Merged
cobusgreyling merged 1 commit intoJul 23, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the shared audit and validation gate scripts safe to run concurrently from separate worktrees by isolating each invocation's temporary files.
Problem
Running
scripts/ci-audit-gates.shconcurrently from two worktrees reproduced a race on the shared/tmp/root-audit.jsonand starter JSON files. One invocation failed while parsing a partially overwritten file:A serial rerun passed, which isolated the failure to the fixed cross-process temp paths rather than the audit content.
No matching open Issue or PR was found; this was discovered while dogfooding the repository's own gates.
Changes
New pattern or starter
Doc / example improvement
Tool change (shared CI gate scripts)
Story
Create a unique
mktempdirectory per audit or validation invocation and remove it on exit.Keep all intermediate JSON and registry comparison files inside that directory.
Preserve the audit workflow's PR-comment handoff through an explicit
LOOP_AUDIT_OUTPUT_FILEpath under${{ runner.temp }}.Pass filenames and starter names to Node through environment variables instead of embedding them in JavaScript source.
Checklist (from CONTRIBUTING)
STATE.md*convention reviewed (not applicable)Testing / Dogfood
bash scripts/ci-audit-gates.shconcurrentlybash scripts/ci-validate-gates.shinvocations concurrently; both completed successfullybash scripts/ci-audit-gates.shserially withLOOP_AUDIT_OUTPUT_FILEand parsed the exported JSONbash scripts/ci-validate-gates.shseriallybash -n scripts/ci-audit-gates.sh scripts/ci-validate-gates.sh.github/workflows/audit.ymlwith the repository's YAML dependencygit diff --checkThe validation gate's
mcp-serverinstall still reports the repository's existing two moderate dependency advisories; this change adds no dependencies and both validation runs exit successfully.Screenshots / Examples
Not applicable; this change has no UI.