@teevee98/synapse-hub 4.1.2 → 4.1.4

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 (122) hide show
  1. package/.agents/skills/01-web-automation/clean-pom-crafter/examples/standard_test_case.groovy +3 -0
  2. package/.agents/skills/01-web-automation/clean-pom-crafter/references/pom_patterns.groovy +3 -0
  3. package/.agents/skills/01-web-automation/e2e-testing-patterns/examples/playwright_sharded_config.ts +3 -0
  4. package/.agents/skills/01-web-automation/playwright-webapp-testing/examples/server_lifecycle_playwright.py +3 -0
  5. package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +3 -0
  6. package/.agents/skills/05-security-and-compliance/security-dast-sentinel/references/dast_recipes.ts +3 -0
  7. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +3 -0
  8. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +3 -0
  9. package/.agents/skills/11-ai-and-prompting/qa-aci-interface/examples/surgical_code_window_walkthrough.md +1 -1
  10. package/README.en.md +2 -2
  11. package/README.md +2 -2
  12. package/agentskills.json +1 -1
  13. package/docs/ARCHITECTURE.en.md +1 -1
  14. package/docs/ARCHITECTURE.md +1 -1
  15. package/docs/PERFORMANCE_AUDIT_REPORT.md +2 -2
  16. package/package.json +1 -1
  17. package/plugin.json +1 -1
  18. package/scripts/generate_skill_examples.py +3 -0
  19. package/scripts/package_dist.py +3 -0
  20. package/skills_manifest.json +1 -1
  21. package/synapse.config.json +1 -1
  22. package/tools/.infer_baseline.json +3 -796
  23. package/tools/__init__.py +4 -1
  24. package/tools/agent_canary.py +3 -0
  25. package/tools/analyze_project.py +3 -0
  26. package/tools/api_drift_sentinel.py +3 -0
  27. package/tools/api_fuzzer.py +3 -0
  28. package/tools/ast_cache.py +4 -2
  29. package/tools/author_integrity.py +53 -1
  30. package/tools/auto_heal.py +7 -2
  31. package/tools/autogen_qa_broker.py +14 -15
  32. package/tools/benchmark_swarm_context.py +10 -2
  33. package/tools/browser_helpers.js +2 -2
  34. package/tools/bug_reporter.py +3 -0
  35. package/tools/build_consolidated_report.py +3 -0
  36. package/tools/bump_version.py +4 -1
  37. package/tools/cache_resolver.py +7 -3
  38. package/tools/check_env.py +3 -0
  39. package/tools/check_version_sync.py +3 -0
  40. package/tools/ci_healing_hook.py +3 -0
  41. package/tools/cli.py +10 -7
  42. package/tools/config_decoupler.py +3 -0
  43. package/tools/core/__init__.py +3 -0
  44. package/tools/core/file_lock.py +23 -14
  45. package/tools/core/i18n.py +9 -7
  46. package/tools/core/memory_bus.py +6 -3
  47. package/tools/core/process_supervisor.py +28 -18
  48. package/tools/core/token_estimator.py +55 -18
  49. package/tools/count_tokens.py +11 -7
  50. package/tools/create_mock_docx.py +3 -0
  51. package/tools/dashboard_generator.py +17 -15
  52. package/tools/db_sandbox.py +4 -1
  53. package/tools/debt_harvester.py +2 -2
  54. package/tools/diagram_architect.py +3 -0
  55. package/tools/distill_log.py +119 -26
  56. package/tools/e2e_flow_prober.py +3 -0
  57. package/tools/export_postman_collection.py +3 -0
  58. package/tools/flaky_detector.py +3 -0
  59. package/tools/fsm_enforcer.py +2 -2
  60. package/tools/fuzz_payloads.py +3 -0
  61. package/tools/generate_allure_report.py +3 -0
  62. package/tools/generate_api_matrix.py +3 -0
  63. package/tools/generate_jmx_plan.py +3 -0
  64. package/tools/generate_tc_from_story.py +3 -0
  65. package/tools/generate_test_reports.py +3 -0
  66. package/tools/git_pre_commit_guard.py +13 -3
  67. package/tools/git_worktree_manager.py +3 -0
  68. package/tools/heal/__init__.py +3 -0
  69. package/tools/heal_pr_automator.py +3 -0
  70. package/tools/heuristic_locator_matcher.py +3 -0
  71. package/tools/hub_publisher.py +3 -3
  72. package/tools/infer_linter.py +19 -9
  73. package/tools/init_config.py +6 -9
  74. package/tools/jtl_analyzer.py +3 -0
  75. package/tools/lint/__init__.py +3 -0
  76. package/tools/lint_ai_docs.py +3 -0
  77. package/tools/lookup_tc.py +3 -0
  78. package/tools/lookup_xpath.py +3 -0
  79. package/tools/matrix_sharder.py +3 -0
  80. package/tools/mcp/__init__.py +3 -0
  81. package/tools/mcp_docx_server.py +1 -1
  82. package/tools/mcp_excel_server.py +4 -1
  83. package/tools/mcp_server.py +4 -1
  84. package/tools/md_to_xlsx.py +3 -0
  85. package/tools/mechanical_ui_gate.py +3 -0
  86. package/tools/micro_mutator.py +9 -5
  87. package/tools/network_mock_shield.py +3 -0
  88. package/tools/newman_analyzer.py +3 -0
  89. package/tools/omni_emitter.py +3 -0
  90. package/tools/omni_parser.py +3 -0
  91. package/tools/omni_transpiler.py +3 -0
  92. package/tools/output_formatter.py +3 -0
  93. package/tools/package_release.py +6 -6
  94. package/tools/pairwise_generator.py +3 -0
  95. package/tools/pentest_scope_guard.py +2 -2
  96. package/tools/perf/__init__.py +3 -0
  97. package/tools/pinpoint_failure.py +3 -0
  98. package/tools/project_state.py +3 -0
  99. package/tools/repo_map.py +3 -0
  100. package/tools/report/__init__.py +3 -0
  101. package/tools/rules_router.py +42 -10
  102. package/tools/runaway_stopper.py +3 -0
  103. package/tools/safety_firewall.py +3 -0
  104. package/tools/setup_project.py +9 -4
  105. package/tools/skill_collision_guard.py +2 -2
  106. package/tools/skillspector.py +2 -1
  107. package/tools/smart_visual_masker.py +3 -0
  108. package/tools/telemetry_correlator.py +3 -0
  109. package/tools/template_excel_exporter.py +2 -2
  110. package/tools/test_impact.py +3 -0
  111. package/tools/trace_data_flow.py +3 -0
  112. package/tools/traffic_session_converter.py +3 -0
  113. package/tools/ui_server.py +2 -2
  114. package/tools/universal_ir.py +3 -0
  115. package/tools/update_sentinel.py +15 -9
  116. package/tools/validate_groovy_scripts.py +3 -0
  117. package/tools/verify_all.py +27 -20
  118. package/tools/visual_diff_canvas.py +3 -0
  119. package/tools/visual_som_helper.py +3 -0
  120. package/tools/watch_mode.py +4 -4
  121. package/tools/wcag_audit.py +3 -0
  122. package/tools/welcome_page.py +1 -1
@@ -55,27 +55,28 @@ for stream in (sys.stdout, sys.stderr):
55
55
  pass
56
56
 
57
57
 
58
- def safe_print(text="", stream=sys.stdout):
58
+ def safe_print(text="", stream=None):
59
59
  """Safely prints text to the given stream, handling BlockingIOError or encoding issues."""
60
+ target_stream = stream if stream is not None else sys.stdout
60
61
  try:
61
62
  if text:
62
- stream.write(f"{text}\n")
63
+ target_stream.write(f"{text}\n")
63
64
  else:
64
- stream.write("\n")
65
- stream.flush()
65
+ target_stream.write("\n")
66
+ target_stream.flush()
66
67
  except BlockingIOError:
67
68
  try:
68
- if hasattr(stream, 'fileno'):
69
- os.set_blocking(stream.fileno(), True)
70
- stream.write(f"{text}\n")
71
- stream.flush()
72
- except OSError as err:
73
- _ = err
69
+ if hasattr(target_stream, 'fileno'):
70
+ os.set_blocking(target_stream.fileno(), True)
71
+ target_stream.write(f"{text}\n")
72
+ target_stream.flush()
73
+ except OSError: # synapse-ignore: SWALLOWED_EXCEPTION
74
+ pass
74
75
  except Exception:
75
76
  try:
76
- print(text)
77
- except Exception as fallback_err:
78
- _ = fallback_err
77
+ sys.stderr.write(f"{text}\n")
78
+ except Exception: # synapse-ignore: SWALLOWED_EXCEPTION
79
+ pass
79
80
 
80
81
  BOM_EXTENSIONS = (
81
82
  ".groovy", ".tc", ".ts", ".glbl", ".md", ".py", ".json", ".ps1",
@@ -90,8 +91,7 @@ REPO_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, ".."))
90
91
  FORBIDDEN_PATH_PATTERNS = [
91
92
  (re.compile(r'file:///[a-zA-Z]:', re.IGNORECASE), "Machine file URI (file:///...)"),
92
93
  (re.compile(r'\b[a-zA-Z]:\\Users\\[a-zA-Z0-9_\-]+\\', re.IGNORECASE), "Windows User directory path"),
93
- (re.compile(r'\b/Users/[a-zA-Z0-9_\-]+/', re.IGNORECASE), "macOS/Unix User directory path"),
94
- (re.compile(r'\b/home/[a-zA-Z0-9_\-]+/', re.IGNORECASE), "Linux User home directory path"),
94
+ (re.compile(r'(?:^|[\s"\'`\(\[\{</])/(?:Users|home)/[a-zA-Z0-9_\-]+/', re.IGNORECASE), "User home directory path (/Users/ or /home/)"),
95
95
  (re.compile(r'\b[a-zA-Z]:[/\\](?:agent-skills|workspace|jenkins|builds)\b', re.IGNORECASE), "Machine-specific repository path"),
96
96
  (re.compile(r'[/\\\\]legacy_abs_path[/\\\\]', re.IGNORECASE), "Legacy absolute path reference"),
97
97
  ]
@@ -236,7 +236,7 @@ MOJIBAKE_INDICATORS = (
236
236
  def gate_1_bom_check(repo_root, mode="AUTO"):
237
237
  """Gate 1: Verifies 100% UTF-8 encoding with zero Byte Order Mark (BOM) bytes and zero corrupted control characters."""
238
238
  print("\n[GATE 1] Scanning UTF-8 No BOM and Encoding Integrity across repository...")
239
- ignored_dirs = {".git", ".gradle", "node_modules", "allure-results", "graphify-out", "__pycache__", ".pytest_cache", ".ruff_cache", ".mypy_cache", "build", "dist", "claude-ecosystem-repos", "external_repos", "teamwork"}
239
+ ignored_dirs = {".git", ".gradle", "node_modules", "allure-results", "graphify-out", "__pycache__", ".pytest_cache", ".ruff_cache", ".mypy_cache", "build", "dist", "claude-ecosystem-repos", "external_repos", "teamwork", ".synapse", ".sandbox_snapshots"}
240
240
  ignored_files = {"verify_all.py", "test_tools.py"}
241
241
  bom_violations = []
242
242
  mojibake_violations = []
@@ -291,12 +291,12 @@ def gate_2_path_portability(repo_root, mode="AUTO"):
291
291
  ignored_dirs = {
292
292
  ".git", ".gradle", "node_modules", "allure-results", "Screenshots",
293
293
  "Reports", "reports", "TestReports", "testreports", "Libs", ".settings", "graphify-out",
294
- "__pycache__", ".pytest_cache", ".ruff_cache", ".mypy_cache", "agent_qa.egg-info", "dist", "build", "claude-ecosystem-repos", "external_repos", "teamwork"
294
+ "__pycache__", ".pytest_cache", ".ruff_cache", ".mypy_cache", "agent_qa.egg-info", "dist", "build", "claude-ecosystem-repos", "external_repos", "teamwork", ".synapse", ".sandbox_snapshots"
295
295
  }
296
296
  ignored_files = {
297
297
  ".project", ".classpath", ".DS_Store", "memory_cache.db",
298
298
  "verify_all.py", "git_pre_commit_guard.py", "agent_canary.py", "repo_map.txt", "repo_map.json",
299
- "PROJECT_HEALTH_REPORT.md", "PROJECT_STATE.md"
299
+ "PROJECT_HEALTH_REPORT.md", "PROJECT_STATE.md", "AUDIT_REPORT.md"
300
300
  }
301
301
  violations = []
302
302
  for root, dirs, files in os.walk(repo_root):
@@ -374,6 +374,9 @@ def gate_3_clean_pom(repo_root, mode="AUTO"):
374
374
  r'(?:\.(?:click|dblclick|fill|type|press|check|locator|waitForSelector|hover|selectOption)|cy\.(?:get|find)|driver\.find[A-Za-z]*|WebUI\.[a-zA-Z]+)\s*\(\s*[\x22\x27`](?P<sel>[^\x22\x27`]+)[\x22\x27`]'
375
375
  )
376
376
  RAW_XPATH_PATTERN = re.compile(r'[\x22\x27`](?:xpath=|\/{2}[a-zA-Z*@\[])[^\x22\x27`]*[\x22\x27`]')
377
+ SEMANTIC_LOCATOR_PATTERN = re.compile(
378
+ r'(?:page|frame)\.(?:getByRole|getByLabel|getByPlaceholder|getByText|getByTestId|getByAltText|getByTitle)\s*\('
379
+ )
377
380
 
378
381
  violations = []
379
382
  for full_path in sorted(set(test_files)):
@@ -392,6 +395,10 @@ def gate_3_clean_pom(repo_root, mode="AUTO"):
392
395
  if "findTestObject" in line:
393
396
  violations.append((rel_path, line_no, "Raw findTestObject"))
394
397
  continue
398
+ # Check Playwright semantic locators in test script
399
+ if SEMANTIC_LOCATOR_PATTERN.search(stripped):
400
+ violations.append((rel_path, line_no, f"Raw Playwright semantic locator in Test Script: '{stripped}'"))
401
+ continue
395
402
  # Check locator calls taking raw CSS/XPath selectors
396
403
  m = LOCATOR_CALL_PATTERN.search(stripped)
397
404
  if m:
@@ -530,7 +537,7 @@ def gate_6_credential_security(repo_root, mode="AUTO"):
530
537
  ignored_dirs = {
531
538
  ".git", ".gradle", "node_modules", "allure-results", "Screenshots",
532
539
  "Reports", "reports", "TestReports", "testreports", "Libs", ".settings", "graphify-out",
533
- "__pycache__", ".pytest_cache", ".ruff_cache", ".mypy_cache", "agent_qa.egg-info", "dist", "build", "claude-ecosystem-repos", "external_repos", "teamwork"
540
+ "__pycache__", ".pytest_cache", ".ruff_cache", ".mypy_cache", "agent_qa.egg-info", "dist", "build", "claude-ecosystem-repos", "external_repos", "teamwork", ".synapse", ".sandbox_snapshots"
534
541
  }
535
542
 
536
543
  for root, dirs, files in os.walk(repo_root):
@@ -890,7 +897,7 @@ def gate_7_infer_linter(repo_root, mode="AUTO"):
890
897
  else:
891
898
  safe_print("[PASS] Hub Mode Regression Test Suite: Verified via active parent test runner.")
892
899
 
893
- test_dirs = ["tests"] if effective_mode == "HUB" else ["Scripts", "tests", "test", "e2e", "specs", "cypress"]
900
+ test_dirs = ["examples"] if effective_mode == "HUB" else ["Scripts", "tests", "test", "e2e", "specs", "cypress"]
894
901
  has_tests = False
895
902
  target_scan_dir = None
896
903
  for td in test_dirs:
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env python3
2
+ # SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
3
+ # SPDX-License-Identifier: MIT
4
+
2
5
  # -*- coding: utf-8 -*-
3
6
  """
4
7
  Enterprise Canvas Visual Diff & Regression Checker
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env python3
2
+ # SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
3
+ # SPDX-License-Identifier: MIT
4
+
2
5
  """
3
6
  Enterprise Vision-Grounded Fallback & Set-of-Marks (SoM) Engine
4
7
  --------------------------------------------------------------
@@ -46,19 +46,19 @@ IGNORED_DIRS = {
46
46
  ".git", ".gradle", "node_modules", "allure-results", "Screenshots",
47
47
  "Reports", "reports", "TestReports", "testreports", "bin", "Libs", ".settings",
48
48
  "graphify-out", "__pycache__", "agent_qa.egg-info", "dist", "build", ".pytest_cache",
49
- "claude-ecosystem-repos", "external_repos", "teamwork"
49
+ "claude-ecosystem-repos", "external_repos", "teamwork", ".synapse", ".sandbox_snapshots"
50
50
  }
51
51
 
52
52
  IGNORED_FILES = {
53
53
  ".project", ".classpath", ".DS_Store", "memory_cache.db",
54
54
  "verify_all.py", "git_pre_commit_guard.py", "agent_canary.py", "watch_mode.py",
55
- "repo_map.txt", "repo_map.json", "PROJECT_HEALTH_REPORT.md", "PROJECT_STATE.md"
55
+ "repo_map.txt", "repo_map.json", "PROJECT_HEALTH_REPORT.md", "PROJECT_STATE.md", "AUDIT_REPORT.md"
56
56
  }
57
57
 
58
58
  FORBIDDEN_PATH_PATTERNS = [
59
59
  (re.compile(r'file:///[a-zA-Z]:', re.IGNORECASE), "Machine file URI (file:///...)"),
60
60
  (re.compile(r'\b[a-zA-Z]:\\Users\\[a-zA-Z0-9_\-]+\\', re.IGNORECASE), "Windows User directory path"),
61
- (re.compile(r'\b/Users/[a-zA-Z0-9_\-]+/', re.IGNORECASE), "macOS/Unix User directory path"),
61
+ (re.compile(r'(?:^|[\s"\'`\(\[\{</])/(?:Users|home)/[a-zA-Z0-9_\-]+/', re.IGNORECASE), "User home directory path (/Users/ or /home/)"),
62
62
  ]
63
63
 
64
64
  # ANSI colors
@@ -263,7 +263,7 @@ def watch_directory(target_dir: str, debounce: float = 0.8, run_once: bool = Fal
263
263
 
264
264
  try:
265
265
  while True:
266
- time.sleep(debounce)
266
+ time.sleep(debounce) # synapse-ignore: HARD_DELAY_ANTI_PATTERN
267
267
  current_states = scan_file_states(target_dir)
268
268
  changed_files = []
269
269
 
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env python3
2
+ # SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
3
+ # SPDX-License-Identifier: MIT
4
+
2
5
  """
3
6
  tools/wcag_audit.py - Automated Accessibility (WCAG 2.2) Linter & Auditor
4
7
  Operationalizes the .agents/skills/05-security-and-compliance/wcag-audit-patterns skill for Web & Enterprise Applications.
@@ -47,7 +47,7 @@ def get_hub_metadata() -> Dict[str, Any]:
47
47
  """Retrieves version and catalog count from skills_manifest.json."""
48
48
  manifest_path = os.path.join(HUB_ROOT, "skills_manifest.json")
49
49
  meta = {
50
- "version": "4.1.2",
50
+ "version": "4.1.4",
51
51
  "totalSkills": 42,
52
52
  "author": "Thế Vị (@TeeVee98)",
53
53
  "repo": "https://github.com/TeeVee98/Synapse-Hub"