@teevee98/synapse-hub 4.1.4 → 4.2.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 (133) hide show
  1. package/.agents/rules/git-push-protocol.md +2 -2
  2. package/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +52 -3
  3. package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +55 -5
  4. package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +62 -67
  5. package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +54 -4
  6. package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +62 -12
  7. package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +55 -8
  8. package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +60 -12
  9. package/.agents/skills/01-web-automation/mobile-appium-som/examples/BaseScreen.java +2 -2
  10. package/.agents/skills/01-web-automation/mobile-appium-som/examples/LoginScreen.java +2 -2
  11. package/.agents/skills/01-web-automation/mobile-appium-som/examples/TC_MobileLogin.java +2 -2
  12. package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +54 -91
  13. package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +59 -11
  14. package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +50 -4
  15. package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +55 -9
  16. package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +55 -9
  17. package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +55 -8
  18. package/.agents/skills/02-test-design/review-spec/SKILL.md +50 -6
  19. package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +50 -4
  20. package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +56 -5
  21. package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +53 -7
  22. package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +86 -36
  23. package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +54 -6
  24. package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +50 -6
  25. package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +50 -3
  26. package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +63 -14
  27. package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +51 -5
  28. package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +54 -4
  29. package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +51 -5
  30. package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +53 -6
  31. package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +54 -8
  32. package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +60 -24
  33. package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +52 -6
  34. package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +56 -10
  35. package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +58 -12
  36. package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +58 -12
  37. package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +53 -5
  38. package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +56 -5
  39. package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +53 -4
  40. package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +58 -5
  41. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +57 -11
  42. package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +83 -34
  43. package/.agents/skills/08-code-quality/graphify-impact-analyzer/examples/dependency_blast_radius.json +3 -4
  44. package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +55 -10
  45. package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +49 -6
  46. package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +52 -7
  47. package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +55 -10
  48. package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +51 -5
  49. package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +54 -17
  50. package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +2 -1
  51. package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +50 -4
  52. package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +53 -7
  53. package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +50 -4
  54. package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +58 -13
  55. package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +51 -5
  56. package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +57 -10
  57. package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +50 -4
  58. package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +50 -4
  59. package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +55 -9
  60. package/.cursor/rules/synapse-qa.mdc +20 -7
  61. package/.cursorrules +19 -5
  62. package/.windsurfrules +18 -3
  63. package/AGENTS.md +51 -59
  64. package/CLAUDE.md +38 -24
  65. package/LICENSE +5 -5
  66. package/NOTICE +1 -1
  67. package/README.en.md +4 -4
  68. package/README.md +4 -4
  69. package/agentskills.json +1 -1
  70. package/docs/ARCHITECTURE.en.md +2 -2
  71. package/docs/ARCHITECTURE.md +11 -2
  72. package/docs/CLIENT_SUPPORT_MATRIX.md +44 -0
  73. package/docs/CLI_REFERENCE.en.md +6 -4
  74. package/docs/CLI_REFERENCE.md +1 -1
  75. package/docs/CONTRIBUTING.en.md +1 -1
  76. package/docs/CONTRIBUTING.md +2 -2
  77. package/docs/SIDE_EFFECTING_TOOLS_INVENTORY.md +233 -0
  78. package/docs/TOOL_CATALOG.md +6 -2
  79. package/docs/research/agent_skill_training_analysis.md +1 -1
  80. package/package.json +1 -1
  81. package/plugin.json +1 -1
  82. package/skills_manifest.json +320 -55
  83. package/synapse.config.json +1 -1
  84. package/templates/ai_bridges/CLAUDE.md +29 -26
  85. package/templates/ai_bridges/copilot-instructions.md +14 -5
  86. package/templates/ai_bridges/cursor_synapse_qa.mdc +16 -7
  87. package/templates/ai_bridges/windsurfrules +14 -3
  88. package/templates/ui/index.html +2 -2
  89. package/tools/TOOLS_RUNBOOK.md +1 -1
  90. package/tools/TOOL_CATALOG.json +63 -3
  91. package/tools/__init__.py +1 -1
  92. package/tools/api_fuzzer.py +447 -132
  93. package/tools/author_integrity.py +121 -11
  94. package/tools/benchmark_swarm_context.py +130 -22
  95. package/tools/break_ui_generator.py +233 -0
  96. package/tools/browser_helpers.js +2 -2
  97. package/tools/check_version_sync.py +18 -50
  98. package/tools/cli.py +110 -19
  99. package/tools/core/bm25_retriever.py +218 -0
  100. package/tools/core/i18n.py +5 -5
  101. package/tools/core/provider_usage_adapter.py +383 -0
  102. package/tools/core/token_estimator.py +81 -15
  103. package/tools/count_tokens.py +7 -2
  104. package/tools/coverage_reporter.py +245 -0
  105. package/tools/dashboard_generator.py +8 -8
  106. package/tools/db_sandbox.py +290 -9
  107. package/tools/distill_log.py +1 -1
  108. package/tools/distill_skill.py +206 -0
  109. package/tools/git_pre_commit_guard.py +202 -1
  110. package/tools/humanize_linter.py +3 -0
  111. package/tools/mcp_docx_server.py +1 -1
  112. package/tools/mcp_excel_server.py +1 -1
  113. package/tools/mcp_server.py +104 -16
  114. package/tools/micro_mutator.py +114 -15
  115. package/tools/pentest_scope_guard.py +674 -58
  116. package/tools/perf/benchmark_perf_runner.py +42 -0
  117. package/tools/project_state.py +29 -5
  118. package/tools/reversible_sandbox.py +58 -13
  119. package/tools/rules_router.py +473 -60
  120. package/tools/security_scanner.py +80 -0
  121. package/tools/senior_code_review.py +14 -0
  122. package/tools/skill_canonical_digest.py +302 -0
  123. package/tools/skill_profiles.py +77 -7
  124. package/tools/slide_deck_exporter.py +477 -0
  125. package/tools/sync_agent_rules.py +187 -61
  126. package/tools/sync_skills_manifest.py +166 -0
  127. package/tools/task_memory_manager.py +275 -0
  128. package/tools/ui_server.py +3 -1
  129. package/tools/update_sentinel.py +3 -3
  130. package/tools/validate_host_interop.py +485 -0
  131. package/tools/validate_skills_schema.py +575 -0
  132. package/tools/verify_all.py +668 -44
  133. package/tools/welcome_page.py +2 -2
@@ -21,11 +21,15 @@ from __future__ import annotations
21
21
 
22
22
  import os
23
23
  import sys
24
+ import logging
24
25
  import csv
25
26
  import json
26
27
  import time
27
28
  import random
29
+ import platform
28
30
  import argparse
31
+ import subprocess
32
+ from datetime import datetime, timezone
29
33
  from typing import Dict, Any
30
34
 
31
35
  # Enforce UTF-8 stdout encoding for Windows console compatibility
@@ -36,6 +40,8 @@ if hasattr(sys.stdout, "reconfigure"):
36
40
  except Exception:
37
41
  pass
38
42
 
43
+ _logger = logging.getLogger("benchmark_perf_runner")
44
+
39
45
  REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
40
46
  DEFAULT_REPORTS_DIR = os.path.join(REPO_ROOT, "Reports", "perf")
41
47
 
@@ -166,9 +172,43 @@ def run_benchmark(
166
172
  "id": "root"
167
173
  }
168
174
  }
175
+ commit_sha = "unversioned"
176
+ try:
177
+ out = subprocess.check_output(
178
+ ["git", "rev-parse", "HEAD"], cwd=REPO_ROOT, stderr=subprocess.DEVNULL
179
+ )
180
+ commit_sha = out.decode("utf-8").strip()
181
+ except (OSError, subprocess.SubprocessError) as err:
182
+ _logger.debug("Could not determine git commit SHA: %s", err)
183
+ commit_sha = "unversioned"
184
+
185
+ now_iso = datetime.now(timezone.utc).isoformat()
186
+ cmd_str = f"{sys.executable} -m tools.perf.benchmark_perf_runner --iterations {n} --concurrency {concurrency}"
187
+
188
+ metadata = {
189
+ "generated_at": now_iso,
190
+ "commit": commit_sha,
191
+ "command": cmd_str,
192
+ "evaluation_type": "RUN_FRESH_BENCHMARK",
193
+ "is_fresh_measurement": True,
194
+ "fixture_environment": {
195
+ "os": platform.system().lower(),
196
+ "python_version": platform.python_version(),
197
+ "cpu_count": os.cpu_count() or 1,
198
+ "concurrency": concurrency,
199
+ "iterations": n,
200
+ "benchmark_kind": "synthetic_local_microbench"
201
+ }
202
+ }
203
+ k6_data["metadata"] = metadata
204
+
169
205
  with open(k6_path, "w", encoding="utf-8") as f:
170
206
  json.dump(k6_data, f, indent=2)
171
207
 
208
+ meta_path = os.path.join(output_dir, "perf_metadata.json")
209
+ with open(meta_path, "w", encoding="utf-8") as f:
210
+ json.dump(metadata, f, indent=2)
211
+
172
212
  passed_p95 = p95 <= target_sla_p95
173
213
  passed_p99 = p99 <= target_sla_p99
174
214
  passed_err = err_rate <= 1.0
@@ -185,6 +225,8 @@ def run_benchmark(
185
225
  "error_rate_pct": round(err_rate, 2),
186
226
  "jtl_file": jtl_path,
187
227
  "k6_file": k6_path,
228
+ "metadata_file": meta_path,
229
+ "metadata": metadata,
188
230
  "sla_pass": sla_pass
189
231
  }
190
232
 
@@ -36,6 +36,7 @@ def init_state(target_dir, goal="Initial Autonomous Setup"):
36
36
  if os.path.exists(state_file):
37
37
  return state_file
38
38
 
39
+ os.makedirs(os.path.dirname(os.path.abspath(state_file)), exist_ok=True)
39
40
  project_name = os.path.basename(os.path.abspath(target_dir))
40
41
  timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
41
42
 
@@ -166,9 +167,32 @@ def read_state(target_dir):
166
167
 
167
168
  if __name__ == "__main__":
168
169
  if len(sys.argv) > 1 and sys.argv[1] in ("-h", "--help"):
169
- print("Usage: python3 tools/project_state.py [target_dir]")
170
- print("Initializes or verifies the rolling-window PROJECT_STATE.md anchor in target directory.")
170
+ print("Usage: python3 tools/project_state.py [status|init|update] [target_dir]")
171
+ print("Initializes, verifies, or inspects the rolling-window PROJECT_STATE.md anchor.")
171
172
  sys.exit(0)
172
- target = sys.argv[1] if len(sys.argv) > 1 else os.getcwd()
173
- sf = init_state(target)
174
- print(f"Project state anchor initialized at: {sf}")
173
+
174
+ arg1 = sys.argv[1] if len(sys.argv) > 1 else "status"
175
+
176
+ if arg1 == "status":
177
+ target = sys.argv[2] if len(sys.argv) > 2 else os.getcwd()
178
+ state = read_state(target)
179
+ if state is None:
180
+ init_state(target)
181
+ state = read_state(target)
182
+ print(state)
183
+ sys.exit(0)
184
+ elif arg1 == "init":
185
+ target = sys.argv[2] if len(sys.argv) > 2 else os.getcwd()
186
+ sf = init_state(target)
187
+ print(f"Project state anchor initialized at: {sf}")
188
+ sys.exit(0)
189
+ elif arg1 == "update":
190
+ target = sys.argv[2] if len(sys.argv) > 2 else os.getcwd()
191
+ sf = update_state(target)
192
+ print(f"Project state anchor updated at: {sf}")
193
+ sys.exit(0)
194
+ else:
195
+ # Default: treat argument as target_dir
196
+ target = arg1
197
+ sf = init_state(target)
198
+ print(f"Project state anchor initialized at: {sf}")
@@ -33,10 +33,16 @@ import atexit
33
33
  import signal
34
34
  import weakref
35
35
  import threading
36
+ import tempfile
36
37
  import subprocess
37
38
  from dataclasses import dataclass, field
38
39
  from typing import List, Optional, Dict, Any
39
40
 
41
+ from pentest_scope_guard import (
42
+ resolve_contained_path,
43
+ PathContainmentError,
44
+ )
45
+
40
46
  # Enforce UTF-8 stdout encoding for Windows console compatibility
41
47
  if hasattr(sys.stdout, 'reconfigure'):
42
48
  try:
@@ -84,10 +90,16 @@ class ReversibleAction:
84
90
  class ExecutionSandbox:
85
91
  """Manages an undo stack of stateful mutations with WAL persistence for guaranteed cleanup."""
86
92
 
87
- def __init__(self, auto_rollback_on_exit: bool = True, wal_path: Optional[str] = None):
93
+ def __init__(
94
+ self,
95
+ auto_rollback_on_exit: bool = True,
96
+ wal_path: Optional[str] = None,
97
+ sandbox_root: Optional[str] = None
98
+ ):
88
99
  self.undo_stack: List[ReversibleAction] = []
89
100
  self.failed_actions: List[ReversibleAction] = []
90
101
  self.auto_rollback_on_exit = auto_rollback_on_exit
102
+ self.sandbox_root = os.path.realpath(os.path.abspath(sandbox_root)) if sandbox_root else None
91
103
  self.wal_path = wal_path if wal_path is not None else _resolve_wal_path()
92
104
  if self.wal_path:
93
105
  try:
@@ -97,6 +109,31 @@ class ExecutionSandbox:
97
109
  self.wal_path = None
98
110
  _ACTIVE_SANDBOXES.add(self)
99
111
 
112
+ def _validate_contained_path(self, target_path: str) -> str:
113
+ """Ensures file or directory path is strictly contained within sandbox roots."""
114
+ if self.sandbox_root:
115
+ return resolve_contained_path(self.sandbox_root, target_path)
116
+
117
+ allowed_roots = [
118
+ os.path.realpath(os.path.abspath(os.getcwd())),
119
+ os.path.realpath(os.path.abspath(QA_HUB_ROOT)),
120
+ os.path.realpath(os.path.abspath(tempfile.gettempdir())),
121
+ ]
122
+
123
+ contained = None
124
+ last_err = None
125
+ for root in allowed_roots:
126
+ try:
127
+ contained = resolve_contained_path(root, target_path)
128
+ break
129
+ except PathContainmentError as pce:
130
+ last_err = pce
131
+ continue
132
+
133
+ if contained is None:
134
+ raise last_err or PathContainmentError(f"Path '{target_path}' escapes sandbox root containment.")
135
+ return contained
136
+
100
137
  def _append_wal(self, action: ReversibleAction):
101
138
  """Persists a pending undo action to disk before side-effects complete."""
102
139
  if not self.wal_path:
@@ -233,21 +270,29 @@ class ExecutionSandbox:
233
270
 
234
271
  if cmd.startswith("FILE_DELETE:"):
235
272
  fpath = cmd.split(":", 1)[1].strip()
236
- if os.path.exists(fpath):
237
- try:
238
- os.remove(fpath)
239
- except OSError as e:
240
- success = False
241
- err_msg = str(e)
273
+ try:
274
+ contained_fpath = self._validate_contained_path(fpath)
275
+ if os.path.exists(contained_fpath):
276
+ os.remove(contained_fpath)
277
+ except PathContainmentError as pce:
278
+ success = False
279
+ err_msg = str(pce)
280
+ except OSError as e:
281
+ success = False
282
+ err_msg = str(e)
242
283
  elif cmd.startswith("DIR_DELETE:"):
243
284
  dpath = cmd.split(":", 1)[1].strip()
244
- if os.path.isdir(dpath):
245
- try:
285
+ try:
286
+ contained_dpath = self._validate_contained_path(dpath)
287
+ if os.path.isdir(contained_dpath):
246
288
  import shutil
247
- shutil.rmtree(dpath, ignore_errors=True)
248
- except Exception as e:
249
- success = False
250
- err_msg = str(e)
289
+ shutil.rmtree(contained_dpath, ignore_errors=True)
290
+ except PathContainmentError as pce:
291
+ success = False
292
+ err_msg = str(pce)
293
+ except Exception as e:
294
+ success = False
295
+ err_msg = str(e)
251
296
  elif cmd in ("NOOP", ":"):
252
297
  success = True
253
298
  elif cmd: