@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.
- package/.agents/skills/01-web-automation/clean-pom-crafter/examples/standard_test_case.groovy +3 -0
- package/.agents/skills/01-web-automation/clean-pom-crafter/references/pom_patterns.groovy +3 -0
- package/.agents/skills/01-web-automation/e2e-testing-patterns/examples/playwright_sharded_config.ts +3 -0
- package/.agents/skills/01-web-automation/playwright-webapp-testing/examples/server_lifecycle_playwright.py +3 -0
- package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +3 -0
- package/.agents/skills/05-security-and-compliance/security-dast-sentinel/references/dast_recipes.ts +3 -0
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +3 -0
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +3 -0
- package/.agents/skills/11-ai-and-prompting/qa-aci-interface/examples/surgical_code_window_walkthrough.md +1 -1
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/agentskills.json +1 -1
- package/docs/ARCHITECTURE.en.md +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/PERFORMANCE_AUDIT_REPORT.md +2 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/scripts/generate_skill_examples.py +3 -0
- package/scripts/package_dist.py +3 -0
- package/skills_manifest.json +1 -1
- package/synapse.config.json +1 -1
- package/tools/.infer_baseline.json +3 -796
- package/tools/__init__.py +4 -1
- package/tools/agent_canary.py +3 -0
- package/tools/analyze_project.py +3 -0
- package/tools/api_drift_sentinel.py +3 -0
- package/tools/api_fuzzer.py +3 -0
- package/tools/ast_cache.py +4 -2
- package/tools/author_integrity.py +53 -1
- package/tools/auto_heal.py +7 -2
- package/tools/autogen_qa_broker.py +14 -15
- package/tools/benchmark_swarm_context.py +10 -2
- package/tools/browser_helpers.js +2 -2
- package/tools/bug_reporter.py +3 -0
- package/tools/build_consolidated_report.py +3 -0
- package/tools/bump_version.py +4 -1
- package/tools/cache_resolver.py +7 -3
- package/tools/check_env.py +3 -0
- package/tools/check_version_sync.py +3 -0
- package/tools/ci_healing_hook.py +3 -0
- package/tools/cli.py +10 -7
- package/tools/config_decoupler.py +3 -0
- package/tools/core/__init__.py +3 -0
- package/tools/core/file_lock.py +23 -14
- package/tools/core/i18n.py +9 -7
- package/tools/core/memory_bus.py +6 -3
- package/tools/core/process_supervisor.py +28 -18
- package/tools/core/token_estimator.py +55 -18
- package/tools/count_tokens.py +11 -7
- package/tools/create_mock_docx.py +3 -0
- package/tools/dashboard_generator.py +17 -15
- package/tools/db_sandbox.py +4 -1
- package/tools/debt_harvester.py +2 -2
- package/tools/diagram_architect.py +3 -0
- package/tools/distill_log.py +119 -26
- package/tools/e2e_flow_prober.py +3 -0
- package/tools/export_postman_collection.py +3 -0
- package/tools/flaky_detector.py +3 -0
- package/tools/fsm_enforcer.py +2 -2
- package/tools/fuzz_payloads.py +3 -0
- package/tools/generate_allure_report.py +3 -0
- package/tools/generate_api_matrix.py +3 -0
- package/tools/generate_jmx_plan.py +3 -0
- package/tools/generate_tc_from_story.py +3 -0
- package/tools/generate_test_reports.py +3 -0
- package/tools/git_pre_commit_guard.py +13 -3
- package/tools/git_worktree_manager.py +3 -0
- package/tools/heal/__init__.py +3 -0
- package/tools/heal_pr_automator.py +3 -0
- package/tools/heuristic_locator_matcher.py +3 -0
- package/tools/hub_publisher.py +3 -3
- package/tools/infer_linter.py +19 -9
- package/tools/init_config.py +6 -9
- package/tools/jtl_analyzer.py +3 -0
- package/tools/lint/__init__.py +3 -0
- package/tools/lint_ai_docs.py +3 -0
- package/tools/lookup_tc.py +3 -0
- package/tools/lookup_xpath.py +3 -0
- package/tools/matrix_sharder.py +3 -0
- package/tools/mcp/__init__.py +3 -0
- package/tools/mcp_docx_server.py +1 -1
- package/tools/mcp_excel_server.py +4 -1
- package/tools/mcp_server.py +4 -1
- package/tools/md_to_xlsx.py +3 -0
- package/tools/mechanical_ui_gate.py +3 -0
- package/tools/micro_mutator.py +9 -5
- package/tools/network_mock_shield.py +3 -0
- package/tools/newman_analyzer.py +3 -0
- package/tools/omni_emitter.py +3 -0
- package/tools/omni_parser.py +3 -0
- package/tools/omni_transpiler.py +3 -0
- package/tools/output_formatter.py +3 -0
- package/tools/package_release.py +6 -6
- package/tools/pairwise_generator.py +3 -0
- package/tools/pentest_scope_guard.py +2 -2
- package/tools/perf/__init__.py +3 -0
- package/tools/pinpoint_failure.py +3 -0
- package/tools/project_state.py +3 -0
- package/tools/repo_map.py +3 -0
- package/tools/report/__init__.py +3 -0
- package/tools/rules_router.py +42 -10
- package/tools/runaway_stopper.py +3 -0
- package/tools/safety_firewall.py +3 -0
- package/tools/setup_project.py +9 -4
- package/tools/skill_collision_guard.py +2 -2
- package/tools/skillspector.py +2 -1
- package/tools/smart_visual_masker.py +3 -0
- package/tools/telemetry_correlator.py +3 -0
- package/tools/template_excel_exporter.py +2 -2
- package/tools/test_impact.py +3 -0
- package/tools/trace_data_flow.py +3 -0
- package/tools/traffic_session_converter.py +3 -0
- package/tools/ui_server.py +2 -2
- package/tools/universal_ir.py +3 -0
- package/tools/update_sentinel.py +15 -9
- package/tools/validate_groovy_scripts.py +3 -0
- package/tools/verify_all.py +27 -20
- package/tools/visual_diff_canvas.py +3 -0
- package/tools/visual_som_helper.py +3 -0
- package/tools/watch_mode.py +4 -4
- package/tools/wcag_audit.py +3 -0
- 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.
|
|
20
|
+
__version__ = "4.1.4"
|
|
18
21
|
__author__ = "Thế Vị (@TeeVee98)"
|
|
19
22
|
|
|
20
23
|
# Expose domain packages
|
package/tools/agent_canary.py
CHANGED
|
@@ -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
|
-------------------------------------------------------
|
package/tools/analyze_project.py
CHANGED
|
@@ -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
|
---------------------------------------------------------
|
package/tools/api_fuzzer.py
CHANGED
package/tools/ast_cache.py
CHANGED
|
@@ -96,7 +96,8 @@ class ASTValidationCache:
|
|
|
96
96
|
self._entries = current_entries
|
|
97
97
|
self._dirty = False
|
|
98
98
|
except Exception as err:
|
|
99
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
package/tools/auto_heal.py
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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))
|
|
@@ -33,13 +33,15 @@ if hasattr(sys.stdout, "reconfigure"):
|
|
|
33
33
|
pass
|
|
34
34
|
|
|
35
35
|
REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
|
36
|
+
if REPO_ROOT not in sys.path:
|
|
37
|
+
sys.path.insert(0, REPO_ROOT)
|
|
36
38
|
|
|
37
39
|
# Import core token estimator
|
|
38
40
|
try:
|
|
39
|
-
from tools.core.token_estimator import count_tokens
|
|
41
|
+
from tools.core.token_estimator import count_tokens, get_estimator_info
|
|
40
42
|
except ImportError:
|
|
41
43
|
try:
|
|
42
|
-
from core.token_estimator import count_tokens
|
|
44
|
+
from core.token_estimator import count_tokens, get_estimator_info
|
|
43
45
|
except ImportError:
|
|
44
46
|
def count_tokens(text: str, model_hint: str = "cl100k") -> int:
|
|
45
47
|
if not text:
|
|
@@ -48,6 +50,9 @@ except ImportError:
|
|
|
48
50
|
char_estimate = len(text) / 3.85
|
|
49
51
|
return int(max(words, char_estimate))
|
|
50
52
|
|
|
53
|
+
def get_estimator_info() -> Dict[str, Any]:
|
|
54
|
+
return {"engine": "fallback_words", "is_exact": False, "encoding": "cl100k_base"}
|
|
55
|
+
|
|
51
56
|
|
|
52
57
|
def estimate_tokens(text: str) -> int:
|
|
53
58
|
"""Wrapper for backward compatibility."""
|
|
@@ -383,6 +388,7 @@ def format_markdown_report(bench: Dict[str, Any]) -> str:
|
|
|
383
388
|
"""Formats benchmark results in a clean, scientifically honest markdown report."""
|
|
384
389
|
syn = bench.get("synthetic_track", bench)
|
|
385
390
|
emp = bench.get("empirical_track", {})
|
|
391
|
+
info = get_estimator_info() if "get_estimator_info" in globals() else {"engine": "cl100k_base", "is_exact": True, "encoding": "cl100k_base"}
|
|
386
392
|
|
|
387
393
|
md = [
|
|
388
394
|
"# Empirical Context & Token Reduction Benchmark (Dual-Track)",
|
|
@@ -390,6 +396,8 @@ def format_markdown_report(bench: Dict[str, Any]) -> str:
|
|
|
390
396
|
"> **Scientific Disclosure:** This benchmark distinguishes between:",
|
|
391
397
|
"> 1. **Track 1 (Synthetic Micro-Workloads):** Deterministic micro-workloads evaluating isolated context patterns.",
|
|
392
398
|
"> 2. **Track 2 (Empirical Reference Suites):** Live measurements on real example workspaces within the repository.",
|
|
399
|
+
f"> - **Tokenizer Engine:** `{info.get('engine', 'cl100k_base')}` (Exact: `{info.get('is_exact', True)}`)",
|
|
400
|
+
f"> - **Encoding Scope:** `{info.get('encoding', 'cl100k_base')}` (Standard OpenAI BPE encoding for LLMs; benchmark artifact specifies exact tokenizer scope).",
|
|
393
401
|
"",
|
|
394
402
|
"## Track 1: Deterministic Micro-Workload Benchmark (Synthetic)",
|
|
395
403
|
"",
|
package/tools/browser_helpers.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
(function () {
|
|
14
14
|
'use strict';
|
|
15
15
|
|
|
16
|
-
if (window.__qa && window.__qa.__version === '4.1.
|
|
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.
|
|
50
|
+
__version: '4.1.4',
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* 1. Smart Action Batching
|
package/tools/bug_reporter.py
CHANGED
|
@@ -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
|
package/tools/bump_version.py
CHANGED
|
@@ -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
|
-
|
|
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)
|
package/tools/cache_resolver.py
CHANGED
|
@@ -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
|
-
|
|
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("""
|
package/tools/check_env.py
CHANGED
|
@@ -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
|
package/tools/ci_healing_hook.py
CHANGED
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
package/tools/core/__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 — Core Execution Engines & Verification Sentinels (tools.core)
|
|
3
6
|
--------------------------------------------------------------------------
|
package/tools/core/file_lock.py
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
157
|
-
|
|
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
|
-
|
|
198
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
package/tools/core/i18n.py
CHANGED
|
@@ -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
|
|
303
|
-
_ = _err
|
|
301
|
+
except Exception:
|
|
304
302
|
continue
|
|
305
303
|
except Exception as _err:
|
|
306
|
-
|
|
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
|
-
|
|
323
|
+
import logging
|
|
324
|
+
logging.getLogger("i18n").debug("Global config read error: %s", _err)
|
|
325
325
|
except Exception as _err:
|
|
326
|
-
|
|
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
|
-
|
|
358
|
+
import logging
|
|
359
|
+
logging.getLogger("i18n").debug("Language resolution error: %s", _err)
|
|
358
360
|
return None
|
|
359
361
|
|
|
360
362
|
|