synapse-hub 2.4.0 → 2.4.2
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/.agents/agents/orchestrator.md +3 -0
- package/.agents/agents/pom-crafter.md +3 -0
- package/.agents/agents/quality-gatekeeper.md +1 -0
- package/.agents/agents/test-runner.md +1 -0
- package/.agents/rules/graphify.md +14 -14
- package/.agents/rules/mandatory-playwright-live.md +29 -29
- package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -614
- package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -28
- package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -138
- package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -522
- package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -64
- package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -56
- package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +98 -98
- package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -209
- package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -155
- package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -67
- package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -160
- package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -75
- package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -388
- package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -134
- package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -541
- package/.agents/templates/completion_report.md +57 -57
- package/.agents/workflows/graphify.md +10 -10
- package/.cursor/rules/language.mdc +7 -7
- package/README.en.md +9 -3
- package/README.md +9 -3
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-06_api_contract_drift.json +21 -21
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-07_api_contract_drift.json +21 -21
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-08_api_contract_drift.json +21 -21
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-09_api_contract_drift.json +21 -21
- package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-10_api_contract_drift.json +21 -21
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-21_fake_pass_tautology.json +20 -20
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-22_fake_pass_tautology.json +20 -20
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-23_fake_pass_tautology.json +20 -20
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-24_fake_pass_tautology.json +20 -20
- package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-25_fake_pass_tautology.json +20 -20
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-01_locator_drift.json +22 -22
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-02_locator_drift.json +22 -22
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-03_locator_drift.json +22 -22
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-04_locator_drift.json +22 -22
- package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-05_locator_drift.json +22 -22
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-16_stale_and_mutation.json +21 -21
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-17_stale_and_mutation.json +21 -21
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-18_stale_and_mutation.json +21 -21
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-19_stale_and_mutation.json +21 -21
- package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-20_stale_and_mutation.json +22 -22
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-11_timing_and_race.json +21 -21
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-12_timing_and_race.json +21 -21
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-13_timing_and_race.json +21 -21
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-14_timing_and_race.json +21 -21
- package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-15_timing_and_race.json +21 -21
- package/benchmarks/qa_eval/reports/BENCHMARK_REPORT.md +94 -69
- package/benchmarks/qa_eval/reports/eval_results.json +460 -104
- package/bin/agent-qa.js +6 -1
- package/docs/ARCHITECTURE.md +13 -2
- package/package.json +6 -6
- package/scripts/install.ps1 +112 -112
- package/scripts/install_global_plugin.ps1 +1 -1
- package/scripts/install_global_plugin.sh +1 -1
- package/scripts/lint_skills.ps1 +57 -57
- package/skills_manifest.json +1 -1
- package/synapse.config.json +1 -1
- package/tools/TOOLS_RUNBOOK.md +6 -1
- package/tools/__init__.py +1 -1
- package/tools/agent_canary.py +501 -501
- package/tools/api_fuzzer.py +11 -2
- package/tools/browser_helpers.js +2 -2
- package/tools/bump_version.py +8 -0
- package/tools/check_version_sync.py +18 -0
- package/tools/cli.py +210 -48
- package/tools/count_tokens.py +4 -4
- package/tools/dashboard_generator.py +10 -10
- package/tools/e2e_flow_prober.sh +0 -0
- package/tools/generate_allure_report.sh +0 -0
- package/tools/generate_test_reports.sh +0 -0
- package/tools/mcp_excel_server.py +3 -1
- package/tools/mcp_excel_server.sh +0 -0
- package/tools/mcp_server.py +1 -1
- package/tools/micro_mutator.py +4 -2
- package/tools/pinpoint_failure.py +88 -88
- package/tools/setup_project.py +1 -1
- package/tools/skillspector.py +31 -0
- package/tools/update_sentinel.py +3 -3
- package/tools/verify_all.py +16 -6
- package/tools/verify_all.sh +0 -0
- package/tools/visual_som_helper.py +14 -3
- package/tools/welcome_page.py +1 -1
- package/benchmarks/qa_eval/reports/AB_METHODOLOGY_REPORT.md +0 -83
package/tools/api_fuzzer.py
CHANGED
|
@@ -115,12 +115,21 @@ class ApiFuzzer:
|
|
|
115
115
|
parsed = urllib.parse.urlparse(self.base_url)
|
|
116
116
|
host = (parsed.hostname or "").lower().strip()
|
|
117
117
|
is_safe_env = self._is_safe_non_prod_host(host)
|
|
118
|
-
|
|
118
|
+
allowed_hosts = {
|
|
119
|
+
h.strip().lower() for h in os.environ.get("SYNAPSE_ALLOW_PROD_HOSTS", "").split(",") if h.strip()
|
|
120
|
+
}
|
|
121
|
+
is_host_specifically_allowed = host in allowed_hosts
|
|
122
|
+
global_override = os.environ.get("SYNAPSE_ALLOW_PROD_FUZZ") in ("1", "true", "TRUE")
|
|
123
|
+
|
|
124
|
+
if host and not is_safe_env and not (is_host_specifically_allowed or global_override):
|
|
119
125
|
raise PermissionError(
|
|
120
126
|
f"[SAFETY FIREWALL - REJECTED] Target host '{host}' is not in the allowed non-production environment allowlist "
|
|
121
127
|
"(localhost, private IP, .local/.internal, or verified dev/staging/qa/test subdomain). "
|
|
122
|
-
"
|
|
128
|
+
f"To authorize this host specifically, set SYNAPSE_ALLOW_PROD_HOSTS='{host}' or SYNAPSE_ALLOW_PROD_FUZZ=1 if authorized."
|
|
123
129
|
)
|
|
130
|
+
if host and not is_safe_env and global_override and not is_host_specifically_allowed:
|
|
131
|
+
print(f" ⚠️ [SECURITY WARNING] SYNAPSE_ALLOW_PROD_FUZZ=1 global override active for host '{host}'. "
|
|
132
|
+
f"Prefer setting SYNAPSE_ALLOW_PROD_HOSTS='{host}' for host-scoped permission.")
|
|
124
133
|
|
|
125
134
|
# Prepare SSL context (support self-signed staging certificates via explicit --insecure flag)
|
|
126
135
|
self.ssl_context = ssl.create_default_context()
|
package/tools/browser_helpers.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
(function () {
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
if (window.__qa && window.__qa.__version === '2.
|
|
16
|
+
if (window.__qa && window.__qa.__version === '2.4.2') {
|
|
17
17
|
return window.__qa;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
const qa = {
|
|
50
|
-
__version: '2.
|
|
50
|
+
__version: '2.4.2',
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* 1. Smart Action Batching
|
package/tools/bump_version.py
CHANGED
|
@@ -195,6 +195,10 @@ def main():
|
|
|
195
195
|
# 7. tools/mcp_excel_server.ps1
|
|
196
196
|
update_file("tools/mcp_excel_server.ps1", r'(version\s*=\s*")[^"]+(")', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
197
197
|
|
|
198
|
+
# 7b. tools/mcp_excel_server.py
|
|
199
|
+
update_file("tools/mcp_excel_server.py", r'(SERVER_VERSION\s*=\s*")[^"]+(")', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
200
|
+
update_file("tools/mcp_excel_server.py", r'("serverInfo":\s*\{[^}]*"version":\s*")[^"]+(")', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
201
|
+
|
|
198
202
|
# 8. docs/ARCHITECTURE.md
|
|
199
203
|
update_file("docs/ARCHITECTURE.md", r'(>\s*\*\*Version:\*\*\s*`)[^`]+(`)', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
200
204
|
|
|
@@ -214,6 +218,10 @@ def main():
|
|
|
214
218
|
# 12. tools/dashboard_generator.py
|
|
215
219
|
update_file("tools/dashboard_generator.py", r'(Synapse-Hub v)[0-9]+\.[0-9]+\.[0-9]+', rf"\g<1>{new_ver}", args.dry_run)
|
|
216
220
|
|
|
221
|
+
# 13. tools/update_sentinel.py
|
|
222
|
+
update_file("tools/update_sentinel.py", r'(\.get\("version",\s*")[^"]+(")', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
223
|
+
update_file("tools/update_sentinel.py", r'(return\s*")[0-9]+\.[0-9]+\.[0-9]+(")', rf"\g<1>{new_ver}\g<2>", args.dry_run)
|
|
224
|
+
|
|
217
225
|
if args.dry_run:
|
|
218
226
|
print("\n[INFO] Dry-run completed. No files modified on disk.")
|
|
219
227
|
return
|
|
@@ -93,6 +93,24 @@ def extract_versions(repo_root: str) -> Dict[str, str]:
|
|
|
93
93
|
if m:
|
|
94
94
|
versions["tools/__init__.py"] = m.group(1)
|
|
95
95
|
|
|
96
|
+
# 9. tools/mcp_excel_server.py
|
|
97
|
+
excel_mcp_path = os.path.join(repo_root, "tools", "mcp_excel_server.py")
|
|
98
|
+
if os.path.exists(excel_mcp_path):
|
|
99
|
+
with open(excel_mcp_path, "r", encoding="utf-8") as f:
|
|
100
|
+
content = f.read()
|
|
101
|
+
m = re.search(r'"serverInfo":\s*\{[^}]*"version":\s*["\']([^"\']+)["\']', content)
|
|
102
|
+
if m:
|
|
103
|
+
versions["tools/mcp_excel_server.py"] = m.group(1)
|
|
104
|
+
|
|
105
|
+
# 10. docs/ARCHITECTURE.md
|
|
106
|
+
arch_path = os.path.join(repo_root, "docs", "ARCHITECTURE.md")
|
|
107
|
+
if os.path.exists(arch_path):
|
|
108
|
+
with open(arch_path, "r", encoding="utf-8") as f:
|
|
109
|
+
content = f.read()
|
|
110
|
+
m = re.search(r'>\s*\*\*Version:\*\*\s*`([^`]+)`', content)
|
|
111
|
+
if m:
|
|
112
|
+
versions["docs/ARCHITECTURE.md"] = m.group(1)
|
|
113
|
+
|
|
96
114
|
return versions
|
|
97
115
|
|
|
98
116
|
|
package/tools/cli.py
CHANGED
|
@@ -13,6 +13,8 @@ Dispatches commands to underlying specialized tools in tools/.
|
|
|
13
13
|
import os
|
|
14
14
|
import sys
|
|
15
15
|
import json
|
|
16
|
+
import re
|
|
17
|
+
import difflib
|
|
16
18
|
import argparse
|
|
17
19
|
|
|
18
20
|
# Enforce UTF-8 stdout encoding for Windows console compatibility
|
|
@@ -27,10 +29,19 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
27
29
|
REPO_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, ".."))
|
|
28
30
|
sys.path.insert(0, SCRIPT_DIR)
|
|
29
31
|
|
|
32
|
+
# ANSI Color formatting
|
|
33
|
+
CYAN = "\033[96m"
|
|
34
|
+
GREEN = "\033[92m"
|
|
35
|
+
YELLOW = "\033[93m"
|
|
36
|
+
RED = "\033[91m"
|
|
37
|
+
BOLD = "\033[1m"
|
|
38
|
+
RESET = "\033[0m"
|
|
39
|
+
|
|
30
40
|
|
|
31
41
|
def cmd_version(args):
|
|
42
|
+
"""Displays the current hub version, skill catalog count, and license information."""
|
|
32
43
|
manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
|
|
33
|
-
version = "2.4.
|
|
44
|
+
version = "2.4.2"
|
|
34
45
|
if os.path.exists(manifest_path):
|
|
35
46
|
try:
|
|
36
47
|
import json
|
|
@@ -45,7 +56,7 @@ def cmd_version(args):
|
|
|
45
56
|
try:
|
|
46
57
|
import json
|
|
47
58
|
with open(manifest_path, "r", encoding="utf-8") as f:
|
|
48
|
-
manifest_skills = json.load(f).get("totalSkills",
|
|
59
|
+
manifest_skills = json.load(f).get("totalSkills", 38)
|
|
49
60
|
except (OSError, json.JSONDecodeError):
|
|
50
61
|
pass
|
|
51
62
|
print(f"Catalog: {manifest_skills} Standardized Skills | 6 Subagent Swarm Profiles")
|
|
@@ -54,6 +65,7 @@ def cmd_version(args):
|
|
|
54
65
|
|
|
55
66
|
|
|
56
67
|
def cmd_verify_author(args):
|
|
68
|
+
"""Validates author attribution and MIT provenance integrity across the repository."""
|
|
57
69
|
from author_integrity import verify_author_attribution, get_canonical_watermark, enforce_author_attribution
|
|
58
70
|
valid, violations = verify_author_attribution()
|
|
59
71
|
if valid:
|
|
@@ -63,33 +75,52 @@ def cmd_verify_author(args):
|
|
|
63
75
|
enforce_author_attribution(strict=True)
|
|
64
76
|
|
|
65
77
|
|
|
78
|
+
def _forward_subcommand_args(args_or_name=None) -> list:
|
|
79
|
+
"""Safely extracts and forwards arguments intended for the underlying subcommand tool."""
|
|
80
|
+
subcmd = None
|
|
81
|
+
if isinstance(args_or_name, str):
|
|
82
|
+
subcmd = args_or_name
|
|
83
|
+
elif hasattr(args_or_name, "subcommand"):
|
|
84
|
+
subcmd = args_or_name.subcommand
|
|
85
|
+
|
|
86
|
+
if subcmd and subcmd in sys.argv:
|
|
87
|
+
idx = sys.argv.index(subcmd)
|
|
88
|
+
return [sys.argv[0]] + sys.argv[idx + 1:]
|
|
89
|
+
return [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
|
|
90
|
+
|
|
91
|
+
|
|
66
92
|
def cmd_verify(args):
|
|
93
|
+
"""Executes the 9 Quality Gates Definition of Done (DoD) verification suite."""
|
|
67
94
|
from verify_all import main as verify_main
|
|
68
|
-
sys.argv =
|
|
95
|
+
sys.argv = _forward_subcommand_args(args)
|
|
69
96
|
sys.exit(verify_main())
|
|
70
97
|
|
|
71
98
|
|
|
72
99
|
def cmd_lint(args):
|
|
100
|
+
"""Runs the Meta Infer-style AST Fake-Pass, zero-assertion, and hard sleep scanner."""
|
|
73
101
|
from infer_linter import main as lint_main
|
|
74
|
-
sys.argv =
|
|
102
|
+
sys.argv = _forward_subcommand_args(args)
|
|
75
103
|
sys.exit(lint_main())
|
|
76
104
|
|
|
77
105
|
|
|
78
106
|
def cmd_heal(args):
|
|
107
|
+
"""Interacts with the central episodic self-healing solution memory cache."""
|
|
79
108
|
from cache_resolver import main as heal_main
|
|
80
|
-
sys.argv =
|
|
109
|
+
sys.argv = _forward_subcommand_args(args)
|
|
81
110
|
sys.exit(heal_main())
|
|
82
111
|
|
|
83
112
|
|
|
84
113
|
def cmd_distill(args):
|
|
114
|
+
"""Distills and filters high-volume CI/CD test execution logs by ~95%."""
|
|
85
115
|
from distill_log import main as distill_main
|
|
86
|
-
sys.argv =
|
|
116
|
+
sys.argv = _forward_subcommand_args(args)
|
|
87
117
|
sys.exit(distill_main())
|
|
88
118
|
|
|
89
119
|
|
|
90
120
|
def cmd_impact(args):
|
|
121
|
+
"""Analyzes code change impact and scopes affected tests using AST graph mapping."""
|
|
91
122
|
from test_impact import main as impact_main
|
|
92
|
-
sys.argv =
|
|
123
|
+
sys.argv = _forward_subcommand_args(args)
|
|
93
124
|
sys.exit(impact_main())
|
|
94
125
|
|
|
95
126
|
|
|
@@ -119,36 +150,42 @@ def cmd_clean(args):
|
|
|
119
150
|
|
|
120
151
|
|
|
121
152
|
def cmd_flaky(args):
|
|
153
|
+
"""Detects non-deterministic flaky tests and manages quarantine governance."""
|
|
122
154
|
from flaky_detector import main as flaky_main
|
|
123
|
-
sys.argv =
|
|
155
|
+
sys.argv = _forward_subcommand_args(args)
|
|
124
156
|
sys.exit(flaky_main())
|
|
125
157
|
|
|
126
158
|
|
|
127
159
|
def cmd_canary(args):
|
|
160
|
+
"""Executes the autonomous canary self-healing benchmark across 8 failure vectors."""
|
|
128
161
|
from agent_canary import main as canary_main
|
|
129
|
-
sys.argv =
|
|
162
|
+
sys.argv = _forward_subcommand_args(args)
|
|
130
163
|
sys.exit(canary_main())
|
|
131
164
|
|
|
132
165
|
|
|
133
166
|
def cmd_analyze(args):
|
|
167
|
+
"""Runs comprehensive 5-in-1 project health and AST architecture analysis."""
|
|
134
168
|
from analyze_project import main as analyze_main
|
|
135
|
-
sys.argv =
|
|
169
|
+
sys.argv = _forward_subcommand_args(args)
|
|
136
170
|
sys.exit(analyze_main())
|
|
137
171
|
|
|
138
172
|
|
|
139
173
|
def cmd_setup(args):
|
|
174
|
+
"""Bootstraps a target test repository with AI guide, Git hook, and AST map."""
|
|
140
175
|
from setup_project import main as setup_main
|
|
141
|
-
sys.argv =
|
|
176
|
+
sys.argv = _forward_subcommand_args(args)
|
|
142
177
|
sys.exit(setup_main())
|
|
143
178
|
|
|
144
179
|
|
|
145
180
|
def cmd_doctor(args):
|
|
181
|
+
"""Runs a 1-click diagnostic check of system environment, tools, and dependencies."""
|
|
146
182
|
from check_env import main as check_env_main
|
|
147
|
-
sys.argv =
|
|
183
|
+
sys.argv = _forward_subcommand_args(args)
|
|
148
184
|
sys.exit(check_env_main())
|
|
149
185
|
|
|
150
186
|
|
|
151
187
|
def cmd_uninstall(args):
|
|
188
|
+
"""Reverts and cleans configuration files and Git hooks installed by setup in target project."""
|
|
152
189
|
from setup_project import uninstall_setup, resolve_target_repo
|
|
153
190
|
target = getattr(args, "target", None)
|
|
154
191
|
target_repo = resolve_target_repo(cli_target=target)
|
|
@@ -156,43 +193,50 @@ def cmd_uninstall(args):
|
|
|
156
193
|
|
|
157
194
|
|
|
158
195
|
def cmd_auto_heal(args):
|
|
196
|
+
"""Executes closed-loop test failure diagnosis and creates a locator healing plan."""
|
|
159
197
|
from auto_heal import main as auto_heal_main
|
|
160
|
-
sys.argv =
|
|
198
|
+
sys.argv = _forward_subcommand_args(args)
|
|
161
199
|
sys.exit(auto_heal_main())
|
|
162
200
|
|
|
163
201
|
|
|
164
202
|
def cmd_safety_check(args):
|
|
203
|
+
"""Validates actions against the Action Safety Firewall to prevent destructive operations."""
|
|
165
204
|
from safety_firewall import main as safety_main
|
|
166
|
-
sys.argv =
|
|
205
|
+
sys.argv = _forward_subcommand_args(args)
|
|
167
206
|
sys.exit(safety_main())
|
|
168
207
|
|
|
169
208
|
|
|
170
209
|
def cmd_contract_drift(args):
|
|
210
|
+
"""Detects breaking API changes across OpenAPI / Swagger contract specifications."""
|
|
171
211
|
from api_drift_sentinel import main as drift_main
|
|
172
|
-
sys.argv =
|
|
212
|
+
sys.argv = _forward_subcommand_args(args)
|
|
173
213
|
sys.exit(drift_main())
|
|
174
214
|
|
|
175
215
|
|
|
176
216
|
def cmd_mcp_serve(args):
|
|
217
|
+
"""Starts the JSON-RPC 2.0 stdio Model Context Protocol (MCP) server."""
|
|
177
218
|
from mcp_server import run_stdio_server
|
|
178
219
|
run_stdio_server()
|
|
179
220
|
|
|
180
221
|
|
|
181
222
|
def cmd_mutate(args):
|
|
223
|
+
"""Injects syntactic micro-mutations to measure test assertion sensitivity."""
|
|
182
224
|
from micro_mutator import main as mut_main
|
|
183
|
-
sys.argv =
|
|
225
|
+
sys.argv = _forward_subcommand_args(args)
|
|
184
226
|
sys.exit(mut_main())
|
|
185
227
|
|
|
186
228
|
|
|
187
229
|
def cmd_heal_pr(args):
|
|
230
|
+
"""Calculates self-healing confidence and generates an automated Git pull request draft."""
|
|
188
231
|
from heal_pr_automator import main as pr_main
|
|
189
|
-
sys.argv =
|
|
232
|
+
sys.argv = _forward_subcommand_args(args)
|
|
190
233
|
sys.exit(pr_main())
|
|
191
234
|
|
|
192
235
|
|
|
193
236
|
def cmd_shard(args):
|
|
237
|
+
"""Balances parallel CI/CD test execution using duration-balanced bin-packing."""
|
|
194
238
|
from matrix_sharder import main as shard_main
|
|
195
|
-
sys.argv =
|
|
239
|
+
sys.argv = _forward_subcommand_args(args)
|
|
196
240
|
sys.exit(shard_main())
|
|
197
241
|
|
|
198
242
|
|
|
@@ -231,37 +275,37 @@ def cmd_omni_scan(args):
|
|
|
231
275
|
|
|
232
276
|
def cmd_report_bug(args):
|
|
233
277
|
from bug_reporter import main as bug_main
|
|
234
|
-
sys.argv =
|
|
278
|
+
sys.argv = _forward_subcommand_args(args)
|
|
235
279
|
sys.exit(bug_main())
|
|
236
280
|
|
|
237
281
|
|
|
238
282
|
def cmd_mock_shield(args):
|
|
239
283
|
from network_mock_shield import main as mock_main
|
|
240
|
-
sys.argv =
|
|
284
|
+
sys.argv = _forward_subcommand_args(args)
|
|
241
285
|
sys.exit(mock_main())
|
|
242
286
|
|
|
243
287
|
|
|
244
288
|
def cmd_visual_mask(args):
|
|
245
289
|
from smart_visual_masker import main as mask_main
|
|
246
|
-
sys.argv =
|
|
290
|
+
sys.argv = _forward_subcommand_args(args)
|
|
247
291
|
sys.exit(mask_main())
|
|
248
292
|
|
|
249
293
|
|
|
250
294
|
def cmd_review_spec(args):
|
|
251
295
|
from goldfish_review import main as review_main
|
|
252
|
-
sys.argv =
|
|
296
|
+
sys.argv = _forward_subcommand_args(args)
|
|
253
297
|
sys.exit(review_main())
|
|
254
298
|
|
|
255
299
|
|
|
256
300
|
def cmd_drift_check(args):
|
|
257
301
|
from spec_drift_sentinel import main as drift_main
|
|
258
|
-
sys.argv =
|
|
302
|
+
sys.argv = _forward_subcommand_args(args)
|
|
259
303
|
sys.exit(drift_main())
|
|
260
304
|
|
|
261
305
|
|
|
262
306
|
def cmd_ci_hook(args):
|
|
263
307
|
from ci_healing_hook import main as hook_main
|
|
264
|
-
sys.argv =
|
|
308
|
+
sys.argv = _forward_subcommand_args(args)
|
|
265
309
|
sys.exit(hook_main())
|
|
266
310
|
|
|
267
311
|
|
|
@@ -295,67 +339,67 @@ def cmd_migrate(args):
|
|
|
295
339
|
|
|
296
340
|
def cmd_decouple_config(args):
|
|
297
341
|
from config_decoupler import main as decouple_main
|
|
298
|
-
sys.argv =
|
|
342
|
+
sys.argv = _forward_subcommand_args(args)
|
|
299
343
|
sys.exit(decouple_main())
|
|
300
344
|
|
|
301
345
|
|
|
302
346
|
def cmd_fuzz_api(args):
|
|
303
347
|
from api_fuzzer import main as fuzz_main
|
|
304
|
-
sys.argv =
|
|
348
|
+
sys.argv = _forward_subcommand_args(args)
|
|
305
349
|
sys.exit(fuzz_main())
|
|
306
350
|
|
|
307
351
|
|
|
308
352
|
def cmd_som(args):
|
|
309
353
|
from visual_som_helper import main as som_main
|
|
310
|
-
sys.argv =
|
|
354
|
+
sys.argv = _forward_subcommand_args(args)
|
|
311
355
|
sys.exit(som_main())
|
|
312
356
|
|
|
313
357
|
|
|
314
358
|
def cmd_gherkin(args):
|
|
315
359
|
from gherkin_suite import main as gherkin_main
|
|
316
|
-
sys.argv =
|
|
360
|
+
sys.argv = _forward_subcommand_args(args)
|
|
317
361
|
sys.exit(gherkin_main())
|
|
318
362
|
|
|
319
363
|
|
|
320
364
|
def cmd_export_postman(args):
|
|
321
365
|
from export_postman_collection import main as postman_main
|
|
322
|
-
sys.argv =
|
|
366
|
+
sys.argv = _forward_subcommand_args(args)
|
|
323
367
|
sys.exit(postman_main())
|
|
324
368
|
|
|
325
369
|
|
|
326
370
|
def cmd_generate_jmx(args):
|
|
327
371
|
from generate_jmx_plan import main as jmx_main
|
|
328
|
-
sys.argv =
|
|
372
|
+
sys.argv = _forward_subcommand_args(args)
|
|
329
373
|
sys.exit(jmx_main())
|
|
330
374
|
|
|
331
375
|
|
|
332
376
|
def cmd_skillspector(args):
|
|
333
377
|
from skillspector import main as skillspector_main
|
|
334
|
-
sys.argv =
|
|
378
|
+
sys.argv = _forward_subcommand_args(args)
|
|
335
379
|
sys.exit(skillspector_main())
|
|
336
380
|
|
|
337
381
|
|
|
338
382
|
def cmd_analyze_jtl(args):
|
|
339
383
|
from jtl_analyzer import main as jtl_main
|
|
340
|
-
sys.argv =
|
|
384
|
+
sys.argv = _forward_subcommand_args(args)
|
|
341
385
|
sys.exit(jtl_main())
|
|
342
386
|
|
|
343
387
|
|
|
344
388
|
def cmd_export_excel(args):
|
|
345
389
|
from md_to_xlsx import main as excel_main
|
|
346
|
-
sys.argv =
|
|
390
|
+
sys.argv = _forward_subcommand_args(args)
|
|
347
391
|
sys.exit(excel_main())
|
|
348
392
|
|
|
349
393
|
|
|
350
394
|
def cmd_correlate_telemetry(args):
|
|
351
395
|
from telemetry_correlator import main as telem_main
|
|
352
|
-
sys.argv =
|
|
396
|
+
sys.argv = _forward_subcommand_args(args)
|
|
353
397
|
sys.exit(telem_main())
|
|
354
398
|
|
|
355
399
|
|
|
356
400
|
def cmd_analyze_newman(args):
|
|
357
401
|
from newman_analyzer import main as newman_main
|
|
358
|
-
sys.argv =
|
|
402
|
+
sys.argv = _forward_subcommand_args(args)
|
|
359
403
|
sys.exit(newman_main())
|
|
360
404
|
|
|
361
405
|
|
|
@@ -376,73 +420,103 @@ def cmd_update(args):
|
|
|
376
420
|
|
|
377
421
|
def cmd_tokens(args):
|
|
378
422
|
import count_tokens
|
|
379
|
-
sys.argv =
|
|
423
|
+
sys.argv = _forward_subcommand_args(args)
|
|
380
424
|
count_tokens.main()
|
|
381
425
|
|
|
382
426
|
|
|
383
427
|
def cmd_dashboard(args):
|
|
384
428
|
import dashboard_generator
|
|
385
|
-
sys.argv =
|
|
429
|
+
sys.argv = _forward_subcommand_args(args)
|
|
386
430
|
dashboard_generator.main()
|
|
387
431
|
|
|
388
432
|
|
|
389
433
|
def cmd_watch(args):
|
|
390
434
|
import watch_mode
|
|
391
|
-
sys.argv =
|
|
435
|
+
sys.argv = _forward_subcommand_args(args)
|
|
392
436
|
watch_mode.main()
|
|
393
437
|
|
|
394
438
|
|
|
395
439
|
def cmd_welcome(args):
|
|
396
440
|
import welcome_page
|
|
397
|
-
sys.argv =
|
|
441
|
+
sys.argv = _forward_subcommand_args(args)
|
|
398
442
|
welcome_page.main()
|
|
399
443
|
|
|
400
444
|
|
|
401
445
|
def cmd_wcag_audit(args):
|
|
402
446
|
from wcag_audit import main as wcag_main
|
|
403
|
-
sys.argv =
|
|
447
|
+
sys.argv = _forward_subcommand_args(args)
|
|
404
448
|
sys.exit(wcag_main())
|
|
405
449
|
|
|
406
450
|
|
|
407
451
|
def cmd_lookup_tc(args):
|
|
408
452
|
from lookup_tc import main as tc_main
|
|
409
|
-
sys.argv =
|
|
453
|
+
sys.argv = _forward_subcommand_args(args)
|
|
410
454
|
sys.exit(tc_main())
|
|
411
455
|
|
|
412
456
|
|
|
413
457
|
def cmd_lookup_xpath(args):
|
|
414
458
|
from lookup_xpath import main as xpath_main
|
|
415
|
-
sys.argv =
|
|
459
|
+
sys.argv = _forward_subcommand_args(args)
|
|
416
460
|
sys.exit(xpath_main())
|
|
417
461
|
|
|
418
462
|
|
|
419
463
|
def cmd_trace_data_flow(args):
|
|
420
464
|
from trace_data_flow import main as tdf_main
|
|
421
|
-
sys.argv =
|
|
465
|
+
sys.argv = _forward_subcommand_args(args)
|
|
422
466
|
sys.exit(tdf_main())
|
|
423
467
|
|
|
424
468
|
|
|
425
469
|
def cmd_generate_tc(args):
|
|
426
470
|
from generate_tc_from_story import main as gen_tc_main
|
|
427
|
-
sys.argv =
|
|
471
|
+
sys.argv = _forward_subcommand_args(args)
|
|
428
472
|
sys.exit(gen_tc_main())
|
|
429
473
|
|
|
430
474
|
|
|
431
475
|
def cmd_pinpoint_failure(args):
|
|
432
476
|
from pinpoint_failure import main as pp_main
|
|
433
|
-
sys.argv =
|
|
477
|
+
sys.argv = _forward_subcommand_args(args)
|
|
434
478
|
sys.exit(pp_main())
|
|
435
479
|
|
|
436
480
|
|
|
437
481
|
def cmd_sync_rules(args):
|
|
438
482
|
from sync_agent_rules import main as sync_rules_main
|
|
439
|
-
sys.argv =
|
|
483
|
+
sys.argv = _forward_subcommand_args(args)
|
|
440
484
|
sys.exit(sync_rules_main())
|
|
441
485
|
|
|
442
486
|
|
|
487
|
+
def cmd_api_matrix(args):
|
|
488
|
+
from generate_api_matrix import main as api_matrix_main
|
|
489
|
+
sys.argv = _forward_subcommand_args(args)
|
|
490
|
+
sys.exit(api_matrix_main())
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
def cmd_canvas_diff(args):
|
|
494
|
+
from visual_diff_canvas import main as canvas_diff_main
|
|
495
|
+
sys.argv = _forward_subcommand_args(args)
|
|
496
|
+
sys.exit(canvas_diff_main())
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
def cmd_validate_groovy(args):
|
|
500
|
+
from validate_groovy_scripts import main as groovy_main
|
|
501
|
+
sys.argv = _forward_subcommand_args(args)
|
|
502
|
+
sys.exit(groovy_main())
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def cmd_check_version(args):
|
|
506
|
+
from check_version_sync import main as ver_sync_main
|
|
507
|
+
sys.argv = _forward_subcommand_args(args)
|
|
508
|
+
sys.exit(ver_sync_main())
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
def cmd_mcp_excel(args):
|
|
512
|
+
from mcp_excel_server import main as mcp_excel_main
|
|
513
|
+
sys.argv = _forward_subcommand_args(args)
|
|
514
|
+
sys.exit(mcp_excel_main())
|
|
515
|
+
|
|
516
|
+
|
|
443
517
|
def _hub_version():
|
|
444
518
|
manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
|
|
445
|
-
version = "2.4.
|
|
519
|
+
version = "2.4.2"
|
|
446
520
|
if os.path.exists(manifest_path):
|
|
447
521
|
try:
|
|
448
522
|
import json
|
|
@@ -453,8 +527,32 @@ def _hub_version():
|
|
|
453
527
|
return version
|
|
454
528
|
|
|
455
529
|
|
|
530
|
+
class SynapseArgumentParser(argparse.ArgumentParser):
|
|
531
|
+
"""Enhanced ArgumentParser providing fuzzy Did-You-Mean suggestions on command typos."""
|
|
532
|
+
def error(self, message):
|
|
533
|
+
import difflib
|
|
534
|
+
m = re.search(r"invalid choice: '([^']+)'", message)
|
|
535
|
+
if m:
|
|
536
|
+
bad_choice = m.group(1)
|
|
537
|
+
choices = []
|
|
538
|
+
for action in self._actions:
|
|
539
|
+
if isinstance(action, argparse._SubParsersAction):
|
|
540
|
+
choices = list(action.choices.keys())
|
|
541
|
+
break
|
|
542
|
+
matches = difflib.get_close_matches(bad_choice, choices, n=3, cutoff=0.4)
|
|
543
|
+
sys.stderr.write(f"\n{BOLD}{RED}❌ Error: Lệnh '{bad_choice}' không tồn tại trong Synapse-Hub.{RESET}\n")
|
|
544
|
+
if matches:
|
|
545
|
+
suggestions = ", ".join(f"{BOLD}{GREEN}{c}{RESET}" for c in matches)
|
|
546
|
+
sys.stderr.write(f"💡 Có phải ý bạn là: {suggestions} ?\n\n")
|
|
547
|
+
sys.stderr.write(f"👉 Thử chạy: {BOLD}agent-qa {matches[0]} --help{RESET}\n\n")
|
|
548
|
+
else:
|
|
549
|
+
sys.stderr.write(f"👉 Gõ {BOLD}agent-qa --help{RESET} để xem danh sách tất cả các lệnh khả dụng.\n\n")
|
|
550
|
+
sys.exit(2)
|
|
551
|
+
super().error(message)
|
|
552
|
+
|
|
553
|
+
|
|
456
554
|
def main():
|
|
457
|
-
parser =
|
|
555
|
+
parser = SynapseArgumentParser(
|
|
458
556
|
prog="agent-qa",
|
|
459
557
|
description="Enterprise AI Agent Quality Engineering & Test Automation Hub CLI"
|
|
460
558
|
)
|
|
@@ -755,12 +853,76 @@ def main():
|
|
|
755
853
|
p_drift.add_argument("--json", action="store_true", help="Output machine-readable JSON format")
|
|
756
854
|
p_drift.set_defaults(func=cmd_drift_check)
|
|
757
855
|
|
|
856
|
+
# api-matrix
|
|
857
|
+
p_api_mat = subparsers.add_parser("api-matrix", help="Generate Positive, Boundary, and Negative test matrix from OpenAPI/Swagger")
|
|
858
|
+
p_api_mat.add_argument("--spec", "-s", help="Path to OpenAPI / Swagger JSON/YAML file")
|
|
859
|
+
p_api_mat.add_argument("--format", "-f", choices=["markdown", "json"], default="markdown", help="Output format (markdown, json)")
|
|
860
|
+
p_api_mat.add_argument("--output", "-o", help="Output file path")
|
|
861
|
+
p_api_mat.add_argument("--sample", action="store_true", help="Generate a sample matrix using built-in demonstration schema")
|
|
862
|
+
p_api_mat.set_defaults(func=cmd_api_matrix)
|
|
863
|
+
|
|
864
|
+
# canvas-diff
|
|
865
|
+
p_canvas = subparsers.add_parser("canvas-diff", help="HTML5 Canvas visual regression diffing & blank check")
|
|
866
|
+
p_canvas.add_argument("canvas_args", nargs="*", help="Subcommand (compare/check-blank) and image paths")
|
|
867
|
+
p_canvas.set_defaults(func=cmd_canvas_diff)
|
|
868
|
+
|
|
869
|
+
# validate-groovy
|
|
870
|
+
p_groovy = subparsers.add_parser("validate-groovy", help="Pre-check Groovy scripts & keywords syntax balance")
|
|
871
|
+
p_groovy.add_argument("target", nargs="?", default=None, help="Target repository or file to validate")
|
|
872
|
+
p_groovy.add_argument("--dir", "-d", help="Explicit directory to scan")
|
|
873
|
+
p_groovy.set_defaults(func=cmd_validate_groovy)
|
|
874
|
+
|
|
875
|
+
# check-version
|
|
876
|
+
p_ver_sync = subparsers.add_parser("check-version", help="Verify universal version synchronization across all files")
|
|
877
|
+
p_ver_sync.add_argument("--expected-version", "-e", help="Expected version string (e.g. from git tag)", default=None)
|
|
878
|
+
p_ver_sync.set_defaults(func=cmd_check_version)
|
|
879
|
+
|
|
880
|
+
# mcp-excel
|
|
881
|
+
p_mcp_excel = subparsers.add_parser("mcp-excel", help="Start the JSON-RPC 2.0 stdio MCP Excel server")
|
|
882
|
+
p_mcp_excel.set_defaults(func=cmd_mcp_excel)
|
|
883
|
+
|
|
758
884
|
args, unknown = parser.parse_known_args()
|
|
759
885
|
if getattr(args, "offline", False):
|
|
760
886
|
os.environ["AGENT_QA_OFFLINE"] = "1"
|
|
761
887
|
print("🔒 [OFFLINE MODE] Air-Gapped Deterministic Mode Active. 100% Local AST & Heuristics (Zero External API calls).")
|
|
762
888
|
|
|
763
889
|
if not args.subcommand:
|
|
890
|
+
# If running in an interactive terminal, offer a friendly quick-start menu
|
|
891
|
+
is_interactive = hasattr(sys.stdin, "isatty") and sys.stdin.isatty() and not os.environ.get("CI") and not os.environ.get("SYNAPSE_NON_INTERACTIVE")
|
|
892
|
+
if is_interactive:
|
|
893
|
+
print(f"\n{BOLD}{CYAN}======================================================================{RESET}")
|
|
894
|
+
print(f"{BOLD}{CYAN} 🧠 SYNAPSE HUB — INTERACTIVE TERMINAL WIZARD {RESET}")
|
|
895
|
+
print(f"{BOLD}{CYAN}======================================================================{RESET}")
|
|
896
|
+
print("Chào bạn! Hãy chọn nhanh một tác vụ để bắt đầu (hoặc nhấn Enter để xem Trợ Giúp):")
|
|
897
|
+
print(f" {BOLD}1.{RESET} 🩺 {BOLD}Doctor{RESET} - Kiểm tra chẩn đoán môi trường (Node, Python, Chrome, Git)")
|
|
898
|
+
print(f" {BOLD}2.{RESET} 🚀 {BOLD}Setup{RESET} - Thiết lập bảo vệ 1-click cho dự án kiểm thử mục tiêu")
|
|
899
|
+
print(f" {BOLD}3.{RESET} 🔍 {BOLD}Lint{RESET} - Quét phát hiện test pass ảo, 0 assert, sleep cứng")
|
|
900
|
+
print(f" {BOLD}4.{RESET} 🛡️ {BOLD}Verify{RESET} - Chạy kiểm tra 9 Cổng Chất Lượng DoD")
|
|
901
|
+
print(f" {BOLD}5.{RESET} 🌐 {BOLD}Welcome{RESET} - Mở trang Landing Page trực quan")
|
|
902
|
+
print(f" {BOLD}6.{RESET} ❓ {BOLD}Help{RESET} - Xem danh sách đầy đủ tất cả các lệnh CLI")
|
|
903
|
+
print(f"{BOLD}{CYAN}======================================================================{RESET}")
|
|
904
|
+
try:
|
|
905
|
+
choice = input(f"Nhập lựa chọn {BOLD}[1-6]{RESET} (mặc định: 6): ").strip()
|
|
906
|
+
except (EOFError, KeyboardInterrupt):
|
|
907
|
+
print()
|
|
908
|
+
sys.exit(0)
|
|
909
|
+
|
|
910
|
+
if choice == "1":
|
|
911
|
+
args.subcommand = "doctor"
|
|
912
|
+
return cmd_doctor(args)
|
|
913
|
+
elif choice == "2":
|
|
914
|
+
args.subcommand = "setup"
|
|
915
|
+
return cmd_setup(args)
|
|
916
|
+
elif choice == "3":
|
|
917
|
+
args.subcommand = "lint"
|
|
918
|
+
return cmd_lint(args)
|
|
919
|
+
elif choice == "4":
|
|
920
|
+
args.subcommand = "verify"
|
|
921
|
+
return cmd_verify(args)
|
|
922
|
+
elif choice == "5":
|
|
923
|
+
args.subcommand = "welcome"
|
|
924
|
+
return cmd_welcome(args)
|
|
925
|
+
|
|
764
926
|
parser.print_help()
|
|
765
927
|
print("\n💡 Tip: Run 'npx synapse-hub welcome' (or 'npm start') to launch the visual landing page.")
|
|
766
928
|
sys.exit(0)
|