@teevee98/synapse-hub 4.0.0 → 4.1.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 (42) hide show
  1. package/.agents/rules/context-engineering.md +3 -3
  2. package/.agents/rules/security_testing_rules.md +8 -5
  3. package/README.en.md +2 -2
  4. package/README.md +2 -2
  5. package/agentskills.json +1 -1
  6. package/docs/ARCHITECTURE.en.md +1 -1
  7. package/docs/ARCHITECTURE.md +1 -1
  8. package/package.json +1 -1
  9. package/plugin.json +1 -1
  10. package/skills_manifest.json +162 -54
  11. package/synapse.config.json +17 -1
  12. package/tools/__init__.py +1 -1
  13. package/tools/ast_cache.py +1 -3
  14. package/tools/author_integrity.py +7 -2
  15. package/tools/benchmark_swarm_context.py +242 -151
  16. package/tools/browser_helpers.js +2 -2
  17. package/tools/build_consolidated_report.py +5 -5
  18. package/tools/check_version_sync.py +56 -0
  19. package/tools/cli.py +3 -3
  20. package/tools/core/file_lock.py +81 -6
  21. package/tools/core/telemetry.py +139 -1
  22. package/tools/core/token_estimator.py +145 -0
  23. package/tools/count_tokens.py +28 -0
  24. package/tools/dashboard_generator.py +6 -6
  25. package/tools/debt_harvester.py +20 -9
  26. package/tools/diagram_architect.py +0 -1
  27. package/tools/distill_log.py +266 -89
  28. package/tools/git_worktree_manager.py +1 -1
  29. package/tools/mcp_docx_server.py +1 -1
  30. package/tools/mcp_excel_server.py +1 -1
  31. package/tools/mcp_server.py +1 -1
  32. package/tools/mechanical_ui_gate.py +1 -1
  33. package/tools/micro_mutator.py +51 -10
  34. package/tools/pairwise_generator.py +0 -1
  35. package/tools/pentest_scope_guard.py +328 -0
  36. package/tools/perf/benchmark_perf_runner.py +226 -0
  37. package/tools/rules_router.py +326 -103
  38. package/tools/token_telemetry.py +224 -0
  39. package/tools/ui_server.py +1 -1
  40. package/tools/update_sentinel.py +3 -3
  41. package/tools/verify_all.py +24 -6
  42. package/tools/welcome_page.py +1 -1
@@ -20,11 +20,11 @@ description: Context engineering and token optimization protocols for large test
20
20
  - Tier 1: Check `tools/repo_map.txt` for class signatures (~500 tokens).
21
21
  - Tier 2: Check dependency blast radius via `tools/test_impact.py`.
22
22
  - Tier 3: Micro-read targeted 20–50 lines using `StartLine` and `EndLine`.
23
- - **English-First Documentation Reading:** When inspecting or reading documentation or architecture specifications with bilingual editions (e.g. `ARCHITECTURE.en.md` vs `ARCHITECTURE.md`, `README.en.md` vs `README.md`), always read the English version (`*.en.md`) to save 50–65% BPE tokens compared to accented Vietnamese text.
23
+ - **English-First Documentation Reading (BPE Token Density):** When inspecting or reading documentation or architecture specifications with bilingual editions (e.g. `ARCHITECTURE.en.md` vs `ARCHITECTURE.md`, `README.en.md` vs `README.md`), prioritize the English version (`*.en.md`). Standard subword BPE tokenizers (cl100k, o200k, Gemini) allocate ~1.8 chars/token for accented Vietnamese text compared to ~3.85 chars/token for English technical prose, yielding ~1.5x–2.2x higher token efficiency and preserving context window capacity.
24
24
 
25
25
  ## 3. KV-Cache Optimization & Static Prefix
26
- - Keep system instructions and rule headers static and immutable at the top.
27
- - Append new observations strictly at the bottom. Use identical status badges to maintain > 85% cache hit rates.
26
+ - Keep system instructions and rule headers static and immutable at the top to optimize provider prefix caching (e.g. Anthropic prompt caching with >= 1,024 prefix tokens, OpenAI prompt caching, Gemini context caching).
27
+ - Append new observations strictly at the bottom. Consistent status badge prefixes maintain prompt invariance across turns where context exceeds the provider cache activation threshold.
28
28
 
29
29
  ## 4. Compaction Anchoring & Subagent Isolation
30
30
  - Persist active test registers, IDs, and state to `PROJECT_STATE.md` so automated context compaction never causes state loss.
@@ -1,15 +1,18 @@
1
1
  # Security & Pentest Testing Invariants (5-Layer Safety Gate)
2
2
 
3
3
  > Rule chốt chặn bắt buộc khi thực thi `security-dast-sentinel` hoặc `skillspector-security-guard` trong Synapse-Hub.
4
+ > **Runtime Enforcement Engine:** Toàn bộ Layer 1 & Layer 2 được kiểm soát và cưỡng chế qua `tools/pentest_scope_guard.py` (`PentestScopeGuard`).
4
5
 
5
6
  ## 1. Layer 1 — Scope & Production Blocklist (Allowlist Gate)
6
- * Mọi script DAST/Fuzzing/Pentest (Burp Suite, OWASP ZAP, Nuclei, Python) bắt buộc đọc `TARGET_BASE_URL` và kiểm tra khớp với `ALLOWED_PENTEST_HOSTS` trong cấu hình môi trường.
7
- * **Từ chối thực thi ngay** nếu URL mục tiêu thuộc môi trường Production (`prod`, tên miền chính thức chưa nằm trong `ALLOWED_PENTEST_HOSTS`).
8
- * Bắt buộc hỏi xác nhận người dùng trước khi chạy bất kỳ lệnh quét chủ động (Active Scan / Fuzzing) nào.
7
+ * Mọi script DAST/Fuzzing/Pentest (Burp Suite, OWASP ZAP, Nuclei, Python) bắt buộc tích hợp `PentestScopeGuard` (`tools/pentest_scope_guard.py`), đọc `TARGET_BASE_URL` và kiểm tra khớp với `ALLOWED_PENTEST_HOSTS`.
8
+ * **Cơ chế Fail-Closed / Mặc định từ chối:** Nếu `ALLOWED_PENTEST_HOSTS` trống, toàn bộ quét chủ động bị ngắt.
9
+ * **Từ chối thực thi ngay** nếu URL mục tiêu thuộc môi trường Production (`prod`, `live`, tên miền chính thức chưa nằm trong `ALLOWED_PENTEST_HOSTS`), hoặc trỏ tới AWS Metadata (`169.254.169.254`) / RFC1918 internal IPs trái phép.
10
+ * Mọi chuyển hướng (HTTP Redirect 301/302) đều phải qua `validate_redirect` để chống SSRF bounce.
11
+ * Bắt buộc có cờ xác nhận `--confirm-pentest-scope` hoặc `PENTEST_CONSENT_ACKNOWLEDGED=1` trước khi chạy quét chủ động. Mọi lần kiểm tra được ghi vào audit trail `.synapse/pentest_audit.log`.
9
12
 
10
13
  ## 2. Layer 2 — Rate-Limit & Concurrency Cap
11
- * Giới hạn cứng tốc độ gửi request trong script tự động: tối đa `5–10 req/s` và tối đa `3–5` luồng song song (trừ bài test Rate-Limit có xác nhận riêng).
12
- * Bắt buộc đặt `timeout <= 10s` cho mọi HTTP request và tự ngắt script nếu gặp `5xx` hoặc `429` liên tiếp vượt ngưỡng.
14
+ * Thực thi qua `PentestRateLimiter`: Giới hạn cứng tốc độ gửi request: tối đa `5–10 req/s` và tối đa `3–5` luồng song song (trừ bài test Rate-Limit có xác nhận riêng).
15
+ * Bắt buộc đặt `timeout <= 10s` cho mọi HTTP request và tự động kích hoạt Circuit Breaker ngắt script nếu gặp `5xx` hoặc `429` liên tiếp vượt ngưỡng.
13
16
 
14
17
  ## 3. Layer 3 — Non-Destructive PoC & Account Isolation
15
18
  * Chỉ dùng payload chứng minh lỗ hổng vô hại (SQLi đọc an toàn, canary string, time-delay nhỏ). Cấm tuyệt đối payload xóa/sửa dữ liệu (`DROP`, `DELETE`, `UPDATE` không điều kiện) hoặc gây DoS.
package/README.en.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  > **Core Mission:** A standalone linter and guardrail engine (zero external dependencies for core engine & DoD gates) safeguarding automated test suites when AI writes code — Automatically catching "fake-pass" tests (0 assertions, tautologies), eliminating fixed sleeps, compressing 95% of CI/CD log noise, and enforcing Clean POM architecture.
8
8
  > **Author:** Thế Vị ([@TeeVee98](https://github.com/TeeVee98)) | **License:** MIT License
9
- > **Version:** `v4.0.0` | **Scale:** 53 Standardized QA Skills, 9 Specialized AI Agents, 10 DoD Quality Gates.
9
+ > **Version:** `v4.1.0` | **Scale:** 53 Standardized QA Skills, 9 Specialized AI Agents, 10 DoD Quality Gates.
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/@teevee98/synapse-hub.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/@teevee98/synapse-hub)
12
12
  [![node version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
@@ -154,7 +154,7 @@ Every test code change must satisfy all 10 Quality Gates before pull request mer
154
154
  # Pre-commit hook (.pre-commit-config.yaml):
155
155
  repos:
156
156
  - repo: https://github.com/TeeVee98/Synapse-Hub
157
- rev: v4.0.0
157
+ rev: v4.1.0
158
158
  hooks:
159
159
  - id: synapse-lint
160
160
  - id: synapse-verify
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  > **Định vị cốt lõi:** Bộ Linter & Guardrails độc lập (zero external dependencies cho core engine & DoD gates) bảo vệ độ tin cậy của test suite khi AI viết code — Tự động bắt test "pass ảo" (0 assert, tautology), loại bỏ hoàn toàn sleep cố định, nén 95% log CI/CD, và chuẩn hóa cấu trúc Clean POM.
8
8
  > **Tác giả:** Thế Vị ([@TeeVee98](https://github.com/TeeVee98)) | **Giấy phép:** MIT License
9
- > **Phiên bản:** `v4.0.0` | **Quy mô:** 53 Kỹ năng QA, 9 Vai trò AI Agent, 10 Cổng kiểm định DoD.
9
+ > **Phiên bản:** `v4.1.0` | **Quy mô:** 53 Kỹ năng QA, 9 Vai trò AI Agent, 10 Cổng kiểm định DoD.
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/@teevee98/synapse-hub.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/@teevee98/synapse-hub)
12
12
  [![node version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
@@ -154,7 +154,7 @@ Mọi thay đổi mã nguồn kiểm thử đều được kiểm chứng qua 10
154
154
  # Pre-commit hook (.pre-commit-config.yaml):
155
155
  repos:
156
156
  - repo: https://github.com/TeeVee98/Synapse-Hub
157
- rev: v4.0.0
157
+ rev: v4.1.0
158
158
  hooks:
159
159
  - id: synapse-lint
160
160
  - id: synapse-verify
package/agentskills.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agentskills.io/schema/v1.json",
3
3
  "name": "Synapse-Hub",
4
- "version": "4.0.0",
4
+ "version": "4.1.0",
5
5
  "description": "Enterprise QA & Test Automation AI Skills Ecosystem — 53 skills organised across 11 Domain Packages adhering to Clean POM Flat Architecture.",
6
6
  "author": "Thế Vị (@TeeVee98)",
7
7
  "repository": "https://github.com/TeeVee98/Synapse-Hub",
@@ -3,7 +3,7 @@
3
3
  [🇻🇳 Tiếng Việt](ARCHITECTURE.md) | [🇬🇧 English Edition](ARCHITECTURE.en.md)
4
4
 
5
5
  > **Scope:** Enterprise Multi-Agent QA Hub
6
- > **Version:** `4.0.0` | **Status:** Active / Production Standard
6
+ > **Version:** `4.1.0` | **Status:** Active / Production Standard
7
7
 
8
8
  ---
9
9
 
@@ -3,7 +3,7 @@
3
3
  [🇻🇳 Tiếng Việt](ARCHITECTURE.md) | [🇬🇧 English Edition](ARCHITECTURE.en.md)
4
4
 
5
5
  > **Phạm vi:** Enterprise Multi-Agent QA Hub
6
- > **Version:** `4.0.0` | **Trạng thái:** Hoạt động / Tiêu chuẩn Sản xuất
6
+ > **Version:** `4.1.0` | **Trạng thái:** Hoạt động / Tiêu chuẩn Sản xuất
7
7
  > **Tác giả:** Thế Vị (@TeeVee98) | **Giấy phép:** MIT License
8
8
 
9
9
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teevee98/synapse-hub",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Enterprise AI Agent Intelligence Hub & Autonomous Skill Network",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "synapse-hub",
3
3
  "displayName": "Synapse Hub Enterprise QA",
4
- "version": "4.0.0",
4
+ "version": "4.1.0",
5
5
  "description": "Enterprise AI Agent Intelligence Hub & Autonomous Skill Network for Quality Engineering, Clean POM, and Automated Testing.",
6
6
  "author": {
7
7
  "name": "TeeVee98",