claude-flow-novice 2.15.1 → 2.15.3
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.
- package/.claude/cfn-extras/agents/google-sheets-specialist.md +614 -0
- package/.claude/commands/cfn/create-handoff.md +224 -0
- package/.claude/hooks/cfn-BACKUP_USAGE.md +243 -243
- package/.claude/hooks/cfn-invoke-security-validation.sh +69 -69
- package/.claude/hooks/cfn-post-edit-cfn-retrospective.sh +78 -78
- package/.claude/hooks/cfn-post-edit.config.json +44 -44
- package/.claude/skills/agent-lifecycle/SKILL.md +60 -0
- package/.claude/skills/agent-lifecycle/execute-lifecycle-hook.sh +573 -0
- package/.claude/skills/agent-lifecycle/simple-audit.sh +31 -0
- package/.claude/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
- package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/.claude/skills/cfn-redis-coordination/get-context.sh +112 -112
- package/.claude/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
- package/.claude/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
- package/.claude/skills/cfn-transparency-middleware/test-integration.sh +161 -161
- package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
- package/.claude/skills/cfn-transparency-middleware/tests/input-validation.sh +92 -92
- package/.claude/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +662 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +29 -0
- package/claude-assets/cfn-extras/agents/google-sheets-specialist.md +614 -0
- package/claude-assets/commands/cfn/create-handoff.md +224 -0
- package/claude-assets/hooks/cfn-BACKUP_USAGE.md +243 -243
- package/claude-assets/hooks/cfn-invoke-security-validation.sh +69 -69
- package/claude-assets/hooks/cfn-post-edit-cfn-retrospective.sh +78 -78
- package/claude-assets/hooks/cfn-post-edit.config.json +44 -44
- package/claude-assets/hooks/cfn-post-execution/memory-cleanup.sh +19 -19
- package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +19 -19
- package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +572 -572
- package/claude-assets/skills/agent-lifecycle/simple-audit.sh +30 -30
- package/claude-assets/skills/cfn-automatic-memory-persistence/persist-agent-output.sh +48 -48
- package/claude-assets/skills/cfn-automatic-memory-persistence/query-agent-history.sh +34 -34
- package/claude-assets/skills/cfn-deliverable-validation/confidence-calculator.sh +261 -261
- package/claude-assets/skills/cfn-expert-update/update-expert.sh +345 -345
- package/claude-assets/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
- package/claude-assets/skills/cfn-intervention-detector/detect-intervention.sh +110 -110
- package/claude-assets/skills/cfn-intervention-orchestrator/execute-intervention.sh +58 -58
- package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
- package/claude-assets/skills/cfn-loop2-output-processing/process-validator-output.sh +275 -275
- package/claude-assets/skills/cfn-memory-management/check-memory.sh +159 -159
- package/claude-assets/skills/cfn-memory-management/cleanup-memory.sh +196 -196
- package/claude-assets/skills/cfn-node-heap-sizer/task-mode-heap-limiter.sh +325 -325
- package/claude-assets/skills/cfn-playbook-auto-update/auto-update-playbook.sh +85 -85
- package/claude-assets/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/claude-assets/skills/cfn-redis-coordination/get-context.sh +112 -112
- package/claude-assets/skills/cfn-scope-simplifier/simplify-scope.sh +67 -67
- package/claude-assets/skills/cfn-specialist-injection/recommend-specialist.sh +56 -56
- package/claude-assets/skills/cfn-standardized-error-handling/capture-agent-error.sh +86 -86
- package/claude-assets/skills/cfn-standardized-error-handling/test-error-handling.sh +165 -165
- package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +264 -264
- package/claude-assets/skills/cfn-task-decomposition/task-decomposer.sh +278 -278
- package/claude-assets/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
- package/claude-assets/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
- package/claude-assets/skills/cfn-transparency-middleware/test-integration.sh +161 -161
- package/claude-assets/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
- package/claude-assets/skills/cfn-transparency-middleware/tests/input-validation.sh +92 -92
- package/claude-assets/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/claude-assets/skills/docker-build/SKILL.md +96 -203
- package/claude-assets/skills/docker-build/build.sh +73 -73
- package/claude-assets/skills/integration/agent-handoff.sh +494 -0
- package/claude-assets/skills/integration/file-operations.sh +414 -0
- package/claude-assets/skills/workflow-codification/APPROVAL_WORKFLOW.md +806 -0
- package/claude-assets/skills/workflow-codification/COST_TRACKING.md +637 -0
- package/claude-assets/skills/workflow-codification/EDGE_CASE_TRACKING.md +404 -0
- package/claude-assets/skills/workflow-codification/README_PHASE4.md +457 -0
- package/claude-assets/skills/workflow-codification/SKILL.md +110 -0
- package/claude-assets/skills/workflow-codification/analyze-patterns.sh +899 -0
- package/claude-assets/skills/workflow-codification/approval-workflow.sh +514 -0
- package/claude-assets/skills/workflow-codification/generate-skill-update.sh +525 -0
- package/claude-assets/skills/workflow-codification/review-skill.sh +643 -0
- package/claude-assets/skills/workflow-codification/templates/email-notification.txt +114 -0
- package/claude-assets/skills/workflow-codification/templates/slack-notification.md +85 -0
- package/claude-assets/skills/workflow-codification/test-integration.sh +281 -0
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh +445 -0
- package/claude-assets/skills/workflow-codification/track-edge-case.sh +323 -0
- package/dist/agents/agent-loader.js +165 -146
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/cli/config-manager.js +91 -109
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/integration/DatabaseHandoff.js +507 -0
- package/dist/integration/DatabaseHandoff.js.map +1 -0
- package/dist/integration/StandardAdapter.js +291 -0
- package/dist/integration/StandardAdapter.js.map +1 -0
- package/dist/lib/agent-output-parser.js +518 -0
- package/dist/lib/agent-output-parser.js.map +1 -0
- package/dist/lib/agent-output-validator.js +950 -0
- package/dist/lib/agent-output-validator.js.map +1 -0
- package/dist/lib/artifact-registry.js +443 -0
- package/dist/lib/artifact-registry.js.map +1 -0
- package/dist/lib/config-validator.js +687 -0
- package/dist/lib/config-validator.js.map +1 -0
- package/dist/types/agent-output.js +44 -0
- package/dist/types/agent-output.js.map +1 -0
- package/dist/types/config.js +28 -0
- package/dist/types/config.js.map +1 -0
- package/package.json +2 -1
- package/scripts/artifact-cleanup.sh +392 -0
- package/scripts/build-linux.sh +78 -0
- package/scripts/deploy-production.sh +355 -355
- package/scripts/docker-playwright-fix.sh +311 -311
- package/scripts/docker-rebuild-all-agents.sh +127 -127
- package/scripts/memory-leak-prevention.sh +305 -305
- package/scripts/migrate-artifacts.sh +563 -0
- package/scripts/migrate-yaml-to-json.sh +465 -0
- package/scripts/run-marketing-tests.sh +42 -42
- package/scripts/update_paths.sh +46 -46
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Retrieve CFN Loop task context from Redis
|
|
3
|
-
# Used by CLI-spawned agents to get structured context from orchestrator
|
|
4
|
-
#
|
|
5
|
-
# Usage:
|
|
6
|
-
# get-context.sh --task-id <id> [--namespace <ns>]
|
|
7
|
-
# get-context.sh --task-id <id> --key <key> [--namespace <ns>]
|
|
8
|
-
# get-context.sh <task_id> (legacy mode)
|
|
9
|
-
|
|
10
|
-
set -euo pipefail
|
|
11
|
-
|
|
12
|
-
# Initialize variables
|
|
13
|
-
TASK_ID=""
|
|
14
|
-
KEY=""
|
|
15
|
-
NAMESPACE="swarm"
|
|
16
|
-
FORMAT="json" # json or raw
|
|
17
|
-
|
|
18
|
-
# Parse arguments
|
|
19
|
-
while [[ $# -gt 0 ]]; do
|
|
20
|
-
case $1 in
|
|
21
|
-
--task-id)
|
|
22
|
-
TASK_ID="$2"
|
|
23
|
-
shift 2
|
|
24
|
-
;;
|
|
25
|
-
--key)
|
|
26
|
-
KEY="$2"
|
|
27
|
-
shift 2
|
|
28
|
-
;;
|
|
29
|
-
--namespace)
|
|
30
|
-
NAMESPACE="$2"
|
|
31
|
-
shift 2
|
|
32
|
-
;;
|
|
33
|
-
--format)
|
|
34
|
-
FORMAT="$2"
|
|
35
|
-
shift 2
|
|
36
|
-
;;
|
|
37
|
-
*)
|
|
38
|
-
# Legacy mode: positional argument
|
|
39
|
-
if [ -z "$TASK_ID" ]; then
|
|
40
|
-
TASK_ID="$1"
|
|
41
|
-
fi
|
|
42
|
-
shift
|
|
43
|
-
;;
|
|
44
|
-
esac
|
|
45
|
-
done
|
|
46
|
-
|
|
47
|
-
# Validate required arguments
|
|
48
|
-
if [ -z "$TASK_ID" ]; then
|
|
49
|
-
echo "Error: --task-id or TASK_ID required" >&2
|
|
50
|
-
echo "Usage: $0 --task-id <id> [--key <key>] [--namespace <ns>] [--format <json|raw>]" >&2
|
|
51
|
-
echo " or: $0 <task_id> (legacy)" >&2
|
|
52
|
-
exit 1
|
|
53
|
-
fi
|
|
54
|
-
|
|
55
|
-
REDIS_KEY="${NAMESPACE}:${TASK_ID}:context"
|
|
56
|
-
|
|
57
|
-
# Check if context exists
|
|
58
|
-
if ! redis-cli EXISTS "$REDIS_KEY" >/dev/null 2>&1; then
|
|
59
|
-
echo "⚠️ No context found for task: $TASK_ID" >&2
|
|
60
|
-
exit 1
|
|
61
|
-
fi
|
|
62
|
-
|
|
63
|
-
# Handle specific key retrieval
|
|
64
|
-
if [ -n "$KEY" ]; then
|
|
65
|
-
VALUE=$(redis-cli HGET "$REDIS_KEY" "$KEY" 2>/dev/null || echo "")
|
|
66
|
-
if [ -z "$VALUE" ]; then
|
|
67
|
-
echo "⚠️ Key '$KEY' not found in context for task: $TASK_ID" >&2
|
|
68
|
-
exit 1
|
|
69
|
-
fi
|
|
70
|
-
|
|
71
|
-
if [ "$FORMAT" = "raw" ]; then
|
|
72
|
-
echo "$VALUE"
|
|
73
|
-
else
|
|
74
|
-
echo "{\"$KEY\":$VALUE}"
|
|
75
|
-
fi
|
|
76
|
-
exit 0
|
|
77
|
-
fi
|
|
78
|
-
|
|
79
|
-
# Handle full context retrieval
|
|
80
|
-
ALL_FIELDS=$(redis-cli HGETALL "$REDIS_KEY" 2>/dev/null || echo "")
|
|
81
|
-
|
|
82
|
-
if [ -z "$ALL_FIELDS" ]; then
|
|
83
|
-
echo "⚠️ Empty context for task: $TASK_ID" >&2
|
|
84
|
-
exit 1
|
|
85
|
-
fi
|
|
86
|
-
|
|
87
|
-
# Format as JSON
|
|
88
|
-
if [ "$FORMAT" = "json" ]; then
|
|
89
|
-
echo "{"
|
|
90
|
-
first=true
|
|
91
|
-
while IFS= read -r field; do
|
|
92
|
-
if [ -z "$field" ]; then continue; fi
|
|
93
|
-
if [ "$first" = true ]; then
|
|
94
|
-
first=false
|
|
95
|
-
else
|
|
96
|
-
echo ","
|
|
97
|
-
fi
|
|
98
|
-
# Skip empty lines and properly format JSON values
|
|
99
|
-
if [[ $field =~ ^[0-9]+$ ]]; then
|
|
100
|
-
# Numeric value
|
|
101
|
-
echo -n " \"$field\": $(redis-cli HGET "$REDIS_KEY" "$field")"
|
|
102
|
-
else
|
|
103
|
-
# String value
|
|
104
|
-
value=$(redis-cli HGET "$REDIS_KEY" "$field" | sed 's/"/\\"/g')
|
|
105
|
-
echo -n " \"$field\": \"$value\""
|
|
106
|
-
fi
|
|
107
|
-
done <<< "$ALL_FIELDS"
|
|
108
|
-
echo ""
|
|
109
|
-
echo "}"
|
|
110
|
-
else
|
|
111
|
-
# Raw format
|
|
112
|
-
redis-cli HGETALL "$REDIS_KEY"
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Retrieve CFN Loop task context from Redis
|
|
3
|
+
# Used by CLI-spawned agents to get structured context from orchestrator
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# get-context.sh --task-id <id> [--namespace <ns>]
|
|
7
|
+
# get-context.sh --task-id <id> --key <key> [--namespace <ns>]
|
|
8
|
+
# get-context.sh <task_id> (legacy mode)
|
|
9
|
+
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
# Initialize variables
|
|
13
|
+
TASK_ID=""
|
|
14
|
+
KEY=""
|
|
15
|
+
NAMESPACE="swarm"
|
|
16
|
+
FORMAT="json" # json or raw
|
|
17
|
+
|
|
18
|
+
# Parse arguments
|
|
19
|
+
while [[ $# -gt 0 ]]; do
|
|
20
|
+
case $1 in
|
|
21
|
+
--task-id)
|
|
22
|
+
TASK_ID="$2"
|
|
23
|
+
shift 2
|
|
24
|
+
;;
|
|
25
|
+
--key)
|
|
26
|
+
KEY="$2"
|
|
27
|
+
shift 2
|
|
28
|
+
;;
|
|
29
|
+
--namespace)
|
|
30
|
+
NAMESPACE="$2"
|
|
31
|
+
shift 2
|
|
32
|
+
;;
|
|
33
|
+
--format)
|
|
34
|
+
FORMAT="$2"
|
|
35
|
+
shift 2
|
|
36
|
+
;;
|
|
37
|
+
*)
|
|
38
|
+
# Legacy mode: positional argument
|
|
39
|
+
if [ -z "$TASK_ID" ]; then
|
|
40
|
+
TASK_ID="$1"
|
|
41
|
+
fi
|
|
42
|
+
shift
|
|
43
|
+
;;
|
|
44
|
+
esac
|
|
45
|
+
done
|
|
46
|
+
|
|
47
|
+
# Validate required arguments
|
|
48
|
+
if [ -z "$TASK_ID" ]; then
|
|
49
|
+
echo "Error: --task-id or TASK_ID required" >&2
|
|
50
|
+
echo "Usage: $0 --task-id <id> [--key <key>] [--namespace <ns>] [--format <json|raw>]" >&2
|
|
51
|
+
echo " or: $0 <task_id> (legacy)" >&2
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
REDIS_KEY="${NAMESPACE}:${TASK_ID}:context"
|
|
56
|
+
|
|
57
|
+
# Check if context exists
|
|
58
|
+
if ! redis-cli EXISTS "$REDIS_KEY" >/dev/null 2>&1; then
|
|
59
|
+
echo "⚠️ No context found for task: $TASK_ID" >&2
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# Handle specific key retrieval
|
|
64
|
+
if [ -n "$KEY" ]; then
|
|
65
|
+
VALUE=$(redis-cli HGET "$REDIS_KEY" "$KEY" 2>/dev/null || echo "")
|
|
66
|
+
if [ -z "$VALUE" ]; then
|
|
67
|
+
echo "⚠️ Key '$KEY' not found in context for task: $TASK_ID" >&2
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
if [ "$FORMAT" = "raw" ]; then
|
|
72
|
+
echo "$VALUE"
|
|
73
|
+
else
|
|
74
|
+
echo "{\"$KEY\":$VALUE}"
|
|
75
|
+
fi
|
|
76
|
+
exit 0
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
# Handle full context retrieval
|
|
80
|
+
ALL_FIELDS=$(redis-cli HGETALL "$REDIS_KEY" 2>/dev/null || echo "")
|
|
81
|
+
|
|
82
|
+
if [ -z "$ALL_FIELDS" ]; then
|
|
83
|
+
echo "⚠️ Empty context for task: $TASK_ID" >&2
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# Format as JSON
|
|
88
|
+
if [ "$FORMAT" = "json" ]; then
|
|
89
|
+
echo "{"
|
|
90
|
+
first=true
|
|
91
|
+
while IFS= read -r field; do
|
|
92
|
+
if [ -z "$field" ]; then continue; fi
|
|
93
|
+
if [ "$first" = true ]; then
|
|
94
|
+
first=false
|
|
95
|
+
else
|
|
96
|
+
echo ","
|
|
97
|
+
fi
|
|
98
|
+
# Skip empty lines and properly format JSON values
|
|
99
|
+
if [[ $field =~ ^[0-9]+$ ]]; then
|
|
100
|
+
# Numeric value
|
|
101
|
+
echo -n " \"$field\": $(redis-cli HGET "$REDIS_KEY" "$field")"
|
|
102
|
+
else
|
|
103
|
+
# String value
|
|
104
|
+
value=$(redis-cli HGET "$REDIS_KEY" "$field" | sed 's/"/\\"/g')
|
|
105
|
+
echo -n " \"$field\": \"$value\""
|
|
106
|
+
fi
|
|
107
|
+
done <<< "$ALL_FIELDS"
|
|
108
|
+
echo ""
|
|
109
|
+
echo "}"
|
|
110
|
+
else
|
|
111
|
+
# Raw format
|
|
112
|
+
redis-cli HGETALL "$REDIS_KEY"
|
|
113
113
|
fi
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Transparency Middleware Configuration
|
|
4
|
-
# Version: 1.0.0
|
|
5
|
-
|
|
6
|
-
# Redis Configuration
|
|
7
|
-
export REDIS_HOST="${REDIS_HOST:-localhost}"
|
|
8
|
-
export REDIS_PORT="${REDIS_PORT:-6379}"
|
|
9
|
-
|
|
10
|
-
# Transparency Levels
|
|
11
|
-
TRANSPARENCY_LEVELS=(
|
|
12
|
-
"minimal" # Minimal logging, low overhead
|
|
13
|
-
"detailed" # Standard operational insights
|
|
14
|
-
"verbose" # Comprehensive logging
|
|
15
|
-
"debug" # Maximum verbosity and tracing
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
# Performance Thresholds
|
|
19
|
-
export MAX_OVERHEAD_PERCENTAGE=5
|
|
20
|
-
export MAX_MESSAGE_LATENCY_MS=50
|
|
21
|
-
export MAX_MEMORY_USAGE_MB=10
|
|
22
|
-
|
|
23
|
-
# Logging Configuration
|
|
24
|
-
export LOG_RETENTION_DAYS=7
|
|
25
|
-
export LOG_MAX_SIZE_MB=100
|
|
26
|
-
|
|
27
|
-
# Test-specific Configuration
|
|
28
|
-
export TEST_TIMEOUT_SECONDS=30
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Transparency Middleware Configuration
|
|
4
|
+
# Version: 1.0.0
|
|
5
|
+
|
|
6
|
+
# Redis Configuration
|
|
7
|
+
export REDIS_HOST="${REDIS_HOST:-localhost}"
|
|
8
|
+
export REDIS_PORT="${REDIS_PORT:-6379}"
|
|
9
|
+
|
|
10
|
+
# Transparency Levels
|
|
11
|
+
TRANSPARENCY_LEVELS=(
|
|
12
|
+
"minimal" # Minimal logging, low overhead
|
|
13
|
+
"detailed" # Standard operational insights
|
|
14
|
+
"verbose" # Comprehensive logging
|
|
15
|
+
"debug" # Maximum verbosity and tracing
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# Performance Thresholds
|
|
19
|
+
export MAX_OVERHEAD_PERCENTAGE=5
|
|
20
|
+
export MAX_MESSAGE_LATENCY_MS=50
|
|
21
|
+
export MAX_MEMORY_USAGE_MB=10
|
|
22
|
+
|
|
23
|
+
# Logging Configuration
|
|
24
|
+
export LOG_RETENTION_DAYS=7
|
|
25
|
+
export LOG_MAX_SIZE_MB=100
|
|
26
|
+
|
|
27
|
+
# Test-specific Configuration
|
|
28
|
+
export TEST_TIMEOUT_SECONDS=30
|
|
29
29
|
export TEST_MESSAGE_COUNT=1000
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Performance Benchmarking for Transparency Middleware
|
|
4
|
-
# Version: 1.0.0
|
|
5
|
-
# Measures message throughput, overhead, and memory usage
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
# Source configuration
|
|
10
|
-
source .claude/skills/cfn-transparency-middleware/middleware-config.sh
|
|
11
|
-
|
|
12
|
-
# Benchmarking results file
|
|
13
|
-
BENCHMARK_RESULTS="/tmp/transparency_benchmark_$(date +%Y%m%d_%H%M%S).json"
|
|
14
|
-
|
|
15
|
-
# Performance Test Parameters
|
|
16
|
-
TOTAL_MESSAGES=10000
|
|
17
|
-
CONCURRENCY_LEVELS=(1 10 100)
|
|
18
|
-
|
|
19
|
-
measure_performance() {
|
|
20
|
-
local concurrency="$1"
|
|
21
|
-
local start_time=$(date +%s.%N)
|
|
22
|
-
local peak_memory=0
|
|
23
|
-
local total_cpu_usage=0
|
|
24
|
-
|
|
25
|
-
# Simulate message processing
|
|
26
|
-
for ((i=0; i<TOTAL_MESSAGES; i++)); do
|
|
27
|
-
./invoke-transparency-middleware.sh process \
|
|
28
|
-
--concurrency "$concurrency" \
|
|
29
|
-
--message-id "$i" &
|
|
30
|
-
done
|
|
31
|
-
|
|
32
|
-
wait
|
|
33
|
-
|
|
34
|
-
local end_time=$(date +%s.%N)
|
|
35
|
-
local duration=$(echo "$end_time - $start_time" | bc)
|
|
36
|
-
local messages_per_second=$(echo "$TOTAL_MESSAGES / $duration" | bc)
|
|
37
|
-
|
|
38
|
-
# Record performance metrics
|
|
39
|
-
jq -n \
|
|
40
|
-
--arg concurrency "$concurrency" \
|
|
41
|
-
--arg messages_total "$TOTAL_MESSAGES" \
|
|
42
|
-
--arg duration "$duration" \
|
|
43
|
-
--arg messages_per_second "$messages_per_second" \
|
|
44
|
-
'{
|
|
45
|
-
"concurrency": $concurrency,
|
|
46
|
-
"total_messages": $messages_total,
|
|
47
|
-
"duration_seconds": $duration,
|
|
48
|
-
"messages_per_second": $messages_per_second
|
|
49
|
-
}' > "$BENCHMARK_RESULTS"
|
|
50
|
-
|
|
51
|
-
# Validate performance
|
|
52
|
-
validate_performance "$messages_per_second"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
validate_performance() {
|
|
56
|
-
local messages_per_second="$1"
|
|
57
|
-
local max_threshold=5000 # Adjust based on your system capabilities
|
|
58
|
-
|
|
59
|
-
if (( $(echo "$messages_per_second < $max_threshold" | bc -l) )); then
|
|
60
|
-
echo "Performance Test PASSED"
|
|
61
|
-
redis-cli publish "swarm:sprint-1.2:performance" "benchmark_passed:1.0"
|
|
62
|
-
else
|
|
63
|
-
echo "Performance Test FAILED"
|
|
64
|
-
redis-cli publish "swarm:sprint-1.2:performance" "benchmark_failed:0.0"
|
|
65
|
-
exit 1
|
|
66
|
-
fi
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
main() {
|
|
70
|
-
echo "Starting Transparency Middleware Performance Benchmarks"
|
|
71
|
-
|
|
72
|
-
for concurrency in "${CONCURRENCY_LEVELS[@]}"; do
|
|
73
|
-
measure_performance "$concurrency"
|
|
74
|
-
done
|
|
75
|
-
|
|
76
|
-
cat "$BENCHMARK_RESULTS"
|
|
77
|
-
}
|
|
78
|
-
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Performance Benchmarking for Transparency Middleware
|
|
4
|
+
# Version: 1.0.0
|
|
5
|
+
# Measures message throughput, overhead, and memory usage
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
# Source configuration
|
|
10
|
+
source .claude/skills/cfn-transparency-middleware/middleware-config.sh
|
|
11
|
+
|
|
12
|
+
# Benchmarking results file
|
|
13
|
+
BENCHMARK_RESULTS="/tmp/transparency_benchmark_$(date +%Y%m%d_%H%M%S).json"
|
|
14
|
+
|
|
15
|
+
# Performance Test Parameters
|
|
16
|
+
TOTAL_MESSAGES=10000
|
|
17
|
+
CONCURRENCY_LEVELS=(1 10 100)
|
|
18
|
+
|
|
19
|
+
measure_performance() {
|
|
20
|
+
local concurrency="$1"
|
|
21
|
+
local start_time=$(date +%s.%N)
|
|
22
|
+
local peak_memory=0
|
|
23
|
+
local total_cpu_usage=0
|
|
24
|
+
|
|
25
|
+
# Simulate message processing
|
|
26
|
+
for ((i=0; i<TOTAL_MESSAGES; i++)); do
|
|
27
|
+
./invoke-transparency-middleware.sh process \
|
|
28
|
+
--concurrency "$concurrency" \
|
|
29
|
+
--message-id "$i" &
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
wait
|
|
33
|
+
|
|
34
|
+
local end_time=$(date +%s.%N)
|
|
35
|
+
local duration=$(echo "$end_time - $start_time" | bc)
|
|
36
|
+
local messages_per_second=$(echo "$TOTAL_MESSAGES / $duration" | bc)
|
|
37
|
+
|
|
38
|
+
# Record performance metrics
|
|
39
|
+
jq -n \
|
|
40
|
+
--arg concurrency "$concurrency" \
|
|
41
|
+
--arg messages_total "$TOTAL_MESSAGES" \
|
|
42
|
+
--arg duration "$duration" \
|
|
43
|
+
--arg messages_per_second "$messages_per_second" \
|
|
44
|
+
'{
|
|
45
|
+
"concurrency": $concurrency,
|
|
46
|
+
"total_messages": $messages_total,
|
|
47
|
+
"duration_seconds": $duration,
|
|
48
|
+
"messages_per_second": $messages_per_second
|
|
49
|
+
}' > "$BENCHMARK_RESULTS"
|
|
50
|
+
|
|
51
|
+
# Validate performance
|
|
52
|
+
validate_performance "$messages_per_second"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
validate_performance() {
|
|
56
|
+
local messages_per_second="$1"
|
|
57
|
+
local max_threshold=5000 # Adjust based on your system capabilities
|
|
58
|
+
|
|
59
|
+
if (( $(echo "$messages_per_second < $max_threshold" | bc -l) )); then
|
|
60
|
+
echo "Performance Test PASSED"
|
|
61
|
+
redis-cli publish "swarm:sprint-1.2:performance" "benchmark_passed:1.0"
|
|
62
|
+
else
|
|
63
|
+
echo "Performance Test FAILED"
|
|
64
|
+
redis-cli publish "swarm:sprint-1.2:performance" "benchmark_failed:0.0"
|
|
65
|
+
exit 1
|
|
66
|
+
fi
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
main() {
|
|
70
|
+
echo "Starting Transparency Middleware Performance Benchmarks"
|
|
71
|
+
|
|
72
|
+
for concurrency in "${CONCURRENCY_LEVELS[@]}"; do
|
|
73
|
+
measure_performance "$concurrency"
|
|
74
|
+
done
|
|
75
|
+
|
|
76
|
+
cat "$BENCHMARK_RESULTS"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
79
|
main
|