claude-flow-novice 2.14.3 → 2.14.4

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 (162) hide show
  1. package/.claude/commands/CFN_LOOP_TASK_MODE.md +4 -47
  2. package/.claude/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -276
  3. package/claude-assets/commands/CFN_LOOP_TASK_MODE.md +4 -47
  4. package/claude-assets/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +0 -276
  5. package/dist/agents/agent-loader.js +165 -146
  6. package/dist/agents/agent-loader.js.map +1 -1
  7. package/dist/cli/agent-prompt-builder.js +25 -0
  8. package/dist/cli/agent-prompt-builder.js.map +1 -1
  9. package/dist/cli/config-manager.js +91 -109
  10. package/package.json +1 -1
  11. package/.claude/skills/cfn-redis-coordination/HEARTBEAT.md +0 -57
  12. package/.claude/skills/cfn-redis-coordination/HEARTBEAT_MONITORING.md +0 -267
  13. package/.claude/skills/cfn-redis-coordination/LOGGING.md +0 -260
  14. package/.claude/skills/cfn-redis-coordination/README.md +0 -65
  15. package/.claude/skills/cfn-redis-coordination/SECURITY_REVIEW.md +0 -25
  16. package/.claude/skills/cfn-redis-coordination/SHUTDOWN_HANDLING.md +0 -164
  17. package/.claude/skills/cfn-redis-coordination/SKILL.md +0 -720
  18. package/.claude/skills/cfn-redis-coordination/demos/test-dlq.sh +0 -129
  19. package/.claude/skills/cfn-redis-coordination/demos/test-iteration-feedback.sh +0 -320
  20. package/.claude/skills/cfn-redis-coordination/demos/test-orchestrator.sh +0 -249
  21. package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4-unix.sh +0 -148
  22. package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4.sh +0 -163
  23. package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake.sh +0 -138
  24. package/.claude/skills/cfn-redis-coordination/demos/test-quick-fix.sh +0 -81
  25. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-absolute.sh +0 -45
  26. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-fallback.sh +0 -68
  27. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-percentage.sh +0 -56
  28. package/.claude/skills/cfn-redis-coordination/demos/test-quorum-with-retry.sh +0 -81
  29. package/.claude/skills/cfn-redis-coordination/demos/test-quorum.sh +0 -57
  30. package/.claude/skills/cfn-redis-coordination/demos/test-shutdown-handling.sh +0 -187
  31. package/.claude/skills/cfn-redis-coordination/demos/test-shutdown.sh +0 -160
  32. package/.claude/skills/cfn-redis-coordination/demos/test-utils-unix.sh +0 -97
  33. package/.claude/skills/cfn-redis-coordination/demos/test-utils.sh +0 -97
  34. package/.claude/skills/cfn-redis-coordination/demos/test-waiting-mode.sh +0 -59
  35. package/.claude/skills/cfn-redis-coordination/examples/README.md +0 -73
  36. package/.claude/skills/cfn-redis-coordination/examples/grafana-dashboard.json +0 -352
  37. package/.claude/skills/cfn-redis-coordination/examples/hierarchical-pattern.sh +0 -127
  38. package/.claude/skills/cfn-redis-coordination/examples/mesh-pattern.sh +0 -171
  39. package/.claude/skills/cfn-redis-coordination/examples/timeout-handling.sh +0 -227
  40. package/.claude/skills/cfn-redis-coordination/examples/waiting-mode-pattern.sh +0 -239
  41. package/.claude/skills/cfn-redis-coordination/execute-product-owner-decision.sh +0 -258
  42. package/.claude/skills/cfn-redis-coordination/get-agent-timeout.sh +0 -177
  43. package/.claude/skills/cfn-redis-coordination/heartbeat-functions.sh +0 -137
  44. package/.claude/skills/cfn-redis-coordination/heartbeat-protocol.md +0 -106
  45. package/.claude/skills/cfn-redis-coordination/heartbeat.sh +0 -126
  46. package/.claude/skills/cfn-redis-coordination/init-swarm.sh +0 -148
  47. package/.claude/skills/cfn-redis-coordination/invoke-redis-pattern.sh +0 -220
  48. package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +0 -283
  49. package/.claude/skills/cfn-redis-coordination/list-active-swarms.sh +0 -147
  50. package/.claude/skills/cfn-redis-coordination/log-event.sh +0 -109
  51. package/.claude/skills/cfn-redis-coordination/metrics-export.sh +0 -674
  52. package/.claude/skills/cfn-redis-coordination/metrics-schema.json +0 -66
  53. package/.claude/skills/cfn-redis-coordination/metrics-storage.md +0 -31
  54. package/.claude/skills/cfn-redis-coordination/monitor-cfn-violations.sh +0 -391
  55. package/.claude/skills/cfn-redis-coordination/monitor-heartbeats.sh +0 -101
  56. package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop-v3.sh +0 -141
  57. package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh +0 -31
  58. package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.bak +0 -0
  59. package/.claude/skills/cfn-redis-coordination/priority-wake-mechanism.md +0 -75
  60. package/.claude/skills/cfn-redis-coordination/priority_wake.py +0 -134
  61. package/.claude/skills/cfn-redis-coordination/query-dlq.sh +0 -162
  62. package/.claude/skills/cfn-redis-coordination/query-logs.sh +0 -103
  63. package/.claude/skills/cfn-redis-coordination/redis-pattern.sh +0 -619
  64. package/.claude/skills/cfn-redis-coordination/retrieve-context.sh +0 -58
  65. package/.claude/skills/cfn-redis-coordination/select-specialist-agent.sh +0 -371
  66. package/.claude/skills/cfn-redis-coordination/semantic-match-tfidf.py +0 -252
  67. package/.claude/skills/cfn-redis-coordination/send-heartbeat.sh +0 -165
  68. package/.claude/skills/cfn-redis-coordination/signal.sh +0 -38
  69. package/.claude/skills/cfn-redis-coordination/store-context.sh +0 -86
  70. package/.claude/skills/cfn-redis-coordination/store-epic-context.sh +0 -123
  71. package/.claude/skills/cfn-redis-coordination/test-context-injection.sh +0 -354
  72. package/.claude/skills/cfn-redis-coordination/test-timeout-enforcement.sh +0 -513
  73. package/.claude/skills/cfn-redis-coordination/tests/convert-line-endings.sh +0 -15
  74. package/.claude/skills/cfn-redis-coordination/tests/dlq-functionality-test.sh +0 -102
  75. package/.claude/skills/cfn-redis-coordination/tests/edge-cases-test.sh +0 -99
  76. package/.claude/skills/cfn-redis-coordination/tests/integration-test.sh +0 -170
  77. package/.claude/skills/cfn-redis-coordination/tests/retry-mechanism-test.sh +0 -82
  78. package/.claude/skills/cfn-redis-coordination/tests/run-test-suite.sh +0 -92
  79. package/.claude/skills/cfn-redis-coordination/tests/run-tests.sh +0 -4
  80. package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-monitoring.sh +0 -418
  81. package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-simple.sh +0 -124
  82. package/.claude/skills/cfn-redis-coordination/tests/test-primitives.sh +0 -166
  83. package/.claude/skills/cfn-redis-coordination/tests/test-utils.sh +0 -54
  84. package/.claude/skills/cfn-redis-coordination/tests/test_utils.sh +0 -49
  85. package/.claude/skills/cfn-redis-coordination/v2_modularization/core_orchestration.sh +0 -76
  86. package/.claude/skills/cfn-redis-coordination/validate-parameters.sh +0 -492
  87. package/claude-assets/skills/cfn-redis-coordination/HEARTBEAT.md +0 -57
  88. package/claude-assets/skills/cfn-redis-coordination/HEARTBEAT_MONITORING.md +0 -267
  89. package/claude-assets/skills/cfn-redis-coordination/LOGGING.md +0 -260
  90. package/claude-assets/skills/cfn-redis-coordination/README.md +0 -65
  91. package/claude-assets/skills/cfn-redis-coordination/SECURITY_REVIEW.md +0 -25
  92. package/claude-assets/skills/cfn-redis-coordination/SHUTDOWN_HANDLING.md +0 -164
  93. package/claude-assets/skills/cfn-redis-coordination/SKILL.md +0 -720
  94. package/claude-assets/skills/cfn-redis-coordination/demos/test-dlq.sh +0 -129
  95. package/claude-assets/skills/cfn-redis-coordination/demos/test-iteration-feedback.sh +0 -320
  96. package/claude-assets/skills/cfn-redis-coordination/demos/test-orchestrator.sh +0 -249
  97. package/claude-assets/skills/cfn-redis-coordination/demos/test-priority-wake-phase4-unix.sh +0 -148
  98. package/claude-assets/skills/cfn-redis-coordination/demos/test-priority-wake-phase4.sh +0 -163
  99. package/claude-assets/skills/cfn-redis-coordination/demos/test-priority-wake.sh +0 -138
  100. package/claude-assets/skills/cfn-redis-coordination/demos/test-quick-fix.sh +0 -81
  101. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-absolute.sh +0 -45
  102. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-fallback.sh +0 -68
  103. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-percentage.sh +0 -56
  104. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum-with-retry.sh +0 -81
  105. package/claude-assets/skills/cfn-redis-coordination/demos/test-quorum.sh +0 -57
  106. package/claude-assets/skills/cfn-redis-coordination/demos/test-shutdown-handling.sh +0 -187
  107. package/claude-assets/skills/cfn-redis-coordination/demos/test-shutdown.sh +0 -160
  108. package/claude-assets/skills/cfn-redis-coordination/demos/test-utils-unix.sh +0 -97
  109. package/claude-assets/skills/cfn-redis-coordination/demos/test-utils.sh +0 -97
  110. package/claude-assets/skills/cfn-redis-coordination/demos/test-waiting-mode.sh +0 -59
  111. package/claude-assets/skills/cfn-redis-coordination/examples/README.md +0 -73
  112. package/claude-assets/skills/cfn-redis-coordination/examples/grafana-dashboard.json +0 -352
  113. package/claude-assets/skills/cfn-redis-coordination/examples/hierarchical-pattern.sh +0 -127
  114. package/claude-assets/skills/cfn-redis-coordination/examples/mesh-pattern.sh +0 -171
  115. package/claude-assets/skills/cfn-redis-coordination/examples/timeout-handling.sh +0 -227
  116. package/claude-assets/skills/cfn-redis-coordination/examples/waiting-mode-pattern.sh +0 -239
  117. package/claude-assets/skills/cfn-redis-coordination/execute-product-owner-decision.sh +0 -258
  118. package/claude-assets/skills/cfn-redis-coordination/get-agent-timeout.sh +0 -177
  119. package/claude-assets/skills/cfn-redis-coordination/heartbeat-functions.sh +0 -137
  120. package/claude-assets/skills/cfn-redis-coordination/heartbeat-protocol.md +0 -106
  121. package/claude-assets/skills/cfn-redis-coordination/heartbeat.sh +0 -126
  122. package/claude-assets/skills/cfn-redis-coordination/init-swarm.sh +0 -148
  123. package/claude-assets/skills/cfn-redis-coordination/invoke-redis-pattern.sh +0 -220
  124. package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +0 -283
  125. package/claude-assets/skills/cfn-redis-coordination/list-active-swarms.sh +0 -147
  126. package/claude-assets/skills/cfn-redis-coordination/log-event.sh +0 -109
  127. package/claude-assets/skills/cfn-redis-coordination/metrics-export.sh +0 -674
  128. package/claude-assets/skills/cfn-redis-coordination/metrics-schema.json +0 -66
  129. package/claude-assets/skills/cfn-redis-coordination/metrics-storage.md +0 -31
  130. package/claude-assets/skills/cfn-redis-coordination/monitor-cfn-violations.sh +0 -391
  131. package/claude-assets/skills/cfn-redis-coordination/monitor-heartbeats.sh +0 -101
  132. package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop-v3.sh +0 -141
  133. package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh +0 -31
  134. package/claude-assets/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.bak +0 -0
  135. package/claude-assets/skills/cfn-redis-coordination/priority-wake-mechanism.md +0 -75
  136. package/claude-assets/skills/cfn-redis-coordination/priority_wake.py +0 -134
  137. package/claude-assets/skills/cfn-redis-coordination/query-dlq.sh +0 -162
  138. package/claude-assets/skills/cfn-redis-coordination/query-logs.sh +0 -103
  139. package/claude-assets/skills/cfn-redis-coordination/redis-pattern.sh +0 -619
  140. package/claude-assets/skills/cfn-redis-coordination/retrieve-context.sh +0 -58
  141. package/claude-assets/skills/cfn-redis-coordination/select-specialist-agent.sh +0 -371
  142. package/claude-assets/skills/cfn-redis-coordination/semantic-match-tfidf.py +0 -252
  143. package/claude-assets/skills/cfn-redis-coordination/send-heartbeat.sh +0 -165
  144. package/claude-assets/skills/cfn-redis-coordination/signal.sh +0 -38
  145. package/claude-assets/skills/cfn-redis-coordination/store-context.sh +0 -86
  146. package/claude-assets/skills/cfn-redis-coordination/store-epic-context.sh +0 -123
  147. package/claude-assets/skills/cfn-redis-coordination/test-context-injection.sh +0 -354
  148. package/claude-assets/skills/cfn-redis-coordination/test-timeout-enforcement.sh +0 -513
  149. package/claude-assets/skills/cfn-redis-coordination/tests/convert-line-endings.sh +0 -15
  150. package/claude-assets/skills/cfn-redis-coordination/tests/dlq-functionality-test.sh +0 -102
  151. package/claude-assets/skills/cfn-redis-coordination/tests/edge-cases-test.sh +0 -99
  152. package/claude-assets/skills/cfn-redis-coordination/tests/integration-test.sh +0 -170
  153. package/claude-assets/skills/cfn-redis-coordination/tests/retry-mechanism-test.sh +0 -82
  154. package/claude-assets/skills/cfn-redis-coordination/tests/run-test-suite.sh +0 -92
  155. package/claude-assets/skills/cfn-redis-coordination/tests/run-tests.sh +0 -4
  156. package/claude-assets/skills/cfn-redis-coordination/tests/test-heartbeat-monitoring.sh +0 -418
  157. package/claude-assets/skills/cfn-redis-coordination/tests/test-heartbeat-simple.sh +0 -124
  158. package/claude-assets/skills/cfn-redis-coordination/tests/test-primitives.sh +0 -166
  159. package/claude-assets/skills/cfn-redis-coordination/tests/test-utils.sh +0 -54
  160. package/claude-assets/skills/cfn-redis-coordination/tests/test_utils.sh +0 -49
  161. package/claude-assets/skills/cfn-redis-coordination/v2_modularization/core_orchestration.sh +0 -76
  162. package/claude-assets/skills/cfn-redis-coordination/validate-parameters.sh +0 -492
@@ -1,99 +0,0 @@
1
- #!/bin/bash
2
- # Edge Cases Test Suite
3
- # Validates complex and concurrent scenarios for error recovery
4
-
5
- set -euo pipefail
6
-
7
- # Source common test utilities
8
- source "$(dirname "$0")/test-utils.sh"
9
-
10
- # Redis connection failure simulation
11
- test_redis_connection_failure() {
12
- local original_redis_host=$(redis-cli config get bind | tail -n 1)
13
-
14
- # Simulate connection failure by setting invalid host
15
- redis-cli config set bind "invalid-host"
16
-
17
- set +e # Disable immediate exit on error
18
- ./.claude/skills/cfn-redis-coordination/retry-mechanism.sh \
19
- --task-id "connection-failure-test" \
20
- --max-retries 3 2>/dev/null
21
- local exit_code=$?
22
- set -e
23
-
24
- # Restore original Redis host
25
- redis-cli config set bind "$original_redis_host"
26
-
27
- # Check that retry mechanism handles connection failure
28
- assert "[ $exit_code -ne 0 ]" "Connection failure not handled correctly"
29
- }
30
-
31
- # Concurrent DLQ writes test
32
- test_concurrent_dlq_writes() {
33
- local concurrent_tasks=10
34
- local base_task_id="concurrent-dlq-$(date +%s)"
35
-
36
- # Run concurrent DLQ writes
37
- for ((i=1; i<=concurrent_tasks; i++)); do
38
- (
39
- ./.claude/skills/cfn-redis-coordination/write-to-dlq.sh \
40
- --task-id "${base_task_id}-$i" \
41
- --agent-id "concurrent-tester" \
42
- --error '{"code": 500, "message": "Concurrent Test"}' &
43
- )
44
- done
45
-
46
- # Wait for all background processes
47
- wait
48
-
49
- # Verify all entries were written
50
- local query_result=$(./.claude/skills/cfn-redis-coordination/query-dlq.sh \
51
- --agent-id "concurrent-tester")
52
-
53
- assert "[ $(echo '$query_result' | grep -c "$base_task_id") -eq $concurrent_tasks ]" "Not all concurrent DLQ writes successful"
54
- }
55
-
56
- # Invalid agent ID handling
57
- test_invalid_agent_id() {
58
- set +e # Disable immediate exit on error
59
- local result=$(./.claude/skills/cfn-redis-coordination/query-dlq.sh \
60
- --agent-id "!@#$%^&*()-invalid-agent" 2>&1)
61
- local exit_code=$?
62
- set -e
63
-
64
- assert "[ $exit_code -ne 0 ]" "Invalid agent ID not rejected"
65
- assert_contains "$result" "Invalid agent ID" "Error message missing for invalid agent ID"
66
- }
67
-
68
- # TTL expiration edge cases
69
- test_ttl_expiration_edge_cases() {
70
- local task_id="ttl-edge-$(date +%s)"
71
- local short_ttl=60 # 1 minute
72
-
73
- # Write with extremely short TTL
74
- ./.claude/skills/cfn-redis-coordination/write-to-dlq.sh \
75
- --task-id "$task_id" \
76
- --agent-id "ttl-edge-tester" \
77
- --error '{"code": 999, "message": "TTL Edge Case"}' \
78
- --ttl "$short_ttl"
79
-
80
- # Wait slightly beyond TTL
81
- sleep $((short_ttl + 5))
82
-
83
- # Verify entry is automatically removed
84
- local query_result=$(./.claude/skills/cfn-redis-coordination/query-dlq.sh \
85
- --task-id "$task_id")
86
-
87
- assert_empty "$query_result" "DLQ entry not automatically expired"
88
- }
89
-
90
- # Run tests
91
- main() {
92
- test_redis_connection_failure
93
- test_concurrent_dlq_writes
94
- test_invalid_agent_id
95
- test_ttl_expiration_edge_cases
96
- echo "Edge Cases Tests: PASSED"
97
- }
98
-
99
- main
@@ -1,170 +0,0 @@
1
- #!/bin/bash
2
- # Integration Test Suite
3
- # Validates full CFN Loop retry and DLQ mechanisms
4
-
5
- set -euo pipefail
6
-
7
- # Source test utilities
8
- source "$(dirname "$0")/test-utils.sh"
9
-
10
- # Simulate a CFN Loop with potential failures
11
- test_cfn_loop_retry_integration() {
12
- local task_id="integration-test-$(date +%s)"
13
- local agent_ids=("researcher" "backend-dev" "devops")
14
- local failed_stages=()
15
-
16
- # Mock agent with potential failure
17
- mock_agent_with_retry() {
18
- local agent_id="$1"
19
- local stage="$2"
20
-
21
- # Simulate potential failures
22
- local failure_probability=0.3 # 30% chance of failure
23
- local random_value=$(shuf -i 1-10 -n 1)
24
-
25
- if [ $random_value -le 3 ]; then
26
- echo "Agent $agent_id failed at stage $stage"
27
- failed_stages+=("$stage")
28
- return 1
29
- fi
30
- return 0
31
- }
32
-
33
- # Run mock CFN Loop
34
- local max_iterations=5
35
- for ((iteration=1; iteration<=max_iterations; iteration++)); do
36
- echo "CFN Loop Iteration $iteration"
37
-
38
- for agent_id in "${agent_ids[@]}"; do
39
- if ! mock_agent_with_retry "$agent_id" "iteration-$iteration"; then
40
- # Retry mechanism
41
- ./.claude/skills/cfn-redis-coordination/retry-mechanism.sh \
42
- --task-id "$task_id" \
43
- --agent-id "$agent_id" \
44
- --max-retries 3
45
- fi
46
-
47
- # Signal agent completion
48
- redis-cli lpush "swarm:$task_id:$agent_id:done" "complete"
49
- done
50
-
51
- # Check consensus
52
- local consensus_result=$(./.claude/skills/cfn-redis-coordination/check-consensus.sh \
53
- --task-id "$task_id" \
54
- --min-confidence 0.85)
55
-
56
- if [ "$consensus_result" == "success" ]; then
57
- break
58
- fi
59
- done
60
-
61
- # Validate test results
62
- assert_not_empty "$consensus_result" "No consensus reached"
63
-
64
- # Check if any agents had to be retried
65
- if [ ${#failed_stages[@]} -gt 0 ]; then
66
- echo "Stages with failures: ${failed_stages[@]}"
67
- fi
68
- }
69
-
70
- # Test DLQ capture during orchestration
71
- test_dlq_capture_during_orchestration() {
72
- local task_id="dlq-capture-$(date +%s)"
73
- local agent_id="critical-agent"
74
- local error_scenarios=(
75
- "connection_timeout"
76
- "invalid_configuration"
77
- "resource_exhaustion"
78
- )
79
-
80
- for scenario in "${error_scenarios[@]}"; do
81
- # Simulate orchestration failure
82
- local result=$(
83
- ./.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh \
84
- --task-id "$task_id" \
85
- --agent-id "$agent_id" \
86
- --error-scenario "$scenario" 2>&1
87
- )
88
-
89
- # Check if DLQ write occurred
90
- local dlq_entry=$(./.claude/skills/cfn-redis-coordination/query-dlq.sh \
91
- --task-id "$task_id")
92
-
93
- assert_not_empty "$dlq_entry" "DLQ not captured for $scenario"
94
- assert_contains "$dlq_entry" "$scenario" "Scenario details missing in DLQ"
95
- done
96
- }
97
-
98
- # Config loading test
99
- test_config_loading() {
100
- local config_variations=(
101
- "/tmp/full-config.json"
102
- "/tmp/minimal-config.json"
103
- "/tmp/override-config.json"
104
- )
105
-
106
- for config_path in "${config_variations[@]}"; do
107
- # Generate test configurations
108
- case "$config_path" in
109
- "/tmp/full-config.json")
110
- cat > "$config_path" << EOF
111
- {
112
- "retry_max_attempts": 5,
113
- "backoff_base": 2,
114
- "dlq_ttl_days": 7,
115
- "log_level": "debug"
116
- }
117
- EOF
118
- ;;
119
- "/tmp/minimal-config.json")
120
- cat > "$config_path" << EOF
121
- {
122
- "retry_max_attempts": 3
123
- }
124
- EOF
125
- ;;
126
- "/tmp/override-config.json")
127
- cat > "$config_path" << EOF
128
- {
129
- "retry_max_attempts": 10,
130
- "feature_flags": {
131
- "advanced_retry": true,
132
- "dlq_monitoring": true
133
- }
134
- }
135
- EOF
136
- ;;
137
- esac
138
-
139
- # Test config loading
140
- local result=$(./.claude/skills/cfn-redis-coordination/load-config.sh \
141
- --config "$config_path")
142
-
143
- assert_not_empty "$result" "Config loading failed for $config_path"
144
- done
145
- }
146
-
147
- # Run integration tests
148
- main() {
149
- local passed=0
150
- local total_tests=3
151
- local tests=(
152
- "test_cfn_loop_retry_integration"
153
- "test_dlq_capture_during_orchestration"
154
- "test_config_loading"
155
- )
156
-
157
- for test in "${tests[@]}"; do
158
- if $test; then
159
- ((passed++))
160
- fi
161
- done
162
-
163
- # Compute and report confidence
164
- report_test_results "redis-phase1-1760875302" "tester-1" "$passed" "$total_tests"
165
-
166
- # Return pass/fail
167
- [ $passed -eq $total_tests ]
168
- }
169
-
170
- main
@@ -1,82 +0,0 @@
1
- #!/bin/bash
2
- # Retry Mechanism Test Suite
3
- # Validates retry logic, backoff, and timeout behavior
4
-
5
- set -euo pipefail
6
-
7
- # Source common test utilities
8
- source "$(dirname "$0")/test-utils.sh"
9
-
10
- # Test retry mechanism with different retry counts
11
- test_retry_mechanism() {
12
- local retry_counts=(0 1 3 5)
13
- local base_backoff=2 # Base backoff in seconds
14
-
15
- for retries in "${retry_counts[@]}"; do
16
- echo "Testing retry mechanism with $retries retries"
17
-
18
- # Simulated failure function
19
- mock_failed_operation() {
20
- local attempt=1
21
- local max_attempts=$((retries + 1))
22
-
23
- while [ $attempt -le $max_attempts ]; do
24
- if [ $attempt -eq $max_attempts ]; then
25
- echo "Final attempt failed"
26
- return 1
27
- fi
28
-
29
- # Simulate failure
30
- echo "Attempt $attempt failed, will retry"
31
- sleep $((base_backoff ** attempt))
32
- ((attempt++))
33
- done
34
- }
35
-
36
- # Capture timing and retry logs
37
- local start_time=$(date +%s)
38
- local log_file="/tmp/retry-test-$retries.log"
39
-
40
- if ! mock_failed_operation 2>"$log_file"; then
41
- local end_time=$(date +%s)
42
- local total_time=$((end_time - start_time))
43
-
44
- # Validate retry count and timing
45
- local actual_retries=$(($(grep -c "Attempt" "$log_file") - 1))
46
- assert_equal "$actual_retries" "$retries" "Retry count mismatch for $retries retries"
47
-
48
- # Validate exponential backoff (roughly)
49
- local expected_max_wait=$((base_backoff ** (retries + 1)))
50
- assert "[ $total_time -le $((expected_max_wait + 5)) ]" "Backoff timing incorrect"
51
- else
52
- fail "Operation should have failed after $retries retries"
53
- fi
54
-
55
- # Clean up log
56
- rm "$log_file"
57
- done
58
- }
59
-
60
- # Test timeout behavior
61
- test_timeout_behavior() {
62
- local timeout_duration=10 # 10 seconds
63
- local long_running_operation() {
64
- sleep 15 # Longer than timeout
65
- }
66
-
67
- local start_time=$(date +%s)
68
- timeout $timeout_duration long_running_operation || true
69
- local end_time=$(date +%s)
70
-
71
- local total_time=$((end_time - start_time))
72
- assert "[ $total_time -ge $timeout_duration ] && [ $total_time -le $((timeout_duration + 2)) ]" "Timeout not enforced correctly"
73
- }
74
-
75
- # Run tests
76
- main() {
77
- test_retry_mechanism
78
- test_timeout_behavior
79
- echo "Retry Mechanism Tests: PASSED"
80
- }
81
-
82
- main
@@ -1,92 +0,0 @@
1
- #!/bin/bash
2
- # Master Test Runner for Redis Phase 1 Error Recovery & Resilience
3
-
4
- set -euo pipefail
5
-
6
- # Source test utilities
7
- source "$(dirname "$0")/test-utils.sh"
8
-
9
- # Test suites to run
10
- test_suites=(
11
- "./retry-mechanism-test.sh"
12
- "./dlq-functionality-test.sh"
13
- "./edge-cases-test.sh"
14
- "./integration-test.sh"
15
- )
16
-
17
- # Global tracking
18
- total_tests=0
19
- passed_tests=0
20
- failed_test_suites=()
21
-
22
- # Run individual test suite
23
- run_test_suite() {
24
- local suite_path="$1"
25
- local suite_name=$(basename "$suite_path")
26
-
27
- echo "Running test suite: $suite_name"
28
-
29
- set +e # Disable immediate exit on error
30
- "$suite_path"
31
- local exit_code=$?
32
- set -e
33
-
34
- if [ $exit_code -eq 0 ]; then
35
- ((passed_tests++))
36
- echo "✅ $suite_name: PASSED"
37
- else
38
- failed_test_suites+=("$suite_name")
39
- echo "❌ $suite_name: FAILED"
40
- fi
41
-
42
- ((total_tests++))
43
- }
44
-
45
- # Main execution
46
- main() {
47
- echo "Starting Redis Phase 1 Error Recovery & Resilience Test Suite"
48
-
49
- # Run all test suites
50
- for suite in "${test_suites[@]}"; do
51
- chmod +x "$suite"
52
- run_test_suite "$suite"
53
- done
54
-
55
- # Calculate confidence
56
- local confidence=$(compute_confidence_score "$passed_tests" "$total_tests")
57
-
58
- # Report results
59
- echo -e "\n--- Test Suite Summary ---"
60
- echo "Total Test Suites: $total_tests"
61
- echo "Passed: $passed_tests"
62
- echo "Failed: $((total_tests - passed_tests))"
63
- echo "Confidence Score: $confidence"
64
-
65
- if [ ${#failed_test_suites[@]} -gt 0 ]; then
66
- echo -e "\nFailed Test Suites:"
67
- for failed_suite in "${failed_test_suites[@]}"; do
68
- echo " - $failed_suite"
69
- done
70
- fi
71
-
72
- # CFN Loop reporting
73
- ./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh report \
74
- --task-id "redis-phase1-1760875302" \
75
- --agent-id "tester-1" \
76
- --confidence "$confidence" \
77
- --iteration 1
78
-
79
- # Signal test completion
80
- redis-cli lpush "swarm:redis-phase1-1760875302:tester-1:done" "complete"
81
-
82
- # Enter waiting mode
83
- ./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh enter \
84
- --task-id "redis-phase1-1760875302" \
85
- --agent-id "tester-1" \
86
- --context "phase1-testing-complete"
87
-
88
- # Ensure exit code reflects overall test success
89
- [ $passed_tests -eq $total_tests ]
90
- }
91
-
92
- main
@@ -1,4 +0,0 @@
1
- #!/bin/bash
2
-
3
- cd "$(dirname "$0")"
4
- bash test-primitives.sh