@teevee98/synapse-hub 4.2.0 → 4.2.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.
Files changed (109) hide show
  1. package/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +46 -2
  2. package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +49 -4
  3. package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +56 -66
  4. package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +48 -3
  5. package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +56 -11
  6. package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +49 -7
  7. package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +54 -11
  8. package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +48 -90
  9. package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +53 -10
  10. package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +44 -3
  11. package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +49 -8
  12. package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +49 -8
  13. package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +49 -7
  14. package/.agents/skills/02-test-design/review-spec/SKILL.md +46 -5
  15. package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +44 -3
  16. package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +50 -4
  17. package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +47 -6
  18. package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +79 -34
  19. package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +47 -4
  20. package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +46 -5
  21. package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +44 -2
  22. package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +57 -13
  23. package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +45 -4
  24. package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +48 -3
  25. package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +45 -4
  26. package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +47 -5
  27. package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +48 -7
  28. package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +54 -23
  29. package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +46 -5
  30. package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +50 -9
  31. package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +52 -11
  32. package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +52 -11
  33. package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +47 -4
  34. package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +50 -4
  35. package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +47 -3
  36. package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +52 -4
  37. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +51 -10
  38. package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +78 -34
  39. package/.agents/skills/08-code-quality/graphify-impact-analyzer/examples/dependency_blast_radius.json +3 -4
  40. package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +49 -9
  41. package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +45 -5
  42. package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +48 -6
  43. package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +49 -9
  44. package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +47 -4
  45. package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +48 -16
  46. package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +2 -1
  47. package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +44 -3
  48. package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +47 -6
  49. package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +44 -3
  50. package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +52 -12
  51. package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +45 -4
  52. package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +51 -9
  53. package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +44 -3
  54. package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +44 -3
  55. package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +49 -8
  56. package/.cursor/rules/synapse-qa.mdc +20 -7
  57. package/.cursorrules +19 -5
  58. package/.windsurfrules +18 -3
  59. package/AGENTS.md +51 -65
  60. package/CLAUDE.md +38 -24
  61. package/README.en.md +2 -2
  62. package/README.md +2 -2
  63. package/agentskills.json +1 -1
  64. package/docs/ARCHITECTURE.en.md +1 -1
  65. package/docs/ARCHITECTURE.md +1 -1
  66. package/docs/CLIENT_SUPPORT_MATRIX.md +44 -0
  67. package/docs/SIDE_EFFECTING_TOOLS_INVENTORY.md +233 -0
  68. package/package.json +1 -1
  69. package/plugin.json +1 -1
  70. package/skills_manifest.json +1 -1
  71. package/synapse.config.json +1 -1
  72. package/templates/ai_bridges/CLAUDE.md +29 -26
  73. package/templates/ai_bridges/copilot-instructions.md +14 -5
  74. package/templates/ai_bridges/cursor_synapse_qa.mdc +16 -7
  75. package/templates/ai_bridges/windsurfrules +14 -3
  76. package/tools/TOOLS_RUNBOOK.md +1 -1
  77. package/tools/__init__.py +1 -1
  78. package/tools/api_fuzzer.py +295 -41
  79. package/tools/benchmark_swarm_context.py +11 -4
  80. package/tools/browser_helpers.js +2 -2
  81. package/tools/bump_version.py +2 -2
  82. package/tools/cli.py +4 -4
  83. package/tools/core/bm25_retriever.py +1 -1
  84. package/tools/core/i18n.py +1 -1
  85. package/tools/core/provider_usage_adapter.py +66 -0
  86. package/tools/core/token_estimator.py +39 -1
  87. package/tools/count_tokens.py +2 -2
  88. package/tools/dashboard_generator.py +8 -8
  89. package/tools/db_sandbox.py +182 -43
  90. package/tools/distill_log.py +1 -1
  91. package/tools/distill_skill.py +17 -2
  92. package/tools/git_pre_commit_guard.py +190 -1
  93. package/tools/hub_publisher.py +2 -12
  94. package/tools/mcp_docx_server.py +1 -1
  95. package/tools/mcp_excel_server.py +1 -1
  96. package/tools/mcp_server.py +33 -5
  97. package/tools/micro_mutator.py +30 -1
  98. package/tools/pentest_scope_guard.py +288 -15
  99. package/tools/project_state.py +29 -5
  100. package/tools/reversible_sandbox.py +58 -13
  101. package/tools/rules_router.py +80 -27
  102. package/tools/skill_canonical_digest.py +60 -2
  103. package/tools/sync_agent_rules.py +187 -61
  104. package/tools/task_memory_manager.py +16 -1
  105. package/tools/ui_server.py +3 -1
  106. package/tools/update_sentinel.py +3 -3
  107. package/tools/validate_skills_schema.py +349 -56
  108. package/tools/verify_all.py +98 -4
  109. package/tools/welcome_page.py +1 -1
@@ -671,7 +671,7 @@ def gate_6_credential_security(repo_root, mode="AUTO"):
671
671
  rel_path = os.path.relpath(full_path, repo_root)
672
672
 
673
673
  # Skip self scanning of pattern definitions in verify_all.py or scanner tests
674
- if rel_path in ("tools\\verify_all.py", "tools/verify_all.py", "tests\\test_tools.py", "tests/test_tools.py"):
674
+ if rel_path in ("tools\\verify_all.py", "tools/verify_all.py", "tests\\test_tools.py", "tests/test_tools.py", "tests\\test_git_pre_commit_guard.py", "tests/test_git_pre_commit_guard.py"):
675
675
  continue
676
676
 
677
677
  try:
@@ -717,7 +717,7 @@ def check_python_ast_integrity(repo_root):
717
717
  ignored = {'.git', 'node_modules', '__pycache__', '.venv', 'venv', 'claude-ecosystem-repos', 'build', 'dist', '.gradle', 'external_repos', 'teamwork'}
718
718
 
719
719
  for root, dirs, files in os.walk(repo_root):
720
- dirs[:] = [d for d in dirs if d not in ignored]
720
+ dirs[:] = [d for d in dirs if d not in ignored and not d.startswith('synapse_hub-')]
721
721
  for f in files:
722
722
  if f.endswith('.py'):
723
723
  py_files.append(os.path.join(root, f))
@@ -757,6 +757,8 @@ def check_python_ast_integrity(repo_root):
757
757
  with open(file_path, 'r', encoding='utf-8', errors='ignore') as fp:
758
758
  content = fp.read()
759
759
  tree = ast.parse(content, file_path)
760
+ except (FileNotFoundError, OSError):
761
+ continue
760
762
  except SyntaxError as e:
761
763
  syntax_viol = (rel_path, e.lineno or 1, f"SyntaxError: {e.msg}")
762
764
  violations.append(syntax_viol)
@@ -931,6 +933,30 @@ def check_python_ast_integrity(repo_root):
931
933
  return violations
932
934
 
933
935
 
936
+ def has_python_sources(repo_root: str) -> bool:
937
+ """Fast O(1) check if repository contains any Python source files, pruning heavy directories."""
938
+ candidate_dirs = [".", "tests", "test", "pages", "src", "Scripts", "features", "step_definitions"]
939
+ for cd in candidate_dirs:
940
+ target = os.path.join(repo_root, cd) if cd != "." else repo_root
941
+ if os.path.isdir(target):
942
+ try:
943
+ for entry in os.scandir(target):
944
+ if entry.is_file(follow_symlinks=False) and entry.name.endswith(".py"):
945
+ return True
946
+ except OSError:
947
+ continue
948
+
949
+ ignored = {".git", "node_modules", ".venv", "venv", "build", "dist", ".gradle", "target", "__pycache__"}
950
+ try:
951
+ for root, dirs, files in os.walk(repo_root):
952
+ dirs[:] = [d for d in dirs if d not in ignored]
953
+ if any(f.endswith(".py") for f in files):
954
+ return True
955
+ except OSError:
956
+ return False
957
+ return False
958
+
959
+
934
960
  def gate_7_infer_linter(repo_root, mode="AUTO"):
935
961
  """Gate 7: Runs Meta Infer-style static defect sentinel catching fake passes, 0 assert, and sleeps."""
936
962
  print("\n[GATE 7] Running Meta Infer-Style Static Defect & Fake-Pass Sentinel...")
@@ -945,8 +971,76 @@ def gate_7_infer_linter(repo_root, mode="AUTO"):
945
971
  return False
946
972
  print("[PASS] 100% Python AST integrity verified (zero syntax errors, zero undefined variables).")
947
973
 
974
+ # Ruff Linter & Code Quality Sentinel (Hub vs Target Adaptive Policy)
975
+ if effective_mode == "HUB":
976
+ # Ruff Linter & Code Quality Sentinel for Synapse Hub codebase
977
+ ruff_targets = [d for d in ["tools", "tests", "scripts"] if os.path.isdir(os.path.join(repo_root, d))]
978
+ if ruff_targets:
979
+ try:
980
+ res_ruff = subprocess.run(
981
+ [sys.executable, "-m", "ruff", "check"] + ruff_targets,
982
+ cwd=repo_root,
983
+ capture_output=True,
984
+ text=True,
985
+ timeout=45.0,
986
+ )
987
+ if res_ruff.returncode == 0:
988
+ print(f"[PASS] 100% Ruff clean: zero linting defects across {', '.join(ruff_targets)}.")
989
+ elif "No module named ruff" in (res_ruff.stderr or ""):
990
+ print("[INFO] Ruff not installed in current environment, skipping ruff check.")
991
+ else:
992
+ print(f"[FAIL] Ruff linter detected violations across {', '.join(ruff_targets)}:")
993
+ safe_print(res_ruff.stdout or res_ruff.stderr)
994
+ return False
995
+ except (subprocess.SubprocessError, FileNotFoundError, OSError) as err:
996
+ print(f"[WARN] Ruff execution skipped: {err}")
997
+ else:
998
+ # TARGET mode: Adaptive Ruff Sentinel for Target Project Python files
999
+ if has_python_sources(repo_root):
1000
+ try:
1001
+ has_own_config = (
1002
+ os.path.isfile(os.path.join(repo_root, "ruff.toml"))
1003
+ or os.path.isfile(os.path.join(repo_root, ".ruff.toml"))
1004
+ or (
1005
+ os.path.isfile(os.path.join(repo_root, "pyproject.toml"))
1006
+ and "[tool.ruff" in open(os.path.join(repo_root, "pyproject.toml"), "r", encoding="utf-8", errors="ignore").read()
1007
+ )
1008
+ )
1009
+
1010
+ if has_own_config:
1011
+ ruff_cmd = [sys.executable, "-m", "ruff", "check", repo_root]
1012
+ else:
1013
+ ruff_cmd = [
1014
+ sys.executable, "-m", "ruff", "check",
1015
+ "--select", "E,F",
1016
+ "--ignore", "E501,E731,E741,F841",
1017
+ "--exclude", ".git,.venv,venv,node_modules,build,dist,__pycache__,reports,Reports,Screenshots",
1018
+ repo_root,
1019
+ ]
1020
+
1021
+ res_ruff = subprocess.run(
1022
+ ruff_cmd,
1023
+ cwd=repo_root,
1024
+ capture_output=True,
1025
+ text=True,
1026
+ timeout=45.0,
1027
+ )
1028
+ if res_ruff.returncode == 0:
1029
+ print("[PASS] 100% Target Python code verified clean via Ruff (zero syntax or critical defects).")
1030
+ elif "No module named ruff" in (res_ruff.stderr or ""):
1031
+ print("[INFO] Ruff not installed in target environment, skipping ruff check.")
1032
+ else:
1033
+ print("[FAIL] Ruff linter detected defects in target Python project:")
1034
+ safe_print(res_ruff.stdout or res_ruff.stderr)
1035
+ return False
1036
+ except (subprocess.SubprocessError, FileNotFoundError, OSError) as err:
1037
+ print(f"[WARN] Target Ruff execution skipped: {err}")
1038
+ else:
1039
+ print("[PASS] Non-Python target stack: zero Python files detected (Ruff skipped).")
1040
+
948
1041
  # In HUB mode: dogfood tools/ with baseline to prevent new unbaselined defects
949
1042
  if effective_mode == "HUB":
1043
+
950
1044
  baseline_file = os.path.join(repo_root, "tools", ".infer_baseline.json")
951
1045
  infer_script = os.path.join(repo_root, "tools", "infer_linter.py")
952
1046
  if os.path.exists(baseline_file) and os.path.exists(infer_script):
@@ -1002,7 +1096,7 @@ def gate_7_infer_linter(repo_root, mode="AUTO"):
1002
1096
  text=True,
1003
1097
  encoding="utf-8",
1004
1098
  errors="replace",
1005
- timeout=240.0,
1099
+ timeout=360.0,
1006
1100
  env=env
1007
1101
  )
1008
1102
  combined_output = (test_res.stdout or "") + "\n" + (test_res.stderr or "")
@@ -1028,7 +1122,7 @@ def gate_7_infer_linter(repo_root, mode="AUTO"):
1028
1122
  metrics_desc = ", ".join(summary_parts)
1029
1123
  safe_print(f"[PASS] Hub regression test suite passed: {metrics_desc} in {metrics['duration_seconds']:.2f}s (Git commit: {commit_sha}).")
1030
1124
  except subprocess.TimeoutExpired:
1031
- safe_print("[FAIL] Gate 7 Hub Regression Test Suite timed out after 240s!")
1125
+ safe_print("[FAIL] Gate 7 Hub Regression Test Suite timed out after 360s!")
1032
1126
  return False
1033
1127
  except (OSError, subprocess.SubprocessError) as err:
1034
1128
  safe_print(f"[FAIL] Gate 7 Failed to run test suite: {err}")
@@ -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.2.0",
50
+ "version": "4.2.2",
51
51
  "totalSkills": 53,
52
52
  "author": "Thế Vị (@TeeVee98)",
53
53
  "repo": "https://github.com/TeeVee98/Synapse-Hub"