@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,336 @@
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/regulatory_compliance.py — Enterprise Regulatory & Compliance Audit Sentinel
8
+ -----------------------------------------------------------------------------------
9
+ Implements verification rules for international regulatory and industry standards:
10
+ 1. GDPR / PDPA: Right to be Forgotten (Article 17), Consent Logging (Article 7),
11
+ and Data Portability (Article 20).
12
+ 2. PCI-DSS v4.0: Requirement 3.4 (PAN Masking with Luhn validation), Requirement 3.2
13
+ (Sensitive Authentication Data / CVV exclusion), and Log Sanitization.
14
+ 3. ISO 15489: Electronic Records Management (Retention Policies & Immutable Audit Trails).
15
+
16
+ Usage:
17
+ python tools/regulatory_compliance.py --scan-pci-file logs/access.log
18
+ python tools/regulatory_compliance.py --audit-gdpr-deletion user_export.json
19
+ python tools/regulatory_compliance.py --scan-text "Customer paid with 4111 1111 1111 1111, CVV: 123"
20
+ python tools/regulatory_compliance.py --audit-pci sample_data.json --gate
21
+ """
22
+
23
+ import os
24
+ import sys
25
+ import json
26
+ import re
27
+ import argparse
28
+ from datetime import datetime, timezone
29
+ from typing import Dict, List, Any, Optional
30
+
31
+ # Enforce UTF-8 stdout encoding for Windows console compatibility
32
+ if hasattr(sys.stdout, "reconfigure"):
33
+ try:
34
+ sys.stdout.reconfigure(encoding="utf-8")
35
+ sys.stderr.reconfigure(encoding="utf-8")
36
+ except Exception:
37
+ pass
38
+
39
+
40
+ # ==============================================================================
41
+ # PCI-DSS v4.0 IMPLEMENTATION (LUHN ALGORITHM & PAN MASKING)
42
+ # ==============================================================================
43
+
44
+ CARD_PATTERNS = [
45
+ # Visa: starts with 4, length 13, 16, or 19
46
+ re.compile(r"\b4[0-9]{12}(?:[0-9]{3})?(?:[0-9]{3})?\b"),
47
+ # Mastercard: starts with 51-55 or 2221-2720, length 16
48
+ re.compile(r"\b(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}\b"),
49
+ # American Express: starts with 34 or 37, length 15
50
+ re.compile(r"\b3[47][0-9]{13}\b"),
51
+ # Discover: starts with 6011, 622126-622925, 644-649, 65, length 16
52
+ re.compile(r"\b6(?:011|5[0-9]{2}|4[4-9][0-9]|22(?:12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[01][0-9]|92[0-5]))[0-9]{10,12}\b"),
53
+ ]
54
+
55
+ # Patterns for spaced or dashed card numbers (e.g. 4111-1111-1111-1111 or 4111 1111 1111 1111)
56
+ CARD_SEPARATED_PATTERN = re.compile(r"\b(?:\d{4}[ -]){3}\d{4}\b|\b\d{4}[ -]\d{6}[ -]\d{5}\b")
57
+
58
+ # CVV / CVC sensitive authentication data pattern
59
+ CVV_PATTERN = re.compile(r"\b(?:cvv|cvc|cid|cvv2|cvc2)[\s:=]+([0-9]{3,4})\b", re.IGNORECASE)
60
+
61
+
62
+ def luhn_checksum_valid(card_number_str: str) -> bool:
63
+ """Validates credit card number digits using ISO/IEC 7812 Luhn formula."""
64
+ digits = [int(c) for c in re.sub(r"\D", "", card_number_str)]
65
+ if len(digits) < 13 or len(digits) > 19:
66
+ return False
67
+ checksum = 0
68
+ parity = len(digits) % 2
69
+ for i, digit in enumerate(digits):
70
+ if i % 2 == parity:
71
+ digit *= 2
72
+ if digit > 9:
73
+ digit -= 9
74
+ checksum += digit
75
+ return (checksum % 10) == 0
76
+
77
+
78
+ def mask_pan(pan_str: str) -> str:
79
+ """Masks a card number according to PCI-DSS: First 6 and last 4 digits visible."""
80
+ digits_only = re.sub(r"\D", "", pan_str)
81
+ if len(digits_only) < 13:
82
+ return "****"
83
+ first6 = digits_only[:6]
84
+ last4 = digits_only[-4:]
85
+ masked_middle = "*" * (len(digits_only) - 10)
86
+ return f"{first6}{masked_middle}{last4}"
87
+
88
+
89
+ def scan_text_for_pci_violations(text: str) -> List[Dict[str, Any]]:
90
+ """Scans text for unmasked PANs and forbidden CVV data."""
91
+ violations = []
92
+
93
+ # 1. Check for raw contiguous card numbers
94
+ for pat in CARD_PATTERNS:
95
+ for match in pat.finditer(text):
96
+ candidate = match.group(0)
97
+ if luhn_checksum_valid(candidate):
98
+ violations.append({
99
+ "standard": "PCI-DSS v4.0 Req 3.4",
100
+ "severity": "CRITICAL",
101
+ "type": "UNMASKED_PAN_LEAK",
102
+ "found": candidate,
103
+ "masked_suggestion": mask_pan(candidate),
104
+ "message": "Raw, unmasked Primary Account Number (PAN) detected with valid Luhn checksum.",
105
+ })
106
+
107
+ # 2. Check for separated card numbers (dashes or spaces)
108
+ for match in CARD_SEPARATED_PATTERN.finditer(text):
109
+ candidate = match.group(0)
110
+ digits = re.sub(r"\D", "", candidate)
111
+ if luhn_checksum_valid(digits):
112
+ # Avoid duplicate if already matched by contiguous
113
+ if not any(v.get("found") == candidate or v.get("found") == digits for v in violations):
114
+ violations.append({
115
+ "standard": "PCI-DSS v4.0 Req 3.4",
116
+ "severity": "CRITICAL",
117
+ "type": "UNMASKED_PAN_LEAK",
118
+ "found": candidate,
119
+ "masked_suggestion": mask_pan(digits),
120
+ "message": "Delimited unmasked PAN detected with valid Luhn checksum.",
121
+ })
122
+
123
+ # 3. Check for CVV / Sensitive Authentication Data storage
124
+ for match in CVV_PATTERN.finditer(text):
125
+ violations.append({
126
+ "standard": "PCI-DSS v4.0 Req 3.2",
127
+ "severity": "CRITICAL",
128
+ "type": "SENSITIVE_AUTH_DATA_STORAGE",
129
+ "found": match.group(0),
130
+ "message": "Sensitive Authentication Data (CVV/CVC) detected. Storing CVV post-authorization is strictly prohibited.",
131
+ })
132
+
133
+ return violations
134
+
135
+
136
+ # ==============================================================================
137
+ # GDPR & PDPA COMPLIANCE (RIGHT TO BE FORGOTTEN & CONSENT)
138
+ # ==============================================================================
139
+
140
+ def audit_right_to_be_forgotten(
141
+ target_user_id: str,
142
+ db_tables_snapshot: Dict[str, List[Dict[str, Any]]],
143
+ pii_keywords: List[str] = None,
144
+ ) -> Dict[str, Any]:
145
+ """
146
+ Verifies Article 17 GDPR (Right to Erasure).
147
+ Ensures user records and associated PII are completely purged or anonymized.
148
+ """
149
+ pii_keywords = pii_keywords or ["email", "phone", "full_name", "address", "ssn", "cccd", "ip_address"]
150
+ lingering_records = []
151
+
152
+ for table_name, rows in db_tables_snapshot.items():
153
+ for idx, row in enumerate(rows):
154
+ # Check direct user_id match
155
+ is_matched_user = False
156
+ for col_val in row.values():
157
+ if str(col_val).strip() == str(target_user_id).strip():
158
+ is_matched_user = True
159
+ break
160
+
161
+ if is_matched_user:
162
+ # Check if fields still contain non-empty PII
163
+ for k, v in row.items():
164
+ k_lower = k.lower()
165
+ if any(kw in k_lower for kw in pii_keywords) and v:
166
+ lingering_records.append({
167
+ "table": table_name,
168
+ "row_index": idx,
169
+ "field": k,
170
+ "residual_value": str(v),
171
+ "issue": "PII field retained after account erasure request.",
172
+ })
173
+
174
+ compliant = len(lingering_records) == 0
175
+ return {
176
+ "standard": "GDPR Article 17 / PDPA",
177
+ "user_id": target_user_id,
178
+ "is_compliant": compliant,
179
+ "lingering_pii_count": len(lingering_records),
180
+ "violations": lingering_records,
181
+ }
182
+
183
+
184
+ def verify_consent_audit_log(consent_record: Dict[str, Any]) -> Dict[str, Any]:
185
+ """
186
+ Verifies Article 7 GDPR (Conditions for Consent).
187
+ Requires explicit opt-in, timestamp, purpose specification, and IP masking.
188
+ """
189
+ missing_fields = []
190
+ required_keys = ["user_id", "timestamp", "consent_version", "purposes", "opt_in_state"]
191
+ for r in required_keys:
192
+ if r not in consent_record:
193
+ missing_fields.append(r)
194
+
195
+ is_opt_in = consent_record.get("opt_in_state") is True
196
+ ip_raw = str(consent_record.get("ip_address", ""))
197
+ ip_masked = bool(re.search(r"(\.0$|\.xxx$|::ffff:0$|\*\*\*)", ip_raw)) if ip_raw else True
198
+
199
+ compliant = (len(missing_fields) == 0) and is_opt_in and ip_masked
200
+
201
+ return {
202
+ "standard": "GDPR Article 7",
203
+ "is_compliant": compliant,
204
+ "missing_fields": missing_fields,
205
+ "explicit_opt_in": is_opt_in,
206
+ "ip_anonymized": ip_masked,
207
+ }
208
+
209
+
210
+ # ==============================================================================
211
+ # ISO 15489 (ELECTRONIC RECORDS MANAGEMENT)
212
+ # ==============================================================================
213
+
214
+ def verify_record_retention_policy(
215
+ created_at_iso: str,
216
+ retention_period_years: int,
217
+ action_attempted: str,
218
+ action_timestamp_iso: Optional[str] = None,
219
+ ) -> Dict[str, Any]:
220
+ """
221
+ Verifies ISO 15489-1 Section 8 (Retention and Disposition).
222
+ Premature permanent deletion of regulated records is a compliance failure.
223
+ """
224
+ try:
225
+ dt_created = datetime.fromisoformat(created_at_iso.replace("Z", "+00:00"))
226
+ dt_action = (
227
+ datetime.fromisoformat(action_timestamp_iso.replace("Z", "+00:00"))
228
+ if action_timestamp_iso
229
+ else datetime.now(timezone.utc)
230
+ )
231
+ except Exception as e:
232
+ return {"is_compliant": False, "error": f"Invalid ISO date: {e}"}
233
+
234
+ age_days = (dt_action - dt_created).days
235
+ required_days = retention_period_years * 365
236
+
237
+ if action_attempted.upper() in ("PURGE", "DELETE", "DROP", "DESTROY") and age_days < required_days:
238
+ return {
239
+ "standard": "ISO 15489 Section 8",
240
+ "is_compliant": False,
241
+ "action": action_attempted,
242
+ "retention_required_days": required_days,
243
+ "record_age_days": age_days,
244
+ "message": f"Illegal disposition: Record age ({age_days} days) is less than statutory retention period ({required_days} days).",
245
+ }
246
+
247
+ return {
248
+ "standard": "ISO 15489 Section 8",
249
+ "is_compliant": True,
250
+ "action": action_attempted,
251
+ "message": "Action conforms to record retention schedule.",
252
+ }
253
+
254
+
255
+ # ==============================================================================
256
+ # CLI HANDLER & BATCH SCANNER
257
+ # ==============================================================================
258
+
259
+ def main():
260
+ parser = argparse.ArgumentParser(
261
+ description="Synapse Hub Regulatory & Compliance Audit Sentinel (GDPR, PCI-DSS, ISO 15489)",
262
+ formatter_class=argparse.RawDescriptionHelpFormatter,
263
+ )
264
+ parser.add_argument("--scan-text", help="Direct text string to scan for PCI-DSS unmasked PANs/CVV")
265
+ parser.add_argument("--scan-file", help="Path to text or JSON file to scan for compliance violations")
266
+ parser.add_argument("--audit-gdpr", help="Path to JSON file containing user deletion snapshot")
267
+ parser.add_argument("--user-id", default="USER_123", help="Target user ID for GDPR Right to be Forgotten audit")
268
+ parser.add_argument("--json", action="store_true", help="Output results in JSON format")
269
+ parser.add_argument("--gate", action="store_true", help="Exit code 1 if any CRITICAL regulatory violation is found")
270
+
271
+ args = parser.parse_args()
272
+
273
+ results = {"audit_timestamp": datetime.now(timezone.utc).isoformat(), "violations": []}
274
+ has_critical = False
275
+
276
+ if args.scan_text:
277
+ viols = scan_text_for_pci_violations(args.scan_text)
278
+ results["violations"].extend(viols)
279
+ if any(v.get("severity") == "CRITICAL" for v in viols):
280
+ has_critical = True
281
+
282
+ elif args.scan_file:
283
+ if not os.path.exists(args.scan_file):
284
+ print(f"❌ Error: File not found: {args.scan_file}", file=sys.stderr)
285
+ return 2
286
+ with open(args.scan_file, "r", encoding="utf-8", errors="ignore") as f:
287
+ content = f.read()
288
+ viols = scan_text_for_pci_violations(content)
289
+ results["violations"].extend(viols)
290
+ if any(v.get("severity") == "CRITICAL" for v in viols):
291
+ has_critical = True
292
+
293
+ elif args.audit_gdpr:
294
+ if not os.path.exists(args.audit_gdpr):
295
+ print(f"❌ Error: File not found: {args.audit_gdpr}", file=sys.stderr)
296
+ return 2
297
+ with open(args.audit_gdpr, "r", encoding="utf-8") as f:
298
+ data = json.load(f)
299
+ gdpr_res = audit_right_to_be_forgotten(args.user_id, data)
300
+ results["gdpr_audit"] = gdpr_res
301
+ if not gdpr_res["is_compliant"]:
302
+ has_critical = True
303
+ else:
304
+ parser.print_help()
305
+ return 2
306
+
307
+ results["total_violations"] = len(results["violations"])
308
+
309
+ if args.json:
310
+ print(json.dumps(results, indent=2, ensure_ascii=False))
311
+ else:
312
+ print("=" * 72)
313
+ print(" SYNAPSE HUB — REGULATORY & COMPLIANCE AUDIT SCORECARD")
314
+ print("=" * 72)
315
+ if "gdpr_audit" in results:
316
+ g = results["gdpr_audit"]
317
+ st = "\033[92m[COMPLIANT]\033[0m" if g["is_compliant"] else "\033[91m[NON-COMPLIANT]\033[0m"
318
+ print(f" GDPR Art. 17 Status: {st}")
319
+ print(f" Residual PII Records: {g['lingering_pii_count']}")
320
+ else:
321
+ print(f" PCI-DSS v4.0 Scan Findings: {len(results['violations'])}")
322
+ for v in results["violations"]:
323
+ print(f" \033[91m[{v['severity']}]\033[0m {v['standard']} | {v['type']} -> {v['message']}")
324
+ if "masked_suggestion" in v:
325
+ print(f" Masked suggestion: {v['masked_suggestion']}")
326
+ print("=" * 72)
327
+
328
+ if args.gate and has_critical:
329
+ print("🚨 Quality Gate Failed: Regulatory compliance violations detected!", file=sys.stderr)
330
+ return 1
331
+
332
+ return 0
333
+
334
+
335
+ if __name__ == "__main__":
336
+ sys.exit(main())
@@ -478,13 +478,13 @@ def _register_teardown_handlers():
478
478
  _register_teardown_handlers()
479
479
 
480
480
 
481
- if __name__ == "__main__":
481
+ def main(argv=None):
482
482
  import argparse
483
483
  parser = argparse.ArgumentParser(description="GoEx Reversible Teardown Sandbox Stack")
484
484
  parser.add_argument("--demo", action="store_true", help="Run reversible stack demonstration")
485
485
  parser.add_argument("--status", action="store_true", help="Display active undo stack count")
486
486
  parser.add_argument("--recover", action="store_true", help="Recover and roll back uncommitted WAL journal")
487
- args = parser.parse_args()
487
+ args = parser.parse_args(argv)
488
488
 
489
489
  if args.recover:
490
490
  print("Recovering uncommitted mutations from WAL journal...")
@@ -498,3 +498,8 @@ if __name__ == "__main__":
498
498
  print("Exited sandbox context, stack rolled back cleanly.")
499
499
  else:
500
500
  print(f"Active global undo stack size: {GLOBAL_SANDBOX.stack_size()}")
501
+ return 0
502
+
503
+
504
+ if __name__ == "__main__":
505
+ sys.exit(main())
@@ -117,7 +117,7 @@ STACK_RULE_MAPPINGS = {
117
117
  "selenium": ["systematic-debugging.md"],
118
118
  "performance": ["performance_testing_rules.md"],
119
119
  "security": ["security_testing_rules.md"],
120
- "api": ["systematic-debugging.md"],
120
+ "api": ["api_testing_rules.md", "systematic-debugging.md"],
121
121
  "git": ["git-push-protocol.md"],
122
122
  }
123
123
 
@@ -211,13 +211,13 @@ TASK_TYPE_CONFIGS: Dict[str, Dict[str, Any]] = {
211
211
  "rules": ["performance_testing_rules.md"],
212
212
  "primary_skills": ["backend-load-and-stress-patterns", "web-vitals-and-performance-profiler"],
213
213
  "secondary_skills": ["lean-impact-scoreboard"],
214
- "default_token_cap": 6000,
214
+ "default_token_cap": 7000,
215
215
  },
216
216
  "security": {
217
217
  "rules": ["security_testing_rules.md"],
218
218
  "primary_skills": ["security-dast-sentinel", "skillspector-security-guard"],
219
219
  "secondary_skills": ["wcag-audit-patterns"],
220
- "default_token_cap": 6000,
220
+ "default_token_cap": 7000,
221
221
  },
222
222
  }
223
223
 
@@ -357,7 +357,9 @@ def _find_repo_root() -> str:
357
357
  """Finds the root of Synapse-Hub repository."""
358
358
  curr = os.path.abspath(os.path.dirname(__file__))
359
359
  while curr != os.path.dirname(curr):
360
- if os.path.exists(os.path.join(curr, "AGENTS.md")) and os.path.exists(os.path.join(curr, ".agents")):
360
+ if os.path.exists(os.path.join(curr, "AGENTS.md")) and (
361
+ os.path.exists(os.path.join(curr, "skills_manifest.json")) or os.path.exists(os.path.join(curr, ".agents"))
362
+ ):
361
363
  return curr
362
364
  curr = os.path.dirname(curr)
363
365
  return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
@@ -4,9 +4,10 @@
4
4
 
5
5
  # -*- coding: utf-8 -*-
6
6
  """
7
- tools/runaway_stopper.py — Agent Runaway & Token Loop Sentinel
7
+ tools/runaway_stopper.py — Agent Runaway & Token Loop Sentinel (Stub / Re-export)
8
8
  Inspired by Garry Tan's gstack (R70/R91 runaway stopper) adapted for Synapse Hub.
9
9
  Prevents runaway subagent threads, context window blowout, and infinite loops.
10
+ Re-exports RunawaySentinel and DEFAULT_THRESHOLDS from tools.core.circuit_breaker.
10
11
  100% UTF-8 No BOM.
11
12
  """
12
13
 
@@ -14,7 +15,8 @@ import sys
14
15
  import os
15
16
  import json
16
17
  import argparse
17
- from typing import Dict, List, Any, Optional
18
+
19
+ __all__ = ["DEFAULT_THRESHOLDS", "RunawaySentinel", "main"]
18
20
 
19
21
  # Enforce UTF-8 stdout encoding
20
22
  if hasattr(sys.stdout, "reconfigure"):
@@ -24,116 +26,21 @@ if hasattr(sys.stdout, "reconfigure"):
24
26
  except Exception:
25
27
  pass
26
28
 
27
- DEFAULT_THRESHOLDS = {
28
- "max_turns": 30,
29
- "warn_turns": 20,
30
- "max_tokens": 150000,
31
- "warn_tokens": 100000,
32
- "max_repeated_calls": 3,
33
- "empty_turn_threshold": 4,
34
- }
35
-
36
- class RunawaySentinel:
37
- def __init__(self, thresholds: Optional[Dict[str, int]] = None):
38
- self.thresholds = dict(DEFAULT_THRESHOLDS)
39
- if thresholds:
40
- self.thresholds.update(thresholds)
41
-
42
- def evaluate_transcript(self, turns: List[Dict[str, Any]]) -> Dict[str, Any]:
43
- """
44
- Evaluates a list of turn records:
45
- turn = {
46
- "turn_index": int,
47
- "tool_name": str,
48
- "command": str,
49
- "tokens_est": int,
50
- "has_error": bool,
51
- "output_length": int
52
- }
53
- """
54
- turn_count = len(turns)
55
- total_tokens = sum(t.get("tokens_est", 0) for t in turns)
56
- flags = []
57
- verdict = "OK"
58
-
59
- # 1. Turn budget check
60
- if turn_count >= self.thresholds["max_turns"]:
61
- flags.append({
62
- "severity": "CRITICAL",
63
- "type": "TURN_LIMIT_EXCEEDED",
64
- "message": f"Turn count ({turn_count}) exceeded maximum threshold ({self.thresholds['max_turns']})."
65
- })
66
- verdict = "STOP"
67
- elif turn_count >= self.thresholds["warn_turns"]:
68
- flags.append({
69
- "severity": "WARNING",
70
- "type": "TURN_LIMIT_WARNING",
71
- "message": f"Turn count ({turn_count}) approached warning threshold ({self.thresholds['warn_turns']})."
72
- })
73
- if verdict == "OK":
74
- verdict = "WARN"
75
-
76
- # 2. Token budget check
77
- if total_tokens >= self.thresholds["max_tokens"]:
78
- flags.append({
79
- "severity": "CRITICAL",
80
- "type": "TOKEN_BUDGET_EXCEEDED",
81
- "message": f"Estimated token usage ({total_tokens:,}) exceeded budget ({self.thresholds['max_tokens']:,})."
82
- })
83
- verdict = "STOP"
84
- elif total_tokens >= self.thresholds["warn_tokens"]:
85
- flags.append({
86
- "severity": "WARNING",
87
- "type": "TOKEN_BUDGET_WARNING",
88
- "message": f"Estimated token usage ({total_tokens:,}) reached warning limit ({self.thresholds['warn_tokens']:,})."
89
- })
90
- if verdict == "OK":
91
- verdict = "WARN"
92
-
93
- # 3. Repeated identical tool call loop detection
94
- recent_commands = [
95
- (t.get("command") or t.get("tool_name") or t.get("tool") or t.get("name") or "")
96
- for t in turns
97
- if (t.get("command") or t.get("tool_name") or t.get("tool") or t.get("name"))
98
- ]
99
- if len(recent_commands) >= self.thresholds["max_repeated_calls"]:
100
- last_cmd = recent_commands[-1]
101
- repeat_count = 1
102
- for cmd in reversed(recent_commands[:-1]):
103
- if cmd == last_cmd and last_cmd:
104
- repeat_count += 1
105
- else:
106
- break
107
- if repeat_count >= self.thresholds["max_repeated_calls"]:
108
- flags.append({
109
- "severity": "CRITICAL",
110
- "type": "TOOL_LOOP_DETECTED",
111
- "message": f"Command repeated {repeat_count} consecutive times: '{last_cmd[:60]}...'"
112
- })
113
- verdict = "STOP"
114
-
115
- # 4. Consecutive empty turns detection
116
- empty_turns = 0
117
- for t in reversed(turns):
118
- if t.get("output_length", 1) == 0 and not t.get("tool_name"):
119
- empty_turns += 1
120
- else:
121
- break
122
- if empty_turns >= self.thresholds["empty_turn_threshold"]:
123
- flags.append({
124
- "severity": "CRITICAL",
125
- "type": "EMPTY_TURNS_LOOP",
126
- "message": f"Detected {empty_turns} consecutive empty turns without progress."
127
- })
128
- verdict = "STOP"
29
+ # Safe import from tools.core.circuit_breaker
30
+ try:
31
+ from tools.core.circuit_breaker import DEFAULT_THRESHOLDS, RunawaySentinel
32
+ except ImportError:
33
+ try:
34
+ from core.circuit_breaker import DEFAULT_THRESHOLDS, RunawaySentinel
35
+ except ImportError:
36
+ _parent_dir = os.path.dirname(os.path.abspath(__file__))
37
+ _repo_root = os.path.dirname(_parent_dir)
38
+ if _repo_root not in sys.path:
39
+ sys.path.insert(0, _repo_root)
40
+ if _parent_dir not in sys.path:
41
+ sys.path.insert(0, _parent_dir)
42
+ from tools.core.circuit_breaker import DEFAULT_THRESHOLDS, RunawaySentinel
129
43
 
130
- return {
131
- "verdict": verdict,
132
- "turn_count": turn_count,
133
- "total_tokens_est": total_tokens,
134
- "flags": flags,
135
- "is_runaway": verdict == "STOP",
136
- }
137
44
 
138
45
  def main():
139
46
  parser = argparse.ArgumentParser(description="Evaluate agent sessions for runaway token consumption and loops.")
@@ -177,5 +84,6 @@ def main():
177
84
  if result["is_runaway"]:
178
85
  sys.exit(1)
179
86
 
87
+
180
88
  if __name__ == "__main__":
181
89
  main()
@@ -391,7 +391,7 @@ def inject_antigravity_global_plugin():
391
391
  """
392
392
  Automatically injects Synapse-Hub into Antigravity's Global Plugin Directory
393
393
  (~/.gemini/config/plugins/synapse-hub).
394
- Ensures that running `npx @teevee98/synapse-hub setup` activates the 56 skills and 9 subagents
394
+ Ensures that running `npx @teevee98/synapse-hub setup` activates the 57 skills and 9 subagents
395
395
  globally across ALL projects in Google Antigravity.
396
396
  """
397
397
  try:
@@ -68,7 +68,7 @@ EXCLUDED_DIRNAMES = frozenset({
68
68
  ".hg",
69
69
  })
70
70
 
71
- TOTAL_REGISTERED_SKILLS = 56
71
+ TOTAL_REGISTERED_SKILLS = 57
72
72
 
73
73
 
74
74
  def resolve_contained_skill_path(repo_root: str, skill_path: str) -> str:
@@ -253,7 +253,7 @@ def validate_lockfile_integrity(repo_root: str, enforce_content_hash: bool = Tru
253
253
 
254
254
  def update_skills_lockfile(repo_root: str) -> Tuple[bool, str]:
255
255
  """
256
- Recalculates canonical SHA-256 hashes for all 56 skills and writes to skills-lock.json & .skill-lock.json.
256
+ Recalculates canonical SHA-256 hashes for all 57 skills and writes to skills-lock.json & .skill-lock.json.
257
257
  Ensures deterministic output: generating twice on the same tree produces byte-identical files.
258
258
  """
259
259
  canonical_lock = os.path.join(repo_root, "skills-lock.json")