fix(ci): select direct agent files for lint and originality

This commit is contained in:
Rudy Celekli
2026-09-28 00:05:15 -04:00
parent 479193dcce
commit 0249ecd37f
2 changed files with 22 additions and 3 deletions
+3 -3
View File
@@ -41,9 +41,9 @@ jobs:
id: changed
run: |
FILES=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- \
'academic/**/*.md' 'design/**/*.md' 'engineering/**/*.md' 'finance/**/*.md' 'game-development/**/*.md' 'gis/**/*.md' 'healthcare/**/*.md' 'marketing/**/*.md' 'paid-media/**/*.md' 'sales/**/*.md' 'security/**/*.md' 'product/**/*.md' \
'project-management/**/*.md' 'research/**/*.md' 'testing/**/*.md' 'support/**/*.md' \
'spatial-computing/**/*.md' 'specialized/**/*.md')
':(glob)academic/**/*.md' ':(glob)design/**/*.md' ':(glob)engineering/**/*.md' ':(glob)finance/**/*.md' ':(glob)game-development/**/*.md' ':(glob)gis/**/*.md' ':(glob)healthcare/**/*.md' ':(glob)marketing/**/*.md' ':(glob)paid-media/**/*.md' ':(glob)sales/**/*.md' ':(glob)security/**/*.md' ':(glob)product/**/*.md' \
':(glob)project-management/**/*.md' ':(glob)research/**/*.md' ':(glob)testing/**/*.md' ':(glob)support/**/*.md' \
':(glob)spatial-computing/**/*.md' ':(glob)specialized/**/*.md')
{
echo "files<<ENDOFLIST"
echo "$FILES"
+19
View File
@@ -95,6 +95,25 @@ if [[ -f "$WF" ]]; then
while IFS= read -r div; do
grep -qE "\b${div}/" "$WF" || fail "$WF has no path filter for division '$div'"
done < <(canonical)
# The workflow's inner git diff pathspecs must select every tracked agent.
# Git's ordinary `division/**/*.md` pattern misses files directly in division/.
changed_paths=()
while IFS= read -r pathspec; do changed_paths+=("$pathspec"); done < <(
sed -n '/FILES=$(git diff/,/^[[:space:]]*{[[:space:]]*$/p' "$WF" \
| grep -oE "'[^']+\.md'" | tr -d "'"
)
if [[ ${#changed_paths[@]} -eq 0 ]]; then
fail "$WF has no changed-agent git diff pathspecs"
else
expected_agents="$(while IFS= read -r div; do
git ls-files -- "$div/*.md"
done < <(canonical) | sort -u)"
selected_agents="$(git ls-files -- "${changed_paths[@]}" | sort -u)"
missed_agents="$(comm -23 <(printf '%s\n' "$expected_agents") <(printf '%s\n' "$selected_agents"))"
if [[ -n "$missed_agents" ]]; then
fail "$WF changed-agent git diff pathspecs miss $(printf '%s\n' "$missed_agents" | wc -l | tr -d ' ') tracked agents (e.g. $(printf '%s\n' "$missed_agents" | head -n 1))"
fi
fi
else
fail "$WF not found"
fi