agentic-qe 3.5.4 → 3.6.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/v3/README.md +1 -1
- package/.claude/agents/v3/qe-message-broker-tester.md +380 -0
- package/.claude/agents/v3/qe-middleware-validator.md +423 -0
- package/.claude/agents/v3/qe-odata-contract-tester.md +484 -0
- package/.claude/agents/v3/qe-pentest-validator.md +359 -0
- package/.claude/agents/v3/qe-qx-partner.md +85 -3
- package/.claude/agents/v3/qe-sap-idoc-tester.md +407 -0
- package/.claude/agents/v3/qe-sap-rfc-tester.md +357 -0
- package/.claude/agents/v3/qe-soap-tester.md +340 -0
- package/.claude/agents/v3/qe-sod-analyzer.md +528 -0
- package/.claude/agents/v3/templates/qx-report-template.html +437 -0
- package/.claude/skills/debug-loop/SKILL.md +61 -0
- package/.claude/skills/enterprise-integration-testing/SKILL.md +735 -0
- package/.claude/skills/middleware-testing-patterns/SKILL.md +798 -0
- package/.claude/skills/observability-testing-patterns/SKILL.md +930 -0
- package/.claude/skills/pentest-validation/SKILL.md +268 -0
- package/.claude/skills/pentest-validation/evals/pentest-validation.yaml +708 -0
- package/.claude/skills/pentest-validation/schemas/output.json +281 -0
- package/.claude/skills/pentest-validation/scripts/validate.sh +402 -0
- package/.claude/skills/pr-review/SKILL.md +61 -0
- package/.claude/skills/qcsd-cicd-swarm/SKILL.md +315 -13
- package/.claude/skills/qcsd-development-swarm/SKILL.md +331 -16
- package/.claude/skills/qcsd-ideation-swarm/SKILL.md +258 -9
- package/.claude/skills/qcsd-refinement-swarm/SKILL.md +344 -22
- package/.claude/skills/release/SKILL.md +333 -0
- package/.claude/skills/skills-manifest.json +5 -4
- package/.claude/skills/wms-testing-patterns/SKILL.md +949 -0
- package/README.md +30 -21
- package/package.json +2 -2
- package/v3/CHANGELOG.md +57 -0
- package/v3/README.md +23 -20
- package/v3/assets/agents/v3/qe-message-broker-tester.md +380 -0
- package/v3/assets/agents/v3/qe-middleware-validator.md +423 -0
- package/v3/assets/agents/v3/qe-odata-contract-tester.md +484 -0
- package/v3/assets/agents/v3/qe-pentest-validator.md +359 -0
- package/v3/assets/agents/v3/qe-qx-partner.md +90 -12
- package/v3/assets/agents/v3/qe-sap-idoc-tester.md +407 -0
- package/v3/assets/agents/v3/qe-sap-rfc-tester.md +357 -0
- package/v3/assets/agents/v3/qe-soap-tester.md +340 -0
- package/v3/assets/agents/v3/qe-sod-analyzer.md +528 -0
- package/v3/assets/agents/v3/templates/qx-report-template.html +437 -0
- package/v3/assets/skills/debug-loop/SKILL.md +61 -0
- package/v3/assets/skills/enterprise-integration-testing/SKILL.md +735 -0
- package/v3/assets/skills/middleware-testing-patterns/SKILL.md +798 -0
- package/v3/assets/skills/observability-testing-patterns/SKILL.md +930 -0
- package/v3/assets/skills/pentest-validation/SKILL.md +268 -0
- package/v3/assets/skills/pentest-validation/evals/pentest-validation.yaml +708 -0
- package/v3/assets/skills/pentest-validation/schemas/output.json +281 -0
- package/v3/assets/skills/pentest-validation/scripts/validate.sh +402 -0
- package/v3/assets/skills/pr-review/SKILL.md +61 -0
- package/v3/assets/skills/qcsd-cicd-swarm/SKILL.md +2206 -0
- package/v3/assets/skills/qcsd-development-swarm/SKILL.md +2154 -0
- package/v3/assets/skills/qcsd-ideation-swarm/SKILL.md +2008 -1753
- package/v3/assets/skills/qcsd-refinement-swarm/SKILL.md +2398 -0
- package/v3/assets/skills/security-visual-testing/SKILL.md +223 -0
- package/v3/assets/skills/security-visual-testing/evals/security-visual-testing.yaml +163 -0
- package/v3/assets/skills/security-visual-testing/schemas/output.json +486 -0
- package/v3/assets/skills/security-visual-testing/scripts/validate.sh +748 -0
- package/v3/assets/skills/sfdipot-product-factors/SKILL.md +239 -0
- package/v3/assets/skills/test-idea-rewriting/SKILL.md +229 -0
- package/v3/assets/skills/wms-testing-patterns/SKILL.md +949 -0
- package/v3/dist/cli/bundle.js +10816 -4625
- package/v3/dist/cli/commands/coverage.d.ts.map +1 -1
- package/v3/dist/cli/commands/coverage.js +29 -0
- package/v3/dist/cli/commands/coverage.js.map +1 -1
- package/v3/dist/cli/commands/learning.d.ts.map +1 -1
- package/v3/dist/cli/commands/learning.js +9 -0
- package/v3/dist/cli/commands/learning.js.map +1 -1
- package/v3/dist/cli/commands/token-usage.d.ts.map +1 -1
- package/v3/dist/cli/commands/token-usage.js +6 -2
- package/v3/dist/cli/commands/token-usage.js.map +1 -1
- package/v3/dist/coordination/protocols/learning-consolidation.d.ts.map +1 -1
- package/v3/dist/coordination/protocols/learning-consolidation.js +1 -0
- package/v3/dist/coordination/protocols/learning-consolidation.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/coordinator.d.ts +8 -0
- package/v3/dist/domains/coverage-analysis/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/coordinator.js +67 -0
- package/v3/dist/domains/coverage-analysis/coordinator.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/interfaces.d.ts +33 -0
- package/v3/dist/domains/coverage-analysis/interfaces.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/plugin.js +17 -0
- package/v3/dist/domains/coverage-analysis/plugin.js.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.d.ts +125 -0
- package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.d.ts.map +1 -0
- package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js +317 -0
- package/v3/dist/domains/coverage-analysis/services/ghost-coverage-analyzer.js.map +1 -0
- package/v3/dist/domains/coverage-analysis/services/index.d.ts +1 -0
- package/v3/dist/domains/coverage-analysis/services/index.d.ts.map +1 -1
- package/v3/dist/domains/coverage-analysis/services/index.js +4 -0
- package/v3/dist/domains/coverage-analysis/services/index.js.map +1 -1
- package/v3/dist/domains/enterprise-integration/coordinator.d.ts +91 -0
- package/v3/dist/domains/enterprise-integration/coordinator.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/coordinator.js +672 -0
- package/v3/dist/domains/enterprise-integration/coordinator.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/index.d.ts +14 -0
- package/v3/dist/domains/enterprise-integration/index.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/index.js +18 -0
- package/v3/dist/domains/enterprise-integration/index.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/interfaces.d.ts +376 -0
- package/v3/dist/domains/enterprise-integration/interfaces.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/interfaces.js +11 -0
- package/v3/dist/domains/enterprise-integration/interfaces.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/plugin.d.ts +88 -0
- package/v3/dist/domains/enterprise-integration/plugin.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/plugin.js +515 -0
- package/v3/dist/domains/enterprise-integration/plugin.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.d.ts +67 -0
- package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.js +670 -0
- package/v3/dist/domains/enterprise-integration/services/esb-middleware-service.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/index.d.ts +13 -0
- package/v3/dist/domains/enterprise-integration/services/index.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/index.js +13 -0
- package/v3/dist/domains/enterprise-integration/services/index.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/message-broker-service.d.ts +88 -0
- package/v3/dist/domains/enterprise-integration/services/message-broker-service.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/message-broker-service.js +560 -0
- package/v3/dist/domains/enterprise-integration/services/message-broker-service.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/odata-service.d.ts +75 -0
- package/v3/dist/domains/enterprise-integration/services/odata-service.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/odata-service.js +618 -0
- package/v3/dist/domains/enterprise-integration/services/odata-service.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/sap-integration-service.d.ts +73 -0
- package/v3/dist/domains/enterprise-integration/services/sap-integration-service.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/sap-integration-service.js +513 -0
- package/v3/dist/domains/enterprise-integration/services/sap-integration-service.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.d.ts +84 -0
- package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js +639 -0
- package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.d.ts +90 -0
- package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.d.ts.map +1 -0
- package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.js +389 -0
- package/v3/dist/domains/enterprise-integration/services/sod-analysis-service.js.map +1 -0
- package/v3/dist/domains/index.d.ts +1 -0
- package/v3/dist/domains/index.d.ts.map +1 -1
- package/v3/dist/domains/index.js +1 -0
- package/v3/dist/domains/index.js.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/coordinator.js +1 -0
- package/v3/dist/domains/learning-optimization/coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.js +1 -0
- package/v3/dist/domains/learning-optimization/services/learning-coordinator.js.map +1 -1
- package/v3/dist/domains/learning-optimization/services/transfer-specialist.d.ts.map +1 -1
- package/v3/dist/domains/learning-optimization/services/transfer-specialist.js +1 -0
- package/v3/dist/domains/learning-optimization/services/transfer-specialist.js.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.d.ts.map +1 -1
- package/v3/dist/domains/test-execution/coordinator.js +34 -0
- package/v3/dist/domains/test-execution/coordinator.js.map +1 -1
- package/v3/dist/domains/test-generation/services/test-data-generator.d.ts +7 -1
- package/v3/dist/domains/test-generation/services/test-data-generator.d.ts.map +1 -1
- package/v3/dist/domains/test-generation/services/test-data-generator.js +116 -98
- package/v3/dist/domains/test-generation/services/test-data-generator.js.map +1 -1
- package/v3/dist/init/agents-installer.d.ts +4 -0
- package/v3/dist/init/agents-installer.d.ts.map +1 -1
- package/v3/dist/init/agents-installer.js +32 -3
- package/v3/dist/init/agents-installer.js.map +1 -1
- package/v3/dist/init/skills-installer.d.ts.map +1 -1
- package/v3/dist/init/skills-installer.js +4 -1
- package/v3/dist/init/skills-installer.js.map +1 -1
- package/v3/dist/init/types.d.ts.map +1 -1
- package/v3/dist/init/types.js +1 -0
- package/v3/dist/init/types.js.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.d.ts +16 -0
- package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.d.ts.map +1 -1
- package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.js +41 -0
- package/v3/dist/integrations/agentic-flow/model-router/budget-enforcer.js.map +1 -1
- package/v3/dist/integrations/ruvector/provider.d.ts.map +1 -1
- package/v3/dist/integrations/ruvector/provider.js +1 -0
- package/v3/dist/integrations/ruvector/provider.js.map +1 -1
- package/v3/dist/kernel/anti-drift-middleware.d.ts +160 -0
- package/v3/dist/kernel/anti-drift-middleware.d.ts.map +1 -0
- package/v3/dist/kernel/anti-drift-middleware.js +376 -0
- package/v3/dist/kernel/anti-drift-middleware.js.map +1 -0
- package/v3/dist/kernel/event-bus.d.ts +29 -1
- package/v3/dist/kernel/event-bus.d.ts.map +1 -1
- package/v3/dist/kernel/event-bus.js +69 -6
- package/v3/dist/kernel/event-bus.js.map +1 -1
- package/v3/dist/kernel/interfaces.d.ts +35 -0
- package/v3/dist/kernel/interfaces.d.ts.map +1 -1
- package/v3/dist/kernel/kernel.d.ts.map +1 -1
- package/v3/dist/kernel/kernel.js +14 -17
- package/v3/dist/kernel/kernel.js.map +1 -1
- package/v3/dist/kernel/unified-memory.d.ts +5 -0
- package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
- package/v3/dist/kernel/unified-memory.js +28 -0
- package/v3/dist/kernel/unified-memory.js.map +1 -1
- package/v3/dist/learning/asymmetric-learning.d.ts +133 -0
- package/v3/dist/learning/asymmetric-learning.d.ts.map +1 -0
- package/v3/dist/learning/asymmetric-learning.js +170 -0
- package/v3/dist/learning/asymmetric-learning.js.map +1 -0
- package/v3/dist/learning/pattern-lifecycle.d.ts +26 -0
- package/v3/dist/learning/pattern-lifecycle.d.ts.map +1 -1
- package/v3/dist/learning/pattern-lifecycle.js +83 -0
- package/v3/dist/learning/pattern-lifecycle.js.map +1 -1
- package/v3/dist/learning/qe-patterns.d.ts +8 -0
- package/v3/dist/learning/qe-patterns.d.ts.map +1 -1
- package/v3/dist/learning/qe-patterns.js.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts +28 -0
- package/v3/dist/learning/real-qe-reasoning-bank.d.ts.map +1 -1
- package/v3/dist/learning/real-qe-reasoning-bank.js +72 -4
- package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
- package/v3/dist/learning/token-tracker.d.ts +22 -0
- package/v3/dist/learning/token-tracker.d.ts.map +1 -1
- package/v3/dist/learning/token-tracker.js +67 -0
- package/v3/dist/learning/token-tracker.js.map +1 -1
- package/v3/dist/mcp/bundle.js +11099 -4879
- package/v3/dist/mcp/tool-registry.d.ts.map +1 -1
- package/v3/dist/mcp/tool-registry.js +4 -0
- package/v3/dist/mcp/tool-registry.js.map +1 -1
- package/v3/dist/mcp/tools/analysis/token-usage.d.ts +1 -1
- package/v3/dist/mcp/tools/analysis/token-usage.d.ts.map +1 -1
- package/v3/dist/mcp/tools/analysis/token-usage.js +23 -3
- package/v3/dist/mcp/tools/analysis/token-usage.js.map +1 -1
- package/v3/dist/mcp/tools/base.d.ts.map +1 -1
- package/v3/dist/mcp/tools/base.js +1 -15
- package/v3/dist/mcp/tools/base.js.map +1 -1
- package/v3/dist/mcp/tools/coverage-analysis/index.d.ts +7 -0
- package/v3/dist/mcp/tools/coverage-analysis/index.d.ts.map +1 -1
- package/v3/dist/mcp/tools/coverage-analysis/index.js +30 -0
- package/v3/dist/mcp/tools/coverage-analysis/index.js.map +1 -1
- package/v3/dist/optimization/token-optimizer-service.d.ts +7 -0
- package/v3/dist/optimization/token-optimizer-service.d.ts.map +1 -1
- package/v3/dist/optimization/token-optimizer-service.js +10 -1
- package/v3/dist/optimization/token-optimizer-service.js.map +1 -1
- package/v3/dist/shared/types/index.d.ts +20 -1
- package/v3/dist/shared/types/index.d.ts.map +1 -1
- package/v3/dist/shared/types/index.js +1 -0
- package/v3/dist/shared/types/index.js.map +1 -1
- package/v3/dist/strange-loop/healing-controller.d.ts.map +1 -1
- package/v3/dist/strange-loop/healing-controller.js +12 -0
- package/v3/dist/strange-loop/healing-controller.js.map +1 -1
- package/v3/dist/strange-loop/strange-loop.d.ts +14 -0
- package/v3/dist/strange-loop/strange-loop.d.ts.map +1 -1
- package/v3/dist/strange-loop/strange-loop.js +24 -0
- package/v3/dist/strange-loop/strange-loop.js.map +1 -1
- package/v3/dist/strange-loop/types.d.ts +2 -2
- package/v3/dist/strange-loop/types.d.ts.map +1 -1
- package/v3/dist/strange-loop/types.js.map +1 -1
- package/v3/dist/sync/claude-flow-bridge.d.ts.map +1 -1
- package/v3/dist/sync/claude-flow-bridge.js +3 -24
- package/v3/dist/sync/claude-flow-bridge.js.map +1 -1
- package/v3/package.json +12 -9
- /package/{v3/assets/skills/sfdipot-product-factors/skill.md → .claude/skills/sfdipot-product-factors/SKILL.md} +0 -0
- /package/{v3/assets/skills/test-idea-rewriting/skill.md → .claude/skills/test-idea-rewriting/SKILL.md} +0 -0
|
@@ -0,0 +1,748 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# AQE Skill Validator: security-visual-testing v1.0.0
|
|
4
|
+
# Validates combined security and visual testing skill output per ADR-056
|
|
5
|
+
# =============================================================================
|
|
6
|
+
#
|
|
7
|
+
# This validator checks:
|
|
8
|
+
# 1. JSON schema compliance (security findings, visual diffs, combined scores)
|
|
9
|
+
# 2. Required tools availability (imagemagick, playwright, semgrep)
|
|
10
|
+
# 3. Security and visual findings structure
|
|
11
|
+
# 4. Cross-domain issue validation
|
|
12
|
+
# 5. Combined scoring accuracy
|
|
13
|
+
#
|
|
14
|
+
# Usage: ./validate.sh <output-file> [options]
|
|
15
|
+
#
|
|
16
|
+
# Options:
|
|
17
|
+
# --self-test Run validator self-test mode
|
|
18
|
+
# --verbose Enable verbose output
|
|
19
|
+
# --json Output results as JSON only
|
|
20
|
+
# --list-tools Show available validation tools
|
|
21
|
+
# --help Show this help message
|
|
22
|
+
#
|
|
23
|
+
# Exit Codes:
|
|
24
|
+
# 0 - Validation passed
|
|
25
|
+
# 1 - Validation failed
|
|
26
|
+
# 2 - Validation skipped (missing required tools)
|
|
27
|
+
#
|
|
28
|
+
# =============================================================================
|
|
29
|
+
|
|
30
|
+
set -euo pipefail
|
|
31
|
+
|
|
32
|
+
# Get script directory
|
|
33
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
34
|
+
|
|
35
|
+
# Navigate to skill directory and project root
|
|
36
|
+
SKILL_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
37
|
+
PROJECT_ROOT="$(cd "$SKILL_DIR/../../.." && pwd)"
|
|
38
|
+
|
|
39
|
+
# Source validator library - check multiple locations
|
|
40
|
+
VALIDATOR_LIB=""
|
|
41
|
+
for lib_path in \
|
|
42
|
+
"$PROJECT_ROOT/.claude/skills/.validation/templates/validator-lib.sh" \
|
|
43
|
+
"$SKILL_DIR/scripts/validator-lib.sh" \
|
|
44
|
+
"$SCRIPT_DIR/validator-lib.sh"; do
|
|
45
|
+
if [[ -f "$lib_path" ]]; then
|
|
46
|
+
VALIDATOR_LIB="$lib_path"
|
|
47
|
+
break
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
if [[ -n "$VALIDATOR_LIB" ]]; then
|
|
52
|
+
# shellcheck source=/dev/null
|
|
53
|
+
source "$VALIDATOR_LIB"
|
|
54
|
+
else
|
|
55
|
+
echo "ERROR: Validator library not found"
|
|
56
|
+
echo "Searched:"
|
|
57
|
+
echo " - $PROJECT_ROOT/.claude/skills/.validation/templates/validator-lib.sh"
|
|
58
|
+
echo " - $SKILL_DIR/scripts/validator-lib.sh"
|
|
59
|
+
echo " - $SCRIPT_DIR/validator-lib.sh"
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
# =============================================================================
|
|
64
|
+
# SKILL-SPECIFIC CONFIGURATION
|
|
65
|
+
# =============================================================================
|
|
66
|
+
|
|
67
|
+
SKILL_NAME="security-visual-testing"
|
|
68
|
+
SKILL_VERSION="1.0.0"
|
|
69
|
+
|
|
70
|
+
# Required tools (validation FAILS with exit 2 if missing)
|
|
71
|
+
REQUIRED_TOOLS=("jq")
|
|
72
|
+
|
|
73
|
+
# Optional tools (validation continues with warnings if missing)
|
|
74
|
+
OPTIONAL_TOOLS=("imagemagick" "playwright" "semgrep" "ajv" "jsonschema" "python3")
|
|
75
|
+
|
|
76
|
+
# Path to output JSON schema
|
|
77
|
+
SCHEMA_PATH="$SKILL_DIR/schemas/output.json"
|
|
78
|
+
|
|
79
|
+
# =============================================================================
|
|
80
|
+
# CONTENT VALIDATION CONFIGURATION
|
|
81
|
+
# =============================================================================
|
|
82
|
+
|
|
83
|
+
# Required fields in output
|
|
84
|
+
REQUIRED_FIELDS=("skillName" "status" "output" "output.summary" "output.securityFindings" "output.visualDiffs")
|
|
85
|
+
|
|
86
|
+
# Fields that must have non-null, non-empty values
|
|
87
|
+
REQUIRED_NON_EMPTY_FIELDS=("output.summary")
|
|
88
|
+
|
|
89
|
+
# Terms that MUST appear in output
|
|
90
|
+
MUST_CONTAIN_TERMS=("security" "visual" "findings")
|
|
91
|
+
|
|
92
|
+
# Terms that must NOT appear in output
|
|
93
|
+
MUST_NOT_CONTAIN_TERMS=("TODO" "placeholder" "FIXME")
|
|
94
|
+
|
|
95
|
+
# Enum validations
|
|
96
|
+
ENUM_VALIDATIONS=(
|
|
97
|
+
".status:success,partial,failed,skipped"
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
# =============================================================================
|
|
101
|
+
# Argument Parsing
|
|
102
|
+
# =============================================================================
|
|
103
|
+
|
|
104
|
+
OUTPUT_FILE=""
|
|
105
|
+
SELF_TEST=false
|
|
106
|
+
VERBOSE=false
|
|
107
|
+
JSON_ONLY=false
|
|
108
|
+
LIST_TOOLS=false
|
|
109
|
+
|
|
110
|
+
while [[ $# -gt 0 ]]; do
|
|
111
|
+
case "$1" in
|
|
112
|
+
--self-test) SELF_TEST=true; shift ;;
|
|
113
|
+
--verbose|-v) VERBOSE=true; export AQE_DEBUG=1; shift ;;
|
|
114
|
+
--json) JSON_ONLY=true; shift ;;
|
|
115
|
+
--list-tools) LIST_TOOLS=true; shift ;;
|
|
116
|
+
-h|--help)
|
|
117
|
+
cat << 'HELP_EOF'
|
|
118
|
+
AQE Security-Visual Testing Skill Validator v1.0.0
|
|
119
|
+
|
|
120
|
+
Usage: ./validate.sh <output-file> [options]
|
|
121
|
+
./validate.sh --self-test [--verbose]
|
|
122
|
+
./validate.sh --list-tools
|
|
123
|
+
|
|
124
|
+
Arguments:
|
|
125
|
+
<output-file> Path to skill output JSON file to validate
|
|
126
|
+
|
|
127
|
+
Options:
|
|
128
|
+
--self-test Run validator self-test mode
|
|
129
|
+
--verbose, -v Enable verbose/debug output
|
|
130
|
+
--json Output results as JSON only (for CI integration)
|
|
131
|
+
--list-tools Show available validation tools and exit
|
|
132
|
+
--help, -h Show this help message
|
|
133
|
+
|
|
134
|
+
Exit Codes:
|
|
135
|
+
0 - Validation passed
|
|
136
|
+
1 - Validation failed
|
|
137
|
+
2 - Validation skipped (missing required tools)
|
|
138
|
+
|
|
139
|
+
Tool Requirements:
|
|
140
|
+
Required: jq (JSON parsing)
|
|
141
|
+
Optional: imagemagick (image diff), playwright (visual testing), semgrep (security scanning)
|
|
142
|
+
|
|
143
|
+
Examples:
|
|
144
|
+
./validate.sh output.json # Validate output file
|
|
145
|
+
./validate.sh output.json --json # JSON output for CI
|
|
146
|
+
./validate.sh --self-test --verbose # Self-test with debug
|
|
147
|
+
./validate.sh --list-tools # Show available tools
|
|
148
|
+
|
|
149
|
+
HELP_EOF
|
|
150
|
+
exit 0
|
|
151
|
+
;;
|
|
152
|
+
-*)
|
|
153
|
+
error "Unknown option: $1"
|
|
154
|
+
echo "Use --help for usage information"
|
|
155
|
+
exit 1
|
|
156
|
+
;;
|
|
157
|
+
*)
|
|
158
|
+
OUTPUT_FILE="$1"
|
|
159
|
+
shift
|
|
160
|
+
;;
|
|
161
|
+
esac
|
|
162
|
+
done
|
|
163
|
+
|
|
164
|
+
# Handle --list-tools mode
|
|
165
|
+
if [[ "$LIST_TOOLS" == "true" ]]; then
|
|
166
|
+
echo "=============================================="
|
|
167
|
+
echo "Available Validation Tools for $SKILL_NAME"
|
|
168
|
+
echo "=============================================="
|
|
169
|
+
echo ""
|
|
170
|
+
echo "Required tools:"
|
|
171
|
+
for tool in "${REQUIRED_TOOLS[@]}"; do
|
|
172
|
+
if command_exists "$tool"; then
|
|
173
|
+
echo " [OK] $tool"
|
|
174
|
+
else
|
|
175
|
+
echo " [MISSING] $tool"
|
|
176
|
+
fi
|
|
177
|
+
done
|
|
178
|
+
echo ""
|
|
179
|
+
echo "Optional tools:"
|
|
180
|
+
for tool in "${OPTIONAL_TOOLS[@]}"; do
|
|
181
|
+
if command_exists "$tool"; then
|
|
182
|
+
echo " [OK] $tool"
|
|
183
|
+
else
|
|
184
|
+
echo " [MISSING] $tool"
|
|
185
|
+
fi
|
|
186
|
+
done
|
|
187
|
+
exit 0
|
|
188
|
+
fi
|
|
189
|
+
|
|
190
|
+
# =============================================================================
|
|
191
|
+
# Self-Test Mode
|
|
192
|
+
# =============================================================================
|
|
193
|
+
|
|
194
|
+
if [[ "$SELF_TEST" == "true" ]]; then
|
|
195
|
+
echo "=============================================="
|
|
196
|
+
info "Running $SKILL_NAME Validator Self-Test"
|
|
197
|
+
echo "=============================================="
|
|
198
|
+
echo ""
|
|
199
|
+
|
|
200
|
+
self_test_passed=true
|
|
201
|
+
self_test_warnings=0
|
|
202
|
+
|
|
203
|
+
# Step 1: Check Required Tools
|
|
204
|
+
echo "--- Step 1: Required Tools ---"
|
|
205
|
+
for tool in "${REQUIRED_TOOLS[@]}"; do
|
|
206
|
+
if command_exists "$tool"; then
|
|
207
|
+
success "Required tool available: $tool"
|
|
208
|
+
else
|
|
209
|
+
error "Required tool MISSING: $tool"
|
|
210
|
+
self_test_passed=false
|
|
211
|
+
fi
|
|
212
|
+
done
|
|
213
|
+
echo ""
|
|
214
|
+
|
|
215
|
+
# Step 2: Check Optional Tools
|
|
216
|
+
echo "--- Step 2: Optional Tools ---"
|
|
217
|
+
for tool in "${OPTIONAL_TOOLS[@]}"; do
|
|
218
|
+
if command_exists "$tool"; then
|
|
219
|
+
success "Optional tool available: $tool"
|
|
220
|
+
else
|
|
221
|
+
warn "Optional tool missing: $tool"
|
|
222
|
+
((self_test_warnings++)) || true
|
|
223
|
+
fi
|
|
224
|
+
done
|
|
225
|
+
echo ""
|
|
226
|
+
|
|
227
|
+
# Step 3: Check Schema File
|
|
228
|
+
echo "--- Step 3: Schema File ---"
|
|
229
|
+
if [[ -f "$SCHEMA_PATH" ]]; then
|
|
230
|
+
success "Schema file exists: $SCHEMA_PATH"
|
|
231
|
+
if validate_json "$SCHEMA_PATH" 2>/dev/null; then
|
|
232
|
+
success "Schema file is valid JSON"
|
|
233
|
+
else
|
|
234
|
+
error "Schema file is NOT valid JSON"
|
|
235
|
+
self_test_passed=false
|
|
236
|
+
fi
|
|
237
|
+
else
|
|
238
|
+
error "Schema file not found: $SCHEMA_PATH"
|
|
239
|
+
self_test_passed=false
|
|
240
|
+
fi
|
|
241
|
+
echo ""
|
|
242
|
+
|
|
243
|
+
# Summary
|
|
244
|
+
echo "=============================================="
|
|
245
|
+
echo "Self-Test Summary for $SKILL_NAME"
|
|
246
|
+
echo "=============================================="
|
|
247
|
+
|
|
248
|
+
if [[ "$self_test_passed" == "true" ]]; then
|
|
249
|
+
if [[ $self_test_warnings -gt 0 ]]; then
|
|
250
|
+
warn "Self-test PASSED with $self_test_warnings warning(s)"
|
|
251
|
+
exit 0
|
|
252
|
+
else
|
|
253
|
+
success "Self-test PASSED"
|
|
254
|
+
exit 0
|
|
255
|
+
fi
|
|
256
|
+
else
|
|
257
|
+
error "Self-test FAILED"
|
|
258
|
+
exit 1
|
|
259
|
+
fi
|
|
260
|
+
fi
|
|
261
|
+
|
|
262
|
+
# =============================================================================
|
|
263
|
+
# SKILL-SPECIFIC VALIDATION FUNCTIONS
|
|
264
|
+
# =============================================================================
|
|
265
|
+
|
|
266
|
+
# Validate security findings structure
|
|
267
|
+
# Returns: 0 if valid, 1 if invalid
|
|
268
|
+
validate_security_findings() {
|
|
269
|
+
local output_file="$1"
|
|
270
|
+
|
|
271
|
+
local sec_findings
|
|
272
|
+
sec_findings=$(json_get "$output_file" ".output.securityFindings" 2>/dev/null)
|
|
273
|
+
|
|
274
|
+
if [[ -z "$sec_findings" ]] || [[ "$sec_findings" == "null" ]]; then
|
|
275
|
+
error "Missing securityFindings in output"
|
|
276
|
+
return 1
|
|
277
|
+
fi
|
|
278
|
+
|
|
279
|
+
# Check for required fields in securityFindings
|
|
280
|
+
local total_findings
|
|
281
|
+
total_findings=$(json_get "$output_file" ".output.securityFindings.totalFindings" 2>/dev/null)
|
|
282
|
+
|
|
283
|
+
if [[ -z "$total_findings" ]] || [[ "$total_findings" == "null" ]]; then
|
|
284
|
+
error "securityFindings missing totalFindings"
|
|
285
|
+
return 1
|
|
286
|
+
fi
|
|
287
|
+
|
|
288
|
+
# Check for security score
|
|
289
|
+
local sec_score
|
|
290
|
+
sec_score=$(json_get "$output_file" ".output.securityFindings.score" 2>/dev/null)
|
|
291
|
+
|
|
292
|
+
if [[ -z "$sec_score" ]] || [[ "$sec_score" == "null" ]]; then
|
|
293
|
+
error "securityFindings missing score"
|
|
294
|
+
return 1
|
|
295
|
+
fi
|
|
296
|
+
|
|
297
|
+
debug "Found $total_findings security findings with score: $sec_score"
|
|
298
|
+
return 0
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
# Validate visual diffs structure
|
|
302
|
+
# Returns: 0 if valid, 1 if invalid
|
|
303
|
+
validate_visual_diffs() {
|
|
304
|
+
local output_file="$1"
|
|
305
|
+
|
|
306
|
+
local visual_diffs
|
|
307
|
+
visual_diffs=$(json_get "$output_file" ".output.visualDiffs" 2>/dev/null)
|
|
308
|
+
|
|
309
|
+
if [[ -z "$visual_diffs" ]] || [[ "$visual_diffs" == "null" ]]; then
|
|
310
|
+
error "Missing visualDiffs in output"
|
|
311
|
+
return 1
|
|
312
|
+
fi
|
|
313
|
+
|
|
314
|
+
# Check for required fields
|
|
315
|
+
local comparisons
|
|
316
|
+
comparisons=$(json_get "$output_file" ".output.visualDiffs.totalComparisons" 2>/dev/null)
|
|
317
|
+
|
|
318
|
+
if [[ -z "$comparisons" ]] || [[ "$comparisons" == "null" ]]; then
|
|
319
|
+
error "visualDiffs missing totalComparisons"
|
|
320
|
+
return 1
|
|
321
|
+
fi
|
|
322
|
+
|
|
323
|
+
# Check for visual score
|
|
324
|
+
local vis_score
|
|
325
|
+
vis_score=$(json_get "$output_file" ".output.visualDiffs.score" 2>/dev/null)
|
|
326
|
+
|
|
327
|
+
if [[ -z "$vis_score" ]] || [[ "$vis_score" == "null" ]]; then
|
|
328
|
+
error "visualDiffs missing score"
|
|
329
|
+
return 1
|
|
330
|
+
fi
|
|
331
|
+
|
|
332
|
+
debug "Found $comparisons visual comparisons with score: $vis_score"
|
|
333
|
+
return 0
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
# Validate combined scoring
|
|
337
|
+
# Returns: 0 if valid, 1 if invalid
|
|
338
|
+
validate_combined_score() {
|
|
339
|
+
local output_file="$1"
|
|
340
|
+
|
|
341
|
+
local combined
|
|
342
|
+
combined=$(json_get "$output_file" ".output.combinedScore.value" 2>/dev/null)
|
|
343
|
+
|
|
344
|
+
if [[ -z "$combined" ]] || [[ "$combined" == "null" ]]; then
|
|
345
|
+
error "Missing combinedScore.value in output"
|
|
346
|
+
return 1
|
|
347
|
+
fi
|
|
348
|
+
|
|
349
|
+
# Validate combined score is between 0 and 100
|
|
350
|
+
if (( $(echo "$combined < 0 || $combined > 100" | bc -l 2>/dev/null || echo "0") )); then
|
|
351
|
+
error "Invalid combinedScore: $combined (must be 0-100)"
|
|
352
|
+
return 1
|
|
353
|
+
fi
|
|
354
|
+
|
|
355
|
+
debug "Combined score: $combined"
|
|
356
|
+
return 0
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
# Main skill-specific validation function
|
|
360
|
+
validate_skill_specific() {
|
|
361
|
+
local output_file="$1"
|
|
362
|
+
local has_errors=false
|
|
363
|
+
|
|
364
|
+
debug "Running security-visual-testing specific validations..."
|
|
365
|
+
|
|
366
|
+
if ! validate_security_findings "$output_file"; then
|
|
367
|
+
has_errors=true
|
|
368
|
+
else
|
|
369
|
+
success "Security findings validation passed"
|
|
370
|
+
fi
|
|
371
|
+
|
|
372
|
+
if ! validate_visual_diffs "$output_file"; then
|
|
373
|
+
has_errors=true
|
|
374
|
+
else
|
|
375
|
+
success "Visual diffs validation passed"
|
|
376
|
+
fi
|
|
377
|
+
|
|
378
|
+
if ! validate_combined_score "$output_file"; then
|
|
379
|
+
has_errors=true
|
|
380
|
+
else
|
|
381
|
+
success "Combined score validation passed"
|
|
382
|
+
fi
|
|
383
|
+
|
|
384
|
+
if [[ "$has_errors" == "true" ]]; then
|
|
385
|
+
return 1
|
|
386
|
+
fi
|
|
387
|
+
|
|
388
|
+
return 0
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
# Override base template validations as needed
|
|
392
|
+
validate_tools() {
|
|
393
|
+
if [[ ${#REQUIRED_TOOLS[@]} -eq 0 ]]; then
|
|
394
|
+
debug "No required tools specified"
|
|
395
|
+
return 0
|
|
396
|
+
fi
|
|
397
|
+
|
|
398
|
+
local missing=()
|
|
399
|
+
for tool in "${REQUIRED_TOOLS[@]}"; do
|
|
400
|
+
if ! command_exists "$tool"; then
|
|
401
|
+
missing+=("$tool")
|
|
402
|
+
fi
|
|
403
|
+
done
|
|
404
|
+
|
|
405
|
+
if [[ ${#missing[@]} -gt 0 ]]; then
|
|
406
|
+
error "Missing required tools: ${missing[*]}"
|
|
407
|
+
return 1
|
|
408
|
+
fi
|
|
409
|
+
|
|
410
|
+
debug "All required tools available"
|
|
411
|
+
return 0
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
validate_schema() {
|
|
415
|
+
local output_file="$1"
|
|
416
|
+
|
|
417
|
+
if [[ -z "$SCHEMA_PATH" ]]; then
|
|
418
|
+
debug "No schema path configured, skipping schema validation"
|
|
419
|
+
return 2
|
|
420
|
+
fi
|
|
421
|
+
|
|
422
|
+
if [[ ! -f "$SCHEMA_PATH" ]]; then
|
|
423
|
+
warn "Schema file not found: $SCHEMA_PATH"
|
|
424
|
+
return 2
|
|
425
|
+
fi
|
|
426
|
+
|
|
427
|
+
debug "Validating against schema: $SCHEMA_PATH"
|
|
428
|
+
|
|
429
|
+
local result
|
|
430
|
+
result=$(validate_json_schema "$SCHEMA_PATH" "$output_file" 2>&1)
|
|
431
|
+
local status=$?
|
|
432
|
+
|
|
433
|
+
case $status in
|
|
434
|
+
0)
|
|
435
|
+
success "Schema validation passed"
|
|
436
|
+
return 0
|
|
437
|
+
;;
|
|
438
|
+
1)
|
|
439
|
+
error "Schema validation failed"
|
|
440
|
+
if [[ "$VERBOSE" == "true" ]]; then
|
|
441
|
+
echo "$result" | while read -r line; do
|
|
442
|
+
echo " $line"
|
|
443
|
+
done
|
|
444
|
+
fi
|
|
445
|
+
return 1
|
|
446
|
+
;;
|
|
447
|
+
2)
|
|
448
|
+
warn "Schema validation skipped (no validator available)"
|
|
449
|
+
return 2
|
|
450
|
+
;;
|
|
451
|
+
esac
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
validate_required_fields() {
|
|
455
|
+
local output_file="$1"
|
|
456
|
+
local missing=()
|
|
457
|
+
local empty=()
|
|
458
|
+
|
|
459
|
+
for field in "${REQUIRED_FIELDS[@]}"; do
|
|
460
|
+
local value
|
|
461
|
+
value=$(json_get "$output_file" ".$field" 2>/dev/null)
|
|
462
|
+
if [[ -z "$value" ]] || [[ "$value" == "null" ]]; then
|
|
463
|
+
missing+=("$field")
|
|
464
|
+
fi
|
|
465
|
+
done
|
|
466
|
+
|
|
467
|
+
for field in "${REQUIRED_NON_EMPTY_FIELDS[@]}"; do
|
|
468
|
+
local value
|
|
469
|
+
value=$(json_get "$output_file" ".$field" 2>/dev/null)
|
|
470
|
+
if [[ -z "$value" ]] || [[ "$value" == "null" ]] || [[ "$value" == "" ]]; then
|
|
471
|
+
empty+=("$field")
|
|
472
|
+
fi
|
|
473
|
+
done
|
|
474
|
+
|
|
475
|
+
local has_errors=false
|
|
476
|
+
|
|
477
|
+
if [[ ${#missing[@]} -gt 0 ]]; then
|
|
478
|
+
error "Missing required fields: ${missing[*]}"
|
|
479
|
+
has_errors=true
|
|
480
|
+
fi
|
|
481
|
+
|
|
482
|
+
if [[ ${#empty[@]} -gt 0 ]]; then
|
|
483
|
+
error "Empty required fields: ${empty[*]}"
|
|
484
|
+
has_errors=true
|
|
485
|
+
fi
|
|
486
|
+
|
|
487
|
+
if [[ "$has_errors" == "true" ]]; then
|
|
488
|
+
return 1
|
|
489
|
+
fi
|
|
490
|
+
|
|
491
|
+
success "All required fields present and valid"
|
|
492
|
+
return 0
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
validate_enum_fields() {
|
|
496
|
+
local output_file="$1"
|
|
497
|
+
|
|
498
|
+
if [[ ${#ENUM_VALIDATIONS[@]} -eq 0 ]]; then
|
|
499
|
+
return 0
|
|
500
|
+
fi
|
|
501
|
+
|
|
502
|
+
local has_errors=false
|
|
503
|
+
|
|
504
|
+
for validation in "${ENUM_VALIDATIONS[@]}"; do
|
|
505
|
+
local field_path="${validation%%:*}"
|
|
506
|
+
local allowed_values="${validation#*:}"
|
|
507
|
+
|
|
508
|
+
local actual_value
|
|
509
|
+
actual_value=$(json_get "$output_file" "$field_path" 2>/dev/null)
|
|
510
|
+
|
|
511
|
+
if [[ -z "$actual_value" ]] || [[ "$actual_value" == "null" ]]; then
|
|
512
|
+
continue
|
|
513
|
+
fi
|
|
514
|
+
|
|
515
|
+
local found=false
|
|
516
|
+
IFS=',' read -ra allowed_array <<< "$allowed_values"
|
|
517
|
+
for allowed in "${allowed_array[@]}"; do
|
|
518
|
+
if [[ "$actual_value" == "$allowed" ]]; then
|
|
519
|
+
found=true
|
|
520
|
+
break
|
|
521
|
+
fi
|
|
522
|
+
done
|
|
523
|
+
|
|
524
|
+
if [[ "$found" == "false" ]]; then
|
|
525
|
+
error "Invalid value for $field_path: '$actual_value' (allowed: $allowed_values)"
|
|
526
|
+
has_errors=true
|
|
527
|
+
fi
|
|
528
|
+
done
|
|
529
|
+
|
|
530
|
+
if [[ "$has_errors" == "true" ]]; then
|
|
531
|
+
return 1
|
|
532
|
+
fi
|
|
533
|
+
|
|
534
|
+
success "All enum fields have valid values"
|
|
535
|
+
return 0
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
validate_content_terms() {
|
|
539
|
+
local output_file="$1"
|
|
540
|
+
local content
|
|
541
|
+
content=$(cat "$output_file")
|
|
542
|
+
|
|
543
|
+
local has_errors=false
|
|
544
|
+
|
|
545
|
+
if [[ ${#MUST_CONTAIN_TERMS[@]} -gt 0 ]]; then
|
|
546
|
+
local missing_terms=()
|
|
547
|
+
for term in "${MUST_CONTAIN_TERMS[@]}"; do
|
|
548
|
+
if ! grep -qi "$term" <<< "$content"; then
|
|
549
|
+
missing_terms+=("$term")
|
|
550
|
+
fi
|
|
551
|
+
done
|
|
552
|
+
|
|
553
|
+
if [[ ${#missing_terms[@]} -gt 0 ]]; then
|
|
554
|
+
error "Output missing required terms: ${missing_terms[*]}"
|
|
555
|
+
has_errors=true
|
|
556
|
+
else
|
|
557
|
+
success "All required terms found"
|
|
558
|
+
fi
|
|
559
|
+
fi
|
|
560
|
+
|
|
561
|
+
if [[ ${#MUST_NOT_CONTAIN_TERMS[@]} -gt 0 ]]; then
|
|
562
|
+
local found_forbidden=()
|
|
563
|
+
for term in "${MUST_NOT_CONTAIN_TERMS[@]}"; do
|
|
564
|
+
if grep -qi "$term" <<< "$content"; then
|
|
565
|
+
found_forbidden+=("$term")
|
|
566
|
+
fi
|
|
567
|
+
done
|
|
568
|
+
|
|
569
|
+
if [[ ${#found_forbidden[@]} -gt 0 ]]; then
|
|
570
|
+
error "Output contains forbidden terms: ${found_forbidden[*]}"
|
|
571
|
+
has_errors=true
|
|
572
|
+
else
|
|
573
|
+
success "No forbidden terms found"
|
|
574
|
+
fi
|
|
575
|
+
fi
|
|
576
|
+
|
|
577
|
+
if [[ "$has_errors" == "true" ]]; then
|
|
578
|
+
return 1
|
|
579
|
+
fi
|
|
580
|
+
|
|
581
|
+
return 0
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
# =============================================================================
|
|
585
|
+
# Main Validation Flow
|
|
586
|
+
# =============================================================================
|
|
587
|
+
|
|
588
|
+
main() {
|
|
589
|
+
if [[ -z "$OUTPUT_FILE" ]]; then
|
|
590
|
+
error "No output file specified"
|
|
591
|
+
echo "Usage: $0 <output-file> [options]"
|
|
592
|
+
exit 1
|
|
593
|
+
fi
|
|
594
|
+
|
|
595
|
+
if [[ ! -f "$OUTPUT_FILE" ]]; then
|
|
596
|
+
error "Output file not found: $OUTPUT_FILE"
|
|
597
|
+
exit 1
|
|
598
|
+
fi
|
|
599
|
+
|
|
600
|
+
if [[ "$JSON_ONLY" != "true" ]]; then
|
|
601
|
+
echo "=============================================="
|
|
602
|
+
info "Validating $SKILL_NAME Output"
|
|
603
|
+
echo "=============================================="
|
|
604
|
+
echo ""
|
|
605
|
+
echo " Skill: $SKILL_NAME v$SKILL_VERSION"
|
|
606
|
+
echo " File: $OUTPUT_FILE"
|
|
607
|
+
echo ""
|
|
608
|
+
fi
|
|
609
|
+
|
|
610
|
+
local tool_status="passed"
|
|
611
|
+
local json_status="passed"
|
|
612
|
+
local schema_status="passed"
|
|
613
|
+
local fields_status="passed"
|
|
614
|
+
local enums_status="passed"
|
|
615
|
+
local content_status="passed"
|
|
616
|
+
local specific_status="passed"
|
|
617
|
+
local error_count=0
|
|
618
|
+
|
|
619
|
+
# Step 1: Check Required Tools
|
|
620
|
+
[[ "$JSON_ONLY" != "true" ]] && echo "--- Step 1: Tool Availability ---"
|
|
621
|
+
|
|
622
|
+
if ! validate_tools; then
|
|
623
|
+
tool_status="failed"
|
|
624
|
+
((error_count++)) || true
|
|
625
|
+
exit $EXIT_SKIP
|
|
626
|
+
fi
|
|
627
|
+
|
|
628
|
+
[[ "$JSON_ONLY" != "true" ]] && success "Tool check passed" && echo ""
|
|
629
|
+
|
|
630
|
+
# Step 2: Validate JSON Syntax
|
|
631
|
+
[[ "$JSON_ONLY" != "true" ]] && echo "--- Step 2: JSON Syntax ---"
|
|
632
|
+
|
|
633
|
+
if ! validate_json "$OUTPUT_FILE"; then
|
|
634
|
+
json_status="failed"
|
|
635
|
+
((error_count++)) || true
|
|
636
|
+
exit $EXIT_FAIL
|
|
637
|
+
fi
|
|
638
|
+
|
|
639
|
+
[[ "$JSON_ONLY" != "true" ]] && success "JSON syntax valid" && echo ""
|
|
640
|
+
|
|
641
|
+
# Step 3: Validate Against Schema
|
|
642
|
+
[[ "$JSON_ONLY" != "true" ]] && echo "--- Step 3: Schema Validation ---"
|
|
643
|
+
|
|
644
|
+
local schema_exit_code
|
|
645
|
+
validate_schema "$OUTPUT_FILE" && schema_exit_code=0 || schema_exit_code=$?
|
|
646
|
+
|
|
647
|
+
case $schema_exit_code in
|
|
648
|
+
0) [[ "$JSON_ONLY" != "true" ]] && echo "" ;;
|
|
649
|
+
1) schema_status="failed"; ((error_count++)) || true; [[ "$JSON_ONLY" != "true" ]] && echo "" ;;
|
|
650
|
+
2) schema_status="skipped"; [[ "$JSON_ONLY" != "true" ]] && echo "" ;;
|
|
651
|
+
esac
|
|
652
|
+
|
|
653
|
+
# Step 4: Validate Required Fields
|
|
654
|
+
[[ "$JSON_ONLY" != "true" ]] && echo "--- Step 4: Required Fields ---"
|
|
655
|
+
|
|
656
|
+
if ! validate_required_fields "$OUTPUT_FILE"; then
|
|
657
|
+
fields_status="failed"
|
|
658
|
+
((error_count++)) || true
|
|
659
|
+
fi
|
|
660
|
+
|
|
661
|
+
[[ "$JSON_ONLY" != "true" ]] && echo ""
|
|
662
|
+
|
|
663
|
+
# Step 5: Validate Enum Values
|
|
664
|
+
[[ "$JSON_ONLY" != "true" ]] && echo "--- Step 5: Enum Validation ---"
|
|
665
|
+
|
|
666
|
+
if ! validate_enum_fields "$OUTPUT_FILE"; then
|
|
667
|
+
enums_status="failed"
|
|
668
|
+
((error_count++)) || true
|
|
669
|
+
fi
|
|
670
|
+
|
|
671
|
+
[[ "$JSON_ONLY" != "true" ]] && echo ""
|
|
672
|
+
|
|
673
|
+
# Step 6: Validate Content Terms
|
|
674
|
+
[[ "$JSON_ONLY" != "true" ]] && echo "--- Step 6: Content Terms ---"
|
|
675
|
+
|
|
676
|
+
if ! validate_content_terms "$OUTPUT_FILE"; then
|
|
677
|
+
content_status="failed"
|
|
678
|
+
((error_count++)) || true
|
|
679
|
+
fi
|
|
680
|
+
|
|
681
|
+
[[ "$JSON_ONLY" != "true" ]] && echo ""
|
|
682
|
+
|
|
683
|
+
# Step 7: Skill-Specific Validation
|
|
684
|
+
[[ "$JSON_ONLY" != "true" ]] && echo "--- Step 7: Skill-Specific Validation ---"
|
|
685
|
+
|
|
686
|
+
if ! validate_skill_specific "$OUTPUT_FILE"; then
|
|
687
|
+
specific_status="failed"
|
|
688
|
+
((error_count++)) || true
|
|
689
|
+
fi
|
|
690
|
+
|
|
691
|
+
[[ "$JSON_ONLY" != "true" ]] && echo ""
|
|
692
|
+
|
|
693
|
+
# Determine Overall Status
|
|
694
|
+
local overall_status="passed"
|
|
695
|
+
local content_overall="passed"
|
|
696
|
+
|
|
697
|
+
if [[ "$fields_status" == "failed" ]] || \
|
|
698
|
+
[[ "$enums_status" == "failed" ]] || \
|
|
699
|
+
[[ "$content_status" == "failed" ]] || \
|
|
700
|
+
[[ "$specific_status" == "failed" ]]; then
|
|
701
|
+
content_overall="failed"
|
|
702
|
+
fi
|
|
703
|
+
|
|
704
|
+
if [[ "$json_status" == "failed" ]] || \
|
|
705
|
+
[[ "$schema_status" == "failed" ]] || \
|
|
706
|
+
[[ "$content_overall" == "failed" ]]; then
|
|
707
|
+
overall_status="failed"
|
|
708
|
+
elif [[ "$schema_status" == "skipped" ]]; then
|
|
709
|
+
overall_status="partial"
|
|
710
|
+
fi
|
|
711
|
+
|
|
712
|
+
# Output Results
|
|
713
|
+
if [[ "$JSON_ONLY" != "true" ]]; then
|
|
714
|
+
echo "=============================================="
|
|
715
|
+
echo "Validation Summary for $SKILL_NAME"
|
|
716
|
+
echo "=============================================="
|
|
717
|
+
echo ""
|
|
718
|
+
echo " Tools: $tool_status"
|
|
719
|
+
echo " JSON Syntax: $json_status"
|
|
720
|
+
echo " Schema: $schema_status"
|
|
721
|
+
echo " Required Fields: $fields_status"
|
|
722
|
+
echo " Enum Values: $enums_status"
|
|
723
|
+
echo " Content Terms: $content_status"
|
|
724
|
+
echo " Skill-Specific: $specific_status"
|
|
725
|
+
echo ""
|
|
726
|
+
echo " Overall: $overall_status"
|
|
727
|
+
echo " Errors: $error_count"
|
|
728
|
+
echo "=============================================="
|
|
729
|
+
echo ""
|
|
730
|
+
fi
|
|
731
|
+
|
|
732
|
+
case "$overall_status" in
|
|
733
|
+
"passed")
|
|
734
|
+
[[ "$JSON_ONLY" != "true" ]] && success "Validation PASSED"
|
|
735
|
+
exit $EXIT_PASS
|
|
736
|
+
;;
|
|
737
|
+
"partial")
|
|
738
|
+
[[ "$JSON_ONLY" != "true" ]] && warn "Validation PARTIAL"
|
|
739
|
+
exit $EXIT_PASS
|
|
740
|
+
;;
|
|
741
|
+
"failed")
|
|
742
|
+
[[ "$JSON_ONLY" != "true" ]] && error "Validation FAILED"
|
|
743
|
+
exit $EXIT_FAIL
|
|
744
|
+
;;
|
|
745
|
+
esac
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
main
|