synapse-hub 3.0.0 → 3.0.1

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 (65) hide show
  1. package/.agents/rules/communication-style.md +4 -0
  2. package/.agents/rules/context-engineering.md +1 -0
  3. package/.agents/rules/git-push-protocol.md +17 -0
  4. package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
  5. package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
  6. package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
  7. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
  8. package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
  9. package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +1 -1
  10. package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
  11. package/.agents/skills/persistent-planning-files/SKILL.md +1 -1
  12. package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
  13. package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
  14. package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
  15. package/.agents/skills/surgical-coding-principles/SKILL.md +1 -1
  16. package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
  17. package/.agents/skills/verification-before-completion/SKILL.md +2 -2
  18. package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +2 -2
  19. package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
  20. package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +61 -0
  21. package/AGENTS.md +6 -4
  22. package/CLAUDE.md +1 -0
  23. package/README.en.md +8 -8
  24. package/README.md +3 -3
  25. package/action.yml +1 -1
  26. package/bin/agent-qa.js +2 -2
  27. package/docs/ARCHITECTURE.en.md +192 -0
  28. package/docs/ARCHITECTURE.md +127 -126
  29. package/docs/CI_CD_INTEGRATION.en.md +96 -0
  30. package/docs/CI_CD_INTEGRATION.md +24 -22
  31. package/docs/CLI_REFERENCE.en.md +174 -0
  32. package/docs/CLI_REFERENCE.md +120 -115
  33. package/docs/CONTRIBUTING.en.md +49 -0
  34. package/docs/CONTRIBUTING.md +25 -67
  35. package/docs/QUALITY_GATES.en.md +115 -0
  36. package/docs/QUALITY_GATES.md +82 -80
  37. package/docs/research/agent_skill_training_analysis.md +1 -1
  38. package/package.json +1 -1
  39. package/skills_manifest.json +1 -1
  40. package/synapse.config.json +1 -1
  41. package/templates/ai_bridges/CLAUDE.md +1 -0
  42. package/tools/__init__.py +1 -1
  43. package/tools/auto_heal_reflexion.py +8 -0
  44. package/tools/browser_helpers.js +2 -2
  45. package/tools/bump_version.py +15 -14
  46. package/tools/check_version_sync.py +24 -7
  47. package/tools/cli.py +3 -3
  48. package/tools/contract_validator.py +141 -0
  49. package/tools/dashboard_generator.py +11 -11
  50. package/tools/db_sandbox.py +22 -9
  51. package/tools/generate_allure_report.py +1 -1
  52. package/tools/infer_linter.py +135 -21
  53. package/tools/mcp_excel_server.py +1 -1
  54. package/tools/mcp_server.py +7 -4
  55. package/tools/micro_mutator.py +21 -3
  56. package/tools/reversible_sandbox.py +2 -2
  57. package/tools/senior_code_review.py +2 -1
  58. package/tools/skill_vault.py +82 -3
  59. package/tools/skillspector.py +5 -1
  60. package/tools/sync_agent_rules.py +1 -0
  61. package/tools/test_impact.py +2 -1
  62. package/tools/update_sentinel.py +3 -3
  63. package/tools/verify_all.py +2 -2
  64. package/tools/visual_diff_canvas.py +3 -2
  65. package/tools/welcome_page.py +1 -1
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Playwright Core Web Vitals (CWV) Profiling Fixture via Chrome DevTools Protocol (CDP)
3
+ * Measures LCP (Largest Contentful Paint), CLS (Cumulative Layout Shift), and INP budgets.
4
+ */
5
+
6
+ import { test as base, expect } from '@playwright/test';
7
+
8
+ interface PerformanceMetrics {
9
+ lcp: number; // ms
10
+ cls: number; // score
11
+ domContentLoaded: number; // ms
12
+ }
13
+
14
+ export const test = base.extend<{ perfMetrics: PerformanceMetrics }>({
15
+ perfMetrics: async ({ page }, use) => {
16
+ const client = await page.context().newCDPSession(page);
17
+ await client.send('Performance.enable');
18
+
19
+ // Collect performance entries after page navigation
20
+ const getMetrics = async (): Promise<PerformanceMetrics> => {
21
+ const rawMetrics = await client.send('Performance.getMetrics');
22
+ const metricsMap = new Map(rawMetrics.metrics.map(m => [m.name, m.value]));
23
+
24
+ // Query window performance observer for LCP & CLS
25
+ const cwv = await page.evaluate(() => {
26
+ return new Promise<{ lcp: number; cls: number }>((resolve) => {
27
+ let lcp = 0;
28
+ let cls = 0;
29
+
30
+ new PerformanceObserver((entryList) => {
31
+ const entries = entryList.getEntries();
32
+ const lastEntry = entries[entries.length - 1];
33
+ lcp = lastEntry ? lastEntry.startTime : 0;
34
+ }).observe({ type: 'largest-contentful-paint', buffered: true });
35
+
36
+ new PerformanceObserver((entryList) => {
37
+ for (const entry of entryList.getEntries() as any[]) {
38
+ if (!entry.hadRecentInput) cls += entry.value;
39
+ }
40
+ }).observe({ type: 'layout-shift', buffered: true });
41
+
42
+ setTimeout(() => resolve({ lcp, cls }), 1500);
43
+ });
44
+ });
45
+
46
+ return {
47
+ lcp: Math.round(cwv.lcp),
48
+ cls: Math.round(cwv.cls * 1000) / 1000,
49
+ domContentLoaded: (metricsMap.get('DomContentLoaded') || 0) * 1000,
50
+ };
51
+ };
52
+
53
+ // Execute test body
54
+ await use({ lcp: 0, cls: 0, domContentLoaded: 0 });
55
+
56
+ // Assert CWV Budget enforcement: LCP < 2500ms, CLS < 0.1
57
+ const finalMetrics = await getMetrics();
58
+ expect(finalMetrics.lcp).toBeLessThan(2500);
59
+ expect(finalMetrics.cls).toBeLessThan(0.10);
60
+ },
61
+ });
package/AGENTS.md CHANGED
@@ -11,6 +11,7 @@
11
11
  `> 🛡️ **Synapse Hub Active:** Clean POM / Flat Architecture`
12
12
  *(Strictly prohibited from containing the string `[OK]`)*. Omit footer telemetry by default to save tokens. Detailed footer is opt-in when requested ("bật telemetry").
13
13
  2. **Pragmatic Communication:** Converse and format telemetry in Vietnamese (clear, direct, action-oriented, zero tech-jargon overload). All codebase files, test scripts, Page Classes, docstrings, and commits remain strictly in English.
14
+ 3. **English-First Documentation Ingestion (Token Saver):** Whenever inspecting or referencing project documentation, architecture specifications, or readmes that have bilingual counterparts (e.g. `ARCHITECTURE.en.md` vs `ARCHITECTURE.md`, `README.en.md` vs `README.md`), always read the English version (`*.en.md`). English achieves significantly higher token density (saving 50–65% BPE tokens vs diacritic Vietnamese), preserving context window capacity.
14
15
 
15
16
  ---
16
17
 
@@ -31,10 +32,11 @@ You are a lazy senior developer. The best code is the code never written. Solve
31
32
  2. **The 7-Rung Ladder (Stop at the first rung that fully works):**
32
33
  - **Rung 1:** *Does it need to exist?* (YAGNI). Skip unrequested features, options, and speculative flexibility in one line.
33
34
  - **Rung 2:** *Already in this codebase?* Use existing helpers, Page Classes, BasePage methods, and patterns.
34
- - **Rung 3:** *Standard library or platform native?* Use language stdlib or test framework native features (Playwright auto-waiting, web-first assertions).
35
- - **Rung 4:** *An installed dependency?* Use existing dependencies. Never add a package for a few lines.
36
- - **Rung 5:** *Can it be one clear line?* Write a line a reader grasps at a glance.
37
- - **Rung 6:** *Otherwise:* Write the minimum complete code that works.
35
+ - **Rung 3:** *Standard library?* Use language stdlib unless the project has its own equivalent.
36
+ - **Rung 4:** *Platform or framework native?* Use test framework native features (Playwright auto-waiting, web-first assertions).
37
+ - **Rung 5:** *An installed dependency?* Use existing dependencies. Never add a package for a few lines.
38
+ - **Rung 6:** *Can it be one clear line?* Write a line a reader grasps at a glance.
39
+ - **Rung 7:** *Otherwise:* Write the minimum complete code that works.
38
40
  3. **Completeness & Execution Invariants:**
39
41
  - Be lazy about the solution, never about the change: finish every part the task needs, including callers, tests, and fixtures your change affects.
40
42
  - Zero unnecessary abstractions: no wrappers, speculative options, configs, or "for later" boilerplate nobody asked for. Deletion beats addition.
package/CLAUDE.md CHANGED
@@ -46,6 +46,7 @@ In accordance with the MIT License, the original copyright notice crediting **Th
46
46
  5. **Pragmatic Communication Protocol:**
47
47
  - Conversational responses, explanation, and telemetry MUST be in Vietnamese.
48
48
  - All codebase assets, test scripts, Page Classes, docstrings, and commits MUST remain strictly in English.
49
+ - English-First Document Ingestion: When reading bilingual docs (e.g. ARCHITECTURE.en.md vs ARCHITECTURE.md), always read the English version (*.en.md) to save 50–65% BPE tokens.
49
50
 
50
51
  6. **Lean Senior Dev Protocol (The 7-Rung Ladder & YAGNI):**
51
52
  - The best code is the code never written. Solve the whole problem with the least new code.
package/README.en.md CHANGED
@@ -6,11 +6,11 @@
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ị ([@TeeVee998](https://github.com/TeeVee998)) | **License:** MIT License
9
- > **Version:** `v2.9.0` | **Scale:** 51 Standardized QA Skills, 6 Specialized AI Agents, 10 DoD Quality Gates.
9
+ > **Version:** `v3.0.1` | **Scale:** 51 Standardized QA Skills, 6 Specialized AI Agents, 10 DoD Quality Gates.
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/synapse-hub.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/synapse-hub)
12
12
  [![node version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
13
- [![python version](https://img.shields.io/badge/python-%3E%3D3.9-blue.svg?style=flat-square)](https://python.org)
13
+ [![python version](https://img.shields.io/badge/python-%3E%3D3.10-blue.svg?style=flat-square)](https://python.org)
14
14
  [![license](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/TeeVee998/Synapse-Hub/blob/main/LICENSE)
15
15
  [![Ecosystem](https://img.shields.io/badge/AI%20Ecosystem-Antigravity%20%7C%20Cursor%20%7C%20Claude%20%7C%20Copilot%20%7C%20Windsurf-orange.svg?style=flat-square)](#)
16
16
 
@@ -113,7 +113,7 @@ Every test code change must satisfy all 10 Quality Gates before pull request mer
113
113
  # Pre-commit hook (.pre-commit-config.yaml):
114
114
  repos:
115
115
  - repo: https://github.com/TeeVee998/Synapse-Hub
116
- rev: v3.0.0
116
+ rev: v3.0.1
117
117
  hooks:
118
118
  - id: synapse-lint
119
119
  - id: synapse-verify
@@ -123,8 +123,8 @@ repos:
123
123
 
124
124
  ## 📚 Deep Technical Documentation
125
125
 
126
- - 🏛️ **Architecture & Industry Comparison Matrix:** [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)
127
- - 🛡️ **10 Quality Gates Definition of Done (DoD):** [docs/QUALITY_GATES.md](docs/QUALITY_GATES.md)
128
- - 📖 **Comprehensive CLI Command Reference:** [docs/CLI_REFERENCE.md](docs/CLI_REFERENCE.md)
129
- - 🚀 **CI/CD Pipeline Integration Playbook:** [docs/CI_CD_INTEGRATION.md](docs/CI_CD_INTEGRATION.md)
130
- - 🤝 **Open-Source Contributing Guidelines:** [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md)
126
+ - 🏛️ **Architecture & Industry Comparison Matrix:** [docs/ARCHITECTURE.en.md](docs/ARCHITECTURE.en.md)
127
+ - 🛡️ **10 Quality Gates Definition of Done (DoD):** [docs/QUALITY_GATES.en.md](docs/QUALITY_GATES.en.md)
128
+ - 📖 **Comprehensive CLI Command Reference:** [docs/CLI_REFERENCE.en.md](docs/CLI_REFERENCE.en.md)
129
+ - 🚀 **CI/CD Pipeline Integration Playbook:** [docs/CI_CD_INTEGRATION.en.md](docs/CI_CD_INTEGRATION.en.md)
130
+ - 🤝 **Open-Source Contributing Guidelines:** [docs/CONTRIBUTING.en.md](docs/CONTRIBUTING.en.md)
package/README.md CHANGED
@@ -6,11 +6,11 @@
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ị ([@TeeVee998](https://github.com/TeeVee998)) | **Giấy phép:** MIT License
9
- > **Phiên bản:** `v2.9.0` | **Quy mô:** 51 Kỹ năng QA, 6 Vai trò AI Agent, 10 Cổng kiểm định DoD.
9
+ > **Phiên bản:** `v3.0.1` | **Quy mô:** 51 Kỹ năng QA, 6 Vai trò AI Agent, 10 Cổng kiểm định DoD.
10
10
 
11
11
  [![npm version](https://img.shields.io/npm/v/synapse-hub.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/synapse-hub)
12
12
  [![node version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
13
- [![python version](https://img.shields.io/badge/python-%3E%3D3.9-blue.svg?style=flat-square)](https://python.org)
13
+ [![python version](https://img.shields.io/badge/python-%3E%3D3.10-blue.svg?style=flat-square)](https://python.org)
14
14
  [![license](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/TeeVee998/Synapse-Hub/blob/main/LICENSE)
15
15
  [![Ecosystem](https://img.shields.io/badge/AI%20Ecosystem-Antigravity%20%7C%20Cursor%20%7C%20Claude%20%7C%20Copilot%20%7C%20Windsurf-orange.svg?style=flat-square)](#)
16
16
 
@@ -113,7 +113,7 @@ Mọi thay đổi mã nguồn kiểm thử đều được kiểm chứng qua 10
113
113
  # Pre-commit hook (.pre-commit-config.yaml):
114
114
  repos:
115
115
  - repo: https://github.com/TeeVee998/Synapse-Hub
116
- rev: v3.0.0
116
+ rev: v3.0.1
117
117
  hooks:
118
118
  - id: synapse-lint
119
119
  - id: synapse-verify
package/action.yml CHANGED
@@ -28,7 +28,7 @@ runs:
28
28
  using: "composite"
29
29
  steps:
30
30
  - name: Set up Python
31
- uses: actions/setup-python@v5
31
+ uses: actions/setup-python@v7
32
32
  with:
33
33
  python-version: "3.10"
34
34
 
package/bin/agent-qa.js CHANGED
@@ -59,8 +59,8 @@ function main() {
59
59
  if (process.argv.includes('--first-run')) {
60
60
  process.exit(0);
61
61
  }
62
- console.error(`\n${BOLD}${RED}[ERROR] Python 3.9+ is required to execute synapse-hub tools.${RESET}`);
63
- console.error(`Neither ${CYAN}python3${RESET} nor ${CYAN}python${RESET} (>= 3.9) was found on your PATH.`);
62
+ console.error(`\n${BOLD}${RED}[ERROR] Python 3.10+ is required to execute synapse-hub tools.${RESET}`);
63
+ console.error(`Neither ${CYAN}python3${RESET} nor ${CYAN}python${RESET} (>= 3.10) was found on your PATH.`);
64
64
  console.error(`👉 Please install Python from: ${BOLD}https://www.python.org/downloads/${RESET}\n`);
65
65
  process.exit(1);
66
66
  }
@@ -0,0 +1,192 @@
1
+ # Agent-Skills Architecture & Design Principles
2
+
3
+ [🇻🇳 Tiếng Việt](ARCHITECTURE.md) | [🇬🇧 English Edition](ARCHITECTURE.en.md)
4
+
5
+ > **Scope:** Enterprise Multi-Agent QA Hub
6
+ > **Version:** `3.0.1` | **Status:** Active / Production Standard
7
+
8
+ ---
9
+
10
+ ## 1. Hub & Spoke Operating Model
11
+
12
+ The `agent-skills` repository functions as a centralized **Intelligence Core (Hub)** decoupled from target test repositories (**Spokes**).
13
+
14
+ ```mermaid
15
+ flowchart TD
16
+ subgraph Hub["Agent-Skills Hub (Intelligence Core)"]
17
+ Catalog["51 Standardized Skills (.agents/skills)"]
18
+ Rules["Core Architectural Rules (.agents/rules)"]
19
+ Tools["Zero-Token Python Engine (tools/)"]
20
+ Swarm["6 Specialized Subagents (.agents/agents)"]
21
+ end
22
+
23
+ subgraph Spokes["Target Repositories (Test Suites)"]
24
+ Repo1["Project A (Playwright / TS)"]
25
+ Repo2["Project B (Katalon / Groovy)"]
26
+ Repo3["Project C (Python / Pytest)"]
27
+ end
28
+
29
+ Hub -->|Mounted as Skill Provider| Repo1
30
+ Hub -->|Mounted as Skill Provider| Repo2
31
+ Hub -->|Mounted as Skill Provider| Repo3
32
+ ```
33
+
34
+ ### Architectural Benefits:
35
+ 1. **Zero Context Contagion:** Target project repositories stay clean and focused strictly on test cases and Page Classes, without polluting git trees with heavy AI agent instructions.
36
+ 2. **Instant Upgradability:** Improvements to self-healing algorithms, token compressors, and lint rules propagate globally to all target projects instantly.
37
+ 3. **Intellectual Property Isolation by Architecture:** Because `agent-skills` is a decoupled, standalone repository, target projects remain 100% clean without requiring complex dual-remote mirroring or `smart_push` scripts. Developers and agents push directly to company SCM for target projects, and to the central hub for skills.
38
+
39
+ ---
40
+
41
+ ## 2. Four-Tier Skill Stratification
42
+
43
+ The 51 skills in the hub are structured into four progressive operational tiers:
44
+
45
+ ```mermaid
46
+ flowchart LR
47
+ T1["Tier 1: Core Automation<br/>POM, Live Probing, Repair"] --> T2["Tier 2: Enterprise Quality<br/>WCAG, Visual, Vitals"]
48
+ T2 --> T3["Tier 3: Context & AI Performance<br/>Token Optimization, Graphify"]
49
+ T3 --> T4["Tier 4: Architecture & CI/CD<br/>ADR, Sharding, GitHub Actions"]
50
+ ```
51
+
52
+ 1. **Tier 1 — Core Automation & Self-Healing:**
53
+ - Script generation, Clean POM flat architecture, live DOM probing via Playwright MCP, and in-place locator healing.
54
+ 2. **Tier 2 — Enterprise Quality Sentinel:**
55
+ - Accessibility audits (WCAG 2.2), Core Web Vitals profiling, visual regression comparisons, and synthetic data generation.
56
+ 3. **Tier 3 — AI Context Engineering & Diagnostics:**
57
+ - Attention-pattern protection, context degradation countermeasures, token optimization, and AST knowledge graph navigation.
58
+ 4. **Tier 4 — Architecture, CI/CD & Delivery:**
59
+ - Architecture Decision Records (ADRs), code refactoring and technical debt remediation, and containerized GitHub Actions CI/CD pipelines.
60
+
61
+ ---
62
+
63
+ ## 3. Flat Clean POM Architecture Pattern
64
+
65
+ Test automation scripts orchestrated through this Hub enforce strict Clean POM boundaries:
66
+
67
+ - **Rule 1 — Zero Selectors in Scripts:** Test scripts (`Scripts/` or `tests/`) must NEVER contain raw XPaths, CSS selectors, or `findTestObject` calls.
68
+ - **Rule 2 — Single Inheritance:** All Page Classes inherit from `BasePage`, which standardizes smart waits, dynamic identifiers, and synthetic event dispatchers.
69
+ - **Rule 3 — Dynamic Test Data Idempotency:** Every data entity must use dynamic prefixes generated via `BasePage.uniqueCode("PREFIX_")` to eliminate database key collisions during parallel execution.
70
+ - **Rule 4 — In-Place Self-Healing:** If an element changes or breaks, only the affected Page Class is updated; test scripts remain untouched.
71
+
72
+ ---
73
+
74
+ ## 4. The 10 Quality Gates Definition-of-Done (DoD)
75
+
76
+ All automated test code authored, modified, or refactored by AI agents must pass through the deterministic 10 Quality Gates pipeline (`tools/verify_all.py`) prior to committing or merging:
77
+
78
+ | Gate | Title | Verifier Tool | Strict Acceptance Criteria |
79
+ | :---: | :--- | :--- | :--- |
80
+ | **Gate 0** | **Author Attribution & MIT Provenance** | `author_integrity.py` | Validates immutable MIT license and attribution to original author Thế Vị (@TeeVee998). |
81
+ | **Gate 1** | **UTF-8 No BOM Clean Encoding** | `verify_all.py` | Scans 100% of repository files; zero BOM bytes (`0xEF, 0xBB, 0xBF`) and zero mojibake errors. |
82
+ | **Gate 2** | **Path Portability** | `verify_all.py` | Rejects workstation-specific absolute paths (`/Users/...`, `C:\...`); mandates root-relative resolution. |
83
+ | **Gate 3** | **Clean POM Flat Architecture** | `verify_all.py` | Enforces 100% locator encapsulation in Page Classes; strictly prohibits raw XPaths in test scripts. |
84
+ | **Gate 4** | **AI Docs Anti-Drift** | `lint_ai_docs.py` | Reconciles real AST classes against `PROJECT_AI_GUIDE.md`; eliminates hallucinated PageClasses. |
85
+ | **Gate 5** | **Temporary File Blacklist** | `verify_all.py` | Ensures zero build debris, memory dumps, or temporary sandbox databases leak into version control. |
86
+ | **Gate 6** | **Credential Security** | `verify_all.py` | AST regex scan blocking hardcoded passwords, private keys, and secret tokens in code. |
87
+ | **Gate 7** | **Static Defect & Fake-Pass Sentinel** | `infer_linter.py` | Detects 0-assertion tests, swallowed exception blocks (`except: pass`), hard sleeps, and unawaited promises. |
88
+ | **Gate 8** | **Assertion Sensitivity Sentinel** | `micro_mutator.py` | Syntactic micro-mutations linked via variable dataflow; requires Sensitivity Score $\ge 80\%$. |
89
+ | **Gate 9** | **Tier-2 Skill Routing & Collision Guard** | `skill_collision_guard.py` | Audits skill trigger descriptions and vectors; blocks ambiguous activation with semantic overlap $\ge 0.75$. |
90
+
91
+ ---
92
+
93
+ ## 5. Architectural Boundaries & Non-Goals
94
+
95
+ To maintain a lightweight, deterministic, and highly portable architecture, Synapse Hub establishes explicit boundaries:
96
+ - **No Proprietary Test Runner:** Does not implement a replacement runner engine. Bridges natively with standard runners (Playwright, Pytest, Katalon/Gradle, Newman, JMeter).
97
+ - **Zero AUT Source Code Modifications:** Operates exclusively within test specifications, Page Object models, mock definitions, and verification gates.
98
+ - **Decoupled Stateless Hub:** Never writes persistent user credentials or proprietary corporate data to git.
99
+ - **Target Language Agnostic:** Leverages Universal Intermediate Representation (Universal IR) to bridge TypeScript, Python, Groovy, and Java seamlessly.
100
+
101
+ The Hub equips 6 specialized subagents with scoped tool and skill permissions:
102
+
103
+ | Subagent Role | Primary Focus | Allowed Skills | Execution Tools |
104
+ | :--- | :--- | :--- | :--- |
105
+ | **`orchestrator`** | Task decomposition & governance | `agent-orchestration-multi-agent-optimize`, `graphify-impact-analyzer`, `architecture-decision-records`, `token-and-context-optimizer`, `actor-qa-swarm`, `event-stream-qa-orchestrator`, `qa-memory-os`, `tot-exploratory-testing`, `review-spec` | `verify_all.py`, `test_impact.py`, `setup_project.py`, `interview_story.py`, `dspy_qa_signatures.py`, `autogen_qa_broker.py`, `qa_event_stream.py`, `test_memory_os.py`, `tot_exploratory_tester.py`, `watch_mode.py`, `dashboard_generator.py` |
106
+ | **`pom-crafter`** | Clean POM design & test generation | `clean-pom-crafter`, `lam-script-generator`, `synthetic-test-data-generator`, `api-spec-to-e2e-matrix`, `gherkin-to-suite`, `mipro-prompt-compiler`, `qa-aci-interface` | `lookup_xpath.py`, `repo_map.py`, `generate_tc_from_story.py`, `skill_vault.py`, `gherkin_suite.py`, `swe_qa_aci.py`, `mipro_assertion_tuner.py`, `api_fuzzer.py`, `export_postman_collection.py` |
107
+ | **`live-explorer`** | Live DOM & AOM exploration (<200ms) | `playwright-live-interaction`, `self-healing-locator`, `visual-regression-sentinel`, `api-network-mocking-interception` | `browser_helpers.js`, `e2e_flow_prober.ps1`, `safety_firewall.py` |
108
+ | **`test-runner`** | Headless CLI test execution & CI | `katalon-cli-runner`, `e2e-testing-patterns`, `flaky-test-sentinel-and-quarantine`, `backend-load-and-stress-patterns`, `github-actions-templates` | `matrix_sharder.py`, `distill_log.py`, `pinpoint_failure.py`, `flaky_detector.py`, `reversible_sandbox.py`, `generate_jmx_plan.py`, `jtl_analyzer.py`, `newman_analyzer.py`, `traffic_session_converter.py`, `db_sandbox.py` |
109
+ | **`failure-analyst`**| Visual & XML error autopsy | `failure-autopsy-and-healing`, `self-healing-locator`, `file-and-report-validator`, `systematic-debugging`, `agentless-qa-repair` | `auto_heal.py`, `heal_pr_automator.py`, `pinpoint_failure.py`, `cache_resolver.py`, `auto_heal_reflexion.py`, `agentless_patcher.py`, `heuristic_locator_matcher.py`, `telemetry_correlator.py` |
110
+ | **`quality-gatekeeper`**| 10 Gates DoD & Fake-Pass Sentinel | `antigravity-test-sentinel`, `code-refactoring-refactor-clean`, `wcag-audit-patterns`, `web-vitals-and-performance-profiler`, `security-dast-sentinel`, `lean-impact-scoreboard`, `web-agent-gym-benchmarking` | `verify_all.py`, `infer_linter.py`, `micro_mutator.py`, `trace_data_flow.py`, `skill_collision_guard.py`, `textgrad_mutation_optimizer.py`, `skillspector.py`, `author_integrity.py`, `browsergym_eval.py` |
111
+
112
+ ### 5.1 Standalone CLI Utilities & Hub Infrastructure Tools (Non-Persona Scoped)
113
+
114
+ The remaining 7 tools serve as global repository entry points and offline infrastructure services, callable directly without subagent persona routing:
115
+ - `cli.py`: Central Agent-QA / Synapse CLI command router and entrypoint (`npx synapse-hub` / `agent-qa`).
116
+ - `output_formatter.py`: ANSI terminal color styling, status badges, and table formatting utility.
117
+ - `welcome_page.py`: Visual HTML onboarding and landing page generator (`agent-qa welcome`).
118
+ - `bump_version.py`: Atomic polyglot semantic version bumper for releases (`agent-qa bump`).
119
+ - `sync_agent_rules.py`: Universal AI bridge synchronization engine (Cursor, Claude Code, Copilot, Windsurf).
120
+ - `md_to_xlsx.py`: Standalone Markdown to Excel converter utility (`agent-qa md-to-xlsx`).
121
+ - `mcp_excel_server.py`: Model Context Protocol (MCP) offline Excel spreadsheet server.
122
+
123
+ ---
124
+
125
+ ## 6. Nomenclature & Package Architecture
126
+
127
+ To ensure consistency across various distribution registries and developer interfaces:
128
+ - **Ecosystem / Project Name:** Synapse Hub (`Synapse-Hub` on GitHub)
129
+ - **NPM Package & Antigravity Plugin:** `synapse-hub` (distributed on NPM Registry and Antigravity Marketplace)
130
+ - **Python Package & Universal CLI:** `agent-qa` (PEP 621 package on PyPI providing the `agent-qa` CLI binary)
131
+ - **MCP Server Protocol Services:** `enterprise-agent-qa` (Core QA MCP server) and `synapse-mcp-excel` (Excel tool server)
132
+ - **Skill Catalog Manifest:** `enterprise-agent-skills-hub` (internal catalog schema identifier in `skills_manifest.json`) and `agentskills.json` (AgentSkills v1 open standard)
133
+
134
+ ---
135
+
136
+ ## 7. Autonomous Agent Self-Evolution & Training Subsystems
137
+
138
+ To elevate AI testing beyond static prompt engineering, Synapse Hub incorporates 6 advanced agent training, compilation, and self-evolution mechanisms synthesized from modern agentic architectures:
139
+
140
+ ```mermaid
141
+ flowchart TD
142
+ subgraph SelfEvolution["Autonomous Agent Self-Evolution Subsystem"]
143
+ Vault["<b>Voyager Lifelong Vault</b><br/>(skill_vault.py)<br/>• Verified PageClass SQLite memory<br/>• Zero repetitive prompt re-synthesis"]
144
+ Reflexion["<b>Episodic Reflexion Loop</b><br/>(auto_heal_reflexion.py)<br/>• K=3 trial-feedback learning<br/>• Self-healing without git pollution"]
145
+ DSPy["<b>DSPy Declarative QA Engine</b><br/>(dspy_qa_signatures.py)<br/>• Typed QA signatures<br/>• Eliminates brittle prompt hacking"]
146
+ TextGrad["<b>TextGrad Mutation Loss</b><br/>(textgrad_mutation_optimizer.py)<br/>• AST mutants as loss function<br/>• Optimizes assertions to score &ge; 80%"]
147
+ Reversible["<b>GoEx Reversible Sandbox</b><br/>(reversible_sandbox.py)<br/>• LIFO undo execution stack<br/>• Zero leftover test debris"]
148
+ Bench["<b>Gorilla BFCL Benchmark</b><br/>(synapse_qa_bench.py)<br/>• Evaluates function calling fidelity<br/>• Prevents agent regression"]
149
+ end
150
+
151
+ Vault --> DSPy --> TextGrad --> Reversible --> Reflexion --> Bench
152
+ ```
153
+
154
+ 1. **Lifelong Skill Memory (`skill_vault.py`):** Inspired by Voyager, stores verified POM methods and complex interaction patterns in permanent SQLite memory, growing the agent's capability with every run.
155
+ 2. **Episodic Trial-Feedback (`auto_heal_reflexion.py`):** Implements Noah Shinn's Reflexion framework, enabling agents to evaluate test failure traces across $K=3$ iterations, generating textual self-reflection to correct locator strategies.
156
+ 3. **Declarative Signature Compilation (`dspy_qa_signatures.py`):** Adheres to Stanford DSPy principles, compiling prompt templates into structured, typed input-output signatures.
157
+ 4. **Mutant-Directed Loss Optimization (`textgrad_mutation_optimizer.py`):** Treats surviving AST mutants as a loss function (TextGrad), iteratively refining assertion logic until all mutants are killed.
158
+ 5. **Reversible Execution Teardown (`reversible_sandbox.py`):** Implements GoEx-style reversible rollback stacks for filesystem and database mutations during automated exploratory runs.
159
+ 6. **Tool Function Calling Benchmark (`synapse_qa_bench.py`):** Implements Berkeley Function-Calling Leaderboard (BFCL) standards for enterprise QA tools, benchmarking tool selection precision and multi-turn execution accuracy.
160
+
161
+ ---
162
+
163
+ ## 8. Comparative Analysis & Industry Positioning
164
+
165
+ | Evaluation Criteria / Solution | ESLint Plugin (Playwright) | Stryker Mutator | Allure Report | Healenium | Synapse Hub 🧠 |
166
+ | :--- | :---: | :---: | :---: | :---: | :---: |
167
+ | **Language & Framework Scope** | Only JS / TS | JS / TS, C#, Scala | Any language (XML ingest) | Java / Python / C# (Selenium) | **Polyglot** (TS/JS, Python, Groovy, Java) |
168
+ | **Deep Agent Context Integration** | ❌ (CLI/IDE lint only) | ❌ (Standalone tool) | ❌ (Post-test visualizer) | ❌ (JVM proxy server) | ✅ **Native** (Rules, MCP, AST Map, 6 Subagents) |
169
+ | **AI Fake-Pass Elimination** | ⚠️ Syntax lint only | ❌ (App code mutations only) | ❌ | ❌ | ✅ **Specialized** (0-assert detection, swallowed exceptions, tautology) |
170
+ | **Mutation Testing Speed** | N/A | ⏱️ Minutes to hours | N/A | N/A | ⚡ **Ultra-fast (~0.1s)** static heuristic assertion sensitivity scan |
171
+ | **Locator Self-Healing** | ❌ | ❌ | ❌ | ⚠️ Requires JVM server + Docker | ⚡ **Lightweight (< 500 tokens)** AOM diffing inside agent loop |
172
+ | **Token & Log Distillation** | ❌ | ❌ | ❌ | ❌ | ✅ **Reduces 95%** log noise (`distill_log.py`, `repo_map.py`) |
173
+ | **Clean POM Architectural Guard** | ❌ | ❌ | ❌ | ❌ | ✅ **Strict enforcement**, Clean POM Flat Architecture |
174
+
175
+ ---
176
+
177
+ ## 9. Known Technical Limitations & Empirical Benchmarks
178
+
179
+ To maintain strict engineering rigor (**Truth Anchor**), Synapse Hub discloses all known technical boundaries:
180
+
181
+ 1. **Static Heuristic Mutation Testing vs Runtime Mutation Testing:**
182
+ `tools/micro_mutator.py` in static mode performs fast heuristic assertion reachability analysis (~0.1s) to detect unasserted branches and weak assertions. This is a lexical reachability and dataflow heuristic, **not** a compiler-grade runtime mutation testing engine (such as Stryker or mutmut). To avoid inflated assertion scores and obtain ground-truth mutation kill rates, execute in Dynamic mode (`--test-cmd`) against real test runners.
183
+ 2. **Empirical Benchmarks (Self-Reported Baseline):**
184
+ The metrics (25/25 challenges resolved, 76.2 tokens/bug) reflect author-measured internal baselines on curated challenges (`benchmarks/qa_eval`) rather than independent third-party double-blind audits. Metrics may vary on real-world enterprise suites depending on architectural complexity and test coverage.
185
+ 3. **Hub-Spoke Version Pinning (Blast-Radius Isolation):**
186
+ When mounting or referencing Synapse Hub in downstream Spoke projects, downstream repositories should pin a specific Git Submodule commit or release tag (`git checkout v3.0.0`) rather than tracking unpinned `main` HEAD, preventing upstream Hub changes from unexpectedly breaking downstream CI/CD pipelines.
187
+ 4. **Supported Runners:**
188
+ First-class runner adapters for **Playwright, Pytest, Katalon Studio/Groovy, and Cypress**. Selenium WebDriver is supported via Clean POM architecture patterns, smart-wait primitives, and Universal IR transpilation.
189
+ 5. **Environment Prerequisites:**
190
+ - Node.js >= 18.0.0 (Node.js 20 or 22 LTS recommended).
191
+ - Python >= 3.10 (fully tested on 3.10, 3.11, 3.12, 3.13, 3.15).
192
+ - Headless browser: Playwright Chromium required for live DOM/AOM probing and self-healing locators.