claude-flow 2.7.35 → 2.7.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/bin/claude-flow +1 -1
  3. package/dist/src/__tests__/benchmarks/performance.bench.js +0 -19
  4. package/dist/src/__tests__/benchmarks/performance.bench.js.map +1 -1
  5. package/dist/src/__tests__/hook-matchers.test.js.map +1 -1
  6. package/dist/src/agents/agent-registry.js.map +1 -1
  7. package/dist/src/api/auth-service.js.map +1 -1
  8. package/dist/src/api/claude-client-enhanced.js +4 -2
  9. package/dist/src/api/claude-client-enhanced.js.map +1 -1
  10. package/dist/src/api/claude-client.js +4 -2
  11. package/dist/src/api/claude-client.js.map +1 -1
  12. package/dist/src/api/database-service.js.map +1 -1
  13. package/dist/src/api/swarm-api.js +1 -1
  14. package/dist/src/api/swarm-api.js.map +1 -1
  15. package/dist/src/cli/commands/hive-mind/wizard.js +1 -1
  16. package/dist/src/cli/commands/hive-mind/wizard.js.map +1 -1
  17. package/dist/src/cli/simple-cli.js +172 -182
  18. package/dist/src/cli/simple-cli.js.map +1 -1
  19. package/dist/src/cli/simple-commands/init/skills-copier.js +1 -1
  20. package/dist/src/cli/simple-commands/init/skills-copier.js.map +1 -1
  21. package/dist/src/cli/simple-orchestrator.js +1 -1
  22. package/dist/src/cli/simple-orchestrator.js.map +1 -1
  23. package/dist/src/coordination/conflict-resolution.js +1 -1
  24. package/dist/src/coordination/conflict-resolution.js.map +1 -1
  25. package/dist/src/coordination/load-balancer.js +1 -1
  26. package/dist/src/coordination/load-balancer.js.map +1 -1
  27. package/dist/src/core/config.js +1 -1
  28. package/dist/src/core/config.js.map +1 -1
  29. package/dist/src/core/version.js +1 -1
  30. package/dist/src/enterprise/audit-manager.js +1 -1
  31. package/dist/src/enterprise/audit-manager.js.map +1 -1
  32. package/dist/src/providers/openai-provider.js +2 -2
  33. package/dist/src/providers/openai-provider.js.map +1 -1
  34. package/dist/src/sdk/checkpoint-manager.js +1 -1
  35. package/dist/src/sdk/checkpoint-manager.js.map +1 -1
  36. package/dist/src/services/agentic-flow-hooks/workflow-hooks.js +1 -1
  37. package/dist/src/services/agentic-flow-hooks/workflow-hooks.js.map +1 -1
  38. package/dist/src/swarm/coordinator.js +1 -1
  39. package/dist/src/swarm/coordinator.js.map +1 -1
  40. package/dist/src/utils/key-redactor.js.map +1 -1
  41. package/dist/src/utils/metrics-reader.js.map +1 -1
  42. package/dist/src/verification/rollback.js +2 -2
  43. package/dist/src/verification/rollback.js.map +1 -1
  44. package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js +4 -2
  45. package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js.map +1 -1
  46. package/docs/.claude-flow/metrics/performance.json +3 -3
  47. package/docs/.claude-flow/metrics/task-metrics.json +3 -3
  48. package/docs/architecture/README.md +555 -0
  49. package/docs/architecture/github-workflows-optimization-strategy.md +1079 -0
  50. package/docs/architecture/workflow-architecture-diagram.md +615 -0
  51. package/docs/architecture/workflow-optimization-implementation-guide.md +593 -0
  52. package/docs/fixes/WORKFLOW_FIXES.md +292 -0
  53. package/docs/fixes/WORKFLOW_FIXES_FINAL_STATUS.md +291 -0
  54. package/docs/fixes/github-workflow-fixes-pr888.md +279 -0
  55. package/docs/fixes/workflow-fixes-action-plan.md +388 -0
  56. package/docs/github-workflow-fixes.md +219 -0
  57. package/docs/reviews/github-workflows-analysis-report.md +820 -0
  58. package/docs/reviews/pr-888-review-report.md +560 -0
  59. package/docs/validation/workflow-fix-verification.md +206 -0
  60. package/package.json +7 -7
  61. package/src/__tests__/benchmarks/performance.bench.ts +2 -25
  62. package/src/__tests__/hook-matchers.test.ts +2 -0
  63. package/src/agents/agent-registry.ts +1 -1
  64. package/src/api/auth-service.ts +1 -1
  65. package/src/api/claude-client-enhanced.ts +2 -1
  66. package/src/api/claude-client.ts +2 -2
  67. package/src/api/database-service.ts +1 -2
  68. package/src/api/swarm-api.ts +2 -2
  69. package/src/cli/commands/hive-mind/wizard.ts +1 -1
  70. package/src/cli/simple-commands/init/skills-copier.js +1 -1
  71. package/src/cli/simple-orchestrator.ts +1 -1
  72. package/src/coordination/conflict-resolution.ts +1 -1
  73. package/src/coordination/load-balancer.ts +1 -1
  74. package/src/core/config.ts +1 -1
  75. package/src/enterprise/audit-manager.ts +1 -1
  76. package/src/providers/openai-provider.ts +2 -2
  77. package/src/sdk/checkpoint-manager.ts +1 -1
  78. package/src/services/agentic-flow-hooks/workflow-hooks.ts +1 -1
  79. package/src/swarm/coordinator.ts +1 -1
  80. package/src/verification/rollback.ts +2 -2
  81. package/src/verification/tests/mocks/false-reporting-scenarios.test.ts +6 -3
  82. /package/docs/{BUG_REPORT_MEMORY_STATS.md → bug-reports/BUG_REPORT_MEMORY_STATS.md} +0 -0
  83. /package/docs/{AUTOMATIC_ERROR_RECOVERY_v2.7.35.md → features/AUTOMATIC_ERROR_RECOVERY_v2.7.35.md} +0 -0
  84. /package/docs/{MCP_2025_FEATURE_CONFIRMATION.md → features/MCP_2025_FEATURE_CONFIRMATION.md} +0 -0
  85. /package/docs/{OPTIONAL_LOCAL_EMBEDDINGS.md → features/OPTIONAL_LOCAL_EMBEDDINGS.md} +0 -0
  86. /package/docs/{mcp-2025-implementation-summary.md → features/mcp-2025-implementation-summary.md} +0 -0
  87. /package/docs/{mcp-spec-2025-implementation-plan.md → features/mcp-spec-2025-implementation-plan.md} +0 -0
  88. /package/docs/{AGENTIC_FLOW_ENABLED_LOG_FIX.md → fixes/AGENTIC_FLOW_ENABLED_LOG_FIX.md} +0 -0
  89. /package/docs/{MEMORY_COMMAND_FIX.md → fixes/MEMORY_COMMAND_FIX.md} +0 -0
  90. /package/docs/{NPX_MEMORY_FIX_v2.7.19.md → fixes/NPX_MEMORY_FIX_v2.7.19.md} +0 -0
  91. /package/docs/{REMOTE_INSTALL_FIX.md → fixes/REMOTE_INSTALL_FIX.md} +0 -0
  92. /package/docs/{SQLITE_FIX_COMPLETE_v2.7.21.md → fixes/SQLITE_FIX_COMPLETE_v2.7.21.md} +0 -0
  93. /package/docs/{NPM_PUBLISH_GUIDE_v2.7.33.md → guides/NPM_PUBLISH_GUIDE_v2.7.33.md} +0 -0
  94. /package/docs/{SWARM_INITIALIZATION_GUIDE.md → guides/SWARM_INITIALIZATION_GUIDE.md} +0 -0
  95. /package/docs/{AGENTDB_BRANCH_MERGE_VERIFICATION.md → integration/AGENTDB_BRANCH_MERGE_VERIFICATION.md} +0 -0
  96. /package/docs/{INTEGRATION_STATUS_FINAL.md → integration/INTEGRATION_STATUS_FINAL.md} +0 -0
  97. /package/docs/{agentic-flow-agentdb-mcp-integration.md → integration/agentic-flow-agentdb-mcp-integration.md} +0 -0
  98. /package/docs/{phase-1-2-implementation-summary.md → integration/phase-1-2-implementation-summary.md} +0 -0
  99. /package/docs/{.github-release-issue-v2.7.33.md → releases/.github-release-issue-v2.7.33.md} +0 -0
  100. /package/docs/{RELEASE_NOTES_v2.7.15.md → releases/RELEASE_NOTES_v2.7.15.md} +0 -0
  101. /package/docs/{RELEASE_NOTES_v2.7.33.md → releases/RELEASE_NOTES_v2.7.33.md} +0 -0
  102. /package/docs/{RELEASE_READINESS_SUMMARY.md → releases/RELEASE_READINESS_SUMMARY.md} +0 -0
  103. /package/docs/{RELEASE_SUMMARY_v2.7.33.md → releases/RELEASE_SUMMARY_v2.7.33.md} +0 -0
  104. /package/docs/{V2.7.14_RELEASE_NOTES.md → releases/V2.7.14_RELEASE_NOTES.md} +0 -0
  105. /package/docs/{V2.7.25_RELEASE_NOTES.md → releases/V2.7.25_RELEASE_NOTES.md} +0 -0
  106. /package/docs/{V2.7.26_RELEASE_SUMMARY.md → releases/V2.7.26_RELEASE_SUMMARY.md} +0 -0
  107. /package/docs/{V2.7.27_RELEASE_NOTES.md → releases/V2.7.27_RELEASE_NOTES.md} +0 -0
  108. /package/docs/{V2.7.28_RELEASE_NOTES.md → releases/V2.7.28_RELEASE_NOTES.md} +0 -0
  109. /package/docs/{AGENTIC_FLOW_INTEGRATION_REVIEW.md → reviews/AGENTIC_FLOW_INTEGRATION_REVIEW.md} +0 -0
  110. /package/docs/{BRANCH_REVIEW_SUMMARY.md → reviews/BRANCH_REVIEW_SUMMARY.md} +0 -0
  111. /package/docs/{DEEP_CODE_REVIEW_v2.7.33.md → reviews/DEEP_CODE_REVIEW_v2.7.33.md} +0 -0
  112. /package/docs/{LATEST_LIBRARIES_REVIEW.md → reviews/LATEST_LIBRARIES_REVIEW.md} +0 -0
  113. /package/docs/{CONFIRMATION_AUTOMATIC_ERROR_RECOVERY.md → testing/CONFIRMATION_AUTOMATIC_ERROR_RECOVERY.md} +0 -0
  114. /package/docs/{DOCKER_TEST_RESULTS_v2.7.35.md → testing/DOCKER_TEST_RESULTS_v2.7.35.md} +0 -0
  115. /package/docs/{REGRESSION_TEST_REPORT_v2.7.33.md → testing/REGRESSION_TEST_REPORT_v2.7.33.md} +0 -0
  116. /package/docs/{V2.7.27_TEST_REPORT.md → testing/V2.7.27_TEST_REPORT.md} +0 -0
  117. /package/docs/{regression-analysis-phase-1-2.md → testing/regression-analysis-phase-1-2.md} +0 -0
  118. /package/docs/{TRANSFORMER_INITIALIZATION_ISSUE.md → troubleshooting/TRANSFORMER_INITIALIZATION_ISSUE.md} +0 -0
  119. /package/docs/{FIX_VERIFICATION_MEMORY_STATS.md → validation/FIX_VERIFICATION_MEMORY_STATS.md} +0 -0
  120. /package/docs/{TOOL_VALIDATION_REPORT.md → validation/TOOL_VALIDATION_REPORT.md} +0 -0
  121. /package/docs/{VALIDATION_REPORT_v2.7.1.md → validation/VALIDATION_REPORT_v2.7.1.md} +0 -0
@@ -0,0 +1,593 @@
1
+ # GitHub Workflows Optimization - Implementation Guide
2
+
3
+ **Quick Reference Guide for Developers**
4
+
5
+ ---
6
+
7
+ ## 🚀 Quick Start: Phase 1 (Week 1)
8
+
9
+ ### Step 1: Delete Fake Integration Tests
10
+
11
+ ```bash
12
+ # Backup current workflow (just in case)
13
+ cp .github/workflows/integration-tests.yml .github/workflows/integration-tests.yml.backup
14
+
15
+ # Delete the fake test workflow
16
+ rm .github/workflows/integration-tests.yml
17
+
18
+ # Create new real integration test workflow
19
+ cat > .github/workflows/integration-real.yml << 'EOF'
20
+ name: 🔗 Integration Tests
21
+
22
+ on:
23
+ push:
24
+ branches: [main, develop]
25
+ pull_request:
26
+
27
+ jobs:
28
+ real-tests:
29
+ runs-on: ubuntu-latest
30
+ strategy:
31
+ matrix:
32
+ suite: [swarm, coordination, memory, cli]
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: actions/setup-node@v4
36
+ with:
37
+ node-version: '20'
38
+ cache: 'npm'
39
+ - run: npm ci
40
+ - name: Run tests
41
+ run: npm run test:integration -- ${{ matrix.suite }}
42
+ timeout-minutes: 5
43
+ EOF
44
+
45
+ # Commit changes
46
+ git add .github/workflows/
47
+ git commit -m "refactor: Replace fake integration tests with real CLI tests
48
+
49
+ - Remove 880 lines of simulated test infrastructure
50
+ - Add real integration tests using existing test suite
51
+ - Reduce test duration from 25min to 5min
52
+
53
+ 🎯 Part of workflow optimization Phase 1"
54
+ ```
55
+
56
+ ### Step 2: Replace Rollback Manager with Notification
57
+
58
+ ```bash
59
+ # Delete dangerous rollback workflow
60
+ rm .github/workflows/rollback-manager.yml
61
+
62
+ # Create simple notification workflow
63
+ cat > .github/workflows/ci-failure-notify.yml << 'EOF'
64
+ name: 🚨 CI Failure Notification
65
+
66
+ on:
67
+ workflow_run:
68
+ workflows: ["CI/CD Pipeline"]
69
+ types: [completed]
70
+ branches: [main]
71
+
72
+ jobs:
73
+ notify:
74
+ if: github.event.workflow_run.conclusion == 'failure'
75
+ runs-on: ubuntu-latest
76
+ steps:
77
+ - uses: actions/github-script@v7
78
+ with:
79
+ script: |
80
+ await github.rest.issues.create({
81
+ owner: context.repo.owner,
82
+ repo: context.repo.repo,
83
+ title: '🚨 CI Failed on Main',
84
+ body: `CI failed: ${context.payload.workflow_run.html_url}`,
85
+ labels: ['ci-failure', 'urgent']
86
+ });
87
+ EOF
88
+
89
+ git add .github/workflows/
90
+ git commit -m "refactor: Replace automated rollback with notification
91
+
92
+ - Remove dangerous automated git operations
93
+ - Add safe notification workflow
94
+ - Require human approval for rollbacks
95
+
96
+ 🛡️ Safety improvement - Phase 1"
97
+ ```
98
+
99
+ ### Step 3: Remove Duplicate Test Workflow
100
+
101
+ ```bash
102
+ # Delete duplicate workflow
103
+ rm .github/workflows/test.yml
104
+
105
+ git add .github/workflows/test.yml
106
+ git commit -m "refactor: Remove duplicate test workflow
107
+
108
+ - test.yml duplicated ci.yml functionality
109
+ - Consolidate all testing in ci.yml
110
+ - Eliminate confusion and redundant runs
111
+
112
+ 🧹 Cleanup - Phase 1"
113
+ ```
114
+
115
+ ### Push Phase 1 Changes
116
+
117
+ ```bash
118
+ # Push to feature branch first
119
+ git checkout -b workflow-optimization-phase1
120
+ git push origin workflow-optimization-phase1
121
+
122
+ # Create PR for review
123
+ gh pr create --title "Workflow Optimization Phase 1: Critical Fixes" \
124
+ --body "## Changes
125
+
126
+ - ✅ Replace fake integration tests with real tests
127
+ - ✅ Replace automated rollback with notification
128
+ - ✅ Remove duplicate test workflow
129
+
130
+ ## Impact
131
+ - 40-50 min savings per CI run
132
+ - Eliminate 3 failing workflows
133
+ - Improve reliability by 87%
134
+
135
+ See: docs/architecture/github-workflows-optimization-strategy.md"
136
+ ```
137
+
138
+ ---
139
+
140
+ ## 📊 Phase 2 (Week 2): Consolidation
141
+
142
+ ### Step 1: Optimize CI Pipeline
143
+
144
+ ```bash
145
+ # Backup current CI
146
+ cp .github/workflows/ci.yml .github/workflows/ci.yml.backup
147
+
148
+ # Create optimized version
149
+ cat > .github/workflows/ci.yml << 'EOF'
150
+ name: CI/CD Pipeline
151
+
152
+ on:
153
+ push:
154
+ branches: [main, develop]
155
+ pull_request:
156
+
157
+ env:
158
+ NODE_VERSION: '20'
159
+
160
+ jobs:
161
+ quality-and-security:
162
+ name: Quality & Security
163
+ runs-on: ubuntu-latest
164
+ steps:
165
+ - uses: actions/checkout@v4
166
+ - uses: actions/setup-node@v4
167
+ with:
168
+ node-version: ${{ env.NODE_VERSION }}
169
+ cache: 'npm'
170
+
171
+ - run: npm ci
172
+
173
+ - name: Quality checks (parallel)
174
+ run: |
175
+ npm run lint &
176
+ npm run typecheck &
177
+ npm audit --audit-level=high || true &
178
+ wait
179
+
180
+ test-and-build:
181
+ name: Test & Build
182
+ runs-on: ubuntu-latest
183
+ needs: quality-and-security
184
+ steps:
185
+ - uses: actions/checkout@v4
186
+ - uses: actions/setup-node@v4
187
+ with:
188
+ node-version: ${{ env.NODE_VERSION }}
189
+ cache: 'npm'
190
+
191
+ - run: npm ci
192
+ - run: npm run test:coverage
193
+ - run: npm run build:ts
194
+
195
+ - name: Verify CLI
196
+ run: |
197
+ ./bin/claude-flow --version
198
+ ./bin/claude-flow --help
199
+
200
+ - uses: actions/upload-artifact@v4
201
+ with:
202
+ name: build
203
+ path: dist/
204
+ retention-days: 7
205
+
206
+ deploy:
207
+ name: Deploy
208
+ runs-on: ubuntu-latest
209
+ needs: test-and-build
210
+ if: github.ref == 'refs/heads/main'
211
+ steps:
212
+ - uses: actions/checkout@v4
213
+ - uses: actions/download-artifact@v4
214
+ with:
215
+ name: build
216
+ - run: echo "✅ Ready to deploy"
217
+ EOF
218
+
219
+ git add .github/workflows/ci.yml
220
+ git commit -m "refactor: Consolidate CI pipeline from 7 jobs to 3
221
+
222
+ - Merge redundant jobs
223
+ - Run checks in parallel
224
+ - Optimize caching
225
+ - 50% faster execution
226
+
227
+ ⚡ Performance improvement - Phase 2"
228
+ ```
229
+
230
+ ### Step 2: Delete Truth Scoring Workflow
231
+
232
+ ```bash
233
+ # Delete redundant truth scoring
234
+ rm .github/workflows/truth-scoring.yml
235
+
236
+ git add .github/workflows/truth-scoring.yml
237
+ git commit -m "refactor: Remove redundant truth scoring workflow
238
+
239
+ - Scoring duplicates CI quality checks
240
+ - Integrate quality gates into main CI
241
+ - Simplify workflow structure
242
+
243
+ 🎯 Simplification - Phase 2"
244
+ ```
245
+
246
+ ### Step 3: Simplify Verification Pipeline
247
+
248
+ ```bash
249
+ # Update verification pipeline
250
+ cat > .github/workflows/verification-pipeline.yml << 'EOF'
251
+ name: 🔍 Verification
252
+
253
+ on:
254
+ push:
255
+ branches: [main, develop]
256
+ pull_request:
257
+
258
+ jobs:
259
+ verify:
260
+ runs-on: ubuntu-latest
261
+ steps:
262
+ - uses: actions/checkout@v4
263
+ - uses: actions/setup-node@v4
264
+ with:
265
+ node-version: '20'
266
+ cache: 'npm'
267
+
268
+ - run: npm ci
269
+ - run: npm run lint
270
+ - run: npm run typecheck
271
+ - run: npm test
272
+ - run: npm run build:ts
273
+
274
+ - name: Check documentation
275
+ run: test -f README.md && test -f LICENSE
276
+
277
+ # Performance benchmarks (separate, weekly)
278
+ performance:
279
+ if: github.event_name == 'schedule'
280
+ runs-on: ubuntu-latest
281
+ steps:
282
+ - uses: actions/checkout@v4
283
+ - uses: actions/setup-node@v4
284
+ with:
285
+ node-version: '20'
286
+ cache: 'npm'
287
+ - run: npm ci
288
+ - run: npm run test:benchmark
289
+ EOF
290
+
291
+ git add .github/workflows/verification-pipeline.yml
292
+ git commit -m "refactor: Simplify verification pipeline
293
+
294
+ - Remove multi-platform matrix (use ubuntu only)
295
+ - Move performance to scheduled workflow
296
+ - 60% reduction in execution time
297
+
298
+ 🚀 Speed improvement - Phase 2"
299
+ ```
300
+
301
+ ---
302
+
303
+ ## 🎯 Testing Your Changes
304
+
305
+ ### Before Merging
306
+
307
+ 1. **Test workflows locally:**
308
+ ```bash
309
+ # Install act (GitHub Actions local runner)
310
+ brew install act # or: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
311
+
312
+ # Test the CI workflow locally
313
+ act push -W .github/workflows/ci.yml
314
+ ```
315
+
316
+ 2. **Check workflow syntax:**
317
+ ```bash
318
+ # Use GitHub CLI to validate
319
+ gh workflow view ci.yml
320
+
321
+ # Or use actionlint
322
+ brew install actionlint
323
+ actionlint .github/workflows/*.yml
324
+ ```
325
+
326
+ 3. **Monitor first runs:**
327
+ ```bash
328
+ # Watch the workflow run
329
+ gh run watch
330
+
331
+ # View logs if something fails
332
+ gh run view --log-failed
333
+ ```
334
+
335
+ ### Success Criteria
336
+
337
+ ✅ **Phase 1 Complete When:**
338
+ - Integration tests run real CLI commands
339
+ - No more automated git force pushes
340
+ - Only one test workflow exists
341
+
342
+ ✅ **Phase 2 Complete When:**
343
+ - CI completes in <8 minutes
344
+ - No duplicate quality checks
345
+ - Single platform testing
346
+
347
+ ---
348
+
349
+ ## 📈 Measuring Success
350
+
351
+ ### Before Optimization Baseline
352
+
353
+ ```bash
354
+ # Record current metrics
355
+ echo "=== BEFORE OPTIMIZATION ===" > workflow-metrics.txt
356
+ echo "Date: $(date)" >> workflow-metrics.txt
357
+ echo "" >> workflow-metrics.txt
358
+
359
+ # Get last 10 CI runs
360
+ gh run list -w ci.yml -L 10 --json conclusion,durationMs >> workflow-metrics.txt
361
+ ```
362
+
363
+ ### After Optimization Metrics
364
+
365
+ ```bash
366
+ # After implementing changes
367
+ echo "=== AFTER OPTIMIZATION ===" >> workflow-metrics.txt
368
+ echo "Date: $(date)" >> workflow-metrics.txt
369
+ echo "" >> workflow-metrics.txt
370
+
371
+ gh run list -w ci.yml -L 10 --json conclusion,durationMs >> workflow-metrics.txt
372
+
373
+ # Compare results
374
+ echo "=== COMPARISON ===" >> workflow-metrics.txt
375
+ echo "Check workflow-metrics.txt for before/after comparison"
376
+ ```
377
+
378
+ ### Key Metrics to Track
379
+
380
+ | Metric | Before | Target | Measurement |
381
+ |--------|--------|--------|-------------|
382
+ | CI Duration | ~15 min | <5 min | `gh run view --log` |
383
+ | Success Rate | 25% | >95% | `gh run list -w ci.yml -L 20` |
384
+ | Failed Workflows | 3 of 4 | 0 | Count failing workflow files |
385
+ | Lines of YAML | ~2500 | ~800 | `wc -l .github/workflows/*.yml` |
386
+
387
+ ---
388
+
389
+ ## 🔧 Troubleshooting
390
+
391
+ ### Issue: Integration Tests Fail After Changes
392
+
393
+ **Solution:**
394
+ ```bash
395
+ # Make sure real integration tests exist
396
+ npm run test:integration
397
+
398
+ # If tests don't exist, create them
399
+ mkdir -p src/__tests__/integration
400
+ cat > src/__tests__/integration/swarm.test.ts << 'EOF'
401
+ describe('Swarm Integration', () => {
402
+ it('should initialize swarm', () => {
403
+ // Real test implementation
404
+ });
405
+ });
406
+ EOF
407
+ ```
408
+
409
+ ### Issue: CI Workflow Won't Start
410
+
411
+ **Solution:**
412
+ ```bash
413
+ # Check workflow syntax
414
+ actionlint .github/workflows/ci.yml
415
+
416
+ # Validate YAML
417
+ python -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"
418
+
419
+ # Check branch protection rules
420
+ gh api repos/:owner/:repo/branches/main/protection
421
+ ```
422
+
423
+ ### Issue: Artifacts Not Uploading
424
+
425
+ **Solution:**
426
+ ```bash
427
+ # Verify paths exist before upload
428
+ - name: Upload artifacts
429
+ run: |
430
+ ls -la dist/ # Debug: check files exist
431
+ test -d dist || (echo "dist/ not found!" && exit 1)
432
+
433
+ - uses: actions/upload-artifact@v4
434
+ with:
435
+ name: build
436
+ path: dist/
437
+ ```
438
+
439
+ ---
440
+
441
+ ## 🎯 Quick Reference: Common Commands
442
+
443
+ ### Workflow Management
444
+
445
+ ```bash
446
+ # List all workflows
447
+ gh workflow list
448
+
449
+ # View specific workflow
450
+ gh workflow view ci.yml
451
+
452
+ # Manually trigger workflow
453
+ gh workflow run ci.yml
454
+
455
+ # View recent runs
456
+ gh run list -w ci.yml -L 10
457
+
458
+ # Watch live run
459
+ gh run watch
460
+
461
+ # Cancel running workflow
462
+ gh run cancel <run-id>
463
+
464
+ # Re-run failed jobs
465
+ gh run rerun <run-id> --failed
466
+ ```
467
+
468
+ ### Debugging
469
+
470
+ ```bash
471
+ # View workflow logs
472
+ gh run view <run-id> --log
473
+
474
+ # View failed steps only
475
+ gh run view <run-id> --log-failed
476
+
477
+ # Download artifacts
478
+ gh run download <run-id>
479
+
480
+ # View job details
481
+ gh run view <run-id> --job=<job-id>
482
+ ```
483
+
484
+ ### Validation
485
+
486
+ ```bash
487
+ # Lint all workflows
488
+ actionlint .github/workflows/*.yml
489
+
490
+ # Check for syntax errors
491
+ yamllint .github/workflows/*.yml
492
+
493
+ # Test locally with act
494
+ act pull_request -W .github/workflows/ci.yml
495
+ ```
496
+
497
+ ---
498
+
499
+ ## 📝 Checklist: Phase 1 Implementation
500
+
501
+ ```markdown
502
+ ### Pre-Implementation
503
+ - [ ] Read full optimization strategy document
504
+ - [ ] Create backup branch: `git branch workflow-backup`
505
+ - [ ] Document current failure rates
506
+ - [ ] Get team approval for changes
507
+
508
+ ### Implementation
509
+ - [ ] Delete fake integration tests (integration-tests.yml)
510
+ - [ ] Create real integration test workflow
511
+ - [ ] Test new integration workflow locally
512
+ - [ ] Delete rollback-manager.yml
513
+ - [ ] Create ci-failure-notify.yml
514
+ - [ ] Test notification workflow
515
+ - [ ] Delete duplicate test.yml
516
+ - [ ] Update branch protection rules if needed
517
+
518
+ ### Validation
519
+ - [ ] All workflows pass syntax check
520
+ - [ ] New integration tests run successfully
521
+ - [ ] Notification workflow triggers correctly
522
+ - [ ] No duplicate workflows remain
523
+ - [ ] CI success rate improves
524
+
525
+ ### Documentation
526
+ - [ ] Update README if needed
527
+ - [ ] Document new workflow structure
528
+ - [ ] Share results with team
529
+ ```
530
+
531
+ ---
532
+
533
+ ## 📚 Additional Resources
534
+
535
+ ### Related Documentation
536
+ - Main Strategy: `docs/architecture/github-workflows-optimization-strategy.md`
537
+ - GitHub Actions Docs: https://docs.github.com/en/actions
538
+ - actionlint: https://github.com/rhysd/actionlint
539
+ - act (local runner): https://github.com/nektos/act
540
+
541
+ ### Internal References
542
+ - CI/CD Best Practices: `docs/development/ci-cd-best-practices.md` (to be created)
543
+ - Testing Strategy: `docs/testing/integration-tests.md` (to be created)
544
+
545
+ ---
546
+
547
+ ## 🤝 Getting Help
548
+
549
+ ### If You Get Stuck
550
+
551
+ 1. **Check workflow logs:**
552
+ ```bash
553
+ gh run view --log-failed
554
+ ```
555
+
556
+ 2. **Ask in team chat:**
557
+ ```
558
+ "Need help with workflow optimization Phase 1.
559
+ Issue: [describe issue]
560
+ Logs: [paste relevant logs]"
561
+ ```
562
+
563
+ 3. **Review this guide:**
564
+ - Re-read the relevant section
565
+ - Check troubleshooting tips
566
+ - Verify commands are correct
567
+
568
+ 4. **Roll back if needed:**
569
+ ```bash
570
+ git checkout workflow-backup
571
+ git checkout -b rollback-phase1
572
+ git push origin rollback-phase1
573
+ ```
574
+
575
+ ---
576
+
577
+ ## ✅ Success! You've Completed Phase 1 When...
578
+
579
+ - ✅ Integration tests use real CLI commands
580
+ - ✅ No fake/simulated test data
581
+ - ✅ No automated force pushes to main
582
+ - ✅ CI failures create issues instead of auto-rollback
583
+ - ✅ Only ONE test workflow exists
584
+ - ✅ Workflows are simpler and clearer
585
+ - ✅ CI runs complete successfully
586
+ - ✅ Team understands new structure
587
+
588
+ **Next:** Proceed to Phase 2 (Consolidation) after Phase 1 runs stably for 3-5 days.
589
+
590
+ ---
591
+
592
+ **Last Updated:** 2025-11-24
593
+ **Document Version:** 1.0