@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/mcp_server.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 Model Context Protocol (MCP) Standard Server
|
|
4
7
|
-------------------------------------------------------
|
|
@@ -46,7 +49,7 @@ import gherkin_suite
|
|
|
46
49
|
import api_fuzzer
|
|
47
50
|
|
|
48
51
|
SERVER_NAME = "enterprise-agent-qa"
|
|
49
|
-
SERVER_VERSION = "4.1.
|
|
52
|
+
SERVER_VERSION = "4.1.4"
|
|
50
53
|
|
|
51
54
|
MCP_TOOLS = [
|
|
52
55
|
{
|
package/tools/md_to_xlsx.py
CHANGED
package/tools/micro_mutator.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
|
Assertion Sensitivity & Syntactic Micro-Mutation Sentinel (Heuristic)
|
|
4
7
|
---------------------------------------------------------------------
|
|
@@ -35,13 +38,13 @@ for stream in (sys.stdout, sys.stderr):
|
|
|
35
38
|
if hasattr(stream, 'fileno'):
|
|
36
39
|
try:
|
|
37
40
|
os.set_blocking(stream.fileno(), True)
|
|
38
|
-
except Exception
|
|
39
|
-
|
|
41
|
+
except Exception:
|
|
42
|
+
pass
|
|
40
43
|
if hasattr(stream, 'reconfigure'):
|
|
41
44
|
try:
|
|
42
45
|
stream.reconfigure(encoding='utf-8')
|
|
43
|
-
except Exception
|
|
44
|
-
|
|
46
|
+
except Exception:
|
|
47
|
+
pass
|
|
45
48
|
|
|
46
49
|
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
47
50
|
HUB_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, ".."))
|
|
@@ -868,7 +871,8 @@ def main():
|
|
|
868
871
|
with open(mutation_run_file, "w", encoding="utf-8") as mrf:
|
|
869
872
|
json.dump(report, mrf, indent=2)
|
|
870
873
|
except Exception as err:
|
|
871
|
-
|
|
874
|
+
import logging
|
|
875
|
+
logging.getLogger("micro_mutator").debug("Failed to write mutation run report: %s", err)
|
|
872
876
|
|
|
873
877
|
output_format = "json" if args.json else args.format
|
|
874
878
|
|
package/tools/newman_analyzer.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/newman_analyzer.py — Enterprise Newman Test Results Analyzer & CI/CD Quality Gate
|
package/tools/omni_emitter.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
|
Omni-Emitter: Universal Polyglot Code Generator & Transpiler
|
|
4
7
|
------------------------------------------------------------
|
package/tools/omni_parser.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
|
Omni-Parser: Universal Polyglot AST & Structure Parser
|
|
4
7
|
------------------------------------------------------
|
package/tools/omni_transpiler.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 Standardized Output Formatter & Exit Code Specification
|
|
4
7
|
------------------------------------------------------------------
|
package/tools/package_release.py
CHANGED
|
@@ -239,21 +239,21 @@ def package_synapse_hub(
|
|
|
239
239
|
if re.match(r"^synapse-hub-v\d+\.\d+\.\d+.*", f, re.IGNORECASE) and f.endswith((".zip", ".tar.gz", ".sha256")):
|
|
240
240
|
try:
|
|
241
241
|
os.remove(os.path.join(out_dir, f))
|
|
242
|
-
except OSError
|
|
243
|
-
|
|
242
|
+
except OSError:
|
|
243
|
+
continue
|
|
244
244
|
elif not is_same_as_root and f.endswith((".zip", ".tar.gz", ".sha256")) and f.lower().startswith("synapse-hub"):
|
|
245
245
|
try:
|
|
246
246
|
os.remove(os.path.join(out_dir, f))
|
|
247
|
-
except OSError
|
|
248
|
-
|
|
247
|
+
except OSError:
|
|
248
|
+
continue
|
|
249
249
|
|
|
250
250
|
if not is_same_as_root:
|
|
251
251
|
for f in os.listdir(repo_root):
|
|
252
252
|
if re.match(r"^synapse-hub-v\d+\.\d+\.\d+.*", f, re.IGNORECASE) and f.endswith((".zip", ".tar.gz", ".sha256")):
|
|
253
253
|
try:
|
|
254
254
|
os.remove(os.path.join(repo_root, f))
|
|
255
|
-
except OSError
|
|
256
|
-
|
|
255
|
+
except OSError:
|
|
256
|
+
continue
|
|
257
257
|
|
|
258
258
|
files = collect_package_files(repo_root)
|
|
259
259
|
base_name = f"synapse-hub-v{version}"
|
|
@@ -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/pairwise_generator.py — Pairwise (2-Way) Combinatorial Test Case Generator
|
|
@@ -38,8 +38,8 @@ if hasattr(sys.stdout, "reconfigure"):
|
|
|
38
38
|
try:
|
|
39
39
|
sys.stdout.reconfigure(encoding="utf-8")
|
|
40
40
|
sys.stderr.reconfigure(encoding="utf-8")
|
|
41
|
-
except Exception
|
|
42
|
-
|
|
41
|
+
except Exception:
|
|
42
|
+
pass
|
|
43
43
|
|
|
44
44
|
REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
|
45
45
|
DEFAULT_AUDIT_LOG = os.path.join(REPO_ROOT, ".synapse", "pentest_audit.log")
|
package/tools/perf/__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 — Performance, Stress & Flakiness Profilers (tools.perf)
|
|
3
6
|
---------------------------------------------------------------------
|
|
@@ -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
|
Fast Zero-Token Failure Pinpointer for Katalon & Jenkins Reports.
|
|
4
7
|
Scans the latest Reports/**/JUnit_Report.xml, extracts failed Test Cases,
|
package/tools/project_state.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 Project State Machine & Token-Capped Memory Anchor
|
|
4
7
|
--------------------------------------------------------------
|
package/tools/repo_map.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 Repository Map Compressor (Inspired by Aider-AI/aider)
|
|
4
7
|
-----------------------------------------------------------
|
package/tools/report/__init__.py
CHANGED
package/tools/rules_router.py
CHANGED
|
@@ -21,9 +21,12 @@ from __future__ import annotations
|
|
|
21
21
|
|
|
22
22
|
import argparse
|
|
23
23
|
import json
|
|
24
|
+
import logging
|
|
24
25
|
import os
|
|
25
26
|
import sys
|
|
26
|
-
|
|
27
|
+
|
|
28
|
+
logger = logging.getLogger("rules_router")
|
|
29
|
+
from typing import Any, Dict, List, Optional, Set, Tuple
|
|
27
30
|
|
|
28
31
|
if hasattr(sys.stdout, "reconfigure"):
|
|
29
32
|
try:
|
|
@@ -225,7 +228,7 @@ def _scan_directory_markers(target_dir: str, prefix: str = "") -> Tuple[Dict[str
|
|
|
225
228
|
detected["performance"].append(f"{prefix}package.json (perf)")
|
|
226
229
|
confidence["performance"] = max(confidence["performance"], 0.90)
|
|
227
230
|
except Exception as err:
|
|
228
|
-
|
|
231
|
+
logger.debug("Failed to inspect package.json: %s", err)
|
|
229
232
|
|
|
230
233
|
# 2. Inspect Python requirements / pyproject / Pipfile
|
|
231
234
|
for py_cfg_name in ("requirements.txt", "requirements-dev.txt", "pyproject.toml", "Pipfile", "setup.py"):
|
|
@@ -253,7 +256,8 @@ def _scan_directory_markers(target_dir: str, prefix: str = "") -> Tuple[Dict[str
|
|
|
253
256
|
detected["security"].append(f"{prefix}{py_cfg_name} (security)")
|
|
254
257
|
confidence["security"] = max(confidence["security"], 0.80)
|
|
255
258
|
except Exception as err:
|
|
256
|
-
|
|
259
|
+
logger.debug("Failed to inspect configuration: %s", err)
|
|
260
|
+
continue
|
|
257
261
|
|
|
258
262
|
# 3. Inspect JVM build markers (build.gradle, pom.xml)
|
|
259
263
|
for jvm_cfg_name in ("build.gradle", "build.gradle.kts", "pom.xml"):
|
|
@@ -278,7 +282,8 @@ def _scan_directory_markers(target_dir: str, prefix: str = "") -> Tuple[Dict[str
|
|
|
278
282
|
detected["performance"].append(f"{prefix}{jvm_cfg_name} (perf)")
|
|
279
283
|
confidence["performance"] = max(confidence["performance"], 0.85)
|
|
280
284
|
except Exception as err:
|
|
281
|
-
|
|
285
|
+
logger.debug("Failed to inspect configuration: %s", err)
|
|
286
|
+
continue
|
|
282
287
|
|
|
283
288
|
# 4. Walk directory structure up to depth 2
|
|
284
289
|
ignored = {".git", "node_modules", ".venv", "venv", "__pycache__", "dist", "build", "target", ".gradle"}
|
|
@@ -320,7 +325,8 @@ def _scan_directory_markers(target_dir: str, prefix: str = "") -> Tuple[Dict[str
|
|
|
320
325
|
detected["selenium"].append(full_evidence_path)
|
|
321
326
|
confidence["selenium"] = max(confidence["selenium"], 0.80)
|
|
322
327
|
except Exception as err:
|
|
323
|
-
|
|
328
|
+
logger.debug("Failed to inspect file: %s", err)
|
|
329
|
+
continue
|
|
324
330
|
else:
|
|
325
331
|
detected["selenium"].append(full_evidence_path)
|
|
326
332
|
confidence["selenium"] = max(confidence["selenium"], 0.95)
|
|
@@ -357,7 +363,8 @@ def _scan_directory_markers(target_dir: str, prefix: str = "") -> Tuple[Dict[str
|
|
|
357
363
|
detected["selenium"].append(full_evidence_path)
|
|
358
364
|
confidence["selenium"] = max(confidence["selenium"], 0.80)
|
|
359
365
|
except Exception as err:
|
|
360
|
-
|
|
366
|
+
logger.debug("Failed to inspect python file: %s", err)
|
|
367
|
+
continue
|
|
361
368
|
|
|
362
369
|
# Directory-level markers (Katalon Keywords/Profiles)
|
|
363
370
|
for d in dirs:
|
|
@@ -389,7 +396,7 @@ def detect_workspace_stacks(workspace_dir: str) -> Dict[str, Any]:
|
|
|
389
396
|
if "include" in f.read().lower():
|
|
390
397
|
is_monorepo = True
|
|
391
398
|
except Exception as err:
|
|
392
|
-
|
|
399
|
+
logger.debug("Failed to read settings.gradle: %s", err)
|
|
393
400
|
|
|
394
401
|
if is_monorepo:
|
|
395
402
|
# Traverse subpackages in packages/, apps/, services/, modules/
|
|
@@ -406,7 +413,7 @@ def detect_workspace_stacks(workspace_dir: str) -> Dict[str, Any]:
|
|
|
406
413
|
detected[stack].extend(evs)
|
|
407
414
|
confidence[stack] = max(confidence[stack], sub_conf[stack])
|
|
408
415
|
except OSError as err:
|
|
409
|
-
|
|
416
|
+
logger.debug("Failed to inspect subpackage: %s", err)
|
|
410
417
|
|
|
411
418
|
# Filter active stacks where confidence >= 0.50
|
|
412
419
|
active_stacks = [s for s, evs in detected.items() if evs and confidence[s] >= 0.50]
|
|
@@ -419,7 +426,7 @@ def detect_workspace_stacks(workspace_dir: str) -> Dict[str, Any]:
|
|
|
419
426
|
}
|
|
420
427
|
|
|
421
428
|
|
|
422
|
-
def route_rules(workspace_dir: str = ".") -> Dict[str, Any]:
|
|
429
|
+
def route_rules(workspace_dir: str = ".", minimal: bool = False, task_type: Optional[str] = None) -> Dict[str, Any]:
|
|
423
430
|
"""
|
|
424
431
|
Determines minimal rules and skills for target workspace, with dual-tier token hydration
|
|
425
432
|
accounting and strict truth-anchoring for unknown stacks.
|
|
@@ -442,6 +449,15 @@ def route_rules(workspace_dir: str = ".") -> Dict[str, Any]:
|
|
|
442
449
|
for s in STACK_SKILL_MAPPINGS.get(stack, []):
|
|
443
450
|
skills_set.add(s)
|
|
444
451
|
|
|
452
|
+
if task_type == "locator":
|
|
453
|
+
minimal = True
|
|
454
|
+
skills_set = {"clean-pom-crafter", "self-healing-locator"}
|
|
455
|
+
elif task_type == "triage":
|
|
456
|
+
minimal = True
|
|
457
|
+
skills_set = {"failure-autopsy-and-healing", "systematic-debugging"}
|
|
458
|
+
elif minimal:
|
|
459
|
+
skills_set = set(sorted(skills_set)[:1])
|
|
460
|
+
|
|
445
461
|
# Resolve rules directory
|
|
446
462
|
rules_dir = os.path.join(repo_root, ".agents", "rules")
|
|
447
463
|
valid_rules = sorted(rules_set)
|
|
@@ -461,6 +477,9 @@ def route_rules(workspace_dir: str = ".") -> Dict[str, Any]:
|
|
|
461
477
|
if is_unknown_stack:
|
|
462
478
|
return {
|
|
463
479
|
"workspace": os.path.abspath(workspace_dir),
|
|
480
|
+
"task_mode": "minimal" if (minimal or task_type) else "full",
|
|
481
|
+
"token_cap": 6000 if (minimal or task_type) else None,
|
|
482
|
+
"task_type": task_type,
|
|
464
483
|
"status": "UNCLASSIFIED_WORKSPACE",
|
|
465
484
|
"detected_stacks": ["unknown"],
|
|
466
485
|
"classification": "UNCLASSIFIED_WORKSPACE (Fallback Core Base Rules)",
|
|
@@ -513,6 +532,9 @@ def route_rules(workspace_dir: str = ".") -> Dict[str, Any]:
|
|
|
513
532
|
|
|
514
533
|
return {
|
|
515
534
|
"workspace": os.path.abspath(workspace_dir),
|
|
535
|
+
"task_mode": "minimal" if (minimal or task_type) else "full",
|
|
536
|
+
"token_cap": 6000 if (minimal or task_type) else None,
|
|
537
|
+
"task_type": task_type,
|
|
516
538
|
"status": "CLASSIFIED",
|
|
517
539
|
"detected_stacks": active_stacks,
|
|
518
540
|
"classification": f"CLASSIFIED ({', '.join(active_stacks)})",
|
|
@@ -620,9 +642,19 @@ def main():
|
|
|
620
642
|
action="store_true",
|
|
621
643
|
help="Print single-line summary of routed rules and tokens saved",
|
|
622
644
|
)
|
|
645
|
+
parser.add_argument(
|
|
646
|
+
"--minimal",
|
|
647
|
+
action="store_true",
|
|
648
|
+
help="Enforce minimal mode payload <= 6,000 tokens",
|
|
649
|
+
)
|
|
650
|
+
parser.add_argument(
|
|
651
|
+
"--task-type",
|
|
652
|
+
choices=["locator", "triage", "api", "perf", "security"],
|
|
653
|
+
help="Target task intent profile",
|
|
654
|
+
)
|
|
623
655
|
args = parser.parse_args()
|
|
624
656
|
|
|
625
|
-
result = route_rules(args.workspace)
|
|
657
|
+
result = route_rules(args.workspace, minimal=args.minimal, task_type=args.task_type)
|
|
626
658
|
|
|
627
659
|
if args.json:
|
|
628
660
|
print(format_routing_report(result, fmt="json"))
|
package/tools/runaway_stopper.py
CHANGED
package/tools/safety_firewall.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 Action Safety Firewall & Blast Radius Containment Engine
|
|
4
7
|
--------------------------------------------------------------------
|
package/tools/setup_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 Autonomous Project Setup & Bootstrap Engine
|
|
4
7
|
----------------------------------------------------------
|
|
@@ -427,16 +430,18 @@ def inject_antigravity_global_plugin():
|
|
|
427
430
|
if os.path.islink(dst):
|
|
428
431
|
try:
|
|
429
432
|
os.unlink(dst)
|
|
430
|
-
except OSError:
|
|
431
|
-
|
|
433
|
+
except OSError as err:
|
|
434
|
+
import logging
|
|
435
|
+
logging.getLogger("setup_project").debug("Unlink failed: %s", err)
|
|
432
436
|
if sys.platform == "win32":
|
|
433
437
|
try:
|
|
434
438
|
import _winapi
|
|
435
439
|
if not os.path.exists(dst):
|
|
436
440
|
_winapi.CreateJunction(src, dst)
|
|
437
441
|
return
|
|
438
|
-
except (OSError, ImportError, AttributeError):
|
|
439
|
-
|
|
442
|
+
except (OSError, ImportError, AttributeError) as err:
|
|
443
|
+
import logging
|
|
444
|
+
logging.getLogger("setup_project").debug("Windows junction failed, falling back to copytree: %s", err)
|
|
440
445
|
shutil.copytree(src, dst, dirs_exist_ok=True, ignore=shutil.ignore_patterns("__pycache__", "*.pyc", "*.tmp"))
|
|
441
446
|
|
|
442
447
|
sync_dir(os.path.join(HUB_ROOT, ".agents", "skills"), os.path.join(target_plugin_dir, "skills"))
|
|
@@ -129,8 +129,8 @@ class SkillCollisionGuard:
|
|
|
129
129
|
with open(full_path, "r", encoding="utf-8", errors="ignore") as fp:
|
|
130
130
|
content = fp.read()
|
|
131
131
|
rules[f] = content
|
|
132
|
-
except OSError
|
|
133
|
-
|
|
132
|
+
except OSError:
|
|
133
|
+
continue
|
|
134
134
|
return rules
|
|
135
135
|
|
|
136
136
|
def audit_rules(self, rules_dir: str = ".agents/rules") -> Tuple[bool, List[Dict[str, Any]]]:
|
package/tools/skillspector.py
CHANGED
|
@@ -995,7 +995,8 @@ def is_path_ignored(file_or_dir_path: str, repo_anchor: Path, patterns: List[str
|
|
|
995
995
|
if spec.match_file(rel_posix):
|
|
996
996
|
return True
|
|
997
997
|
except (ImportError, Exception) as err:
|
|
998
|
-
|
|
998
|
+
import logging
|
|
999
|
+
logging.getLogger("skillspector").debug("Pathspec match failed, falling back to fnmatch: %s", err)
|
|
999
1000
|
|
|
1000
1001
|
# fnmatch fallback
|
|
1001
1002
|
for pat in patterns:
|
|
@@ -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/telemetry_correlator.py — Full-Stack APM & Server Telemetry Performance Correlator
|
package/tools/test_impact.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 Test Impact Analyzer (Graphify AST-Powered)
|
|
4
7
|
---------------------------------------------------
|
package/tools/trace_data_flow.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 Data Flow & Teardown Tracer (Taint Analysis)
|
|
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 Shift-Right Traffic & User Session Replay Engine (HAR / RUM to Test)
|
|
4
7
|
--------------------------------------------------------------------------------
|
package/tools/ui_server.py
CHANGED
|
@@ -236,7 +236,7 @@ class SynapseUiHandler(BaseHTTPRequestHandler):
|
|
|
236
236
|
if path == "/api/status":
|
|
237
237
|
active_target = JOB_MANAGER.target_dir or REPO_ROOT
|
|
238
238
|
self.send_json(200, {
|
|
239
|
-
"version": "4.1.
|
|
239
|
+
"version": "4.1.4",
|
|
240
240
|
"status": "ONLINE",
|
|
241
241
|
"os": sys.platform,
|
|
242
242
|
"workspace": active_target,
|
|
@@ -371,7 +371,7 @@ def run_server(host: str = "127.0.0.1", port: int = 8080, open_browser: bool = T
|
|
|
371
371
|
|
|
372
372
|
if open_browser:
|
|
373
373
|
def opener():
|
|
374
|
-
time.sleep(0.5)
|
|
374
|
+
time.sleep(0.5) # synapse-ignore: HARD_DELAY_ANTI_PATTERN
|
|
375
375
|
webbrowser.open(url)
|
|
376
376
|
threading.Thread(target=opener, daemon=True).start()
|
|
377
377
|
|
package/tools/universal_ir.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 Testing Intermediate Representation (IR) Schema
|
|
4
7
|
---------------------------------------------------------
|
package/tools/update_sentinel.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 Synapse-Hub Auto-Update & Version Drift Sentinel
|
|
4
7
|
------------------------------------------------------------
|
|
@@ -65,7 +68,7 @@ def get_local_version():
|
|
|
65
68
|
try:
|
|
66
69
|
with open(pkg_file, "r", encoding="utf-8") as f:
|
|
67
70
|
data = json.load(f)
|
|
68
|
-
return data.get("version", "4.1.
|
|
71
|
+
return data.get("version", "4.1.4")
|
|
69
72
|
except (OSError, json.JSONDecodeError):
|
|
70
73
|
data = {}
|
|
71
74
|
|
|
@@ -74,11 +77,11 @@ def get_local_version():
|
|
|
74
77
|
try:
|
|
75
78
|
with open(manifest_file, "r", encoding="utf-8") as f:
|
|
76
79
|
data = json.load(f)
|
|
77
|
-
return data.get("version", "4.1.
|
|
80
|
+
return data.get("version", "4.1.4")
|
|
78
81
|
except (OSError, json.JSONDecodeError):
|
|
79
82
|
data = {}
|
|
80
83
|
|
|
81
|
-
return "4.1.
|
|
84
|
+
return "4.1.4"
|
|
82
85
|
|
|
83
86
|
|
|
84
87
|
def fetch_remote_version():
|
|
@@ -304,8 +307,9 @@ def perform_update():
|
|
|
304
307
|
)
|
|
305
308
|
if res.returncode == 0:
|
|
306
309
|
print(f" {GREEN}[OK] Global NPM package updated to latest!{RESET}")
|
|
307
|
-
except (subprocess.SubprocessError, OSError):
|
|
308
|
-
|
|
310
|
+
except (subprocess.SubprocessError, OSError) as err:
|
|
311
|
+
import logging
|
|
312
|
+
logging.getLogger("update_sentinel").debug("NPM update skipped: %s", err)
|
|
309
313
|
|
|
310
314
|
# 2. Check Global Plugin
|
|
311
315
|
if os.path.exists(GLOBAL_PLUGIN_DIR) and GLOBAL_PLUGIN_DIR.lower() != HUB_ROOT.lower():
|
|
@@ -315,8 +319,9 @@ def perform_update():
|
|
|
315
319
|
try:
|
|
316
320
|
subprocess.run(["git", "pull", "--ff-only"], cwd=GLOBAL_PLUGIN_DIR, stdout=subprocess.DEVNULL, timeout=30.0)
|
|
317
321
|
print(f" {GREEN}[OK] Updated Global Plugin repository: {GLOBAL_PLUGIN_DIR}{RESET}")
|
|
318
|
-
except (subprocess.SubprocessError, OSError):
|
|
319
|
-
|
|
322
|
+
except (subprocess.SubprocessError, OSError) as err:
|
|
323
|
+
import logging
|
|
324
|
+
logging.getLogger("update_sentinel").debug("Git pull skipped: %s", err)
|
|
320
325
|
else:
|
|
321
326
|
# Refresh metadata files in global plugin
|
|
322
327
|
try:
|
|
@@ -327,8 +332,9 @@ def perform_update():
|
|
|
327
332
|
if os.path.exists(src_f):
|
|
328
333
|
shutil.copy2(src_f, dst_f)
|
|
329
334
|
print(f" {GREEN}[OK] Refreshed metadata & LICENSE in: {GLOBAL_PLUGIN_DIR}{RESET}")
|
|
330
|
-
except OSError:
|
|
331
|
-
|
|
335
|
+
except OSError as err:
|
|
336
|
+
import logging
|
|
337
|
+
logging.getLogger("update_sentinel").debug("Failed to refresh metadata: %s", err)
|
|
332
338
|
|
|
333
339
|
# 3. Re-initialize SQLite Memory Cache
|
|
334
340
|
print(f"\n{BOLD}[3/3] Synchronizing Central Agent Memory Cache...{RESET}")
|
|
@@ -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
|
Pre-check validator for Groovy scripts and POM keywords in enterprise test suites.
|
|
4
7
|
Catches syntax errors, broken GString escape sequences, and structural balance issues
|