From ff97a372ace4a58a6749d95b1474a5528d467e3e Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Fri, 3 Apr 2026 10:33:48 -0700 Subject: [PATCH] fix(workflows): convert hardcoded repo lists to read from repos.txt audit-repo-health.md: - All 9 steps now read from repos.txt dynamically - Repos without relevant files (package.json, .dockerignore, etc.) are skipped - No more manual maintenance when repos are added/removed verify-all-backends.md: - Remove duplicate learning_ai_notes entry - Add learning_ai_efforise backend - Add learning_ai_efforise client + learning_ai_local_llms dashboard to web checks gitea-ci.md: - Steps 3+4 read from repos.txt, skip repos without gitea remote - Handle oss/ subdirectory repos via basename for Gitea API --- .windsurf/workflows/audit-repo-health.md | 140 ++++++--------------- .windsurf/workflows/gitea-ci.md | 42 +++---- .windsurf/workflows/verify-all-backends.md | 6 +- 3 files changed, 54 insertions(+), 134 deletions(-) diff --git a/.windsurf/workflows/audit-repo-health.md b/.windsurf/workflows/audit-repo-health.md index 5625a79b..dc0078ca 100644 --- a/.windsurf/workflows/audit-repo-health.md +++ b/.windsurf/workflows/audit-repo-health.md @@ -15,20 +15,12 @@ Systematically verify consistency across all ByteLyst product repos. Catches dri ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== packageManager in root package.json ===" -for repo in \ - learning_ai_common_plat \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue + [[ ! -f "$REPOS_DIR/$repo/package.json" ]] && continue printf "%-40s " "$repo:" grep '"packageManager"' "$REPOS_DIR/$repo/package.json" 2>/dev/null || echo "MISSING" -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` Expect: all repos show `"packageManager": "pnpm@10.6.5"`. Fix any MISSING entries. @@ -40,20 +32,12 @@ Expect: all repos show `"packageManager": "pnpm@10.6.5"`. Fix any MISSING entrie ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== node_modules in .gitignore ===" -for repo in \ - learning_ai_common_plat \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue + [[ ! -f "$REPOS_DIR/$repo/.gitignore" ]] && continue printf "%-40s " "$repo:" grep -c 'node_modules' "$REPOS_DIR/$repo/.gitignore" 2>/dev/null || echo "MISSING" -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` Expect: all repos have at least 1 match. Fix any with 0 or MISSING. @@ -65,16 +49,8 @@ Expect: all repos have at least 1 match. Fix any with 0 or MISSING. ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== .dockerignore health ===" -for repo in \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue di="$REPOS_DIR/$repo/.dockerignore" if [ ! -f "$di" ]; then echo "$repo: MISSING .dockerignore" @@ -83,10 +59,10 @@ for repo in \ else echo "$repo: OK" fi -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` -Expect: all OK. Any BUG entries will break Docker builds. +Expect: all OK (repos without .dockerignore are skipped). Any BUG entries will break Docker builds. ## 4. Check stale package-lock.json files @@ -95,19 +71,11 @@ Expect: all OK. Any BUG entries will break Docker builds. ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== Stale package-lock.json ===" -for repo in \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue found=$(find "$REPOS_DIR/$repo" -name "package-lock.json" -not -path "*/node_modules/*" 2>/dev/null) if [ -n "$found" ]; then echo "STALE: $found"; fi -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt echo "(empty = all clean)" ``` @@ -120,17 +88,9 @@ Expect: no output. Remove any stale lockfiles found. ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== Dockerfile base image + NODE_TLS ===" -for repo in \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do - for df in $(git -C "$REPOS_DIR/$repo" ls-files '*/Dockerfile' 2>/dev/null); do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue + for df in $(git -C "$REPOS_DIR/$repo" ls-files '*/Dockerfile' 'Dockerfile' 2>/dev/null); do full="$REPOS_DIR/$repo/$df" base=$(grep -m1 '^FROM' "$full" | awk '{print $2}') tls=$(grep -c 'NODE_TLS_REJECT_UNAUTHORIZED' "$full" 2>/dev/null) @@ -139,7 +99,7 @@ for repo in \ [[ "$tls" == "0" && "$df" != *python* ]] && status="$status WARN:no-NODE_TLS" echo "$repo/$df: base=$base tls=$tls $status" done -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` Expect: all use `node:22-slim`, all have `NODE_TLS` refs > 0. Fix any WARN entries. @@ -151,15 +111,9 @@ Expect: all use `node:22-slim`, all have `NODE_TLS` refs > 0. Fix any WARN entri ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== next.config.ts: transpilePackages + symlinks ===" -for repo in \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_notes \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do - for cfg in $(find "$REPOS_DIR/$repo" -maxdepth 2 -name "next.config.ts" -not -path "*/node_modules/*" 2>/dev/null); do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue + for cfg in $(find "$REPOS_DIR/$repo" -maxdepth 3 -name "next.config.ts" -not -path "*/node_modules/*" 2>/dev/null); do relpath="${cfg#$REPOS_DIR/}" tp=$(grep -c 'transpilePackages' "$cfg") sl=$(grep -c 'symlinks' "$cfg") @@ -168,7 +122,7 @@ for repo in \ [[ "$sl" == "0" ]] && status="$status MISSING:symlinks" echo "$relpath: transpile=$tp symlinks=$sl $status" done -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` Expect: all show transpile>0 and symlinks>0. Fix any MISSING entries. @@ -180,17 +134,10 @@ Expect: all show transpile>0 and symlinks>0. Fix any MISSING entries. ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== pnpm-workspace.yaml includes common-plat ===" -for repo in \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue ws="$REPOS_DIR/$repo/pnpm-workspace.yaml" + [[ ! -f "$ws" ]] && continue if [ ! -f "$ws" ]; then echo "$repo: MISSING pnpm-workspace.yaml" elif grep -q 'common_plat' "$ws"; then @@ -198,10 +145,10 @@ for repo in \ else echo "$repo: MISSING common-plat in workspace" fi -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` -Expect: all OK. Fix any MISSING entries. +Expect: all OK (repos without pnpm-workspace.yaml are skipped). Fix any MISSING entries. ## 8. Check docker-prep.sh uses shared prep-consumer @@ -210,16 +157,8 @@ Expect: all OK. Fix any MISSING entries. ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== docker-prep.sh uses shared prep-consumer ===" -for repo in \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue script="$REPOS_DIR/$repo/scripts/docker-prep.sh" if [ ! -f "$script" ]; then echo "$repo: NO docker-prep.sh" @@ -228,10 +167,10 @@ for repo in \ else echo "$repo: WARN — legacy docker-prep.sh" fi -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` -Expect: all OK. Legacy scripts should be replaced with the shared wrapper. +Expect: all OK (repos without docker-prep.sh are skipped). Legacy scripts should be replaced with the shared wrapper. ## 9. Check verify scripts reference correct package filter names @@ -240,19 +179,12 @@ Expect: all OK. Legacy scripts should be replaced with the shared wrapper. ```bash REPOS_DIR="/Users/sd9235/code/mygh" echo "=== Root verify scripts ===" -for repo in \ - learning_voice_ai_agent \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue + [[ ! -f "$REPOS_DIR/$repo/package.json" ]] && continue printf "%-40s " "$repo:" node -e "const p=require('$REPOS_DIR/$repo/package.json'); console.log(p.scripts?.verify || 'NONE')" 2>/dev/null -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` Review output manually — ensure `--filter` names match actual package names in sub-packages. diff --git a/.windsurf/workflows/gitea-ci.md b/.windsurf/workflows/gitea-ci.md index 9d3b234a..30ab2a86 100644 --- a/.windsurf/workflows/gitea-ci.md +++ b/.windsurf/workflows/gitea-ci.md @@ -30,22 +30,14 @@ Each push triggers the `.gitea/workflows/ci.yml` workflow on the local runner. ```bash REPOS_DIR="/Users/sd9235/code/mygh" -for repo in \ - learning_ai_common_plat \ - learning_voice_ai_agent \ - learning_multimodal_memory_agents \ - learning_ai_clock \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_notes \ - learning_ai_flowmonk \ - learning_ai_trails \ - learning_ai_local_memory_gpt; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue + cd "$REPOS_DIR/$repo" 2>/dev/null || continue + # Skip repos without a gitea remote + git remote get-url gitea &>/dev/null || continue echo "=== $repo ===" - cd "$REPOS_DIR/$repo" git push gitea main 2>&1 | tail -2 -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` ## 4. Wait for jobs to process, then check results @@ -54,20 +46,14 @@ Wait ~2 minutes per repo for the runner (capacity=1) to process the queue, then ```bash REPOS_DIR="/Users/sd9235/code/mygh" -for repo in \ - learning_ai_common_plat \ - learning_ai_clock \ - learning_ai_trails \ - learning_ai_flowmonk \ - learning_ai_notes \ - learning_ai_fastgap \ - learning_ai_jarvis_jr \ - learning_ai_peakpulse \ - learning_ai_local_memory_gpt \ - learning_voice_ai_agent \ - learning_multimodal_memory_agents; do +while IFS= read -r repo; do + [[ -z "$repo" || "$repo" =~ ^# ]] && continue + cd "$REPOS_DIR/$repo" 2>/dev/null || continue + git remote get-url gitea &>/dev/null || continue + # Use basename for Gitea API (oss/learning_ai_claw-cowork → learning_ai_claw-cowork) + repo_name=$(basename "$repo") echo "=== $repo ===" - curl -s -u "bytelyst:bytelyst123" "http://localhost:3300/api/v1/repos/bytelyst/$repo/actions/jobs" | python3 -c " + curl -s -u "bytelyst:bytelyst123" "http://localhost:3300/api/v1/repos/bytelyst/$repo_name/actions/jobs" | python3 -c " import sys, json jobs = json.load(sys.stdin).get('jobs', []) if not jobs: @@ -80,7 +66,7 @@ else: icon = '✅' if c == 'success' else '❌' if c == 'failure' else '⏳' print(f' {icon} {c:12} {j[\"name\"]}') " 2>/dev/null -done +done < /Users/sd9235/code/mygh/learning_ai_common_plat/.windsurf/workflows/repos.txt ``` ## 5. (Optional) View logs for a failing job diff --git a/.windsurf/workflows/verify-all-backends.md b/.windsurf/workflows/verify-all-backends.md index fdbbd45b..2fac093f 100644 --- a/.windsurf/workflows/verify-all-backends.md +++ b/.windsurf/workflows/verify-all-backends.md @@ -39,7 +39,7 @@ for entry in \ "learning_ai_peakpulse:@peakpulse/backend" \ "learning_voice_ai_agent:@lysnrai/backend" \ "learning_ai_flowmonk:@flowmonk/backend" \ - "learning_ai_notes:@notelett/backend"; do + "learning_ai_efforise:@efforise/backend"; do repo="${entry%%:*}" filter="${entry##*:}" @@ -83,7 +83,9 @@ for entry in \ "learning_ai_clock:web" \ "learning_ai_jarvis_jr:jarvisjr-web" \ "learning_voice_ai_agent:user-dashboard-web" \ - "learning_ai_flowmonk:@flowmonk/web"; do + "learning_ai_flowmonk:@flowmonk/web" \ + "learning_ai_efforise:client" \ + "learning_ai_local_llms:dashboard"; do repo="${entry%%:*}" filter="${entry##*:}"