@teevee98/synapse-hub 4.3.1 → 4.4.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 (289) hide show
  1. package/.cursor/rules/agents.mdc +11 -11
  2. package/.cursor/rules/katalon.mdc +11 -0
  3. package/.cursor/rules/perf.mdc +10 -0
  4. package/.cursor/rules/playwright.mdc +10 -0
  5. package/.cursor/rules/pytest.mdc +10 -0
  6. package/.cursor/rules/synapse-qa.mdc +4 -2
  7. package/.cursorrules +3 -10
  8. package/.windsurfrules +3 -10
  9. package/AGENTS.md +4 -3
  10. package/CLAUDE.md +4 -5
  11. package/README.en.md +3 -3
  12. package/README.md +3 -3
  13. package/agentskills.json +15 -15
  14. package/{.agents/agents → ai-agents/personas}/api-engineer.md +9 -1
  15. package/{.agents/agents → ai-agents/personas}/failure-analyst.md +1 -1
  16. package/{.agents/agents → ai-agents/personas}/live-explorer.md +1 -1
  17. package/{.agents/agents → ai-agents/personas}/orchestrator.md +8 -15
  18. package/{.agents/agents → ai-agents/personas}/perf-engineer.md +11 -5
  19. package/{.agents/agents → ai-agents/personas}/pom-crafter.md +3 -9
  20. package/{.agents/agents → ai-agents/personas}/quality-gatekeeper.md +1 -1
  21. package/{.agents/agents → ai-agents/personas}/test-designer.md +2 -1
  22. package/{.agents/agents → ai-agents/personas}/test-runner.md +3 -4
  23. package/{.agents/rules → automation/playwright}/mandatory-playwright-live.md +5 -13
  24. package/{.agents/skills/01-web-automation → automation/playwright}/playwright-webapp-testing/SKILL.md +2 -0
  25. package/{.agents/skills/01-web-automation → automation/shared-utils}/clean-pom-crafter/SKILL.md +14 -3
  26. package/{.agents/skills/01-web-automation → automation/shared-utils}/e2e-testing-patterns/SKILL.md +12 -1
  27. package/{.agents/skills/01-web-automation → automation/shared-utils}/lam-script-generator/SKILL.md +2 -0
  28. package/docs/ARCHITECTURE.en.md +96 -3
  29. package/docs/ARCHITECTURE.md +87 -3
  30. package/docs/TOOL_CATALOG.md +17 -5
  31. package/docs/reports/AUDIT_REPORT.md +1038 -0
  32. package/docs/reports/PROJECT_HEALTH_REPORT.md +49 -0
  33. package/docs/reports/TECHNICAL_DEBT_LEDGER.md +22 -0
  34. package/package.json +8 -1
  35. package/plugin.json +1 -1
  36. package/{.agents/skills/02-test-design → requirement/spec-review}/review-spec/SKILL.md +8 -0
  37. package/scripts/install_global_plugin.ps1 +1 -1
  38. package/scripts/install_global_plugin.sh +1 -1
  39. package/skills_index.json +61 -0
  40. package/skills_manifest.json +88 -62
  41. package/{.agents/skills/08-code-quality → standards/coding-standards}/lean-code-ladder/SKILL.md +8 -1
  42. package/{.agents/skills/08-code-quality → standards/coding-standards}/surgical-coding-principles/SKILL.md +2 -0
  43. package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/mipro-prompt-compiler/SKILL.md +8 -0
  44. package/synapse.config.json +1 -1
  45. package/templates/ai_bridges/CLAUDE.md +4 -5
  46. package/templates/ai_bridges/copilot-instructions.md +1 -0
  47. package/templates/ai_bridges/cursor_synapse_qa.mdc +4 -2
  48. package/templates/ai_bridges/windsurfrules +3 -10
  49. package/templates/test-plan/performance-test-plan-template.md +106 -0
  50. package/{.agents/skills/02-test-design → test-design/manual-rbt}/rbt-manual-testing/SKILL.md +11 -5
  51. package/{.agents/skills/07-data-and-state → test-design/test-data}/file-and-report-validator/SKILL.md +8 -1
  52. package/{.agents/skills/07-data-and-state → test-design/test-data}/synthetic-test-data-generator/SKILL.md +4 -1
  53. package/testing/api-contracts/api_testing_rules.md +74 -0
  54. package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/agentless-qa-repair/SKILL.md +2 -0
  55. package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/failure-autopsy-and-healing/SKILL.md +5 -11
  56. package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/self-healing-locator/SKILL.md +2 -0
  57. package/testing/manual/manual-qa-and-rtm-bridge/SKILL.md +92 -0
  58. package/testing/manual/manual-qa-and-rtm-bridge/examples/sample_bug_and_rtm.json +38 -0
  59. package/{.agents/skills/04-performance-and-load → testing/performance}/backend-load-and-stress-patterns/SKILL.md +5 -2
  60. package/testing/performance/backend-load-and-stress-patterns/references/performance_test_plan_29119.md +106 -0
  61. package/{.agents/rules → testing/performance}/performance_testing_rules.md +27 -3
  62. package/{.agents/skills/04-performance-and-load → testing/performance}/web-vitals-and-performance-profiler/SKILL.md +75 -14
  63. package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/security-dast-sentinel/SKILL.md +13 -2
  64. package/{.agents/rules → testing/security-a11y}/security_testing_rules.md +19 -0
  65. package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/wcag-audit-patterns/SKILL.md +4 -1
  66. package/tools/.infer_baseline.json +44 -3
  67. package/tools/TOOLS_RUNBOOK.md +246 -4
  68. package/tools/TOOL_CATALOG.json +199 -19
  69. package/tools/TOOL_INDEX.json +160 -0
  70. package/tools/__init__.py +1 -1
  71. package/tools/ai_eval_sentinel.py +403 -0
  72. package/tools/assertion_optimizer.py +188 -0
  73. package/tools/asvs_auditor.py +410 -0
  74. package/tools/author_integrity.py +12 -1
  75. package/tools/benchmark_swarm_context.py +1 -1
  76. package/tools/browser_helpers.js +2 -2
  77. package/tools/catalogs/api_contract_testing.json +107 -0
  78. package/tools/catalogs/auxiliary_utilities.json +1536 -0
  79. package/tools/catalogs/benchmarking.json +23 -0
  80. package/tools/catalogs/ci_cd_packaging.json +46 -0
  81. package/tools/catalogs/code_generation_ast.json +70 -0
  82. package/tools/catalogs/failure_autopsy_healing.json +41 -0
  83. package/tools/catalogs/manual_testing_design.json +80 -0
  84. package/tools/catalogs/orchestration.json +25 -0
  85. package/tools/catalogs/performance_testing.json +71 -0
  86. package/tools/catalogs/quality_gates.json +65 -0
  87. package/tools/catalogs/sandboxing_isolation.json +42 -0
  88. package/tools/catalogs/security.json +72 -0
  89. package/tools/catalogs/setup_onboarding.json +26 -0
  90. package/tools/catalogs/testing_utilities.json +111 -0
  91. package/tools/chaos_resilience_probe.py +362 -0
  92. package/tools/check_env.py +16 -3
  93. package/tools/check_version_sync.py +114 -63
  94. package/tools/cldr_l10n_verifier.py +309 -0
  95. package/tools/cli.py +971 -3
  96. package/tools/core/circuit_breaker.py +106 -0
  97. package/tools/core/token_estimator.py +56 -7
  98. package/tools/cvss_calculator.py +412 -0
  99. package/tools/dashboard_generator.py +12 -12
  100. package/tools/etl_data_reconciler.py +460 -0
  101. package/tools/generate_jmx_plan.py +12 -4
  102. package/tools/generate_tool_catalog.py +60 -2
  103. package/tools/jtl_analyzer.py +23 -1
  104. package/tools/mcp_docx_server.py +1 -1
  105. package/tools/mcp_excel_server.py +1 -1
  106. package/tools/mcp_server.py +5 -1
  107. package/tools/mobile_resilience_sentinel.py +273 -0
  108. package/tools/observability_tester.py +235 -0
  109. package/tools/payment_interop_simulator.py +337 -0
  110. package/tools/pre_push_guard.py +306 -0
  111. package/tools/project_state.py +17 -10
  112. package/tools/regulatory_compliance.py +336 -0
  113. package/tools/reversible_sandbox.py +7 -2
  114. package/tools/rules_router.py +6 -4
  115. package/tools/runaway_stopper.py +19 -111
  116. package/tools/setup_project.py +1 -1
  117. package/tools/skill_canonical_digest.py +2 -2
  118. package/tools/skillspector.py +78 -10
  119. package/tools/sync_agent_rules.py +15 -27
  120. package/tools/sync_skills_manifest.py +38 -4
  121. package/tools/tmmi_auditor.py +179 -0
  122. package/tools/ui_server.py +1 -1
  123. package/tools/update_sentinel.py +4 -4
  124. package/tools/validate_host_interop.py +3 -1
  125. package/tools/validate_skills_schema.py +49 -2
  126. package/tools/vpat_exporter.py +428 -0
  127. package/tools/welcome_page.py +4 -4
  128. package/.agents/rules/stack-auto-router.md +0 -30
  129. package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +0 -114
  130. package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +0 -9
  131. package/.agents/skills/09-ci-and-devops/gitlab-ci-templates/SKILL.md +0 -123
  132. package/.agents/skills/09-ci-and-devops/gitlab-ci-templates/examples/sample_gitlab_ci.yml +0 -17
  133. package/.agents/skills/09-ci-and-devops/jenkins-pipeline-templates/SKILL.md +0 -133
  134. package/.agents/skills/09-ci-and-devops/jenkins-pipeline-templates/examples/Jenkinsfile.example +0 -21
  135. package/.cursor/rules/language.mdc +0 -7
  136. package/templates/ci/github-actions-synapse.yml +0 -95
  137. package/templates/ci/gitlab-ci-synapse.yml +0 -16
  138. package/tools/build_consolidated_report.py +0 -1643
  139. package/tools/create_mock_docx.py +0 -107
  140. /package/{.agents → ai-agents/hooks}/hooks.json +0 -0
  141. /package/{.agents → ai-agents}/hooks/session_start.py +0 -0
  142. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/actor-qa-swarm/SKILL.md +0 -0
  143. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/actor-qa-swarm/examples/broker_sharding_sample.json +0 -0
  144. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/agent-orchestration-multi-agent-optimize/SKILL.md +0 -0
  145. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/agent-orchestration-multi-agent-optimize/examples/swarm_workload_config.json +0 -0
  146. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/event-stream-qa-orchestrator/SKILL.md +0 -0
  147. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/event-stream-qa-orchestrator/examples/timeline_sample.jsonl +0 -0
  148. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/persistent-planning-files/SKILL.md +0 -0
  149. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/persistent-planning-files/examples/task_plan_example.md +0 -0
  150. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/qa-memory-os/SKILL.md +0 -0
  151. /package/{.agents/skills/10-agent-orchestration → ai-agents/orchestration}/qa-memory-os/examples/archival_memory_sample.json +0 -0
  152. /package/{.agents → ai-agents}/workflows/graphify.md +0 -0
  153. /package/{.agents → ai-agents}/workflows/test-impact.md +0 -0
  154. /package/{.agents → ai-agents}/workflows/verify.md +0 -0
  155. /package/{.agents/rules → automation/cypress}/cypress_rules.md +0 -0
  156. /package/{.agents/skills/01-web-automation → automation/katalon}/katalon-cli-runner/SKILL.md +0 -0
  157. /package/{.agents/skills/01-web-automation → automation/katalon}/katalon-cli-runner/examples/headless_kre_exec.sh +0 -0
  158. /package/{.agents/skills/01-web-automation → automation/katalon}/katalon-cli-runner/references/groovy-patterns.md +0 -0
  159. /package/{.agents/skills/01-web-automation → automation/katalon}/katalon-cli-runner/references/katalon-api.md +0 -0
  160. /package/{.agents/skills/01-web-automation → automation/katalon}/katalon-cli-runner/references/runner_commands.md +0 -0
  161. /package/{.agents/skills/01-web-automation → automation/mobile}/mobile-appium-som/SKILL.md +0 -0
  162. /package/{.agents/skills/01-web-automation → automation/mobile}/mobile-appium-som/examples/BaseScreen.java +0 -0
  163. /package/{.agents/skills/01-web-automation → automation/mobile}/mobile-appium-som/examples/LoginScreen.java +0 -0
  164. /package/{.agents/skills/01-web-automation → automation/mobile}/mobile-appium-som/examples/TC_MobileLogin.java +0 -0
  165. /package/{.agents/skills/01-web-automation → automation/mobile}/mobile-maestro-detox-patterns/SKILL.md +0 -0
  166. /package/{.agents/skills/01-web-automation → automation/mobile}/mobile-maestro-detox-patterns/examples/sample_flow.yaml +0 -0
  167. /package/{.agents/rules → automation/mobile}/mobile_appium_rules.md +0 -0
  168. /package/{.agents/skills/01-web-automation → automation/playwright}/playwright-live-interaction/SKILL.md +0 -0
  169. /package/{.agents/skills/01-web-automation → automation/playwright}/playwright-live-interaction/examples/live_probe_script.js +0 -0
  170. /package/{.agents/skills/01-web-automation → automation/playwright}/playwright-live-interaction/references/advanced_superpowers.md +0 -0
  171. /package/{.agents/skills/01-web-automation → automation/playwright}/playwright-live-interaction/references/compact_accessibility_snapshots.md +0 -0
  172. /package/{.agents/skills/01-web-automation → automation/playwright}/playwright-live-interaction/references/recipes.md +0 -0
  173. /package/{.agents/skills/01-web-automation → automation/playwright}/playwright-live-interaction/references/swarm_orchestration.md +0 -0
  174. /package/{.agents/skills/01-web-automation → automation/playwright}/playwright-webapp-testing/examples/server_lifecycle_playwright.py +0 -0
  175. /package/{.agents/skills/01-web-automation → automation/shared-utils}/auth-session-and-cookie-manager/SKILL.md +0 -0
  176. /package/{.agents/skills/01-web-automation → automation/shared-utils}/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +0 -0
  177. /package/{.agents/skills/01-web-automation → automation/shared-utils}/auth-session-and-cookie-manager/examples/storage_state_sample.json +0 -0
  178. /package/{.agents/skills/01-web-automation → automation/shared-utils}/bats-testing-patterns/SKILL.md +0 -0
  179. /package/{.agents/skills/01-web-automation → automation/shared-utils}/bats-testing-patterns/examples/cli_runner_test.bats +0 -0
  180. /package/{.agents/skills/01-web-automation → automation/shared-utils}/bats-testing-patterns/resources/implementation-playbook.md +0 -0
  181. /package/{.agents/skills/01-web-automation → automation/shared-utils}/clean-pom-crafter/examples/standard_test_case.groovy +0 -0
  182. /package/{.agents/skills/01-web-automation → automation/shared-utils}/clean-pom-crafter/references/pom_patterns.groovy +0 -0
  183. /package/{.agents/skills/01-web-automation → automation/shared-utils}/e2e-testing-patterns/examples/playwright_sharded_config.ts +0 -0
  184. /package/{.agents/skills/01-web-automation → automation/shared-utils}/e2e-testing-patterns/resources/implementation-playbook.md +0 -0
  185. /package/{.agents/skills/01-web-automation → automation/shared-utils}/lam-script-generator/examples/user_story_sample.md +0 -0
  186. /package/{.agents/skills/03-api-and-contracts → requirement/spec-review}/api-spec-to-e2e-matrix/SKILL.md +0 -0
  187. /package/{.agents/skills/03-api-and-contracts → requirement/spec-review}/api-spec-to-e2e-matrix/examples/sample_openapi.json +0 -0
  188. /package/{.agents/skills/02-test-design → requirement/spec-review}/architecture-decision-records/SKILL.md +0 -0
  189. /package/{.agents/skills/02-test-design → requirement/spec-review}/architecture-decision-records/examples/0001-record-architecture-decisions.md +0 -0
  190. /package/{.agents/skills/02-test-design → requirement/spec-review}/review-spec/examples/pocock_grilling_decision_rubric.md +0 -0
  191. /package/{.agents/skills/02-test-design → requirement/spec-review}/review-spec/examples/sample_spec_review.md +0 -0
  192. /package/{.agents → requirement}/workflows/analyze_requirement_document.md +0 -0
  193. /package/{.agents → requirement}/workflows/generate_requirements_from_website.md +0 -0
  194. /package/{.agents/rules → standards/coding-standards}/author-integrity-guard.md +0 -0
  195. /package/{.agents/skills/08-code-quality → standards/coding-standards}/code-refactoring-refactor-clean/SKILL.md +0 -0
  196. /package/{.agents/skills/08-code-quality → standards/coding-standards}/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +0 -0
  197. /package/{.agents/skills/08-code-quality → standards/coding-standards}/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +0 -0
  198. /package/{.agents/skills/08-code-quality → standards/coding-standards}/code-refactoring-refactor-clean/resources/implementation-playbook.md +0 -0
  199. /package/{.agents/rules → standards/coding-standards}/communication-style.md +0 -0
  200. /package/{.agents/rules → standards/coding-standards}/git-push-protocol.md +0 -0
  201. /package/{.agents/skills/08-code-quality → standards/coding-standards}/graphify-impact-analyzer/SKILL.md +0 -0
  202. /package/{.agents/skills/08-code-quality → standards/coding-standards}/graphify-impact-analyzer/examples/dependency_blast_radius.json +0 -0
  203. /package/{.agents/skills/08-code-quality → standards/coding-standards}/lean-code-ladder/examples/ladder_walkthrough.md +0 -0
  204. /package/{.agents/skills/08-code-quality → standards/coding-standards}/repo-quality-audit/SKILL.md +0 -0
  205. /package/{.agents/skills/08-code-quality → standards/coding-standards}/repo-quality-audit/examples/sample_audit_walkthrough.md +0 -0
  206. /package/{.agents/skills/08-code-quality → standards/coding-standards}/repo-quality-audit/examples/sample_repo_audit.md +0 -0
  207. /package/{.agents/skills/08-code-quality → standards/coding-standards}/senior-code-review/SKILL.md +0 -0
  208. /package/{.agents/skills/08-code-quality → standards/coding-standards}/senior-code-review/examples/sample_review_walkthrough.md +0 -0
  209. /package/{.agents/skills/08-code-quality → standards/coding-standards}/surgical-coding-principles/examples/surgical_vs_scope_creep.md +0 -0
  210. /package/{.agents/skills/08-code-quality → standards/coding-standards}/technical-debt-harvester/SKILL.md +0 -0
  211. /package/{.agents/skills/08-code-quality → standards/coding-standards}/technical-debt-harvester/examples/sample_debt_ledger.md +0 -0
  212. /package/{.agents/skills/08-code-quality → standards/coding-standards}/technical-debt-harvester/examples/sample_ledger_output.md +0 -0
  213. /package/{.agents/rules → standards/context-ai}/context-engineering.md +0 -0
  214. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/meta-prompt-crafter/SKILL.md +0 -0
  215. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/meta-prompt-crafter/examples/qa_prompt_template.md +0 -0
  216. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/mipro-prompt-compiler/examples/compiled_module_sample.json +0 -0
  217. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +0 -0
  218. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/qa-aci-interface/SKILL.md +0 -0
  219. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/qa-aci-interface/examples/surgical_code_window_walkthrough.md +0 -0
  220. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/qa-aci-interface/examples/surgical_edit_sample.json +0 -0
  221. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/token-and-context-optimizer/SKILL.md +0 -0
  222. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/token-and-context-optimizer/examples/distilled_log_sample.txt +0 -0
  223. /package/{.agents/skills/11-ai-and-prompting → standards/context-ai}/token-and-context-optimizer/references/context_engineering_guide.md +0 -0
  224. /package/{.agents/rules → standards/qa-process}/graphify.md +0 -0
  225. /package/{.agents/rules → standards/qa-process}/lessons-learned.md +0 -0
  226. /package/{.agents/rules → standards/qa-process}/skill-precedence.md +0 -0
  227. /package/{.agents/rules → standards/quality-gates}/systematic-debugging.md +0 -0
  228. /package/{.agents/templates → templates/test-report}/completion_report.md +0 -0
  229. /package/{.agents/skills/02-test-design → test-design/bdd-gherkin}/gherkin-to-suite/SKILL.md +0 -0
  230. /package/{.agents/skills/02-test-design → test-design/bdd-gherkin}/gherkin-to-suite/examples/checkout.feature +0 -0
  231. /package/{.agents/skills/02-test-design → test-design/bdd-gherkin}/gherkin-to-suite/examples/suite_report_sample.json +0 -0
  232. /package/{.agents → test-design/bdd-gherkin}/workflows/generate_cross_module_test_plan.md +0 -0
  233. /package/{.agents → test-design/bdd-gherkin}/workflows/generate_testcases_from_requirements.md +0 -0
  234. /package/{.agents/skills/02-test-design → test-design/exploratory}/tot-exploratory-testing/SKILL.md +0 -0
  235. /package/{.agents/skills/02-test-design → test-design/exploratory}/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +0 -0
  236. /package/{.agents/skills/02-test-design → test-design/exploratory}/tot-exploratory-testing/examples/tot_graph_sample.json +0 -0
  237. /package/{.agents/skills/02-test-design → test-design/manual-rbt}/rbt-manual-testing/examples/checkout_rbt_manual_suite.md +0 -0
  238. /package/{.agents/skills/02-test-design → test-design/manual-rbt}/rbt-manual-testing/references/field_validation_checklist.md +0 -0
  239. /package/{.agents → test-design/manual-rbt}/workflows/export_testcases_excel.md +0 -0
  240. /package/{.agents → test-design/manual-rbt}/workflows/generate_manual_testcases_rbt.md +0 -0
  241. /package/{.agents/skills/07-data-and-state → test-design/test-data}/db-state-verifier-and-seeder/SKILL.md +0 -0
  242. /package/{.agents/skills/07-data-and-state → test-design/test-data}/db-state-verifier-and-seeder/examples/db_fixture_seed.json +0 -0
  243. /package/{.agents/skills/07-data-and-state → test-design/test-data}/file-and-report-validator/examples/sample_export_schema.json +0 -0
  244. /package/{.agents/skills/07-data-and-state → test-design/test-data}/synthetic-test-data-generator/examples/idempotent_data_recipe.json +0 -0
  245. /package/{.agents → test-design/test-data}/workflows/generate_combinatorial_test_data.md +0 -0
  246. /package/{.agents/skills/03-api-and-contracts → testing/api-contracts}/api-network-mocking-interception/SKILL.md +0 -0
  247. /package/{.agents/skills/03-api-and-contracts → testing/api-contracts}/api-network-mocking-interception/examples/network_route_stub.json +0 -0
  248. /package/{.agents/skills/03-api-and-contracts → testing/api-contracts}/consumer-driven-contract-testing/SKILL.md +0 -0
  249. /package/{.agents/skills/03-api-and-contracts → testing/api-contracts}/consumer-driven-contract-testing/examples/order_service_pact.json +0 -0
  250. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/agentless-qa-repair/examples/healing_report_sample.json +0 -0
  251. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/agentless-qa-repair/examples/three_phase_repair_workflow.md +0 -0
  252. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/antigravity-test-sentinel/SKILL.md +0 -0
  253. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/antigravity-test-sentinel/examples/dod_gate_policy.json +0 -0
  254. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +0 -0
  255. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +0 -0
  256. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/failure-autopsy-and-healing/examples/sample_junit_failure.xml +0 -0
  257. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/failure-autopsy-and-healing/references/healing_matrix.md +0 -0
  258. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/failure-autopsy-and-healing/references/qa_investigation_protocol.md +0 -0
  259. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/failure-autopsy-and-healing/scripts/triage_failures.sh +0 -0
  260. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/flaky-test-sentinel-and-quarantine/SKILL.md +0 -0
  261. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/flaky-test-sentinel-and-quarantine/examples/quarantine_registry.json +0 -0
  262. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/self-healing-locator/examples/aom_diff_sample.json +0 -0
  263. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/systematic-debugging/SKILL.md +0 -0
  264. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/systematic-debugging/examples/four_phase_case.md +0 -0
  265. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/test-driven-development/SKILL.md +0 -0
  266. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/test-driven-development/examples/red_green_refactor_qa.md +0 -0
  267. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/verification-before-completion/SKILL.md +0 -0
  268. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/verification-before-completion/examples/evidence_log_example.md +0 -0
  269. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/visual-regression-sentinel/SKILL.md +0 -0
  270. /package/{.agents/skills/06-healing-and-resilience → testing/healing-resilience}/visual-regression-sentinel/examples/visual_mask_rules.json +0 -0
  271. /package/{.agents/skills/04-performance-and-load → testing/performance}/backend-load-and-stress-patterns/examples/k6_load_test_sample.js +0 -0
  272. /package/{.agents/skills/04-performance-and-load → testing/performance}/backend-load-and-stress-patterns/references/k6_load_template.js +0 -0
  273. /package/{.agents/skills/04-performance-and-load → testing/performance}/lean-impact-scoreboard/SKILL.md +0 -0
  274. /package/{.agents/skills/04-performance-and-load → testing/performance}/lean-impact-scoreboard/examples/sample_benchmark_gain.md +0 -0
  275. /package/{.agents/skills/04-performance-and-load → testing/performance}/lean-impact-scoreboard/examples/sample_scoreboard.md +0 -0
  276. /package/{.agents/skills/04-performance-and-load → testing/performance}/web-vitals-and-performance-profiler/examples/cwv_budget_policy.json +0 -0
  277. /package/{.agents/skills/04-performance-and-load → testing/performance}/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +0 -0
  278. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/security-dast-sentinel/examples/dast_scan_config.json +0 -0
  279. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/security-dast-sentinel/references/AI-AND-LLM.md +0 -0
  280. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/security-dast-sentinel/references/ATTACK-CLASSES.md +0 -0
  281. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/security-dast-sentinel/references/dast_recipes.ts +0 -0
  282. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/skillspector-security-guard/SKILL.md +0 -0
  283. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/skillspector-security-guard/examples/audit_threat_vectors_report.json +0 -0
  284. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/skillspector-security-guard/examples/safe_mcp_config.json +0 -0
  285. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/wcag-audit-patterns/examples/wcag_compliance_checklist.json +0 -0
  286. /package/{.agents/skills/05-security-and-compliance → testing/security-a11y}/wcag-audit-patterns/resources/implementation-playbook.md +0 -0
  287. /package/{.agents/skills/01-web-automation → tools/benchmarks-tests}/web-agent-gym-benchmarking/SKILL.md +0 -0
  288. /package/{.agents/skills/01-web-automation → tools/benchmarks-tests}/web-agent-gym-benchmarking/examples/benchmark_report_sample.json +0 -0
  289. /package/{.agents/skills/01-web-automation → tools/benchmarks-tests}/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +0 -0
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env python3
2
+ # SPDX-FileCopyrightText: Copyright (c) 2026 Thế Vị (@TeeVee98). All rights reserved.
3
+ # SPDX-License-Identifier: MIT
4
+ # Project: Synapse-Hub (https://github.com/TeeVee98/Synapse-Hub)
5
+
6
+ """
7
+ tools/assertion_optimizer.py — Unified Assertion Optimization & Tuning Suite
8
+ ----------------------------------------------------------------------------
9
+ Unifies and orchestrates the DSPy v2 declarative signatures, MIPROv2 Bayesian
10
+ instruction search, and TextGrad mutation loss feedback into a single CLI tool.
11
+
12
+ Subcommands:
13
+ signatures : Inspect or compile declarative QA DSPy signatures.
14
+ tune : Run MIPROv2 prompt optimization over candidate instructions & demonstrations.
15
+ gradient : Compute textual gradients from surviving micro-mutants to refine assertions.
16
+ eval : Evaluate assertion code against Synapse-Hub 10 Quality Gates DoD metric.
17
+
18
+ 100% UTF-8 No BOM.
19
+ """
20
+
21
+ import os
22
+ import sys
23
+ import json
24
+ import argparse
25
+
26
+ # Enforce UTF-8 stdio
27
+ if hasattr(sys.stdout, "reconfigure"):
28
+ try:
29
+ sys.stdout.reconfigure(encoding="utf-8")
30
+ sys.stderr.reconfigure(encoding="utf-8")
31
+ except Exception:
32
+ pass
33
+
34
+ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
35
+ if SCRIPT_DIR not in sys.path:
36
+ sys.path.insert(0, SCRIPT_DIR)
37
+
38
+ # Safe imports from underlying assertion engines
39
+ try:
40
+ import dspy_qa_signatures
41
+ except ImportError:
42
+ dspy_qa_signatures = None
43
+
44
+ try:
45
+ import mipro_assertion_tuner
46
+ except ImportError:
47
+ mipro_assertion_tuner = None
48
+
49
+ try:
50
+ import textgrad_mutation_optimizer
51
+ except ImportError:
52
+ textgrad_mutation_optimizer = None
53
+
54
+
55
+ def run_signatures_cmd(args: argparse.Namespace) -> int:
56
+ """Handles signatures subcommand."""
57
+ if not dspy_qa_signatures:
58
+ print("Error: dspy_qa_signatures engine not available.", file=sys.stderr)
59
+ return 1
60
+
61
+ print("====================================================================")
62
+ print(" DECLARATIVE QA DSPy SIGNATURES ENGINE")
63
+ print("====================================================================")
64
+ print("Registered Signatures:")
65
+ print(" 1. UserStoryToUniversalIR : Formalizes agile stories into AST IR.")
66
+ print(" 2. UniversalIRToCleanPOM : Transpiles Universal IR into Clean POM Page Classes.")
67
+ print(" 3. RCAFailureDiagnosis : Extracts root cause analysis from test trace.")
68
+ print("====================================================================")
69
+ return 0
70
+
71
+
72
+ def run_tune_cmd(args: argparse.Namespace) -> int:
73
+ """Handles MIPROv2 tuning subcommand."""
74
+ if not mipro_assertion_tuner:
75
+ print("Error: mipro_assertion_tuner engine not available.", file=sys.stderr)
76
+ return 1
77
+
78
+ tuner = mipro_assertion_tuner.MiproAssertionTuner()
79
+ res = tuner.compile_module(signature_name="AssertionGenerator", trials=args.trials)
80
+ if args.json:
81
+ print(json.dumps(res, indent=2, ensure_ascii=False))
82
+ else:
83
+ print("====================================================================")
84
+ print(" MIPROv2 BAYESIAN ASSERTION TUNING RESULTS")
85
+ print("====================================================================")
86
+ print(f"Optimal Score: {res.get('best_score', 0):.2f}%")
87
+ print(f"Instruction : {res.get('best_instruction', '')}")
88
+ print(f"Few-Shot Demos: {len(res.get('best_demonstrations', []))}")
89
+ print("====================================================================")
90
+ return 0
91
+
92
+
93
+ def run_gradient_cmd(args: argparse.Namespace) -> int:
94
+ """Handles TextGrad mutation loss feedback subcommand."""
95
+ if not textgrad_mutation_optimizer:
96
+ print("Error: textgrad_mutation_optimizer engine not available.", file=sys.stderr)
97
+ return 1
98
+
99
+ optimizer = textgrad_mutation_optimizer.TextualGradientOptimizer(
100
+ target_score=args.target_score,
101
+ max_iterations=args.max_iterations,
102
+ )
103
+ initial_code = args.prompt or (
104
+ "import { test, expect } from '@playwright/test';\n"
105
+ "test('demo test', async ({ page }) => {\n"
106
+ " expect(1).toBe(1);\n"
107
+ "});"
108
+ )
109
+ success, optimized_code, history = optimizer.optimize_assertions(initial_code)
110
+ if args.json:
111
+ payload = {
112
+ "success": success,
113
+ "optimized_code": optimized_code,
114
+ "history": history,
115
+ }
116
+ print(json.dumps(payload, indent=2, ensure_ascii=False))
117
+ else:
118
+ print("====================================================================")
119
+ print(" TEXTGRAD MUTATION LOSS OPTIMIZATION RESULTS")
120
+ print("====================================================================")
121
+ print(f"Convergence : {'SUCCESS' if success else 'PARTIAL'}")
122
+ print(f"Iterations : {len(history)}")
123
+ print(f"Optimized Code:\n{optimized_code}")
124
+ print("====================================================================")
125
+ return 0 if success else 1
126
+
127
+
128
+ def run_eval_cmd(args: argparse.Namespace) -> int:
129
+ """Evaluates assertion snippet against QA DoD metric."""
130
+ if not dspy_qa_signatures:
131
+ print("Error: dspy_qa_signatures engine not available.", file=sys.stderr)
132
+ return 1
133
+
134
+ class _MockPred:
135
+ def __init__(self, code: str):
136
+ self.test_script_code = code
137
+ self.page_class_code = "export class Page { async doAction() {} }"
138
+
139
+ code_to_eval = args.code or (
140
+ "import { test, expect } from '@playwright/test';\n"
141
+ "test('demo', async ({ page }) => {\n"
142
+ " expect(true).toBe(true);\n"
143
+ "});"
144
+ )
145
+ score = dspy_qa_signatures.qa_dod_metric(None, _MockPred(code_to_eval))
146
+ print(f"DoD Metric Score: {score:.2f} (Passed: {score >= 0.8})")
147
+ return 0 if score >= 0.8 else 1
148
+
149
+
150
+ def main() -> int:
151
+ parser = argparse.ArgumentParser(
152
+ description="Unified Assertion Optimization & Tuning Suite (DSPy v2, MIPROv2 & TextGrad)"
153
+ )
154
+ subparsers = parser.add_subparsers(dest="subcommand", help="Available subcommands")
155
+
156
+ # Signatures
157
+ sub_sig = subparsers.add_parser("signatures", help="Inspect or compile declarative QA DSPy signatures")
158
+ sub_sig.set_defaults(func=run_signatures_cmd)
159
+
160
+ # Tune
161
+ sub_tune = subparsers.add_parser("tune", help="Run MIPROv2 Bayesian instruction & few-shot search")
162
+ sub_tune.add_argument("--trials", type=int, default=10, help="Number of search trials")
163
+ sub_tune.add_argument("--json", action="store_true", help="Output JSON")
164
+ sub_tune.set_defaults(func=run_tune_cmd)
165
+
166
+ # Gradient
167
+ sub_grad = subparsers.add_parser("gradient", help="Compute textual gradients from surviving mutants")
168
+ sub_grad.add_argument("--prompt", type=str, default="", help="Initial assertion prompt")
169
+ sub_grad.add_argument("--target-score", type=float, default=80.0, help="Target mutation score (default: 80.0)")
170
+ sub_grad.add_argument("--max-iterations", type=int, default=3, help="Max gradient steps")
171
+ sub_grad.add_argument("--json", action="store_true", help="Output JSON")
172
+ sub_grad.set_defaults(func=run_gradient_cmd)
173
+
174
+ # Eval
175
+ sub_eval = subparsers.add_parser("eval", help="Evaluate code snippet against DoD metric")
176
+ sub_eval.add_argument("--code", type=str, default="", help="Code snippet to evaluate")
177
+ sub_eval.set_defaults(func=run_eval_cmd)
178
+
179
+ args = parser.parse_args()
180
+ if not hasattr(args, "func") or not args.subcommand:
181
+ parser.print_help()
182
+ return 0
183
+
184
+ return args.func(args)
185
+
186
+
187
+ if __name__ == "__main__":
188
+ sys.exit(main())
@@ -0,0 +1,410 @@
1
+ #!/usr/bin/env python3
2
+ # SPDX-FileCopyrightText: Copyright (c) 2026 Thế Vị (@TeeVee98). All rights reserved.
3
+ # SPDX-License-Identifier: MIT
4
+ # Project: Synapse-Hub (https://github.com/TeeVee98/Synapse-Hub)
5
+
6
+ """
7
+ tools/asvs_auditor.py — OWASP Application Security Verification Standard (ASVS 4.0.3) Engine
8
+ --------------------------------------------------------------------------------------------
9
+ Implements the OWASP ASVS 4.0.3 verification framework across 14 security chapters
10
+ and 3 verification levels (Level 1: Opportunistic, Level 2: Standard, Level 3: Advanced).
11
+
12
+ Provides:
13
+ 1. Complete ASVS 4.0.3 requirement matrix with CWE cross-references.
14
+ 2. Automated non-destructive probes for Level-1 verifiable web/API controls
15
+ (Security Headers, CORS, Cookies, TLS enforcement, Error disclosures).
16
+ 3. Interactive/Automated compliance checklists and Markdown/JSON reporting.
17
+
18
+ Usage:
19
+ python tools/asvs_auditor.py --probe https://staging.example.com --level 1
20
+ python tools/asvs_auditor.py --probe https://staging.example.com --json report.json
21
+ python tools/asvs_auditor.py --export-checklist asvs_checklist.md --level 2
22
+ """
23
+
24
+ import sys
25
+ import json
26
+ import urllib.request
27
+ import urllib.parse
28
+ import urllib.error
29
+ import ssl
30
+ import argparse
31
+ from typing import Dict, List, Any, Optional
32
+
33
+ # Enforce UTF-8 stdout encoding for Windows console compatibility
34
+ if hasattr(sys.stdout, "reconfigure"):
35
+ try:
36
+ sys.stdout.reconfigure(encoding="utf-8")
37
+ sys.stderr.reconfigure(encoding="utf-8")
38
+ except Exception:
39
+ pass
40
+
41
+
42
+ # ==============================================================================
43
+ # ASVS 4.0.3 CHAPTER DEFINITIONS & CORE MATRIX
44
+ # ==============================================================================
45
+
46
+ ASVS_CHAPTERS = {
47
+ "V1": "Architecture, Design and Threat Modeling",
48
+ "V2": "Authentication",
49
+ "V3": "Session Management",
50
+ "V4": "Access Control",
51
+ "V5": "Malicious Input Handling & Validation",
52
+ "V6": "Cryptography at Rest",
53
+ "V7": "Error Handling and Logging",
54
+ "V8": "Data Protection & Privacy",
55
+ "V9": "Communications & TLS Verification",
56
+ "V10": "Malicious Code & Integrity",
57
+ "V11": "Business Logic",
58
+ "V12": "Files and Resources",
59
+ "V13": "API and Web Service",
60
+ "V14": "Configuration & Security Headers",
61
+ }
62
+
63
+ # Curated high-impact ASVS requirements covering L1, L2, L3
64
+ ASVS_REQUIREMENTS = [
65
+ # V1: Architecture
66
+ {"id": "V1.1.1", "chapter": "V1", "level": 1, "cwe": "CWE-1027", "desc": "Verify that secure development lifecycle is followed and threat modeling was performed.", "automated": False},
67
+ {"id": "V1.4.1", "chapter": "V1", "level": 1, "cwe": "CWE-1188", "desc": "Verify that untrusted data from all boundaries is validated or sanitized.", "automated": False},
68
+
69
+ # V2: Authentication
70
+ {"id": "V2.1.1", "chapter": "V2", "level": 1, "cwe": "CWE-521", "desc": "Verify that user passwords are at least 12 characters in length (or 8 for legacy).", "automated": True},
71
+ {"id": "V2.2.1", "chapter": "V2", "level": 1, "cwe": "CWE-307", "desc": "Verify that anti-automation or rate-limiting is in place against brute-force attacks.", "automated": True},
72
+ {"id": "V2.8.1", "chapter": "V2", "level": 2, "cwe": "CWE-308", "desc": "Verify multi-factor authentication (MFA) is supported for privileged accounts.", "automated": False},
73
+
74
+ # V3: Session Management
75
+ {"id": "V3.4.1", "chapter": "V3", "level": 1, "cwe": "CWE-614", "desc": "Verify cookie-based session tokens possess the 'Secure' attribute.", "automated": True},
76
+ {"id": "V3.4.2", "chapter": "V3", "level": 1, "cwe": "CWE-1004", "desc": "Verify cookie-based session tokens possess the 'HttpOnly' attribute.", "automated": True},
77
+ {"id": "V3.4.3", "chapter": "V3", "level": 1, "cwe": "CWE-1275", "desc": "Verify cookie-based session tokens possess 'SameSite=Lax' or 'SameSite=Strict'.", "automated": True},
78
+ {"id": "V3.2.1", "chapter": "V3", "level": 2, "cwe": "CWE-384", "desc": "Verify session tokens are invalidated and renewed upon user authentication/logout.", "automated": True},
79
+
80
+ # V4: Access Control
81
+ {"id": "V4.1.1", "chapter": "V4", "level": 1, "cwe": "CWE-285", "desc": "Verify that the principle of least privilege exists (users only access their own records).", "automated": True},
82
+ {"id": "V4.1.2", "chapter": "V4", "level": 1, "cwe": "CWE-639", "desc": "Verify protection against Broken Object Level Authorization (BOLA/IDOR).", "automated": True},
83
+ {"id": "V4.2.1", "chapter": "V4", "level": 1, "cwe": "CWE-862", "desc": "Verify that sensitive endpoints strictly enforce role-based access control (RBAC).", "automated": True},
84
+
85
+ # V5: Malicious Input Handling
86
+ {"id": "V5.1.1", "chapter": "V5", "level": 1, "cwe": "CWE-20", "desc": "Verify that all input data is validated against a strict allowlist schema.", "automated": True},
87
+ {"id": "V5.3.1", "chapter": "V5", "level": 1, "cwe": "CWE-89", "desc": "Verify protection against SQL Injection using parameterized queries and ORMs.", "automated": True},
88
+ {"id": "V5.3.3", "chapter": "V5", "level": 1, "cwe": "CWE-79", "desc": "Verify context-aware output encoding to prevent Cross-Site Scripting (XSS).", "automated": True},
89
+
90
+ # V6: Cryptography at Rest
91
+ {"id": "V6.2.1", "chapter": "V6", "level": 2, "cwe": "CWE-311", "desc": "Verify sensitive data at rest (passwords, PII, keys) is strongly encrypted using AES-256 or ChaCha20.", "automated": False},
92
+
93
+ # V7: Error Handling and Logging
94
+ {"id": "V7.1.1", "chapter": "V7", "level": 1, "cwe": "CWE-209", "desc": "Verify that error handling does not disclose internal system details, stacktraces, or database queries.", "automated": True},
95
+ {"id": "V7.1.2", "chapter": "V7", "level": 1, "cwe": "CWE-532", "desc": "Verify that log messages do not record secrets, auth tokens, credit cards, or passwords in plain text.", "automated": True},
96
+
97
+ # V8: Data Protection
98
+ {"id": "V8.3.1", "chapter": "V8", "level": 1, "cwe": "CWE-319", "desc": "Verify that sensitive personal data (PII) is masked or tokenized in test environments and logs.", "automated": True},
99
+
100
+ # V9: Communications
101
+ {"id": "V9.1.1", "chapter": "V9", "level": 1, "cwe": "CWE-319", "desc": "Verify that all network traffic enforces TLS 1.2 or TLS 1.3.", "automated": True},
102
+ {"id": "V9.2.1", "chapter": "V9", "level": 1, "cwe": "CWE-523", "desc": "Verify that HTTP Strict Transport Security (HSTS) header is enabled with max-age >= 15768000.", "automated": True},
103
+
104
+ # V10: Malicious Code
105
+ {"id": "V10.3.1", "chapter": "V10", "level": 1, "cwe": "CWE-1395", "desc": "Verify third-party dependencies are scanned for known CVE vulnerabilities.", "automated": True},
106
+
107
+ # V11: Business Logic
108
+ {"id": "V11.1.1", "chapter": "V11", "level": 1, "cwe": "CWE-840", "desc": "Verify that business logic flows cannot be bypassed or executed out of sequence.", "automated": True},
109
+ {"id": "V11.1.4", "chapter": "V11", "level": 1, "cwe": "CWE-362", "desc": "Verify protection against race conditions and double-submits in financial transactions.", "automated": True},
110
+
111
+ # V12: Files and Resources
112
+ {"id": "V12.1.1", "chapter": "V12", "level": 1, "cwe": "CWE-434", "desc": "Verify that uploaded files are validated for MIME type, extension, and scanned for malware.", "automated": True},
113
+
114
+ # V13: API and Web Service
115
+ {"id": "V13.1.1", "chapter": "V13", "level": 1, "cwe": "CWE-306", "desc": "Verify that all API endpoints enforce authentication and valid access tokens.", "automated": True},
116
+ {"id": "V13.2.1", "chapter": "V13", "level": 1, "cwe": "CWE-1027", "desc": "Verify that API schemas conform to published OpenAPI/Swagger specifications.", "automated": True},
117
+
118
+ # V14: Configuration & Headers
119
+ {"id": "V14.4.1", "chapter": "V14", "level": 1, "cwe": "CWE-1021", "desc": "Verify that 'Content-Security-Policy' header is present and restricts script execution.", "automated": True},
120
+ {"id": "V14.4.2", "chapter": "V14", "level": 1, "cwe": "CWE-1021", "desc": "Verify that 'X-Frame-Options' (or CSP frame-ancestors) is set to DENY or SAMEORIGIN.", "automated": True},
121
+ {"id": "V14.4.3", "chapter": "V14", "level": 1, "cwe": "CWE-16", "desc": "Verify that 'X-Content-Type-Options' is set to 'nosniff'.", "automated": True},
122
+ {"id": "V14.4.4", "chapter": "V14", "level": 1, "cwe": "CWE-116", "desc": "Verify that 'Referrer-Policy' is configured safely (e.g., strict-origin-when-cross-origin).", "automated": True},
123
+ {"id": "V14.5.1", "chapter": "V14", "level": 1, "cwe": "CWE-942", "desc": "Verify CORS policy does not reflect untrusted Origins with Access-Control-Allow-Credentials: true.", "automated": True},
124
+ ]
125
+
126
+
127
+ # ==============================================================================
128
+ # AUTOMATED LEVEL-1 VERIFIER PROBE
129
+ # ==============================================================================
130
+
131
+ class ASVSProbeRunner:
132
+ """Performs passive and safe non-destructive probes against web/API targets."""
133
+
134
+ def __init__(self, target_url: str, timeout: int = 8):
135
+ self.target_url = target_url.strip()
136
+ self.timeout = timeout
137
+ self.headers_observed: Dict[str, str] = {}
138
+ self.cookies_observed: List[str] = []
139
+ self.status_code = 0
140
+ self.is_tls = self.target_url.startswith("https://")
141
+ self.cors_vulnerable = False
142
+ self.verbose_error_detected = False
143
+
144
+ def execute_probe(self) -> Dict[str, Any]:
145
+ """Dispatches inspection request and analyzes response."""
146
+ results = {}
147
+ req = urllib.request.Request(
148
+ self.target_url,
149
+ headers={"User-Agent": "Synapse-Hub-ASVS-Auditor/4.3.1 (OWASP-Verification)"},
150
+ )
151
+ ctx = ssl.create_default_context()
152
+
153
+ try:
154
+ with urllib.request.urlopen(req, timeout=self.timeout, context=ctx) as resp:
155
+ self.status_code = resp.getcode()
156
+ for k, v in resp.headers.items():
157
+ self.headers_observed[k.lower()] = v
158
+ self.cookies_observed = resp.headers.get_all("set-cookie") or []
159
+ body = resp.read(4096).decode("utf-8", errors="ignore")
160
+ if "stacktrace" in body.lower() or "sqlexception" in body.lower():
161
+ self.verbose_error_detected = True
162
+ except urllib.error.HTTPError as e:
163
+ self.status_code = e.code
164
+ for k, v in e.headers.items():
165
+ self.headers_observed[k.lower()] = v
166
+ self.cookies_observed = e.headers.get_all("set-cookie") or []
167
+ except Exception as e:
168
+ results["error"] = f"Failed to connect to target: {e}"
169
+ return results
170
+
171
+ # Test CORS Reflection (safe non-destructive probe)
172
+ try:
173
+ cors_req = urllib.request.Request(
174
+ self.target_url,
175
+ headers={
176
+ "User-Agent": "Synapse-Hub-ASVS-Auditor/4.3.1",
177
+ "Origin": "https://untrusted-attacker-domain.example",
178
+ },
179
+ )
180
+ with urllib.request.urlopen(cors_req, timeout=self.timeout, context=ctx) as c_resp:
181
+ acao = c_resp.headers.get("Access-Control-Allow-Origin", "")
182
+ acac = c_resp.headers.get("Access-Control-Allow-Credentials", "").lower()
183
+ if "untrusted-attacker-domain" in acao and acac == "true":
184
+ self.cors_vulnerable = True
185
+ except Exception:
186
+ pass
187
+
188
+ return self.evaluate_asvs_controls()
189
+
190
+ def evaluate_asvs_controls(self) -> Dict[str, Any]:
191
+ """Evaluates observed probe data against ASVS Level 1 requirements."""
192
+ evaluations = {}
193
+
194
+ # V9.1.1 & V9.2.1: TLS & HSTS
195
+ hsts_header = self.headers_observed.get("strict-transport-security", "")
196
+ hsts_pass = self.is_tls and ("max-age=" in hsts_header)
197
+ evaluations["V9.1.1"] = {"status": "PASS" if self.is_tls else "FAIL", "evidence": f"TLS enabled: {self.is_tls}"}
198
+ evaluations["V9.2.1"] = {
199
+ "status": "PASS" if hsts_pass else "FAIL",
200
+ "evidence": f"Strict-Transport-Security: {hsts_header}" if hsts_header else "Header missing",
201
+ }
202
+
203
+ # V14.4.1: Content-Security-Policy
204
+ csp = self.headers_observed.get("content-security-policy", "")
205
+ evaluations["V14.4.1"] = {
206
+ "status": "PASS" if csp else "FAIL",
207
+ "evidence": f"CSP present (length {len(csp)})" if csp else "Content-Security-Policy header missing",
208
+ }
209
+
210
+ # V14.4.2: X-Frame-Options or CSP frame-ancestors
211
+ xfo = self.headers_observed.get("x-frame-options", "").upper()
212
+ frame_safe = ("DENY" in xfo or "SAMEORIGIN" in xfo) or ("frame-ancestors" in csp)
213
+ evaluations["V14.4.2"] = {
214
+ "status": "PASS" if frame_safe else "FAIL",
215
+ "evidence": f"X-Frame-Options: {xfo}" if xfo else "X-Frame-Options missing",
216
+ }
217
+
218
+ # V14.4.3: X-Content-Type-Options: nosniff
219
+ xcto = self.headers_observed.get("x-content-type-options", "").lower()
220
+ evaluations["V14.4.3"] = {
221
+ "status": "PASS" if "nosniff" in xcto else "FAIL",
222
+ "evidence": f"X-Content-Type-Options: {xcto}" if xcto else "Missing 'nosniff'",
223
+ }
224
+
225
+ # V14.4.4: Referrer-Policy
226
+ ref_pol = self.headers_observed.get("referrer-policy", "")
227
+ evaluations["V14.4.4"] = {
228
+ "status": "PASS" if ref_pol else "FAIL",
229
+ "evidence": f"Referrer-Policy: {ref_pol}" if ref_pol else "Referrer-Policy missing",
230
+ }
231
+
232
+ # V14.5.1: CORS
233
+ evaluations["V14.5.1"] = {
234
+ "status": "FAIL" if self.cors_vulnerable else "PASS",
235
+ "evidence": "Insecure CORS reflection with credentials" if self.cors_vulnerable else "CORS policy safe or restrictive",
236
+ }
237
+
238
+ # V3.4.1 - V3.4.3: Cookies
239
+ if self.cookies_observed:
240
+ sec_cookie = all("secure" in c.lower() for c in self.cookies_observed)
241
+ http_only = all("httponly" in c.lower() for c in self.cookies_observed)
242
+ same_site = all("samesite" in c.lower() for c in self.cookies_observed)
243
+ evaluations["V3.4.1"] = {"status": "PASS" if sec_cookie else "FAIL", "evidence": f"Secure flag on {len(self.cookies_observed)} cookies"}
244
+ evaluations["V3.4.2"] = {"status": "PASS" if http_only else "FAIL", "evidence": f"HttpOnly flag on {len(self.cookies_observed)} cookies"}
245
+ evaluations["V3.4.3"] = {"status": "PASS" if same_site else "FAIL", "evidence": "SameSite attribute present on cookies"}
246
+ else:
247
+ evaluations["V3.4.1"] = {"status": "NOT_APPLICABLE", "evidence": "No Set-Cookie headers in response"}
248
+ evaluations["V3.4.2"] = {"status": "NOT_APPLICABLE", "evidence": "No Set-Cookie headers in response"}
249
+ evaluations["V3.4.3"] = {"status": "NOT_APPLICABLE", "evidence": "No Set-Cookie headers in response"}
250
+
251
+ # V7.1.1: Error & Stacktrace disclosure
252
+ evaluations["V7.1.1"] = {
253
+ "status": "FAIL" if self.verbose_error_detected else "PASS",
254
+ "evidence": "Stacktrace / Exception revealed in body" if self.verbose_error_detected else "Zero system leaks observed in response",
255
+ }
256
+
257
+ return evaluations
258
+
259
+
260
+ # ==============================================================================
261
+ # REPORTING & CHECKLIST GENERATION
262
+ # ==============================================================================
263
+
264
+ def generate_asvs_checklist_markdown(level: int = 1, chapter: Optional[str] = None) -> str:
265
+ """Generates an interactive Markdown audit checklist for ASVS."""
266
+ lines = [
267
+ f"# OWASP ASVS 4.0.3 Verification Checklist (Level {level})",
268
+ "",
269
+ "> Generated by Synapse Hub ASVS Engine (`tools/asvs_auditor.py`).",
270
+ "",
271
+ ]
272
+
273
+ grouped: Dict[str, List[Dict[str, Any]]] = {}
274
+ for req in ASVS_REQUIREMENTS:
275
+ if req["level"] > level:
276
+ continue
277
+ if chapter and req["chapter"] != chapter:
278
+ continue
279
+ c_id = req["chapter"]
280
+ grouped.setdefault(c_id, []).append(req)
281
+
282
+ for c_id, reqs in grouped.items():
283
+ title = ASVS_CHAPTERS.get(c_id, c_id)
284
+ lines.append(f"## Chapter {c_id}: {title}")
285
+ lines.append("")
286
+ lines.append("| Status | ID | Level | CWE | Requirement Description | Verification Method |")
287
+ lines.append("| :---: | :--- | :---: | :--- | :--- | :--- |")
288
+ for r in reqs:
289
+ v_type = "Automated Probe" if r["automated"] else "Manual Review"
290
+ lines.append(f"| [ ] | **{r['id']}** | L{r['level']} | {r['cwe']} | {r['desc']} | {v_type} |")
291
+ lines.append("")
292
+
293
+ return "\n".join(lines)
294
+
295
+
296
+ def run_asvs_audit(target_url: Optional[str], level: int = 1, chapter: Optional[str] = None) -> Dict[str, Any]:
297
+ """Runs ASVS audit combining automated probes and structural requirements."""
298
+ probe_results = {}
299
+ if target_url:
300
+ runner = ASVSProbeRunner(target_url)
301
+ probe_results = runner.execute_probe()
302
+
303
+ report_items = []
304
+ total_applicable = 0
305
+ total_passed = 0
306
+ total_failed = 0
307
+ total_na = 0
308
+ total_manual = 0
309
+
310
+ for req in ASVS_REQUIREMENTS:
311
+ if req["level"] > level:
312
+ continue
313
+ if chapter and req["chapter"] != chapter:
314
+ continue
315
+
316
+ item = dict(req)
317
+ item["chapter_title"] = ASVS_CHAPTERS.get(req["chapter"], req["chapter"])
318
+ r_id = req["id"]
319
+
320
+ if r_id in probe_results:
321
+ probe = probe_results[r_id]
322
+ item["status"] = probe["status"]
323
+ item["evidence"] = probe["evidence"]
324
+ if item["status"] == "PASS":
325
+ total_passed += 1
326
+ elif item["status"] == "FAIL":
327
+ total_failed += 1
328
+ elif item["status"] == "NOT_APPLICABLE":
329
+ total_na += 1
330
+ else:
331
+ item["status"] = "MANUAL_VERIFICATION_REQUIRED"
332
+ item["evidence"] = "Requires architecture review, code audit, or functional test."
333
+ total_manual += 1
334
+
335
+ total_applicable += 1
336
+ report_items.append(item)
337
+
338
+ score_pct = (total_passed / (total_passed + total_failed) * 100) if (total_passed + total_failed) > 0 else 0.0
339
+
340
+ return {
341
+ "asvs_version": "4.0.3",
342
+ "target_url": target_url or "Offline Checklist",
343
+ "level": level,
344
+ "compliance_score_pct": round(score_pct, 1),
345
+ "summary": {
346
+ "total_requirements": total_applicable,
347
+ "passed": total_passed,
348
+ "failed": total_failed,
349
+ "not_applicable": total_na,
350
+ "manual_required": total_manual,
351
+ },
352
+ "requirements": report_items,
353
+ }
354
+
355
+
356
+ def main():
357
+ parser = argparse.ArgumentParser(
358
+ description="Synapse Hub OWASP ASVS 4.0.3 Verification Engine",
359
+ formatter_class=argparse.RawDescriptionHelpFormatter,
360
+ )
361
+ parser.add_argument("--probe", help="Target URL to run automated Level 1 ASVS probes against")
362
+ parser.add_argument("--level", type=int, choices=[1, 2, 3], default=1, help="ASVS Verification Level (1: Opportunistic, 2: Standard, 3: Advanced)")
363
+ parser.add_argument("--chapter", help="Filter by Chapter ID (e.g. V1, V3, V14)")
364
+ parser.add_argument("--export-checklist", help="Export Markdown checklist file (e.g. asvs_checklist.md)")
365
+ parser.add_argument("--json", help="Export structured JSON audit report to specified file")
366
+ parser.add_argument("--gate-score", type=float, help="Quality Gate: Fail with exit code 1 if compliance score < threshold")
367
+
368
+ args = parser.parse_args()
369
+
370
+ if args.export_checklist:
371
+ md = generate_asvs_checklist_markdown(level=args.level, chapter=args.chapter)
372
+ with open(args.export_checklist, "w", encoding="utf-8") as f:
373
+ f.write(md)
374
+ print(f"✅ Exported OWASP ASVS Level {args.level} checklist to {args.export_checklist}")
375
+ return 0
376
+
377
+ report = run_asvs_audit(args.probe, level=args.level, chapter=args.chapter)
378
+
379
+ if args.json:
380
+ with open(args.json, "w", encoding="utf-8") as f:
381
+ json.dump(report, f, indent=2, ensure_ascii=False)
382
+ print(f"✅ ASVS audit report saved to {args.json}")
383
+ else:
384
+ print("=" * 70)
385
+ print(" SYNAPSE HUB — OWASP ASVS 4.0.3 SECURITY AUDIT SCORECARD")
386
+ print("=" * 70)
387
+ print(f" Target URL : {report['target_url']}")
388
+ print(f" Target Level : Level {report['level']} (ASVS 4.0.3)")
389
+ print(f" Total Checks : {report['summary']['total_requirements']}")
390
+ print(f" Passed Checks : \033[92m{report['summary']['passed']}\033[0m")
391
+ print(f" Failed Checks : \033[91m{report['summary']['failed']}\033[0m")
392
+ print(f" Manual Review : \033[93m{report['summary']['manual_required']}\033[0m")
393
+ print(f" Compliance Rate: \033[1m{report['compliance_score_pct']}%\033[0m (Automated probes)")
394
+ print("-" * 70)
395
+
396
+ for r in report["requirements"]:
397
+ if r["status"] in ("PASS", "FAIL"):
398
+ st_color = "\033[92m[PASS]\033[0m" if r["status"] == "PASS" else "\033[91m[FAIL]\033[0m"
399
+ print(f" {st_color} {r['id']:<8} L{r['level']} | {r['desc'][:45]:<45} -> {r['evidence']}")
400
+ print("=" * 70)
401
+
402
+ if args.gate_score and report["compliance_score_pct"] < args.gate_score:
403
+ print(f"🚨 Quality Gate Failed: ASVS score {report['compliance_score_pct']}% < required {args.gate_score}%", file=sys.stderr)
404
+ return 1
405
+
406
+ return 0
407
+
408
+
409
+ if __name__ == "__main__":
410
+ sys.exit(main())
@@ -49,7 +49,18 @@ CANONICAL_AUTHOR_SIGS = {
49
49
  CANONICAL_AUTHOR_SIG = "6c56b5f2c2d6f4e4b82cf4d1fa6ccd4a5e8cf0cb0e15a4a60136965fe8ebb697"
50
50
 
51
51
  SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
52
- DEFAULT_REPO_ROOT = os.path.dirname(SCRIPT_DIR)
52
+
53
+
54
+ def _find_repo_root() -> str:
55
+ curr = SCRIPT_DIR
56
+ while curr and curr != os.path.dirname(curr):
57
+ if os.path.isfile(os.path.join(curr, "LICENSE")) or os.path.isfile(os.path.join(curr, "package.json")):
58
+ return curr
59
+ curr = os.path.dirname(curr)
60
+ return os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR)))
61
+
62
+
63
+ DEFAULT_REPO_ROOT = _find_repo_root()
53
64
 
54
65
 
55
66
  def get_canonical_watermark() -> str:
@@ -511,7 +511,7 @@ def format_markdown_report(bench: Dict[str, Any]) -> str:
511
511
  "",
512
512
  "## Track 2: Empirical Reference Suites Benchmark (Static Workspace Inspection)",
513
513
  "",
514
- "> *Methodology: Dynamically enumerates all 14 rules and 56 skills in repository without static per-skill multiplier assumptions.*",
514
+ "> *Methodology: Dynamically enumerates all 14 rules and 57 skills in repository without static per-skill multiplier assumptions.*",
515
515
  "> *Disclosure: 'Avoided Disk Read (I/O)' measures filesystem file size bytes not read from storage; it is strictly distinguished from context tokens and is not billed token savings.*",
516
516
  "",
517
517
  "| Reference Project | Detected Stack | Confidence | Catalog Summary Saved | Full Hydration Saved | Avoided Disk Read (I/O) |",
@@ -13,7 +13,7 @@
13
13
  (function () {
14
14
  'use strict';
15
15
 
16
- if (window.__qa && window.__qa.__version === '4.3.1') {
16
+ if (window.__qa && window.__qa.__version === '4.4.1') {
17
17
  return window.__qa;
18
18
  }
19
19
 
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  const qa = {
50
- __version: '4.3.1',
50
+ __version: '4.4.1',
51
51
 
52
52
  /**
53
53
  * 1. Smart Action Batching