synapse-hub 2.7.0 → 3.0.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.
Files changed (141) hide show
  1. package/.agents/agents/live-explorer.md +2 -0
  2. package/.agents/agents/pom-crafter.md +2 -0
  3. package/.agents/agents/test-runner.md +3 -0
  4. package/.agents/rules/communication-style.md +4 -0
  5. package/.agents/rules/context-engineering.md +1 -0
  6. package/.agents/rules/git-push-protocol.md +17 -0
  7. package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
  8. package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
  9. package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
  10. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
  11. package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
  12. package/.agents/skills/lean-impact-scoreboard/SKILL.md +1 -1
  13. package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +1 -1
  14. package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
  15. package/.agents/skills/persistent-planning-files/SKILL.md +1 -1
  16. package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
  17. package/.agents/skills/repo-quality-audit/SKILL.md +1 -1
  18. package/.agents/skills/review-spec/SKILL.md +1 -1
  19. package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
  20. package/.agents/skills/senior-code-review/SKILL.md +1 -1
  21. package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
  22. package/.agents/skills/surgical-coding-principles/SKILL.md +1 -1
  23. package/.agents/skills/technical-debt-harvester/SKILL.md +1 -1
  24. package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
  25. package/.agents/skills/verification-before-completion/SKILL.md +2 -2
  26. package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +2 -2
  27. package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
  28. package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +61 -0
  29. package/AGENTS.md +6 -4
  30. package/CLAUDE.md +2 -1
  31. package/README.en.md +71 -292
  32. package/README.md +69 -304
  33. package/action.yml +1 -1
  34. package/bin/agent-qa.js +2 -2
  35. package/docs/ARCHITECTURE.en.md +192 -0
  36. package/docs/ARCHITECTURE.md +135 -88
  37. package/docs/CI_CD_INTEGRATION.en.md +96 -0
  38. package/docs/CI_CD_INTEGRATION.md +24 -22
  39. package/docs/CLI_REFERENCE.en.md +174 -0
  40. package/docs/CLI_REFERENCE.md +120 -115
  41. package/docs/CONTRIBUTING.en.md +49 -0
  42. package/docs/CONTRIBUTING.md +26 -68
  43. package/docs/QUALITY_GATES.en.md +115 -0
  44. package/docs/QUALITY_GATES.md +115 -0
  45. package/docs/research/agent_skill_training_analysis.md +1 -1
  46. package/package.json +1 -1
  47. package/scripts/package_dist.py +2 -1
  48. package/skills_manifest.json +6 -6
  49. package/synapse.config.json +1 -1
  50. package/templates/ai_bridges/CLAUDE.md +2 -1
  51. package/templates/ai_bridges/copilot-instructions.md +2 -2
  52. package/tools/__init__.py +18 -1
  53. package/tools/_openapi_parser.py +1 -1
  54. package/tools/agent_canary.py +42 -30
  55. package/tools/agentless_patcher.py +2 -2
  56. package/tools/analyze_project.py +3 -5
  57. package/tools/api_drift_sentinel.py +4 -4
  58. package/tools/api_fuzzer.py +8 -8
  59. package/tools/auto_heal.py +4 -5
  60. package/tools/auto_heal_reflexion.py +10 -2
  61. package/tools/autogen_qa_broker.py +2 -2
  62. package/tools/browser_helpers.js +2 -2
  63. package/tools/browsergym_eval.py +2 -3
  64. package/tools/bug_reporter.py +11 -13
  65. package/tools/bump_version.py +90 -19
  66. package/tools/cache_resolver.py +78 -83
  67. package/tools/check_env.py +9 -1
  68. package/tools/check_version_sync.py +58 -4
  69. package/tools/ci_healing_hook.py +4 -6
  70. package/tools/cli.py +5 -7
  71. package/tools/config_decoupler.py +2 -3
  72. package/tools/contract_validator.py +141 -0
  73. package/tools/core/__init__.py +52 -0
  74. package/tools/count_tokens.py +22 -20
  75. package/tools/dashboard_generator.py +629 -1000
  76. package/tools/db_sandbox.py +87 -62
  77. package/tools/debt_harvester.py +3 -3
  78. package/tools/distill_log.py +3 -3
  79. package/tools/dspy_qa_signatures.py +3 -4
  80. package/tools/export_postman_collection.py +8 -8
  81. package/tools/flaky_detector.py +2 -2
  82. package/tools/fuzz_payloads.py +5 -5
  83. package/tools/generate_allure_report.py +1 -1
  84. package/tools/generate_jmx_plan.py +4 -4
  85. package/tools/gherkin_suite.py +1 -1
  86. package/tools/git_pre_commit_guard.py +2 -2
  87. package/tools/goldfish_review.py +2 -2
  88. package/tools/heal/__init__.py +28 -0
  89. package/tools/heal_pr_automator.py +6 -6
  90. package/tools/heuristic_locator_matcher.py +2 -2
  91. package/tools/infer_linter.py +143 -29
  92. package/tools/interview_story.py +0 -1
  93. package/tools/jtl_analyzer.py +11 -11
  94. package/tools/lint/__init__.py +30 -0
  95. package/tools/lint_ai_docs.py +42 -0
  96. package/tools/lookup_tc.py +1 -1
  97. package/tools/matrix_sharder.py +15 -13
  98. package/tools/mcp/__init__.py +16 -0
  99. package/tools/mcp_excel_server.py +2 -2
  100. package/tools/mcp_server.py +9 -7
  101. package/tools/md_to_xlsx.py +26 -26
  102. package/tools/micro_mutator.py +32 -15
  103. package/tools/network_mock_shield.py +27 -27
  104. package/tools/newman_analyzer.py +2 -3
  105. package/tools/omni_emitter.py +5 -8
  106. package/tools/omni_parser.py +5 -5
  107. package/tools/omni_transpiler.py +5 -5
  108. package/tools/output_formatter.py +19 -0
  109. package/tools/perf/__init__.py +24 -0
  110. package/tools/pinpoint_failure.py +1 -1
  111. package/tools/project_state.py +0 -2
  112. package/tools/qa_event_stream.py +1 -1
  113. package/tools/repo_map.py +8 -8
  114. package/tools/report/__init__.py +32 -0
  115. package/tools/reversible_sandbox.py +3 -4
  116. package/tools/safety_firewall.py +2 -2
  117. package/tools/senior_code_review.py +4 -3
  118. package/tools/setup_project.py +10 -12
  119. package/tools/skill_collision_guard.py +3 -3
  120. package/tools/skill_vault.py +94 -6
  121. package/tools/skillspector.py +10 -8
  122. package/tools/smart_visual_masker.py +4 -6
  123. package/tools/spec_drift_sentinel.py +1 -2
  124. package/tools/swe_qa_aci.py +2 -2
  125. package/tools/synapse_qa_bench.py +3 -3
  126. package/tools/sync_agent_rules.py +18 -3
  127. package/tools/telemetry_correlator.py +3 -2
  128. package/tools/test_impact.py +2 -1
  129. package/tools/test_memory_os.py +15 -5
  130. package/tools/textgrad_mutation_optimizer.py +3 -3
  131. package/tools/tms_sync_bridge.py +5 -5
  132. package/tools/tot_exploratory_tester.py +5 -6
  133. package/tools/traffic_session_converter.py +9 -9
  134. package/tools/universal_ir.py +2 -3
  135. package/tools/update_sentinel.py +6 -9
  136. package/tools/verify_all.py +12 -2
  137. package/tools/visual_diff_canvas.py +4 -4
  138. package/tools/visual_som_helper.py +15 -13
  139. package/tools/watch_mode.py +1 -1
  140. package/tools/wcag_audit.py +22 -1
  141. package/tools/welcome_page.py +5 -6
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env python3
2
- from __future__ import annotations
3
2
  """
4
3
  Enterprise Vision-Grounded Fallback & Set-of-Marks (SoM) Engine
5
4
  --------------------------------------------------------------
@@ -20,27 +19,25 @@ Features:
20
19
  4. Compact Vision Prompt Formatter:
21
20
  - Formats token-efficient briefs for Multimodal Vision Models (Gemini / Claude / GPT-4o).
22
21
  """
22
+ from __future__ import annotations
23
23
 
24
24
  import os
25
25
  import sys
26
26
  import json
27
27
  import sqlite3
28
28
  import argparse
29
- from typing import Dict, Any, List, Optional, Tuple, Union
29
+ from typing import Dict, Any, List, Optional, Tuple
30
30
  try:
31
31
  from PIL import Image, ImageDraw, ImageFont, ImageFilter
32
32
  HAS_PIL = True
33
33
  except ImportError:
34
- Image = None
35
- ImageDraw = None
36
- ImageFont = None
37
- ImageFilter = None
34
+ Image = None # type: ignore[assignment]
35
+ ImageDraw = None # type: ignore[assignment]
36
+ ImageFont = None # type: ignore[assignment]
37
+ ImageFilter = None # type: ignore[assignment]
38
38
  HAS_PIL = False
39
39
 
40
- if HAS_PIL and Image is not None:
41
- ImageSourceType = Union[Image.Image, str]
42
- else:
43
- ImageSourceType = Any
40
+ ImageSourceType = Any
44
41
 
45
42
  # Enforce UTF-8 stdout encoding for Windows console compatibility
46
43
  if hasattr(sys.stdout, 'reconfigure'):
@@ -74,12 +71,12 @@ def compute_visual_hash(image_source: ImageSourceType, bbox: Optional[List[int]]
74
71
  if isinstance(image_source, str):
75
72
  if not os.path.exists(image_source):
76
73
  raise FileNotFoundError(f"Image not found: {image_source}")
77
- img = Image.open(image_source)
74
+ img: Any = Image.open(image_source)
78
75
  else:
79
76
  img = image_source
80
77
 
81
78
  if bbox and len(bbox) == 4:
82
- img = img.crop(bbox)
79
+ img = img.crop(tuple(bbox))
83
80
 
84
81
  # Resize to (hash_size + 1, hash_size) in grayscale
85
82
  resized = img.convert("L").resize((hash_size + 1, hash_size), Image.Resampling.LANCZOS)
@@ -266,6 +263,8 @@ class VisualSoMHelper:
266
263
  edges = img.filter(ImageFilter.FIND_EDGES)
267
264
  edges = edges.point(lambda p: 255 if p > edge_threshold else 0)
268
265
  pixels = edges.load()
266
+ if pixels is None:
267
+ return []
269
268
 
270
269
  # Identify active cells with high edge density
271
270
  active_cells = set()
@@ -274,7 +273,10 @@ class VisualSoMHelper:
274
273
  count = 0
275
274
  for cy in range(y, min(h, y + stride)):
276
275
  for cx in range(x, min(w, x + stride)):
277
- if pixels[cx, cy] > 0:
276
+ px_val = pixels[cx, cy]
277
+ if isinstance(px_val, (int, float)) and px_val > 0:
278
+ count += 1
279
+ elif isinstance(px_val, tuple) and px_val and px_val[0] > 0:
278
280
  count += 1
279
281
  if count >= min_pixels_per_cell:
280
282
  active_cells.add((x // stride, y // stride))
@@ -156,7 +156,7 @@ def run_incremental_audit(file_path: str, target_dir: str) -> Dict[str, Any]:
156
156
  """Performs fast sub-100ms audit on a single changed file."""
157
157
  start_t = time.perf_counter()
158
158
  rel_path = os.path.relpath(file_path, target_dir)
159
- results = {
159
+ results: Dict[str, Any] = {
160
160
  "file": rel_path,
161
161
  "bom_pass": True,
162
162
  "path_pass": True,
@@ -126,6 +126,18 @@ class WCAGAuditor(HTMLParser):
126
126
 
127
127
 
128
128
  def run_audit(target, is_url=False):
129
+ """Executes a WCAG 2.2 accessibility audit against an HTML file or live web URL.
130
+
131
+ Args:
132
+ target: Filepath or URL pointing to HTML content.
133
+ is_url: True if target should be fetched over HTTP/HTTPS.
134
+
135
+ Returns:
136
+ The populated WCAGAuditor instance containing violations and stats.
137
+
138
+ Raises:
139
+ ValueError: If an insecure or invalid URL scheme is passed.
140
+ """
129
141
  auditor = WCAGAuditor()
130
142
  if is_url:
131
143
  parsed = urllib.parse.urlparse(target)
@@ -143,6 +155,15 @@ def run_audit(target, is_url=False):
143
155
 
144
156
 
145
157
  def format_markdown_report(target, auditor):
158
+ """Generates an executive WCAG 2.2 audit markdown report.
159
+
160
+ Args:
161
+ target: Target URL or file audited.
162
+ auditor: Populated WCAGAuditor instance.
163
+
164
+ Returns:
165
+ Markdown string containing compliance score, grade, and violation details.
166
+ """
146
167
  violations = auditor.violations
147
168
  stats = {
148
169
  "elements_scanned": auditor.elements_scanned,
@@ -158,7 +179,7 @@ def format_markdown_report(target, auditor):
158
179
  grade = "PASS" if score >= 80 else "NEEDS REMEDIATION"
159
180
 
160
181
  out = [
161
- f"# WCAG 2.2 Accessibility Audit Report",
182
+ "# WCAG 2.2 Accessibility Audit Report",
162
183
  f"**Target:** `{target}`",
163
184
  f"**Elements Scanned:** {stats['elements_scanned']}",
164
185
  f"**Violations Found:** {stats['violations_found']}",
@@ -28,7 +28,6 @@ import html as html_lib
28
28
  import argparse
29
29
  import webbrowser
30
30
  from datetime import datetime
31
- from pathlib import Path
32
31
  from typing import Dict, Any, Optional
33
32
 
34
33
  # Enforce UTF-8 stdout encoding for Windows console compatibility
@@ -48,7 +47,7 @@ def get_hub_metadata() -> Dict[str, Any]:
48
47
  """Retrieves version and catalog count from skills_manifest.json."""
49
48
  manifest_path = os.path.join(HUB_ROOT, "skills_manifest.json")
50
49
  meta = {
51
- "version": "2.7.0",
50
+ "version": "3.0.1",
52
51
  "totalSkills": 42,
53
52
  "author": "Thế Vị (@TeeVee998)",
54
53
  "repo": "https://github.com/TeeVee998/Synapse-Hub"
@@ -80,10 +79,10 @@ def generate_welcome_html(target_repo: Optional[str] = None, stack_info: Optiona
80
79
  """Renders the standalone interactive HTML5 landing page with bilingual language switcher."""
81
80
  meta = get_hub_metadata()
82
81
  now_str = datetime.now().strftime("%Y-%m-%d %H:%M")
83
-
82
+
84
83
  is_external_target = bool(target_repo and not is_hub_repo(target_repo) and stack_info)
85
84
  if is_external_target:
86
- raw_target_name = (stack_info.get("name") if stack_info else "") or os.path.basename(os.path.abspath(target_repo))
85
+ raw_target_name = (stack_info.get("name") if stack_info else "") or os.path.basename(os.path.abspath(target_repo or ""))
87
86
  raw_framework = (stack_info.get("framework") if stack_info else "") or "Automated QA"
88
87
  target_name = html_lib.escape(str(raw_target_name))
89
88
  framework_name = html_lib.escape(str(raw_framework))
@@ -248,7 +247,7 @@ def generate_welcome_page(target_repo: Optional[str] = None, output_path: Option
248
247
  if open_browser:
249
248
  opened = open_welcome_page(out_file)
250
249
  if opened:
251
- print(f" 🚀 Đã mở Visual Landing Page trong trình duyệt của bạn.")
250
+ print(" 🚀 Đã mở Visual Landing Page trong trình duyệt của bạn.")
252
251
  return out_file
253
252
 
254
253
 
@@ -284,7 +283,7 @@ def main():
284
283
  mark_first_run_completed(target_dir)
285
284
 
286
285
  print(f"✅ Landing page generated successfully at:\n file://{out_path}")
287
- print(f"👉 You can re-open it anytime with: npx synapse-hub welcome")
286
+ print("👉 You can re-open it anytime with: npx synapse-hub welcome")
288
287
 
289
288
 
290
289
  if __name__ == "__main__":