claude-flow-novice 2.15.8 → 2.15.9
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/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +104 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +123 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +89 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +47 -0
- package/.claude/skills/cfn-redis-coordination/report-completion.sh +55 -10
- package/.claude/skills/cfn-redis-coordination/store-context.sh +31 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +6 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +6 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +6 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +6 -1
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +18 -8
- package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +18 -8
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +18 -8
- package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +17 -7
- package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +17 -8
- package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +18 -8
- package/claude-assets/agents/cfn-dev-team/reviewers/code-reviewer.md +9 -5
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +13 -6
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +13 -6
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +13 -6
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +15 -5
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +9 -5
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +8 -4
- package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +16 -13
- package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +9 -5
- package/claude-assets/agents/cfn-dev-team/testers/tester.md +9 -5
- package/claude-assets/skills/cfn-loop-orchestration/helpers/consensus-ts.sh +104 -0
- package/claude-assets/skills/cfn-loop-orchestration/helpers/deliverable-verifier-ts.sh +123 -0
- package/claude-assets/skills/cfn-loop-orchestration/helpers/iteration-manager-ts.sh +89 -0
- package/claude-assets/skills/cfn-loop-orchestration/helpers/timeout-calculator-ts.sh +47 -0
- package/claude-assets/skills/cfn-redis-coordination/report-completion.sh +55 -10
- package/claude-assets/skills/cfn-redis-coordination/store-context.sh +31 -1
- package/package.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
# Consensus Checker (TypeScript Wrapper)
|
|
5
|
+
# Collects and validates Loop 2 consensus scores
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# consensus-ts.sh --scores <score1,score2,...> \
|
|
9
|
+
# --threshold <0.0-1.0> \
|
|
10
|
+
# --mode <mvp|standard|enterprise>
|
|
11
|
+
#
|
|
12
|
+
# Returns:
|
|
13
|
+
# Exit 0: Consensus reached
|
|
14
|
+
# Exit 1: Consensus failed
|
|
15
|
+
##############################################################################
|
|
16
|
+
|
|
17
|
+
set -euo pipefail
|
|
18
|
+
|
|
19
|
+
# Get script directory
|
|
20
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
21
|
+
HELPERS_DIR="$SCRIPT_DIR/../src/helpers"
|
|
22
|
+
|
|
23
|
+
# Parameters
|
|
24
|
+
SCORES=""
|
|
25
|
+
THRESHOLD=""
|
|
26
|
+
MODE="standard"
|
|
27
|
+
|
|
28
|
+
# Parse arguments
|
|
29
|
+
while [[ $# -gt 0 ]]; do
|
|
30
|
+
case $1 in
|
|
31
|
+
--scores) SCORES="$2"; shift 2 ;;
|
|
32
|
+
--threshold) THRESHOLD="$2"; shift 2 ;;
|
|
33
|
+
--mode) MODE="$2"; shift 2 ;;
|
|
34
|
+
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
35
|
+
esac
|
|
36
|
+
done
|
|
37
|
+
|
|
38
|
+
# Validation
|
|
39
|
+
if [ -z "$SCORES" ]; then
|
|
40
|
+
echo "Error: Missing required parameter --scores" >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
# Convert comma-separated scores to JSON array
|
|
45
|
+
IFS=',' read -ra SCORE_ARRAY <<< "$SCORES"
|
|
46
|
+
SCORES_JSON="["
|
|
47
|
+
for i in "${!SCORE_ARRAY[@]}"; do
|
|
48
|
+
if [ $i -gt 0 ]; then
|
|
49
|
+
SCORES_JSON+=","
|
|
50
|
+
fi
|
|
51
|
+
SCORES_JSON+="${SCORE_ARRAY[$i]}"
|
|
52
|
+
done
|
|
53
|
+
SCORES_JSON+="]"
|
|
54
|
+
|
|
55
|
+
# Build TypeScript invocation
|
|
56
|
+
TS_CODE="
|
|
57
|
+
import { collectConsensus, validateConsensus } from './consensus';
|
|
58
|
+
|
|
59
|
+
const scores = $SCORES_JSON;
|
|
60
|
+
const mode = '$MODE';
|
|
61
|
+
const threshold = ${THRESHOLD:-null};
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
const consensus = collectConsensus(scores);
|
|
65
|
+
console.log(\`Consensus Statistics:\`);
|
|
66
|
+
console.log(\` Count: \${consensus.count}\`);
|
|
67
|
+
console.log(\` Average: \${consensus.average.toFixed(3)}\`);
|
|
68
|
+
console.log(\` Min: \${consensus.min.toFixed(3)}\`);
|
|
69
|
+
console.log(\` Max: \${consensus.max.toFixed(3)}\`);
|
|
70
|
+
console.log();
|
|
71
|
+
|
|
72
|
+
const validationParams: any = {
|
|
73
|
+
average: consensus.average,
|
|
74
|
+
mode
|
|
75
|
+
};
|
|
76
|
+
if (threshold !== null) {
|
|
77
|
+
validationParams.threshold = threshold;
|
|
78
|
+
}
|
|
79
|
+
const validation = validateConsensus(validationParams);
|
|
80
|
+
|
|
81
|
+
console.log(\`Consensus Validation:\`);
|
|
82
|
+
console.log(\` Mode: \${validation.mode}\`);
|
|
83
|
+
console.log(\` Threshold: \${validation.threshold.toFixed(2)}\`);
|
|
84
|
+
console.log(\` Average: \${validation.average.toFixed(3)}\`);
|
|
85
|
+
console.log(\` Gap: \${validation.gap >= 0 ? '+' : ''}\${validation.gap.toFixed(3)}\`);
|
|
86
|
+
console.log(\` Passed: \${validation.passed}\`);
|
|
87
|
+
console.log();
|
|
88
|
+
|
|
89
|
+
if (validation.passed) {
|
|
90
|
+
console.log('✅ Consensus REACHED - Loop 2 validation successful');
|
|
91
|
+
process.exit(0);
|
|
92
|
+
} else {
|
|
93
|
+
console.log('❌ Consensus FAILED - Iteration required');
|
|
94
|
+
process.exit(1);
|
|
95
|
+
}
|
|
96
|
+
} catch (error: any) {
|
|
97
|
+
console.error('Error:', error.message);
|
|
98
|
+
process.exit(2);
|
|
99
|
+
}
|
|
100
|
+
"
|
|
101
|
+
|
|
102
|
+
# Execute TypeScript code
|
|
103
|
+
cd "$HELPERS_DIR"
|
|
104
|
+
ts-node -e "$TS_CODE"
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
# Deliverable Verifier (TypeScript Wrapper)
|
|
5
|
+
# Verifies expected deliverables exist (prevents "consensus on vapor")
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# deliverable-verifier-ts.sh --files <file1,file2,...> \
|
|
9
|
+
# [--expected-types <.ext1,.ext2,...>] \
|
|
10
|
+
# [--task-type <description>] \
|
|
11
|
+
# [--require-git-changes]
|
|
12
|
+
#
|
|
13
|
+
# Returns:
|
|
14
|
+
# Exit 0: Deliverables verified
|
|
15
|
+
# Exit 1: Missing deliverables or validation failed
|
|
16
|
+
##############################################################################
|
|
17
|
+
|
|
18
|
+
set -euo pipefail
|
|
19
|
+
|
|
20
|
+
# Get script directory
|
|
21
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
22
|
+
HELPERS_DIR="$SCRIPT_DIR/../src/helpers"
|
|
23
|
+
|
|
24
|
+
# Parameters
|
|
25
|
+
FILES=""
|
|
26
|
+
EXPECTED_TYPES=""
|
|
27
|
+
TASK_TYPE=""
|
|
28
|
+
REQUIRE_GIT_CHANGES="false"
|
|
29
|
+
|
|
30
|
+
# Parse arguments
|
|
31
|
+
while [[ $# -gt 0 ]]; do
|
|
32
|
+
case $1 in
|
|
33
|
+
--files) FILES="$2"; shift 2 ;;
|
|
34
|
+
--expected-types) EXPECTED_TYPES="$2"; shift 2 ;;
|
|
35
|
+
--task-type) TASK_TYPE="$2"; shift 2 ;;
|
|
36
|
+
--require-git-changes) REQUIRE_GIT_CHANGES="true"; shift 1 ;;
|
|
37
|
+
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
38
|
+
esac
|
|
39
|
+
done
|
|
40
|
+
|
|
41
|
+
# Convert comma-separated files to JSON array
|
|
42
|
+
if [ -n "$FILES" ]; then
|
|
43
|
+
IFS=',' read -ra FILE_ARRAY <<< "$FILES"
|
|
44
|
+
FILES_JSON="["
|
|
45
|
+
for i in "${!FILE_ARRAY[@]}"; do
|
|
46
|
+
if [ $i -gt 0 ]; then
|
|
47
|
+
FILES_JSON+=","
|
|
48
|
+
fi
|
|
49
|
+
FILES_JSON+="\"${FILE_ARRAY[$i]}\""
|
|
50
|
+
done
|
|
51
|
+
FILES_JSON+="]"
|
|
52
|
+
else
|
|
53
|
+
FILES_JSON="[]"
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
# Convert comma-separated types to JSON array
|
|
57
|
+
if [ -n "$EXPECTED_TYPES" ]; then
|
|
58
|
+
IFS=',' read -ra TYPE_ARRAY <<< "$EXPECTED_TYPES"
|
|
59
|
+
TYPES_JSON="["
|
|
60
|
+
for i in "${!TYPE_ARRAY[@]}"; do
|
|
61
|
+
if [ $i -gt 0 ]; then
|
|
62
|
+
TYPES_JSON+=","
|
|
63
|
+
fi
|
|
64
|
+
TYPES_JSON+="\"${TYPE_ARRAY[$i]}\""
|
|
65
|
+
done
|
|
66
|
+
TYPES_JSON+="]"
|
|
67
|
+
else
|
|
68
|
+
TYPES_JSON="undefined"
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
# Build TypeScript invocation
|
|
72
|
+
TS_CODE="
|
|
73
|
+
import { verifyDeliverables } from './deliverable-verifier';
|
|
74
|
+
|
|
75
|
+
const result = verifyDeliverables({
|
|
76
|
+
files: $FILES_JSON,
|
|
77
|
+
${EXPECTED_TYPES:+expectedTypes: $TYPES_JSON,}
|
|
78
|
+
${TASK_TYPE:+taskType: '$TASK_TYPE',}
|
|
79
|
+
requireGitChanges: $REQUIRE_GIT_CHANGES
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
console.log('Deliverable Verification:');
|
|
83
|
+
console.log(\` Files checked: \${result.files.length}\`);
|
|
84
|
+
console.log(\` Found: \${result.found.length}\`);
|
|
85
|
+
console.log(\` Missing: \${result.missing.length}\`);
|
|
86
|
+
if (result.gitChanges !== undefined) {
|
|
87
|
+
console.log(\` Git changes: \${result.gitChanges}\`);
|
|
88
|
+
}
|
|
89
|
+
console.log();
|
|
90
|
+
|
|
91
|
+
if (result.found.length > 0) {
|
|
92
|
+
console.log('Found files:');
|
|
93
|
+
result.found.forEach(file => console.log(\` ✅ \${file}\`));
|
|
94
|
+
console.log();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (result.missing.length > 0) {
|
|
98
|
+
console.log('Missing files:');
|
|
99
|
+
result.missing.forEach(file => console.log(\` ❌ \${file}\`));
|
|
100
|
+
console.log();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (result.typeErrors && result.typeErrors.length > 0) {
|
|
104
|
+
console.log('Type errors:');
|
|
105
|
+
result.typeErrors.forEach(file => console.log(\` ⚠️ \${file}\`));
|
|
106
|
+
console.log();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (result.verified) {
|
|
110
|
+
console.log('✅ Deliverable verification PASSED');
|
|
111
|
+
process.exit(0);
|
|
112
|
+
} else {
|
|
113
|
+
console.log('❌ Deliverable verification FAILED');
|
|
114
|
+
if (result.reason) {
|
|
115
|
+
console.log(\` Reason: \${result.reason}\`);
|
|
116
|
+
}
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
"
|
|
120
|
+
|
|
121
|
+
# Execute TypeScript code
|
|
122
|
+
cd "$HELPERS_DIR"
|
|
123
|
+
ts-node -e "$TS_CODE"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
# Iteration Manager (TypeScript Wrapper)
|
|
5
|
+
# Prepares next iteration and generates wake signals
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# iteration-manager-ts.sh --current-iteration <n> \
|
|
9
|
+
# --agents <agent1,agent2,...> \
|
|
10
|
+
# [--feedback <json>]
|
|
11
|
+
#
|
|
12
|
+
# Returns:
|
|
13
|
+
# Next iteration metadata (JSON)
|
|
14
|
+
##############################################################################
|
|
15
|
+
|
|
16
|
+
set -euo pipefail
|
|
17
|
+
|
|
18
|
+
# Get script directory
|
|
19
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
20
|
+
HELPERS_DIR="$SCRIPT_DIR/../src/helpers"
|
|
21
|
+
|
|
22
|
+
# Parameters
|
|
23
|
+
CURRENT_ITERATION=""
|
|
24
|
+
AGENTS=""
|
|
25
|
+
FEEDBACK="{}"
|
|
26
|
+
|
|
27
|
+
# Parse arguments
|
|
28
|
+
while [[ $# -gt 0 ]]; do
|
|
29
|
+
case $1 in
|
|
30
|
+
--current-iteration) CURRENT_ITERATION="$2"; shift 2 ;;
|
|
31
|
+
--agents) AGENTS="$2"; shift 2 ;;
|
|
32
|
+
--feedback) FEEDBACK="$2"; shift 2 ;;
|
|
33
|
+
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
34
|
+
esac
|
|
35
|
+
done
|
|
36
|
+
|
|
37
|
+
# Validation
|
|
38
|
+
if [ -z "$CURRENT_ITERATION" ] || [ -z "$AGENTS" ]; then
|
|
39
|
+
echo "Error: Missing required parameters" >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Convert comma-separated agents to JSON array
|
|
44
|
+
IFS=',' read -ra AGENT_ARRAY <<< "$AGENTS"
|
|
45
|
+
AGENTS_JSON="["
|
|
46
|
+
for i in "${!AGENT_ARRAY[@]}"; do
|
|
47
|
+
if [ $i -gt 0 ]; then
|
|
48
|
+
AGENTS_JSON+=","
|
|
49
|
+
fi
|
|
50
|
+
AGENTS_JSON+="\"${AGENT_ARRAY[$i]}\""
|
|
51
|
+
done
|
|
52
|
+
AGENTS_JSON+="]"
|
|
53
|
+
|
|
54
|
+
# Build TypeScript invocation
|
|
55
|
+
TS_CODE="
|
|
56
|
+
import { prepareIteration, wakeAgents } from './iteration-manager';
|
|
57
|
+
|
|
58
|
+
const iteration = prepareIteration({
|
|
59
|
+
currentIteration: $CURRENT_ITERATION,
|
|
60
|
+
feedback: $FEEDBACK
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
console.log('Iteration Preparation:');
|
|
64
|
+
console.log(\` Next Iteration: \${iteration.nextIteration}\`);
|
|
65
|
+
console.log(\` Timestamp: \${iteration.timestamp}\`);
|
|
66
|
+
console.log();
|
|
67
|
+
|
|
68
|
+
const agentIds = $AGENTS_JSON;
|
|
69
|
+
const wake = wakeAgents(agentIds);
|
|
70
|
+
|
|
71
|
+
console.log('Wake Signals Generated:');
|
|
72
|
+
wake.signals.forEach((signal, idx) => {
|
|
73
|
+
console.log(\` [\${idx + 1}] \${signal}\`);
|
|
74
|
+
});
|
|
75
|
+
console.log();
|
|
76
|
+
console.log(\`✅ Prepared iteration \${iteration.nextIteration} for \${agentIds.length} agents\`);
|
|
77
|
+
|
|
78
|
+
// Output JSON for programmatic consumption
|
|
79
|
+
console.log();
|
|
80
|
+
console.log('JSON_OUTPUT:', JSON.stringify({
|
|
81
|
+
nextIteration: iteration.nextIteration,
|
|
82
|
+
timestamp: iteration.timestamp,
|
|
83
|
+
signals: wake.signals
|
|
84
|
+
}));
|
|
85
|
+
"
|
|
86
|
+
|
|
87
|
+
# Execute TypeScript code
|
|
88
|
+
cd "$HELPERS_DIR"
|
|
89
|
+
ts-node -e "$TS_CODE"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
# Timeout Calculator (TypeScript Wrapper)
|
|
5
|
+
# Calculates mode and phase-specific timeouts for agent execution
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# timeout-calculator-ts.sh --mode <mvp|standard|enterprise> [--phase <phase-id>]
|
|
9
|
+
#
|
|
10
|
+
# Returns:
|
|
11
|
+
# Timeout value in seconds (stdout)
|
|
12
|
+
##############################################################################
|
|
13
|
+
|
|
14
|
+
set -euo pipefail
|
|
15
|
+
|
|
16
|
+
# Get script directory
|
|
17
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
18
|
+
HELPERS_DIR="$SCRIPT_DIR/../src/helpers"
|
|
19
|
+
|
|
20
|
+
# Parameters
|
|
21
|
+
MODE="standard"
|
|
22
|
+
PHASE=""
|
|
23
|
+
|
|
24
|
+
# Parse arguments
|
|
25
|
+
while [[ $# -gt 0 ]]; do
|
|
26
|
+
case $1 in
|
|
27
|
+
--mode) MODE="$2"; shift 2 ;;
|
|
28
|
+
--phase) PHASE="$2"; shift 2 ;;
|
|
29
|
+
*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
30
|
+
esac
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
# Build TypeScript invocation
|
|
34
|
+
TS_CODE="
|
|
35
|
+
import { calculateTimeout } from './timeout-calculator';
|
|
36
|
+
|
|
37
|
+
const timeout = calculateTimeout({
|
|
38
|
+
mode: '$MODE',
|
|
39
|
+
${PHASE:+phase: '$PHASE'}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
console.log(timeout);
|
|
43
|
+
"
|
|
44
|
+
|
|
45
|
+
# Execute TypeScript code
|
|
46
|
+
cd "$HELPERS_DIR"
|
|
47
|
+
ts-node -e "$TS_CODE"
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
# Report agent completion and confidence to Redis
|
|
3
3
|
# Replaces deprecated invoke-waiting-mode.sh for CFN Loop coordination
|
|
4
4
|
#
|
|
5
|
-
# Usage:
|
|
5
|
+
# Usage:
|
|
6
|
+
# report-completion.sh --task-id <id> --agent-id <id> --confidence <0.0-1.0>
|
|
7
|
+
# [--iteration <n>] [--namespace <ns>] [--result <json>]
|
|
8
|
+
# [--test-pass-rate <pct>] [--tests-run <n>] [--tests-passed <n>]
|
|
6
9
|
|
|
7
10
|
set -euo pipefail
|
|
8
11
|
|
|
@@ -16,6 +19,10 @@ AGENT_ID=""
|
|
|
16
19
|
CONFIDENCE=""
|
|
17
20
|
RESULT=""
|
|
18
21
|
ITERATION="1"
|
|
22
|
+
NAMESPACE="swarm"
|
|
23
|
+
TEST_PASS_RATE=""
|
|
24
|
+
TESTS_RUN=""
|
|
25
|
+
TESTS_PASSED=""
|
|
19
26
|
|
|
20
27
|
while [[ $# -gt 0 ]]; do
|
|
21
28
|
case $1 in
|
|
@@ -39,6 +46,22 @@ while [[ $# -gt 0 ]]; do
|
|
|
39
46
|
ITERATION="$2"
|
|
40
47
|
shift 2
|
|
41
48
|
;;
|
|
49
|
+
--namespace)
|
|
50
|
+
NAMESPACE="$2"
|
|
51
|
+
shift 2
|
|
52
|
+
;;
|
|
53
|
+
--test-pass-rate)
|
|
54
|
+
TEST_PASS_RATE="$2"
|
|
55
|
+
shift 2
|
|
56
|
+
;;
|
|
57
|
+
--tests-run)
|
|
58
|
+
TESTS_RUN="$2"
|
|
59
|
+
shift 2
|
|
60
|
+
;;
|
|
61
|
+
--tests-passed)
|
|
62
|
+
TESTS_PASSED="$2"
|
|
63
|
+
shift 2
|
|
64
|
+
;;
|
|
42
65
|
*)
|
|
43
66
|
echo "Unknown option: $1" >&2
|
|
44
67
|
exit 1
|
|
@@ -51,7 +74,9 @@ done
|
|
|
51
74
|
# Wrapper provides graceful Task mode fallback when Redis unavailable
|
|
52
75
|
if [ -z "$TASK_ID" ] || [ -z "$AGENT_ID" ] || [ -z "$CONFIDENCE" ]; then
|
|
53
76
|
echo "Error: Missing required parameters" >&2
|
|
54
|
-
echo "Usage: $0 --task-id <id> --agent-id <id> --confidence <0.0-1.0>
|
|
77
|
+
echo "Usage: $0 --task-id <id> --agent-id <id> --confidence <0.0-1.0>" >&2
|
|
78
|
+
echo " [--iteration <n>] [--namespace <ns>] [--result <json>]" >&2
|
|
79
|
+
echo " [--test-pass-rate <pct>] [--tests-run <n>] [--tests-passed <n>]" >&2
|
|
55
80
|
exit 1
|
|
56
81
|
fi
|
|
57
82
|
|
|
@@ -66,24 +91,44 @@ fi
|
|
|
66
91
|
# Measured improvement: ~62% coordination overhead reduction in standard mode
|
|
67
92
|
{
|
|
68
93
|
echo "MULTI"
|
|
69
|
-
echo "LPUSH
|
|
70
|
-
echo "SET
|
|
94
|
+
echo "LPUSH ${NAMESPACE}:${TASK_ID}:${AGENT_ID}:done complete"
|
|
95
|
+
echo "SET ${NAMESPACE}:${TASK_ID}:${AGENT_ID}:confidence $CONFIDENCE EX 3600"
|
|
96
|
+
|
|
97
|
+
# Build result hash with test metrics if provided
|
|
98
|
+
RESULT_HASH_ARGS="confidence $CONFIDENCE iteration $ITERATION"
|
|
71
99
|
|
|
72
100
|
if [ -n "$RESULT" ]; then
|
|
73
|
-
|
|
74
|
-
else
|
|
75
|
-
echo "HSET swarm:${TASK_ID}:${AGENT_ID}:result confidence $CONFIDENCE iteration $ITERATION timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
101
|
+
RESULT_HASH_ARGS="$RESULT_HASH_ARGS result $RESULT"
|
|
76
102
|
fi
|
|
77
103
|
|
|
104
|
+
if [ -n "$TEST_PASS_RATE" ]; then
|
|
105
|
+
RESULT_HASH_ARGS="$RESULT_HASH_ARGS test_pass_rate $TEST_PASS_RATE"
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
if [ -n "$TESTS_RUN" ]; then
|
|
109
|
+
RESULT_HASH_ARGS="$RESULT_HASH_ARGS tests_run $TESTS_RUN"
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
if [ -n "$TESTS_PASSED" ]; then
|
|
113
|
+
RESULT_HASH_ARGS="$RESULT_HASH_ARGS tests_passed $TESTS_PASSED"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
RESULT_HASH_ARGS="$RESULT_HASH_ARGS timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
117
|
+
|
|
118
|
+
echo "HSET ${NAMESPACE}:${TASK_ID}:${AGENT_ID}:result $RESULT_HASH_ARGS"
|
|
119
|
+
|
|
78
120
|
echo "EXEC"
|
|
79
121
|
} | redis-cli > /dev/null
|
|
80
122
|
|
|
81
123
|
# Step 4: Add to agent completion list (for orchestrator tracking)
|
|
82
|
-
redis-cli LPUSH "
|
|
124
|
+
redis-cli LPUSH "${NAMESPACE}:${TASK_ID}:completed_agents" "$AGENT_ID" > /dev/null
|
|
83
125
|
|
|
84
126
|
# Step 5: Set TTL on keys (auto-cleanup)
|
|
85
|
-
redis-cli EXPIRE "
|
|
86
|
-
redis-cli EXPIRE "
|
|
127
|
+
redis-cli EXPIRE "${NAMESPACE}:${TASK_ID}:${AGENT_ID}:result" 3600 > /dev/null
|
|
128
|
+
redis-cli EXPIRE "${NAMESPACE}:${TASK_ID}:${AGENT_ID}:done" 3600 > /dev/null
|
|
87
129
|
|
|
88
130
|
echo "✅ Reported completion for agent: $AGENT_ID (confidence: $CONFIDENCE)"
|
|
131
|
+
if [ -n "$TEST_PASS_RATE" ]; then
|
|
132
|
+
echo " Test pass rate: $TEST_PASS_RATE%"
|
|
133
|
+
fi
|
|
89
134
|
exit 0
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#
|
|
5
5
|
# Usage:
|
|
6
6
|
# store-context.sh --task-id <id> --key <key> --value <value> [--namespace <ns>]
|
|
7
|
+
# store-context.sh --task-id <id> --epic <epic> --mode <mode> [--namespace <ns>]
|
|
7
8
|
# store-context.sh <task_id> <context_json> (legacy mode)
|
|
8
9
|
|
|
9
10
|
set -euo pipefail
|
|
@@ -18,6 +19,8 @@ KEY=""
|
|
|
18
19
|
VALUE=""
|
|
19
20
|
NAMESPACE="swarm"
|
|
20
21
|
CONTEXT=""
|
|
22
|
+
EPIC=""
|
|
23
|
+
MODE=""
|
|
21
24
|
|
|
22
25
|
# Parse arguments
|
|
23
26
|
while [[ $# -gt 0 ]]; do
|
|
@@ -38,6 +41,14 @@ while [[ $# -gt 0 ]]; do
|
|
|
38
41
|
NAMESPACE="$2"
|
|
39
42
|
shift 2
|
|
40
43
|
;;
|
|
44
|
+
--epic)
|
|
45
|
+
EPIC="$2"
|
|
46
|
+
shift 2
|
|
47
|
+
;;
|
|
48
|
+
--mode)
|
|
49
|
+
MODE="$2"
|
|
50
|
+
shift 2
|
|
51
|
+
;;
|
|
41
52
|
*)
|
|
42
53
|
# Legacy mode: positional arguments
|
|
43
54
|
if [ -z "$TASK_ID" ]; then
|
|
@@ -54,10 +65,29 @@ done
|
|
|
54
65
|
if [ -z "$TASK_ID" ]; then
|
|
55
66
|
echo "Error: --task-id or TASK_ID required" >&2
|
|
56
67
|
echo "Usage: $0 --task-id <id> --key <key> --value <value> [--namespace <ns>]" >&2
|
|
68
|
+
echo " or: $0 --task-id <id> --epic <epic> --mode <mode> [--namespace <ns>]" >&2
|
|
57
69
|
echo " or: $0 <task_id> <context_json> (legacy)" >&2
|
|
58
70
|
exit 1
|
|
59
71
|
fi
|
|
60
72
|
|
|
73
|
+
# Handle epic+mode mode (new)
|
|
74
|
+
if [ -n "$EPIC" ] && [ -n "$MODE" ]; then
|
|
75
|
+
# Store epic and mode with task context
|
|
76
|
+
REDIS_KEY="${NAMESPACE}:${TASK_ID}:context"
|
|
77
|
+
|
|
78
|
+
redis-cli HSET "$REDIS_KEY" \
|
|
79
|
+
"epic" "$EPIC" \
|
|
80
|
+
"mode" "$MODE" \
|
|
81
|
+
"updated_at" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
|
|
82
|
+
> /dev/null
|
|
83
|
+
|
|
84
|
+
# Set TTL (24 hours)
|
|
85
|
+
redis-cli EXPIRE "$REDIS_KEY" 86400 > /dev/null
|
|
86
|
+
|
|
87
|
+
echo "✅ Context stored: epic=$EPIC, mode=$MODE for task: $TASK_ID"
|
|
88
|
+
exit 0
|
|
89
|
+
fi
|
|
90
|
+
|
|
61
91
|
# Handle structured mode (new)
|
|
62
92
|
if [ -n "$KEY" ] && [ -n "$VALUE" ]; then
|
|
63
93
|
# Store structured context with specific key
|
|
@@ -89,5 +119,5 @@ if [ -n "$CONTEXT" ]; then
|
|
|
89
119
|
exit 0
|
|
90
120
|
fi
|
|
91
121
|
|
|
92
|
-
echo "Error: Either --key/--value or <context_json> required" >&2
|
|
122
|
+
echo "Error: Either --epic/--mode, --key/--value, or <context_json> required" >&2
|
|
93
123
|
exit 1
|
|
@@ -845,6 +845,8 @@ fi
|
|
|
845
845
|
Complete your frontend coordination work and provide test-based validation:
|
|
846
846
|
|
|
847
847
|
1. **Execute Tests**: Run all test suites from success criteria
|
|
848
|
+
|
|
849
|
+
```bash
|
|
848
850
|
# Parse natively (no external dependencies)
|
|
849
851
|
PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
|
|
850
852
|
FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
|
|
@@ -853,7 +855,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
|
|
|
853
855
|
|
|
854
856
|
# Return results (Main Chat receives automatically in Task Mode)
|
|
855
857
|
echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
|
|
856
|
-
|
|
858
|
+
```
|
|
859
|
+
|
|
860
|
+
2. **Review Metrics**: Verify test pass rate ≥95%
|
|
861
|
+
3. **Coverage Check**: Ensure test coverage ≥80%
|
|
857
862
|
4. **Store in Redis**: Use test-results key (not confidence key)
|
|
858
863
|
5. **Signal Completion**: Push to completion queue
|
|
859
864
|
|
|
@@ -440,6 +440,8 @@ When spawned via Task() tool in Main Chat:
|
|
|
440
440
|
Complete your consensus-building work and provide test-based validation:
|
|
441
441
|
|
|
442
442
|
1. **Execute Tests**: Run all test suites from success criteria
|
|
443
|
+
|
|
444
|
+
```bash
|
|
443
445
|
# Parse natively (no external dependencies)
|
|
444
446
|
PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
|
|
445
447
|
FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
|
|
@@ -448,7 +450,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
|
|
|
448
450
|
|
|
449
451
|
# Return results (Main Chat receives automatically in Task Mode)
|
|
450
452
|
echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
|
|
451
|
-
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
2. **Review Metrics**: Verify test pass rate ≥95%
|
|
456
|
+
3. **Coverage Check**: Ensure test coverage ≥80%
|
|
452
457
|
4. **Store in Redis**: Use test-results key (not confidence key)
|
|
453
458
|
5. **Signal Completion**: Push to completion queue
|
|
454
459
|
|
|
@@ -529,6 +529,8 @@ echo "CONFIDENCE: [0.0-1.0]"
|
|
|
529
529
|
Complete your handoff coordination work and provide test-based validation:
|
|
530
530
|
|
|
531
531
|
1. **Execute Tests**: Run all test suites from success criteria
|
|
532
|
+
|
|
533
|
+
```bash
|
|
532
534
|
# Parse natively (no external dependencies)
|
|
533
535
|
PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
|
|
534
536
|
FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
|
|
@@ -537,7 +539,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
|
|
|
537
539
|
|
|
538
540
|
# Return results (Main Chat receives automatically in Task Mode)
|
|
539
541
|
echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
|
|
540
|
-
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
2. **Review Metrics**: Verify test pass rate ≥95%
|
|
545
|
+
3. **Coverage Check**: Ensure test coverage ≥80%
|
|
541
546
|
4. **Store in Redis**: Use test-results key (not confidence key)
|
|
542
547
|
5. **Signal Completion**: Push to completion queue
|
|
543
548
|
|
|
@@ -470,6 +470,8 @@ When spawned via Task() tool in Main Chat:
|
|
|
470
470
|
Complete your multi-sprint coordination work and provide test-based validation:
|
|
471
471
|
|
|
472
472
|
1. **Execute Tests**: Run all test suites from success criteria
|
|
473
|
+
|
|
474
|
+
```bash
|
|
473
475
|
# Parse natively (no external dependencies)
|
|
474
476
|
PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
|
|
475
477
|
FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
|
|
@@ -478,7 +480,10 @@ RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0
|
|
|
478
480
|
|
|
479
481
|
# Return results (Main Chat receives automatically in Task Mode)
|
|
480
482
|
echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
|
|
481
|
-
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
2. **Review Metrics**: Verify test pass rate ≥95%
|
|
486
|
+
3. **Coverage Check**: Ensure test coverage ≥80%
|
|
482
487
|
4. **Store in Redis**: Use test-results key (not confidence key)
|
|
483
488
|
5. **Signal Completion**: Push to completion queue
|
|
484
489
|
|
|
@@ -624,16 +624,26 @@ networks:
|
|
|
624
624
|
Complete your work and provide test-based validation:
|
|
625
625
|
|
|
626
626
|
1. **Execute Tests**: Run all test suites from success criteria
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
627
|
+
```bash
|
|
628
|
+
# Parse natively (no external dependencies)
|
|
629
|
+
PASS=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= passing)' || echo "0")
|
|
630
|
+
FAIL=$(echo "$TEST_OUTPUT" | grep -oP '\d+(?= failing)' || echo "0")
|
|
631
|
+
TOTAL=$((PASS + FAIL))
|
|
632
|
+
RATE=$(awk "BEGIN {if ($TOTAL > 0) printf \"%.2f\", $PASS/$TOTAL; else print \"0.00\"}")
|
|
633
|
+
|
|
634
|
+
# Return results (Main Chat receives automatically in Task Mode)
|
|
635
|
+
echo "{\"passed\": $PASS, \"failed\": $FAIL, \"pass_rate\": $RATE}"
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
2. **Parse Results**: Extract test counts and calculate pass rate
|
|
639
|
+
|
|
640
|
+
3. **Coverage Check**: Ensure coverage meets minimum thresholds
|
|
641
|
+
- Build tests: ≥95%
|
|
642
|
+
- Security tests: ≥90%
|
|
635
643
|
- Coverage: ≥80%
|
|
644
|
+
|
|
636
645
|
4. **Store in Redis**: Use test-results key (not confidence key)
|
|
646
|
+
|
|
637
647
|
5. **Signal Completion**: Push to completion queue
|
|
638
648
|
|
|
639
649
|
**Example Report:**
|