claude-flow-novice 2.9.0 → 2.10.0
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/agents/cfn-dev-team/CLAUDE.md +1086 -0
- package/.claude/agents/cfn-dev-team/README.md +116 -0
- package/.claude/agents/cfn-dev-team/architecture/api-designer-persona.md +149 -0
- package/.claude/agents/cfn-dev-team/architecture/base-template-generator.md +196 -0
- package/.claude/agents/cfn-dev-team/architecture/goal-planner.md +183 -0
- package/.claude/agents/cfn-dev-team/architecture/planner.md +182 -0
- package/.claude/agents/cfn-dev-team/architecture/system-architect.md +162 -0
- package/.claude/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +540 -0
- package/.claude/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +20 -14
- package/.claude/agents/cfn-dev-team/coordinators/consensus-builder.md +167 -0
- package/.claude/agents/cfn-dev-team/dev-ops/devops-engineer.md +148 -0
- package/.claude/agents/cfn-dev-team/dev-ops/github-commit-agent.md +118 -0
- package/.claude/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +540 -0
- package/.claude/agents/cfn-dev-team/developers/backend-dev.md +20 -0
- package/.claude/agents/cfn-dev-team/developers/data/data-engineer.md +585 -0
- package/.claude/agents/cfn-dev-team/developers/database/database-architect.md +276 -0
- package/.claude/agents/cfn-dev-team/developers/dev-backend-api.md +147 -0
- package/.claude/agents/cfn-dev-team/developers/frontend/mobile-dev.md +218 -0
- package/.claude/agents/cfn-dev-team/developers/{react-frontend-engineer.md → frontend/react-frontend-engineer.md} +53 -5
- package/.claude/agents/cfn-dev-team/developers/frontend/spec-mobile-react-native.md +199 -0
- package/.claude/agents/cfn-dev-team/developers/graphql-specialist.md +615 -0
- package/.claude/agents/cfn-dev-team/developers/rust-developer.md +174 -0
- package/.claude/agents/cfn-dev-team/documentation/README-VALIDATION.md +243 -0
- package/.claude/agents/cfn-dev-team/documentation/agent-type-guidelines.md +465 -0
- package/.claude/agents/cfn-dev-team/documentation/api-docs.md +103 -0
- package/.claude/agents/cfn-dev-team/documentation/docs-api-openapi.md +98 -0
- package/.claude/agents/cfn-dev-team/documentation/pseudocode.md +159 -0
- package/.claude/agents/cfn-dev-team/documentation/specification.md +157 -0
- package/.claude/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +109 -0
- package/.claude/agents/cfn-dev-team/{coordinators → product-owners}/cto-agent.md +8 -6
- package/.claude/agents/cfn-dev-team/product-owners/power-user-persona.md +190 -0
- package/.claude/agents/cfn-dev-team/{coordinators → product-owners}/product-owner.md +85 -59
- package/.claude/agents/cfn-dev-team/reviewers/quality/analyze-code-quality.md +141 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/code-analyzer.md +200 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/cyclomatic-complexity-reducer.md +321 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +238 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +101 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/quality-metrics.md +375 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/security-specialist.md +193 -0
- package/.claude/agents/cfn-dev-team/reviewers/reviewer.md +39 -0
- package/.claude/agents/cfn-dev-team/testers/interaction-tester.md +31 -0
- package/.claude/agents/cfn-dev-team/testers/load-testing-specialist.md +469 -0
- package/.claude/agents/cfn-dev-team/testers/playwright-tester.md +24 -0
- package/.claude/agents/cfn-dev-team/testers/tester.md +20 -0
- package/.claude/agents/cfn-dev-team/utility/agent-builder.md +151 -0
- package/.claude/agents/cfn-dev-team/utility/analyst.md +178 -0
- package/.claude/agents/cfn-dev-team/utility/claude-code-expert.md +1043 -0
- package/.claude/agents/cfn-dev-team/utility/code-booster.md +139 -0
- package/.claude/agents/cfn-dev-team/utility/context-curator.md +99 -0
- package/.claude/agents/cfn-dev-team/{developers → utility}/researcher.md +6 -4
- package/.claude/commands/cfn/CFN_LOOP_FRONTEND.md +741 -0
- package/.claude/commands/cfn/CFN_LOOP_TASK_MODE.md +353 -0
- package/.claude/commands/cfn/cfn-loop-frontend.md +555 -0
- package/.claude/commands/cfn/cfn-loop.md +168 -7
- package/{CFN-CLAUDE.md → .claude/root-claude-distribute/CFN-CLAUDE.md} +23 -3
- package/.claude/skills/cfn-ace-system/SKILL.md +364 -0
- package/.claude/skills/cfn-ace-system/add-bullet.sh +145 -0
- package/.claude/skills/cfn-ace-system/analyze-anti-pattern-effectiveness.sh +56 -0
- package/.claude/skills/cfn-ace-system/classify-task.sh +18 -0
- package/.claude/skills/cfn-ace-system/export-ace-metrics.sh +48 -0
- package/.claude/skills/cfn-ace-system/extract-tags.sh +385 -0
- package/.claude/skills/cfn-ace-system/format-negative-context.sh +180 -0
- package/.claude/skills/cfn-ace-system/init-indexes.sql +160 -0
- package/.claude/skills/cfn-ace-system/invoke-context-curate.sh +192 -0
- package/.claude/skills/cfn-ace-system/invoke-context-inject.sh +361 -0
- package/.claude/skills/cfn-ace-system/invoke-context-query.sh +139 -0
- package/.claude/skills/cfn-ace-system/invoke-context-reflect.sh +343 -0
- package/.claude/skills/cfn-ace-system/invoke-context-stats.sh +227 -0
- package/.claude/skills/cfn-ace-system/log-merge.sh +67 -0
- package/.claude/skills/cfn-ace-system/monitor-injection-performance.sh +138 -0
- package/.claude/skills/cfn-ace-system/optimize-injection-pipeline.sh +169 -0
- package/.claude/skills/cfn-ace-system/query-anti-patterns.sh +276 -0
- package/.claude/skills/cfn-ace-system/query-contexts.sh +150 -0
- package/.claude/skills/cfn-ace-system/query-reflections.sh +35 -0
- package/.claude/skills/cfn-ace-system/schema/001-create-context-reflections.sql +237 -0
- package/.claude/skills/cfn-ace-system/schema/README.md +723 -0
- package/.claude/skills/cfn-ace-system/schema/SCHEMA_DESIGN_SUMMARY.md +564 -0
- package/.claude/skills/cfn-ace-system/schema/populate-test-data-simple.sh +62 -0
- package/.claude/skills/cfn-ace-system/schema/populate-test-data.sh +247 -0
- package/.claude/skills/cfn-ace-system/schema/run-migration.sh +231 -0
- package/.claude/skills/cfn-ace-system/schema/validate-schema.sql +280 -0
- package/.claude/skills/cfn-ace-system/score-relevance-adapter.sh +138 -0
- package/.claude/skills/cfn-ace-system/score-relevance.sh +253 -0
- package/.claude/skills/cfn-ace-system/sprint-7-lessons.json +46 -0
- package/.claude/skills/cfn-ace-system/store-reflection.sh +46 -0
- package/.claude/skills/cfn-ace-system/test-ace-skill.sh +312 -0
- package/.claude/skills/cfn-ace-system/track-ab-test.sh +42 -0
- package/.claude/skills/cfn-ace-system/update-reflection.sh +41 -0
- package/.claude/skills/cfn-agent-discovery/SKILL.md +40 -0
- package/.claude/skills/cfn-agent-discovery/agents-registry-clean.json +0 -0
- package/.claude/skills/cfn-agent-discovery/agents-registry-fixed.json +19 -0
- package/.claude/skills/cfn-agent-discovery/agents-registry.json +718 -0
- package/.claude/skills/cfn-agent-discovery/discover-agents.py +184 -0
- package/.claude/skills/cfn-agent-discovery/discover-agents.sh +87 -0
- package/.claude/skills/cfn-agent-discovery/invoke-registry.sh +11 -0
- package/.claude/skills/cfn-agent-discovery/temp_script.py +0 -0
- package/.claude/skills/cfn-agent-execution/execute-agent.sh +126 -0
- package/.claude/skills/cfn-agent-output-processing/SKILL.md +359 -0
- package/.claude/skills/cfn-agent-selector/SKILL.md +90 -0
- package/.claude/skills/cfn-agent-selector/select-agents.sh +112 -0
- package/.claude/skills/cfn-agent-spawning/SKILL.md +135 -0
- package/.claude/skills/cfn-agent-spawning/agent-selection-guide.md +814 -0
- package/.claude/skills/cfn-agent-spawning/check-dependencies.sh +30 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh +263 -0
- package/.claude/skills/cfn-agent-spawning/spawn-templates.sh +613 -0
- package/.claude/skills/cfn-analytics/description-refinement-guide.md +164 -0
- package/.claude/skills/cfn-analytics/log-skill-invocation.js +122 -0
- package/.claude/skills/cfn-analytics/run-production-criteria-tests.sh +126 -0
- package/.claude/skills/cfn-analytics/skill-analytics-dashboard.js +113 -0
- package/.claude/skills/cfn-analytics/skill-invocation-hook.sh +28 -0
- package/.claude/skills/cfn-analytics/skill-invocations.sql +58 -0
- package/.claude/skills/cfn-analytics/test-corpus.json +32 -0
- package/.claude/skills/cfn-analytics/test-data-generator.js +115 -0
- package/.claude/skills/cfn-analytics/test-manual-override-rate.js +285 -0
- package/.claude/skills/cfn-analytics/validate-skill-selection.js +188 -0
- package/.claude/skills/cfn-config-management/SKILL.md +34 -0
- package/.claude/skills/cfn-config-management/check-dependencies.sh +56 -0
- package/.claude/skills/cfn-config-management/config.json +32 -0
- package/.claude/skills/cfn-config-management/manage-config.sh +113 -0
- package/.claude/skills/cfn-event-bus/SKILL.md +412 -0
- package/.claude/skills/cfn-event-bus/config.json +111 -0
- package/.claude/skills/cfn-event-bus/eventbus-wrapper.cjs +69 -0
- package/.claude/skills/cfn-event-bus/invoke-event-publish.sh +147 -0
- package/.claude/skills/cfn-event-bus/invoke-event-subscribe.sh +171 -0
- package/.claude/skills/cfn-event-bus/invoke-lifecycle-track.sh +201 -0
- package/.claude/skills/cfn-event-bus/test-event-bus.sh +280 -0
- package/.claude/skills/cfn-fleet-manager/SKILL.md +412 -0
- package/.claude/skills/cfn-fleet-manager/config.json +60 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-allocate.sh +182 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-balance.sh +239 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-metrics.sh +193 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-register.sh +124 -0
- package/.claude/skills/cfn-fleet-manager/test-fleet-manager.sh +345 -0
- package/.claude/skills/cfn-hook-pipeline/SKILL.md +148 -0
- package/.claude/skills/cfn-hook-pipeline/auto-resolve.sh +66 -0
- package/.claude/skills/cfn-hook-pipeline/check-dependencies.sh +40 -0
- package/.claude/skills/cfn-hook-pipeline/feedback-resolver.sh +452 -0
- package/.claude/skills/cfn-hook-pipeline/post-edit-handler.sh +154 -0
- package/.claude/skills/cfn-hook-pipeline/security-scan.json +60 -0
- package/.claude/skills/cfn-hook-pipeline/security-scanner.sh +121 -0
- package/.claude/skills/cfn-hook-pipeline/test-root-warning-resolution.sh +148 -0
- package/.claude/skills/cfn-hybrid-routing/SKILL.md +46 -0
- package/.claude/skills/cfn-hybrid-routing/check-dependencies.sh +52 -0
- package/.claude/skills/cfn-hybrid-routing/config.json +26 -0
- package/.claude/skills/cfn-hybrid-routing/spawn-worker.sh +44 -0
- package/.claude/skills/cfn-loop-orchestration/SKILL.md +299 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/auto-tune-timeouts.sh +228 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/consensus.sh +84 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/context-injection.sh +142 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/context-lookup.sh +359 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier.sh +71 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/gate-check.sh +90 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager.sh +87 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/spawn-agents.sh +271 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator.sh +51 -0
- package/.claude/skills/cfn-loop-orchestration/inject-loop-context.sh +41 -0
- package/.claude/skills/cfn-loop-orchestration/monitor-execution.sh +156 -0
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +884 -0
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +840 -0
- package/.claude/skills/cfn-loop-orchestration/security_utils.sh +99 -0
- package/.claude/skills/cfn-loop-orchestration/test-cfn-orchestration.sh +281 -0
- package/.claude/skills/cfn-loop-orchestration/test-edge-cases.sh +188 -0
- package/.claude/skills/cfn-loop-validation/SKILL.md +353 -0
- package/.claude/skills/cfn-loop-validation/check-dependencies.sh +31 -0
- package/.claude/skills/cfn-loop-validation/config.json +161 -0
- package/.claude/skills/cfn-loop-validation/consensus-calculator.js +477 -0
- package/.claude/skills/cfn-loop-validation/evidence-chain.sql +163 -0
- package/.claude/skills/cfn-loop-validation/examples/README.md +453 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-full-cfn-loop.sh +234 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-loop2-consensus.sh +132 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-loop3-gate.sh +115 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-redis-integration.sh +186 -0
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -0
- package/.claude/skills/cfn-loop-validation/validate-iteration.sh +134 -0
- package/.claude/skills/cfn-process-lifecycle/SKILL.md +39 -0
- package/.claude/skills/cfn-process-lifecycle/check-dependencies.sh +58 -0
- package/.claude/skills/cfn-process-lifecycle/config.json +39 -0
- package/.claude/skills/cfn-process-lifecycle/process-manager.sh +144 -0
- package/.claude/skills/cfn-product-owner-decision/SKILL.md +332 -0
- package/.claude/skills/cfn-product-owner-decision/execute-decision.sh +176 -0
- package/.claude/skills/cfn-product-owner-decision/parse-decision.sh +66 -0
- package/.claude/skills/cfn-product-owner-decision/validate-deliverables.sh +82 -0
- package/.claude/skills/cfn-redis-coordination/AGENT_LOGGING.md +280 -0
- package/.claude/skills/cfn-redis-coordination/BZPOPMIN_FIX_SUMMARY.md +209 -0
- package/.claude/skills/cfn-redis-coordination/HEARTBEAT.md +57 -0
- package/.claude/skills/cfn-redis-coordination/HEARTBEAT_MONITORING.md +267 -0
- package/.claude/skills/cfn-redis-coordination/LOGGING.md +260 -0
- package/.claude/skills/cfn-redis-coordination/SECURITY_REVIEW.md +25 -0
- package/.claude/skills/cfn-redis-coordination/SHUTDOWN_HANDLING.md +164 -0
- package/.claude/skills/cfn-redis-coordination/SKILL.md +720 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh +124 -0
- package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +75 -0
- package/.claude/skills/cfn-redis-coordination/analyze-task-complexity.sh +277 -0
- package/.claude/skills/cfn-redis-coordination/cancel-swarm.sh +221 -0
- package/.claude/skills/cfn-redis-coordination/cfn-loop-exec.sh +468 -0
- package/.claude/skills/cfn-redis-coordination/cfn-loop-relaunch.sh +29 -0
- package/.claude/skills/cfn-redis-coordination/check-dependencies.sh +32 -0
- package/.claude/skills/cfn-redis-coordination/collect-confidence-scores.sh +179 -0
- package/.claude/skills/cfn-redis-coordination/collect-results.sh +75 -0
- package/.claude/skills/cfn-redis-coordination/complete-swarm.sh +75 -0
- package/.claude/skills/cfn-redis-coordination/config.json +61 -0
- package/.claude/skills/cfn-redis-coordination/data/cfn-loop.db +0 -0
- package/.claude/skills/cfn-redis-coordination/demos/phase4-wake-queue-test-report.md +82 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-bzpopmin-fix.sh +274 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +276 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-dlq.sh +129 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-iteration-feedback.sh +320 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-orchestrator.sh +249 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4-unix.sh +148 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4.sh +163 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake.sh +138 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quick-fix.sh +81 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-absolute.sh +45 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-fallback.sh +68 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-percentage.sh +56 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-with-retry.sh +81 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum.sh +57 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-shutdown-handling.sh +187 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-shutdown.sh +160 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-utils-unix.sh +97 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-utils.sh +97 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-waiting-mode.sh +59 -0
- package/.claude/skills/cfn-redis-coordination/examples/README.md +73 -0
- package/.claude/skills/cfn-redis-coordination/examples/grafana-dashboard.json +352 -0
- package/.claude/skills/cfn-redis-coordination/examples/hierarchical-pattern.sh +127 -0
- package/.claude/skills/cfn-redis-coordination/examples/mesh-pattern.sh +171 -0
- package/.claude/skills/cfn-redis-coordination/examples/timeout-handling.sh +227 -0
- package/.claude/skills/cfn-redis-coordination/examples/waiting-mode-pattern.sh +239 -0
- package/.claude/skills/cfn-redis-coordination/execute-product-owner-decision.sh +258 -0
- package/.claude/skills/cfn-redis-coordination/get-agent-timeout.sh +177 -0
- package/.claude/skills/cfn-redis-coordination/heartbeat-functions.sh +137 -0
- package/.claude/skills/cfn-redis-coordination/heartbeat-protocol.md +106 -0
- package/.claude/skills/cfn-redis-coordination/heartbeat.sh +126 -0
- package/.claude/skills/cfn-redis-coordination/init-swarm.sh +148 -0
- package/.claude/skills/cfn-redis-coordination/invoke-redis-pattern.sh +220 -0
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +283 -0
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh.backup-p7 +423 -0
- package/.claude/skills/cfn-redis-coordination/list-active-swarms.sh +147 -0
- package/.claude/skills/cfn-redis-coordination/log-event.sh +109 -0
- package/.claude/skills/cfn-redis-coordination/metrics-export.sh +674 -0
- package/.claude/skills/cfn-redis-coordination/metrics-schema.json +66 -0
- package/.claude/skills/cfn-redis-coordination/metrics-storage.md +31 -0
- package/.claude/skills/cfn-redis-coordination/monitor-cfn-violations.sh +391 -0
- package/.claude/skills/cfn-redis-coordination/monitor-heartbeats.sh +101 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop-v3.sh +141 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh +31 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup +38 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-1761167675 +1672 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-p5 +1604 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase1 +1550 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase2 +1621 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase3 +1621 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.bak +0 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.broken +1627 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.corrupted +80 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.deprecated +1864 -0
- package/.claude/skills/cfn-redis-coordination/priority-wake-mechanism.md +75 -0
- package/.claude/skills/cfn-redis-coordination/priority_wake.py +134 -0
- package/.claude/skills/cfn-redis-coordination/query-dlq.sh +162 -0
- package/.claude/skills/cfn-redis-coordination/query-logs.sh +103 -0
- package/.claude/skills/cfn-redis-coordination/redis-pattern.sh +619 -0
- package/.claude/skills/cfn-redis-coordination/retrieve-context.sh +58 -0
- package/.claude/skills/cfn-redis-coordination/select-specialist-agent.sh +371 -0
- package/.claude/skills/cfn-redis-coordination/semantic-match-tfidf.py +252 -0
- package/.claude/skills/cfn-redis-coordination/send-heartbeat.sh +165 -0
- package/.claude/skills/cfn-redis-coordination/signal.sh +38 -0
- package/.claude/skills/cfn-redis-coordination/store-context.sh +86 -0
- package/.claude/skills/cfn-redis-coordination/store-epic-context.sh +123 -0
- package/.claude/skills/cfn-redis-coordination/test-context-injection.sh +354 -0
- package/.claude/skills/cfn-redis-coordination/test-timeout-enforcement.sh +513 -0
- package/.claude/skills/cfn-redis-coordination/tests/convert-line-endings.sh +15 -0
- package/.claude/skills/cfn-redis-coordination/tests/dlq-functionality-test.sh +102 -0
- package/.claude/skills/cfn-redis-coordination/tests/edge-cases-test.sh +99 -0
- package/.claude/skills/cfn-redis-coordination/tests/integration-test.sh +170 -0
- package/.claude/skills/cfn-redis-coordination/tests/retry-mechanism-test.sh +82 -0
- package/.claude/skills/cfn-redis-coordination/tests/run-test-suite.sh +92 -0
- package/.claude/skills/cfn-redis-coordination/tests/run-tests.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-monitoring.sh +418 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-simple.sh +124 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-primitives.sh +166 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-utils.sh +54 -0
- package/.claude/skills/cfn-redis-coordination/tests/test_coordination_primitives.sh.deprecated +20 -0
- package/.claude/skills/cfn-redis-coordination/tests/test_utils.sh +49 -0
- package/.claude/skills/cfn-redis-coordination/v2_modularization/core_orchestration.sh +76 -0
- package/.claude/skills/cfn-redis-coordination/validate-parameters.sh +492 -0
- package/.claude/skills/cfn-sqlite-memory/IMPLEMENTATION_REPORT.md +393 -0
- package/.claude/skills/cfn-sqlite-memory/QUICK_REFERENCE.md +204 -0
- package/.claude/skills/cfn-sqlite-memory/SKILL.md +415 -0
- package/.claude/skills/cfn-sqlite-memory/acl-queries.sql +452 -0
- package/.claude/skills/cfn-sqlite-memory/check-dependencies.sh +36 -0
- package/.claude/skills/cfn-sqlite-memory/config.json +45 -0
- package/.claude/skills/cfn-sqlite-memory/memory-cli.sh +88 -0
- package/.claude/skills/cfn-sqlite-memory/test-state-persistence.js +187 -0
- package/.claude/skills/cfn-sqlite-memory/ttl-cleanup.sh +274 -0
- package/.claude/skills/cfn-test-execution/SKILL.md +128 -0
- package/.claude/skills/cfn-test-execution/check-dependencies.sh +36 -0
- package/.claude/skills/cfn-test-execution/test-cache-reader.sh +134 -0
- package/.claude/skills/cfn-test-execution/test-concurrent-conflicts.sh +115 -0
- package/.claude/skills/cfn-test-execution/test-coordinator-pattern.sh +109 -0
- package/.claude/skills/cfn-transparency-middleware/Cargo.toml +18 -0
- package/.claude/skills/cfn-transparency-middleware/SECURITY.md +41 -0
- package/.claude/skills/cfn-transparency-middleware/SKILL.md +91 -0
- package/.claude/skills/cfn-transparency-middleware/TEST_RESULTS.md +174 -0
- package/.claude/skills/cfn-transparency-middleware/config.json +31 -0
- package/.claude/skills/cfn-transparency-middleware/examples/basic-usage.ts +39 -0
- package/.claude/skills/cfn-transparency-middleware/examples/batch-processing.ts +52 -0
- package/.claude/skills/cfn-transparency-middleware/examples/custom-filtering.ts +61 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-filter.sh +98 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-init.sh +224 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-level.sh +333 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-metrics.sh +345 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-observe.sh +140 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-stop.sh +235 -0
- package/.claude/skills/cfn-transparency-middleware/memory_query.rs +85 -0
- package/.claude/skills/cfn-transparency-middleware/memory_repository.rs +140 -0
- package/.claude/skills/cfn-transparency-middleware/memory_schema.rs +64 -0
- package/.claude/skills/cfn-transparency-middleware/middleware-config.sh +29 -0
- package/.claude/skills/cfn-transparency-middleware/performance-benchmark.sh +79 -0
- package/.claude/skills/cfn-transparency-middleware/test-e2e.sh +406 -0
- package/.claude/skills/cfn-transparency-middleware/test-integration.sh +162 -0
- package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh +368 -0
- package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh.unix +126 -0
- package/.claude/skills/cfn-transparency-middleware/tests/input-validation.sh +93 -0
- package/.claude/skills/cfn-transparency-middleware/wrap-agent.sh +132 -0
- package/.claude/skills/cfn-webapp-testing/SCREENSHOT_NAMING_CONVENTION.md +547 -0
- package/.claude/skills/cfn-webapp-testing/SKILL.md +877 -0
- package/.claude/skills/cfn-webapp-testing/capture-screenshot.sh +238 -0
- package/.claude/skills/cfn-webapp-testing/cfn-loop-integration.sh +265 -0
- package/.claude/skills/cfn-webapp-testing/compare-screenshots.sh +199 -0
- package/.claude/skills/cfn-webapp-testing/init-storage.sh +150 -0
- package/.claude/skills/cfn-webapp-testing/set-baseline.sh +196 -0
- package/.claude/skills/cfn-webapp-testing/test-webapp-testing.sh +233 -0
- package/README.md +51 -2
- package/dist/ace/ace-reflector.js +109 -10
- package/dist/ace/ace-reflector.js.map +1 -1
- package/dist/agents/agent-loader.js +165 -146
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/cli/agent-executor.js +1 -1
- package/dist/cli/agent-executor.js.map +1 -1
- package/dist/cli/config-manager.js +109 -91
- package/dist/cli/config-manager.js.map +1 -1
- package/package.json +43 -7
- package/readme/README.md +15 -4
- package/scripts/init-project.js +84 -29
- package/scripts/run-marketing-tests.sh +43 -0
- package/scripts/update_paths.sh +47 -0
- package/tools/install-lizard.sh +37 -0
- package/tools/simple-complexity.sh +44 -0
- package/.claude/agents/cfn-dev-team/developers/coder.md +0 -270
- package/.claude/agents/cfn-dev-team/developers/state-architect.md +0 -127
- package/.claude/agents/cfn-dev-team/reviewers/code-quality-validator.md +0 -128
- /package/.claude/agents/cfn-dev-team/developers/{ui-designer.md → frontend/ui-designer.md} +0 -0
- /package/.claude/agents/cfn-dev-team/{coordinators → product-owners}/product-owner-agent.md +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Performance Benchmarking for Transparency Middleware
|
|
4
|
+
# Version: 1.0.0
|
|
5
|
+
# Measures message throughput, overhead, and memory usage
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
# Source configuration
|
|
10
|
+
source .claude/skills/cfn-transparency-middleware/middleware-config.sh
|
|
11
|
+
|
|
12
|
+
# Benchmarking results file
|
|
13
|
+
BENCHMARK_RESULTS="/tmp/transparency_benchmark_$(date +%Y%m%d_%H%M%S).json"
|
|
14
|
+
|
|
15
|
+
# Performance Test Parameters
|
|
16
|
+
TOTAL_MESSAGES=10000
|
|
17
|
+
CONCURRENCY_LEVELS=(1 10 100)
|
|
18
|
+
|
|
19
|
+
measure_performance() {
|
|
20
|
+
local concurrency="$1"
|
|
21
|
+
local start_time=$(date +%s.%N)
|
|
22
|
+
local peak_memory=0
|
|
23
|
+
local total_cpu_usage=0
|
|
24
|
+
|
|
25
|
+
# Simulate message processing
|
|
26
|
+
for ((i=0; i<TOTAL_MESSAGES; i++)); do
|
|
27
|
+
./invoke-transparency-middleware.sh process \
|
|
28
|
+
--concurrency "$concurrency" \
|
|
29
|
+
--message-id "$i" &
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
wait
|
|
33
|
+
|
|
34
|
+
local end_time=$(date +%s.%N)
|
|
35
|
+
local duration=$(echo "$end_time - $start_time" | bc)
|
|
36
|
+
local messages_per_second=$(echo "$TOTAL_MESSAGES / $duration" | bc)
|
|
37
|
+
|
|
38
|
+
# Record performance metrics
|
|
39
|
+
jq -n \
|
|
40
|
+
--arg concurrency "$concurrency" \
|
|
41
|
+
--arg messages_total "$TOTAL_MESSAGES" \
|
|
42
|
+
--arg duration "$duration" \
|
|
43
|
+
--arg messages_per_second "$messages_per_second" \
|
|
44
|
+
'{
|
|
45
|
+
"concurrency": $concurrency,
|
|
46
|
+
"total_messages": $messages_total,
|
|
47
|
+
"duration_seconds": $duration,
|
|
48
|
+
"messages_per_second": $messages_per_second
|
|
49
|
+
}' > "$BENCHMARK_RESULTS"
|
|
50
|
+
|
|
51
|
+
# Validate performance
|
|
52
|
+
validate_performance "$messages_per_second"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
validate_performance() {
|
|
56
|
+
local messages_per_second="$1"
|
|
57
|
+
local max_threshold=5000 # Adjust based on your system capabilities
|
|
58
|
+
|
|
59
|
+
if (( $(echo "$messages_per_second < $max_threshold" | bc -l) )); then
|
|
60
|
+
echo "Performance Test PASSED"
|
|
61
|
+
redis-cli publish "swarm:sprint-1.2:performance" "benchmark_passed:1.0"
|
|
62
|
+
else
|
|
63
|
+
echo "Performance Test FAILED"
|
|
64
|
+
redis-cli publish "swarm:sprint-1.2:performance" "benchmark_failed:0.0"
|
|
65
|
+
exit 1
|
|
66
|
+
fi
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
main() {
|
|
70
|
+
echo "Starting Transparency Middleware Performance Benchmarks"
|
|
71
|
+
|
|
72
|
+
for concurrency in "${CONCURRENCY_LEVELS[@]}"; do
|
|
73
|
+
measure_performance "$concurrency"
|
|
74
|
+
done
|
|
75
|
+
|
|
76
|
+
cat "$BENCHMARK_RESULTS"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
main
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# E2E Test: Full transparency middleware lifecycle
|
|
3
|
+
# Sprint 1.3 - Backend Developer - Testing and Integration
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
# Test configuration
|
|
8
|
+
TEST_TASK_ID="e2e-test-$(date +%s)"
|
|
9
|
+
TEST_AGENT_ID="backend-dev-e2e"
|
|
10
|
+
TEST_DB=".claude/test-swarm-memory.db"
|
|
11
|
+
REDIS_CHANNEL="test:transparency"
|
|
12
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
13
|
+
|
|
14
|
+
# Color output for better readability
|
|
15
|
+
GREEN='\033[0;32m'
|
|
16
|
+
RED='\033[0;31m'
|
|
17
|
+
YELLOW='\033[1;33m'
|
|
18
|
+
NC='\033[0m' # No Color
|
|
19
|
+
|
|
20
|
+
# Logging functions
|
|
21
|
+
log_step() {
|
|
22
|
+
echo -e "${YELLOW}=== $1 ===${NC}"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
log_success() {
|
|
26
|
+
echo -e "${GREEN}✅ $1${NC}"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
log_error() {
|
|
30
|
+
echo -e "${RED}❌ $1${NC}"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
# Cleanup function
|
|
34
|
+
cleanup() {
|
|
35
|
+
log_step "Cleanup: Removing test artifacts"
|
|
36
|
+
rm -f "$TEST_DB" 2>/dev/null || true
|
|
37
|
+
rm -f /tmp/test-middleware-config.json 2>/dev/null || true
|
|
38
|
+
redis-cli flushdb >/dev/null 2>&1 || true
|
|
39
|
+
log_success "Cleanup complete"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# Test 1: Environment preparation
|
|
43
|
+
test_environment_preparation() {
|
|
44
|
+
log_step "1. Environment Preparation"
|
|
45
|
+
|
|
46
|
+
# Clean test environment
|
|
47
|
+
cleanup
|
|
48
|
+
|
|
49
|
+
# Verify Redis is available
|
|
50
|
+
if ! redis-cli ping >/dev/null 2>&1; then
|
|
51
|
+
log_error "Redis is not available"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
log_success "Redis connection verified"
|
|
55
|
+
|
|
56
|
+
# Verify SQLite is available
|
|
57
|
+
if ! command -v sqlite3 &>/dev/null; then
|
|
58
|
+
log_error "SQLite3 is not available"
|
|
59
|
+
exit 1
|
|
60
|
+
fi
|
|
61
|
+
log_success "SQLite3 verified"
|
|
62
|
+
|
|
63
|
+
# Verify Node.js is available
|
|
64
|
+
if ! command -v node &>/dev/null; then
|
|
65
|
+
log_error "Node.js is not available"
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
log_success "Node.js verified"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# Test 2: Configuration setup
|
|
72
|
+
test_configuration_setup() {
|
|
73
|
+
log_step "2. Configuration Setup"
|
|
74
|
+
|
|
75
|
+
# Create test-specific configuration
|
|
76
|
+
cat > /tmp/test-middleware-config.json << 'EOF'
|
|
77
|
+
{
|
|
78
|
+
"redis": {
|
|
79
|
+
"host": "localhost",
|
|
80
|
+
"port": 6379,
|
|
81
|
+
"channel": "test:transparency"
|
|
82
|
+
},
|
|
83
|
+
"storage": {
|
|
84
|
+
"database": ".claude/test-swarm-memory.db",
|
|
85
|
+
"table": "agent_memory"
|
|
86
|
+
},
|
|
87
|
+
"logging": {
|
|
88
|
+
"level": "debug",
|
|
89
|
+
"format": "json",
|
|
90
|
+
"destination": "console"
|
|
91
|
+
},
|
|
92
|
+
"events": {
|
|
93
|
+
"emit_memory_store": true,
|
|
94
|
+
"emit_agent_lifecycle": true,
|
|
95
|
+
"emit_high_value_actions": true
|
|
96
|
+
},
|
|
97
|
+
"capture": {
|
|
98
|
+
"edit_operations": true,
|
|
99
|
+
"bash_commands": true,
|
|
100
|
+
"task_spawning": true,
|
|
101
|
+
"read_operations": false
|
|
102
|
+
},
|
|
103
|
+
"security": {
|
|
104
|
+
"anonymize_sensitive_data": true,
|
|
105
|
+
"max_payload_size_bytes": 1048576
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
EOF
|
|
109
|
+
|
|
110
|
+
if [[ ! -f /tmp/test-middleware-config.json ]]; then
|
|
111
|
+
log_error "Failed to create test configuration"
|
|
112
|
+
exit 1
|
|
113
|
+
fi
|
|
114
|
+
log_success "Test configuration created"
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# Test 3: Database initialization
|
|
118
|
+
test_database_initialization() {
|
|
119
|
+
log_step "3. Database Initialization"
|
|
120
|
+
|
|
121
|
+
# Create SQLite database with agent_memory schema
|
|
122
|
+
sqlite3 "$TEST_DB" << 'EOF'
|
|
123
|
+
CREATE TABLE IF NOT EXISTS agent_memory (
|
|
124
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
125
|
+
agent_id TEXT NOT NULL,
|
|
126
|
+
task_id TEXT NOT NULL,
|
|
127
|
+
timestamp INTEGER NOT NULL,
|
|
128
|
+
event_type TEXT NOT NULL,
|
|
129
|
+
tool TEXT,
|
|
130
|
+
metadata TEXT,
|
|
131
|
+
confidence REAL,
|
|
132
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_agent_id ON agent_memory(agent_id);
|
|
136
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_task_id ON agent_memory(task_id);
|
|
137
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_timestamp ON agent_memory(timestamp DESC);
|
|
138
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_event_type ON agent_memory(event_type);
|
|
139
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_tool ON agent_memory(tool);
|
|
140
|
+
CREATE INDEX IF NOT EXISTS idx_agent_memory_task_agent ON agent_memory(task_id, agent_id);
|
|
141
|
+
EOF
|
|
142
|
+
|
|
143
|
+
# Verify table creation
|
|
144
|
+
local table_count=$(sqlite3 "$TEST_DB" "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='agent_memory';")
|
|
145
|
+
if [[ "$table_count" -ne 1 ]]; then
|
|
146
|
+
log_error "Failed to create agent_memory table"
|
|
147
|
+
exit 1
|
|
148
|
+
fi
|
|
149
|
+
log_success "Database initialized with agent_memory schema"
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
# Test 4: Simulated agent execution with high-value events
|
|
153
|
+
test_agent_execution_simulation() {
|
|
154
|
+
log_step "4. Agent Execution Simulation"
|
|
155
|
+
|
|
156
|
+
# Simulate agent I/O containing Edit, Bash, and Task operations
|
|
157
|
+
# Using parameterized queries via printf to avoid SQL injection
|
|
158
|
+
|
|
159
|
+
# Insert Edit event using printf for safe parameter binding
|
|
160
|
+
local edit_timestamp=$(date +%s)
|
|
161
|
+
printf "INSERT INTO agent_memory (agent_id, task_id, timestamp, event_type, tool, metadata, confidence) VALUES ('%s', '%s', %d, 'high_value_action', 'Edit', '{\"file_path\":\"test.ts\",\"operation\":\"edit\",\"old_string\":\"foo\",\"new_string\":\"bar\"}', 0.85);\n" \
|
|
162
|
+
"$TEST_AGENT_ID" "$TEST_TASK_ID" "$edit_timestamp" | sqlite3 "$TEST_DB"
|
|
163
|
+
|
|
164
|
+
# Insert Bash event using printf for safe parameter binding
|
|
165
|
+
local bash_timestamp=$((edit_timestamp + 1))
|
|
166
|
+
printf "INSERT INTO agent_memory (agent_id, task_id, timestamp, event_type, tool, metadata, confidence) VALUES ('%s', '%s', %d, 'high_value_action', 'Bash', '{\"command\":\"npm test\",\"description\":\"Run tests\",\"exit_code\":0}', 0.90);\n" \
|
|
167
|
+
"$TEST_AGENT_ID" "$TEST_TASK_ID" "$bash_timestamp" | sqlite3 "$TEST_DB"
|
|
168
|
+
|
|
169
|
+
# Insert Task event using printf for safe parameter binding
|
|
170
|
+
local task_timestamp=$((bash_timestamp + 1))
|
|
171
|
+
printf "INSERT INTO agent_memory (agent_id, task_id, timestamp, event_type, tool, metadata, confidence) VALUES ('%s', '%s', %d, 'agent_lifecycle', 'Task', '{\"subagent_type\":\"reviewer\",\"description\":\"Review changes\",\"status\":\"spawned\"}', 0.88);\n" \
|
|
172
|
+
"$TEST_AGENT_ID" "$TEST_TASK_ID" "$task_timestamp" | sqlite3 "$TEST_DB"
|
|
173
|
+
|
|
174
|
+
# Publish events to Redis (using printf for safe parameter binding)
|
|
175
|
+
printf '{"agent_id":"%s","event":"edit_operation"}\n' "$TEST_AGENT_ID" | xargs -I {} redis-cli lpush "$REDIS_CHANNEL" {} >/dev/null
|
|
176
|
+
printf '{"agent_id":"%s","event":"bash_command"}\n' "$TEST_AGENT_ID" | xargs -I {} redis-cli lpush "$REDIS_CHANNEL" {} >/dev/null
|
|
177
|
+
printf '{"agent_id":"%s","event":"task_spawned"}\n' "$TEST_AGENT_ID" | xargs -I {} redis-cli lpush "$REDIS_CHANNEL" {} >/dev/null
|
|
178
|
+
|
|
179
|
+
log_success "Agent execution simulated (3 high-value events)"
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
# Test 5: SQLite storage verification
|
|
183
|
+
test_sqlite_storage_verification() {
|
|
184
|
+
log_step "5. SQLite Storage Verification"
|
|
185
|
+
|
|
186
|
+
# Count events for test agent using printf for safe parameter binding
|
|
187
|
+
local event_count
|
|
188
|
+
event_count=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND task_id='%s';\n" \
|
|
189
|
+
"$TEST_AGENT_ID" "$TEST_TASK_ID" | sqlite3 "$TEST_DB")
|
|
190
|
+
|
|
191
|
+
if [[ "$event_count" -lt 3 ]]; then
|
|
192
|
+
log_error "Missing events (expected ≥3, got $event_count)"
|
|
193
|
+
exit 1
|
|
194
|
+
fi
|
|
195
|
+
log_success "All high-value events stored ($event_count events)"
|
|
196
|
+
|
|
197
|
+
# Verify event types using safe parameter binding
|
|
198
|
+
local edit_count
|
|
199
|
+
edit_count=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND tool='Edit';\n" \
|
|
200
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
201
|
+
|
|
202
|
+
local bash_count
|
|
203
|
+
bash_count=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND tool='Bash';\n" \
|
|
204
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
205
|
+
|
|
206
|
+
local task_count
|
|
207
|
+
task_count=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND tool='Task';\n" \
|
|
208
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
209
|
+
|
|
210
|
+
if [[ "$edit_count" -lt 1 ]]; then
|
|
211
|
+
log_error "Edit event not captured"
|
|
212
|
+
exit 1
|
|
213
|
+
fi
|
|
214
|
+
log_success "Edit event captured ($edit_count)"
|
|
215
|
+
|
|
216
|
+
if [[ "$bash_count" -lt 1 ]]; then
|
|
217
|
+
log_error "Bash event not captured"
|
|
218
|
+
exit 1
|
|
219
|
+
fi
|
|
220
|
+
log_success "Bash event captured ($bash_count)"
|
|
221
|
+
|
|
222
|
+
if [[ "$task_count" -lt 1 ]]; then
|
|
223
|
+
log_error "Task event not captured"
|
|
224
|
+
exit 1
|
|
225
|
+
fi
|
|
226
|
+
log_success "Task event captured ($task_count)"
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
# Test 6: Redis event verification
|
|
230
|
+
test_redis_event_verification() {
|
|
231
|
+
log_step "6. Redis Event Verification"
|
|
232
|
+
|
|
233
|
+
# Count events in Redis list
|
|
234
|
+
local redis_event_count=$(redis-cli llen "$REDIS_CHANNEL" 2>/dev/null || echo "0")
|
|
235
|
+
|
|
236
|
+
echo "Redis events emitted: $redis_event_count"
|
|
237
|
+
|
|
238
|
+
if [[ "$redis_event_count" -ge 3 ]]; then
|
|
239
|
+
log_success "Redis events verified ($redis_event_count events)"
|
|
240
|
+
else
|
|
241
|
+
log_error "Insufficient Redis events (expected ≥3, got $redis_event_count)"
|
|
242
|
+
fi
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
# Test 7: Query and display results
|
|
246
|
+
test_query_and_display() {
|
|
247
|
+
log_step "7. Query and Display Results"
|
|
248
|
+
|
|
249
|
+
# Query stored memories with JSON output using safe parameter binding
|
|
250
|
+
echo ""
|
|
251
|
+
echo "Stored Memory Entries:"
|
|
252
|
+
echo "----------------------"
|
|
253
|
+
|
|
254
|
+
printf "SELECT json_object('id', id, 'agent_id', agent_id, 'task_id', task_id, 'timestamp', timestamp, 'event_type', event_type, 'tool', tool, 'metadata', json(metadata), 'confidence', confidence, 'created_at', created_at) as json_entry FROM agent_memory WHERE agent_id='%s' AND task_id='%s' ORDER BY timestamp ASC LIMIT 5;\n" \
|
|
255
|
+
"$TEST_AGENT_ID" "$TEST_TASK_ID" | sqlite3 "$TEST_DB" | python3 -m json.tool 2>/dev/null || \
|
|
256
|
+
printf "SELECT json_object('id', id, 'agent_id', agent_id, 'task_id', task_id, 'timestamp', timestamp, 'event_type', event_type, 'tool', tool, 'metadata', json(metadata), 'confidence', confidence, 'created_at', created_at) as json_entry FROM agent_memory WHERE agent_id='%s' AND task_id='%s' ORDER BY timestamp ASC LIMIT 5;\n" \
|
|
257
|
+
"$TEST_AGENT_ID" "$TEST_TASK_ID" | sqlite3 "$TEST_DB"
|
|
258
|
+
|
|
259
|
+
echo ""
|
|
260
|
+
log_success "Memory query executed successfully"
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
# Test 8: Metadata validation
|
|
264
|
+
test_metadata_validation() {
|
|
265
|
+
log_step "8. Metadata Validation"
|
|
266
|
+
|
|
267
|
+
# Verify metadata JSON is valid and contains expected fields using safe parameter binding
|
|
268
|
+
local metadata_check
|
|
269
|
+
metadata_check=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND tool='Edit' AND json_extract(metadata, '\$.file_path') IS NOT NULL;\n" \
|
|
270
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
271
|
+
|
|
272
|
+
if [[ "$metadata_check" -lt 1 ]]; then
|
|
273
|
+
log_error "Edit metadata validation failed"
|
|
274
|
+
exit 1
|
|
275
|
+
fi
|
|
276
|
+
log_success "Edit metadata validated (file_path present)"
|
|
277
|
+
|
|
278
|
+
# Verify Bash metadata
|
|
279
|
+
metadata_check=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND tool='Bash' AND json_extract(metadata, '\$.command') IS NOT NULL;\n" \
|
|
280
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
281
|
+
|
|
282
|
+
if [[ "$metadata_check" -lt 1 ]]; then
|
|
283
|
+
log_error "Bash metadata validation failed"
|
|
284
|
+
exit 1
|
|
285
|
+
fi
|
|
286
|
+
log_success "Bash metadata validated (command present)"
|
|
287
|
+
|
|
288
|
+
# Verify Task metadata
|
|
289
|
+
metadata_check=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND tool='Task' AND json_extract(metadata, '\$.subagent_type') IS NOT NULL;\n" \
|
|
290
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
291
|
+
|
|
292
|
+
if [[ "$metadata_check" -lt 1 ]]; then
|
|
293
|
+
log_error "Task metadata validation failed"
|
|
294
|
+
exit 1
|
|
295
|
+
fi
|
|
296
|
+
log_success "Task metadata validated (subagent_type present)"
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
# Test 9: Confidence scoring validation
|
|
300
|
+
test_confidence_scoring() {
|
|
301
|
+
log_step "9. Confidence Scoring Validation"
|
|
302
|
+
|
|
303
|
+
# Verify all events have valid confidence scores (0.0-1.0) using safe parameter binding
|
|
304
|
+
local invalid_scores
|
|
305
|
+
invalid_scores=$(printf "SELECT COUNT(*) FROM agent_memory WHERE agent_id='%s' AND (confidence < 0.0 OR confidence > 1.0 OR confidence IS NULL);\n" \
|
|
306
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
307
|
+
|
|
308
|
+
if [[ "$invalid_scores" -gt 0 ]]; then
|
|
309
|
+
log_error "Invalid confidence scores detected ($invalid_scores events)"
|
|
310
|
+
exit 1
|
|
311
|
+
fi
|
|
312
|
+
log_success "All confidence scores valid (0.0-1.0 range)"
|
|
313
|
+
|
|
314
|
+
# Calculate average confidence
|
|
315
|
+
local avg_confidence
|
|
316
|
+
avg_confidence=$(printf "SELECT ROUND(AVG(confidence), 2) FROM agent_memory WHERE agent_id='%s';\n" \
|
|
317
|
+
"$TEST_AGENT_ID" | sqlite3 "$TEST_DB")
|
|
318
|
+
|
|
319
|
+
echo "Average confidence: $avg_confidence"
|
|
320
|
+
log_success "Confidence scoring validated"
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
# Test 10: Cleanup validation
|
|
324
|
+
test_cleanup_validation() {
|
|
325
|
+
log_step "10. Cleanup Validation"
|
|
326
|
+
|
|
327
|
+
# Final cleanup
|
|
328
|
+
cleanup
|
|
329
|
+
|
|
330
|
+
# Verify database removed
|
|
331
|
+
if [[ -f "$TEST_DB" ]]; then
|
|
332
|
+
log_error "Test database not cleaned up"
|
|
333
|
+
exit 1
|
|
334
|
+
fi
|
|
335
|
+
log_success "Test database cleaned up"
|
|
336
|
+
|
|
337
|
+
# Verify Redis flushed
|
|
338
|
+
local redis_keys=$(redis-cli keys "*" | wc -l)
|
|
339
|
+
if [[ "$redis_keys" -gt 0 ]]; then
|
|
340
|
+
echo "Warning: Redis still contains keys ($redis_keys)"
|
|
341
|
+
else
|
|
342
|
+
log_success "Redis flushed successfully"
|
|
343
|
+
fi
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
# Main test execution
|
|
347
|
+
main() {
|
|
348
|
+
echo ""
|
|
349
|
+
echo "========================================="
|
|
350
|
+
echo "Transparency Middleware E2E Test Suite"
|
|
351
|
+
echo "========================================="
|
|
352
|
+
echo ""
|
|
353
|
+
|
|
354
|
+
# Execute test suite
|
|
355
|
+
test_environment_preparation
|
|
356
|
+
test_configuration_setup
|
|
357
|
+
test_database_initialization
|
|
358
|
+
test_agent_execution_simulation
|
|
359
|
+
test_sqlite_storage_verification
|
|
360
|
+
test_redis_event_verification
|
|
361
|
+
test_query_and_display
|
|
362
|
+
test_metadata_validation
|
|
363
|
+
test_confidence_scoring
|
|
364
|
+
test_cleanup_validation
|
|
365
|
+
|
|
366
|
+
echo ""
|
|
367
|
+
echo "========================================="
|
|
368
|
+
log_success "E2E Test Complete - All Systems Operational"
|
|
369
|
+
echo "========================================="
|
|
370
|
+
echo ""
|
|
371
|
+
|
|
372
|
+
# CFN Protocol: Report completion
|
|
373
|
+
redis-cli lpush "swarm:sprint-1.3-testing:backend-dev:done" "complete" >/dev/null 2>&1
|
|
374
|
+
|
|
375
|
+
return 0
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
# Trap errors and ensure cleanup
|
|
379
|
+
trap cleanup EXIT
|
|
380
|
+
|
|
381
|
+
# Execute main function
|
|
382
|
+
main
|
|
383
|
+
|
|
384
|
+
exit_code=$?
|
|
385
|
+
|
|
386
|
+
# Signal CFN completion (even if tests fail)
|
|
387
|
+
if [[ "$exit_code" -eq 0 ]]; then
|
|
388
|
+
CONFIDENCE=0.95
|
|
389
|
+
else
|
|
390
|
+
CONFIDENCE=0.60
|
|
391
|
+
fi
|
|
392
|
+
|
|
393
|
+
# Report confidence to CFN Loop
|
|
394
|
+
"$SCRIPT_DIR/.claude/skills/cfn-cfn-redis-coordination/invoke-waiting-mode.sh" report \
|
|
395
|
+
--task-id "sprint-1.3-testing" \
|
|
396
|
+
--agent-id "backend-dev" \
|
|
397
|
+
--confidence "$CONFIDENCE" \
|
|
398
|
+
--iteration 1 2>/dev/null || true
|
|
399
|
+
|
|
400
|
+
# Enter waiting mode
|
|
401
|
+
"$SCRIPT_DIR/.claude/skills/cfn-cfn-redis-coordination/invoke-waiting-mode.sh" enter \
|
|
402
|
+
--task-id "sprint-1.3-testing" \
|
|
403
|
+
--agent-id "backend-dev" \
|
|
404
|
+
--context "iteration-1-complete" 2>/dev/null || true
|
|
405
|
+
|
|
406
|
+
exit "$exit_code"
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Integration test: Transparency middleware with CFN Loop orchestrator
|
|
3
|
+
# Validates middleware initialization, agent wrapping, and memory capture
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
# Enhanced logging function with security audit trail
|
|
8
|
+
log() {
|
|
9
|
+
local level="$1"
|
|
10
|
+
local message="$2"
|
|
11
|
+
local timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
12
|
+
local caller_info=$(caller)
|
|
13
|
+
|
|
14
|
+
# Log to syslog for security tracking
|
|
15
|
+
logger -p local0.notice -t "interaction-tester" \
|
|
16
|
+
"SECURITY_AUDIT: level=${level}, caller=${caller_info}, message=${message}"
|
|
17
|
+
|
|
18
|
+
echo "[${timestamp}] [${level}] [${caller_info}] ${message}"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
# Strict input validation
|
|
22
|
+
validate_input() {
|
|
23
|
+
local input="$1"
|
|
24
|
+
local input_type="$2"
|
|
25
|
+
|
|
26
|
+
case "$input_type" in
|
|
27
|
+
"task_id")
|
|
28
|
+
if [[ ! "$input" =~ ^[a-zA-Z0-9_-]+$ ]]; then
|
|
29
|
+
log "SECURITY_ERROR" "Invalid task_id format: ${input}"
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
;;
|
|
33
|
+
"agent_id")
|
|
34
|
+
if [[ ! "$input" =~ ^[a-zA-Z0-9_-]+$ ]]; then
|
|
35
|
+
log "SECURITY_ERROR" "Invalid agent_id format: ${input}"
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
;;
|
|
39
|
+
*)
|
|
40
|
+
log "SECURITY_ERROR" "Unknown input type: ${input_type}"
|
|
41
|
+
exit 1
|
|
42
|
+
;;
|
|
43
|
+
esac
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# Error handling wrapper with extensive logging
|
|
47
|
+
safe_execute() {
|
|
48
|
+
local command="$1"
|
|
49
|
+
local error_message="${2:-Execution failed}"
|
|
50
|
+
local log_file="/tmp/interaction_tester_$(date +%s).log"
|
|
51
|
+
|
|
52
|
+
# Redirect command output to log file for detailed tracing
|
|
53
|
+
set +e
|
|
54
|
+
eval "$command" > >(tee -a "$log_file") 2> >(tee -a "$log_file" >&2)
|
|
55
|
+
local exit_code=$?
|
|
56
|
+
set -e
|
|
57
|
+
|
|
58
|
+
if [ $exit_code -ne 0 ]; then
|
|
59
|
+
log "ERROR" "$error_message (Exit code: $exit_code)"
|
|
60
|
+
log "ERROR" "Detailed logs in: $log_file"
|
|
61
|
+
|
|
62
|
+
# Signal failure to Redis coordination with log reference
|
|
63
|
+
redis-cli lpush "swarm:sprint-1.3-testing:interaction-tester:error" \
|
|
64
|
+
"integration_test_failure:${log_file}" >/dev/null
|
|
65
|
+
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# Cleanup log file after successful execution
|
|
70
|
+
rm -f "$log_file"
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# Dependency check
|
|
74
|
+
check_dependencies() {
|
|
75
|
+
local dependencies=("node" "sqlite3" "redis-cli" "jq")
|
|
76
|
+
for dep in "${dependencies[@]}"; do
|
|
77
|
+
if ! command -v "$dep" &> /dev/null; then
|
|
78
|
+
log "ERROR" "Dependency not found: $dep"
|
|
79
|
+
exit 1
|
|
80
|
+
fi
|
|
81
|
+
done
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
main() {
|
|
85
|
+
log "INFO" "=== Transparency Middleware Integration Test ==="
|
|
86
|
+
|
|
87
|
+
# Check dependencies
|
|
88
|
+
check_dependencies
|
|
89
|
+
|
|
90
|
+
# 1. Initialize middleware
|
|
91
|
+
log "INFO" "Initializing Transparency Middleware"
|
|
92
|
+
safe_execute "node -e \"
|
|
93
|
+
import TransparencyMiddleware from './src/middleware/transparency-middleware.js';
|
|
94
|
+
const config = TransparencyMiddleware.loadConfig('./.claude/skills/cfn-transparency-middleware/config.json');
|
|
95
|
+
const middleware = new TransparencyMiddleware(config);
|
|
96
|
+
await middleware.initialize();
|
|
97
|
+
console.log('Middleware initialized successfully');
|
|
98
|
+
\"" "Middleware initialization failed"
|
|
99
|
+
|
|
100
|
+
# 2. Spawn test agent with middleware wrapper
|
|
101
|
+
log "INFO" "Spawning test agent"
|
|
102
|
+
safe_execute "./.claude/skills/cfn-transparency-middleware/wrap-agent.sh \
|
|
103
|
+
\"backend-dev\" \
|
|
104
|
+
\"test-agent-1\" \
|
|
105
|
+
\"integration-test-task\" \
|
|
106
|
+
\"echo 'Test execution'\"" "Agent wrapping failed"
|
|
107
|
+
|
|
108
|
+
# 3. Verify memory was captured
|
|
109
|
+
log "INFO" "Verifying memory capture"
|
|
110
|
+
|
|
111
|
+
# Validate task_id using strict input validation
|
|
112
|
+
TASK_ID="integration-test-task"
|
|
113
|
+
validate_input "$TASK_ID" "task_id"
|
|
114
|
+
|
|
115
|
+
# Prepared statement with parameterized query
|
|
116
|
+
MEMORY_COUNT=$(safe_execute "sqlite3 -csv .claude/swarm-memory.db \
|
|
117
|
+
'SELECT COUNT(*) FROM agent_memory WHERE task_id = ?;' '$TASK_ID'" "SQLite query failed")
|
|
118
|
+
|
|
119
|
+
if [ "$MEMORY_COUNT" -eq 0 ]; then
|
|
120
|
+
log "ERROR" "No memory captured for task: $TASK_ID"
|
|
121
|
+
|
|
122
|
+
# Log additional diagnostic information
|
|
123
|
+
redis-cli lpush "swarm:sprint-1.3-testing:interaction-tester:memory_check" \
|
|
124
|
+
"task_id_length:${#TASK_ID},task_id_check:$TASK_ID" >/dev/null
|
|
125
|
+
|
|
126
|
+
exit 1
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
log "INFO" "Memory captured: $MEMORY_COUNT events"
|
|
130
|
+
|
|
131
|
+
# 4. Verify Redis events emitted
|
|
132
|
+
log "INFO" "Checking Redis events"
|
|
133
|
+
REDIS_EVENTS=$(safe_execute "redis-cli llen \"agent:transparency\"" "Redis event count failed")
|
|
134
|
+
log "INFO" "Redis events: $REDIS_EVENTS"
|
|
135
|
+
|
|
136
|
+
# 5. Test query script
|
|
137
|
+
log "INFO" "Testing memory query script"
|
|
138
|
+
safe_execute "./.claude/skills/cfn-transparency-middleware/query-memory.sh \
|
|
139
|
+
\"integration-test-task\" \
|
|
140
|
+
\"*\" \
|
|
141
|
+
10 | jq '.' >/dev/null" "Memory query failed"
|
|
142
|
+
|
|
143
|
+
# CFN Protocol: Signal task completion
|
|
144
|
+
redis-cli lpush "swarm:sprint-1.3-testing:interaction-tester:done" "complete" >/dev/null
|
|
145
|
+
|
|
146
|
+
# Report confidence and enter waiting mode
|
|
147
|
+
./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh report \
|
|
148
|
+
--task-id "sprint-1.3-testing" \
|
|
149
|
+
--agent-id "interaction-tester" \
|
|
150
|
+
--confidence 0.95 \
|
|
151
|
+
--iteration 1
|
|
152
|
+
|
|
153
|
+
./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh enter \
|
|
154
|
+
--task-id "sprint-1.3-testing" \
|
|
155
|
+
--agent-id "interaction-tester" \
|
|
156
|
+
--context "iteration-1-complete"
|
|
157
|
+
|
|
158
|
+
log "INFO" "✅ Integration test complete"
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
# Run the main function
|
|
162
|
+
main
|