synapse-hub 2.7.0 β†’ 3.0.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 (108) hide show
  1. package/.agents/agents/live-explorer.md +2 -0
  2. package/.agents/agents/pom-crafter.md +2 -0
  3. package/.agents/agents/test-runner.md +3 -0
  4. package/.agents/skills/lean-impact-scoreboard/SKILL.md +1 -1
  5. package/.agents/skills/repo-quality-audit/SKILL.md +1 -1
  6. package/.agents/skills/review-spec/SKILL.md +1 -1
  7. package/.agents/skills/senior-code-review/SKILL.md +1 -1
  8. package/.agents/skills/technical-debt-harvester/SKILL.md +1 -1
  9. package/CLAUDE.md +1 -1
  10. package/README.en.md +70 -291
  11. package/README.md +68 -303
  12. package/docs/ARCHITECTURE.md +48 -2
  13. package/docs/CONTRIBUTING.md +1 -1
  14. package/docs/QUALITY_GATES.md +113 -0
  15. package/package.json +1 -1
  16. package/scripts/package_dist.py +2 -1
  17. package/skills_manifest.json +6 -6
  18. package/synapse.config.json +1 -1
  19. package/templates/ai_bridges/CLAUDE.md +1 -1
  20. package/templates/ai_bridges/copilot-instructions.md +2 -2
  21. package/tools/__init__.py +18 -1
  22. package/tools/_openapi_parser.py +1 -1
  23. package/tools/agent_canary.py +42 -30
  24. package/tools/agentless_patcher.py +2 -2
  25. package/tools/analyze_project.py +3 -5
  26. package/tools/api_drift_sentinel.py +4 -4
  27. package/tools/api_fuzzer.py +8 -8
  28. package/tools/auto_heal.py +4 -5
  29. package/tools/auto_heal_reflexion.py +2 -2
  30. package/tools/autogen_qa_broker.py +2 -2
  31. package/tools/browser_helpers.js +2 -2
  32. package/tools/browsergym_eval.py +2 -3
  33. package/tools/bug_reporter.py +11 -13
  34. package/tools/bump_version.py +75 -5
  35. package/tools/cache_resolver.py +78 -83
  36. package/tools/check_env.py +9 -1
  37. package/tools/check_version_sync.py +40 -3
  38. package/tools/ci_healing_hook.py +4 -6
  39. package/tools/cli.py +5 -7
  40. package/tools/config_decoupler.py +2 -3
  41. package/tools/core/__init__.py +52 -0
  42. package/tools/count_tokens.py +22 -20
  43. package/tools/dashboard_generator.py +627 -998
  44. package/tools/db_sandbox.py +65 -53
  45. package/tools/debt_harvester.py +3 -3
  46. package/tools/distill_log.py +3 -3
  47. package/tools/dspy_qa_signatures.py +3 -4
  48. package/tools/export_postman_collection.py +8 -8
  49. package/tools/flaky_detector.py +2 -2
  50. package/tools/fuzz_payloads.py +5 -5
  51. package/tools/generate_allure_report.py +1 -1
  52. package/tools/generate_jmx_plan.py +4 -4
  53. package/tools/gherkin_suite.py +1 -1
  54. package/tools/git_pre_commit_guard.py +2 -2
  55. package/tools/goldfish_review.py +2 -2
  56. package/tools/heal/__init__.py +28 -0
  57. package/tools/heal_pr_automator.py +6 -6
  58. package/tools/heuristic_locator_matcher.py +2 -2
  59. package/tools/infer_linter.py +8 -8
  60. package/tools/interview_story.py +0 -1
  61. package/tools/jtl_analyzer.py +11 -11
  62. package/tools/lint/__init__.py +30 -0
  63. package/tools/lint_ai_docs.py +42 -0
  64. package/tools/lookup_tc.py +1 -1
  65. package/tools/matrix_sharder.py +15 -13
  66. package/tools/mcp/__init__.py +16 -0
  67. package/tools/mcp_excel_server.py +2 -2
  68. package/tools/mcp_server.py +3 -4
  69. package/tools/md_to_xlsx.py +26 -26
  70. package/tools/micro_mutator.py +11 -12
  71. package/tools/network_mock_shield.py +27 -27
  72. package/tools/newman_analyzer.py +2 -3
  73. package/tools/omni_emitter.py +5 -8
  74. package/tools/omni_parser.py +5 -5
  75. package/tools/omni_transpiler.py +5 -5
  76. package/tools/output_formatter.py +19 -0
  77. package/tools/perf/__init__.py +24 -0
  78. package/tools/pinpoint_failure.py +1 -1
  79. package/tools/project_state.py +0 -2
  80. package/tools/qa_event_stream.py +1 -1
  81. package/tools/repo_map.py +8 -8
  82. package/tools/report/__init__.py +32 -0
  83. package/tools/reversible_sandbox.py +1 -2
  84. package/tools/safety_firewall.py +2 -2
  85. package/tools/senior_code_review.py +2 -2
  86. package/tools/setup_project.py +10 -12
  87. package/tools/skill_collision_guard.py +3 -3
  88. package/tools/skill_vault.py +12 -3
  89. package/tools/skillspector.py +5 -7
  90. package/tools/smart_visual_masker.py +4 -6
  91. package/tools/spec_drift_sentinel.py +1 -2
  92. package/tools/swe_qa_aci.py +2 -2
  93. package/tools/synapse_qa_bench.py +3 -3
  94. package/tools/sync_agent_rules.py +17 -3
  95. package/tools/telemetry_correlator.py +3 -2
  96. package/tools/test_memory_os.py +15 -5
  97. package/tools/textgrad_mutation_optimizer.py +3 -3
  98. package/tools/tms_sync_bridge.py +5 -5
  99. package/tools/tot_exploratory_tester.py +5 -6
  100. package/tools/traffic_session_converter.py +9 -9
  101. package/tools/universal_ir.py +2 -3
  102. package/tools/update_sentinel.py +6 -9
  103. package/tools/verify_all.py +10 -0
  104. package/tools/visual_diff_canvas.py +1 -2
  105. package/tools/visual_som_helper.py +15 -13
  106. package/tools/watch_mode.py +1 -1
  107. package/tools/wcag_audit.py +22 -1
  108. package/tools/welcome_page.py +5 -6
@@ -11,8 +11,10 @@ tools:
11
11
  - tools/safety_firewall.py
12
12
  - tools/browser_helpers.js
13
13
  - tools/e2e_flow_prober.ps1
14
+ - tools/e2e_flow_prober.py
14
15
  - tools/lookup_xpath.py
15
16
  - tools/visual_diff_canvas.py
17
+ - tools/visual_som_helper.py
16
18
  - tools/network_mock_shield.py
17
19
  - tools/smart_visual_masker.py
18
20
  ---
@@ -25,6 +25,8 @@ tools:
25
25
  - tools/omni_parser.py
26
26
  - tools/omni_emitter.py
27
27
  - tools/omni_transpiler.py
28
+ - tools/universal_ir.py
29
+ - tools/_openapi_parser.py
28
30
  - tools/network_mock_shield.py
29
31
  - tools/cache_resolver.py
30
32
  - tools/micro_mutator.py
@@ -18,7 +18,10 @@ tools:
18
18
  - tools/pinpoint_failure.py
19
19
  - tools/ci_healing_hook.py
20
20
  - tools/generate_allure_report.ps1
21
+ - tools/generate_allure_report.py
21
22
  - tools/generate_test_reports.ps1
23
+ - tools/generate_test_reports.py
24
+ - tools/tms_sync_bridge.py
22
25
  - tools/generate_jmx_plan.py
23
26
  - tools/jtl_analyzer.py
24
27
  - tools/newman_analyzer.py
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: lean-impact-scoreboard
3
- description: "Display the measured impact scoreboard (code reduction %, token optimization %, cost reduction %, test rigor) from lean engineering benchmarks."
3
+ description: "Display empirical impact scoreboards (code reduction, token savings, mutation rigor). Use when reviewing lean engineering benchmarks, token throughput, or reporting quality metrics."
4
4
  category: architecture_and_analysis
5
5
  version: "1.0.0"
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: repo-quality-audit
3
- description: "Quality audit of a whole codebase: bugs, security risks, concurrency and scale bottlenecks, missing test coverage, and code bloat. Ranks findings with 'Fix this first' priority."
3
+ description: "Comprehensive codebase quality audit covering bugs, security, bottlenecks, and bloat. Use when auditing an entire project, evaluating repository health, or prioritizing technical debt."
4
4
  category: architecture_and_analysis
5
5
  version: "1.0.0"
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: review-spec
3
- description: "Zero-context stress test and quality review of test specifications, user stories, BDD feature files, and acceptance criteria before code generation begins."
3
+ description: "Stress-test specifications, user stories, and BDD feature files with zero-context rigor. Use when reviewing requirements, user stories, or acceptance criteria before code generation."
4
4
  category: architecture_and_analysis
5
5
  version: "1.0.0"
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: senior-code-review
3
- description: "Quality review of a code change: verify logic correctness, security boundaries, real concurrency/load, missing test coverage, execution speed, and eliminate bloat. Reads connected callers and data flows, not just the diff."
3
+ description: "Review code changes across logic, security, concurrency, and test coverage. Use when conducting pull request reviews, diff inspections, or auditing commit changes before merge."
4
4
  category: architecture_and_analysis
5
5
  version: "1.0.0"
6
6
  ---
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: technical-debt-harvester
3
- description: "Harvest shortcut: comments into a tracked debt ledger so deliberate compromises do not rot into forgotten tech debt."
3
+ description: "Harvest shortcut: comments into a tracked technical debt ledger. Use when auditing code compromises, tracking deferred refactorings, or scanning for shortcut markers."
4
4
  category: architecture_and_analysis
5
5
  version: "1.0.0"
6
6
  ---
package/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CLAUDE.md β€” Synapse-Hub Guidelines for Claude Code
2
2
 
3
- > **Author & Creator:** ThαΊΏ Vα»‹ (@TeeVee998) <https://github.com/TeeVee998/Synapse-Hub>
3
+ > **Author & Creator:** ThαΊΏ Vα»‹ (@TeeVee998) <https://github.com/TeeVee998/Synapse-Hub>
4
4
  > **License:** MIT License (Mandatory Attribution Preservation)
5
5
 
6
6
  <!-- ============================================================================== -->
package/README.en.md CHANGED
@@ -1,12 +1,12 @@
1
- # 🧠 Synapse Hub β€” AI Test Quality Linter & Guardrails for Automated Testing
2
- ### *Zero-Dependency Quality Linter, Fake-Pass Sentinel & Guardrails for AI-Generated Tests*
1
+ # 🧠 Synapse Hub β€” AI Test Quality Linter & Guardrails
2
+
3
+ ### *The Test Quality Linter & Guardrails for the Era of AI-Generated Code*
3
4
 
4
5
  [πŸ‡»πŸ‡³ TiαΊΏng Việt](README.md) | [πŸ‡¬πŸ‡§ English Edition](README.en.md)
5
6
 
6
- > **Core Mission:** A standalone, zero-dependency Linter & Guardrail engine (zero external dependencies for core engine & DoD gates) protecting test suite integrity in the era of AI code generation β€” Catching tautological "fake-pass" tests, eliminating hard sleeps, distilling 95% CI log noise, and enforcing Clean POM architecture. Specialized tools (Excel export, Canvas visual diff) leverage standard optional extras (`openpyxl`, `Pillow`).
7
- > **Extended Ecosystem:** Bundled with 51 production QA skills, 6 specialized AI roles, and 10 DoD Quality Gates supporting Playwright, Cypress, Pytest, and Katalon.
8
- > **Author:** ThαΊΏ Vα»‹ ([@TeeVee998](https://github.com/TeeVee998))
9
- > **Hub Version:** `v2.7.0` | **Scope:** 51 Standardized Skills, 6 Specialized AI Agents, 76 CLI Commands & 76+ Test Engineering Tools, 10 DoD Quality Gates.
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
+ > **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.
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)
@@ -16,336 +16,115 @@
16
16
 
17
17
  ---
18
18
 
19
- ### πŸ’‘ What is Synapse Hub? (In 30 Seconds)
20
-
21
- > πŸ“Œ **Hub & Spoke Architecture Notice (Avoid Cloner Confusion):**
22
- > β€’ **Synapse-Hub (This Repo):** The **"Central Brain"** hosting 51 skills, linters, and QA tools β€” **not** your test suite.
23
- > β€’ **Target Project (Spoke):** Your actual automation test repository (Playwright, Katalon, Pytest, Cypress, etc.).
24
- > πŸ‘‰ To bootstrap Synapse Hub protection for your test project, open a terminal inside that project and run:
25
- > `npx synapse-hub setup` *(or from here with a target flag: `npx synapse-hub setup --target ../your-target-project`)*.
26
-
27
- Think of Synapse Hub as a versatile, dual-mode engine:
28
- 1. πŸ› οΈ **Standalone CLI Tool (Zero AI needed):** Simply run `npx synapse-hub lint` to scan your test suite, distill bloated CI logs, or export test cases to standard Excel spreadsheets without any complex setup.
29
- 2. 🧠 **Guardrail "Brain" for AI Coding Assistants:** When using Google Antigravity, Cursor, or Claude Code, Synapse Hub acts as an automated quality guardrail β€” preventing AI assistants from generating tautological fake-passes, swallowing exceptions, or inserting flaky hard sleeps.
19
+ ## πŸ’‘ What Problem Does Synapse Hub Solve?
30
20
 
31
- > πŸ›‘οΈ **Zero Overhead:** You **never need to memorize** all 51 skills or 60+ tools! The system operates strictly *On-Demand*, activating tools only when a specific situation arises.
21
+ When software engineers and QA teams use AI coding assistants (Cursor, Copilot, Claude Code, Antigravity) to write automated tests, AI often produces fragile code patterns:
32
22
 
33
- #### βš–οΈ Before vs. After Synapse Hub:
34
-
35
- | Raw AI-Generated Tests (Without Synapse) | Protected by Synapse Hub πŸ›‘οΈ |
23
+ | When AI Writes Tests Without Guardrails | When Protected by Synapse Hub πŸ›‘οΈ |
36
24
  | :--- | :--- |
37
- | ❌ **"Fake-Pass" tests:** Tests pass unconditionally with **0 assertions**, giving false confidence. | βœ… **Caught in 0.1s:** Flags zero-assertion tautologies and enforces genuine validation. |
38
- | ❌ **Hardcoded sleeps:** Injects random `sleep(5000)` calls, making suites slow and flaky in CI. | βœ… **Smart Wait Enforcement:** Flags static delays and guides dynamic element synchronization. |
39
- | ❌ **Context overflow:** CI logs with 20,000+ lines blow up LLM token windows without root cause. | βœ… **95% Noise Distillation:** Compresses logs down to ~30 lines containing the exact failing trace. |
40
- | ❌ **Security leaks:** AI inadvertently commits hardcoded plaintext passwords or secret tokens. | βœ… **Gate 6 Sentinel:** Scans and blocks credentials before commits ever reach remote SCM. |
25
+ | ❌ **"Fake-Pass" Tests:** Green checkmark, but contains **0 assertions** β€” verifies nothing. | βœ… **Detected in 0.1s:** Flags empty tests and requires concrete assertions. |
26
+ | ❌ **Hardcoded Sleeps:** Spams `sleep(5000)` indiscriminately, causing flaky CI builds. | βœ… **Smart Waits Enforced:** Flags hardcoded delays and guides dynamic wait adoption. |
27
+ | ❌ **AI Context Overflow:** 20,000-line CI logs overwhelm LLM context windows. | βœ… **95% Log Noise Distilled:** Isolates exact failing stacktraces in ~30 lines. |
28
+ | ❌ **Security Leaks:** Accidental commits containing plaintext tokens or passwords. | βœ… **Gate 6 Sentinel:** Detects and blocks hardcoded secrets before commit. |
41
29
 
42
30
  ---
43
31
 
44
- ## ⚑ 1. The 60-Second "Wow" (3 Hero Features πŸ¦Έβ€β™‚οΈ)
32
+ ## ⚑ Quickstart in 60 Seconds (One-Command Onboarding πŸš€)
45
33
 
46
- No need to read dozens of documents or configure complex frameworks. You can immediately solve three daily QA pain points:
34
+ You **never need to memorize** 51 skills or 90 internal tools. Synapse Hub activates autonomously when needed:
47
35
 
48
- ### πŸ” 1. Catch "Fake-Pass", Static Sleeps & Swallowed Exceptions
49
36
  ```bash
50
- npx synapse-hub lint ./tests
51
- ```
52
- * **The Problem:** AI-generated tests frequently pass unconditionally without testing anything (zero assertions), rely on flaky hardcoded sleeps (`Thread.sleep`), or hide exceptions in empty `try-catch` blocks.
53
- * **The Solution:** Polyglot heuristic & static AST linter (Playwright TypeScript/JavaScript, Pytest Python, Cypress, Groovy/Katalon) flags defects in 0.1s without LLM tokens.
37
+ # 1. Diagnose system prerequisites (Node, Python, Chrome, Git):
38
+ npx synapse-hub doctor
54
39
 
55
- ### πŸ“Š 2. Convert Requirements Into Standard 12-Column Excel
56
- ```bash
57
- npx synapse-hub export-excel
58
- ```
59
- * **The Problem:** QA engineers spend tedious hours manually formatting Excel sheets from user stories or Markdown scenarios.
60
- * **The Solution:** Compiles test scenarios directly into formatted 12-column `.xlsx` spreadsheets with calculated P Γ— I risk scoring, ready for PMs and stakeholders.
40
+ # 2. Activate protection for your test project (Playwright, Pytest, Cypress, Katalon):
41
+ npx synapse-hub setup --target /path/to/test-repo
61
42
 
62
- ### 🧹 3. Distill 95% CI Log Bloat Down to Root Cause
63
- ```bash
64
- npx synapse-hub distill path/to/ci.log
65
- ```
66
- * **The Problem:** CI/CD build logs containing 20,000+ lines overwhelm LLM context windows and human eyes.
67
- * **The Solution:** Filters out 95% repetitive noise and extracts ~30 lines containing the exact failing line, exception stacktrace, and HTTP status.
43
+ # 3. Scan for fake-passes and hardcoded sleeps instantly:
44
+ npx synapse-hub lint ./tests
68
45
 
69
- ### πŸ’» Real-World Terminal Output (Catching Defects in 0.1s Zero-Token):
70
- ```bash
71
- $ npx synapse-hub lint ./tests
72
-
73
- ======================================================================
74
- ENTERPRISE STATIC DEFECT & FAKE-PASS SENTINEL
75
- ======================================================================
76
- Target Scope : 6 Test Scripts (Polyglot TS/Python/Groovy)
77
- Detected Items:
78
- - [CRITICAL] tests/checkout.spec.ts:42 - Fake-pass risk: Test contains 0 assertions!
79
- - [CRITICAL] tests/login.spec.ts:14 - Hardcoded sleep (5000ms) detected. Replace with dynamic wait.
80
- ======================================================================
81
- Result: 2 anti-patterns flagged in 0.12s (Zero LLM tokens used).
46
+ # 4. Verify the 10 DoD Quality Gates before pushing code:
47
+ npx synapse-hub verify
82
48
  ```
83
49
 
84
- ---
50
+ > πŸ’‘ **Tip:** Install globally to invoke `synapse-hub <command>` directly without `npx`:
51
+ > `npm install -g synapse-hub` (or via Python: `pip install agent-qa`)
85
52
 
86
- ## πŸš€ 2. Fast & Non-Intrusive Onboarding
53
+ ---
87
54
 
88
- Synapse Hub respects your workspace privacy and system boundaries. You have complete control over disk writes:
55
+ ## πŸ› οΈ Daily Core CLI Commands
89
56
 
90
57
  ```bash
91
- # 🩺 Diagnose your local environment in 1 second (Node, Python, Chrome, Git):
92
- npx synapse-hub doctor
58
+ # Catch fake-passes, hard sleeps, and swallowed exceptions (Polyglot TS/JS, Python, Groovy):
59
+ synapse-hub lint ./tests
93
60
 
94
- # πŸ’‘ Pro Tip: Install globally to run commands directly without npx:
95
- npm install -g synapse-hub
96
- synapse-hub doctor
61
+ # Run the comprehensive 10 Quality Gates Definition of Done (DoD) suite:
62
+ synapse-hub verify
97
63
 
98
- # πŸ”Ή Option 1: Project-local configuration only (Safest, does not touch ~/.gemini)
99
- npx synapse-hub setup --local-only
64
+ # Generate an actionable executive project health report (PROJECT_HEALTH_REPORT.md):
65
+ synapse-hub analyze
100
66
 
101
- # πŸ”Ή Option 2: Dry-run simulation (Preview actions without writing any file to disk)
102
- npx synapse-hub setup --dry-run
67
+ # Distill 95% of CI log noise down to the true root cause and stacktrace:
68
+ synapse-hub distill path/to/ci.log
103
69
 
104
- # πŸ”Ή Option 3: Full setup (Generates PROJECT_AI_GUIDE.md, AI bridges and Antigravity plugin)
105
- npx synapse-hub setup
70
+ # Export User Stories into standard 12-column Excel sheets with P x I risk matrices:
71
+ synapse-hub export-excel
106
72
 
107
- # πŸ”Ή Completely revert and uninstall at any time:
108
- npx synapse-hub uninstall
73
+ # Measure test assertion sensitivity via micro-mutation testing (~0.1s):
74
+ synapse-hub mutate ./tests
109
75
  ```
110
76
 
111
- ### Run Quality DoD Gates:
112
- ```bash
113
- npx synapse-hub verify # Execute 10 Quality Gates DoD (Gate 0–9)
114
- npx synapse-hub analyze # Comprehensive 5-in-1 project health audit
115
- ```
77
+ ---
78
+
79
+ ## πŸ›‘οΈ The 10 Definition-of-Done (DoD) Quality Gates
80
+
81
+ Every test code change must satisfy all 10 Quality Gates before pull request merge:
82
+
83
+ - **Gate 0:** Author Attribution & MIT License Provenance
84
+ - **Gate 1:** UTF-8 No BOM Clean Encoding (Zero corrupting BOM bytes)
85
+ - **Gate 2:** Path Portability (Zero hardcoded machine-specific absolute paths)
86
+ - **Gate 3:** Clean POM Flat Architecture (Zero locators inside test scripts)
87
+ - **Gate 4:** AI Docs Anti-Drift (Zero hallucinated PageClasses in AI guides)
88
+ - **Gate 5:** Temporary File Blacklist (Zero scratch files or binary dumps)
89
+ - **Gate 6:** Credential Security Sentinel (Zero plaintext secrets or API keys)
90
+ - **Gate 7:** Static Defect & Fake-Pass Sentinel (Zero 0-assert tests, zero sleeps)
91
+ - **Gate 8:** Assertion Sensitivity Sentinel (Syntactic Mutation Score $\ge 80\%$)
92
+ - **Gate 9:** Skill Routing & Collision Guard (Trigger similarity $< 0.75$)
116
93
 
117
- ### πŸ”„ 3-Line CI/CD & Pre-commit Integration:
118
- Automatically block fake-pass tests and substandard code before merging:
94
+ *(For detailed gate specifications and remediation guides, see [docs/QUALITY_GATES.md](docs/QUALITY_GATES.md)).*
95
+
96
+ ---
97
+
98
+ ## πŸ”„ CI/CD & Pre-commit Integration
119
99
 
120
100
  ```yaml
121
- # Method 1: Official Composite GitHub Action (action.yml)
101
+ # GitHub Actions (.github/workflows/verify.yml):
122
102
  - name: Run Synapse Hub Quality Gates
123
103
  uses: TeeVee998/Synapse-Hub@v2
124
104
  with:
125
105
  mode: 'target'
126
- format: 'sarif'
127
106
 
128
- # Method 2: Direct NPX execution (GitLab CI / Bitbucket / Jenkins)
107
+ # Or run directly on any CI provider (GitLab CI, Bitbucket, Jenkins):
129
108
  - name: Run Synapse Hub Quality Gates
130
109
  run: npx synapse-hub verify
131
110
  ```
132
111
 
133
112
  ```yaml
134
- # Pre-commit Hook Integration (.pre-commit-config.yaml):
113
+ # Pre-commit hook (.pre-commit-config.yaml):
135
114
  repos:
136
115
  - repo: https://github.com/TeeVee998/Synapse-Hub
137
- rev: v2.4.0
116
+ rev: v3.0.0
138
117
  hooks:
139
118
  - id: synapse-lint
140
119
  - id: synapse-verify
141
120
  ```
142
- *(Configurable via root `synapse.config.json`. See comprehensive documentation at [docs/CI_CD_INTEGRATION.md](docs/CI_CD_INTEGRATION.md)).*
143
-
144
- | Gate | Gate Name | Practical Verification Objective |
145
- | :---: | :--- | :--- |
146
- | **Gate 0** | **Author Attribution & MIT** | Canonical author attribution invariant preserving author ThαΊΏ Vα»‹ (@TeeVee998) MIT notice. |
147
- | **Gate 1** | **UTF-8 No BOM Clean Encoding** | Scans 100% of repository files for illegal BOM bytes and mojibake corruption. |
148
- | **Gate 2** | **Path Portability** | Prohibits local workstation paths (`/Users/...`, `C:\...`) in source code. |
149
- | **Gate 3** | **Clean POM Flat Architecture** | Enforces 100% locator encapsulation in Page Classes; zero raw XPaths in test scripts. |
150
- | **Gate 4** | **AI Docs Anti-Drift** | Verifies AST truth against `PROJECT_AI_GUIDE.md`, eliminating hallucinated PageClasses. |
151
- | **Gate 5** | **Temp File Blacklist** | Prevents temporary build debris (`*.tmp`, memory dumps, stale artifacts) from leaking. |
152
- | **Gate 6** | **Credential Security** | Blocks hardcoded plaintext passwords, private keys, and secret tokens in code. |
153
- | **Gate 7** | **Static Defect & Fake-Pass Sentinel** | Static heuristic analysis catching 0-assertion tests, empty catch blocks, hardcoded/variable sleeps (β‰₯ 3000ms), and unawaited promises. |
154
- | **Gate 8** | **Assertion Sensitivity Sentinel** | Injects syntactic micro-mutations linked via dataflow (Ultra-fast Heuristic Static mode ~0.1s; pass `--test-cmd` for runtime re-test; requires Score β‰₯ 80%). |
155
- | **Gate 9** | **Tier-2 Skill Routing & Collision Guard** | Audits semantic descriptions and activation triggers between skills; prevents ambiguous overlap collisions (Threshold < 0.75). |
156
-
157
- ---
158
-
159
- ## 🎯 3. Level-Based Roadmap
160
-
161
- | Level | What You Want | Synapse Hub Entry Point |
162
- | :--- | :--- | :--- |
163
- | **Fresher / Junior** | Learn fast, deliver immediately, understand weak asserts | β€’ `npx synapse-hub export-excel`: Generate standard test cases.<br/>β€’ `npx synapse-hub lint ./tests`: Understand why assertions are tautological.<br/>β€’ Inspect Clean POM examples in `examples/practices/`. |
164
- | **Mid-Level** | Reduce flakiness, cut locator maintenance | β€’ `npx synapse-hub flaky scan ./tests`: Detect flaky tests and quarantine them.<br/>β€’ `npx synapse-hub heal`: Semantic locator healing via AOM diffing.<br/>β€’ Add linter to pre-commit git hooks. |
165
- | **Senior / Lead** | Control, measurement, CI/CD safety gates | β€’ `npx synapse-hub verify`: 10 Automated DoD Gates in CI.<br/>β€’ `npx synapse-hub mutate ./tests`: Heuristic assertion sensitivity analysis before merge.<br/>β€’ Standard Markdown/JSON telemetry for PR review bots. |
166
-
167
- > *Pro Tip: If installed globally (`npm i -g synapse-hub`), you can use the shorter syntax `synapse-hub <cmd>` or equivalent aliases `synapse`, `agent-qa`.*
168
-
169
- ---
170
-
171
- ## πŸ’Ž 4. Core Architecture & Engineering Pillars
172
-
173
- ```mermaid
174
- flowchart TD
175
- subgraph Hub["🧠 Synapse Hub (Core v2.4.0)"]
176
- Skills[".agents/skills/ (51 Skills)"]
177
- Agents[".agents/agents/ (6 Specialized Roles)"]
178
- Rules[".agents/rules/ (11 Core Rules)"]
179
- Tools["tools/ (60+ Universal Python Tools)"]
180
- Workflows[".agents/workflows/ (10 Workflows)"]
181
- end
182
-
183
- subgraph ChatSession["πŸ’¬ AI Agent Workspace / IDE"]
184
- Hub -->|Mount / Plugins| ChatSession
185
- end
186
-
187
- subgraph Projects["πŸ“ Target Test Projects"]
188
- ProjectA["Playwright (TS/JS)"]
189
- ProjectB["Pytest (Python)"]
190
- ProjectC["Cypress / Katalon"]
191
- end
192
-
193
- ProjectA -->|Verify & Lint| ChatSession
194
- ProjectB -->|Verify & Lint| ChatSession
195
- ProjectC -->|Verify & Lint| ChatSession
196
- ```
197
-
198
- ### 🧠 Pillar 1: Fake-Pass Prevention & Assertion Sensitivity (Heuristic)
199
- - **Static Defect Sentinel (`tools/infer_linter.py`):** Scans for anti-patterns: unasserted tests, swallowed catch blocks, hardcoded sleeps, and unawaited Playwright assertions.
200
- - **Assertion Sensitivity Sentinel (`tools/micro_mutator.py`):** Injects lightweight syntactic micro-mutations (equality, relational, boundary inversions) to verify whether downstream assertions catch logic flaws. Enforces Sensitivity Score β‰₯ 80% to pass Gate 8.
201
-
202
- ### ⚑ Pillar 2: Context Optimization & Token Conservation
203
- - **Log Distillation (`tools/distill_log.py`):** Truncates verbose terminal output to keep AI prompts concise.
204
- - **AST Method Mapping (`tools/repo_map.py`):** Maps class methods into a compressed < 600 token index; no reading large monolithic files whole.
205
- - **Episodic SQLite Memory (`tools/cache_resolver.py`):** Offline solution store at `~/.agent_memory/global_cache.db` (zero token queries).
206
-
207
- ---
208
-
209
- ## βš–οΈ 5. Transparent Engineering & Known Limitations
210
-
211
- To uphold our strict **Truth Anchor** standard, we openly disclose known system boundaries:
212
-
213
- 1. **Assertion Sensitivity is a Syntactic Heuristic, not Compiler-Grade Mutation Testing:**
214
- `tools/micro_mutator.py` uses lexical AST pattern evaluation to test downstream assertion coverage in sub-second speed. It **does not replace** full dynamic runtime mutation testing frameworks (such as Stryker for JS/TS or mutmut for Python) when bytecode-level mutant kill-rate is mandated.
215
- 2. **Empirical Benchmark & Evaluation Metrics (`benchmarks/qa_eval`):**
216
- Evaluated across 25 polyglot testing challenges (Groovy, TypeScript, Python, Java):
217
- - **Autonomous Resolution Rate:** 25 / 25 challenges (100.0%).
218
- - **Average Token Consumption:** 76.2 tokens / bug (saving 95% prompt context vs full repo dump).
219
- - **Assertion Sensitivity (Mutation Score):** 100.0% mutants killed.
220
- - **Fake-Pass Sentinel Accuracy (`infer_linter.py`):** **100.0% Precision** (0 false positives), **95.7% Recall**, **97.8% F1-Score** on 51 independent samples.
221
- 3. **Framework Support Scope:**
222
- Synapse Hub provides native runners and direct adapters for **Playwright, Pytest, Katalon Studio/Groovy, and Cypress**. For **Selenium WebDriver**, the hub supports Clean POM design patterns, smart waits, and universal IR transpilation, which can be readily adapted into standard Selenium WebDriver test suites.
223
- 4. **Recommended Runtime Baseline:**
224
- - Node.js: `>= 18.0.0` (Node 20 or 22 LTS recommended).
225
- - Python: `>= 3.9` (Python 3.10+ recommended; full testing matrix on Python 3.10, 3.11, 3.12, 3.13).
226
- 5. **Headless Browser Requirement:**
227
- Live DOM inspection and locator self-healing require a headless browser environment (e.g., Playwright Chromium) to extract the Accessibility Object Model (AOM).
228
-
229
- ---
230
-
231
- ## πŸ‘₯ 6. Multi-Agent Swarm System (6 Specialized Roles)
232
-
233
- | Subagent Role | Core Responsibilities | Key Skills | Included Tools |
234
- | :--- | :--- | :--- | :--- |
235
- | **`orchestrator`** | Workflow director, project bootstrapper, health auditor, state anchor. | `agent-orchestration`, `graphify`, `architecture-decision-records` | `setup_project.py`, `analyze_project.py`, `repo_map.py` |
236
- | **`live-explorer`** | Live DOM/AOM probing via headless Playwright, destructive action firewall. | `playwright-live-interaction`, `self-healing-locator`, `visual-regression-sentinel` | `safety_firewall.py`, `browser_helpers.js` |
237
- | **`pom-crafter`** | Clean POM engineer, API breaking change sentinel, story-to-script generator. | `clean-pom-crafter`, `lam-script-generator`, `synthetic-test-data-generator` | `generate_tc_from_story.py`, `api_drift_sentinel.py` |
238
- | **`test-runner`** | Headless CLI suite dispatcher, parallel matrix sharder, log distiller. | `katalon-cli-runner`, `e2e-testing-patterns`, `flaky-test-sentinel-and-quarantine` | `matrix_sharder.py`, `distill_log.py`, `pinpoint_failure.py` |
239
- | **`failure-analyst`** | Root cause autopsy, failing line isolation, automated bug ticket synthesis. | `failure-autopsy-and-healing`, `token-and-context-optimizer` | `auto_heal.py`, `bug_reporter.py`, `cache_resolver.py` |
240
- | **`quality-gatekeeper`**| Sentinel guardian enforcing 9 DoD Quality Gates and assertion sensitivity. | `antigravity-test-sentinel`, `wcag-audit-patterns`, `security-dast-sentinel` | `verify_all.py`, `micro_mutator.py`, `infer_linter.py` |
241
-
242
- ---
243
-
244
- ## πŸ“¦ 7. Standardized Skill Catalog (42 Skills in .agents/skills/)
245
-
246
- <details>
247
- <summary><b>πŸ“¦ Click to expand: 42 Standardized Skills</b></summary>
248
-
249
- | # | Skill ID | Practical Capability |
250
- |:---:|---|---|
251
- | 1 | `clean-pom-crafter` | Clean POM & Flat Architecture page class design (zero raw selectors in test scripts). |
252
- | 2 | `playwright-live-interaction` | Live DOM/AOM exploration and < 200ms selector verification via headless Playwright. |
253
- | 3 | `failure-autopsy-and-healing` | Failure triage from JUnit XML/screenshots and automated broken locator repair. |
254
- | 4 | `infer_linter` / `antigravity-test-sentinel` | Quality gatekeeper enforcing zero fake-passes and 10 DoD quality gates. |
255
- | 5 | `token-and-context-optimizer` | Prompt context optimization, log distillation, and Context Rot prevention. |
256
- | 6 | `flaky-test-sentinel-and-quarantine` | Non-deterministic test detection, flakiness scoring, and quarantine management. |
257
- | 7 | `api-spec-to-e2e-matrix` | Convert OpenAPI/Swagger specifications into E2E testing matrices. |
258
- | 8 | `api-network-mocking-interception` | HTTP/GraphQL traffic stubbing, route mocking, and chaos network failure simulation. |
259
- | 9 | `synthetic-test-data-generator` | Generate idempotent, collision-free synthetic test data with timestamps. |
260
- | 10 | `db-state-verifier-and-seeder` | Seed isolated test fixtures and assert database state across SQL and NoSQL. |
261
- | 11 | `visual-regression-sentinel` | Screenshot layout comparison with dynamic anti-flake element masking. |
262
- | 12 | `wcag-audit-patterns` | Accessibility auditing against WCAG 2.2 A/AA and semantic ARIA roles. |
263
- | 13 | `security-dast-sentinel` | Dynamic security analysis: OWASP Top 10, security headers, token leaks, and IDOR. |
264
- | 14 | `web-vitals-and-performance-profiler` | Core Web Vitals (LCP, CLS, INP) measurement and network waterfalls via CDP. |
265
- | 15 | `backend-load-and-stress-patterns` | Orchestrate k6, Locust, and Apache JMeter backend load and SLA endurance test suites. |
266
- | 16 | `auth-session-and-cookie-manager` | Browser session `storageState`, JWT token management, and multi-role states. |
267
- | 17 | `file-and-report-validator` | Tabular integrity and schema validation for downloaded/uploaded files (Excel, CSV, PDF). |
268
- | 18 | `e2e-testing-patterns` | Multi-browser E2E test architectures, parallel sharding, and retry governance. |
269
- | 19 | `lam-script-generator` | Transform user stories and acceptance criteria into runnable Clean POM test scripts. |
270
- | 20 | `katalon-cli-runner` | Headless test execution for Katalon and Gradle suites with automatic driver cleanup. |
271
- | 21 | `bats-testing-patterns` | Automated testing for bash/sh scripts, CLI tools, and CI/CD pipelines with Bats. |
272
- | 22 | `code-refactoring-refactor-clean` | Technical debt remediation and test refactoring using SOLID and Clean Code patterns. |
273
- | 23 | `agent-orchestration-multi-agent-optimize` | Profile and optimize multi-agent swarm workloads and token throughput. |
274
- | 24 | `architecture-decision-records` | Author and maintain technical Architecture Decision Records (ADRs). |
275
- | 25 | `github-actions-templates` | Production-ready GitHub Actions workflow templates for automated test pipelines. |
276
- | 26 | `graphify-impact-analyzer` | Code change blast radius analysis and impacted test scoping via AST graphs. |
277
- | 27 | `skillspector-security-guard` | Audit AI agent skills and MCP configurations against prompt injection vectors. |
278
- | 28 | `gherkin-to-suite` | Compile Gherkin `.feature` BDD files into an expanded test matrix, Universal IR, and coverage-gap report. |
279
- | 29 | `rbt-manual-testing` | 6-stage Risk-Based Testing (AI-RBT) manual test case synthesis, 12-column matrix, and input checklist. |
280
- | 30 | `agy-customizations` | Antigravity Customization System guide for skills, rules, hooks, and MCP servers. |
281
- | 31 | `persistent-planning-files` | Persist plans, findings, and progress to three markdown files so multi-phase work survives context resets. |
282
- | 32 | `surgical-coding-principles` | Four disciplined-change principles: state assumptions, minimal diffs, every line traces to the request. |
283
- | 33 | `lean-code-ladder` | 7-rung reuse-first ladder: pick the smallest complete solution before writing new code. |
284
- | 34 | `playwright-webapp-testing` | Managed server lifecycle (start/ready/teardown) for local Playwright webapp test runs. |
285
- | 35 | `test-driven-development` | RED-GREEN-REFACTOR discipline: no production code before a watched failing test. |
286
- | 36 | `systematic-debugging` | Four-phase root-cause investigation before any fix; 3 failed fixes signal an architecture question. |
287
- | 37 | `verification-before-completion` | Evidence protocol: every pass/done claim requires fresh command output from the current session. |
288
- | 38 | `meta-prompt-crafter` | Meta-prompt engineer: Transforms rough requests into high-fidelity prompts for any target AI. |
289
- | 39 | `senior-code-review` | Senior-level diff code review: bugs, security risks, concurrency, missing tests, and bloat reduction. |
290
- | 40 | `repo-quality-audit` | Whole codebase quality audit: bugs, scale bottlenecks, dead code, ranked with "Fix this first" priority. |
291
- | 41 | `technical-debt-harvester` | Harvests `shortcut:` comments into an actionable debt ledger via `agent-qa debt`. |
292
- | 42 | `lean-impact-scoreboard` | Displays empirical benchmark scoreboard of code reduction %, token savings, and execution speed. |
293
-
294
- > **Open source & credits:** Skills and tools are adapted and specialized from open-source projects (NVIDIA SkillSpector, andrej-karpathy-skills, ponytail, planning-with-files, anthropics/skills, superpowers, wshobson/agents, vercel-labs/agent-browser, LaVague, graphify...) β€” full license and author attribution details in `NOTICE` (entries 1-33); companion external-tool guide in `docs/adopted-ecosystem-tools.md`.
295
-
296
- </details>
297
-
298
- ---
299
-
300
- ## πŸ› οΈ 8. CLI Tooling Arsenal (tools/)
301
-
302
- Synapse Hub includes over 68 utility tools implemented entirely in the **Python Standard Library** (zero external dependencies):
303
-
304
- ```bash
305
- # 1. Diagnose local environment (Node, Python, Chrome, Git)
306
- npx synapse-hub doctor
307
-
308
- # 2. Run 10 Quality Gates DoD Verification (Gate 0–9)
309
- npx synapse-hub verify
310
-
311
- # 3. Scan for fake-passes, tautologies, and empty catch blocks
312
- npx synapse-hub lint ./tests
313
-
314
- # 4. Distill verbose CI/CD logs down to root causes
315
- npx synapse-hub distill path/to/ci.log
316
-
317
- # 5. Export test cases to formatted Excel .xlsx
318
- npx synapse-hub export-excel
319
-
320
- # 6. Verify assertion sensitivity via syntactic micro-mutations
321
- npx synapse-hub mutate ./tests
322
-
323
- # 7. Detect and quarantine flaky tests
324
- npx synapse-hub flaky scan ./tests
325
-
326
- # 8. Query lifelong verified PageClass library (Voyager SkillVault)
327
- python tools/skill_vault.py --query "table_pagination"
328
-
329
- # 9. Episodic reflection self-healing loop (Noah Shinn Reflexion K=3)
330
- python tools/auto_heal_reflexion.py --test "TC_Checkout_01" --error "ElementClickInterceptedException"
331
-
332
- # 10. Interrogate ambiguous requirements (Pocock Grilling Engine)
333
- python tools/interview_story.py "As a user I want to checkout"
334
-
335
- # 11. Optimize assertion prompts against mutants (TextGrad Loss Optimizer)
336
- python tools/textgrad_mutation_optimizer.py --file tests/test_login.py
337
-
338
- # 12. Benchmark agent tool-calling precision (Gorilla BFCL Benchmark)
339
- python tools/synapse_qa_bench.py
340
- ```
341
-
342
- *(See [docs/CLI_REFERENCE.md](docs/CLI_REFERENCE.md) and [tools/TOOLS_RUNBOOK.md](tools/TOOLS_RUNBOOK.md) for parameter details).*
343
-
344
- > πŸ’‘ **Equivalent Command Aliases:** When installed globally (`npm i -g synapse-hub`), you can interchangeably use `synapse-hub`, `synapse`, or `agent-qa` (e.g., `synapse verify`, `agent-qa lint ./tests`).
345
121
 
346
122
  ---
347
123
 
348
- ## πŸ“„ Provenance & Attribution (MIT License)
124
+ ## πŸ“š Deep Technical Documentation
349
125
 
350
- This software was created and designed by **ThαΊΏ Vα»‹ ([@TeeVee998](https://github.com/TeeVee998))** under the open-source [MIT License](LICENSE).
351
- You are free to use, modify, and distribute this software, provided that the **original author attribution and copyright notice are preserved**.
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)