@teevee98/synapse-hub 4.1.3 → 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 (121) 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/browser_helpers.js +2 -2
  33. package/tools/bug_reporter.py +3 -0
  34. package/tools/build_consolidated_report.py +3 -0
  35. package/tools/bump_version.py +4 -1
  36. package/tools/cache_resolver.py +7 -3
  37. package/tools/check_env.py +3 -0
  38. package/tools/check_version_sync.py +3 -0
  39. package/tools/ci_healing_hook.py +3 -0
  40. package/tools/cli.py +10 -7
  41. package/tools/config_decoupler.py +3 -0
  42. package/tools/core/__init__.py +3 -0
  43. package/tools/core/file_lock.py +23 -14
  44. package/tools/core/i18n.py +9 -7
  45. package/tools/core/memory_bus.py +6 -3
  46. package/tools/core/process_supervisor.py +28 -18
  47. package/tools/core/token_estimator.py +55 -18
  48. package/tools/count_tokens.py +11 -7
  49. package/tools/create_mock_docx.py +3 -0
  50. package/tools/dashboard_generator.py +17 -15
  51. package/tools/db_sandbox.py +4 -1
  52. package/tools/debt_harvester.py +2 -2
  53. package/tools/diagram_architect.py +3 -0
  54. package/tools/distill_log.py +22 -2
  55. package/tools/e2e_flow_prober.py +3 -0
  56. package/tools/export_postman_collection.py +3 -0
  57. package/tools/flaky_detector.py +3 -0
  58. package/tools/fsm_enforcer.py +2 -2
  59. package/tools/fuzz_payloads.py +3 -0
  60. package/tools/generate_allure_report.py +3 -0
  61. package/tools/generate_api_matrix.py +3 -0
  62. package/tools/generate_jmx_plan.py +3 -0
  63. package/tools/generate_tc_from_story.py +3 -0
  64. package/tools/generate_test_reports.py +3 -0
  65. package/tools/git_pre_commit_guard.py +13 -3
  66. package/tools/git_worktree_manager.py +3 -0
  67. package/tools/heal/__init__.py +3 -0
  68. package/tools/heal_pr_automator.py +3 -0
  69. package/tools/heuristic_locator_matcher.py +3 -0
  70. package/tools/hub_publisher.py +3 -3
  71. package/tools/infer_linter.py +19 -9
  72. package/tools/init_config.py +6 -9
  73. package/tools/jtl_analyzer.py +3 -0
  74. package/tools/lint/__init__.py +3 -0
  75. package/tools/lint_ai_docs.py +3 -0
  76. package/tools/lookup_tc.py +3 -0
  77. package/tools/lookup_xpath.py +3 -0
  78. package/tools/matrix_sharder.py +3 -0
  79. package/tools/mcp/__init__.py +3 -0
  80. package/tools/mcp_docx_server.py +1 -1
  81. package/tools/mcp_excel_server.py +4 -1
  82. package/tools/mcp_server.py +4 -1
  83. package/tools/md_to_xlsx.py +3 -0
  84. package/tools/mechanical_ui_gate.py +3 -0
  85. package/tools/micro_mutator.py +9 -5
  86. package/tools/network_mock_shield.py +3 -0
  87. package/tools/newman_analyzer.py +3 -0
  88. package/tools/omni_emitter.py +3 -0
  89. package/tools/omni_parser.py +3 -0
  90. package/tools/omni_transpiler.py +3 -0
  91. package/tools/output_formatter.py +3 -0
  92. package/tools/package_release.py +6 -6
  93. package/tools/pairwise_generator.py +3 -0
  94. package/tools/pentest_scope_guard.py +2 -2
  95. package/tools/perf/__init__.py +3 -0
  96. package/tools/pinpoint_failure.py +3 -0
  97. package/tools/project_state.py +3 -0
  98. package/tools/repo_map.py +3 -0
  99. package/tools/report/__init__.py +3 -0
  100. package/tools/rules_router.py +42 -10
  101. package/tools/runaway_stopper.py +3 -0
  102. package/tools/safety_firewall.py +3 -0
  103. package/tools/setup_project.py +9 -4
  104. package/tools/skill_collision_guard.py +2 -2
  105. package/tools/skillspector.py +2 -1
  106. package/tools/smart_visual_masker.py +3 -0
  107. package/tools/telemetry_correlator.py +3 -0
  108. package/tools/template_excel_exporter.py +2 -2
  109. package/tools/test_impact.py +3 -0
  110. package/tools/trace_data_flow.py +3 -0
  111. package/tools/traffic_session_converter.py +3 -0
  112. package/tools/ui_server.py +2 -2
  113. package/tools/universal_ir.py +3 -0
  114. package/tools/update_sentinel.py +15 -9
  115. package/tools/validate_groovy_scripts.py +3 -0
  116. package/tools/verify_all.py +27 -20
  117. package/tools/visual_diff_canvas.py +3 -0
  118. package/tools/visual_som_helper.py +3 -0
  119. package/tools/watch_mode.py +4 -4
  120. package/tools/wcag_audit.py +3 -0
  121. package/tools/welcome_page.py +1 -1
package/tools/__init__.py CHANGED
@@ -1,3 +1,6 @@
1
+ # SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
2
+ # SPDX-License-Identifier: MIT
3
+
1
4
  """
2
5
  Synapse Hub — Enterprise AI Agent Quality Engineering & Automated Testing Tooling Suite.
3
6
  ========================================================================================
@@ -14,7 +17,7 @@ Domain Packages:
14
17
  - tools.mcp: Model Context Protocol servers (core QA and Excel manipulation).
15
18
  """
16
19
 
17
- __version__ = "4.1.3"
20
+ __version__ = "4.1.4"
18
21
  __author__ = "Thế Vị (@TeeVee98)"
19
22
 
20
23
  # Expose domain packages
@@ -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 AUTONOMOUS AGENT Canary & Mutation Testing Arena
4
7
  -------------------------------------------------------
@@ -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 QA Project Analyzer & Intelligence Aggregator
4
7
  ---------------------------------------------------------
@@ -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 API Contract Drift & Breaking Change Sentinel
4
7
  ---------------------------------------------------------
@@ -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 Autonomous API Fuzzing & Chaos Breaker
@@ -96,7 +96,8 @@ class ASTValidationCache:
96
96
  self._entries = current_entries
97
97
  self._dirty = False
98
98
  except Exception as err:
99
- _ = err
99
+ import logging
100
+ logging.getLogger("ast_cache").debug("Failed to load ast cache: %s", err)
100
101
 
101
102
  def get_signature(self, file_path: str) -> Optional[Tuple[int, int]]:
102
103
  """Returns (mtime_ns, size) for fast freshness check."""
@@ -137,7 +138,8 @@ class ASTValidationCache:
137
138
  try:
138
139
  locked_json_write(self.cache_path, payload, indent=2, timeout=5.0, atomic=True)
139
140
  except Exception as err:
140
- _ = err
141
+ import logging
142
+ logging.getLogger("ast_cache").debug("Failed to load ast cache: %s", err)
141
143
 
142
144
 
143
145
  # Module-level singleton helper
@@ -186,10 +186,62 @@ def enforce_author_attribution(repo_root: Optional[str] = None, strict: bool = T
186
186
  return True
187
187
 
188
188
 
189
+ def verify_source_headers(
190
+ repo_root: Optional[str] = None,
191
+ extensions: Tuple[str, ...] = (".py", ".ts", ".groovy"),
192
+ scan_dirs: Optional[List[str]] = None,
193
+ ) -> Tuple[bool, List[str]]:
194
+ """
195
+ Validates that internal source files preserve the mandatory author attribution header:
196
+ SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
197
+ SPDX-License-Identifier: MIT
198
+ Returns (is_valid, list_of_missing_files).
199
+ """
200
+ root = repo_root or DEFAULT_REPO_ROOT
201
+ ignored_dirs = {
202
+ ".git", ".gradle", "node_modules", "allure-results", "graphify-out",
203
+ "__pycache__", ".pytest_cache", ".ruff_cache", ".mypy_cache",
204
+ "build", "dist", "claude-ecosystem-repos", "external_repos",
205
+ "teamwork", ".synapse", ".sandbox_snapshots"
206
+ }
207
+ missing: List[str] = []
208
+ dirs_to_scan = scan_dirs or ["tools", "tests", "examples", "scripts", "benchmarks", ".agents"]
209
+
210
+ for d in dirs_to_scan:
211
+ full_d = os.path.join(root, d)
212
+ if not os.path.isdir(full_d):
213
+ continue
214
+ for cur_root, dirs, files in os.walk(full_d):
215
+ dirs[:] = [sub for sub in dirs if sub not in ignored_dirs]
216
+ for f in sorted(files):
217
+ if any(f.endswith(ext) for ext in extensions):
218
+ file_path = os.path.join(cur_root, f)
219
+ try:
220
+ with open(file_path, "r", encoding="utf-8", errors="ignore") as fp:
221
+ header = fp.read(600)
222
+ has_author = (
223
+ ("Thế Vị" in header or "TeeVee98" in header or "TeeVee998" in header)
224
+ and "SPDX-FileCopyrightText" in header
225
+ )
226
+ has_license = "SPDX-License-Identifier" in header
227
+ if not (has_author and has_license):
228
+ missing.append(os.path.relpath(file_path, root).replace(os.sep, "/"))
229
+ except OSError as err:
230
+ missing.append(f"{os.path.relpath(file_path, root)}: {err}")
231
+
232
+ return len(missing) == 0, missing
233
+
234
+
189
235
  if __name__ == "__main__":
190
236
  valid, viols = verify_author_attribution()
191
- if valid:
237
+ headers_valid, missing_headers = verify_source_headers()
238
+ if valid and headers_valid:
192
239
  print(f"✅ Author attribution is 100% verified intact: {get_canonical_watermark()}")
240
+ print("✅ Source file SPDX headers verified intact (0 missing across source tree).")
193
241
  sys.exit(0)
194
242
  else:
243
+ if not headers_valid:
244
+ print(f"[WARN] Missing SPDX headers in {len(missing_headers)} files:", file=sys.stderr)
245
+ for mf in missing_headers[:10]:
246
+ print(f" • {mf}", file=sys.stderr)
195
247
  enforce_author_attribution(strict=True)
@@ -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 Closed-Loop Autonomous Test Healer Engine
4
7
  -----------------------------------------------------
@@ -55,7 +58,8 @@ def capture_live_aom_snapshot(url: str, timeout: float = 10.0) -> Optional[Dict[
55
58
  browser.close()
56
59
  return snapshot
57
60
  except Exception as _err:
58
- _ = _err
61
+ import logging
62
+ logging.getLogger("auto_heal").debug("Playwright snapshot capture failed: %s", _err)
59
63
  return None
60
64
 
61
65
 
@@ -227,7 +231,8 @@ def main():
227
231
  with open(args.aom, "r", encoding="utf-8") as af:
228
232
  aom_snap = json.load(af)
229
233
  except Exception as _err:
230
- _ = _err
234
+ import logging
235
+ logging.getLogger("auto_heal").debug("Failed to read AOM snapshot: %s", _err)
231
236
 
232
237
  if args.record_lesson:
233
238
  ok = record_heal_lesson(
@@ -36,8 +36,8 @@ if hasattr(sys.stdout, 'reconfigure'):
36
36
  try:
37
37
  sys.stdout.reconfigure(encoding='utf-8')
38
38
  sys.stderr.reconfigure(encoding='utf-8')
39
- except Exception as err:
40
- _ = err
39
+ except Exception:
40
+ pass
41
41
 
42
42
 
43
43
  class StorageBackend(ABC):
@@ -190,7 +190,8 @@ class SQLiteStorageBackend(StorageBackend):
190
190
  try:
191
191
  payload = json.loads(row["payload"])
192
192
  except Exception as err:
193
- _ = err
193
+ import logging
194
+ logging.getLogger("autogen_qa_broker").debug("Failed to decode message payload: %s", err)
194
195
  payload = row["payload"]
195
196
 
196
197
  messages.append({
@@ -253,7 +254,8 @@ class SQLiteStorageBackend(StorageBackend):
253
254
  try:
254
255
  payload = json.loads(row["payload"])
255
256
  except Exception as err:
256
- _ = err
257
+ import logging
258
+ logging.getLogger("autogen_qa_broker").debug("Failed to decode message payload: %s", err)
257
259
  payload = row["payload"]
258
260
  mailboxes[to_act].append({
259
261
  "id": row["id"],
@@ -368,7 +370,6 @@ class RedisStorageBackend(StorageBackend):
368
370
  try:
369
371
  self.client.ping()
370
372
  except Exception as err:
371
- _ = err
372
373
  sys.stderr.write(f"Notice: Redis backend ping failed ({err}).\n")
373
374
 
374
375
  def save_message(
@@ -411,8 +412,7 @@ class RedisStorageBackend(StorageBackend):
411
412
  continue
412
413
  try:
413
414
  data = json.loads(raw)
414
- except Exception as err:
415
- _ = err
415
+ except Exception:
416
416
  continue
417
417
 
418
418
  if topic and data.get("topic") != topic:
@@ -421,7 +421,8 @@ class RedisStorageBackend(StorageBackend):
421
421
  try:
422
422
  payload = json.loads(data["payload"])
423
423
  except Exception as err:
424
- _ = err
424
+ import logging
425
+ logging.getLogger("autogen_qa_broker").debug("Failed to decode data payload: %s", err)
425
426
  payload = data.get("payload")
426
427
 
427
428
  was_read = bool(data.get("read", 0))
@@ -477,7 +478,8 @@ class RedisStorageBackend(StorageBackend):
477
478
  try:
478
479
  val = json.loads(val_str)
479
480
  except Exception as err:
480
- _ = err
481
+ import logging
482
+ logging.getLogger("autogen_qa_broker").debug("Failed to decode subscription: %s", err)
481
483
  val = {"handler": "default_handler", "subscribed_at": ""}
482
484
  subscriptions[ev_topic].append({
483
485
  "actor": act,
@@ -507,8 +509,7 @@ class RedisStorageBackend(StorageBackend):
507
509
  continue
508
510
  try:
509
511
  data = json.loads(raw)
510
- except Exception as err:
511
- _ = err
512
+ except Exception:
512
513
  continue
513
514
 
514
515
  if not data.get("read", 0):
@@ -793,8 +794,7 @@ def main():
793
794
  if args.subcommand == "send-message":
794
795
  try:
795
796
  payload = json.loads(args.payload)
796
- except Exception as err:
797
- _ = err
797
+ except Exception:
798
798
  payload = args.payload
799
799
  res = broker.send_message(args.from_actor, args.to_actor, args.topic, payload)
800
800
  print(json.dumps(res, indent=2))
@@ -813,8 +813,7 @@ def main():
813
813
  elif args.subcommand == "publish":
814
814
  try:
815
815
  payload = json.loads(args.payload)
816
- except Exception as err:
817
- _ = err
816
+ except Exception:
818
817
  payload = args.payload
819
818
  res = broker.publish(args.event, payload)
820
819
  print(json.dumps(res, indent=2))
@@ -13,7 +13,7 @@
13
13
  (function () {
14
14
  'use strict';
15
15
 
16
- if (window.__qa && window.__qa.__version === '4.1.3') {
16
+ if (window.__qa && window.__qa.__version === '4.1.4') {
17
17
  return window.__qa;
18
18
  }
19
19
 
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  const qa = {
50
- __version: '4.1.3',
50
+ __version: '4.1.4',
51
51
 
52
52
  /**
53
53
  * 1. Smart Action Batching
@@ -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
  Auto-Bug Reporter & Root Cause Analysis (RCA) Ticket Generator
4
7
  --------------------------------------------------------------
@@ -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
  tools/build_consolidated_report.py — Generate Unified Top 20 Skills & Agents Evaluation Report
@@ -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
  tools/bump_version.py — Atomic Universal Version Bumper for Synapse Hub
@@ -229,7 +232,7 @@ def git_commit_and_tag(version: str, push: bool = False):
229
232
  if untracked:
230
233
  print(f"⚠️ Warning: Detected {len(untracked)} untracked file(s). Note that 'git add -u' only stages modified tracked files.")
231
234
  except Exception as err:
232
- _ = err
235
+ print(f"Notice: Could not check untracked files ({err}).")
233
236
 
234
237
  print(f"\n📦 Creating Git commit and tag {tag_name}...")
235
238
  subprocess.run(["git", "add", "-u"], cwd=REPO_ROOT, check=True, timeout=30.0)
@@ -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
  Universal Local Semantic Memory Cache & Self-Healing Resolver
4
7
  -------------------------------------------------------------
@@ -259,7 +262,7 @@ def retry_on_locked(max_retries=5, initial_delay=0.05, backoff=2.0):
259
262
  last_err = e
260
263
  err_msg = str(e).lower()
261
264
  if "locked" in err_msg or "busy" in err_msg:
262
- time.sleep(delay)
265
+ time.sleep(delay) # synapse-ignore: HARD_DELAY_ANTI_PATTERN
263
266
  delay *= backoff
264
267
  else:
265
268
  raise
@@ -317,8 +320,9 @@ def init_db(seed=True, target_db=None):
317
320
  """)
318
321
  try:
319
322
  cursor.execute("ALTER TABLE healing_cache ADD COLUMN code_patch TEXT DEFAULT ''")
320
- except sqlite3.OperationalError:
321
- _ = True
323
+ except sqlite3.OperationalError as _err:
324
+ import logging
325
+ logging.getLogger("cache_resolver").debug("code_patch column already exists: %s", _err)
322
326
 
323
327
  # 2. Negative Memory Table (Blacklist of Failed Fix Attempts)
324
328
  cursor.execute("""
@@ -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
  ==============================================================================
4
7
  Enterprise Automation - Environment & Onboarding Diagnostic Tool
@@ -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
  tools/check_version_sync.py — Version Synchronization Sentinel for Synapse Hub
@@ -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
  CI/CD Silent Self-Healing Pipeline Hook
4
7
  ---------------------------------------
package/tools/cli.py CHANGED
@@ -99,7 +99,7 @@ def cmd_set_lang(args):
99
99
  def cmd_version(args):
100
100
  """Displays the current hub version, skill catalog count, and license information."""
101
101
  manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
102
- version = "4.1.3"
102
+ version = "4.1.4"
103
103
  if os.path.exists(manifest_path):
104
104
  try:
105
105
  import json
@@ -686,14 +686,14 @@ def cmd_trend(args):
686
686
 
687
687
  def _hub_version():
688
688
  manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
689
- version = "4.1.3"
689
+ version = "4.1.4"
690
690
  if os.path.exists(manifest_path):
691
691
  try:
692
692
  import json
693
693
  with open(manifest_path, "r", encoding="utf-8") as f:
694
694
  version = json.load(f).get("version", version)
695
695
  except (OSError, json.JSONDecodeError):
696
- version = "4.1.3"
696
+ version = "4.1.4"
697
697
  return version
698
698
 
699
699
 
@@ -844,7 +844,8 @@ class SynapseArgumentParser(argparse.ArgumentParser):
844
844
  except SystemExit as exc:
845
845
  sys.exit(exc.code if exc.code is not None else 0)
846
846
  except Exception as _err:
847
- _ = _err
847
+ import logging
848
+ logging.getLogger("cli").debug("Argparse error formatting: %s", _err)
848
849
 
849
850
  def format_help(self):
850
851
  self._localize_argparse_groups()
@@ -1562,7 +1563,8 @@ def main():
1562
1563
  try:
1563
1564
  persist_language_preference(cli_lang)
1564
1565
  except Exception as _err:
1565
- _ = _err
1566
+ import logging
1567
+ logging.getLogger("cli").debug("Failed to persist language preference: %s", _err)
1566
1568
  active_lang = resolve_language(cli_lang)
1567
1569
  parser = build_parser(active_lang)
1568
1570
  args, unknown = parser.parse_known_args()
@@ -1602,8 +1604,9 @@ def main():
1602
1604
  try:
1603
1605
  import update_sentinel
1604
1606
  update_sentinel.check_for_updates(force=False, notify=True)
1605
- except (ImportError, OSError, TimeoutError):
1606
- _ = False
1607
+ except (ImportError, OSError, TimeoutError) as err:
1608
+ import logging
1609
+ logging.getLogger("cli").debug("Update check skipped: %s", err)
1607
1610
  args.func(args)
1608
1611
 
1609
1612
 
@@ -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
  Environment & Secret Decoupling Engine
4
7
  ---------------------------------------
@@ -1,3 +1,6 @@
1
+ # SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
2
+ # SPDX-License-Identifier: MIT
3
+
1
4
  """
2
5
  Synapse Hub — Core Execution Engines & Verification Sentinels (tools.core)
3
6
  --------------------------------------------------------------------------
@@ -87,7 +87,8 @@ def _win32_lock(fd: int, shared: bool = False) -> bool:
87
87
  return True
88
88
  except (AttributeError, TypeError, ValueError) as exc:
89
89
  # Fall through to msvcrt fallback if ctypes kernel32 LockFileEx is missing or incompatible
90
- _ = exc
90
+ import logging
91
+ logging.getLogger("file_lock").debug("LockFileEx fallback to msvcrt: %s", exc)
91
92
 
92
93
  # Graceful fallback to msvcrt.locking (exclusive lock only)
93
94
  if msvcrt_mod is not None:
@@ -117,7 +118,8 @@ def _win32_unlock(fd: int) -> bool:
117
118
  )
118
119
  return bool(res)
119
120
  except (AttributeError, TypeError, ValueError) as exc:
120
- _ = exc
121
+ import logging
122
+ logging.getLogger("file_lock").debug("UnlockFileEx fallback to msvcrt: %s", exc)
121
123
 
122
124
  # Graceful fallback to msvcrt.locking
123
125
  if msvcrt_mod is not None:
@@ -153,8 +155,9 @@ def _is_process_alive(pid: int) -> bool:
153
155
  return True
154
156
  return False
155
157
  except Exception as err:
156
- _ = err
157
- return True
158
+ import logging
159
+ logging.getLogger("file_lock").debug("Stale lock check error: %s", err)
160
+ return True
158
161
 
159
162
 
160
163
  class FileLockTimeoutError(TimeoutError):
@@ -194,8 +197,9 @@ class FileLock:
194
197
  elif content.isdigit():
195
198
  return int(content)
196
199
  except Exception as err:
197
- _ = err
198
- return None
200
+ import logging
201
+ logging.getLogger("file_lock").debug("Failed to read lock holder PID: %s", err)
202
+ return None
199
203
 
200
204
  def acquire(self) -> FileLock:
201
205
  """Acquires the advisory lock, polling until timeout with stale-lock reclamation."""
@@ -216,7 +220,8 @@ class FileLock:
216
220
  if os.fstat(self._fd).st_size == 0:
217
221
  os.write(self._fd, b"\x00")
218
222
  except (OSError, PermissionError) as err:
219
- _ = err
223
+ import logging
224
+ logging.getLogger("file_lock").debug("Win zero-byte write error: %s", err)
220
225
  os.lseek(self._fd, 0, os.SEEK_SET)
221
226
  _win32_lock(self._fd, shared=self.shared)
222
227
 
@@ -226,14 +231,16 @@ class FileLock:
226
231
  os.lseek(self._fd, 0, os.SEEK_SET)
227
232
  os.write(self._fd, f"{os.getpid()}:{int(time.time())}\n".encode("utf-8"))
228
233
  except OSError as err:
229
- _ = err
234
+ import logging
235
+ logging.getLogger("file_lock").debug("PID write error: %s", err)
230
236
  return self
231
237
  except (BlockingIOError, OSError, PermissionError):
232
238
  if self._fd is not None:
233
239
  try:
234
240
  os.close(self._fd)
235
241
  except OSError as err:
236
- _ = err
242
+ import logging
243
+ logging.getLogger("file_lock").debug("PID write error: %s", err)
237
244
  self._fd = None
238
245
 
239
246
  elapsed = time.time() - start
@@ -246,10 +253,10 @@ class FileLock:
246
253
  if os.path.exists(self.lock_path):
247
254
  os.remove(self.lock_path)
248
255
  stale_reclaimed = True
249
- time.sleep(0.02)
256
+ time.sleep(0.02) # synapse-ignore: HARD_DELAY_ANTI_PATTERN
257
+ continue
258
+ except OSError:
250
259
  continue
251
- except OSError as err:
252
- _ = err
253
260
 
254
261
  raise FileLockTimeoutError(
255
262
  f"Timed out after {self.timeout}s waiting for lock on {self.lock_path}"
@@ -266,7 +273,8 @@ class FileLock:
266
273
  _win32_unlock(self._fd)
267
274
  os.close(self._fd)
268
275
  except OSError as err:
269
- _ = err
276
+ import logging
277
+ logging.getLogger("file_lock").debug("FD close on unlock error: %s", err)
270
278
  finally:
271
279
  self._fd = None
272
280
 
@@ -312,7 +320,8 @@ def locked_write(file_path: str, content: str, timeout: float = 10.0, atomic: bo
312
320
  try:
313
321
  os.remove(temp_path)
314
322
  except OSError as err:
315
- _ = err
323
+ import logging
324
+ logging.getLogger("file_lock").debug("PID write error: %s", err)
316
325
  else:
317
326
  with open(file_path, "w", encoding="utf-8") as f:
318
327
  f.write(content)
@@ -266,7 +266,6 @@ def persist_language_preference(lang: str, target_dir: Optional[str] = None) ->
266
266
  if isinstance(loaded, dict):
267
267
  data = loaded
268
268
  except Exception as _err:
269
- _ = _err
270
269
  data = {}
271
270
 
272
271
  data["language"] = clean_lang
@@ -299,11 +298,11 @@ def _probe_config_file_lang() -> Optional[str]:
299
298
  cfg_lang = str(cfg_data.get("language", "")).strip().lower()
300
299
  if cfg_lang in ("vi", "en"):
301
300
  return cfg_lang
302
- except Exception as _err:
303
- _ = _err
301
+ except Exception:
304
302
  continue
305
303
  except Exception as _err:
306
- _ = _err
304
+ import logging
305
+ logging.getLogger("i18n").debug("Language resolution error: %s", _err)
307
306
  return None
308
307
 
309
308
 
@@ -321,9 +320,11 @@ def _probe_global_config_lang() -> Optional[str]:
321
320
  if cfg_lang in ("vi", "en"):
322
321
  return cfg_lang
323
322
  except Exception as _err:
324
- _ = _err
323
+ import logging
324
+ logging.getLogger("i18n").debug("Global config read error: %s", _err)
325
325
  except Exception as _err:
326
- _ = _err
326
+ import logging
327
+ logging.getLogger("i18n").debug("Language resolution error: %s", _err)
327
328
  return None
328
329
 
329
330
 
@@ -354,7 +355,8 @@ def _probe_os_locale_lang() -> Optional[str]:
354
355
  if def_loc.startswith("en"):
355
356
  return "en"
356
357
  except Exception as _err:
357
- _ = _err
358
+ import logging
359
+ logging.getLogger("i18n").debug("Language resolution error: %s", _err)
358
360
  return None
359
361
 
360
362
 
@@ -125,7 +125,8 @@ class UnifiedMemoryBus:
125
125
  try:
126
126
  cur.execute("ALTER TABLE actor_mailbox ADD COLUMN session_id TEXT;")
127
127
  except sqlite3.OperationalError as _err:
128
- _ = _err
128
+ import logging
129
+ logging.getLogger("memory_bus").debug("session_id column already exists: %s", _err)
129
130
 
130
131
  # 3. Skill Vault Partition
131
132
  cur.execute("""
@@ -734,7 +735,8 @@ class UnifiedMemoryBus:
734
735
  try:
735
736
  self._conn.execute("ROLLBACK;")
736
737
  except Exception as _rb_err:
737
- _ = _rb_err
738
+ import logging
739
+ logging.getLogger("memory_bus").debug("Rollback on transaction error: %s", _rb_err)
738
740
  if attempt == max_retries - 1:
739
741
  raise
740
742
  # Non-blocking backoff jitter on SQLite contention
@@ -881,7 +883,8 @@ class UnifiedMemoryBus:
881
883
  try:
882
884
  self._conn.close()
883
885
  except Exception as err:
884
- _ = err
886
+ import logging
887
+ logging.getLogger("memory_bus").debug("Connection close error: %s", err)
885
888
 
886
889
  def __enter__(self) -> "UnifiedMemoryBus":
887
890
  return self