claude-flow-novice 2.5.2 → 2.8.1
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/adaptive-context/cfn-v3-reflection.json +21 -0
- package/.claude/agents/AGENT_LIFECYCLE.md +495 -0
- package/.claude/agents/CLAUDE.md +1002 -1233
- package/.claude/agents/accessibility-advocate.md +457 -0
- package/.claude/agents/agent-principles/README.md +226 -226
- package/.claude/agents/agent-principles/agent-type-guidelines.md +10 -0
- package/.claude/agents/agent-principles/format-selection.md +10 -0
- package/.claude/agents/agent-principles/phase4-template-optimization.md +502 -494
- package/.claude/agents/agent-principles/prompt-engineering.md +8 -0
- package/.claude/agents/agent-principles/quality-metrics.md +8 -0
- package/.claude/agents/analysis/code-analyzer.md +7 -17
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +2 -104
- package/.claude/agents/analysis/perf-analyzer.md +2 -196
- package/.claude/agents/context/context-curator.md +78 -84
- package/.claude/agents/context/context-reflector.md +27 -81
- package/.claude/agents/coordinators/README.md +42 -0
- package/.claude/agents/coordinators/cfn-v3-coordinator.md +440 -0
- package/.claude/agents/{product-owner-team → coordinators}/cto-agent.md +154 -187
- package/.claude/agents/coordinators/multi-sprint-coordinator.md +50 -0
- package/.claude/agents/{product-owner-team → coordinators}/product-owner-agent.md +6 -39
- package/.claude/agents/{cfn-loop → coordinators}/product-owner.md +72 -17
- package/.claude/agents/core-agents/reviewer.md +114 -135
- package/.claude/agents/custom/agent-builder.md +637 -0
- package/.claude/agents/developers/README.md +69 -0
- package/.claude/agents/developers/backend-dev.md +77 -0
- package/.claude/agents/{core-agents → developers}/coder.md +131 -26
- package/.claude/agents/developers/react-frontend-engineer.md +121 -0
- package/.claude/agents/{frontend → developers}/state-architect.md +1 -0
- package/.claude/agents/{frontend → developers}/ui-designer.md +1 -0
- package/.claude/agents/development/backend/dev-backend-api.md +0 -29
- package/.claude/agents/development/npm-package-specialist.md +355 -347
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +8 -0
- package/.claude/agents/documentation/api-docs.md +8 -0
- package/.claude/agents/github/github-commit-agent.md +125 -117
- package/.claude/agents/goal/goal-planner.md +8 -0
- package/.claude/agents/infrastructure/README.md +100 -0
- package/.claude/agents/{specialized → infrastructure}/devops-engineer.md +131 -150
- package/.claude/agents/planners/README.md +94 -0
- package/.claude/agents/{core-agents → planners}/analyst.md +1 -22
- package/.claude/agents/{planning-team → planners}/api-designer-persona.md +8 -0
- package/.claude/agents/{core-agents → planners}/architect.md +7 -20
- package/.claude/agents/{core-agents → planners}/planner.md +0 -21
- package/.claude/agents/{planning-team → planners}/security-architect-persona.md +8 -28
- package/.claude/agents/{planning-team → planners}/system-architect-persona.md +6 -38
- package/.claude/agents/{architecture → planners}/system-architect.md +12 -17
- package/.claude/agents/product-owner-team/accessibility-advocate-persona.md +132 -161
- package/.claude/agents/product-owner-team/power-user-persona.md +149 -182
- package/.claude/agents/retrospective-analyst.md +84 -0
- package/.claude/agents/reviewers/README.md +58 -0
- package/.claude/agents/{analysis → reviewers}/code-quality-validator.md +8 -17
- package/.claude/agents/reviewers/reviewer.md +181 -0
- package/.claude/agents/sparc/architecture.md +6 -25
- package/.claude/agents/sparc/pseudocode.md +6 -0
- package/.claude/agents/sparc/refinement.md +6 -0
- package/.claude/agents/sparc/specification.md +1 -0
- package/.claude/agents/specialists/README.md +60 -0
- package/.claude/agents/{core-agents → specialists}/base-template-generator.md +8 -21
- package/.claude/agents/{specialized → specialists}/cli-agent-optimizer.md +1 -1
- package/.claude/agents/{specialized → specialists}/code-booster.md +1 -0
- package/.claude/agents/{consensus → specialists}/consensus-builder.md +1 -17
- package/.claude/agents/{specialized/mobile → specialists}/mobile-dev.md +0 -20
- package/.claude/agents/{core-agents → specialists}/performance-benchmarker.md +134 -148
- package/.claude/agents/{specialized → specialists}/rust-developer.md +1 -20
- package/.claude/agents/{specialized → specialists}/rust-enterprise-developer.md +1 -20
- package/.claude/agents/{specialized → specialists}/rust-mvp-developer.md +1 -20
- package/.claude/agents/{core-agents → specialists}/security-manager.md +68 -88
- package/.claude/agents/{security → specialists}/security-specialist-existing.md +6 -57
- package/.claude/agents/{security → specialists}/security-specialist.md +6 -30
- package/.claude/agents/{specialized/mobile → specialists}/spec-mobile-react-native.md +2 -21
- package/.claude/agents/testers/README.md +94 -0
- package/.claude/agents/{testing → testers}/e2e/playwright-agent.md +1 -20
- package/.claude/agents/{testing → testers}/interaction-tester.md +1 -20
- package/.claude/agents/{testing → testers}/playwright-tester.md +1 -1
- package/.claude/agents/testers/tester.md +139 -0
- package/.claude/agents/testers/unit/tdd-london-swarm.md +49 -0
- package/.claude/agents/testers/validation/production-validator.md +33 -0
- package/.claude/agents-ignore/cfn-loop-coordinator.md +157 -0
- package/.claude/agents-ignore/cfn-loop-coordinator.md.backup +156 -0
- package/.claude/agents-ignore/coordinator.md.backup +182 -0
- package/.claude/agents-ignore/cost-savings-cfn-loop-coordinator.md +760 -0
- package/.claude/agents-ignore/cost-savings-coordinator.md +173 -0
- package/.claude/artifacts/ace-reflections/REFLECT-001-summary.json +39 -0
- package/.claude/artifacts/ace-reflections/sprint-7_$(date -u +/"%Y%m%d_%H%M%S/").json" +47 -0
- package/.claude/artifacts/reflection-merge-logs/cli-agent-spawning-v2.5.2-merge-report.md +61 -0
- package/.claude/commands/CFN_COORDINATOR_PARAMETERS.md +10 -10
- package/.claude/commands/cfn-loop-epic.md +43 -19
- package/.claude/commands/cfn-loop-single.md +3 -3
- package/.claude/commands/cfn-loop-sprints.md +1 -1
- package/.claude/commands/cfn-loop.md +45 -32
- package/.claude/commands/cfn-mode.md +20 -0
- package/.claude/commands/custom-routing-activate.md +37 -123
- package/.claude/commands/custom-routing-deactivate.md +27 -124
- package/.claude/commands/switch-api.md +41 -16
- package/.claude/commands/write-plan.md +104 -0
- package/.claude/data/cfn-loop.db +0 -0
- package/.claude/data/cfn_loop_logs.db +0 -0
- package/.claude/hooks/BACKUP_USAGE.md +243 -0
- package/.claude/hooks/post-edit-cfn-retrospective.sh +79 -0
- package/.claude/hooks/post-edit.sh +21 -0
- package/.claude/hooks/pre-edit-backup.sh +71 -0
- package/.claude/hooks/restore-from-backup.sh +37 -0
- package/.claude/prompts/cfn-loop-context.md +115 -0
- package/.claude/prompts/loop-specific/loop2.md +50 -0
- package/.claude/prompts/loop-specific/loop3.md +43 -0
- package/.claude/prompts/loop-specific/loop4.md +54 -0
- package/.claude/root-claude-distribute/CLAUDE.md +76 -2
- package/.claude/skills/ace-system/sprint-7-lessons.json +46 -0
- package/.claude/skills/ace-system/store-reflection.sh +33 -136
- package/.claude/skills/agent-discovery/SKILL.md +40 -0
- package/.claude/skills/agent-discovery/agents-registry-clean.json +0 -0
- package/.claude/skills/agent-discovery/agents-registry-fixed.json +19 -0
- package/.claude/skills/agent-discovery/agents-registry.json +718 -0
- package/.claude/skills/agent-discovery/discover-agents.py +175 -0
- package/.claude/skills/agent-discovery/discover-agents.sh +87 -0
- package/.claude/skills/agent-discovery/invoke-registry.sh +11 -0
- package/.claude/skills/agent-discovery/temp_script.py +0 -0
- package/.claude/skills/agent-execution/execute-agent.sh +126 -0
- package/.claude/skills/agent-output-processing/SKILL.md +359 -0
- package/.claude/skills/agent-selector/SKILL.md +90 -0
- package/.claude/skills/agent-selector/select-agents.sh +96 -0
- package/.claude/skills/agent-spawning/agent-selection-guide.md +1 -1
- package/.claude/skills/agent-swap/SKILL.md +36 -0
- package/.claude/skills/agent-swap/recommend-swap.sh +60 -0
- package/.claude/skills/api-validation/test-endpoints.sh +54 -0
- package/.claude/skills/automatic-memory-persistence/SKILL.md +73 -0
- package/.claude/skills/automatic-memory-persistence/persist-agent-output.sh +49 -0
- package/.claude/skills/automatic-memory-persistence/query-agent-history.sh +35 -0
- package/.claude/skills/automatic-memory-persistence/test-memory-persistence.sh +235 -0
- package/.claude/skills/cfn-loop-orchestration/README.md +41 -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/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/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 +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 +307 -217
- package/.claude/skills/complexity-estimator/SKILL.md +96 -0
- package/.claude/skills/complexity-estimator/estimate-complexity.sh +144 -0
- package/.claude/skills/context-pruner/SKILL.md +75 -0
- package/.claude/skills/context-pruner/prune-context.sh +73 -0
- package/.claude/skills/defense-in-depth/SKILL.md +133 -0
- package/.claude/skills/dependency-extractor/SKILL.md +35 -0
- package/.claude/skills/dependency-extractor/extract-dependencies.sh +66 -0
- package/.claude/skills/epic-decomposer/SKILL.md +44 -0
- package/.claude/skills/epic-decomposer/decompose-epic.sh +104 -0
- package/.claude/skills/improvement-recommender/SKILL.md +33 -0
- package/.claude/skills/improvement-recommender/recommend-improvements.sh +92 -0
- package/.claude/skills/intervention-detector/SKILL.md +39 -0
- package/.claude/skills/intervention-detector/detect-intervention.sh +111 -0
- package/.claude/skills/intervention-orchestrator/SKILL.md +43 -0
- package/.claude/skills/intervention-orchestrator/execute-intervention.sh +59 -0
- package/.claude/skills/loop2-output-processing/SKILL.md +163 -0
- package/.claude/skills/loop2-output-processing/execute-and-extract.sh +77 -0
- package/.claude/skills/loop2-output-processing/execute-and-extract.sh.backup +36 -0
- package/.claude/skills/loop2-output-processing/parse-feedback.sh +147 -0
- package/.claude/skills/loop2-output-processing/process-validator-output.sh +275 -0
- package/.claude/skills/loop2-output-processing/test-bug27-fix.sh +200 -0
- package/.claude/skills/loop2-output-processing/test-loop2-processing.sh +113 -0
- package/.claude/skills/loop3-output-processing/AGENT_COMPLETION_PROTOCOL.md +206 -0
- package/.claude/skills/loop3-output-processing/SKILL.md +421 -0
- package/.claude/skills/loop3-output-processing/calculate-confidence.sh +28 -0
- package/.claude/skills/loop3-output-processing/execute-and-extract.sh +85 -0
- package/.claude/skills/loop3-output-processing/parse-confidence.sh +31 -0
- package/.claude/skills/loop3-output-processing/test-agent-timeout.sh +327 -0
- package/.claude/skills/loop3-output-processing/test-loop3-processing.sh +155 -0
- package/.claude/skills/loop3-output-processing/verify-deliverables.sh +42 -0
- package/.claude/skills/pattern-extraction/SKILL.md +30 -0
- package/.claude/skills/pattern-extraction/extract-patterns.sh +80 -0
- package/.claude/skills/playbook/SKILL.md +113 -0
- package/.claude/skills/playbook/init-playbook.sh +54 -0
- package/.claude/skills/playbook/playbook.db +0 -0
- package/.claude/skills/playbook/query-playbook.sh +79 -0
- package/.claude/skills/playbook/update-playbook.sh +69 -0
- package/.claude/skills/playbook-auto-update/SKILL.md +29 -0
- package/.claude/skills/playbook-auto-update/auto-update-playbook.sh +86 -0
- package/.claude/skills/product-owner-decision/SKILL.md +332 -0
- package/.claude/skills/product-owner-decision/execute-decision.sh +176 -0
- package/.claude/skills/product-owner-decision/parse-decision.sh +66 -0
- package/.claude/skills/product-owner-decision/validate-deliverables.sh +82 -0
- package/.claude/skills/redis-coordination/AGENT_LOGGING.md +280 -0
- package/.claude/skills/redis-coordination/LOGGING.md +260 -0
- package/.claude/skills/redis-coordination/README.md +30 -29
- package/.claude/skills/redis-coordination/SKILL.md +685 -83
- package/.claude/skills/redis-coordination/agent-log.sh +124 -0
- package/.claude/skills/redis-coordination/analyze-task-complexity.sh +277 -0
- package/.claude/skills/redis-coordination/cfn-loop-exec.sh +468 -0
- package/.claude/skills/redis-coordination/collect-confidence-scores.sh +179 -0
- package/.claude/skills/redis-coordination/collect-results.sh +75 -0
- package/.claude/skills/redis-coordination/data/cfn-loop.db +0 -0
- package/.claude/skills/redis-coordination/demos/test-iteration-feedback.sh +320 -0
- package/.claude/skills/redis-coordination/{test-orchestrator.sh → demos/test-orchestrator.sh} +25 -0
- package/.claude/skills/redis-coordination/execute-product-owner-decision.sh +258 -0
- package/.claude/skills/redis-coordination/get-agent-timeout.sh +176 -176
- package/.claude/skills/redis-coordination/init-swarm.sh +6 -1
- package/.claude/skills/redis-coordination/invoke-waiting-mode.sh +106 -183
- package/.claude/skills/redis-coordination/invoke-waiting-mode.sh.backup-p7 +423 -0
- package/.claude/skills/redis-coordination/log-event.sh +109 -0
- package/.claude/skills/redis-coordination/monitor-cfn-violations.sh +391 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop-v3.sh +141 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh +31 -933
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.backup +38 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.backup-1761167675 +1672 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.backup-p5 +1604 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.backup-phase1 +1550 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.backup-phase2 +1621 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.backup-phase3 +1621 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.bak +0 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.broken +1627 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.corrupted +80 -0
- package/.claude/skills/redis-coordination/orchestrate-cfn-loop.sh.deprecated +1864 -0
- package/.claude/skills/redis-coordination/query-logs.sh +103 -0
- package/.claude/skills/redis-coordination/retrieve-context.sh +58 -0
- package/.claude/skills/redis-coordination/select-specialist-agent.sh +371 -0
- package/.claude/skills/redis-coordination/semantic-match-tfidf.py +252 -0
- package/.claude/skills/redis-coordination/send-heartbeat.sh +164 -72
- package/.claude/skills/redis-coordination/signal.sh +38 -0
- package/.claude/skills/redis-coordination/store-context.sh +86 -0
- package/.claude/skills/redis-coordination/store-epic-context.sh +123 -0
- package/.claude/skills/redis-coordination/test-context-injection.sh +354 -0
- package/.claude/skills/redis-coordination/test-timeout-enforcement.sh +513 -0
- package/.claude/skills/redis-coordination/tests/convert-line-endings.sh +15 -0
- package/.claude/skills/redis-coordination/tests/dlq-functionality-test.sh +101 -101
- package/.claude/skills/redis-coordination/tests/edge-cases-test.sh +98 -98
- package/.claude/skills/redis-coordination/tests/integration-test.sh +169 -169
- package/.claude/skills/redis-coordination/tests/retry-mechanism-test.sh +81 -81
- package/.claude/skills/redis-coordination/tests/run-test-suite.sh +91 -91
- package/.claude/skills/redis-coordination/tests/run-tests.sh +4 -0
- package/.claude/skills/redis-coordination/tests/test-primitives.sh +166 -0
- package/.claude/skills/redis-coordination/tests/test-utils.sh +53 -121
- package/.claude/skills/redis-coordination/tests/test_coordination_primitives.sh.deprecated +20 -0
- package/.claude/skills/redis-coordination/tests/test_utils.sh +49 -0
- package/.claude/skills/redis-coordination/v2_modularization/core_orchestration.sh +76 -0
- package/.claude/skills/redis-coordination/validate-parameters.sh +492 -0
- package/.claude/skills/retrospective-report/SKILL.md +31 -0
- package/.claude/skills/retrospective-report/generate-report.sh +101 -0
- package/.claude/skills/run-all-skill-tests.sh +124 -0
- package/.claude/skills/scope-simplifier/SKILL.md +37 -0
- package/.claude/skills/scope-simplifier/simplify-scope.sh +68 -0
- package/.claude/skills/simplified-agent-lifecycle/COST_ANALYSIS.md +49 -0
- package/.claude/skills/simplified-agent-lifecycle/DESIGN.md +98 -0
- package/.claude/skills/simplified-agent-lifecycle/MIGRATION_PLAN.md +74 -0
- package/.claude/skills/skill-builder/SKILL.md +910 -0
- package/.claude/skills/specialist-injection/SKILL.md +41 -0
- package/.claude/skills/specialist-injection/recommend-specialist.sh +57 -0
- package/.claude/skills/sprint-execution/SKILL.md +27 -0
- package/.claude/skills/sprint-execution/execute-sprint-task.sh +59 -0
- package/.claude/skills/sprint-execution/execute-sprint.sh +65 -0
- package/.claude/skills/sprint-planner/SKILL.md +37 -0
- package/.claude/skills/sprint-planner/plan-sprint.sh +85 -0
- package/.claude/skills/standardized-error-handling/SKILL.md +56 -0
- package/.claude/skills/standardized-error-handling/capture-agent-error.sh +87 -0
- package/.claude/skills/standardized-error-handling/test-error-handling.sh +166 -0
- package/.claude/skills/task-classifier/SKILL.md +94 -0
- package/.claude/skills/task-classifier/classify-task.sh +115 -0
- package/.claude/skills/validation-templates/SKILL.md +47 -0
- package/.claude/skills/validation-templates/content.json +38 -0
- package/.claude/skills/validation-templates/data.json +38 -0
- package/.claude/skills/validation-templates/design.json +38 -0
- package/.claude/skills/validation-templates/infrastructure.json +38 -0
- package/.claude/skills/validation-templates/research.json +38 -0
- package/.claude/skills/validation-templates/software.json +38 -0
- package/.claude/skills/webapp-testing/README.md +142 -0
- package/.claude/skills/webapp-testing/SCREENSHOT_NAMING_CONVENTION.md +547 -0
- package/.claude/skills/webapp-testing/SKILL.md +877 -0
- package/.claude/skills/webapp-testing/capture-screenshot.sh +238 -0
- package/.claude/skills/webapp-testing/cfn-loop-integration.sh +265 -0
- package/.claude/skills/webapp-testing/compare-screenshots.sh +199 -0
- package/.claude/skills/webapp-testing/init-storage.sh +150 -0
- package/.claude/skills/webapp-testing/set-baseline.sh +196 -0
- package/.claude/skills/webapp-testing/test-webapp-testing.sh +233 -0
- package/.claude/spawn-pattern-examples.md +3 -3
- package/CLAUDE.md +364 -16
- package/README.md +598 -251
- package/dist/agents/agent-loader.js +146 -165
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/cli/agent-command.js +153 -0
- package/dist/cli/agent-command.js.map +1 -0
- package/dist/cli/agent-definition-parser.js +183 -0
- package/dist/cli/agent-definition-parser.js.map +1 -0
- package/dist/cli/agent-executor.js +310 -0
- package/dist/cli/agent-executor.js.map +1 -0
- package/dist/cli/agent-prompt-builder.js +268 -0
- package/dist/cli/agent-prompt-builder.js.map +1 -0
- package/dist/cli/agent-spawn.js +56 -2
- package/dist/cli/agent-spawn.js.map +1 -1
- package/dist/cli/anthropic-client.js +421 -0
- package/dist/cli/anthropic-client.js.map +1 -0
- package/dist/cli/cfn-context.js +150 -0
- package/dist/cli/cfn-context.js.map +1 -1
- package/dist/cli/cfn-fork.js +159 -0
- package/dist/cli/cfn-fork.js.map +1 -0
- package/dist/cli/cli-agent-context.js +358 -0
- package/dist/cli/cli-agent-context.js.map +1 -0
- package/dist/cli/config-manager.js +109 -91
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/conversation-fork.js +201 -0
- package/dist/cli/conversation-fork.js.map +1 -0
- package/dist/cli/index.js +119 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/iteration-history.js +188 -0
- package/dist/cli/iteration-history.js.map +1 -0
- package/dist/cli/tool-definitions.js +263 -0
- package/dist/cli/tool-definitions.js.map +1 -0
- package/dist/cli/tool-executor.js +247 -0
- package/dist/cli/tool-executor.js.map +1 -0
- package/dist/hello.js +8 -0
- package/dist/hello.js.map +1 -0
- package/package.json +16 -6
- package/scripts/README.md +68 -0
- package/scripts/cfn-intervention-example.sh +21 -0
- package/scripts/migrate-test-infrastructure.sh +40 -0
- package/scripts/switch-api.sh +233 -0
- package/scripts/validate-test-migration.sh +49 -0
- package/scripts/verify-no-secrets.sh +55 -0
- package/.claude/agents/architecture/system-architect.md.backup +0 -603
- package/.claude/agents/code-booster.md +0 -131
- package/.claude/agents/consensus/performance-benchmarker.md +0 -101
- package/.claude/agents/consensus/security-manager.md +0 -107
- package/.claude/agents/context-curator.md +0 -167
- package/.claude/agents/context-reflector.md +0 -65
- package/.claude/agents/core-agents/cfn-loop-coordinator.md +0 -134
- package/.claude/agents/core-agents/code-quality-validator.md +0 -149
- package/.claude/agents/core-agents/context-curator.md +0 -452
- package/.claude/agents/core-agents/context-reflector.md +0 -273
- package/.claude/agents/core-agents/cost-savings-cfn-loop-coordinator.md +0 -190
- package/.claude/agents/core-agents/tester.md +0 -170
- package/.claude/agents/development/backend-dev.md +0 -165
- package/.claude/agents/devops/devops-engineer.md +0 -148
- package/.claude/agents/frontend/interaction-tester.md +0 -139
- package/.claude/agents/frontend/react-frontend-engineer.md +0 -9
- package/.claude/agents/personas/accessibility-advocate-persona.md +0 -107
- package/.claude/agents/testing/production-validator.md +0 -179
- package/.claude/agents/testing/tdd-london-swarm.md +0 -209
- package/.claude/agents/testing/unit/tdd-london-swarm.md +0 -43
- package/.claude/agents/testing/validation/production-validator.md +0 -43
- package/dist/coordination/fleet-manager.test.js +0 -141
- package/dist/coordination/fleet-manager.test.js.map +0 -1
- package/dist/middleware/transparency-middleware.test.js +0 -184
- package/dist/middleware/transparency-middleware.test.js.map +0 -1
- /package/.claude/agents/{core-agents → developers}/researcher.md +0 -0
- /package/.claude/agents/{consensus → specialists}/crdt-synchronizer.md +0 -0
- /package/.claude/agents/{consensus → specialists}/quorum-manager.md +0 -0
- /package/.claude/agents/{consensus → specialists}/raft-manager.md +0 -0
- /package/.claude/{agents/core-agents → agents-ignore}/coordinator.md +0 -0
- /package/.claude/{agents/core-agents/cost-savings-coordinator.md → agents-ignore/cost-savings-coordinator.md.backup} +0 -0
- /package/.claude/skills/redis-coordination/{phase4-wake-queue-test-report.md → demos/phase4-wake-queue-test-report.md} +0 -0
- /package/.claude/skills/redis-coordination/{test-bzpopmin-fix.sh → demos/test-bzpopmin-fix.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-cancel-swarm.sh → demos/test-cancel-swarm.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-dlq.sh → demos/test-dlq.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-priority-wake-phase4-unix.sh → demos/test-priority-wake-phase4-unix.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-priority-wake-phase4.sh → demos/test-priority-wake-phase4.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-priority-wake.sh → demos/test-priority-wake.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-quick-fix.sh → demos/test-quick-fix.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-quorum-absolute.sh → demos/test-quorum-absolute.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-quorum-fallback.sh → demos/test-quorum-fallback.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-quorum-percentage.sh → demos/test-quorum-percentage.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-quorum-with-retry.sh → demos/test-quorum-with-retry.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-quorum.sh → demos/test-quorum.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-shutdown-handling.sh → demos/test-shutdown-handling.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-shutdown.sh → demos/test-shutdown.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-utils-unix.sh → demos/test-utils-unix.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-utils.sh → demos/test-utils.sh} +0 -0
- /package/.claude/skills/redis-coordination/{test-waiting-mode.sh → demos/test-waiting-mode.sh} +0 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Loop 2 Output Processing: Feedback Parsing
|
|
5
|
+
# Supports both old (stdin) and new (--extract-*) interfaces
|
|
6
|
+
|
|
7
|
+
detect_confidence() {
|
|
8
|
+
local input="$1"
|
|
9
|
+
|
|
10
|
+
# Pattern 1: Explicit numeric in header (## Validation Confidence: 0.XX)
|
|
11
|
+
if echo "$input" | grep -qoE "Validation Confidence:?\s*0?\.[0-9]+"; then
|
|
12
|
+
echo "$input" | grep -oE "Validation Confidence:?\s*0?\.[0-9]+" | grep -oE "0?\.[0-9]+" | head -1
|
|
13
|
+
return 0
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Pattern 2: Generic confidence field (confidence: 0.XX or Confidence: 0.XX)
|
|
17
|
+
if echo "$input" | grep -qoiE "confidence:?\s*0?\.[0-9]+"; then
|
|
18
|
+
echo "$input" | grep -oiE "confidence:?\s*0?\.[0-9]+" | grep -oE "0?\.[0-9]+" | head -1
|
|
19
|
+
return 0
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Pattern 3: Percentage (XX% or XX percent)
|
|
23
|
+
if echo "$input" | grep -qoE "[0-9]+%|[0-9]+\s*percent"; then
|
|
24
|
+
PERCENT=$(echo "$input" | grep -oE "[0-9]+%|[0-9]+\s*percent" | grep -oE "[0-9]+" | head -1)
|
|
25
|
+
echo "scale=2; $PERCENT / 100" | bc
|
|
26
|
+
return 0
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Pattern 4: Decimal without prefix (e.g., "0.87" in context of confidence)
|
|
30
|
+
if echo "$input" | grep -qE "(score|rating|level).{0,10}0?\.[0-9]{2}"; then
|
|
31
|
+
echo "$input" | grep -oE "(score|rating|level).{0,10}0?\.[0-9]{2}" | grep -oE "0?\.[0-9]{2}" | head -1
|
|
32
|
+
return 0
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Pattern 5: Qualitative (high/medium/low) - check word boundaries
|
|
36
|
+
if echo "$input" | grep -qiE "(high|strong|excellent)[[:space:]]*(confidence|validation)|(confidence|validation)[[:space:]]*(high|strong|excellent)"; then
|
|
37
|
+
echo "0.90"
|
|
38
|
+
return 0
|
|
39
|
+
fi
|
|
40
|
+
if echo "$input" | grep -qiE "(medium|moderate|good)[[:space:]]*(confidence|validation)|(confidence|validation)[[:space:]]*(medium|moderate|good)"; then
|
|
41
|
+
echo "0.75"
|
|
42
|
+
return 0
|
|
43
|
+
fi
|
|
44
|
+
if echo "$input" | grep -qiE "(low|weak|poor)[[:space:]]*(confidence|validation)|(confidence|validation)[[:space:]]*(low|weak|poor)"; then
|
|
45
|
+
echo "0.50"
|
|
46
|
+
return 0
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# Default: not found
|
|
50
|
+
echo "0.0"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
extract_feedback_items() {
|
|
54
|
+
local input="$1"
|
|
55
|
+
local category="$2"
|
|
56
|
+
|
|
57
|
+
# BUG #27 FIX: Enhanced feedback extraction with multiple patterns
|
|
58
|
+
|
|
59
|
+
# Pattern 1: Look for categorized sections (### CRITICAL Issues)
|
|
60
|
+
# Use awk to extract section between header and next ### or EOF
|
|
61
|
+
local items=$(echo "$input" | awk -v cat="$category" '
|
|
62
|
+
BEGIN { in_section=0; IGNORECASE=1 }
|
|
63
|
+
/^###/ {
|
|
64
|
+
if ($0 ~ cat) { in_section=1; next }
|
|
65
|
+
else { in_section=0 }
|
|
66
|
+
}
|
|
67
|
+
in_section && /^[-*0-9]/ {
|
|
68
|
+
# Remove bullet prefix and trim
|
|
69
|
+
gsub(/^[- *0-9.]+/, "")
|
|
70
|
+
gsub(/^[[:space:]]+|[[:space:]]+$/, "")
|
|
71
|
+
if (length($0) > 0) print
|
|
72
|
+
}
|
|
73
|
+
')
|
|
74
|
+
|
|
75
|
+
# Pattern 2: If no structured sections, look for inline mentions (Critical:, Warning:, etc.)
|
|
76
|
+
if [[ -z "$items" ]]; then
|
|
77
|
+
items=$(echo "$input" | grep -iA3 "${category}:" | tail -n +2 | grep -E "^-|^\*|^[0-9]" | sed 's/^[- \*0-9.]*//g' | sed 's/^[[:space:]]*//' | grep -v "^$" | head -5)
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
# Pattern 3: Extract from sentences containing category keyword (e.g., "Critical: error found")
|
|
81
|
+
if [[ -z "$items" ]]; then
|
|
82
|
+
# Look for sentences like "Critical: missing error handling"
|
|
83
|
+
items=$(echo "$input" | grep -iE "^${category}:" | sed "s/^${category}://i" | sed 's/^[[:space:]]*//' | grep -v "^$" | head -3)
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
if [[ -n "$items" ]]; then
|
|
87
|
+
# Convert to JSON array, filtering empty lines and "No issues found"
|
|
88
|
+
echo "$items" | jq -R -s -c 'split("\n") | map(select(length > 0 and . != "No issues found" and . != "Issues"))'
|
|
89
|
+
else
|
|
90
|
+
echo "[]"
|
|
91
|
+
fi
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# Check if using new interface (--extract-*)
|
|
95
|
+
if [[ "${1:-}" == "--extract-confidence" ]]; then
|
|
96
|
+
# New interface: --extract-confidence "output text"
|
|
97
|
+
INPUT="${2:-}"
|
|
98
|
+
detect_confidence "$INPUT"
|
|
99
|
+
exit 0
|
|
100
|
+
elif [[ "${1:-}" == "--extract-feedback" ]]; then
|
|
101
|
+
# New interface: --extract-feedback "output text"
|
|
102
|
+
INPUT="${2:-}"
|
|
103
|
+
|
|
104
|
+
CRITICAL=$(extract_feedback_items "$INPUT" "Critical")
|
|
105
|
+
WARNINGS=$(extract_feedback_items "$INPUT" "Warning")
|
|
106
|
+
SUGGESTIONS=$(extract_feedback_items "$INPUT" "Suggestion")
|
|
107
|
+
|
|
108
|
+
# Output JSON feedback object
|
|
109
|
+
jq -n \
|
|
110
|
+
--argjson critical "$CRITICAL" \
|
|
111
|
+
--argjson warnings "$WARNINGS" \
|
|
112
|
+
--argjson suggestions "$SUGGESTIONS" \
|
|
113
|
+
'{critical: $critical, warnings: $warnings, suggestions: $suggestions}'
|
|
114
|
+
exit 0
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# Old interface (backward compatibility): read from stdin
|
|
118
|
+
RAW_INPUT=$(cat | xargs)
|
|
119
|
+
|
|
120
|
+
# If input is empty, use a default
|
|
121
|
+
if [[ -z "$RAW_INPUT" ]]; then
|
|
122
|
+
RAW_INPUT="No specific feedback"
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
# Detect confidence
|
|
126
|
+
CONFIDENCE=$(detect_confidence "$RAW_INPUT")
|
|
127
|
+
|
|
128
|
+
# Extract feedback
|
|
129
|
+
CRITICAL=$(extract_feedback_items "$RAW_INPUT" "Critical")
|
|
130
|
+
WARNING=$(extract_feedback_items "$RAW_INPUT" "Warning")
|
|
131
|
+
SUGGESTION=$(extract_feedback_items "$RAW_INPUT" "Suggestion")
|
|
132
|
+
|
|
133
|
+
# Output JSON (old format for backward compatibility)
|
|
134
|
+
jq -n \
|
|
135
|
+
--arg confidence "$CONFIDENCE" \
|
|
136
|
+
--argjson critical "$CRITICAL" \
|
|
137
|
+
--argjson warning "$WARNING" \
|
|
138
|
+
--argjson suggestion "$SUGGESTION" \
|
|
139
|
+
'{
|
|
140
|
+
confidence: ($confidence | tonumber),
|
|
141
|
+
confidence_source: "extracted",
|
|
142
|
+
feedback: {
|
|
143
|
+
critical: $critical,
|
|
144
|
+
warning: $warning,
|
|
145
|
+
suggestion: $suggestion
|
|
146
|
+
}
|
|
147
|
+
}'
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Loop 2 Output Processing: Enhanced Validator Output Processing
|
|
5
|
+
# BUG #27 FIX: Enforce structured output template and reject defaults
|
|
6
|
+
# BUG #30 FIX: Add context sanitization and environment validation
|
|
7
|
+
|
|
8
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
+
|
|
10
|
+
# Parse arguments (SAME AS execute-and-extract.sh)
|
|
11
|
+
AGENT_TYPE=""
|
|
12
|
+
TASK_ID=""
|
|
13
|
+
AGENT_ID=""
|
|
14
|
+
CONTEXT=""
|
|
15
|
+
ITERATION=1
|
|
16
|
+
TIMEOUT=900
|
|
17
|
+
|
|
18
|
+
while [[ $# -gt 0 ]]; do
|
|
19
|
+
case $1 in
|
|
20
|
+
--agent-type) AGENT_TYPE="$2"; shift 2 ;;
|
|
21
|
+
--task-id) TASK_ID="$2"; shift 2 ;;
|
|
22
|
+
--agent-id) AGENT_ID="$2"; shift 2 ;;
|
|
23
|
+
--context) CONTEXT="$2"; shift 2 ;;
|
|
24
|
+
--iteration) ITERATION="$2"; shift 2 ;;
|
|
25
|
+
--timeout) TIMEOUT="$2"; shift 2 ;;
|
|
26
|
+
*) echo "ERROR: Unknown parameter: $1" >&2; exit 1 ;;
|
|
27
|
+
esac
|
|
28
|
+
done
|
|
29
|
+
|
|
30
|
+
# Validate required parameters
|
|
31
|
+
if [ -z "$AGENT_TYPE" ] || [ -z "$TASK_ID" ] || [ -z "$AGENT_ID" ] || [ -z "$CONTEXT" ]; then
|
|
32
|
+
echo "ERROR: Missing required parameters" >&2
|
|
33
|
+
echo "Usage: $0 --agent-type TYPE --task-id ID --agent-id ID --context CONTEXT [--iteration N] [--timeout SECONDS]" >&2
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# BUG #30 FIX: Context sanitization function
|
|
38
|
+
# Sanitizes context by removing dangerous characters and validating JSON structure
|
|
39
|
+
validate_and_sanitize_context() {
|
|
40
|
+
local context="$1"
|
|
41
|
+
local timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
42
|
+
|
|
43
|
+
echo "[Validator] [$timestamp] Sanitizing context (length: ${#context} chars)" >&2
|
|
44
|
+
echo "[Validator] [$timestamp] Context preview: ${context:0:100}..." >&2
|
|
45
|
+
|
|
46
|
+
# Strip dangerous characters: null bytes, backticks, $, backslash
|
|
47
|
+
# Also strip control characters and other special chars that can break shell parsing
|
|
48
|
+
local sanitized=$(echo "$context" | tr -d '\0' | sed 's/[`$\\]//g' | sed 's/[[:cntrl:]]/ /g')
|
|
49
|
+
|
|
50
|
+
# Log sanitization results
|
|
51
|
+
local removed_chars=$((${#context} - ${#sanitized}))
|
|
52
|
+
if [ "$removed_chars" -gt 0 ]; then
|
|
53
|
+
echo "[Validator] [$timestamp] Sanitized context: removed $removed_chars dangerous characters" >&2
|
|
54
|
+
else
|
|
55
|
+
echo "[Validator] [$timestamp] No dangerous characters found in context" >&2
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# Validate that context is not empty after sanitization
|
|
59
|
+
if [ -z "$sanitized" ]; then
|
|
60
|
+
echo "ERROR: Context became empty after sanitization" >&2
|
|
61
|
+
return 1
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
echo "$sanitized"
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
# BUG #30 FIX: Environment validation function
|
|
68
|
+
# Validates that required environment variables exist before spawning agents
|
|
69
|
+
validate_environment() {
|
|
70
|
+
local timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
71
|
+
local missing_vars=()
|
|
72
|
+
|
|
73
|
+
echo "[Validator] [$timestamp] Validating environment variables" >&2
|
|
74
|
+
|
|
75
|
+
# Check required variables
|
|
76
|
+
if [ -z "${REDIS_HOST:-}" ]; then
|
|
77
|
+
missing_vars+=("REDIS_HOST")
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
if [ -z "${HOME:-}" ]; then
|
|
81
|
+
missing_vars+=("HOME")
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
if [ -z "${PATH:-}" ]; then
|
|
85
|
+
missing_vars+=("PATH")
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
# Log validation results
|
|
89
|
+
if [ ${#missing_vars[@]} -gt 0 ]; then
|
|
90
|
+
echo "ERROR: Missing required environment variables: ${missing_vars[*]}" >&2
|
|
91
|
+
echo "[Validator] [$timestamp] Current environment state:" >&2
|
|
92
|
+
echo "[Validator] REDIS_HOST=${REDIS_HOST:-<not set>}" >&2
|
|
93
|
+
echo "[Validator] HOME=${HOME:-<not set>}" >&2
|
|
94
|
+
echo "[Validator] PATH=${PATH:-<not set>}" >&2
|
|
95
|
+
return 1
|
|
96
|
+
fi
|
|
97
|
+
|
|
98
|
+
echo "[Validator] [$timestamp] Environment validation passed" >&2
|
|
99
|
+
echo "[Validator] REDIS_HOST=${REDIS_HOST}" >&2
|
|
100
|
+
echo "[Validator] HOME=${HOME}" >&2
|
|
101
|
+
echo "[Validator] PATH=${PATH:0:100}..." >&2
|
|
102
|
+
|
|
103
|
+
return 0
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# BUG #27 FIX: Add structured output template to context
|
|
107
|
+
ENHANCED_CONTEXT="$CONTEXT
|
|
108
|
+
|
|
109
|
+
**REQUIRED OUTPUT FORMAT:**
|
|
110
|
+
|
|
111
|
+
You MUST structure your validation output as follows:
|
|
112
|
+
|
|
113
|
+
## Validation Confidence: [0.00-1.00]
|
|
114
|
+
|
|
115
|
+
### CRITICAL Issues
|
|
116
|
+
- [List any critical issues that must be fixed]
|
|
117
|
+
- [Use bullet points with dash prefix]
|
|
118
|
+
|
|
119
|
+
### WARNING Issues
|
|
120
|
+
- [List warnings that should be addressed]
|
|
121
|
+
- [Each on a new line with dash prefix]
|
|
122
|
+
|
|
123
|
+
### SUGGESTION Items
|
|
124
|
+
- [List improvement suggestions]
|
|
125
|
+
- [Optional enhancements]
|
|
126
|
+
|
|
127
|
+
**Example:**
|
|
128
|
+
## Validation Confidence: 0.87
|
|
129
|
+
|
|
130
|
+
### CRITICAL Issues
|
|
131
|
+
- Missing error handling in invoke-gate-ack.sh:88
|
|
132
|
+
- Security vulnerability in input validation
|
|
133
|
+
|
|
134
|
+
### WARNING Issues
|
|
135
|
+
- Inconsistent naming convention in test file
|
|
136
|
+
- Missing JSDoc comments
|
|
137
|
+
|
|
138
|
+
### SUGGESTION Items
|
|
139
|
+
- Consider adding retry backoff strategy
|
|
140
|
+
- Could use Promise.all for parallel operations
|
|
141
|
+
|
|
142
|
+
**Important:**
|
|
143
|
+
- Confidence MUST be explicit numeric value (0.00-1.00)
|
|
144
|
+
- Categorize ALL feedback items by severity
|
|
145
|
+
- If no issues found, state \"No issues found\" under each category
|
|
146
|
+
- Do NOT use default confidence scores without justification
|
|
147
|
+
"
|
|
148
|
+
|
|
149
|
+
# BUG #30 FIX: Validate environment before spawning
|
|
150
|
+
if ! validate_environment; then
|
|
151
|
+
echo "ERROR: Environment validation failed, cannot spawn validator agent" >&2
|
|
152
|
+
exit 1
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
# BUG #30 FIX: Sanitize context before passing to agent
|
|
156
|
+
SANITIZED_CONTEXT=$(validate_and_sanitize_context "$ENHANCED_CONTEXT")
|
|
157
|
+
if [ $? -ne 0 ]; then
|
|
158
|
+
echo "ERROR: Context sanitization failed" >&2
|
|
159
|
+
exit 1
|
|
160
|
+
fi
|
|
161
|
+
|
|
162
|
+
# BUG #30 FIX: Enhanced agent spawning with controlled environment and error capture
|
|
163
|
+
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
164
|
+
echo "[Validator] [$TIMESTAMP] Spawning $AGENT_TYPE with sanitized context" >&2
|
|
165
|
+
echo "[Validator] [$TIMESTAMP] Sanitized context length: ${#SANITIZED_CONTEXT} chars" >&2
|
|
166
|
+
|
|
167
|
+
# Capture both stdout and stderr separately, plus exit code
|
|
168
|
+
SPAWN_TMP_OUT=$(mktemp)
|
|
169
|
+
SPAWN_TMP_ERR=$(mktemp)
|
|
170
|
+
EXIT_CODE=0
|
|
171
|
+
|
|
172
|
+
# Use env -i for controlled environment with explicit variable passing
|
|
173
|
+
env -i \
|
|
174
|
+
HOME="$HOME" \
|
|
175
|
+
PATH="$PATH" \
|
|
176
|
+
REDIS_HOST="$REDIS_HOST" \
|
|
177
|
+
timeout "$TIMEOUT" npx claude-flow-novice agent "$AGENT_TYPE" \
|
|
178
|
+
--task-id "$TASK_ID" \
|
|
179
|
+
--agent-id "$AGENT_ID" \
|
|
180
|
+
--context "$SANITIZED_CONTEXT" \
|
|
181
|
+
> "$SPAWN_TMP_OUT" 2> "$SPAWN_TMP_ERR" || EXIT_CODE=$?
|
|
182
|
+
|
|
183
|
+
AGENT_OUTPUT=$(cat "$SPAWN_TMP_OUT")
|
|
184
|
+
AGENT_STDERR=$(cat "$SPAWN_TMP_ERR")
|
|
185
|
+
|
|
186
|
+
# BUG #30 FIX: Enhanced error logging on spawn failure
|
|
187
|
+
if [ $EXIT_CODE -ne 0 ]; then
|
|
188
|
+
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
189
|
+
echo "[Validator] [$TIMESTAMP] ⚠️ Agent spawn failed with exit code: $EXIT_CODE" >&2
|
|
190
|
+
echo "[Validator] [$TIMESTAMP] Agent STDOUT (length: ${#AGENT_OUTPUT}):" >&2
|
|
191
|
+
echo "$AGENT_OUTPUT" >&2
|
|
192
|
+
echo "[Validator] [$TIMESTAMP] Agent STDERR (length: ${#AGENT_STDERR}):" >&2
|
|
193
|
+
echo "$AGENT_STDERR" >&2
|
|
194
|
+
echo "[Validator] [$TIMESTAMP] Context used (first 200 chars): ${SANITIZED_CONTEXT:0:200}..." >&2
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
# Cleanup temp files
|
|
198
|
+
rm -f "$SPAWN_TMP_OUT" "$SPAWN_TMP_ERR"
|
|
199
|
+
|
|
200
|
+
# Log successful spawn
|
|
201
|
+
if [ $EXIT_CODE -eq 0 ]; then
|
|
202
|
+
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
203
|
+
echo "[Validator] [$TIMESTAMP] Agent spawn successful (output length: ${#AGENT_OUTPUT} chars)" >&2
|
|
204
|
+
fi
|
|
205
|
+
|
|
206
|
+
# Parse confidence using multi-pattern detection
|
|
207
|
+
CONFIDENCE=$("$SCRIPT_DIR/parse-feedback.sh" --extract-confidence "$AGENT_OUTPUT" 2>/dev/null || echo "0.0")
|
|
208
|
+
|
|
209
|
+
# BUG #27 FIX: Enhanced confidence validation
|
|
210
|
+
CONFIDENCE_SOURCE="unknown"
|
|
211
|
+
if [ -z "$CONFIDENCE" ] || [ "$CONFIDENCE" = "null" ] || (( $(echo "$CONFIDENCE == 0.0" | bc -l) )); then
|
|
212
|
+
CONFIDENCE=0.70
|
|
213
|
+
CONFIDENCE_SOURCE="default-fallback"
|
|
214
|
+
echo "[Validator] WARNING: No confidence found in output, using default 0.70" >&2
|
|
215
|
+
elif (( $(echo "$CONFIDENCE == 0.70" | bc -l) )); then
|
|
216
|
+
# Check if this is explicit 0.70 or default
|
|
217
|
+
if echo "$AGENT_OUTPUT" | grep -qE "confidence:?\s*0?\.70"; then
|
|
218
|
+
CONFIDENCE_SOURCE="explicit-0.70"
|
|
219
|
+
else
|
|
220
|
+
CONFIDENCE_SOURCE="default-fallback"
|
|
221
|
+
echo "[Validator] WARNING: Confidence defaulted to 0.70 (no explicit score found)" >&2
|
|
222
|
+
fi
|
|
223
|
+
else
|
|
224
|
+
CONFIDENCE_SOURCE="explicit"
|
|
225
|
+
fi
|
|
226
|
+
|
|
227
|
+
# Parse feedback from output
|
|
228
|
+
FEEDBACK_RAW=$("$SCRIPT_DIR/parse-feedback.sh" --extract-feedback "$AGENT_OUTPUT" 2>/dev/null || echo '{"critical":[],"warnings":[],"suggestions":[]}')
|
|
229
|
+
|
|
230
|
+
# Ensure feedback is valid JSON
|
|
231
|
+
if ! echo "$FEEDBACK_RAW" | jq empty 2>/dev/null; then
|
|
232
|
+
echo "[Validator] WARNING: Invalid feedback JSON, using default" >&2
|
|
233
|
+
FEEDBACK_RAW='{"critical":[],"warnings":[],"suggestions":[]}'
|
|
234
|
+
fi
|
|
235
|
+
|
|
236
|
+
# BUG #27 FIX: Count feedback items
|
|
237
|
+
CRITICAL_COUNT=$(echo "$FEEDBACK_RAW" | jq '.critical | length')
|
|
238
|
+
WARNING_COUNT=$(echo "$FEEDBACK_RAW" | jq '.warnings | length')
|
|
239
|
+
SUGGESTION_COUNT=$(echo "$FEEDBACK_RAW" | jq '.suggestions | length')
|
|
240
|
+
TOTAL_FEEDBACK=$((CRITICAL_COUNT + WARNING_COUNT + SUGGESTION_COUNT))
|
|
241
|
+
|
|
242
|
+
# BUG #27 FIX: Detect default output pattern (0.70 confidence + zero feedback)
|
|
243
|
+
if (( $(echo "$CONFIDENCE == 0.70" | bc -l) )) && [ "$TOTAL_FEEDBACK" -eq 0 ]; then
|
|
244
|
+
echo "[Validator] ⚠️ WARNING: Validator produced default output (0.70 confidence, 0 feedback items)" >&2
|
|
245
|
+
echo "[Validator] This may indicate the validator didn't properly analyze the code" >&2
|
|
246
|
+
VALIDATION_WARNING="default-output-detected"
|
|
247
|
+
else
|
|
248
|
+
VALIDATION_WARNING="none"
|
|
249
|
+
fi
|
|
250
|
+
|
|
251
|
+
# BUG #27 FIX: If feedback exists but confidence is default, log warning
|
|
252
|
+
if [ "$TOTAL_FEEDBACK" -gt 0 ] && (( $(echo "$CONFIDENCE == 0.70" | bc -l) )) && [ "$CONFIDENCE_SOURCE" = "default-fallback" ]; then
|
|
253
|
+
echo "[Validator] ⚠️ WARNING: Feedback found ($TOTAL_FEEDBACK items) but confidence defaulted to 0.70" >&2
|
|
254
|
+
echo "[Validator] Validator may not be using structured output format" >&2
|
|
255
|
+
fi
|
|
256
|
+
|
|
257
|
+
# Build output JSON with enhanced metadata
|
|
258
|
+
cat <<EOF
|
|
259
|
+
{
|
|
260
|
+
"agent_id": "$AGENT_ID",
|
|
261
|
+
"agent_type": "$AGENT_TYPE",
|
|
262
|
+
"confidence": $CONFIDENCE,
|
|
263
|
+
"confidence_source": "$CONFIDENCE_SOURCE",
|
|
264
|
+
"feedback": $FEEDBACK_RAW,
|
|
265
|
+
"feedback_counts": {
|
|
266
|
+
"critical": $CRITICAL_COUNT,
|
|
267
|
+
"warnings": $WARNING_COUNT,
|
|
268
|
+
"suggestions": $SUGGESTION_COUNT,
|
|
269
|
+
"total": $TOTAL_FEEDBACK
|
|
270
|
+
},
|
|
271
|
+
"validation_warning": "$VALIDATION_WARNING",
|
|
272
|
+
"iteration": $ITERATION,
|
|
273
|
+
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
274
|
+
}
|
|
275
|
+
EOF
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# BUG #27 FIX TEST: Validate enhanced validator output processing
|
|
5
|
+
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
PARSE_SCRIPT="$SCRIPT_DIR/parse-feedback.sh"
|
|
8
|
+
|
|
9
|
+
echo "=========================================="
|
|
10
|
+
echo "BUG #27 FIX: Validator Output Processing Tests"
|
|
11
|
+
echo "=========================================="
|
|
12
|
+
echo ""
|
|
13
|
+
|
|
14
|
+
PASSED=0
|
|
15
|
+
FAILED=0
|
|
16
|
+
|
|
17
|
+
# Test Case 1: Structured output with explicit confidence
|
|
18
|
+
echo "[TEST 1] Structured output with explicit confidence"
|
|
19
|
+
MOCK_OUTPUT='## Validation Confidence: 0.87
|
|
20
|
+
|
|
21
|
+
### CRITICAL Issues
|
|
22
|
+
- Missing error handling in invoke-gate-ack.sh:88
|
|
23
|
+
- Security vulnerability in auth module
|
|
24
|
+
|
|
25
|
+
### WARNING Issues
|
|
26
|
+
- Inconsistent naming convention in test file
|
|
27
|
+
- Missing JSDoc comments
|
|
28
|
+
|
|
29
|
+
### SUGGESTION Items
|
|
30
|
+
- Consider adding retry backoff strategy
|
|
31
|
+
- Could use Promise.all for parallel operations'
|
|
32
|
+
|
|
33
|
+
CONFIDENCE=$("$PARSE_SCRIPT" --extract-confidence "$MOCK_OUTPUT")
|
|
34
|
+
FEEDBACK=$("$PARSE_SCRIPT" --extract-feedback "$MOCK_OUTPUT")
|
|
35
|
+
|
|
36
|
+
if [ "$CONFIDENCE" = "0.87" ]; then
|
|
37
|
+
echo "✅ PASS: Confidence correctly parsed as 0.87"
|
|
38
|
+
PASSED=$((PASSED + 1))
|
|
39
|
+
else
|
|
40
|
+
echo "❌ FAIL: Expected 0.87, got $CONFIDENCE"
|
|
41
|
+
FAILED=$((FAILED + 1))
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
CRITICAL_COUNT=$(echo "$FEEDBACK" | jq '.critical | length')
|
|
45
|
+
WARNING_COUNT=$(echo "$FEEDBACK" | jq '.warnings | length')
|
|
46
|
+
SUGGESTION_COUNT=$(echo "$FEEDBACK" | jq '.suggestions | length')
|
|
47
|
+
|
|
48
|
+
if [ "$CRITICAL_COUNT" -eq 2 ] && [ "$WARNING_COUNT" -eq 2 ] && [ "$SUGGESTION_COUNT" -eq 2 ]; then
|
|
49
|
+
echo "✅ PASS: Feedback counts correct (2C/2W/2S)"
|
|
50
|
+
PASSED=$((PASSED + 1))
|
|
51
|
+
else
|
|
52
|
+
echo "❌ FAIL: Expected 2C/2W/2S, got ${CRITICAL_COUNT}C/${WARNING_COUNT}W/${SUGGESTION_COUNT}S"
|
|
53
|
+
FAILED=$((FAILED + 1))
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
echo ""
|
|
57
|
+
|
|
58
|
+
# Test Case 2: Default output pattern (0.70 confidence, zero feedback)
|
|
59
|
+
echo "[TEST 2] Default output pattern detection"
|
|
60
|
+
MOCK_OUTPUT_DEFAULT='The code looks good. Confidence: 0.70'
|
|
61
|
+
|
|
62
|
+
CONFIDENCE=$("$PARSE_SCRIPT" --extract-confidence "$MOCK_OUTPUT_DEFAULT")
|
|
63
|
+
FEEDBACK=$("$PARSE_SCRIPT" --extract-feedback "$MOCK_OUTPUT_DEFAULT")
|
|
64
|
+
|
|
65
|
+
TOTAL_FEEDBACK=$(echo "$FEEDBACK" | jq '.critical + .warnings + .suggestions | length')
|
|
66
|
+
|
|
67
|
+
if [ "$CONFIDENCE" = "0.70" ] && [ "$TOTAL_FEEDBACK" -eq 0 ]; then
|
|
68
|
+
echo "✅ PASS: Default pattern detected (0.70 + 0 feedback)"
|
|
69
|
+
PASSED=$((PASSED + 1))
|
|
70
|
+
else
|
|
71
|
+
echo "❌ FAIL: Pattern detection failed ($CONFIDENCE confidence, $TOTAL_FEEDBACK feedback)"
|
|
72
|
+
FAILED=$((FAILED + 1))
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
echo ""
|
|
76
|
+
|
|
77
|
+
# Test Case 3: Percentage-based confidence
|
|
78
|
+
echo "[TEST 3] Percentage confidence parsing"
|
|
79
|
+
MOCK_OUTPUT_PERCENT='Overall validation: 92%
|
|
80
|
+
|
|
81
|
+
### CRITICAL Issues
|
|
82
|
+
- Missing input validation
|
|
83
|
+
|
|
84
|
+
### WARNING Issues
|
|
85
|
+
- No issues found
|
|
86
|
+
|
|
87
|
+
### SUGGESTION Items
|
|
88
|
+
- Improve documentation'
|
|
89
|
+
|
|
90
|
+
CONFIDENCE=$("$PARSE_SCRIPT" --extract-confidence "$MOCK_OUTPUT_PERCENT")
|
|
91
|
+
|
|
92
|
+
if [ "$CONFIDENCE" = ".92" ]; then
|
|
93
|
+
echo "✅ PASS: Percentage converted to decimal (0.92)"
|
|
94
|
+
PASSED=$((PASSED + 1))
|
|
95
|
+
else
|
|
96
|
+
echo "❌ FAIL: Expected .92, got $CONFIDENCE"
|
|
97
|
+
FAILED=$((FAILED + 1))
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
FEEDBACK=$("$PARSE_SCRIPT" --extract-feedback "$MOCK_OUTPUT_PERCENT")
|
|
101
|
+
CRITICAL_COUNT=$(echo "$FEEDBACK" | jq '.critical | length')
|
|
102
|
+
|
|
103
|
+
if [ "$CRITICAL_COUNT" -eq 1 ]; then
|
|
104
|
+
echo "✅ PASS: Critical issue extracted from percentage output"
|
|
105
|
+
PASSED=$((PASSED + 1))
|
|
106
|
+
else
|
|
107
|
+
echo "❌ FAIL: Expected 1 critical, got $CRITICAL_COUNT"
|
|
108
|
+
FAILED=$((FAILED + 1))
|
|
109
|
+
fi
|
|
110
|
+
|
|
111
|
+
echo ""
|
|
112
|
+
|
|
113
|
+
# Test Case 4: Qualitative confidence
|
|
114
|
+
echo "[TEST 4] Qualitative confidence mapping"
|
|
115
|
+
MOCK_OUTPUT_QUAL='Validation complete with high confidence.
|
|
116
|
+
|
|
117
|
+
### CRITICAL Issues
|
|
118
|
+
- No issues found
|
|
119
|
+
|
|
120
|
+
### WARNING Issues
|
|
121
|
+
- Minor style inconsistencies
|
|
122
|
+
|
|
123
|
+
### SUGGESTION Items
|
|
124
|
+
- Add unit tests'
|
|
125
|
+
|
|
126
|
+
CONFIDENCE=$("$PARSE_SCRIPT" --extract-confidence "$MOCK_OUTPUT_QUAL")
|
|
127
|
+
|
|
128
|
+
if [ "$CONFIDENCE" = "0.90" ]; then
|
|
129
|
+
echo "✅ PASS: 'high confidence' mapped to 0.90"
|
|
130
|
+
PASSED=$((PASSED + 1))
|
|
131
|
+
else
|
|
132
|
+
echo "❌ FAIL: Expected 0.90, got $CONFIDENCE"
|
|
133
|
+
FAILED=$((FAILED + 1))
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
echo ""
|
|
137
|
+
|
|
138
|
+
# Test Case 5: No confidence found (should default to 0.0 for detection)
|
|
139
|
+
echo "[TEST 5] Missing confidence detection"
|
|
140
|
+
MOCK_OUTPUT_NONE='Review complete.
|
|
141
|
+
|
|
142
|
+
Some issues found:
|
|
143
|
+
- Missing tests
|
|
144
|
+
- No documentation'
|
|
145
|
+
|
|
146
|
+
CONFIDENCE=$("$PARSE_SCRIPT" --extract-confidence "$MOCK_OUTPUT_NONE")
|
|
147
|
+
|
|
148
|
+
if [ "$CONFIDENCE" = "0.0" ]; then
|
|
149
|
+
echo "✅ PASS: Missing confidence returns 0.0 for detection"
|
|
150
|
+
PASSED=$((PASSED + 1))
|
|
151
|
+
else
|
|
152
|
+
echo "❌ FAIL: Expected 0.0, got $CONFIDENCE"
|
|
153
|
+
FAILED=$((FAILED + 1))
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
echo ""
|
|
157
|
+
|
|
158
|
+
# Test Case 6: Unstructured feedback extraction
|
|
159
|
+
echo "[TEST 6] Unstructured feedback extraction"
|
|
160
|
+
MOCK_OUTPUT_UNSTRUCTURED='Validation Confidence: 0.82
|
|
161
|
+
|
|
162
|
+
Critical: Missing error handling in line 88
|
|
163
|
+
Warning: Inconsistent variable naming
|
|
164
|
+
Suggestion: Add more comments'
|
|
165
|
+
|
|
166
|
+
CONFIDENCE=$("$PARSE_SCRIPT" --extract-confidence "$MOCK_OUTPUT_UNSTRUCTURED")
|
|
167
|
+
FEEDBACK=$("$PARSE_SCRIPT" --extract-feedback "$MOCK_OUTPUT_UNSTRUCTURED")
|
|
168
|
+
|
|
169
|
+
CRITICAL_COUNT=$(echo "$FEEDBACK" | jq '.critical | length')
|
|
170
|
+
WARNING_COUNT=$(echo "$FEEDBACK" | jq '.warnings | length')
|
|
171
|
+
SUGGESTION_COUNT=$(echo "$FEEDBACK" | jq '.suggestions | length')
|
|
172
|
+
|
|
173
|
+
if [ "$CONFIDENCE" = "0.82" ]; then
|
|
174
|
+
echo "✅ PASS: Confidence parsed from unstructured format"
|
|
175
|
+
PASSED=$((PASSED + 1))
|
|
176
|
+
else
|
|
177
|
+
echo "❌ FAIL: Expected 0.82, got $CONFIDENCE"
|
|
178
|
+
FAILED=$((FAILED + 1))
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
if [ "$CRITICAL_COUNT" -ge 1 ] && [ "$WARNING_COUNT" -ge 1 ] && [ "$SUGGESTION_COUNT" -ge 1 ]; then
|
|
182
|
+
echo "✅ PASS: Feedback extracted from unstructured format (${CRITICAL_COUNT}C/${WARNING_COUNT}W/${SUGGESTION_COUNT}S)"
|
|
183
|
+
PASSED=$((PASSED + 1))
|
|
184
|
+
else
|
|
185
|
+
echo "❌ FAIL: Expected at least 1C/1W/1S, got ${CRITICAL_COUNT}C/${WARNING_COUNT}W/${SUGGESTION_COUNT}S"
|
|
186
|
+
FAILED=$((FAILED + 1))
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
echo ""
|
|
190
|
+
echo "=========================================="
|
|
191
|
+
echo "Test Results: $PASSED passed, $FAILED failed"
|
|
192
|
+
echo "=========================================="
|
|
193
|
+
|
|
194
|
+
if [ $FAILED -eq 0 ]; then
|
|
195
|
+
echo "✅ All tests passed!"
|
|
196
|
+
exit 0
|
|
197
|
+
else
|
|
198
|
+
echo "❌ Some tests failed"
|
|
199
|
+
exit 1
|
|
200
|
+
fi
|