claude-flow-novice 2.15.2 → 2.15.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.
- package/.claude/cfn-extras/skills/advanced-features/cfn-agent-swap/recommend-swap.sh +59 -59
- package/.claude/cfn-extras/skills/analytics/cfn-improvement-recommender/recommend-improvements.sh +91 -91
- package/.claude/cfn-extras/skills/analytics/cfn-pattern-extraction/extract-patterns.sh +79 -79
- package/.claude/cfn-extras/skills/analytics/cfn-retrospective-report/generate-report.sh +100 -100
- package/.claude/cfn-extras/skills/analytics/cfn-telemetry/start-telemetry.sh +110 -110
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/add-bullet.sh +145 -145
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/log-merge.sh +67 -67
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/monitor-injection-performance.sh +137 -137
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/optimize-injection-pipeline.sh +168 -168
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/query-reflections.sh +35 -35
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/store-reflection.sh +45 -45
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/track-ab-test.sh +41 -41
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/update-reflection.sh +41 -41
- package/.claude/cfn-extras/skills/deprecated/cfn-cli-setup/validate-cli-environment.sh +191 -191
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/create-campaign.sh +231 -231
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/get-campaign-performance.sh +190 -190
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/pause-campaign.sh +142 -142
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/set-budget.sh +181 -181
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/update-bid-strategy.sh +133 -133
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/get-conversation-history.sh +121 -121
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/qualify-lead.sh +156 -156
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/schedule-demo.sh +181 -181
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/send-message.sh +137 -137
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/transfer-to-human.sh +179 -179
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/create-campaign.sh +183 -183
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/get-delivery-status.sh +139 -139
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/opt-out.sh +150 -150
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/schedule-campaign.sh +187 -187
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/send-sms.sh +181 -181
- package/.claude/cfn-extras/skills/ui-portal/cfn-web-portal/test-web-portal-skill.sh +50 -50
- package/.claude/cfn-extras/skills/ui-portal/cfn-web-portal/validate-deployment.sh +84 -84
- package/.claude/cfn-extras/skills/utility/cfn-environment-sanitization/sanitize-environment.sh +243 -243
- package/.claude/commands/cfn-loop-cli.md +16 -2
- package/.claude/commands/switch-api.md +31 -10
- package/.claude/hooks/cfn-BACKUP_USAGE.md +243 -243
- package/.claude/hooks/cfn-invoke-security-validation.sh +69 -69
- package/.claude/hooks/cfn-lint-sql-injection.sh +61 -0
- package/.claude/hooks/cfn-post-edit-cfn-retrospective.sh +109 -78
- package/.claude/hooks/cfn-post-edit.config.json +44 -44
- package/.claude/hooks/cfn-pre-edit-security-warning.sh +40 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh +22 -24
- package/.claude/skills/cfn-docker-agent-spawning/SKILL.md +28 -4
- package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +3 -1
- package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +224 -20
- package/.claude/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
- package/.claude/skills/cfn-loop-orchestration/helpers/gate-check.sh +550 -46
- package/.claude/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +277 -0
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +184 -23
- package/.claude/skills/cfn-loop-orchestration/security_utils.sh +24 -0
- package/.claude/skills/cfn-loop-orchestration/test-iteration-context-injection.sh +366 -0
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
- package/.claude/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +319 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh.bak +124 -0
- package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/.claude/skills/cfn-redis-coordination/collect-confidence-scores.sh +30 -0
- package/.claude/skills/cfn-redis-coordination/get-context.sh +145 -112
- package/.claude/skills/cfn-redis-coordination/get-success-criteria.sh +54 -0
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -0
- package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/.claude/skills/cfn-redis-coordination/redis-functions.sh +33 -0
- package/.claude/skills/cfn-redis-coordination/report-completion.sh +24 -31
- package/.claude/skills/cfn-redis-coordination/store-context.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/store-success-criteria.sh +85 -0
- package/.claude/skills/cfn-redis-coordination/update-all-scripts.sh +67 -0
- package/.claude/skills/cfn-sqlite-memory/ttl-cleanup.sh +17 -25
- 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-e2e.sh +15 -0
- 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 +107 -92
- package/.claude/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/README.md +116 -475
- package/claude-assets/agents/cfn-dev-team/README.md +103 -0
- package/claude-assets/agents/cfn-dev-team/architecture/goal-planner.md +1 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +77 -15
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +355 -6
- package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +82 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +82 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +77 -15
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +99 -12
- package/claude-assets/agents/cfn-dev-team/dev-ops/github-commit-agent.md +1 -1
- package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +97 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +20 -1
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +97 -0
- package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +110 -13
- package/claude-assets/agents/cfn-dev-team/developers/data/data-engineer.md +106 -15
- package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +115 -11
- package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +94 -7
- package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +87 -9
- package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +85 -7
- package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +160 -28
- package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +101 -19
- package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +108 -14
- package/claude-assets/agents/cfn-dev-team/reviewers/{reviewer.md → code-reviewer.md} +95 -8
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +107 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +98 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +95 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +136 -9
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +108 -1
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +107 -13
- package/claude-assets/agents/cfn-dev-team/testers/contract-tester.md +737 -0
- package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +1 -1
- package/claude-assets/agents/cfn-dev-team/testers/integration-tester.md +828 -0
- package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +106 -7
- package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +77 -0
- package/claude-assets/agents/cfn-dev-team/testers/mutation-testing-specialist.md +684 -0
- package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +110 -1
- package/claude-assets/agents/cfn-dev-team/testers/tester.md +94 -7
- package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +1 -3
- package/claude-assets/agents/cfn-dev-team/utility/epic-creator.md +87 -13
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +103 -7
- package/claude-assets/agents/cfn-dev-team/utility/researcher.md +1 -3
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +94 -7
- package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +46 -0
- package/claude-assets/agents/project-only-agents/npm-package-specialist.md +1 -1
- package/claude-assets/cfn-extras/skills/advanced-features/cfn-agent-swap/recommend-swap.sh +59 -59
- package/claude-assets/cfn-extras/skills/analytics/cfn-improvement-recommender/recommend-improvements.sh +91 -91
- package/claude-assets/cfn-extras/skills/analytics/cfn-pattern-extraction/extract-patterns.sh +79 -79
- package/claude-assets/cfn-extras/skills/analytics/cfn-retrospective-report/generate-report.sh +100 -100
- package/claude-assets/cfn-extras/skills/analytics/cfn-telemetry/start-telemetry.sh +110 -110
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/add-bullet.sh +145 -145
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/log-merge.sh +67 -67
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/monitor-injection-performance.sh +137 -137
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/optimize-injection-pipeline.sh +168 -168
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/query-reflections.sh +35 -35
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/store-reflection.sh +45 -45
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/track-ab-test.sh +41 -41
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/update-reflection.sh +41 -41
- package/claude-assets/cfn-extras/skills/deprecated/cfn-cli-setup/validate-cli-environment.sh +191 -191
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/create-campaign.sh +231 -231
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/get-campaign-performance.sh +190 -190
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/pause-campaign.sh +142 -142
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/set-budget.sh +181 -181
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/update-bid-strategy.sh +133 -133
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/get-conversation-history.sh +121 -121
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/qualify-lead.sh +156 -156
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/schedule-demo.sh +181 -181
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/send-message.sh +137 -137
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/transfer-to-human.sh +179 -179
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/create-campaign.sh +183 -183
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/get-delivery-status.sh +139 -139
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/opt-out.sh +150 -150
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/schedule-campaign.sh +187 -187
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/send-sms.sh +181 -181
- package/claude-assets/cfn-extras/skills/ui-portal/cfn-web-portal/test-web-portal-skill.sh +50 -50
- package/claude-assets/cfn-extras/skills/ui-portal/cfn-web-portal/validate-deployment.sh +84 -84
- package/claude-assets/cfn-extras/skills/utility/cfn-environment-sanitization/sanitize-environment.sh +243 -243
- package/claude-assets/commands/cfn-loop-cli.md +16 -2
- package/claude-assets/commands/switch-api.md +31 -10
- 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-lint-sql-injection.sh +61 -0
- package/claude-assets/hooks/cfn-post-edit-cfn-retrospective.sh +109 -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-edit-security-warning.sh +40 -0
- package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +19 -19
- package/claude-assets/hooks/detect-hardcoded-credentials.sh +212 -0
- package/claude-assets/skills/SKILL_TEMPLATE.md +774 -0
- package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +543 -572
- package/claude-assets/skills/agent-lifecycle/simple-audit.sh +57 -30
- package/claude-assets/skills/agent-template-generator/SKILL.md +440 -0
- package/claude-assets/skills/agent-template-generator/generate-agent.sh +405 -0
- package/claude-assets/skills/agent-validation-linter/SKILL.md +589 -0
- package/claude-assets/skills/agent-validation-linter/lint-agents.sh +271 -0
- package/claude-assets/skills/bootstrap/bash-fundamentals.md +786 -0
- package/claude-assets/skills/bootstrap/database-connection.md +464 -0
- package/claude-assets/skills/bootstrap/error-handling.md +580 -0
- package/claude-assets/skills/bootstrap/file-operations.md +699 -0
- package/claude-assets/skills/bootstrap/skill-loader.md +616 -0
- package/claude-assets/skills/bootstrap/sqlite-params.sh +287 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh +22 -24
- 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-automatic-memory-persistence/test-memory-persistence.sh +17 -16
- package/claude-assets/skills/cfn-deliverable-validation/confidence-calculator.sh +261 -261
- package/claude-assets/skills/cfn-deployment/SKILL.md +293 -0
- package/claude-assets/skills/cfn-deployment/execute.sh +21 -0
- package/claude-assets/skills/cfn-docker-agent-spawning/SKILL.md +28 -4
- package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +3 -1
- package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +224 -20
- package/claude-assets/skills/cfn-environment-sanitization/sanitize-environment.sh +38 -0
- package/claude-assets/skills/cfn-error-batching-strategy/lib/core-functions.sh +47 -47
- package/claude-assets/skills/cfn-expert-update/update-expert.sh +345 -345
- package/claude-assets/skills/cfn-file-operations/SKILL.md +290 -0
- package/claude-assets/skills/cfn-file-operations/execute.sh +129 -0
- package/claude-assets/skills/cfn-file-operations/lib/atomic-write.sh +294 -0
- package/claude-assets/skills/cfn-file-operations/lib/lock.sh +361 -0
- package/claude-assets/skills/cfn-file-operations/test.sh +369 -0
- 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-log-operations/SKILL.md +308 -0
- package/claude-assets/skills/cfn-log-operations/execute.sh +420 -0
- package/claude-assets/skills/cfn-log-operations/lib/rotate.sh +406 -0
- package/claude-assets/skills/cfn-log-operations/lib/search.sh +448 -0
- package/claude-assets/skills/cfn-log-operations/test.sh +394 -0
- package/claude-assets/skills/cfn-loop-orchestration/helpers/gate-check.sh +550 -46
- package/claude-assets/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +277 -0
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +184 -23
- package/claude-assets/skills/cfn-loop-orchestration/security_utils.sh +24 -0
- package/claude-assets/skills/cfn-loop-orchestration/test-iteration-context-injection.sh +366 -0
- 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-parameterized-queries/SKILL.md +339 -0
- package/claude-assets/skills/cfn-playbook/query-playbook.sh +19 -15
- package/claude-assets/skills/cfn-playbook/update-playbook.sh +25 -14
- package/claude-assets/skills/cfn-playbook-auto-update/auto-update-playbook.sh +85 -85
- package/claude-assets/skills/cfn-process-instrumentation/instrument-process.sh +44 -0
- package/claude-assets/skills/cfn-promotion/SKILL.md +305 -0
- package/claude-assets/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +319 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-log.sh +4 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-log.sh.bak +124 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/claude-assets/skills/cfn-redis-coordination/collect-confidence-scores.sh +30 -0
- package/claude-assets/skills/cfn-redis-coordination/get-context.sh +145 -112
- package/claude-assets/skills/cfn-redis-coordination/get-success-criteria.sh +54 -0
- package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -0
- package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/claude-assets/skills/cfn-redis-coordination/redis-functions.sh +33 -0
- package/claude-assets/skills/cfn-redis-coordination/report-completion.sh +24 -31
- package/claude-assets/skills/cfn-redis-coordination/store-context.sh +4 -0
- package/claude-assets/skills/cfn-redis-coordination/store-success-criteria.sh +85 -0
- package/claude-assets/skills/cfn-redis-coordination/update-all-scripts.sh +67 -0
- package/claude-assets/skills/cfn-scope-simplifier/simplify-scope.sh +67 -67
- package/claude-assets/skills/cfn-skill-loader/SKILL.md +466 -0
- package/claude-assets/skills/cfn-skill-loader/execute.sh +344 -0
- package/claude-assets/skills/cfn-specialist-injection/recommend-specialist.sh +56 -56
- package/claude-assets/skills/cfn-sqlite-memory/ttl-cleanup.sh +17 -25
- 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-audit/get-audit-data.sh +42 -21
- package/claude-assets/skills/cfn-task-audit/store-task-audit.sh +17 -10
- 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-test-runner/detect-regressions.sh +17 -14
- package/claude-assets/skills/cfn-test-runner/detect-regressions.sh.backup-1763392821 +55 -0
- package/claude-assets/skills/cfn-test-runner/store-benchmarks.sh +17 -19
- 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-e2e.sh +15 -0
- 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 +107 -92
- package/claude-assets/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/claude-assets/skills/cfn-utilities/SKILL.md +237 -0
- package/claude-assets/skills/cfn-utilities/execute.sh +32 -0
- package/claude-assets/skills/cfn-utilities/lib/errors.sh +56 -0
- package/claude-assets/skills/cfn-utilities/lib/file-ops.sh +164 -0
- package/claude-assets/skills/cfn-utilities/lib/logging.sh +77 -0
- package/claude-assets/skills/cfn-utilities/lib/retry.sh +127 -0
- package/claude-assets/skills/cfn-utilities/test.sh +317 -0
- 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 +492 -0
- package/claude-assets/skills/integration/file-operations.sh +414 -0
- package/claude-assets/skills/json-validation/SKILL.md +431 -0
- package/claude-assets/skills/json-validation/test-validate-success-criteria.sh +421 -0
- package/claude-assets/skills/json-validation/validate-success-criteria.sh +197 -0
- package/claude-assets/skills/redis-coordination/validate-parameters.sh +34 -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/DEPLOY_QUICK_REFERENCE.md +106 -0
- package/claude-assets/skills/workflow-codification/EDGE_CASE_TRACKING.md +404 -0
- package/claude-assets/skills/workflow-codification/PROPAGATE_UPDATE_QUICK_REFERENCE.md +366 -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/deploy-approved-skill.sh +481 -0
- package/claude-assets/skills/workflow-codification/deploy-approved-skill.sh.backup-1763392820 +512 -0
- package/claude-assets/skills/workflow-codification/generate-skill-update.sh +525 -0
- package/claude-assets/skills/workflow-codification/lib/security-utils.sh +204 -0
- package/claude-assets/skills/workflow-codification/propagate-skill-update.sh +648 -0
- package/claude-assets/skills/workflow-codification/propagate-skill-update.sh.backup-1763392820 +664 -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 +296 -0
- package/claude-assets/skills/workflow-codification/test-metadata-update.sh +350 -0
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh +486 -0
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh.backup-1763392821 +445 -0
- package/claude-assets/skills/workflow-codification/track-edge-case.sh +290 -0
- package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
- package/dist/ace/ace-curator.js +10 -2
- package/dist/ace/ace-curator.js.map +1 -1
- package/dist/ace/ace-generator.js +4 -0
- package/dist/ace/ace-generator.js.map +1 -1
- package/dist/ace/ace-reflector.js +1 -1
- package/dist/ace/ace-reflector.js.map +1 -1
- package/dist/ace/context-injection.js +24 -2
- package/dist/ace/context-injection.js.map +1 -1
- package/dist/agents/agent-loader.js +146 -165
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/agents/task-agent-integration.js +1 -1
- package/dist/agents/task-agent-integration.js.map +1 -1
- package/dist/api/health-endpoints.js +390 -0
- package/dist/api/health-endpoints.js.map +1 -0
- package/dist/cli/agent-executor.js +4 -1
- package/dist/cli/agent-executor.js.map +1 -1
- package/dist/cli/agent-prompt-builder.js +89 -1
- package/dist/cli/agent-prompt-builder.js.map +1 -1
- package/dist/cli/agent-spawn.js +130 -37
- package/dist/cli/agent-spawn.js.map +1 -1
- package/dist/cli/config-manager.js +91 -109
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/skill-cache-validator.js +412 -0
- package/dist/cli/skill-cache-validator.js.map +1 -0
- package/dist/cli/skill-cli.js +991 -0
- package/dist/cli/skill-cli.js.map +1 -0
- package/dist/cli/skill-execution-logger.js +284 -0
- package/dist/cli/skill-execution-logger.js.map +1 -0
- package/dist/cli/skill-loader.js +457 -0
- package/dist/cli/skill-loader.js.map +1 -0
- package/dist/coordination/event-bus.js +2 -2
- package/dist/coordination/event-bus.js.map +1 -1
- package/dist/coordination/fleet-manager.js +1 -1
- package/dist/coordination/fleet-manager.js.map +1 -1
- package/dist/coordination/index.js +23 -9
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/types/fleet-manager.types.js.map +1 -1
- package/dist/db/migration-manager.js +483 -0
- package/dist/db/migration-manager.js.map +1 -0
- package/dist/db/skills-query.js +535 -0
- package/dist/db/skills-query.js.map +1 -0
- 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/jobs/edge-case-analyzer.js +367 -0
- package/dist/jobs/edge-case-analyzer.js.map +1 -0
- package/dist/jobs/promotion-sla-enforcer.js +288 -0
- package/dist/jobs/promotion-sla-enforcer.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/agent-workspace.js +281 -0
- package/dist/lib/agent-workspace.js.map +1 -0
- package/dist/lib/artifact-registry.js +443 -0
- package/dist/lib/artifact-registry.js.map +1 -0
- package/dist/lib/atomic-file-writer.js +377 -0
- package/dist/lib/atomic-file-writer.js.map +1 -0
- package/dist/lib/backup-manager.js +779 -0
- package/dist/lib/backup-manager.js.map +1 -0
- package/dist/lib/checkpoint-manager.js +837 -0
- package/dist/lib/checkpoint-manager.js.map +1 -0
- package/dist/lib/circuit-breaker.js +340 -0
- package/dist/lib/circuit-breaker.js.map +1 -0
- package/dist/lib/completion-signal-handler.js +243 -0
- package/dist/lib/completion-signal-handler.js.map +1 -0
- package/dist/lib/config-manager.js +312 -0
- package/dist/lib/config-manager.js.map +1 -0
- package/dist/lib/config-migrator.js +386 -0
- package/dist/lib/config-migrator.js.map +1 -0
- package/dist/lib/config-validator.js +687 -0
- package/dist/lib/config-validator.js.map +1 -0
- package/dist/lib/correlation-cache.js +311 -0
- package/dist/lib/correlation-cache.js.map +1 -0
- package/dist/lib/correlation.js +263 -0
- package/dist/lib/correlation.js.map +1 -0
- package/dist/lib/database-service/connection-pool-manager.js +520 -0
- package/dist/lib/database-service/connection-pool-manager.js.map +1 -0
- package/dist/lib/database-service/correlation.js +329 -0
- package/dist/lib/database-service/correlation.js.map +1 -0
- package/dist/lib/database-service/errors.js +120 -0
- package/dist/lib/database-service/errors.js.map +1 -0
- package/dist/lib/database-service/index.js +168 -0
- package/dist/lib/database-service/index.js.map +1 -0
- package/dist/lib/database-service/postgres-adapter.js +526 -0
- package/dist/lib/database-service/postgres-adapter.js.map +1 -0
- package/dist/lib/database-service/redis-adapter.js +360 -0
- package/dist/lib/database-service/redis-adapter.js.map +1 -0
- package/dist/lib/database-service/sqlite-adapter.js +544 -0
- package/dist/lib/database-service/sqlite-adapter.js.map +1 -0
- package/dist/lib/database-service/transaction-manager.js +773 -0
- package/dist/lib/database-service/transaction-manager.js.map +1 -0
- package/dist/lib/database-service/types.js +23 -0
- package/dist/lib/database-service/types.js.map +1 -0
- package/dist/lib/deadlock-resolver.js +292 -0
- package/dist/lib/deadlock-resolver.js.map +1 -0
- package/dist/lib/distributed-lock.js +451 -0
- package/dist/lib/distributed-lock.js.map +1 -0
- package/dist/lib/edge-case-deduplicator.js +227 -0
- package/dist/lib/edge-case-deduplicator.js.map +1 -0
- package/dist/lib/encryption-manager.js +322 -0
- package/dist/lib/encryption-manager.js.map +1 -0
- package/dist/lib/error-aggregator.js +234 -0
- package/dist/lib/error-aggregator.js.map +1 -0
- package/dist/lib/errors.js +287 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/file-lock-manager.js +578 -0
- package/dist/lib/file-lock-manager.js.map +1 -0
- package/dist/lib/file-operations.js +367 -0
- package/dist/lib/file-operations.js.map +1 -0
- package/dist/lib/idempotent-write.js +237 -0
- package/dist/lib/idempotent-write.js.map +1 -0
- package/dist/lib/integration-schema-validator.js +522 -0
- package/dist/lib/integration-schema-validator.js.map +1 -0
- package/dist/lib/lock-health-monitor.js +298 -0
- package/dist/lib/lock-health-monitor.js.map +1 -0
- package/dist/lib/log-shipper.js +422 -0
- package/dist/lib/log-shipper.js.map +1 -0
- package/dist/lib/logging.js +146 -0
- package/dist/lib/logging.js.map +1 -0
- package/dist/lib/message-deduplicator.js +439 -0
- package/dist/lib/message-deduplicator.js.map +1 -0
- package/dist/lib/multi-system-query.js +604 -0
- package/dist/lib/multi-system-query.js.map +1 -0
- package/dist/lib/orphan-detector.js +332 -0
- package/dist/lib/orphan-detector.js.map +1 -0
- package/dist/lib/password-generator.js +166 -0
- package/dist/lib/password-generator.js.map +1 -0
- package/dist/lib/path-validator.js +429 -0
- package/dist/lib/path-validator.js.map +1 -0
- package/dist/lib/query-translator.js +905 -0
- package/dist/lib/query-translator.js.map +1 -0
- package/dist/lib/queue-recovery.js +469 -0
- package/dist/lib/queue-recovery.js.map +1 -0
- package/dist/lib/redis-queue-manager.js +512 -0
- package/dist/lib/redis-queue-manager.js.map +1 -0
- package/dist/lib/reflection-archiver.js +272 -0
- package/dist/lib/reflection-archiver.js.map +1 -0
- package/dist/lib/retry-manager.js +453 -0
- package/dist/lib/retry-manager.js.map +1 -0
- package/dist/lib/retry.js +262 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/lib/schema-transform.js +695 -0
- package/dist/lib/schema-transform.js.map +1 -0
- package/dist/lib/schema-validator.js +491 -0
- package/dist/lib/schema-validator.js.map +1 -0
- package/dist/lib/skill-cache.js +297 -0
- package/dist/lib/skill-cache.js.map +1 -0
- package/dist/lib/skill-content-manager.js +337 -0
- package/dist/lib/skill-content-manager.js.map +1 -0
- package/dist/lib/skill-frontmatter-parser.js +237 -0
- package/dist/lib/skill-frontmatter-parser.js.map +1 -0
- package/dist/lib/skill-git-integration.js +275 -0
- package/dist/lib/skill-git-integration.js.map +1 -0
- package/dist/lib/skill-markdown-validator.js +396 -0
- package/dist/lib/skill-markdown-validator.js.map +1 -0
- package/dist/lib/skill-output-parser.js +312 -0
- package/dist/lib/skill-output-parser.js.map +1 -0
- package/dist/lib/unified-query-api.js +467 -0
- package/dist/lib/unified-query-api.js.map +1 -0
- package/dist/middleware/auth-middleware.js +350 -0
- package/dist/middleware/auth-middleware.js.map +1 -0
- package/dist/middleware/schema-validation.js +347 -0
- package/dist/middleware/schema-validation.js.map +1 -0
- package/dist/providers/anthropic-provider.js +1 -1
- package/dist/providers/anthropic-provider.js.map +1 -1
- package/dist/providers/provider-factory.js +2 -2
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/services/edge-case-analyzer.js +321 -0
- package/dist/services/edge-case-analyzer.js.map +1 -0
- package/dist/services/edge-case-deduplicator.js +266 -0
- package/dist/services/edge-case-deduplicator.js.map +1 -0
- package/dist/services/edge-case-detector.js +337 -0
- package/dist/services/edge-case-detector.js.map +1 -0
- package/dist/services/edge-case-tracker.js +547 -0
- package/dist/services/edge-case-tracker.js.map +1 -0
- package/dist/services/health-check-system.js +586 -0
- package/dist/services/health-check-system.js.map +1 -0
- package/dist/services/metrics-logger.js +412 -0
- package/dist/services/metrics-logger.js.map +1 -0
- package/dist/services/patch-generator.js +378 -0
- package/dist/services/patch-generator.js.map +1 -0
- package/dist/services/patch-validator.js +337 -0
- package/dist/services/patch-validator.js.map +1 -0
- package/dist/services/performance-monitor.js +811 -0
- package/dist/services/performance-monitor.js.map +1 -0
- package/dist/services/promotion-pipeline.js +918 -0
- package/dist/services/promotion-pipeline.js.map +1 -0
- package/dist/services/promotion-validator.js +394 -0
- package/dist/services/promotion-validator.js.map +1 -0
- package/dist/services/reflection-logger.js +388 -0
- package/dist/services/reflection-logger.js.map +1 -0
- package/dist/services/skill-deployment.js +472 -0
- package/dist/services/skill-deployment.js.map +1 -0
- package/dist/services/skill-loader.js +427 -0
- package/dist/services/skill-loader.js.map +1 -0
- package/dist/services/skill-promotion.js +372 -0
- package/dist/services/skill-promotion.js.map +1 -0
- package/dist/services/skill-validator.js +454 -0
- package/dist/services/skill-validator.js.map +1 -0
- package/dist/services/skill-versioning.js +244 -0
- package/dist/services/skill-versioning.js.map +1 -0
- package/dist/services/workspace-supervisor.js +597 -0
- package/dist/services/workspace-supervisor.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/dist/types/edge-case.js +45 -0
- package/dist/types/edge-case.js.map +1 -0
- package/package.json +201 -176
- package/readme/README.md +19 -4
- package/scripts/artifact-cleanup.sh +392 -0
- package/scripts/backup-cleanup.sh +627 -0
- package/scripts/cleanup-workspaces.sh +412 -0
- package/scripts/cleanup-yaml-configs.sh +141 -0
- package/scripts/deploy-approved-skills.sh +263 -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/health-check.sh +447 -0
- package/scripts/log-aggregator.sh +554 -0
- package/scripts/log-monitor.sh +629 -0
- package/scripts/manage-agent-workspaces.sh +434 -0
- package/scripts/memory-leak-prevention.sh +305 -305
- package/scripts/migrate-artifacts.sh +563 -0
- package/scripts/migrate-schema.sh +533 -0
- package/scripts/migrate-yaml-to-json.sh +465 -0
- package/scripts/promote-staged-skills.sh +423 -0
- package/scripts/run-marketing-tests.sh +42 -42
- package/scripts/update_paths.sh +46 -46
- package/scripts/verify-no-secrets.sh +88 -35
- package/.claude/cfn-extras/agents/deprecated-coordinators/adaptive-coordinator.md.backup +0 -161
- package/.claude/cfn-extras/agents/deprecated-coordinators/blocking-coordinator-example.md.backup +0 -728
- package/.claude/cfn-extras/agents/deprecated-coordinators/mesh-coordinator.md.backup +0 -131
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh.backup +0 -273
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -949
- package/README.md.backup_before_replace +0 -781
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/adaptive-coordinator.md.backup +0 -161
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/blocking-coordinator-example.md.backup +0 -728
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/mesh-coordinator.md.backup +0 -131
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh.backup +0 -273
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -949
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
parse_jest_output() {
|
|
5
|
+
local output="$1"
|
|
6
|
+
local total=0 passed=0 failed=0 skipped=0 duration=0
|
|
7
|
+
local failed_names=()
|
|
8
|
+
|
|
9
|
+
local tests_line=$(echo "$output" | grep "^Tests:" || echo "")
|
|
10
|
+
|
|
11
|
+
if [ -n "$tests_line" ]; then
|
|
12
|
+
[[ "$tests_line" =~ ([0-9]+)[[:space:]]*passed ]] && passed="${BASH_REMATCH[1]}"
|
|
13
|
+
[[ "$tests_line" =~ ([0-9]+)[[:space:]]*failed ]] && failed="${BASH_REMATCH[1]}"
|
|
14
|
+
[[ "$tests_line" =~ ([0-9]+)[[:space:]]*skipped ]] && skipped="${BASH_REMATCH[1]}"
|
|
15
|
+
[[ "$tests_line" =~ ([0-9]+)[[:space:]]*total ]] && total="${BASH_REMATCH[1]}"
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# OPTIMIZATION: Replace bc with BASH arithmetic (75-150ms savings)
|
|
19
|
+
if [[ "$output" =~ Time:[[:space:]]*([0-9.]+)[[:space:]]*s ]]; then
|
|
20
|
+
duration=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[1]} * 1000}")
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
while IFS= read -r line; do
|
|
24
|
+
[[ "$line" =~ ●[[:space:]]*(.*) ]] && failed_names+=("${BASH_REMATCH[1]}")
|
|
25
|
+
done <<< "$output"
|
|
26
|
+
|
|
27
|
+
# OPTIMIZATION: Replace bc with awk
|
|
28
|
+
local pass_rate="0.0000"
|
|
29
|
+
if [ "$total" -gt 0 ]; then
|
|
30
|
+
pass_rate=$(awk "BEGIN {printf \"%.4f\", $passed / $total}")
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# OPTIMIZATION: Single jq call
|
|
34
|
+
local failed_names_json="[]"
|
|
35
|
+
[ ${#failed_names[@]} -gt 0 ] && failed_names_json=$(printf '%s\n' "${failed_names[@]}" | jq -Rs 'split("\n") | map(select(length > 0))')
|
|
36
|
+
|
|
37
|
+
cat <<EOF
|
|
38
|
+
{"framework":"jest","total_tests":$total,"passed_tests":$passed,"failed_tests":$failed,"skipped_tests":$skipped,"pass_rate":$pass_rate,"duration_ms":$duration,"failed_test_names":$failed_names_json}
|
|
39
|
+
EOF
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
parse_mocha_output() {
|
|
43
|
+
local output="$1"
|
|
44
|
+
local total=0 passed=0 failed=0 skipped=0 duration=0
|
|
45
|
+
local failed_names=()
|
|
46
|
+
|
|
47
|
+
[[ "$output" =~ ([0-9]+)[[:space:]]*passing ]] && passed="${BASH_REMATCH[1]}"
|
|
48
|
+
[[ "$output" =~ ([0-9]+)[[:space:]]*failing ]] && failed="${BASH_REMATCH[1]}"
|
|
49
|
+
[[ "$output" =~ ([0-9]+)[[:space:]]*pending ]] && skipped="${BASH_REMATCH[1]}"
|
|
50
|
+
total=$((passed + failed + skipped))
|
|
51
|
+
|
|
52
|
+
# OPTIMIZATION: Replace bc with awk
|
|
53
|
+
if [[ "$output" =~ passing[[:space:]]*\(([0-9]+)ms\) ]]; then
|
|
54
|
+
duration="${BASH_REMATCH[1]}"
|
|
55
|
+
elif [[ "$output" =~ passing[[:space:]]*\(([0-9.]+)s\) ]]; then
|
|
56
|
+
duration=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[1]} * 1000}")
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
while IFS= read -r line; do
|
|
60
|
+
[[ "$line" =~ ^[[:space:]]*[0-9]+\)[[:space:]]*(.*): ]] && failed_names+=("${BASH_REMATCH[1]}")
|
|
61
|
+
done <<< "$output"
|
|
62
|
+
|
|
63
|
+
# OPTIMIZATION: Replace bc with awk
|
|
64
|
+
local pass_rate="0.0000"
|
|
65
|
+
if [ "$total" -gt 0 ]; then
|
|
66
|
+
pass_rate=$(awk "BEGIN {printf \"%.4f\", $passed / $total}")
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# OPTIMIZATION: Single jq call
|
|
70
|
+
local failed_names_json="[]"
|
|
71
|
+
[ ${#failed_names[@]} -gt 0 ] && failed_names_json=$(printf '%s\n' "${failed_names[@]}" | jq -Rs 'split("\n") | map(select(length > 0))')
|
|
72
|
+
|
|
73
|
+
cat <<EOF
|
|
74
|
+
{"framework":"mocha","total_tests":$total,"passed_tests":$passed,"failed_tests":$failed,"skipped_tests":$skipped,"pass_rate":$pass_rate,"duration_ms":$duration,"failed_test_names":$failed_names_json}
|
|
75
|
+
EOF
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
parse_pytest_output() {
|
|
79
|
+
local output="$1"
|
|
80
|
+
local total=0 passed=0 failed=0 skipped=0 duration=0
|
|
81
|
+
local failed_names=()
|
|
82
|
+
|
|
83
|
+
[[ "$output" =~ ([0-9]+)[[:space:]]*passed ]] && passed="${BASH_REMATCH[1]}"
|
|
84
|
+
[[ "$output" =~ ([0-9]+)[[:space:]]*failed ]] && failed="${BASH_REMATCH[1]}"
|
|
85
|
+
[[ "$output" =~ ([0-9]+)[[:space:]]*skipped ]] && skipped="${BASH_REMATCH[1]}"
|
|
86
|
+
total=$((passed + failed + skipped))
|
|
87
|
+
|
|
88
|
+
# OPTIMIZATION: Replace bc with awk
|
|
89
|
+
[[ "$output" =~ in[[:space:]]+([0-9.]+)s ]] && duration=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[1]} * 1000}")
|
|
90
|
+
|
|
91
|
+
while IFS= read -r line; do
|
|
92
|
+
[[ "$line" =~ FAILED[[:space:]]+([^[:space:]]+) ]] && failed_names+=("${BASH_REMATCH[1]}")
|
|
93
|
+
done <<< "$output"
|
|
94
|
+
|
|
95
|
+
# OPTIMIZATION: Replace bc with awk
|
|
96
|
+
local pass_rate="0.0000"
|
|
97
|
+
if [ "$total" -gt 0 ]; then
|
|
98
|
+
pass_rate=$(awk "BEGIN {printf \"%.4f\", $passed / $total}")
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# OPTIMIZATION: Single jq call
|
|
102
|
+
local failed_names_json="[]"
|
|
103
|
+
[ ${#failed_names[@]} -gt 0 ] && failed_names_json=$(printf '%s\n' "${failed_names[@]}" | jq -Rs 'split("\n") | map(select(length > 0))')
|
|
104
|
+
|
|
105
|
+
cat <<EOF
|
|
106
|
+
{"framework":"pytest","total_tests":$total,"passed_tests":$passed,"failed_tests":$failed,"skipped_tests":$skipped,"pass_rate":$pass_rate,"duration_ms":$duration,"failed_test_names":$failed_names_json}
|
|
107
|
+
EOF
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
parse_tap_output() {
|
|
111
|
+
local output="$1"
|
|
112
|
+
local total=0 passed=0 failed=0 skipped=0
|
|
113
|
+
local failed_names=()
|
|
114
|
+
|
|
115
|
+
[[ "$output" =~ 1\.\.([0-9]+) ]] && total="${BASH_REMATCH[1]}"
|
|
116
|
+
passed=$(echo "$output" | grep -c "^ok " || true)
|
|
117
|
+
failed=$(echo "$output" | grep -c "^not ok " || true)
|
|
118
|
+
skipped=$(echo "$output" | grep -c "^ok .* # SKIP" || true)
|
|
119
|
+
passed=$((passed - skipped))
|
|
120
|
+
|
|
121
|
+
while IFS= read -r line; do
|
|
122
|
+
[[ "$line" =~ ^not\ ok\ [0-9]+\ (.*) ]] && failed_names+=("${BASH_REMATCH[1]}")
|
|
123
|
+
done <<< "$output"
|
|
124
|
+
|
|
125
|
+
# OPTIMIZATION: Replace bc with awk
|
|
126
|
+
local pass_rate="0.0000"
|
|
127
|
+
if [ "$total" -gt 0 ]; then
|
|
128
|
+
pass_rate=$(awk "BEGIN {printf \"%.4f\", $passed / $total}")
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
# OPTIMIZATION: Single jq call
|
|
132
|
+
local failed_names_json="[]"
|
|
133
|
+
[ ${#failed_names[@]} -gt 0 ] && failed_names_json=$(printf '%s\n' "${failed_names[@]}" | jq -Rs 'split("\n") | map(select(length > 0))')
|
|
134
|
+
|
|
135
|
+
cat <<EOF
|
|
136
|
+
{"framework":"tap","total_tests":$total,"passed_tests":$passed,"failed_tests":$failed,"skipped_tests":$skipped,"pass_rate":$pass_rate,"duration_ms":0,"failed_test_names":$failed_names_json}
|
|
137
|
+
EOF
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
parse_junit_xml() {
|
|
141
|
+
local xml_file="$1"
|
|
142
|
+
[ ! -f "$xml_file" ] && echo '{"error":"File not found"}' && return 1
|
|
143
|
+
|
|
144
|
+
local total=0 failures=0 errors=0 skipped=0 duration=0
|
|
145
|
+
|
|
146
|
+
if command -v xmllint &>/dev/null; then
|
|
147
|
+
total=$(xmllint --xpath "sum(//testsuite/@tests)" "$xml_file" 2>/dev/null || echo "0")
|
|
148
|
+
failures=$(xmllint --xpath "sum(//testsuite/@failures)" "$xml_file" 2>/dev/null || echo "0")
|
|
149
|
+
errors=$(xmllint --xpath "sum(//testsuite/@errors)" "$xml_file" 2>/dev/null || echo "0")
|
|
150
|
+
skipped=$(xmllint --xpath "sum(//testsuite/@skipped)" "$xml_file" 2>/dev/null || echo "0")
|
|
151
|
+
duration=$(xmllint --xpath "sum(//testsuite/@time)" "$xml_file" 2>/dev/null || echo "0")
|
|
152
|
+
else
|
|
153
|
+
total=$(grep -oP 'tests="\K[0-9]+' "$xml_file" | awk '{s+=$1} END {print s}')
|
|
154
|
+
failures=$(grep -oP 'failures="\K[0-9]+' "$xml_file" | awk '{s+=$1} END {print s}')
|
|
155
|
+
errors=$(grep -oP 'errors="\K[0-9]+' "$xml_file" | awk '{s+=$1} END {print s}')
|
|
156
|
+
skipped=$(grep -oP 'skipped="\K[0-9]+' "$xml_file" | awk '{s+=$1} END {print s}')
|
|
157
|
+
duration=$(grep -oP 'time="\K[0-9.]+' "$xml_file" | awk '{s+=$1} END {print s}')
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
total=${total:-0} failures=${failures:-0} errors=${errors:-0} skipped=${skipped:-0} duration=${duration:-0}
|
|
161
|
+
local failed=$((failures + errors))
|
|
162
|
+
local passed=$((total - failed - skipped))
|
|
163
|
+
|
|
164
|
+
# OPTIMIZATION: Replace bc with awk
|
|
165
|
+
local duration_ms=$(awk "BEGIN {printf \"%.0f\", $duration * 1000}")
|
|
166
|
+
|
|
167
|
+
local pass_rate="0.0000"
|
|
168
|
+
if [ "$total" -gt 0 ]; then
|
|
169
|
+
pass_rate=$(awk "BEGIN {printf \"%.4f\", $passed / $total}")
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
cat <<EOF
|
|
173
|
+
{"framework":"junit","total_tests":$total,"passed_tests":$passed,"failed_tests":$failed,"skipped_tests":$skipped,"pass_rate":$pass_rate,"duration_ms":$duration_ms,"failed_test_names":[]}
|
|
174
|
+
EOF
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
parse_go_test_output() {
|
|
178
|
+
local output="$1"
|
|
179
|
+
local total=0 passed=0 failed=0 skipped=0 duration=0
|
|
180
|
+
local failed_names=()
|
|
181
|
+
|
|
182
|
+
passed=$(echo "$output" | grep -c "^--- PASS:" || true)
|
|
183
|
+
failed=$(echo "$output" | grep -c "^--- FAIL:" || true)
|
|
184
|
+
skipped=$(echo "$output" | grep -c "^--- SKIP:" || true)
|
|
185
|
+
total=$((passed + failed + skipped))
|
|
186
|
+
|
|
187
|
+
while IFS= read -r line; do
|
|
188
|
+
[[ "$line" =~ ^---\ FAIL:\ (.*) ]] && failed_names+=("${BASH_REMATCH[1]}")
|
|
189
|
+
done <<< "$output"
|
|
190
|
+
|
|
191
|
+
# OPTIMIZATION: Replace bc with awk
|
|
192
|
+
[[ "$output" =~ ok[[:space:]]+[^[:space:]]+[[:space:]]+([0-9.]+)s ]] && duration=$(awk "BEGIN {printf \"%.0f\", ${BASH_REMATCH[1]} * 1000}")
|
|
193
|
+
|
|
194
|
+
local pass_rate="0.0000"
|
|
195
|
+
if [ "$total" -gt 0 ]; then
|
|
196
|
+
pass_rate=$(awk "BEGIN {printf \"%.4f\", $passed / $total}")
|
|
197
|
+
fi
|
|
198
|
+
|
|
199
|
+
# OPTIMIZATION: Single jq call
|
|
200
|
+
local failed_names_json="[]"
|
|
201
|
+
[ ${#failed_names[@]} -gt 0 ] && failed_names_json=$(printf '%s\n' "${failed_names[@]}" | jq -Rs 'split("\n") | map(select(length > 0))')
|
|
202
|
+
|
|
203
|
+
cat <<EOF
|
|
204
|
+
{"framework":"go","total_tests":$total,"passed_tests":$passed,"failed_tests":$failed,"skipped_tests":$skipped,"pass_rate":$pass_rate,"duration_ms":$duration,"failed_test_names":$failed_names_json}
|
|
205
|
+
EOF
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
auto_detect_framework() {
|
|
209
|
+
local input="$1"
|
|
210
|
+
|
|
211
|
+
if [ -f "$input" ]; then
|
|
212
|
+
if grep -q "<testsuite" "$input" 2>/dev/null; then
|
|
213
|
+
echo "junit"
|
|
214
|
+
return 0
|
|
215
|
+
fi
|
|
216
|
+
input=$(cat "$input")
|
|
217
|
+
fi
|
|
218
|
+
|
|
219
|
+
if [[ "$input" =~ Test\ Suites: ]] || [[ "$input" =~ PASS[[:space:]]+.*\.test\.(js|ts) ]]; then
|
|
220
|
+
echo "jest"
|
|
221
|
+
return 0
|
|
222
|
+
fi
|
|
223
|
+
|
|
224
|
+
if [[ "$input" =~ [0-9]+\ passing ]] && [[ "$input" =~ [0-9]+\ failing ]]; then
|
|
225
|
+
echo "mocha"
|
|
226
|
+
return 0
|
|
227
|
+
fi
|
|
228
|
+
|
|
229
|
+
if [[ "$input" =~ ====.*passed.*==== ]] || [[ "$input" =~ FAILED.*\.py:: ]]; then
|
|
230
|
+
echo "pytest"
|
|
231
|
+
return 0
|
|
232
|
+
fi
|
|
233
|
+
|
|
234
|
+
if [[ "$input" =~ 1\.\.[0-9]+ ]] || [[ "$input" =~ ok\ [0-9]+ ]] || [[ "$input" =~ not\ ok\ [0-9]+ ]]; then
|
|
235
|
+
echo "tap"
|
|
236
|
+
return 0
|
|
237
|
+
fi
|
|
238
|
+
|
|
239
|
+
if [[ "$input" =~ ---\ PASS: ]] || [[ "$input" =~ ---\ FAIL: ]]; then
|
|
240
|
+
echo "go"
|
|
241
|
+
return 0
|
|
242
|
+
fi
|
|
243
|
+
|
|
244
|
+
echo "unknown"
|
|
245
|
+
return 1
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
parse_test_results() {
|
|
249
|
+
local framework="$1"
|
|
250
|
+
local input="$2"
|
|
251
|
+
|
|
252
|
+
if [ "$framework" = "auto" ]; then
|
|
253
|
+
framework=$(auto_detect_framework "$input")
|
|
254
|
+
if [ "$framework" = "unknown" ]; then
|
|
255
|
+
echo '{"error":"Unable to auto-detect testing framework"}'
|
|
256
|
+
return 1
|
|
257
|
+
fi
|
|
258
|
+
fi
|
|
259
|
+
|
|
260
|
+
local output="$input"
|
|
261
|
+
[ -f "$input" ] && output=$(cat "$input")
|
|
262
|
+
|
|
263
|
+
case "$framework" in
|
|
264
|
+
jest) parse_jest_output "$output" ;;
|
|
265
|
+
mocha) parse_mocha_output "$output" ;;
|
|
266
|
+
pytest) parse_pytest_output "$output" ;;
|
|
267
|
+
tap) parse_tap_output "$output" ;;
|
|
268
|
+
junit) parse_junit_xml "$input" ;;
|
|
269
|
+
go) parse_go_test_output "$output" ;;
|
|
270
|
+
*) echo '{"error":"Unknown framework"}' && return 1 ;;
|
|
271
|
+
esac
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
|
|
275
|
+
[ $# -lt 2 ] && echo "Usage: $0 <framework|auto> <output_file_or_string>" && exit 1
|
|
276
|
+
parse_test_results "$1" "$2"
|
|
277
|
+
fi
|
|
@@ -64,6 +64,16 @@ source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/security_utils.sh"
|
|
|
64
64
|
HELPERS_DIR="$SCRIPT_DIR/helpers"
|
|
65
65
|
REDIS_COORD_SKILL="$PROJECT_ROOT/.claude/skills/cfn-redis-coordination"
|
|
66
66
|
|
|
67
|
+
# Validate Redis connectivity
|
|
68
|
+
REDIS_PORT="${CFN_REDIS_PORT:-6379}"
|
|
69
|
+
REDIS_HOST="${CFN_REDIS_HOST:-localhost}"
|
|
70
|
+
if command -v redis-cli &>/dev/null; then
|
|
71
|
+
if ! redis-cli -h "${REDIS_HOST}" -p "${REDIS_PORT}" ping &>/dev/null; then
|
|
72
|
+
echo "⚠️ Warning: Redis not reachable at ${REDIS_HOST}:${REDIS_PORT}" >&2
|
|
73
|
+
echo " Redis coordination features may not function correctly" >&2
|
|
74
|
+
fi
|
|
75
|
+
fi
|
|
76
|
+
|
|
67
77
|
# Configuration
|
|
68
78
|
TASK_ID=""
|
|
69
79
|
MODE="standard"
|
|
@@ -71,6 +81,7 @@ LOOP3_AGENTS=""
|
|
|
71
81
|
LOOP2_AGENTS=""
|
|
72
82
|
PRODUCT_OWNER=""
|
|
73
83
|
MAX_ITERATIONS=10
|
|
84
|
+
MAX_ALLOWED_ITERATIONS=100 # Security: Prevent resource exhaustion via unbounded iterations
|
|
74
85
|
MIN_QUORUM_LOOP3="0.66"
|
|
75
86
|
MIN_QUORUM_LOOP2="0.66"
|
|
76
87
|
EPIC_CONTEXT=""
|
|
@@ -82,8 +93,8 @@ PHASE_ID=""
|
|
|
82
93
|
# Mode-specific thresholds
|
|
83
94
|
declare -A GATE_THRESHOLD=(
|
|
84
95
|
[mvp]=0.70
|
|
85
|
-
[standard]=0.
|
|
86
|
-
[enterprise]=0.
|
|
96
|
+
[standard]=0.95
|
|
97
|
+
[enterprise]=0.98
|
|
87
98
|
)
|
|
88
99
|
|
|
89
100
|
declare -A CONSENSUS_THRESHOLD=(
|
|
@@ -162,9 +173,20 @@ while [[ $# -gt 0 ]]; do
|
|
|
162
173
|
echo "Max iterations must be a positive integer"
|
|
163
174
|
exit 1
|
|
164
175
|
fi
|
|
176
|
+
# SECURITY FIX: Enforce upper bound to prevent resource exhaustion
|
|
177
|
+
if [[ "$2" -gt "$MAX_ALLOWED_ITERATIONS" ]]; then
|
|
178
|
+
echo "❌ MAX_ITERATIONS=$2 exceeds limit of $MAX_ALLOWED_ITERATIONS" >&2
|
|
179
|
+
echo " (Use --max-iterations <N> where N <= $MAX_ALLOWED_ITERATIONS)" >&2
|
|
180
|
+
exit 1
|
|
181
|
+
fi
|
|
182
|
+
if [[ "$2" -lt 1 ]]; then
|
|
183
|
+
echo "❌ MAX_ITERATIONS must be at least 1" >&2
|
|
184
|
+
exit 1
|
|
185
|
+
fi
|
|
165
186
|
MAX_ITERATIONS="$2"
|
|
166
187
|
shift 2
|
|
167
188
|
;;
|
|
189
|
+
|
|
168
190
|
--min-quorum-loop3)
|
|
169
191
|
if [[ $# -lt 2 ]]; then
|
|
170
192
|
echo "Error: --min-quorum-loop3 requires a value"
|
|
@@ -292,11 +314,11 @@ case "$MODE" in
|
|
|
292
314
|
CONSENSUS=${CONSENSUS_THRESHOLD[mvp]:-0.80}
|
|
293
315
|
;;
|
|
294
316
|
standard)
|
|
295
|
-
GATE=${GATE_THRESHOLD[standard]:-0.
|
|
317
|
+
GATE=${GATE_THRESHOLD[standard]:-0.95}
|
|
296
318
|
CONSENSUS=${CONSENSUS_THRESHOLD[standard]:-0.90}
|
|
297
319
|
;;
|
|
298
320
|
enterprise)
|
|
299
|
-
GATE=${GATE_THRESHOLD[enterprise]:-0.
|
|
321
|
+
GATE=${GATE_THRESHOLD[enterprise]:-0.98}
|
|
300
322
|
CONSENSUS=${CONSENSUS_THRESHOLD[enterprise]:-0.95}
|
|
301
323
|
;;
|
|
302
324
|
*)
|
|
@@ -420,6 +442,41 @@ build_agent_context() {
|
|
|
420
442
|
|
|
421
443
|
context="$context | Iteration: $iteration"
|
|
422
444
|
|
|
445
|
+
# Check if jq is available before attempting JSON parsing
|
|
446
|
+
if ! command -v jq &>/dev/null; then
|
|
447
|
+
echo "⚠️ Warning: jq not installed. Test context injection will be skipped" >&2
|
|
448
|
+
echo "$context"
|
|
449
|
+
return
|
|
450
|
+
fi
|
|
451
|
+
|
|
452
|
+
# Inject test failure diagnostics from previous iteration
|
|
453
|
+
if [ "$iteration" -gt 1 ]; then
|
|
454
|
+
local iteration_context_file="/tmp/cfn-iteration-context-${task_id}.json"
|
|
455
|
+
|
|
456
|
+
if [ -f "$iteration_context_file" ]; then
|
|
457
|
+
# Extract failed test summary from iteration context
|
|
458
|
+
local failed_summary=""
|
|
459
|
+
failed_summary=$(jq -r '
|
|
460
|
+
if (.pass_rate? != null)
|
|
461
|
+
and .failed_tests
|
|
462
|
+
and (.failed_tests | length > 0)
|
|
463
|
+
then
|
|
464
|
+
"Previous Test Results: Pass Rate " +
|
|
465
|
+
((.pass_rate * 100) | floor | tostring) +
|
|
466
|
+
"% | Failed Tests: " +
|
|
467
|
+
([.failed_tests[].failed_test_names[]? // empty] | join(", "))
|
|
468
|
+
else
|
|
469
|
+
empty
|
|
470
|
+
end
|
|
471
|
+
' "$iteration_context_file" 2>/dev/null || echo "")
|
|
472
|
+
|
|
473
|
+
if [ -n "$failed_summary" ]; then
|
|
474
|
+
context="$context | $failed_summary"
|
|
475
|
+
echo "📊 Injected test diagnostics from previous iteration" >&2
|
|
476
|
+
fi
|
|
477
|
+
fi
|
|
478
|
+
fi
|
|
479
|
+
|
|
423
480
|
if [[ -n "$feedback" ]]; then
|
|
424
481
|
context="$context | Feedback: $feedback"
|
|
425
482
|
fi
|
|
@@ -448,6 +505,32 @@ function spawn_loop3_agents() {
|
|
|
448
505
|
|
|
449
506
|
echo "[Loop 3] Spawning implementer agents (iteration $iteration)..."
|
|
450
507
|
|
|
508
|
+
# Load success criteria from Redis (if available)
|
|
509
|
+
export AGENT_SUCCESS_CRITERIA=""
|
|
510
|
+
if [[ -n "$task_id" ]] && [[ -x "$SCRIPT_DIR/../cfn-redis-coordination/get-success-criteria.sh" ]]; then
|
|
511
|
+
SUCCESS_CRITERIA=$("$SCRIPT_DIR/../cfn-redis-coordination/get-success-criteria.sh" --task-id "$task_id" 2>/dev/null || echo "")
|
|
512
|
+
|
|
513
|
+
if [[ -n "$SUCCESS_CRITERIA" ]]; then
|
|
514
|
+
# SECURITY FIX: Validate JSON size before parsing (prevent DoS)
|
|
515
|
+
CRITERIA_SIZE=$(echo -n "$SUCCESS_CRITERIA" | wc -c)
|
|
516
|
+
MAX_SIZE=10485760 # 10MB
|
|
517
|
+
|
|
518
|
+
if [[ "$CRITERIA_SIZE" -gt "$MAX_SIZE" ]]; then
|
|
519
|
+
echo " ❌ Success criteria exceeds maximum size (10MB): ${CRITERIA_SIZE} bytes" >&2
|
|
520
|
+
exit 1
|
|
521
|
+
fi
|
|
522
|
+
|
|
523
|
+
# Validate JSON before exporting
|
|
524
|
+
if echo "$SUCCESS_CRITERIA" | jq empty 2>/dev/null; then
|
|
525
|
+
export AGENT_SUCCESS_CRITERIA="$SUCCESS_CRITERIA"
|
|
526
|
+
TEST_SUITE_COUNT=$(echo "$SUCCESS_CRITERIA" | jq -r '.test_suites | length' 2>/dev/null || echo "0")
|
|
527
|
+
echo " ✅ Success criteria loaded ($TEST_SUITE_COUNT test suites)" >&2
|
|
528
|
+
else
|
|
529
|
+
echo " ⚠️ Invalid success criteria JSON - skipping" >&2
|
|
530
|
+
fi
|
|
531
|
+
fi
|
|
532
|
+
fi
|
|
533
|
+
|
|
451
534
|
# Convert comma-separated agents to array
|
|
452
535
|
IFS=',' read -ra AGENT_ARRAY <<< "$agents"
|
|
453
536
|
|
|
@@ -476,21 +559,62 @@ function spawn_loop3_agents() {
|
|
|
476
559
|
# Docker-based spawning (prevents WebAssembly OOM)
|
|
477
560
|
echo " → Docker mode: spawning via container" >&2
|
|
478
561
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
562
|
+
# SECURITY FIX: Sanitize Docker environment variables to prevent command injection
|
|
563
|
+
CFN_DOCKER_IMAGE_SAFE=$(sanitize_docker_var "${CFN_DOCKER_IMAGE:-claude-flow-novice:agent}") || {
|
|
564
|
+
echo "❌ Invalid CFN_DOCKER_IMAGE" >&2
|
|
565
|
+
exit 1
|
|
566
|
+
}
|
|
567
|
+
CFN_DOCKER_NETWORK_SAFE=$(sanitize_docker_var "${CFN_DOCKER_NETWORK:-mcp-network}") || {
|
|
568
|
+
echo "❌ Invalid CFN_DOCKER_NETWORK" >&2
|
|
569
|
+
exit 1
|
|
570
|
+
}
|
|
571
|
+
CFN_MEMORY_LIMIT_SAFE=$(sanitize_docker_var "${CFN_MEMORY_LIMIT:-2g}") || {
|
|
572
|
+
echo "❌ Invalid CFN_MEMORY_LIMIT" >&2
|
|
573
|
+
exit 1
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
# Build Docker command as array (prevents injection, no eval needed)
|
|
577
|
+
DOCKER_CMD=(
|
|
578
|
+
docker run --detach
|
|
579
|
+
--name "agent-${safe_agent_id}"
|
|
580
|
+
--memory "$CFN_MEMORY_LIMIT_SAFE"
|
|
581
|
+
--cpus 1.5
|
|
582
|
+
--network "$CFN_DOCKER_NETWORK_SAFE"
|
|
583
|
+
--env REDIS_URL=redis://redis:6379
|
|
584
|
+
--env "AGENT_ID=${safe_agent_id}"
|
|
585
|
+
--env "AGENT_TYPE=${safe_agent_type}"
|
|
586
|
+
--env "TASK_ID=${safe_task_id}"
|
|
587
|
+
--env "ITERATION=${iteration}"
|
|
588
|
+
)
|
|
589
|
+
|
|
590
|
+
# SECURITY FIX: Base64-encode success criteria to prevent shell injection
|
|
591
|
+
if [[ -n "${AGENT_SUCCESS_CRITERIA:-}" ]]; then
|
|
592
|
+
ENCODED_CRITERIA=$(echo -n "$AGENT_SUCCESS_CRITERIA" | base64 -w 0)
|
|
593
|
+
|
|
594
|
+
# SECURITY FIX: Validate size AFTER encoding to prevent expansion bypass (10MB → 13.9MB)
|
|
595
|
+
ENCODED_SIZE=$(echo -n "$ENCODED_CRITERIA" | wc -c)
|
|
596
|
+
MAX_ENCODED_SIZE=10485760 # 10MB
|
|
597
|
+
|
|
598
|
+
if [[ "$ENCODED_SIZE" -gt "$MAX_ENCODED_SIZE" ]]; then
|
|
599
|
+
echo "❌ Encoded success criteria exceeds 10MB limit: ${ENCODED_SIZE} bytes" >&2
|
|
600
|
+
echo " (Original: $(echo -n "$AGENT_SUCCESS_CRITERIA" | wc -c) bytes, Expanded: +33% via base64)" >&2
|
|
601
|
+
exit 1
|
|
602
|
+
fi
|
|
603
|
+
|
|
604
|
+
DOCKER_CMD+=(--env "AGENT_SUCCESS_CRITERIA_B64=${ENCODED_CRITERIA}")
|
|
605
|
+
fi
|
|
606
|
+
|
|
607
|
+
# Add volumes and image
|
|
608
|
+
DOCKER_CMD+=(
|
|
609
|
+
--volume "${PROJECT_ROOT}/.claude:/app/.claude:ro"
|
|
610
|
+
--volume "${PROJECT_ROOT}/packages:/app/packages"
|
|
611
|
+
--volume "/tmp/agent-workspace-${safe_agent_id}:/app/workspace"
|
|
612
|
+
"$CFN_DOCKER_IMAGE_SAFE"
|
|
613
|
+
sh -c "npx claude-flow-novice agent \"${safe_agent_type}\" --task-id \"${safe_task_id}\" --agent-id \"${safe_agent_id}\" --iteration \"${iteration}\""
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
# Execute safely without eval (prevents command injection)
|
|
617
|
+
"${DOCKER_CMD[@]}" >/dev/null 2>&1 &
|
|
494
618
|
|
|
495
619
|
AGENT_PID=$!
|
|
496
620
|
else
|
|
@@ -534,8 +658,13 @@ function spawn_loop3_agents() {
|
|
|
534
658
|
echo "🔍 Started monitoring for $UNIQUE_AGENT_ID (Agent PID: $AGENT_PID, Monitor PID: $MONITOR_PID)" >&2
|
|
535
659
|
fi
|
|
536
660
|
|
|
537
|
-
#
|
|
538
|
-
redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}"
|
|
661
|
+
# SECURITY FIX: Atomic SADD + EXPIRE using Lua script (prevent race condition)
|
|
662
|
+
redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" --eval - \
|
|
663
|
+
"swarm:${task_id}:loop3:agent_ids:iteration${iteration}" "$UNIQUE_AGENT_ID" <<'LUA' >/dev/null
|
|
664
|
+
redis.call('SADD', KEYS[1], ARGV[1])
|
|
665
|
+
redis.call('EXPIRE', KEYS[1], 86400)
|
|
666
|
+
return redis.call('SCARD', KEYS[1])
|
|
667
|
+
LUA
|
|
539
668
|
done
|
|
540
669
|
|
|
541
670
|
echo "[Loop 3] All agents spawned"
|
|
@@ -747,6 +876,32 @@ function spawn_loop2_agents() {
|
|
|
747
876
|
|
|
748
877
|
echo "[Loop 2] Spawning validator agents (iteration $iteration)..."
|
|
749
878
|
|
|
879
|
+
# Load success criteria from Redis (if available)
|
|
880
|
+
export AGENT_SUCCESS_CRITERIA=""
|
|
881
|
+
if [[ -n "$task_id" ]] && [[ -x "$SCRIPT_DIR/../cfn-redis-coordination/get-success-criteria.sh" ]]; then
|
|
882
|
+
SUCCESS_CRITERIA=$("$SCRIPT_DIR/../cfn-redis-coordination/get-success-criteria.sh" --task-id "$task_id" 2>/dev/null || echo "")
|
|
883
|
+
|
|
884
|
+
if [[ -n "$SUCCESS_CRITERIA" ]]; then
|
|
885
|
+
# SECURITY FIX: Validate JSON size before parsing (prevent DoS)
|
|
886
|
+
CRITERIA_SIZE=$(echo -n "$SUCCESS_CRITERIA" | wc -c)
|
|
887
|
+
MAX_SIZE=10485760 # 10MB
|
|
888
|
+
|
|
889
|
+
if [[ "$CRITERIA_SIZE" -gt "$MAX_SIZE" ]]; then
|
|
890
|
+
echo " ❌ Success criteria exceeds maximum size (10MB): ${CRITERIA_SIZE} bytes" >&2
|
|
891
|
+
exit 1
|
|
892
|
+
fi
|
|
893
|
+
|
|
894
|
+
# Validate JSON before exporting
|
|
895
|
+
if echo "$SUCCESS_CRITERIA" | jq empty 2>/dev/null; then
|
|
896
|
+
export AGENT_SUCCESS_CRITERIA="$SUCCESS_CRITERIA"
|
|
897
|
+
TEST_SUITE_COUNT=$(echo "$SUCCESS_CRITERIA" | jq -r '.test_suites | length' 2>/dev/null || echo "0")
|
|
898
|
+
echo " ✅ Success criteria loaded ($TEST_SUITE_COUNT test suites)" >&2
|
|
899
|
+
else
|
|
900
|
+
echo " ⚠️ Invalid success criteria JSON - skipping" >&2
|
|
901
|
+
fi
|
|
902
|
+
fi
|
|
903
|
+
fi
|
|
904
|
+
|
|
750
905
|
# Convert comma-separated agents to array
|
|
751
906
|
IFS=',' read -ra AGENT_ARRAY <<< "$agents"
|
|
752
907
|
|
|
@@ -788,7 +943,13 @@ function spawn_loop2_agents() {
|
|
|
788
943
|
--namespace "swarm" >/dev/null
|
|
789
944
|
|
|
790
945
|
# Store agent ID mapping for later retrieval using Redis SADD for set storage
|
|
791
|
-
|
|
946
|
+
# SECURITY FIX: Atomic SADD + EXPIRE using Lua script (prevent race condition)
|
|
947
|
+
redis-cli -h "${REDIS_HOST:-localhost}" -p "${REDIS_PORT:-6379}" --eval - \
|
|
948
|
+
"swarm:${task_id}:loop2:agent_ids:iteration${iteration}" "$UNIQUE_VALIDATOR_ID" <<'LUA' >/dev/null
|
|
949
|
+
redis.call('SADD', KEYS[1], ARGV[1])
|
|
950
|
+
redis.call('EXPIRE', KEYS[1], 86400)
|
|
951
|
+
return redis.call('SCARD', KEYS[1])
|
|
952
|
+
LUA
|
|
792
953
|
done
|
|
793
954
|
|
|
794
955
|
echo "[Loop 2] All agents spawned"
|
|
@@ -804,7 +965,7 @@ function spawn_product_owner() {
|
|
|
804
965
|
# BLOCKER #2 FIX: Match execute-decision.sh actual parameters
|
|
805
966
|
# Required: --task-id, --agent-id, --consensus, --threshold, --iteration, --max-iterations
|
|
806
967
|
local decision_output
|
|
807
|
-
decision_output=$("$
|
|
968
|
+
decision_output=$("$PROJECT_ROOT/.claude/skills/cfn-product-owner-decision/execute-decision.sh" \
|
|
808
969
|
--task-id "$task_id" \
|
|
809
970
|
--agent-id "$PRODUCT_OWNER" \
|
|
810
971
|
--consensus "$LOOP2_FINAL_CONSENSUS" \
|
|
@@ -96,4 +96,28 @@ function validate_agent_list() {
|
|
|
96
96
|
done
|
|
97
97
|
|
|
98
98
|
return 0
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
# SECURITY FIX: Sanitize Docker environment variables to prevent command injection
|
|
102
|
+
# Allowed characters: alphanumeric, dash, colon, slash, dot, underscore
|
|
103
|
+
# This prevents injection attacks via malicious CFN_DOCKER_IMAGE, CFN_DOCKER_NETWORK, etc.
|
|
104
|
+
function sanitize_docker_var() {
|
|
105
|
+
local var="$1"
|
|
106
|
+
local pattern="^[a-zA-Z0-9._:/-]+$"
|
|
107
|
+
|
|
108
|
+
# Check if input is empty
|
|
109
|
+
if [ -z "$var" ]; then
|
|
110
|
+
echo "Error: Docker variable cannot be empty" >&2
|
|
111
|
+
return 1
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
# Validate against allowed pattern (no semicolons, backticks, pipes, etc.)
|
|
115
|
+
if [[ ! "$var" =~ $pattern ]]; then
|
|
116
|
+
echo "❌ Invalid characters in Docker variable: $var" >&2
|
|
117
|
+
echo " Only alphanumeric, dash, colon, slash, dot, and underscore allowed" >&2
|
|
118
|
+
return 1
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
# If all checks pass, echo the sanitized input
|
|
122
|
+
echo "$var"
|
|
99
123
|
}
|