synapse-hub 2.2.4 → 2.4.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 (311) hide show
  1. package/.agents/agents/failure-analyst.md +11 -0
  2. package/.agents/agents/live-explorer.md +28 -0
  3. package/.agents/agents/orchestrator.md +20 -4
  4. package/.agents/agents/pom-crafter.md +12 -0
  5. package/.agents/agents/quality-gatekeeper.md +19 -4
  6. package/.agents/agents/test-runner.md +11 -0
  7. package/.agents/rules/communication-style.md +40 -0
  8. package/.agents/rules/context-engineering.md +23 -0
  9. package/.agents/rules/git-push-protocol.md +10 -16
  10. package/.agents/rules/graphify.md +14 -14
  11. package/.agents/rules/mandatory-playwright-live.md +29 -29
  12. package/.agents/rules/mobile_appium_rules.md +132 -0
  13. package/.agents/rules/performance_testing_rules.md +74 -0
  14. package/.agents/rules/systematic-debugging.md +6 -6
  15. package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +64 -215
  16. package/.agents/skills/agent-orchestration-multi-agent-optimize/examples/swarm_workload_config.json +12 -0
  17. package/.agents/skills/antigravity-test-sentinel/SKILL.md +3 -3
  18. package/.agents/skills/antigravity-test-sentinel/examples/dod_gate_policy.json +11 -0
  19. package/.agents/skills/api-network-mocking-interception/SKILL.md +1 -1
  20. package/.agents/skills/api-network-mocking-interception/examples/network_route_stub.json +9 -0
  21. package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +9 -9
  22. package/.agents/skills/api-spec-to-e2e-matrix/examples/sample_openapi.json +19 -0
  23. package/.agents/skills/architecture-decision-records/SKILL.md +35 -412
  24. package/.agents/skills/architecture-decision-records/examples/0001-record-architecture-decisions.md +12 -0
  25. package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +1 -1
  26. package/.agents/skills/auth-session-and-cookie-manager/examples/storage_state_sample.json +11 -0
  27. package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +80 -186
  28. package/.agents/skills/backend-load-and-stress-patterns/examples/k6_load_test_sample.js +13 -0
  29. package/.agents/skills/bats-testing-patterns/SKILL.md +1 -1
  30. package/.agents/skills/bats-testing-patterns/examples/cli_runner_test.bats +6 -0
  31. package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -614
  32. package/.agents/skills/clean-pom-crafter/SKILL.md +21 -3
  33. package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -28
  34. package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -138
  35. package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +2 -2
  36. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +9 -0
  37. package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +5 -5
  38. package/.agents/skills/db-state-verifier-and-seeder/examples/db_fixture_seed.json +12 -0
  39. package/.agents/skills/e2e-testing-patterns/SKILL.md +1 -1
  40. package/.agents/skills/e2e-testing-patterns/examples/playwright_sharded_config.ts +12 -0
  41. package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -522
  42. package/.agents/skills/failure-autopsy-and-healing/SKILL.md +17 -3
  43. package/.agents/skills/failure-autopsy-and-healing/examples/sample_junit_failure.xml +8 -0
  44. package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -64
  45. package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -56
  46. package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +98 -98
  47. package/.agents/skills/file-and-report-validator/SKILL.md +1 -1
  48. package/.agents/skills/file-and-report-validator/examples/sample_export_schema.json +14 -0
  49. package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +3 -3
  50. package/.agents/skills/flaky-test-sentinel-and-quarantine/examples/quarantine_registry.json +11 -0
  51. package/.agents/skills/gherkin-to-suite/SKILL.md +103 -0
  52. package/.agents/skills/gherkin-to-suite/examples/checkout.feature +39 -0
  53. package/.agents/skills/gherkin-to-suite/examples/suite_report_sample.json +334 -0
  54. package/.agents/skills/github-actions-templates/SKILL.md +47 -304
  55. package/.agents/skills/github-actions-templates/examples/matrix_test_pipeline.yml +8 -0
  56. package/.agents/skills/graphify-impact-analyzer/SKILL.md +6 -6
  57. package/.agents/skills/graphify-impact-analyzer/examples/dependency_blast_radius.json +8 -0
  58. package/.agents/skills/katalon-cli-runner/SKILL.md +2 -2
  59. package/.agents/skills/katalon-cli-runner/examples/headless_kre_exec.sh +3 -0
  60. package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -209
  61. package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -155
  62. package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -67
  63. package/.agents/skills/lam-script-generator/SKILL.md +42 -1
  64. package/.agents/skills/lam-script-generator/examples/user_story_sample.md +8 -0
  65. package/.agents/skills/lean-code-ladder/SKILL.md +83 -0
  66. package/.agents/skills/lean-code-ladder/examples/ladder_walkthrough.md +37 -0
  67. package/.agents/skills/meta-prompt-crafter/SKILL.md +107 -0
  68. package/.agents/skills/meta-prompt-crafter/examples/qa_prompt_template.md +35 -0
  69. package/.agents/skills/persistent-planning-files/SKILL.md +108 -0
  70. package/.agents/skills/persistent-planning-files/examples/task_plan_example.md +56 -0
  71. package/.agents/skills/playwright-live-interaction/SKILL.md +49 -1
  72. package/.agents/skills/playwright-live-interaction/examples/live_probe_script.js +5 -0
  73. package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -160
  74. package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -75
  75. package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -388
  76. package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -134
  77. package/.agents/skills/playwright-webapp-testing/SKILL.md +93 -0
  78. package/.agents/skills/playwright-webapp-testing/examples/server_lifecycle_playwright.py +63 -0
  79. package/.agents/skills/rbt-manual-testing/SKILL.md +150 -0
  80. package/.agents/skills/rbt-manual-testing/examples/checkout_rbt_manual_suite.md +25 -0
  81. package/.agents/skills/security-dast-sentinel/SKILL.md +54 -135
  82. package/.agents/skills/security-dast-sentinel/examples/dast_scan_config.json +10 -0
  83. package/.agents/skills/self-healing-locator/SKILL.md +24 -10
  84. package/.agents/skills/self-healing-locator/examples/aom_diff_sample.json +16 -0
  85. package/.agents/skills/skillspector-security-guard/SKILL.md +32 -90
  86. package/.agents/skills/skillspector-security-guard/examples/safe_mcp_config.json +12 -0
  87. package/.agents/skills/surgical-coding-principles/SKILL.md +89 -0
  88. package/.agents/skills/surgical-coding-principles/examples/surgical_vs_scope_creep.md +46 -0
  89. package/.agents/skills/synthetic-test-data-generator/SKILL.md +3 -3
  90. package/.agents/skills/synthetic-test-data-generator/examples/idempotent_data_recipe.json +9 -0
  91. package/.agents/skills/systematic-debugging/SKILL.md +100 -0
  92. package/.agents/skills/systematic-debugging/examples/four_phase_case.md +44 -0
  93. package/.agents/skills/test-driven-development/SKILL.md +114 -0
  94. package/.agents/skills/test-driven-development/examples/red_green_refactor_qa.md +78 -0
  95. package/.agents/skills/token-and-context-optimizer/SKILL.md +1 -1
  96. package/.agents/skills/token-and-context-optimizer/examples/distilled_log_sample.txt +3 -0
  97. package/.agents/skills/verification-before-completion/SKILL.md +100 -0
  98. package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +46 -0
  99. package/.agents/skills/visual-regression-sentinel/SKILL.md +21 -1
  100. package/.agents/skills/visual-regression-sentinel/examples/visual_mask_rules.json +9 -0
  101. package/.agents/skills/wcag-audit-patterns/SKILL.md +3 -3
  102. package/.agents/skills/wcag-audit-patterns/examples/wcag_compliance_checklist.json +10 -0
  103. package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -541
  104. package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +1 -1
  105. package/.agents/skills/web-vitals-and-performance-profiler/examples/cwv_budget_policy.json +6 -0
  106. package/.agents/templates/completion_report.md +57 -57
  107. package/.agents/workflows/analyze_requirement_document.md +18 -0
  108. package/.agents/workflows/export_testcases_excel.md +32 -0
  109. package/.agents/workflows/generate_combinatorial_test_data.md +28 -0
  110. package/.agents/workflows/generate_cross_module_test_plan.md +37 -0
  111. package/.agents/workflows/generate_manual_testcases_rbt.md +56 -0
  112. package/.agents/workflows/generate_requirements_from_website.md +25 -0
  113. package/.agents/workflows/generate_testcases_from_requirements.md +21 -0
  114. package/.agents/workflows/graphify.md +10 -10
  115. package/.agents/workflows/verify.md +2 -2
  116. package/.cursor/rules/language.mdc +7 -7
  117. package/.cursor/rules/synapse-qa.mdc +23 -0
  118. package/.cursorrules +7 -0
  119. package/.pre-commit-hooks.yaml +14 -0
  120. package/.windsurfrules +7 -0
  121. package/AGENTS.md +54 -15
  122. package/CLAUDE.md +35 -12
  123. package/LICENSE +30 -0
  124. package/NOTICE +180 -0
  125. package/README.en.md +325 -0
  126. package/README.md +247 -516
  127. package/action.yml +51 -0
  128. package/benchmarks/qa_eval/README.md +71 -0
  129. package/benchmarks/qa_eval/build_dataset.py +677 -0
  130. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-06_api_contract_drift.json +22 -0
  131. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-07_api_contract_drift.json +22 -0
  132. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-08_api_contract_drift.json +22 -0
  133. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-09_api_contract_drift.json +22 -0
  134. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-10_api_contract_drift.json +22 -0
  135. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-21_fake_pass_tautology.json +21 -0
  136. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-22_fake_pass_tautology.json +21 -0
  137. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-23_fake_pass_tautology.json +21 -0
  138. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-24_fake_pass_tautology.json +21 -0
  139. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-25_fake_pass_tautology.json +21 -0
  140. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-01_locator_drift.json +23 -0
  141. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-02_locator_drift.json +23 -0
  142. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-03_locator_drift.json +23 -0
  143. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-04_locator_drift.json +23 -0
  144. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-05_locator_drift.json +23 -0
  145. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-16_stale_and_mutation.json +22 -0
  146. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-17_stale_and_mutation.json +22 -0
  147. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-18_stale_and_mutation.json +22 -0
  148. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-19_stale_and_mutation.json +22 -0
  149. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-20_stale_and_mutation.json +23 -0
  150. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-11_timing_and_race.json +22 -0
  151. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-12_timing_and_race.json +22 -0
  152. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-13_timing_and_race.json +22 -0
  153. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-14_timing_and_race.json +22 -0
  154. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-15_timing_and_race.json +22 -0
  155. package/benchmarks/qa_eval/eval_runner.py +418 -0
  156. package/benchmarks/qa_eval/reports/AB_METHODOLOGY_REPORT.md +83 -0
  157. package/benchmarks/qa_eval/reports/BENCHMARK_REPORT.md +69 -0
  158. package/benchmarks/qa_eval/reports/eval_results.json +105 -0
  159. package/bin/agent-qa.js +10 -3
  160. package/docs/ARCHITECTURE.md +107 -0
  161. package/docs/CI_CD_INTEGRATION.md +94 -0
  162. package/docs/CLI_REFERENCE.md +157 -0
  163. package/docs/CONTRIBUTING.md +91 -0
  164. package/docs/PLUGIN_DEVELOPMENT_GUIDE.md +126 -0
  165. package/docs/TOKEN_QUOTA_PLAYBOOK.md +41 -0
  166. package/docs/adopted-ecosystem-tools.md +87 -0
  167. package/docs/schemas/synapse.config.schema.json +64 -0
  168. package/examples/cypress-ecommerce-suite/README.md +45 -0
  169. package/examples/cypress-ecommerce-suite/cypress/e2e/checkout.cy.js +17 -0
  170. package/examples/cypress-ecommerce-suite/cypress/pages/BasePage.js +29 -0
  171. package/examples/cypress-ecommerce-suite/cypress/pages/CartPage.js +51 -0
  172. package/examples/cypress-ecommerce-suite/cypress.config.js +13 -0
  173. package/examples/cypress-ecommerce-suite/package.json +13 -0
  174. package/examples/katalon-suite/Keywords/pages/BasePage.groovy +19 -0
  175. package/examples/katalon-suite/Keywords/pages/DashboardPage.groovy +29 -0
  176. package/examples/katalon-suite/Keywords/pages/LoginPage.groovy +45 -0
  177. package/examples/katalon-suite/Profiles/default.glbl +12 -0
  178. package/examples/katalon-suite/README.md +18 -0
  179. package/examples/katalon-suite/Scripts/Auth/TC_LoginSuccess/Script1234567890.groovy +12 -0
  180. package/examples/katalon-suite/Scripts/Dashboard/TC_ViewSummary/Script1234567891.groovy +15 -0
  181. package/examples/katalon-suite/katalon_suite.prj +21 -0
  182. package/examples/playwright-crm-suite/README.md +40 -0
  183. package/examples/playwright-crm-suite/package.json +14 -0
  184. package/examples/playwright-crm-suite/pages/BasePage.ts +37 -0
  185. package/examples/playwright-crm-suite/pages/CustomerPage.ts +57 -0
  186. package/examples/playwright-crm-suite/pages/LoginPage.ts +32 -0
  187. package/examples/playwright-crm-suite/playwright.config.ts +27 -0
  188. package/examples/playwright-crm-suite/tests/auth.spec.ts +22 -0
  189. package/examples/playwright-crm-suite/tests/customers.spec.ts +33 -0
  190. package/examples/plugins/sample-custom-plugin/README.md +14 -0
  191. package/examples/plugins/sample-custom-plugin/plugin.json +16 -0
  192. package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/SKILL.md +29 -0
  193. package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/examples/audit_fixture.json +8 -0
  194. package/examples/plugins/sample-custom-plugin/tools/custom_security_headers.py +125 -0
  195. package/examples/practices/README.md +22 -0
  196. package/examples/practices/requirements/crm/requirements_contracts.md +292 -0
  197. package/examples/practices/requirements/crm/requirements_customers.md +462 -0
  198. package/examples/practices/requirements/crm/requirements_login.md +202 -0
  199. package/examples/practices/requirements/crm/requirements_projects.md +396 -0
  200. package/examples/practices/requirements/crm/requirements_tasks.md +343 -0
  201. package/examples/practices/requirements/ecommerce/requirements_category_brand.txt +402 -0
  202. package/examples/practices/requirements/jira/KAN-5/KAN-1/2026-04-03_04-28-27.png +0 -0
  203. package/examples/practices/requirements/jira/KAN-5/KAN-1/KAN-1_requirement.md +52 -0
  204. package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-19.png +0 -0
  205. package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-57.png +0 -0
  206. package/examples/practices/requirements/jira/KAN-5/KAN-4/KAN-4_requirement.md +119 -0
  207. package/examples/practices/requirements/jira/KAN-5/KAN-5_overview.md +9 -0
  208. package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-08.png +0 -0
  209. package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-23.png +0 -0
  210. package/examples/practices/requirements/jira/KAN-5/KAN-6/KAN-6_requirement.md +32 -0
  211. package/examples/practices/testcases/api/book_management_api_test_cases.md +144 -0
  212. package/examples/practices/testcases/api/user_management_api_test_cases.md +139 -0
  213. package/examples/practices/testcases/crm/test_cases_crm_login.md +148 -0
  214. package/examples/practices/testcases/crm/test_cases_customers.md +156 -0
  215. package/examples/pytest-api-suite/README.md +45 -0
  216. package/examples/pytest-api-suite/conftest.py +31 -0
  217. package/examples/pytest-api-suite/pages/user_api_client.py +36 -0
  218. package/examples/pytest-api-suite/requirements.txt +2 -0
  219. package/examples/pytest-api-suite/tests/test_user_api.py +44 -0
  220. package/examples/selenium-suite/README.md +18 -0
  221. package/examples/selenium-suite/pages/base_page.py +27 -0
  222. package/examples/selenium-suite/pages/login_page.py +29 -0
  223. package/examples/selenium-suite/pages/order_page.py +25 -0
  224. package/examples/selenium-suite/pytest.ini +6 -0
  225. package/examples/selenium-suite/requirements.txt +2 -0
  226. package/examples/selenium-suite/tests/test_login.py +10 -0
  227. package/examples/selenium-suite/tests/test_order.py +10 -0
  228. package/package.json +22 -7
  229. package/scripts/generate_skill_examples.py +244 -0
  230. package/scripts/install.ps1 +112 -0
  231. package/scripts/install_global_plugin.ps1 +94 -0
  232. package/scripts/install_global_plugin.sh +49 -0
  233. package/scripts/lint_skills.ps1 +57 -0
  234. package/scripts/package_dist.py +323 -0
  235. package/scripts/setup.sh +59 -0
  236. package/scripts/update_hub.ps1 +19 -0
  237. package/scripts/update_hub.sh +15 -0
  238. package/skills_manifest.json +209 -6
  239. package/synapse.config.json +30 -0
  240. package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +7 -7
  241. package/templates/PROJECT_STATE_TEMPLATE.md +1 -1
  242. package/templates/ai_bridges/CLAUDE.md +33 -16
  243. package/templates/ai_bridges/copilot-instructions.md +14 -21
  244. package/templates/ai_bridges/cursor_synapse_qa.mdc +17 -20
  245. package/templates/ai_bridges/windsurfrules +21 -21
  246. package/templates/ci/github-actions-synapse.yml +71 -4
  247. package/templates/welcome.html.tmpl +1674 -0
  248. package/tools/.infer_baseline.json +1102 -0
  249. package/tools/TOOLS_RUNBOOK.md +92 -130
  250. package/tools/__init__.py +26 -0
  251. package/tools/agent_canary.py +501 -501
  252. package/tools/analyze_project.py +31 -17
  253. package/tools/api_fuzzer.py +278 -6
  254. package/tools/author_integrity.py +6 -6
  255. package/tools/auto_heal.py +1 -1
  256. package/tools/browser_helpers.js +105 -7
  257. package/tools/bug_reporter.py +31 -1
  258. package/tools/bump_version.py +23 -3
  259. package/tools/cache_resolver.py +248 -14
  260. package/tools/check_env.py +55 -14
  261. package/tools/check_version_sync.py +153 -0
  262. package/tools/ci_healing_hook.py +1 -1
  263. package/tools/cli.py +263 -13
  264. package/tools/count_tokens.py +1257 -0
  265. package/tools/dashboard_generator.py +2638 -0
  266. package/tools/db_sandbox.py +198 -20
  267. package/tools/e2e_flow_prober.ps1 +12 -64
  268. package/tools/e2e_flow_prober.py +99 -0
  269. package/tools/e2e_flow_prober.sh +4 -0
  270. package/tools/flaky_detector.py +4 -3
  271. package/tools/generate_allure_report.ps1 +12 -29
  272. package/tools/generate_allure_report.py +77 -0
  273. package/tools/generate_allure_report.sh +4 -0
  274. package/tools/generate_jmx_plan.py +257 -58
  275. package/tools/generate_test_reports.ps1 +12 -134
  276. package/tools/generate_test_reports.py +133 -0
  277. package/tools/generate_test_reports.sh +4 -0
  278. package/tools/gherkin_suite.py +758 -0
  279. package/tools/git_pre_commit_guard.py +12 -6
  280. package/tools/goldfish_review.py +366 -0
  281. package/tools/heal_pr_automator.py +1 -1
  282. package/tools/heuristic_locator_matcher.py +170 -21
  283. package/tools/infer_linter.py +612 -70
  284. package/tools/lint_ai_docs.py +64 -0
  285. package/tools/matrix_sharder.py +1 -1
  286. package/tools/mcp_excel_server.ps1 +12 -250
  287. package/tools/mcp_excel_server.py +249 -0
  288. package/tools/mcp_excel_server.sh +4 -0
  289. package/tools/mcp_server.py +368 -144
  290. package/tools/md_to_xlsx.py +307 -0
  291. package/tools/micro_mutator.py +300 -69
  292. package/tools/omni_transpiler.py +2 -2
  293. package/tools/output_formatter.py +128 -0
  294. package/tools/pinpoint_failure.py +88 -88
  295. package/tools/project_state.py +2 -2
  296. package/tools/repo_map.py +1 -1
  297. package/tools/safety_firewall.py +196 -45
  298. package/tools/setup_project.py +294 -30
  299. package/tools/spec_drift_sentinel.py +439 -0
  300. package/tools/sync_agent_rules.py +248 -0
  301. package/tools/telemetry_correlator.py +45 -0
  302. package/tools/test_impact.py +51 -12
  303. package/tools/tms_sync_bridge.py +21 -5
  304. package/tools/universal_ir.py +3 -0
  305. package/tools/update_sentinel.py +87 -15
  306. package/tools/verify_all.ps1 +13 -0
  307. package/tools/verify_all.py +463 -79
  308. package/tools/visual_diff_canvas.py +1 -0
  309. package/tools/visual_som_helper.py +1 -1
  310. package/tools/watch_mode.py +305 -0
  311. package/tools/welcome_page.py +291 -0
@@ -0,0 +1,153 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """
4
+ tools/check_version_sync.py — Version Synchronization Sentinel for Synapse Hub
5
+
6
+ Verifies that the release version is strictly consistent across all manifest,
7
+ package, protocol, and CLI definitions in the repository:
8
+ 1. package.json (NPM manifest)
9
+ 2. pyproject.toml (PEP 621 Python package metadata)
10
+ 3. plugin.json (Antigravity plugin manifest)
11
+ 4. skills_manifest.json (Skill Catalog index)
12
+ 5. synapse.config.json (Hub runtime configuration)
13
+ 6. tools/mcp_server.py (MCP server protocol version)
14
+ 7. tools/cli.py (Agent-QA CLI hub version)
15
+ 8. tools/__init__.py (Python package version)
16
+
17
+ Usage:
18
+ python3 tools/check_version_sync.py
19
+ python3 tools/check_version_sync.py --expected-version 2.3.0
20
+ """
21
+
22
+ import os
23
+ import sys
24
+ import re
25
+ import json
26
+ import argparse
27
+ from typing import Dict, Optional, Tuple
28
+
29
+ REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
30
+
31
+
32
+ def extract_versions(repo_root: str) -> Dict[str, str]:
33
+ """Extracts declared versions across all source and manifest targets."""
34
+ versions: Dict[str, str] = {}
35
+
36
+ # 1. package.json
37
+ pkg_path = os.path.join(repo_root, "package.json")
38
+ if os.path.exists(pkg_path):
39
+ with open(pkg_path, "r", encoding="utf-8") as f:
40
+ versions["package.json"] = json.load(f).get("version", "")
41
+
42
+ # 2. pyproject.toml
43
+ pyproject_path = os.path.join(repo_root, "pyproject.toml")
44
+ if os.path.exists(pyproject_path):
45
+ with open(pyproject_path, "r", encoding="utf-8") as f:
46
+ content = f.read()
47
+ m = re.search(r'(?m)^version\s*=\s*["\']([^"\']+)["\']', content)
48
+ if m:
49
+ versions["pyproject.toml"] = m.group(1)
50
+
51
+ # 3. plugin.json
52
+ plugin_path = os.path.join(repo_root, "plugin.json")
53
+ if os.path.exists(plugin_path):
54
+ with open(plugin_path, "r", encoding="utf-8") as f:
55
+ versions["plugin.json"] = json.load(f).get("version", "")
56
+
57
+ # 4. skills_manifest.json
58
+ manifest_path = os.path.join(repo_root, "skills_manifest.json")
59
+ if os.path.exists(manifest_path):
60
+ with open(manifest_path, "r", encoding="utf-8") as f:
61
+ versions["skills_manifest.json"] = json.load(f).get("version", "")
62
+
63
+ # 5. synapse.config.json
64
+ config_path = os.path.join(repo_root, "synapse.config.json")
65
+ if os.path.exists(config_path):
66
+ with open(config_path, "r", encoding="utf-8") as f:
67
+ versions["synapse.config.json"] = json.load(f).get("version", "")
68
+
69
+ # 6. tools/mcp_server.py
70
+ mcp_path = os.path.join(repo_root, "tools", "mcp_server.py")
71
+ if os.path.exists(mcp_path):
72
+ with open(mcp_path, "r", encoding="utf-8") as f:
73
+ content = f.read()
74
+ m = re.search(r'SERVER_VERSION\s*=\s*["\']([^"\']+)["\']', content)
75
+ if m:
76
+ versions["tools/mcp_server.py"] = m.group(1)
77
+
78
+ # 7. tools/cli.py
79
+ cli_path = os.path.join(repo_root, "tools", "cli.py")
80
+ if os.path.exists(cli_path):
81
+ with open(cli_path, "r", encoding="utf-8") as f:
82
+ content = f.read()
83
+ m = re.search(r'version\s*=\s*["\']([^"\']+)["\']', content)
84
+ if m:
85
+ versions["tools/cli.py"] = m.group(1)
86
+
87
+ # 8. tools/__init__.py
88
+ init_path = os.path.join(repo_root, "tools", "__init__.py")
89
+ if os.path.exists(init_path):
90
+ with open(init_path, "r", encoding="utf-8") as f:
91
+ content = f.read()
92
+ m = re.search(r'__version__\s*=\s*["\']([^"\']+)["\']', content)
93
+ if m:
94
+ versions["tools/__init__.py"] = m.group(1)
95
+
96
+ return versions
97
+
98
+
99
+ def check_sync(repo_root: str, expected_version: Optional[str] = None) -> Tuple[bool, Dict[str, str], str]:
100
+ """
101
+ Checks if all version definitions match.
102
+ Returns (is_synced, versions_dict, canonical_version_or_error_msg).
103
+ """
104
+ versions = extract_versions(repo_root)
105
+ if not versions:
106
+ return False, {}, "No version files found in repository."
107
+
108
+ target_ver = expected_version or versions.get("package.json")
109
+ if not target_ver:
110
+ target_ver = next(iter(versions.values()))
111
+
112
+ mismatches = {path: ver for path, ver in versions.items() if ver != target_ver}
113
+ if mismatches:
114
+ return False, versions, target_ver
115
+ return True, versions, target_ver
116
+
117
+
118
+ def main() -> int:
119
+ parser = argparse.ArgumentParser(description="Verify universal version sync across Synapse Hub files")
120
+ parser.add_argument("--expected-version", "-e", help="Expected version string (e.g. from git tag)", default=None)
121
+ parser.add_argument("--repo-root", default=REPO_ROOT, help="Root directory of the repository")
122
+ args = parser.parse_args()
123
+
124
+ expected = args.expected_version
125
+ if expected and expected.startswith("v"):
126
+ expected = expected[1:]
127
+
128
+ is_synced, versions, canonical = check_sync(args.repo_root, expected)
129
+
130
+ print("======================================================================")
131
+ print(" SYNAPSE HUB - UNIVERSAL VERSION SYNCHRONIZATION AUDIT ")
132
+ print("======================================================================")
133
+ print(f"Target Version: v{canonical}")
134
+ print("----------------------------------------------------------------------")
135
+
136
+ all_matched = True
137
+ for file_path, ver in sorted(versions.items()):
138
+ status = "[MATCH]" if ver == canonical else "[MISMATCH]"
139
+ if ver != canonical:
140
+ all_matched = False
141
+ print(f" {status:<11} {file_path:<26} -> {ver}")
142
+
143
+ print("======================================================================")
144
+ if is_synced and all_matched:
145
+ print(f"[PASS] 100% Version synchronization verified across all {len(versions)} targets.")
146
+ return 0
147
+ else:
148
+ print(f"[FAIL] Version mismatch detected! All components must match v{canonical}.")
149
+ return 1
150
+
151
+
152
+ if __name__ == "__main__":
153
+ sys.exit(main())
@@ -54,7 +54,7 @@ The Self-Healing Engine successfully located the replacement element:
54
54
  ### ✅ Verification Status
55
55
  - [x] In-place AST replacement verified
56
56
  - [x] Syntax checked across target framework
57
- - [x] DoD 8 Quality Gates checked
57
+ - [x] DoD 9 Quality Gates checked
58
58
 
59
59
  ### 🚀 QA Action Required
60
60
  Review the diff above and **Merge PR** to lock the healed locator into main branch.
package/tools/cli.py CHANGED
@@ -12,6 +12,7 @@ Dispatches commands to underlying specialized tools in tools/.
12
12
 
13
13
  import os
14
14
  import sys
15
+ import json
15
16
  import argparse
16
17
 
17
18
  # Enforce UTF-8 stdout encoding for Windows console compatibility
@@ -29,23 +30,23 @@ sys.path.insert(0, SCRIPT_DIR)
29
30
 
30
31
  def cmd_version(args):
31
32
  manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
32
- version = "2.2.4"
33
+ version = "2.4.0"
33
34
  if os.path.exists(manifest_path):
34
35
  try:
35
36
  import json
36
37
  with open(manifest_path, "r", encoding="utf-8") as f:
37
38
  data = json.load(f)
38
39
  version = data.get("version", version)
39
- except Exception:
40
+ except (OSError, json.JSONDecodeError):
40
41
  pass
41
42
  print(f"Agent-QA Hub CLI v{version}")
42
- manifest_skills = 28
43
+ manifest_skills = 38
43
44
  if os.path.exists(manifest_path):
44
45
  try:
45
46
  import json
46
47
  with open(manifest_path, "r", encoding="utf-8") as f:
47
- manifest_skills = json.load(f).get("totalSkills", 28)
48
- except Exception:
48
+ manifest_skills = json.load(f).get("totalSkills", 37)
49
+ except (OSError, json.JSONDecodeError):
49
50
  pass
50
51
  print(f"Catalog: {manifest_skills} Standardized Skills | 6 Subagent Swarm Profiles")
51
52
  print("Created by: Thế Vị (@TeeVee998) <https://github.com/TeeVee998/Synapse-Hub>")
@@ -112,7 +113,7 @@ def cmd_clean(args):
112
113
  try:
113
114
  os.remove(os.path.join(root, f))
114
115
  removed_count += 1
115
- except Exception:
116
+ except OSError:
116
117
  pass
117
118
  print(f"✅ Cleanup finished: {removed_count} build artifacts and caches removed.")
118
119
 
@@ -141,6 +142,19 @@ def cmd_setup(args):
141
142
  sys.exit(setup_main())
142
143
 
143
144
 
145
+ def cmd_doctor(args):
146
+ from check_env import main as check_env_main
147
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
148
+ sys.exit(check_env_main())
149
+
150
+
151
+ def cmd_uninstall(args):
152
+ from setup_project import uninstall_setup, resolve_target_repo
153
+ target = getattr(args, "target", None)
154
+ target_repo = resolve_target_repo(cli_target=target)
155
+ sys.exit(uninstall_setup(target_repo))
156
+
157
+
144
158
  def cmd_auto_heal(args):
145
159
  from auto_heal import main as auto_heal_main
146
160
  sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
@@ -233,6 +247,18 @@ def cmd_visual_mask(args):
233
247
  sys.exit(mask_main())
234
248
 
235
249
 
250
+ def cmd_review_spec(args):
251
+ from goldfish_review import main as review_main
252
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
253
+ sys.exit(review_main())
254
+
255
+
256
+ def cmd_drift_check(args):
257
+ from spec_drift_sentinel import main as drift_main
258
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
259
+ sys.exit(drift_main())
260
+
261
+
236
262
  def cmd_ci_hook(args):
237
263
  from ci_healing_hook import main as hook_main
238
264
  sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
@@ -259,8 +285,8 @@ def cmd_migrate(args):
259
285
  try:
260
286
  transpile_file(file_path, target, output_dir=dest, hermetic=True)
261
287
  migrated_count += 1
262
- except Exception:
263
- pass
288
+ except (OSError, ValueError, SyntaxError) as e:
289
+ print(f" ⚠️ Skipping {f}: {e}")
264
290
  print(f"✅ [MIGRATION COMPLETE] {migrated_count} test files converted to {target} in '{dest}'.")
265
291
  else:
266
292
  transpile_file(src, target, output_dir=dest, hermetic=True)
@@ -285,6 +311,12 @@ def cmd_som(args):
285
311
  sys.exit(som_main())
286
312
 
287
313
 
314
+ def cmd_gherkin(args):
315
+ from gherkin_suite import main as gherkin_main
316
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
317
+ sys.exit(gherkin_main())
318
+
319
+
288
320
  def cmd_export_postman(args):
289
321
  from export_postman_collection import main as postman_main
290
322
  sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
@@ -309,6 +341,12 @@ def cmd_analyze_jtl(args):
309
341
  sys.exit(jtl_main())
310
342
 
311
343
 
344
+ def cmd_export_excel(args):
345
+ from md_to_xlsx import main as excel_main
346
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
347
+ sys.exit(excel_main())
348
+
349
+
312
350
  def cmd_correlate_telemetry(args):
313
351
  from telemetry_correlator import main as telem_main
314
352
  sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
@@ -336,17 +374,107 @@ def cmd_update(args):
336
374
  update_sentinel.perform_update()
337
375
 
338
376
 
377
+ def cmd_tokens(args):
378
+ import count_tokens
379
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
380
+ count_tokens.main()
381
+
382
+
383
+ def cmd_dashboard(args):
384
+ import dashboard_generator
385
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
386
+ dashboard_generator.main()
387
+
388
+
389
+ def cmd_watch(args):
390
+ import watch_mode
391
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
392
+ watch_mode.main()
393
+
394
+
395
+ def cmd_welcome(args):
396
+ import welcome_page
397
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
398
+ welcome_page.main()
399
+
400
+
401
+ def cmd_wcag_audit(args):
402
+ from wcag_audit import main as wcag_main
403
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
404
+ sys.exit(wcag_main())
405
+
406
+
407
+ def cmd_lookup_tc(args):
408
+ from lookup_tc import main as tc_main
409
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
410
+ sys.exit(tc_main())
411
+
412
+
413
+ def cmd_lookup_xpath(args):
414
+ from lookup_xpath import main as xpath_main
415
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
416
+ sys.exit(xpath_main())
417
+
418
+
419
+ def cmd_trace_data_flow(args):
420
+ from trace_data_flow import main as tdf_main
421
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
422
+ sys.exit(tdf_main())
423
+
424
+
425
+ def cmd_generate_tc(args):
426
+ from generate_tc_from_story import main as gen_tc_main
427
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
428
+ sys.exit(gen_tc_main())
429
+
430
+
431
+ def cmd_pinpoint_failure(args):
432
+ from pinpoint_failure import main as pp_main
433
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
434
+ sys.exit(pp_main())
435
+
436
+
437
+ def cmd_sync_rules(args):
438
+ from sync_agent_rules import main as sync_rules_main
439
+ sys.argv = [sys.argv[0]] + (sys.argv[2:] if len(sys.argv) > 2 else [])
440
+ sys.exit(sync_rules_main())
441
+
442
+
443
+ def _hub_version():
444
+ manifest_path = os.path.join(REPO_ROOT, "skills_manifest.json")
445
+ version = "2.4.0"
446
+ if os.path.exists(manifest_path):
447
+ try:
448
+ import json
449
+ with open(manifest_path, "r", encoding="utf-8") as f:
450
+ version = json.load(f).get("version", version)
451
+ except (OSError, json.JSONDecodeError):
452
+ pass
453
+ return version
454
+
455
+
339
456
  def main():
340
457
  parser = argparse.ArgumentParser(
341
458
  prog="agent-qa",
342
459
  description="Enterprise AI Agent Quality Engineering & Test Automation Hub CLI"
343
460
  )
461
+ parser.add_argument(
462
+ "--version",
463
+ action="version",
464
+ version=f"Agent-QA Hub CLI v{_hub_version()}"
465
+ )
344
466
  parser.add_argument(
345
467
  "--offline", "--offline-deterministic",
346
468
  action="store_true",
347
469
  dest="offline",
348
470
  help="Force 100%% offline air-gapped deterministic mode (zero external network / LLM API calls)"
349
471
  )
472
+ parser.add_argument(
473
+ "-q", "--quiet",
474
+ action="store_true",
475
+ dest="quiet",
476
+ help="Suppress informational banners and output only critical verdicts"
477
+ )
350
478
  subparsers = parser.add_subparsers(dest="subcommand", help="Available subcommands")
351
479
 
352
480
  # version
@@ -357,6 +485,18 @@ def main():
357
485
  p_setup = subparsers.add_parser("setup", help="Autonomous 1-click bootstrap of target project (AI guide, Git hook, AST map)")
358
486
  p_setup.set_defaults(func=cmd_setup)
359
487
 
488
+ # doctor
489
+ p_doctor = subparsers.add_parser("doctor", description="Enterprise Environment Diagnostic Tool", help="Run 1-click diagnostic check of system environment, tools, and dependencies")
490
+ p_doctor.add_argument("target", nargs="?", default=None, help="Target repository path to diagnose")
491
+ p_doctor.add_argument("--repo", "--path", dest="repo_path", default=None, help="Target repository path")
492
+ p_doctor.add_argument("--insecure", action="store_true", help="Allow unverified SSL certificates during connectivity checks")
493
+ p_doctor.set_defaults(func=cmd_doctor)
494
+
495
+ # uninstall
496
+ p_uninstall = subparsers.add_parser("uninstall", help="Revert and remove files installed by setup in target project")
497
+ p_uninstall.add_argument("target", nargs="?", default=None, help="Target repository path to revert")
498
+ p_uninstall.set_defaults(func=cmd_uninstall)
499
+
360
500
  # auto-heal
361
501
  p_auto_heal = subparsers.add_parser("auto-heal", help="Autonomous closed-loop test failure diagnosis and healing plan")
362
502
  p_auto_heal.set_defaults(func=cmd_auto_heal)
@@ -366,7 +506,7 @@ def main():
366
506
  p_heal_pr.set_defaults(func=cmd_heal_pr)
367
507
 
368
508
  # mutate
369
- p_mut = subparsers.add_parser("mutate", help="Inject AST micro-mutants to verify test assertion strength")
509
+ p_mut = subparsers.add_parser("mutate", help="Inject syntactic micro-mutants to verify test assertion strength")
370
510
  p_mut.set_defaults(func=cmd_mutate)
371
511
 
372
512
  # shard
@@ -390,7 +530,7 @@ def main():
390
530
  p_analyze.set_defaults(func=cmd_analyze)
391
531
 
392
532
  # verify
393
- p_verify = subparsers.add_parser("verify", help="Execute 7 Quality Gates DoD Verification")
533
+ p_verify = subparsers.add_parser("verify", help="Execute 9 Quality Gates DoD Verification")
394
534
  p_verify.set_defaults(func=cmd_verify)
395
535
 
396
536
  # lint
@@ -409,6 +549,10 @@ def main():
409
549
  p_impact = subparsers.add_parser("impact", help="Analyze code change impact using AST Knowledge Graph")
410
550
  p_impact.set_defaults(func=cmd_impact)
411
551
 
552
+ # gherkin
553
+ p_gherkin = subparsers.add_parser("gherkin", help="Compile Gherkin .feature files into test matrix, Universal IR and coverage-gap report (0-token)")
554
+ p_gherkin.set_defaults(func=cmd_gherkin)
555
+
412
556
  # canary
413
557
  p_canary = subparsers.add_parser("canary", help="Run autonomous canary resilience benchmark")
414
558
  p_canary.set_defaults(func=cmd_canary)
@@ -484,6 +628,13 @@ def main():
484
628
  p_jtl = subparsers.add_parser("analyze-jtl", help="Analyze JMeter .jtl results, evaluate P90/P95/P99 SLA, and enforce CI/CD Quality Gate")
485
629
  p_jtl.set_defaults(func=cmd_analyze_jtl)
486
630
 
631
+ # export-excel
632
+ p_excel = subparsers.add_parser("export-excel", help="Convert Markdown Test Cases into Styled Enterprise Excel (.xlsx)")
633
+ p_excel.add_argument("input", nargs="?", help="Path to input Markdown file (.md)")
634
+ p_excel.add_argument("-o", "--output", help="Path to output Excel file (.xlsx)")
635
+ p_excel.add_argument("--sheet-name", default="Test Cases", help="Worksheet title (default: Test Cases)")
636
+ p_excel.set_defaults(func=cmd_export_excel)
637
+
487
638
  # correlate-telemetry
488
639
  p_telemetry = subparsers.add_parser("correlate-telemetry", help="Correlate Client-Side JMeter latency with Server-Side APM CPU/RAM/DB telemetry")
489
640
  p_telemetry.set_defaults(func=cmd_correlate_telemetry)
@@ -509,6 +660,101 @@ def main():
509
660
  p_author = subparsers.add_parser("verify-author", help="Verify author attribution, provenance, and anti-tamper integrity")
510
661
  p_author.set_defaults(func=cmd_verify_author)
511
662
 
663
+ # tokens (Cross-Platform Token & Cost Auditor)
664
+ p_tokens = subparsers.add_parser("tokens", help="Audit token usage and estimated API cost across Antigravity, Cursor, and Claude Code")
665
+ p_tokens.add_argument("--platform", "-p", choices=["auto", "antigravity", "cursor", "claude", "all"], default="auto", help="AI platform to audit (default: auto)")
666
+ p_tokens.add_argument("--session", type=str, help="Specific session ID or index to audit")
667
+ p_tokens.add_argument("--current", action="store_true", help="Audit current active conversation")
668
+ p_tokens.add_argument("--last", action="store_true", help="Audit previous completed session (default)")
669
+ p_tokens.add_argument("--last-task", action="store_true", help="Audit specifically the last turn of target session")
670
+ p_tokens.add_argument("--turns", action="store_true", help="Show full turn-by-turn breakdown table")
671
+ p_tokens.add_argument("--rolling", "--budget", action="store_true", dest="rolling", help="Show 5-hour and 7-day rolling window quota & remaining tokens")
672
+ p_tokens.add_argument("--savings", action="store_true", help="Show Hub vs. Non-Hub token and cost savings comparison")
673
+ p_tokens.add_argument("--header", action="store_true", help="Print Pre-Flight confirmation block lines")
674
+ p_tokens.add_argument("--list", action="store_true", help="List recent conversations")
675
+ p_tokens.add_argument("--pricing", choices=["gemini-flash", "gemini-pro", "claude-sonnet", "claude-opus", "gpt-4o", "gpt-4o-mini"], default=None, help="Model pricing basis (default: auto-detected)")
676
+ p_tokens.add_argument("--json", action="store_true", help="Output machine-readable JSON format")
677
+ p_tokens.add_argument("--file", type=str, help="Direct path to a transcript.jsonl file")
678
+ p_tokens.set_defaults(func=cmd_tokens)
679
+
680
+ # dashboard (Standalone One-Page HTML Executive Dashboard)
681
+ p_dashboard = subparsers.add_parser("dashboard", help="Generate standalone one-page executive HTML dashboard (zero CDN deps)")
682
+ p_dashboard.add_argument("target", nargs="?", default=None, help="Target repository directory (default: current or Hub)")
683
+ p_dashboard.add_argument("--output", "-o", help="Output HTML file path (default: <target>/reports/PROJECT_DASHBOARD.html)")
684
+ p_dashboard.add_argument("--open", action="store_true", help="Automatically open generated dashboard in default browser")
685
+ p_dashboard.add_argument("--json", action="store_true", help="Print summary JSON to stdout")
686
+ p_dashboard.add_argument("--lang", choices=["vi", "en"], default="vi", help="Default display language (vi: Tiếng Việt, en: English, default: vi)")
687
+ p_dashboard.set_defaults(func=cmd_dashboard)
688
+
689
+ # watch (Real-Time Incremental Watch Mode Sentinel)
690
+ p_watch = subparsers.add_parser("watch", help="Real-Time incremental watch mode & test engineering HUD (< 100ms feedback)")
691
+ p_watch.add_argument("target", nargs="?", default=".", help="Directory to monitor (default: current directory)")
692
+ p_watch.add_argument("--debounce", type=float, default=0.8, help="Debounce interval in seconds (default: 0.8)")
693
+ p_watch.add_argument("--inactivity-timeout", type=float, default=0.0, help="Inactivity timeout in seconds to trigger stuck warning (default: 0 = disabled)")
694
+ p_watch.add_argument("--once", action="store_true", help="Run incremental scan once on all files and exit")
695
+ p_watch.set_defaults(func=cmd_watch)
696
+
697
+ # welcome (Interactive Visual Landing Page)
698
+ p_welcome = subparsers.add_parser("welcome", description="Interactive Visual Landing Page", help="Launch interactive visual landing page introducing Synapse Hub")
699
+ p_welcome.add_argument("target", nargs="?", default=None, help="Target repository directory (default: current directory)")
700
+ p_welcome.add_argument("--output", "-o", default=None, help="Output HTML file path (default: reports/WELCOME.html)")
701
+ p_welcome.add_argument("--lang", choices=["vi", "en"], default="vi", help="Default initial language (default: vi = Vietnamese)")
702
+ p_welcome.add_argument("--no-browser", action="store_true", help="Do not open the browser after generating the page")
703
+ p_welcome.add_argument("--open", action="store_true", help="Explicitly open the browser")
704
+ p_welcome.add_argument("--first-run", action="store_true", help="Only open if running for the first time (e.g. npm install or first pull)")
705
+ p_welcome.set_defaults(func=cmd_welcome)
706
+
707
+ # wcag-audit (WCAG 2.2 Accessibility Sentinel)
708
+ p_wcag = subparsers.add_parser("wcag-audit", help="Audit WCAG 2.2 accessibility conformance and contrast ratios")
709
+ p_wcag.add_argument("target", nargs="?", default=".", help="Target HTML file or directory to audit")
710
+ p_wcag.set_defaults(func=cmd_wcag_audit)
711
+
712
+ # lookup-tc (Deterministic Test Case Identifier Index)
713
+ p_lookup_tc = subparsers.add_parser("lookup-tc", help="Search test cases by ID, tag, priority, or flow")
714
+ p_lookup_tc.add_argument("query", nargs="?", default="", help="Query keyword or TC ID")
715
+ p_lookup_tc.set_defaults(func=cmd_lookup_tc)
716
+
717
+ # lookup-xpath (AOM & DOM Selector Lookup Cache)
718
+ p_lookup_xpath = subparsers.add_parser("lookup-xpath", help="Query cached resilient XPath & AOM locators")
719
+ p_lookup_xpath.add_argument("query", nargs="?", default="", help="Element text, test-id, or locator label")
720
+ p_lookup_xpath.set_defaults(func=cmd_lookup_xpath)
721
+
722
+ # trace-data-flow (Idempotent Data Flow & Taint Analysis)
723
+ p_trace = subparsers.add_parser("trace-data-flow", help="Trace test data lifecycles to detect DB leaks and missing teardowns")
724
+ p_trace.add_argument("target", nargs="?", default=".", help="Target test directory to inspect")
725
+ p_trace.set_defaults(func=cmd_trace_data_flow)
726
+
727
+ # generate-tc (User Story & Acceptance Criteria Compiler)
728
+ p_gen_tc = subparsers.add_parser("generate-tc", help="Compile natural language user stories into Clean POM test cases")
729
+ p_gen_tc.add_argument("story_file", nargs="?", default="", help="Path to markdown/text user story specification")
730
+ p_gen_tc.set_defaults(func=cmd_generate_tc)
731
+
732
+ # pinpoint-failure (Instant JUnit XML Root Cause Autopsy)
733
+ p_pinpoint = subparsers.add_parser("pinpoint-failure", help="Parse JUnit XML and locate exact failing line in 0.1s")
734
+ p_pinpoint.add_argument("report_file", nargs="?", default="", help="Path to JUnit XML test report")
735
+ p_pinpoint.set_defaults(func=cmd_pinpoint_failure)
736
+
737
+ # sync-rules (Single-Source Agent Rules Synchronizer)
738
+ p_sync_rules = subparsers.add_parser("sync-rules", help="Synchronize AGENTS.md single source of truth across all AI IDE bridges")
739
+ p_sync_rules.add_argument("--check", action="store_true", help="Verify all AI bridges are in sync without writing")
740
+ p_sync_rules.set_defaults(func=cmd_sync_rules)
741
+
742
+ # review-spec (Zero-Context Test Spec Auditor - Elephant-Goldfish Model)
743
+ p_review = subparsers.add_parser("review-spec", help="Zero-context stress-test for specifications and user stories (Elephant-Goldfish Model)")
744
+ p_review.add_argument("spec_file", nargs="?", default="", help="Path to specification file (Markdown or Gherkin .feature, use '-' for stdin)")
745
+ p_review.add_argument("--stdin", action="store_true", help="Read specification from standard input (stdin)")
746
+ p_review.add_argument("--json", action="store_true", help="Output machine-readable JSON format")
747
+ p_review.add_argument("--min-score", type=int, default=80, help="Minimum readiness score threshold (default: 80)")
748
+ p_review.set_defaults(func=cmd_review_spec)
749
+
750
+ # drift-check (Spec-to-Code Drift Sentinel)
751
+ p_drift = subparsers.add_parser("drift-check", help="Spec-to-Code Drift Sentinel checking Deficit & Scope Drift")
752
+ p_drift.add_argument("--spec", required=True, help="Path to specification file (Markdown or Gherkin .feature)")
753
+ p_drift.add_argument("--code", required=True, help="Path to test script or directory of test scripts")
754
+ p_drift.add_argument("--markdown", "-m", help="Path to export Markdown drift report (e.g. SPEC_DRIFT_REPORT.md)")
755
+ p_drift.add_argument("--json", action="store_true", help="Output machine-readable JSON format")
756
+ p_drift.set_defaults(func=cmd_drift_check)
757
+
512
758
  args, unknown = parser.parse_known_args()
513
759
  if getattr(args, "offline", False):
514
760
  os.environ["AGENT_QA_OFFLINE"] = "1"
@@ -516,18 +762,22 @@ def main():
516
762
 
517
763
  if not args.subcommand:
518
764
  parser.print_help()
765
+ print("\n💡 Tip: Run 'npx synapse-hub welcome' (or 'npm start') to launch the visual landing page.")
519
766
  sys.exit(0)
520
767
 
521
- # Enforce cryptographic author attribution and anti-tamper provenance
768
+ # Enforce canonical author attribution and anti-tamper provenance
522
769
  from author_integrity import assert_integrity_or_raise
523
770
  assert_integrity_or_raise()
524
771
 
772
+ if getattr(args, "quiet", False):
773
+ os.environ["SYNAPSE_QUIET"] = "1"
774
+
525
775
  # Non-intrusive cached update notification (24h cache)
526
- if args.subcommand not in ("update", "mcp-serve", "version"):
776
+ if args.subcommand not in ("update", "mcp-serve", "version") and not getattr(args, "quiet", False):
527
777
  try:
528
778
  import update_sentinel
529
779
  update_sentinel.check_for_updates(force=False, notify=True)
530
- except Exception:
780
+ except (ImportError, OSError, TimeoutError):
531
781
  pass
532
782
 
533
783
  # Dispatch subcommand