@teevee98/synapse-hub 4.1.3 → 4.2.0

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 (206) 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 +6 -1
  3. package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +6 -1
  4. package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +8 -3
  5. package/.agents/skills/01-web-automation/clean-pom-crafter/examples/standard_test_case.groovy +3 -0
  6. package/.agents/skills/01-web-automation/clean-pom-crafter/references/pom_patterns.groovy +3 -0
  7. package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +6 -1
  8. package/.agents/skills/01-web-automation/e2e-testing-patterns/examples/playwright_sharded_config.ts +3 -0
  9. package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +6 -1
  10. package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +6 -1
  11. package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +6 -1
  12. package/.agents/skills/01-web-automation/mobile-appium-som/examples/BaseScreen.java +2 -2
  13. package/.agents/skills/01-web-automation/mobile-appium-som/examples/LoginScreen.java +2 -2
  14. package/.agents/skills/01-web-automation/mobile-appium-som/examples/TC_MobileLogin.java +2 -2
  15. package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +7 -2
  16. package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +6 -1
  17. package/.agents/skills/01-web-automation/playwright-webapp-testing/examples/server_lifecycle_playwright.py +3 -0
  18. package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +6 -1
  19. package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +6 -1
  20. package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +6 -1
  21. package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +6 -1
  22. package/.agents/skills/02-test-design/review-spec/SKILL.md +4 -1
  23. package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +6 -1
  24. package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +6 -1
  25. package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +6 -1
  26. package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +7 -2
  27. package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +7 -2
  28. package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +4 -1
  29. package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +6 -1
  30. package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +3 -0
  31. package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +6 -1
  32. package/.agents/skills/05-security-and-compliance/security-dast-sentinel/references/dast_recipes.ts +3 -0
  33. package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +6 -1
  34. package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +6 -1
  35. package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +6 -1
  36. package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +6 -1
  37. package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +7 -2
  38. package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +6 -1
  39. package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +6 -1
  40. package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +6 -1
  41. package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +6 -1
  42. package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +6 -1
  43. package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +6 -1
  44. package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +6 -1
  45. package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +6 -1
  46. package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +6 -1
  47. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +6 -1
  48. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +3 -0
  49. package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +3 -0
  50. package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +6 -1
  51. package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +6 -1
  52. package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +4 -1
  53. package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +4 -1
  54. package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +6 -1
  55. package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +4 -1
  56. package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +6 -1
  57. package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +6 -1
  58. package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +6 -1
  59. package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +6 -1
  60. package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +6 -1
  61. package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +6 -1
  62. package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +6 -1
  63. package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +6 -1
  64. package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +6 -1
  65. package/.agents/skills/11-ai-and-prompting/qa-aci-interface/examples/surgical_code_window_walkthrough.md +1 -1
  66. package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +6 -1
  67. package/AGENTS.md +7 -1
  68. package/LICENSE +5 -5
  69. package/NOTICE +1 -1
  70. package/README.en.md +4 -4
  71. package/README.md +4 -4
  72. package/agentskills.json +1 -1
  73. package/docs/ARCHITECTURE.en.md +2 -2
  74. package/docs/ARCHITECTURE.md +11 -2
  75. package/docs/CLI_REFERENCE.en.md +6 -4
  76. package/docs/CLI_REFERENCE.md +1 -1
  77. package/docs/CONTRIBUTING.en.md +1 -1
  78. package/docs/CONTRIBUTING.md +2 -2
  79. package/docs/PERFORMANCE_AUDIT_REPORT.md +2 -2
  80. package/docs/TOOL_CATALOG.md +6 -2
  81. package/docs/research/agent_skill_training_analysis.md +1 -1
  82. package/package.json +1 -1
  83. package/plugin.json +1 -1
  84. package/scripts/generate_skill_examples.py +3 -0
  85. package/scripts/package_dist.py +3 -0
  86. package/skills_manifest.json +320 -55
  87. package/synapse.config.json +1 -1
  88. package/templates/ui/index.html +2 -2
  89. package/tools/.infer_baseline.json +3 -796
  90. package/tools/TOOL_CATALOG.json +63 -3
  91. package/tools/__init__.py +4 -1
  92. package/tools/agent_canary.py +3 -0
  93. package/tools/analyze_project.py +3 -0
  94. package/tools/api_drift_sentinel.py +3 -0
  95. package/tools/api_fuzzer.py +182 -118
  96. package/tools/ast_cache.py +4 -2
  97. package/tools/author_integrity.py +174 -12
  98. package/tools/auto_heal.py +7 -2
  99. package/tools/autogen_qa_broker.py +14 -15
  100. package/tools/benchmark_swarm_context.py +119 -18
  101. package/tools/break_ui_generator.py +233 -0
  102. package/tools/browser_helpers.js +2 -2
  103. package/tools/bug_reporter.py +3 -0
  104. package/tools/build_consolidated_report.py +3 -0
  105. package/tools/bump_version.py +4 -1
  106. package/tools/cache_resolver.py +7 -3
  107. package/tools/check_env.py +3 -0
  108. package/tools/check_version_sync.py +21 -50
  109. package/tools/ci_healing_hook.py +3 -0
  110. package/tools/cli.py +116 -22
  111. package/tools/config_decoupler.py +3 -0
  112. package/tools/core/__init__.py +3 -0
  113. package/tools/core/bm25_retriever.py +218 -0
  114. package/tools/core/file_lock.py +23 -14
  115. package/tools/core/i18n.py +13 -11
  116. package/tools/core/memory_bus.py +6 -3
  117. package/tools/core/process_supervisor.py +28 -18
  118. package/tools/core/provider_usage_adapter.py +317 -0
  119. package/tools/core/token_estimator.py +83 -18
  120. package/tools/count_tokens.py +16 -7
  121. package/tools/coverage_reporter.py +245 -0
  122. package/tools/create_mock_docx.py +3 -0
  123. package/tools/dashboard_generator.py +17 -15
  124. package/tools/db_sandbox.py +150 -5
  125. package/tools/debt_harvester.py +2 -2
  126. package/tools/diagram_architect.py +3 -0
  127. package/tools/distill_log.py +22 -2
  128. package/tools/distill_skill.py +191 -0
  129. package/tools/e2e_flow_prober.py +3 -0
  130. package/tools/export_postman_collection.py +3 -0
  131. package/tools/flaky_detector.py +3 -0
  132. package/tools/fsm_enforcer.py +2 -2
  133. package/tools/fuzz_payloads.py +3 -0
  134. package/tools/generate_allure_report.py +3 -0
  135. package/tools/generate_api_matrix.py +3 -0
  136. package/tools/generate_jmx_plan.py +3 -0
  137. package/tools/generate_tc_from_story.py +3 -0
  138. package/tools/generate_test_reports.py +3 -0
  139. package/tools/git_pre_commit_guard.py +25 -3
  140. package/tools/git_worktree_manager.py +3 -0
  141. package/tools/heal/__init__.py +3 -0
  142. package/tools/heal_pr_automator.py +3 -0
  143. package/tools/heuristic_locator_matcher.py +3 -0
  144. package/tools/hub_publisher.py +3 -3
  145. package/tools/humanize_linter.py +3 -0
  146. package/tools/infer_linter.py +19 -9
  147. package/tools/init_config.py +6 -9
  148. package/tools/jtl_analyzer.py +3 -0
  149. package/tools/lint/__init__.py +3 -0
  150. package/tools/lint_ai_docs.py +3 -0
  151. package/tools/lookup_tc.py +3 -0
  152. package/tools/lookup_xpath.py +3 -0
  153. package/tools/matrix_sharder.py +3 -0
  154. package/tools/mcp/__init__.py +3 -0
  155. package/tools/mcp_docx_server.py +1 -1
  156. package/tools/mcp_excel_server.py +4 -1
  157. package/tools/mcp_server.py +78 -15
  158. package/tools/md_to_xlsx.py +3 -0
  159. package/tools/mechanical_ui_gate.py +3 -0
  160. package/tools/micro_mutator.py +93 -19
  161. package/tools/network_mock_shield.py +3 -0
  162. package/tools/newman_analyzer.py +3 -0
  163. package/tools/omni_emitter.py +3 -0
  164. package/tools/omni_parser.py +3 -0
  165. package/tools/omni_transpiler.py +3 -0
  166. package/tools/output_formatter.py +3 -0
  167. package/tools/package_release.py +6 -6
  168. package/tools/pairwise_generator.py +3 -0
  169. package/tools/pentest_scope_guard.py +401 -58
  170. package/tools/perf/__init__.py +3 -0
  171. package/tools/perf/benchmark_perf_runner.py +42 -0
  172. package/tools/pinpoint_failure.py +3 -0
  173. package/tools/project_state.py +3 -0
  174. package/tools/repo_map.py +3 -0
  175. package/tools/report/__init__.py +3 -0
  176. package/tools/rules_router.py +426 -34
  177. package/tools/runaway_stopper.py +3 -0
  178. package/tools/safety_firewall.py +3 -0
  179. package/tools/security_scanner.py +80 -0
  180. package/tools/senior_code_review.py +14 -0
  181. package/tools/setup_project.py +9 -4
  182. package/tools/skill_canonical_digest.py +244 -0
  183. package/tools/skill_collision_guard.py +2 -2
  184. package/tools/skill_profiles.py +77 -7
  185. package/tools/skillspector.py +2 -1
  186. package/tools/slide_deck_exporter.py +477 -0
  187. package/tools/smart_visual_masker.py +3 -0
  188. package/tools/sync_skills_manifest.py +166 -0
  189. package/tools/task_memory_manager.py +260 -0
  190. package/tools/telemetry_correlator.py +3 -0
  191. package/tools/template_excel_exporter.py +2 -2
  192. package/tools/test_impact.py +3 -0
  193. package/tools/trace_data_flow.py +3 -0
  194. package/tools/traffic_session_converter.py +3 -0
  195. package/tools/ui_server.py +2 -2
  196. package/tools/universal_ir.py +3 -0
  197. package/tools/update_sentinel.py +15 -9
  198. package/tools/validate_groovy_scripts.py +3 -0
  199. package/tools/validate_host_interop.py +485 -0
  200. package/tools/validate_skills_schema.py +282 -0
  201. package/tools/verify_all.py +600 -63
  202. package/tools/visual_diff_canvas.py +3 -0
  203. package/tools/visual_som_helper.py +3 -0
  204. package/tools/watch_mode.py +4 -4
  205. package/tools/wcag_audit.py +3 -0
  206. package/tools/welcome_page.py +2 -2
@@ -0,0 +1,260 @@
1
+ #!/usr/bin/env python3
2
+ # SPDX-FileCopyrightText: © 2026 Thế Vị (@TeeVee98) <https://github.com/TeeVee98/Synapse-Hub>
3
+ # SPDX-License-Identifier: MIT
4
+
5
+ # -*- coding: utf-8 -*-
6
+ """
7
+ tools/task_memory_manager.py — Compaction-Resilient Working Memory Manager
8
+ Inspired by OthmanAdi/planning-with-files (28.1k ⭐).
9
+
10
+ Maintains disk-persistent working memory across agent compactions and sessions:
11
+ - task_plan.md: Strategic goal, phases, and active state.
12
+ - findings.md: Empirical discovery, DOM selectors, diagnostic evidence.
13
+ - progress.md: Checklists, milestones, step-by-step audit log.
14
+ - .checksums.json: SHA-256 cryptographic verification of file integrity.
15
+
16
+ 100% Python Standard Library (zero external dependencies).
17
+ """
18
+
19
+ import argparse
20
+ import datetime
21
+ import hashlib
22
+ import json
23
+ import os
24
+ import sys
25
+ from typing import Any, Dict, Optional, Tuple
26
+
27
+ DEFAULT_MEMORY_DIR = ".task_memory"
28
+
29
+
30
+ def compute_sha256(content: str) -> str:
31
+ """Computes SHA-256 hexadecimal digest for a string content."""
32
+ return hashlib.sha256(content.encode("utf-8")).hexdigest()
33
+
34
+
35
+ def compute_file_sha256(file_path: str) -> Optional[str]:
36
+ """Computes SHA-256 for a file on disk."""
37
+ if not os.path.isfile(file_path):
38
+ return None
39
+ with open(file_path, "r", encoding="utf-8") as f:
40
+ return hashlib.sha256(f.read().encode("utf-8")).hexdigest()
41
+
42
+
43
+ class TaskMemoryManager:
44
+ """Manages disk-persistent working memory files with cryptographic checksums."""
45
+
46
+ def __init__(self, memory_dir: str = DEFAULT_MEMORY_DIR):
47
+ self.memory_dir = os.path.abspath(memory_dir)
48
+ self.plan_path = os.path.join(self.memory_dir, "task_plan.md")
49
+ self.findings_path = os.path.join(self.memory_dir, "findings.md")
50
+ self.progress_path = os.path.join(self.memory_dir, "progress.md")
51
+ self.checksums_path = os.path.join(self.memory_dir, ".checksums.json")
52
+
53
+ def _read_checksums(self) -> Dict[str, str]:
54
+ if not os.path.isfile(self.checksums_path):
55
+ return {}
56
+ for _ in range(5):
57
+ try:
58
+ with open(self.checksums_path, "r", encoding="utf-8") as f:
59
+ return json.load(f)
60
+ except (json.JSONDecodeError, OSError):
61
+ continue
62
+ return {}
63
+
64
+ def _write_checksums(self, checksums: Dict[str, str]) -> None:
65
+ tmp_path = self.checksums_path + ".tmp"
66
+ actual_tmp = f"{tmp_path}.{os.getpid()}_{id(checksums)}"
67
+ with open(actual_tmp, "w", encoding="utf-8") as f:
68
+ json.dump(checksums, f, indent=2, ensure_ascii=False)
69
+ os.replace(actual_tmp, self.checksums_path)
70
+
71
+ def _update_file_checksum(self, filename: str, content: str) -> None:
72
+ checksums = self._read_checksums()
73
+ checksums[filename] = compute_sha256(content)
74
+ self._write_checksums(checksums)
75
+
76
+ def init_memory(self, title: str = "Task Execution Plan", goal: str = "Execute task according to DoD") -> Dict[str, str]:
77
+ """Initializes empty memory files if they do not exist."""
78
+ os.makedirs(self.memory_dir, exist_ok=True)
79
+ now = datetime.datetime.now(datetime.timezone.utc).isoformat()
80
+
81
+ if not os.path.isfile(self.plan_path):
82
+ initial_plan = (
83
+ f"# {title}\n\n"
84
+ f"> Initialized: `{now}`\n\n"
85
+ f"## 1. Goal & Requirements\n{goal}\n\n"
86
+ f"## 2. Phases & Milestones\n- [ ] Phase 1: Discovery & Analysis\n- [ ] Phase 2: Implementation\n- [ ] Phase 3: Verification & DoD\n\n"
87
+ f"## 3. Active Status\n`IN_PROGRESS`\n"
88
+ )
89
+ with open(self.plan_path, "w", encoding="utf-8") as f:
90
+ f.write(initial_plan)
91
+ self._update_file_checksum("task_plan.md", initial_plan)
92
+
93
+ if not os.path.isfile(self.findings_path):
94
+ initial_findings = (
95
+ f"# Empirical Findings & Evidence Log\n\n"
96
+ f"> Initialized: `{now}`\n\n"
97
+ f"| Timestamp | Category | Summary | Details |\n"
98
+ f"|---|---|---|---|\n"
99
+ )
100
+ with open(self.findings_path, "w", encoding="utf-8") as f:
101
+ f.write(initial_findings)
102
+ self._update_file_checksum("findings.md", initial_findings)
103
+
104
+ if not os.path.isfile(self.progress_path):
105
+ initial_progress = (
106
+ f"# Execution Progress & Milestone Ledger\n\n"
107
+ f"> Initialized: `{now}`\n\n"
108
+ f"## Milestones\n"
109
+ f"- [x] Task memory initialized (`{now}`)\n"
110
+ )
111
+ with open(self.progress_path, "w", encoding="utf-8") as f:
112
+ f.write(initial_progress)
113
+ self._update_file_checksum("progress.md", initial_progress)
114
+
115
+ return self._read_checksums()
116
+
117
+ def update_task_plan(self, content: str) -> str:
118
+ """Overwrites or updates task_plan.md and recomputes checksum."""
119
+ os.makedirs(self.memory_dir, exist_ok=True)
120
+ with open(self.plan_path, "w", encoding="utf-8") as f:
121
+ f.write(content)
122
+ sha = compute_sha256(content)
123
+ self._update_file_checksum("task_plan.md", content)
124
+ return sha
125
+
126
+ def record_finding(self, title: str, details: str, category: str = "OBSERVATION") -> None:
127
+ """Appends an empirical finding or diagnostic evidence to findings.md."""
128
+ os.makedirs(self.memory_dir, exist_ok=True)
129
+ now = datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC")
130
+ sanitized_title = str(title).replace("\r", " ").replace("\n", " ").replace("|", "/")
131
+ sanitized_cat = str(category).replace("\r", " ").replace("\n", " ").replace("|", "/")
132
+ sanitized_details = str(details).replace("\r", " ").replace("\n", " ").replace("|", "/")
133
+ row = f"| `{now}` | `{sanitized_cat}` | **{sanitized_title}** | {sanitized_details} |\n"
134
+
135
+ if not os.path.isfile(self.findings_path):
136
+ self.init_memory()
137
+
138
+ with open(self.findings_path, "a", encoding="utf-8") as f:
139
+ f.write(row)
140
+
141
+ with open(self.findings_path, "r", encoding="utf-8") as f:
142
+ content = f.read()
143
+ self._update_file_checksum("findings.md", content)
144
+
145
+ def record_progress(self, step: str, status: str = "DONE") -> None:
146
+ """Records a completed step or milestone in progress.md."""
147
+ os.makedirs(self.memory_dir, exist_ok=True)
148
+ now = datetime.datetime.now(datetime.timezone.utc).strftime("%H:%M:%S UTC")
149
+ sanitized_step = str(step).replace("\r", " ").replace("\n", " ")
150
+ sanitized_status = str(status).replace("\r", " ").replace("\n", " ")
151
+ mark = "[x]" if sanitized_status.upper() in ("DONE", "COMPLETED", "PASS") else "[-]"
152
+ entry = f"- {mark} `{now}` {sanitized_step} (`{sanitized_status}`)\n"
153
+
154
+ if not os.path.isfile(self.progress_path):
155
+ self.init_memory()
156
+
157
+ with open(self.progress_path, "a", encoding="utf-8") as f:
158
+ f.write(entry)
159
+
160
+ with open(self.progress_path, "r", encoding="utf-8") as f:
161
+ content = f.read()
162
+ self._update_file_checksum("progress.md", content)
163
+
164
+ def verify_integrity(self) -> Tuple[bool, Dict[str, Dict[str, Any]]]:
165
+ """
166
+ Verifies SHA-256 hashes of all memory files against recorded checksums.
167
+ Returns: (all_valid, details_map)
168
+ """
169
+ checksums = self._read_checksums()
170
+ results: Dict[str, Dict[str, Any]] = {}
171
+ all_valid = True
172
+
173
+ files = [
174
+ ("task_plan.md", self.plan_path),
175
+ ("findings.md", self.findings_path),
176
+ ("progress.md", self.progress_path),
177
+ ]
178
+
179
+ for fname, fpath in files:
180
+ expected = checksums.get(fname)
181
+ actual = compute_file_sha256(fpath)
182
+ valid = (actual is not None) and (actual == expected)
183
+ if not valid:
184
+ all_valid = False
185
+ results[fname] = {
186
+ "exists": os.path.isfile(fpath),
187
+ "expected_sha256": expected,
188
+ "actual_sha256": actual,
189
+ "valid": valid,
190
+ }
191
+
192
+ return all_valid, results
193
+
194
+ def export_summary(self) -> str:
195
+ """Exports a compact text summary of working memory state."""
196
+ valid, details = self.verify_integrity()
197
+ lines = [
198
+ f"Task Memory Status: {'VALID (100% SHA-256 Match)' if valid else 'COMPROMISED / MODIFIED'}",
199
+ f"Location: {self.memory_dir}",
200
+ ]
201
+ for fname, info in details.items():
202
+ status = "OK" if info["valid"] else "MISMATCH / MISSING"
203
+ lines.append(f" - {fname}: {status} (SHA: {str(info['actual_sha256'])[:8]}...)")
204
+ return "\n".join(lines)
205
+
206
+
207
+ def main() -> int:
208
+ parser = argparse.ArgumentParser(description="Compaction-Resilient Working Memory Manager (OthmanAdi Pattern)")
209
+ subparsers = parser.add_subparsers(dest="command", required=True)
210
+
211
+ # init
212
+ init_p = subparsers.add_parser("init", help="Initialize memory files")
213
+ init_p.add_argument("--dir", default=DEFAULT_MEMORY_DIR, help="Memory directory")
214
+ init_p.add_argument("--title", default="Task Execution Plan", help="Plan title")
215
+
216
+ # finding
217
+ finding_p = subparsers.add_parser("finding", help="Record finding")
218
+ finding_p.add_argument("title", help="Finding title")
219
+ finding_p.add_argument("details", help="Details text")
220
+ finding_p.add_argument("--dir", default=DEFAULT_MEMORY_DIR, help="Memory directory")
221
+ finding_p.add_argument("--cat", default="OBSERVATION", help="Category")
222
+
223
+ # progress
224
+ progress_p = subparsers.add_parser("progress", help="Record progress milestone")
225
+ progress_p.add_argument("step", help="Completed step description")
226
+ progress_p.add_argument("--dir", default=DEFAULT_MEMORY_DIR, help="Memory directory")
227
+ progress_p.add_argument("--status", default="DONE", help="Step status")
228
+
229
+ # verify
230
+ verify_p = subparsers.add_parser("verify", help="Verify cryptographic integrity")
231
+ verify_p.add_argument("--dir", default=DEFAULT_MEMORY_DIR, help="Memory directory")
232
+
233
+ args = parser.parse_args()
234
+ mgr = TaskMemoryManager(args.dir)
235
+
236
+ if args.command == "init":
237
+ res = mgr.init_memory(title=args.title)
238
+ print(f"✅ Initialized task memory in {args.dir} with checksums: {list(res.keys())}")
239
+ return 0
240
+
241
+ if args.command == "finding":
242
+ mgr.record_finding(title=args.title, details=args.details, category=args.cat)
243
+ print(f"✅ Recorded finding: '{args.title}' in {args.dir}/findings.md")
244
+ return 0
245
+
246
+ if args.command == "progress":
247
+ mgr.record_progress(step=args.step, status=args.status)
248
+ print(f"✅ Recorded progress: '{args.step}' in {args.dir}/progress.md")
249
+ return 0
250
+
251
+ if args.command == "verify":
252
+ valid, details = mgr.verify_integrity()
253
+ print(mgr.export_summary())
254
+ return 0 if valid else 1
255
+
256
+ return -1
257
+
258
+
259
+ if __name__ == "__main__":
260
+ sys.exit(main())
@@ -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
@@ -55,8 +55,8 @@ def find_project_config(start_dir: Optional[str] = None) -> Optional[Dict[str, A
55
55
  data = json.load(f)
56
56
  data["_config_dir"] = str(p)
57
57
  return data
58
- except Exception as _err:
59
- _ = _err
58
+ except Exception:
59
+ continue
60
60
  return None
61
61
 
62
62
 
@@ -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
  ---------------------------------------------------
@@ -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
  --------------------------------------------------------------------------------
@@ -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.3",
239
+ "version": "4.2.0",
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
 
@@ -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
  ---------------------------------------------------------
@@ -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.3")
71
+ return data.get("version", "4.2.0")
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.3")
80
+ return data.get("version", "4.2.0")
78
81
  except (OSError, json.JSONDecodeError):
79
82
  data = {}
80
83
 
81
- return "4.1.3"
84
+ return "4.2.0"
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
- _ = False
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
- _ = False
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
- _ = False
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