synapse-hub 2.7.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 (141) 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/rules/communication-style.md +4 -0
  5. package/.agents/rules/context-engineering.md +1 -0
  6. package/.agents/rules/git-push-protocol.md +17 -0
  7. package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
  8. package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
  9. package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
  10. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
  11. package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
  12. package/.agents/skills/lean-impact-scoreboard/SKILL.md +1 -1
  13. package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +1 -1
  14. package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
  15. package/.agents/skills/persistent-planning-files/SKILL.md +1 -1
  16. package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
  17. package/.agents/skills/repo-quality-audit/SKILL.md +1 -1
  18. package/.agents/skills/review-spec/SKILL.md +1 -1
  19. package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
  20. package/.agents/skills/senior-code-review/SKILL.md +1 -1
  21. package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
  22. package/.agents/skills/surgical-coding-principles/SKILL.md +1 -1
  23. package/.agents/skills/technical-debt-harvester/SKILL.md +1 -1
  24. package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
  25. package/.agents/skills/verification-before-completion/SKILL.md +2 -2
  26. package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +2 -2
  27. package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
  28. package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +61 -0
  29. package/AGENTS.md +6 -4
  30. package/CLAUDE.md +2 -1
  31. package/README.en.md +71 -292
  32. package/README.md +69 -304
  33. package/action.yml +1 -1
  34. package/bin/agent-qa.js +2 -2
  35. package/docs/ARCHITECTURE.en.md +192 -0
  36. package/docs/ARCHITECTURE.md +135 -88
  37. package/docs/CI_CD_INTEGRATION.en.md +96 -0
  38. package/docs/CI_CD_INTEGRATION.md +24 -22
  39. package/docs/CLI_REFERENCE.en.md +174 -0
  40. package/docs/CLI_REFERENCE.md +120 -115
  41. package/docs/CONTRIBUTING.en.md +49 -0
  42. package/docs/CONTRIBUTING.md +26 -68
  43. package/docs/QUALITY_GATES.en.md +115 -0
  44. package/docs/QUALITY_GATES.md +115 -0
  45. package/docs/research/agent_skill_training_analysis.md +1 -1
  46. package/package.json +1 -1
  47. package/scripts/package_dist.py +2 -1
  48. package/skills_manifest.json +6 -6
  49. package/synapse.config.json +1 -1
  50. package/templates/ai_bridges/CLAUDE.md +2 -1
  51. package/templates/ai_bridges/copilot-instructions.md +2 -2
  52. package/tools/__init__.py +18 -1
  53. package/tools/_openapi_parser.py +1 -1
  54. package/tools/agent_canary.py +42 -30
  55. package/tools/agentless_patcher.py +2 -2
  56. package/tools/analyze_project.py +3 -5
  57. package/tools/api_drift_sentinel.py +4 -4
  58. package/tools/api_fuzzer.py +8 -8
  59. package/tools/auto_heal.py +4 -5
  60. package/tools/auto_heal_reflexion.py +10 -2
  61. package/tools/autogen_qa_broker.py +2 -2
  62. package/tools/browser_helpers.js +2 -2
  63. package/tools/browsergym_eval.py +2 -3
  64. package/tools/bug_reporter.py +11 -13
  65. package/tools/bump_version.py +90 -19
  66. package/tools/cache_resolver.py +78 -83
  67. package/tools/check_env.py +9 -1
  68. package/tools/check_version_sync.py +58 -4
  69. package/tools/ci_healing_hook.py +4 -6
  70. package/tools/cli.py +5 -7
  71. package/tools/config_decoupler.py +2 -3
  72. package/tools/contract_validator.py +141 -0
  73. package/tools/core/__init__.py +52 -0
  74. package/tools/count_tokens.py +22 -20
  75. package/tools/dashboard_generator.py +629 -1000
  76. package/tools/db_sandbox.py +87 -62
  77. package/tools/debt_harvester.py +3 -3
  78. package/tools/distill_log.py +3 -3
  79. package/tools/dspy_qa_signatures.py +3 -4
  80. package/tools/export_postman_collection.py +8 -8
  81. package/tools/flaky_detector.py +2 -2
  82. package/tools/fuzz_payloads.py +5 -5
  83. package/tools/generate_allure_report.py +1 -1
  84. package/tools/generate_jmx_plan.py +4 -4
  85. package/tools/gherkin_suite.py +1 -1
  86. package/tools/git_pre_commit_guard.py +2 -2
  87. package/tools/goldfish_review.py +2 -2
  88. package/tools/heal/__init__.py +28 -0
  89. package/tools/heal_pr_automator.py +6 -6
  90. package/tools/heuristic_locator_matcher.py +2 -2
  91. package/tools/infer_linter.py +143 -29
  92. package/tools/interview_story.py +0 -1
  93. package/tools/jtl_analyzer.py +11 -11
  94. package/tools/lint/__init__.py +30 -0
  95. package/tools/lint_ai_docs.py +42 -0
  96. package/tools/lookup_tc.py +1 -1
  97. package/tools/matrix_sharder.py +15 -13
  98. package/tools/mcp/__init__.py +16 -0
  99. package/tools/mcp_excel_server.py +2 -2
  100. package/tools/mcp_server.py +9 -7
  101. package/tools/md_to_xlsx.py +26 -26
  102. package/tools/micro_mutator.py +32 -15
  103. package/tools/network_mock_shield.py +27 -27
  104. package/tools/newman_analyzer.py +2 -3
  105. package/tools/omni_emitter.py +5 -8
  106. package/tools/omni_parser.py +5 -5
  107. package/tools/omni_transpiler.py +5 -5
  108. package/tools/output_formatter.py +19 -0
  109. package/tools/perf/__init__.py +24 -0
  110. package/tools/pinpoint_failure.py +1 -1
  111. package/tools/project_state.py +0 -2
  112. package/tools/qa_event_stream.py +1 -1
  113. package/tools/repo_map.py +8 -8
  114. package/tools/report/__init__.py +32 -0
  115. package/tools/reversible_sandbox.py +3 -4
  116. package/tools/safety_firewall.py +2 -2
  117. package/tools/senior_code_review.py +4 -3
  118. package/tools/setup_project.py +10 -12
  119. package/tools/skill_collision_guard.py +3 -3
  120. package/tools/skill_vault.py +94 -6
  121. package/tools/skillspector.py +10 -8
  122. package/tools/smart_visual_masker.py +4 -6
  123. package/tools/spec_drift_sentinel.py +1 -2
  124. package/tools/swe_qa_aci.py +2 -2
  125. package/tools/synapse_qa_bench.py +3 -3
  126. package/tools/sync_agent_rules.py +18 -3
  127. package/tools/telemetry_correlator.py +3 -2
  128. package/tools/test_impact.py +2 -1
  129. package/tools/test_memory_os.py +15 -5
  130. package/tools/textgrad_mutation_optimizer.py +3 -3
  131. package/tools/tms_sync_bridge.py +5 -5
  132. package/tools/tot_exploratory_tester.py +5 -6
  133. package/tools/traffic_session_converter.py +9 -9
  134. package/tools/universal_ir.py +2 -3
  135. package/tools/update_sentinel.py +6 -9
  136. package/tools/verify_all.py +12 -2
  137. package/tools/visual_diff_canvas.py +4 -4
  138. package/tools/visual_som_helper.py +15 -13
  139. package/tools/watch_mode.py +1 -1
  140. package/tools/wcag_audit.py +22 -1
  141. package/tools/welcome_page.py +5 -6
@@ -0,0 +1,96 @@
1
+ # CI/CD Integration Guide — Synapse-Hub Enterprise QA
2
+
3
+ [🇻🇳 Tiếng Việt](CI_CD_INTEGRATION.md) | [🇬🇧 English Edition](CI_CD_INTEGRATION.en.md)
4
+
5
+ This guide explains how to integrate Synapse-Hub quality gates (`verify_all.py`, `infer_linter`, AST mutator, Clean POM checks) directly into target project CI/CD pipelines without local filesystem dependencies.
6
+
7
+ ---
8
+
9
+ ## 1. Zero-Install NPX Integration (Recommended)
10
+
11
+ Since `synapse-hub` is distributed via NPM Registry and GitHub Packages, target CI pipelines do not need to clone the hub repository manually. `npx` dynamically fetches and executes the CLI engine.
12
+
13
+ ### GitHub Actions Workflow (`.github/workflows/synapse_qa.yml`)
14
+
15
+ ```yaml
16
+ name: Synapse QA Quality Gate
17
+
18
+ on:
19
+ push:
20
+ branches: [ main, develop, master ]
21
+ pull_request:
22
+ branches: [ main, develop, master ]
23
+
24
+ jobs:
25
+ quality-gate:
26
+ name: 10 Quality Gates DoD Verification
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - name: Checkout Project Source
30
+ uses: actions/checkout@v4
31
+
32
+ - name: Setup Node.js & Python
33
+ uses: actions/setup-node@v4
34
+ with:
35
+ node-version: 20
36
+ - uses: actions/setup-python@v5
37
+ with:
38
+ python-version: '3.12'
39
+
40
+ - name: Verify 10 Quality Gates
41
+ run: npx synapse-hub verify
42
+ ```
43
+
44
+ ### GitLab CI (`.gitlab-ci.yml`)
45
+
46
+ ```yaml
47
+ synapse-qa-gate:
48
+ stage: test
49
+ image: node:20-bookworm
50
+ before_script:
51
+ - apt-get update && apt-get install -y python3 python3-pip
52
+ script:
53
+ - npx synapse-hub verify
54
+ rules:
55
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
56
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
57
+ ```
58
+
59
+ ---
60
+
61
+ ## 2. Git Submodule Integration (For Air-Gapped / Private SCM)
62
+
63
+ If your enterprise network restricts public NPM registry access, mount `Synapse-Hub` as a Git Submodule inside the target repository:
64
+
65
+ ```bash
66
+ # Add submodule into target project
67
+ git submodule add https://github.com/TeeVee998/Synapse-Hub.git .synapse-hub
68
+ ```
69
+
70
+ In your CI pipeline:
71
+ ```bash
72
+ git submodule update --init --recursive
73
+ python .synapse-hub/tools/verify_all.py
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 3. Python Git / Pip Package Integration
79
+
80
+ Target runners with Python 3.9+ can install `synapse-hub` directly from git:
81
+
82
+ ```bash
83
+ pip install git+https://github.com/TeeVee998/Synapse-Hub.git
84
+ agent-qa verify
85
+ ```
86
+
87
+ ---
88
+
89
+ ## 4. Available CI Subcommands
90
+
91
+ | Command | Purpose | SLA / Exit Code |
92
+ | :--- | :--- | :--- |
93
+ | `npx synapse-hub verify` | Executes all 10 Quality Gates DoD | Exits `0` if all PASS; non-zero if any FAIL. |
94
+ | `npx synapse-hub lint` | Meta Infer-style static defect and fake-pass scan | Fails if 0-assert tests or empty catches exist. |
95
+ | `npx synapse-hub mutate --min-score 80` | Syntactic Micro-Mutation verification | Fails if test assertion score < 80%. |
96
+ | `npx synapse-hub analyze` | Comprehensive 5-in-1 health audit | Outputs health score and JSON/Markdown artifacts. |
@@ -1,14 +1,16 @@
1
- # CI/CD Integration Guide — Synapse-Hub Enterprise QA
1
+ # Hướng Dẫn Tích Hợp CI/CD — Synapse-Hub Enterprise QA
2
2
 
3
- This guide explains how to integrate Synapse-Hub quality gates (`verify_all.py`, `infer_linter`, AST mutator, Clean POM checks) directly into target project CI/CD pipelines without local filesystem dependencies.
3
+ [🇻🇳 Tiếng Việt](CI_CD_INTEGRATION.md) | [🇬🇧 English Edition](CI_CD_INTEGRATION.en.md)
4
+
5
+ Tài liệu này hướng dẫn cách đưa các cổng kiểm định chất lượng của Synapse Hub (`verify_all.py`, `infer_linter`, bộ micro-mutation và kiểm tra Clean POM) trực tiếp vào đường ống CI/CD của dự án test mà không phụ thuộc vào môi trường máy cá nhân.
4
6
 
5
7
  ---
6
8
 
7
- ## 1. Zero-Install NPX Integration (Recommended)
9
+ ## 1. Tích Hợp Chạy Ngay Qua Lệnh NPX (Khuyên Dùng)
8
10
 
9
- Since `synapse-hub` is distributed via NPM Registry and GitHub Packages, target CI pipelines do not need to clone the hub repository manually. `npx` dynamically fetches and executes the CLI engine.
11
+ Do `synapse-hub` được phát hành sẵn trên NPM Registry và GitHub Packages, pipeline CI của dự án không cần clone repo Hub về máy. Lệnh `npx` sẽ tự động tải và kích hoạt CLI tức thì.
10
12
 
11
- ### GitHub Actions Workflow (`.github/workflows/synapse_qa.yml`)
13
+ ### Đường Ống GitHub Actions (`.github/workflows/synapse_qa.yml`)
12
14
 
13
15
  ```yaml
14
16
  name: Synapse QA Quality Gate
@@ -21,13 +23,13 @@ on:
21
23
 
22
24
  jobs:
23
25
  quality-gate:
24
- name: 9 Quality Gates DoD Verification
26
+ name: Kiểm Định 10 Cổng Chất Lượng DoD
25
27
  runs-on: ubuntu-latest
26
28
  steps:
27
- - name: Checkout Project Source
29
+ - name: Checkout Mã Nguồn Dự Án
28
30
  uses: actions/checkout@v4
29
31
 
30
- - name: Setup Node.js & Python
32
+ - name: Cài Đặt Node.js & Python
31
33
  uses: actions/setup-node@v4
32
34
  with:
33
35
  node-version: 20
@@ -35,11 +37,11 @@ jobs:
35
37
  with:
36
38
  python-version: '3.12'
37
39
 
38
- - name: Verify 9 Quality Gates
40
+ - name: Chạy Kiểm Định 10 Cổng Chất Lượng
39
41
  run: npx synapse-hub verify
40
42
  ```
41
43
 
42
- ### GitLab CI (`.gitlab-ci.yml`)
44
+ ### Đường Ống GitLab CI (`.gitlab-ci.yml`)
43
45
 
44
46
  ```yaml
45
47
  synapse-qa-gate:
@@ -56,16 +58,16 @@ synapse-qa-gate:
56
58
 
57
59
  ---
58
60
 
59
- ## 2. Git Submodule Integration (For Air-Gapped / Private SCM)
61
+ ## 2. Tích Hợp Dạng Git Submodule (Dành Cho Mạng Nội Bộ / Không Có Internet)
60
62
 
61
- If your enterprise network restricts public NPM registry access, mount `Synapse-Hub` as a Git Submodule inside the target repository:
63
+ Nếu hệ thống mạng nội bộ công ty bị chặn truy cập ra ngoài internet hoặc NPM registry công khai, bạn có thể gắn `Synapse-Hub` như một Git Submodule bên trong repo của dự án test:
62
64
 
63
65
  ```bash
64
- # Add submodule into target project
66
+ # Thêm submodule vào thư mục dự án test
65
67
  git submodule add https://github.com/TeeVee998/Synapse-Hub.git .synapse-hub
66
68
  ```
67
69
 
68
- In your CI pipeline:
70
+ Trong file cấu hình pipeline CI:
69
71
  ```bash
70
72
  git submodule update --init --recursive
71
73
  python .synapse-hub/tools/verify_all.py
@@ -73,9 +75,9 @@ python .synapse-hub/tools/verify_all.py
73
75
 
74
76
  ---
75
77
 
76
- ## 3. Python Git / Pip Package Integration
78
+ ## 3. Cài Đặt Trực Tiếp Bằng Pip Từ Git
77
79
 
78
- Target runners with Python 3.9+ can install `synapse-hub` directly from git:
80
+ Với các runner CI đã có sẵn môi trường Python 3.10+, bạn có thể cài đặt `synapse-hub` trực tiếp từ Git repository:
79
81
 
80
82
  ```bash
81
83
  pip install git+https://github.com/TeeVee998/Synapse-Hub.git
@@ -84,11 +86,11 @@ agent-qa verify
84
86
 
85
87
  ---
86
88
 
87
- ## 4. Available CI Subcommands
89
+ ## 4. Các Lệnh Thường Dùng Trên CI
88
90
 
89
- | Command | Purpose | SLA / Exit Code |
91
+ | Lệnh Thực Thi | Mục Đích | Điều Kiện Vượt Qua / Mã Thoát |
90
92
  | :--- | :--- | :--- |
91
- | `npx synapse-hub verify` | Executes all 9 Quality Gates DoD | Exits `0` if all PASS; non-zero if any FAIL. |
92
- | `npx synapse-hub lint` | Meta Infer-style static defect and fake-pass scan | Fails if 0-assert tests or empty catches exist. |
93
- | `npx synapse-hub mutate --min-score 80` | Syntactic Micro-Mutation verification | Fails if test assertion score < 80%. |
94
- | `npx synapse-hub analyze` | Comprehensive 5-in-1 health audit | Outputs health score and JSON/Markdown artifacts. |
93
+ | `npx synapse-hub verify` | Chạy toàn diện 10 Cổng Chất Lượng DoD | Trả về `0` nếu toàn bộ PASS; báo lỗi khác 0 nếu có bất kỳ cổng nào FAIL. |
94
+ | `npx synapse-hub lint` | Bắt lỗi tĩnh Meta Infer-style và test pass ảo | Fail ngay nếu có test 0 câu assert hoặc try-catch nuốt lỗi. |
95
+ | `npx synapse-hub mutate --min-score 80` | Kiểm tra độ nhạy của các câu assert bằng Micro-Mutation | Fail nếu điểm diệt đột biến của test < 80%. |
96
+ | `npx synapse-hub analyze` | Báo cáo kiểm toán sức khỏe dự án 5-trong-1 | Xuất điểm đánh giá và file báo cáo JSON/Markdown cho team. |
@@ -0,0 +1,174 @@
1
+ # Agent-QA CLI & Tools Reference Manual
2
+
3
+ [🇻🇳 Tiếng Việt](CLI_REFERENCE.md) | [🇬🇧 English Edition](CLI_REFERENCE.en.md)
4
+
5
+ The `agent-skills` Hub provides a unified CLI utility `agent-qa` (and direct python scripts in `tools/`) to execute quality gates, linting, impact analysis, and log distillation.
6
+
7
+ ---
8
+
9
+ ## 1. Unified CLI Entrypoint (`agent-qa`)
10
+
11
+ When installed via `pip install -e .`, the `agent-qa` command is globally accessible:
12
+
13
+ ```bash
14
+ agent-qa <command> [options]
15
+ ```
16
+
17
+ ### Supported Commands (53 Subcommands)
18
+
19
+ #### A. Core Quality & DoD Gates
20
+ | Command | Subsystem | Description | Example |
21
+ | :--- | :--- | :--- | :--- |
22
+ | `verify` | Quality Sentinel | Executes all 9 Quality Gates DoD validation | `synapse-hub verify` |
23
+ | `lint` | Static Analysis | Polyglot heuristic & static AST defect scanner with baseline & suppression | `synapse-hub lint ./tests` |
24
+ | `mutate` | Mutation Sentinel | Syntactic micro-mutator checking assertion sensitivity | `synapse-hub mutate ./tests --min-score 80` |
25
+ | `watch` | HUD Sentinel | Incremental live file watcher for real-time quality feedback | `synapse-hub watch` |
26
+ | `wcag-audit` | Accessibility | WCAG 2.2 accessibility conformance and contrast auditor | `synapse-hub wcag-audit ./reports/WELCOME.html` |
27
+ | `trace-data-flow` | Data Flow | Taint analysis tracing test data lifecycles to detect DB leaks | `synapse-hub trace-data-flow ./tests` |
28
+ | `verify-author` | Provenance Guard | Validates canonical author attribution watermark | `synapse-hub verify-author` |
29
+ | `debt` | Technical Debt | Harvests `shortcut:` annotations across repo into markdown ledger | `synapse-hub debt` |
30
+ | `review` | Senior Review | 6-pillar code change review (Bugs, Security, Scale, Tests, Speed, Bloat) | `synapse-hub review` |
31
+
32
+ #### B. Diagnostics, Onboarding & Visual Landing
33
+ | Command | Subsystem | Description | Example |
34
+ | :--- | :--- | :--- | :--- |
35
+ | `doctor` | Environment Audit | 1-click diagnostic for Node.js, Python, Chrome, Git | `synapse-hub doctor` |
36
+ | `welcome` | Visual Landing | Launches interactive bilingual landing page in browser | `synapse-hub welcome` |
37
+ | `setup` | Project Setup | Bootstraps project, generates AI Guide & AI Bridges | `synapse-hub setup --local-only` |
38
+ | `uninstall` | Clean Removal | Cleanly removes AI Bridges, hooks, and local configurations | `synapse-hub uninstall` |
39
+ | `sync-rules` | AI Bridge Sync | Synchronizes AGENTS.md rules across all IDE assistants | `synapse-hub sync-rules` |
40
+ | `version` | Hub Metadata | Displays installed Hub version and catalog summary | `synapse-hub version` |
41
+ | `update` | Auto-Update | 1-click upgrade engine syncing latest upstream changes | `synapse-hub update` |
42
+ | `clean` | Artifact Janitor | Cleans up temporary artifacts, cache files, and logs | `synapse-hub clean` |
43
+
44
+ #### C. Self-Healing, Triage & Token Optimization
45
+ | Command | Subsystem | Description | Example |
46
+ | :--- | :--- | :--- | :--- |
47
+ | `heal` | Semantic Memory | Queries zero-token semantic error memory cache | `synapse-hub heal query "StaleElement"` |
48
+ | `auto-heal` | Closed-Loop | Autonomous test healing engine parsing JUnit failures | `synapse-hub auto-heal` |
49
+ | `heal-pr` | PR Automator | Creates automated Git branch and PR with healing patch | `synapse-hub heal-pr --branch heal/fix-login` |
50
+ | `distill` | Token Optimizer | Filters verbose CLI/Gradle/CI logs by 95% | `synapse-hub distill build.log` |
51
+ | `pinpoint-failure` | Failure Autopsy | Parses JUnit XML reports and locates exact failing lines in 0.1s | `synapse-hub pinpoint-failure report.xml` |
52
+ | `flaky` | Quarantine | Detects non-deterministic flaky tests and manages quarantine | `synapse-hub flaky --detect` |
53
+ | `lookup-tc` | TC Index | Searches test cases by ID, tag, priority, or flow name | `synapse-hub lookup-tc TC-101` |
54
+ | `lookup-xpath` | Selector Cache | Queries cached resilient XPath & AOM element locators | `synapse-hub lookup-xpath "Submit"` |
55
+ | `impact` | AST Knowledge | Analyzes blast radius of git code changes | `synapse-hub impact --git-diff` |
56
+ | `canary` | Resilience Arena | Injects failure vectors to test autonomous recovery MTTR | `synapse-hub canary --run` |
57
+ | `report-bug` | Bug Triage | Generates structured Markdown/Jira defect reports from RCA | `synapse-hub report-bug --junit report.xml` |
58
+ | `ci-hook` | CI Integration | CI/CD hook executing automated triage on build failure | `synapse-hub ci-hook --log ci.log` |
59
+ | `tokens` | Token Counter | Measures prompt tokens across files and subagent contexts | `synapse-hub tokens path/to/prompt.md` |
60
+
61
+ #### D. API, Performance & Security Testing
62
+ | Command | Subsystem | Description | Example |
63
+ | :--- | :--- | :--- | :--- |
64
+ | `fuzz-api` | Security Fuzzer | Non-production API security, boundary, and chaos fuzzer | `synapse-hub fuzz-api --spec openapi.json` |
65
+ | `contract-drift` | Drift Sentinel | Detects breaking changes and schema drift in API specs | `synapse-hub contract-drift --baseline v1.json --current v2.json` |
66
+ | `generate-jmx` | Load Testing | Compiles User Story / API specs into Apache JMeter JMX plan | `synapse-hub generate-jmx --threads 50` |
67
+ | `analyze-jtl` | Load Analysis | Parses JMeter JTL execution logs and asserts SLA thresholds | `synapse-hub analyze-jtl results.jtl` |
68
+ | `analyze-newman` | Postman Audit | Analyzes Newman execution JSON reports for API quality | `synapse-hub analyze-newman newman_run.json` |
69
+ | `export-postman` | Collection Gen | Exports API specification into Postman Collection v2.1 | `synapse-hub export-postman --spec swagger.json` |
70
+ | `mock-shield` | Route Mocking | Generates Playwright network route mocks from API specs | `synapse-hub mock-shield --spec openapi.json` |
71
+ | `skillspector` | AI Security | Audits AI Agent skills and MCP configs for prompt injection | `synapse-hub skillspector --dir .agents/skills` |
72
+ | `safety-check` | Firewall Guard | Dry-run code snippet analysis for destructive UI actions | `synapse-hub safety-check --snippet "btn.click()"` |
73
+
74
+ #### E. Code Generation, Transpilation & Formatting
75
+ | Command | Subsystem | Description | Example |
76
+ | :--- | :--- | :--- | :--- |
77
+ | `generate-tc` | Story Compiler | Compiles natural language user stories into Clean POM test cases | `synapse-hub generate-tc story.md` |
78
+ | `export-excel` | Excel Reporter | Converts Markdown test cases to standard 12-column Excel | `synapse-hub export-excel` |
79
+ | `gherkin` | BDD Compiler | Compiles Gherkin .feature specs into executable suites | `synapse-hub gherkin specs/checkout.feature` |
80
+ | `transpile` | Omni Transpiler | Transpiles test code between Playwright, Pytest, Katalon | `synapse-hub transpile tests/spec.ts --to pytest` |
81
+ | `omni-scan` | Engine Scanner | Scans polyglot repositories for test framework presence | `synapse-hub omni-scan` |
82
+ | `shard` | Matrix Sharder | Partitions test suites across parallel CI runners | `synapse-hub shard ./tests --runners 4` |
83
+ | `visual-mask` | Visual Sentinel | Computes anti-flake coordinate masks for visual testing | `synapse-hub visual-mask screenshot.png` |
84
+ | `som` | Vision Testing | Visual Set-of-Marks helper for interactive elements | `synapse-hub som screen.png` |
85
+ | `decouple-config`| Config Isolator | Decouples environment variables and credentials from code | `synapse-hub decouple-config config.groovy` |
86
+ | `correlate-telemetry` | Correlator | Correlates browser traces, HTTP logs, and server logs | `synapse-hub correlate-telemetry --trace trace.zip` |
87
+ | `dashboard` | Project HUD | Generates standalone HTML5 executive health dashboard | `synapse-hub dashboard` |
88
+ | `analyze` | Health Audit | Comprehensive 5-in-1 repository health and DoD audit | `synapse-hub analyze` |
89
+ | `mcp-serve` | MCP Server | Launches Model Context Protocol (MCP) server over stdio | `synapse-hub mcp-serve` |
90
+
91
+ ---
92
+
93
+ ## 2. Direct Python Scripts Runbook
94
+
95
+ If running without global package installation, tools can be executed directly via Python:
96
+
97
+ ### 2.1. Verify 10 Quality Gates (Gate 0 - Gate 9)
98
+ ```bash
99
+ # Auto-detect mode (default: detects Hub vs Target Test Project)
100
+ python tools/verify_all.py
101
+
102
+ # Explicit mode selection
103
+ python tools/verify_all.py --mode hub # QA Hub integrity validation
104
+ python tools/verify_all.py --mode target # Target automation suite validation
105
+ ```
106
+ - **Operational Modes:**
107
+ - `--mode hub`: Validates QA Hub assets, skills, tools integrity, zero BOM, path portability, and universal credential security across repository files without requiring target test scripts.
108
+ - `--mode target`: Enforces target automation suite standards including Clean POM across test scripts and credential encryption.
109
+ - **Gate 0:** Author Attribution & Provenance Guard (preserves MIT author notice).
110
+ - **Gate 1:** 100% UTF-8 No BOM check across all scripts, markdown, and config files.
111
+ - **Gate 2:** Path Portability (zero absolute host/machine directory paths).
112
+ - **Gate 3:** Clean POM & Flat Architecture (zero raw XPaths/CSS in test scripts).
113
+ - **Gate 4:** AI Docs & Artifacts Anti-Drift check (zero hallucinated tools/classes).
114
+ - **Gate 5:** Temporary file and properties artifact cleanup.
115
+ - **Gate 6:** Credential Security & Secret Scanner (zero hardcoded plaintext passwords or API tokens).
116
+ - **Gate 7:** Static Defect & AST Fake-Pass Sentinel.
117
+ - **Gate 8:** Syntactic Micro-Mutation Sentinel (Requires Mutation Score >= 80%).
118
+ - **Gate 9:** Skill Routing & Collision Guard (Cosine similarity < 0.75).
119
+
120
+ ### 2.2. AST Fake-Pass Sentinel
121
+ ```bash
122
+ python tools/infer_linter.py
123
+ ```
124
+
125
+ ### 2.3. Semantic Memory Cache & Negative Feedback Blacklist
126
+ ```bash
127
+ # Initialize database with seed solutions and forbidden anti-patches
128
+ python tools/cache_resolver.py init
129
+
130
+ # Query pre-tested patches AND retrieve blacklisted anti-patches (0 tokens)
131
+ python tools/cache_resolver.py query --error "ElementClickInterceptedException"
132
+
133
+ # Learn a verified working solution (Positive Memory)
134
+ python tools/cache_resolver.py learn --error "Timeout" --cause "Slow API" --patch "waitForNetworkIdle()" --symptom "Spinner"
135
+
136
+ # Record a failed bug fix attempt into blacklist (Negative Memory)
137
+ python tools/cache_resolver.py record-failed --error "StaleElement" --patch "sleep(5000)" --reason "Still fails under network latency"
138
+ ```
139
+
140
+ ### 2.4. Log Distiller
141
+ ```bash
142
+ python tools/distill_log.py execution.log
143
+ ```
144
+
145
+ ### 2.5. Technical Debt Harvester
146
+ ```bash
147
+ python tools/debt_harvester.py --scan
148
+ python tools/debt_harvester.py --scan ./src --output DEBT_LEDGER.md
149
+ ```
150
+
151
+ ### 2.6. Senior Code Reviewer (6 Pillars)
152
+ ```bash
153
+ python tools/senior_code_review.py
154
+ python tools/senior_code_review.py --staged
155
+ ```
156
+
157
+ ---
158
+
159
+ ## 3. Standard Exit Code Specification & Terminal Environment
160
+
161
+ Synapse Hub adheres to deterministic, standardized UNIX exit codes across all CLI tools:
162
+
163
+ | Exit Code | Constant Name | Description | Typical Remediation |
164
+ | :---: | :--- | :--- | :--- |
165
+ | **`0`** | `EXIT_SUCCESS` | Operation passed; all Quality Gates satisfied; 0 critical defects. | Proceed to next pipeline stage or commit. |
166
+ | **`1`** | `EXIT_FAILURE` | Quality Gate rejection; test execution failure; linter defect found. | Review failing check details; fix unasserted or swallowed code. |
167
+ | **`2`** | `EXIT_USAGE_ERROR` | Invalid CLI arguments; unknown subcommand; syntax error. | Check command syntax via `--help`. |
168
+ | **`3`** | `EXIT_SECURITY_BLOCK` | Destructive action blocked by safety firewall; secret token leak; MIT license modified. | Review security violation; set `ALLOW_DESTRUCTIVE=1` if intentional. |
169
+ | **`4`** | `EXIT_ENVIRONMENT_ERROR` | Incompatible runtime; missing required tool (e.g. Python < 3.9). | Install recommended runtime (Python 3.10+, Node 20+). |
170
+
171
+ ### Terminal Environment Standards:
172
+ - **`NO_COLOR` Support:** In accordance with [no-color.org](https://no-color.org), setting the `NO_COLOR` environment variable automatically suppresses all ANSI color escape sequences.
173
+ - **`--quiet` / `-q` Flag:** Pass `-q` or `--quiet` to suppress informational banners and output only critical verdicts or machine-readable results.
174
+ - **Machine-Readable Formats:** Use `--format json`, `--format sarif`, or `--format junit` for clean, parseable pipeline outputs.