ai-slopgate 1.2.1__tar.gz

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 (323) hide show
  1. ai_slopgate-1.2.1/PKG-INFO +396 -0
  2. ai_slopgate-1.2.1/README.md +375 -0
  3. ai_slopgate-1.2.1/pyproject.toml +90 -0
  4. ai_slopgate-1.2.1/setup.cfg +4 -0
  5. ai_slopgate-1.2.1/src/ai_slopgate.egg-info/PKG-INFO +396 -0
  6. ai_slopgate-1.2.1/src/ai_slopgate.egg-info/SOURCES.txt +321 -0
  7. ai_slopgate-1.2.1/src/ai_slopgate.egg-info/dependency_links.txt +1 -0
  8. ai_slopgate-1.2.1/src/ai_slopgate.egg-info/entry_points.txt +5 -0
  9. ai_slopgate-1.2.1/src/ai_slopgate.egg-info/requires.txt +2 -0
  10. ai_slopgate-1.2.1/src/ai_slopgate.egg-info/top_level.txt +1 -0
  11. ai_slopgate-1.2.1/src/slopgate/__init__.py +5 -0
  12. ai_slopgate-1.2.1/src/slopgate/__main__.py +7 -0
  13. ai_slopgate-1.2.1/src/slopgate/_argparse_types.py +17 -0
  14. ai_slopgate-1.2.1/src/slopgate/_types.py +40 -0
  15. ai_slopgate-1.2.1/src/slopgate/adapters/__init__.py +52 -0
  16. ai_slopgate-1.2.1/src/slopgate/adapters/_payload_fields.py +68 -0
  17. ai_slopgate-1.2.1/src/slopgate/adapters/base.py +104 -0
  18. ai_slopgate-1.2.1/src/slopgate/adapters/claude.py +191 -0
  19. ai_slopgate-1.2.1/src/slopgate/adapters/codex.py +253 -0
  20. ai_slopgate-1.2.1/src/slopgate/adapters/cursor.py +209 -0
  21. ai_slopgate-1.2.1/src/slopgate/adapters/cursor_output.py +191 -0
  22. ai_slopgate-1.2.1/src/slopgate/adapters/opencode.py +183 -0
  23. ai_slopgate-1.2.1/src/slopgate/async_jobs.py +49 -0
  24. ai_slopgate-1.2.1/src/slopgate/cli/__init__.py +51 -0
  25. ai_slopgate-1.2.1/src/slopgate/cli/_claude_retry.py +35 -0
  26. ai_slopgate-1.2.1/src/slopgate/cli/_config_commands.py +89 -0
  27. ai_slopgate-1.2.1/src/slopgate/cli/_lint_commands.py +331 -0
  28. ai_slopgate-1.2.1/src/slopgate/cli/_lint_report_format.py +30 -0
  29. ai_slopgate-1.2.1/src/slopgate/cli/_migrate.py +139 -0
  30. ai_slopgate-1.2.1/src/slopgate/cli/_self_test.py +106 -0
  31. ai_slopgate-1.2.1/src/slopgate/cli/cli.py +5 -0
  32. ai_slopgate-1.2.1/src/slopgate/cli/commands.py +329 -0
  33. ai_slopgate-1.2.1/src/slopgate/cli/lint.py +87 -0
  34. ai_slopgate-1.2.1/src/slopgate/cli/lint_report.py +332 -0
  35. ai_slopgate-1.2.1/src/slopgate/cli/main.py +156 -0
  36. ai_slopgate-1.2.1/src/slopgate/cli/parsers.py +335 -0
  37. ai_slopgate-1.2.1/src/slopgate/cli/parsers_lint.py +129 -0
  38. ai_slopgate-1.2.1/src/slopgate/config/__init__.py +50 -0
  39. ai_slopgate-1.2.1/src/slopgate/config/_coerce.py +54 -0
  40. ai_slopgate-1.2.1/src/slopgate/config/_discovery.py +96 -0
  41. ai_slopgate-1.2.1/src/slopgate/config/_io.py +67 -0
  42. ai_slopgate-1.2.1/src/slopgate/config/_loader.py +39 -0
  43. ai_slopgate-1.2.1/src/slopgate/config/_repo.py +192 -0
  44. ai_slopgate-1.2.1/src/slopgate/config/_settings.py +296 -0
  45. ai_slopgate-1.2.1/src/slopgate/constants.py +161 -0
  46. ai_slopgate-1.2.1/src/slopgate/context.py +89 -0
  47. ai_slopgate-1.2.1/src/slopgate/engine/__init__.py +20 -0
  48. ai_slopgate-1.2.1/src/slopgate/engine/_evaluation.py +120 -0
  49. ai_slopgate-1.2.1/src/slopgate/engine/_hints.py +350 -0
  50. ai_slopgate-1.2.1/src/slopgate/engine/_render.py +99 -0
  51. ai_slopgate-1.2.1/src/slopgate/engine/_retry.py +344 -0
  52. ai_slopgate-1.2.1/src/slopgate/engine/_runner.py +221 -0
  53. ai_slopgate-1.2.1/src/slopgate/enrichment/__init__.py +175 -0
  54. ai_slopgate-1.2.1/src/slopgate/enrichment/_helpers.py +104 -0
  55. ai_slopgate-1.2.1/src/slopgate/enrichment/_thin_wrapper_enricher.py +51 -0
  56. ai_slopgate-1.2.1/src/slopgate/enrichment/_types.py +20 -0
  57. ai_slopgate-1.2.1/src/slopgate/enrichment/code_enrichers.py +300 -0
  58. ai_slopgate-1.2.1/src/slopgate/enrichment/fixtures.py +137 -0
  59. ai_slopgate-1.2.1/src/slopgate/enrichment/local_context.py +43 -0
  60. ai_slopgate-1.2.1/src/slopgate/enrichment/logger_enrichers.py +120 -0
  61. ai_slopgate-1.2.1/src/slopgate/enrichment/pytest_enrichers.py +221 -0
  62. ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/__init__.py +13 -0
  63. ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_magic_number_import_hints.py +155 -0
  64. ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_magic_numbers.py +219 -0
  65. ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_models.py +21 -0
  66. ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_paths.py +74 -0
  67. ai_slopgate-1.2.1/src/slopgate/enrichment/silent_except.py +68 -0
  68. ai_slopgate-1.2.1/src/slopgate/enrichment/type_enrichers.py +166 -0
  69. ai_slopgate-1.2.1/src/slopgate/installer/__init__.py +132 -0
  70. ai_slopgate-1.2.1/src/slopgate/installer/_claude.py +187 -0
  71. ai_slopgate-1.2.1/src/slopgate/installer/_codex.py +295 -0
  72. ai_slopgate-1.2.1/src/slopgate/installer/_cursor.py +218 -0
  73. ai_slopgate-1.2.1/src/slopgate/installer/_install_scope.py +143 -0
  74. ai_slopgate-1.2.1/src/slopgate/installer/_opencode.py +173 -0
  75. ai_slopgate-1.2.1/src/slopgate/installer/_shared.py +291 -0
  76. ai_slopgate-1.2.1/src/slopgate/installer/_suite.py +258 -0
  77. ai_slopgate-1.2.1/src/slopgate/installer/_suite_autoupdate.py +292 -0
  78. ai_slopgate-1.2.1/src/slopgate/installer/_suite_autoupdate_types.py +19 -0
  79. ai_slopgate-1.2.1/src/slopgate/installer/_suite_autoupdate_windows.py +81 -0
  80. ai_slopgate-1.2.1/src/slopgate/lint/__init__.py +81 -0
  81. ai_slopgate-1.2.1/src/slopgate/lint/_baseline.py +248 -0
  82. ai_slopgate-1.2.1/src/slopgate/lint/_collectors.py +248 -0
  83. ai_slopgate-1.2.1/src/slopgate/lint/_config.py +164 -0
  84. ai_slopgate-1.2.1/src/slopgate/lint/_details/__init__.py +11 -0
  85. ai_slopgate-1.2.1/src/slopgate/lint/_details/_formatter.py +31 -0
  86. ai_slopgate-1.2.1/src/slopgate/lint/_details/_metadata.py +156 -0
  87. ai_slopgate-1.2.1/src/slopgate/lint/_details/_prognosis.py +176 -0
  88. ai_slopgate-1.2.1/src/slopgate/lint/_details/_test_context.py +271 -0
  89. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/__init__.py +97 -0
  90. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/code_smells.py +250 -0
  91. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/declarative.py +168 -0
  92. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/__init__.py +80 -0
  93. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_blocks.py +121 -0
  94. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_literals.py +193 -0
  95. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_semantic.py +294 -0
  96. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_semantic_builtins.py +63 -0
  97. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/exception_safety.py +302 -0
  98. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/line_length.py +76 -0
  99. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/logging_conventions.py +172 -0
  100. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/stale_code.py +54 -0
  101. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/__init__.py +275 -0
  102. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_assertion_core.py +258 -0
  103. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_basic_detection.py +329 -0
  104. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_coverage_helpers.py +211 -0
  105. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_fixtures.py +77 -0
  106. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_hypothesis_obsolete.py +255 -0
  107. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_integrity_index.py +95 -0
  108. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_payload_core.py +182 -0
  109. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_payload_detectors.py +190 -0
  110. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_production_detectors.py +186 -0
  111. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_production_symbols.py +335 -0
  112. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/type_safety.py +271 -0
  113. ai_slopgate-1.2.1/src/slopgate/lint/_detectors/wrappers.py +131 -0
  114. ai_slopgate-1.2.1/src/slopgate/lint/_helpers.py +337 -0
  115. ai_slopgate-1.2.1/src/slopgate/lint/_parity.py +234 -0
  116. ai_slopgate-1.2.1/src/slopgate/lint/_parse_errors.py +39 -0
  117. ai_slopgate-1.2.1/src/slopgate/lint/_toml_overrides.py +99 -0
  118. ai_slopgate-1.2.1/src/slopgate/lint/_updater.py +312 -0
  119. ai_slopgate-1.2.1/src/slopgate/lint/config_values.py +165 -0
  120. ai_slopgate-1.2.1/src/slopgate/models.py +122 -0
  121. ai_slopgate-1.2.1/src/slopgate/policy_defaults.py +242 -0
  122. ai_slopgate-1.2.1/src/slopgate/quality/__init__.py +1 -0
  123. ai_slopgate-1.2.1/src/slopgate/quality/constant_index.py +229 -0
  124. ai_slopgate-1.2.1/src/slopgate/resources/__init__.py +15 -0
  125. ai_slopgate-1.2.1/src/slopgate/resources/__pycache__/__init__.cpython-311.pyc +0 -0
  126. ai_slopgate-1.2.1/src/slopgate/resources/__pycache__/__init__.cpython-312.pyc +0 -0
  127. ai_slopgate-1.2.1/src/slopgate/resources/__pycache__/__init__.cpython-314.pyc +0 -0
  128. ai_slopgate-1.2.1/src/slopgate/resources/defaults.json +1093 -0
  129. ai_slopgate-1.2.1/src/slopgate/resources/opencode_plugin.ts +406 -0
  130. ai_slopgate-1.2.1/src/slopgate/resources/prompt_context/organization.md +6 -0
  131. ai_slopgate-1.2.1/src/slopgate/resources/prompt_context/repo.md +77 -0
  132. ai_slopgate-1.2.1/src/slopgate/resources/slopgate_template.toml +117 -0
  133. ai_slopgate-1.2.1/src/slopgate/rules/__init__.py +267 -0
  134. ai_slopgate-1.2.1/src/slopgate/rules/_error_output_signals.py +53 -0
  135. ai_slopgate-1.2.1/src/slopgate/rules/base.py +42 -0
  136. ai_slopgate-1.2.1/src/slopgate/rules/baseline_guard.py +225 -0
  137. ai_slopgate-1.2.1/src/slopgate/rules/common/__init__.py +112 -0
  138. ai_slopgate-1.2.1/src/slopgate/rules/common/_quality_lint.py +202 -0
  139. ai_slopgate-1.2.1/src/slopgate/rules/common/_quality_lint_guidance.py +109 -0
  140. ai_slopgate-1.2.1/src/slopgate/rules/common/_quality_postedit.py +142 -0
  141. ai_slopgate-1.2.1/src/slopgate/rules/common/_sensitive_system_git.py +257 -0
  142. ai_slopgate-1.2.1/src/slopgate/rules/common/_shell_read.py +282 -0
  143. ai_slopgate-1.2.1/src/slopgate/rules/common/_shell_safe_read.py +82 -0
  144. ai_slopgate-1.2.1/src/slopgate/rules/error_rules.py +286 -0
  145. ai_slopgate-1.2.1/src/slopgate/rules/langgraph.py +347 -0
  146. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/__init__.py +67 -0
  147. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_helpers.py +121 -0
  148. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio.py +227 -0
  149. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_ast.py +206 -0
  150. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_config.py +150 -0
  151. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_fixture_scope.py +150 -0
  152. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_messages.py +32 -0
  153. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_scope.py +28 -0
  154. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/__init__.py +207 -0
  155. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_ast_health.py +113 -0
  156. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_boundary_helpers.py +217 -0
  157. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_boundary_rule.py +81 -0
  158. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_broad_silent.py +163 -0
  159. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_complexity_dead.py +170 -0
  160. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_feature_envy.py +185 -0
  161. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_flat_siblings.py +277 -0
  162. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_import_alias_rule.py +111 -0
  163. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_import_fanout_rule.py +115 -0
  164. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_import_helpers.py +124 -0
  165. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_method_style.py +281 -0
  166. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_module_size_guidance.py +81 -0
  167. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_module_size_projection.py +139 -0
  168. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_module_size_sources.py +227 -0
  169. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_private_imports.py +106 -0
  170. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_source_parse.py +125 -0
  171. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_wrapper_god.py +226 -0
  172. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/__init__.py +5 -0
  173. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/_test_smell_rule_helpers.py +111 -0
  174. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/__init__.py +37 -0
  175. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_blocks.py +152 -0
  176. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_call_sequences.py +114 -0
  177. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_magic_numbers.py +97 -0
  178. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_semantic.py +136 -0
  179. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_shared.py +12 -0
  180. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit.py +142 -0
  181. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/__init__.py +28 -0
  182. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/_duplicate.py +238 -0
  183. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/_smells.py +202 -0
  184. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/_stability.py +48 -0
  185. ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_smell_rules.py +269 -0
  186. ai_slopgate-1.2.1/src/slopgate/rules/regex_rule.py +103 -0
  187. ai_slopgate-1.2.1/src/slopgate/rules/regex_rule_matching.py +54 -0
  188. ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/__init__.py +112 -0
  189. ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_enrollment.py +159 -0
  190. ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_git_quality.py +319 -0
  191. ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_infra_security.py +187 -0
  192. ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_session_config.py +119 -0
  193. ai_slopgate-1.2.1/src/slopgate/search/__init__.py +17 -0
  194. ai_slopgate-1.2.1/src/slopgate/search/_cli_command_specs.py +142 -0
  195. ai_slopgate-1.2.1/src/slopgate/search/_cli_doctor.py +76 -0
  196. ai_slopgate-1.2.1/src/slopgate/search/_cli_init.py +225 -0
  197. ai_slopgate-1.2.1/src/slopgate/search/_cli_parser.py +103 -0
  198. ai_slopgate-1.2.1/src/slopgate/search/cli.py +279 -0
  199. ai_slopgate-1.2.1/src/slopgate/search/completions.py +136 -0
  200. ai_slopgate-1.2.1/src/slopgate/search/config.py +147 -0
  201. ai_slopgate-1.2.1/src/slopgate/search/git_utils.py +121 -0
  202. ai_slopgate-1.2.1/src/slopgate/search/index_ops.py +131 -0
  203. ai_slopgate-1.2.1/src/slopgate/search/opencode_scaffold.py +266 -0
  204. ai_slopgate-1.2.1/src/slopgate/search/runtime.py +229 -0
  205. ai_slopgate-1.2.1/src/slopgate/search/scaffolds.py +110 -0
  206. ai_slopgate-1.2.1/src/slopgate/state/__init__.py +47 -0
  207. ai_slopgate-1.2.1/src/slopgate/state/_files.py +148 -0
  208. ai_slopgate-1.2.1/src/slopgate/state/_keys.py +231 -0
  209. ai_slopgate-1.2.1/src/slopgate/state/_locks_store.py +114 -0
  210. ai_slopgate-1.2.1/src/slopgate/state/_models.py +51 -0
  211. ai_slopgate-1.2.1/src/slopgate/stats/__init__.py +17 -0
  212. ai_slopgate-1.2.1/src/slopgate/stats/_analysis.py +227 -0
  213. ai_slopgate-1.2.1/src/slopgate/stats/_load.py +71 -0
  214. ai_slopgate-1.2.1/src/slopgate/stats/_report.py +182 -0
  215. ai_slopgate-1.2.1/src/slopgate/trace.py +54 -0
  216. ai_slopgate-1.2.1/src/slopgate/util/__init__.py +5 -0
  217. ai_slopgate-1.2.1/src/slopgate/util/logger.py +32 -0
  218. ai_slopgate-1.2.1/src/slopgate/util/path_filters.py +31 -0
  219. ai_slopgate-1.2.1/src/slopgate/util/payloads/__init__.py +62 -0
  220. ai_slopgate-1.2.1/src/slopgate/util/payloads/_basic.py +134 -0
  221. ai_slopgate-1.2.1/src/slopgate/util/payloads/_patches.py +36 -0
  222. ai_slopgate-1.2.1/src/slopgate/util/payloads/_payload.py +15 -0
  223. ai_slopgate-1.2.1/src/slopgate/util/payloads/_properties.py +121 -0
  224. ai_slopgate-1.2.1/src/slopgate/util/payloads/_shell.py +173 -0
  225. ai_slopgate-1.2.1/src/slopgate/util/payloads/_targets.py +110 -0
  226. ai_slopgate-1.2.1/src/slopgate/util/platform.py +62 -0
  227. ai_slopgate-1.2.1/src/slopgate/util/subprocesses.py +65 -0
  228. ai_slopgate-1.2.1/tests/test_adapter_payload_properties.py +62 -0
  229. ai_slopgate-1.2.1/tests/test_adapter_render_request_properties.py +65 -0
  230. ai_slopgate-1.2.1/tests/test_adapters.py +117 -0
  231. ai_slopgate-1.2.1/tests/test_ast_rules.py +70 -0
  232. ai_slopgate-1.2.1/tests/test_async_and_claude_retry_public_api.py +74 -0
  233. ai_slopgate-1.2.1/tests/test_boundary_logging_rule.py +190 -0
  234. ai_slopgate-1.2.1/tests/test_bundle_link_scripts.py +92 -0
  235. ai_slopgate-1.2.1/tests/test_cli.py +124 -0
  236. ai_slopgate-1.2.1/tests/test_cli_trust_regressions.py +213 -0
  237. ai_slopgate-1.2.1/tests/test_codex_config_toml.py +111 -0
  238. ai_slopgate-1.2.1/tests/test_config_enrichment_git_public_api.py +224 -0
  239. ai_slopgate-1.2.1/tests/test_config_enrollment.py +70 -0
  240. ai_slopgate-1.2.1/tests/test_constant_index_public_api.py +106 -0
  241. ai_slopgate-1.2.1/tests/test_duplicate_declarative_policy.py +71 -0
  242. ai_slopgate-1.2.1/tests/test_duplicate_detector.py +199 -0
  243. ai_slopgate-1.2.1/tests/test_duplicate_detector_literals.py +212 -0
  244. ai_slopgate-1.2.1/tests/test_engine.py +165 -0
  245. ai_slopgate-1.2.1/tests/test_engine_inline_deny_tests.py +247 -0
  246. ai_slopgate-1.2.1/tests/test_enrichment.py +92 -0
  247. ai_slopgate-1.2.1/tests/test_enrichment_helpers_public_api.py +190 -0
  248. ai_slopgate-1.2.1/tests/test_enrichment_public_api.py +334 -0
  249. ai_slopgate-1.2.1/tests/test_error_and_config_rules.py +301 -0
  250. ai_slopgate-1.2.1/tests/test_fixture_support_policy.py +171 -0
  251. ai_slopgate-1.2.1/tests/test_flat_file_sibling_packages.py +277 -0
  252. ai_slopgate-1.2.1/tests/test_harness_schema_context.py +321 -0
  253. ai_slopgate-1.2.1/tests/test_hook_state_spec.py +109 -0
  254. ai_slopgate-1.2.1/tests/test_hot_rule_recommendation_gate.py +228 -0
  255. ai_slopgate-1.2.1/tests/test_hot_rule_target_recovery_gate.py +129 -0
  256. ai_slopgate-1.2.1/tests/test_hypothesis_candidate_public_api.py +170 -0
  257. ai_slopgate-1.2.1/tests/test_hypothesis_cli_installer_properties.py +144 -0
  258. ai_slopgate-1.2.1/tests/test_hypothesis_config_enrichment_util_properties.py +162 -0
  259. ai_slopgate-1.2.1/tests/test_hypothesis_misc_properties.py +206 -0
  260. ai_slopgate-1.2.1/tests/test_hypothesis_production_surface.py +348 -0
  261. ai_slopgate-1.2.1/tests/test_hypothesis_refactored_public_symbol_coverage_a.py +298 -0
  262. ai_slopgate-1.2.1/tests/test_hypothesis_refactored_public_symbol_coverage_b.py +242 -0
  263. ai_slopgate-1.2.1/tests/test_hypothesis_repo_cli_properties.py +234 -0
  264. ai_slopgate-1.2.1/tests/test_installer.py +342 -0
  265. ai_slopgate-1.2.1/tests/test_installer_claude_hooks.py +303 -0
  266. ai_slopgate-1.2.1/tests/test_installer_cursor_hooks.py +142 -0
  267. ai_slopgate-1.2.1/tests/test_installer_ownership.py +211 -0
  268. ai_slopgate-1.2.1/tests/test_installer_scope.py +132 -0
  269. ai_slopgate-1.2.1/tests/test_installer_scope_uninstall.py +277 -0
  270. ai_slopgate-1.2.1/tests/test_langgraph_rules.py +148 -0
  271. ai_slopgate-1.2.1/tests/test_line_length_detector.py +44 -0
  272. ai_slopgate-1.2.1/tests/test_lint_baseline_path_config.py +45 -0
  273. ai_slopgate-1.2.1/tests/test_lint_baseline_sync.py +187 -0
  274. ai_slopgate-1.2.1/tests/test_lint_cli_hardening.py +289 -0
  275. ai_slopgate-1.2.1/tests/test_lint_freeze.py +41 -0
  276. ai_slopgate-1.2.1/tests/test_lint_helpers.py +47 -0
  277. ai_slopgate-1.2.1/tests/test_lint_parity_contract.py +210 -0
  278. ai_slopgate-1.2.1/tests/test_lint_parse_reuse.py +138 -0
  279. ai_slopgate-1.2.1/tests/test_lint_paths_config.py +100 -0
  280. ai_slopgate-1.2.1/tests/test_lint_payload_detector_public_api.py +198 -0
  281. ai_slopgate-1.2.1/tests/test_lint_source_detector_public_api.py +204 -0
  282. ai_slopgate-1.2.1/tests/test_lint_strict.py +16 -0
  283. ai_slopgate-1.2.1/tests/test_lint_test_integrity_index.py +183 -0
  284. ai_slopgate-1.2.1/tests/test_lint_updater_public_api.py +119 -0
  285. ai_slopgate-1.2.1/tests/test_module_package_splits.py +93 -0
  286. ai_slopgate-1.2.1/tests/test_opencode_installer.py +144 -0
  287. ai_slopgate-1.2.1/tests/test_package_update.py +47 -0
  288. ai_slopgate-1.2.1/tests/test_payload_helpers_properties.py +168 -0
  289. ai_slopgate-1.2.1/tests/test_powershell_argv_parsing.py +80 -0
  290. ai_slopgate-1.2.1/tests/test_private_import_chain_rule.py +106 -0
  291. ai_slopgate-1.2.1/tests/test_production_symbol_coverage.py +237 -0
  292. ai_slopgate-1.2.1/tests/test_public_helper_contracts.py +238 -0
  293. ai_slopgate-1.2.1/tests/test_pytest_asyncio_rule.py +113 -0
  294. ai_slopgate-1.2.1/tests/test_python_ast_helpers_public_api.py +85 -0
  295. ai_slopgate-1.2.1/tests/test_quality_lint_response_rendering.py +184 -0
  296. ai_slopgate-1.2.1/tests/test_quality_lint_scope_references.py +66 -0
  297. ai_slopgate-1.2.1/tests/test_refactored_public_symbol_coverage_a.py +323 -0
  298. ai_slopgate-1.2.1/tests/test_refactored_public_symbol_coverage_b.py +344 -0
  299. ai_slopgate-1.2.1/tests/test_regex_targets.py +305 -0
  300. ai_slopgate-1.2.1/tests/test_rule_and_config_public_contracts.py +70 -0
  301. ai_slopgate-1.2.1/tests/test_scheduler_xml.py +72 -0
  302. ai_slopgate-1.2.1/tests/test_search_boundary.py +27 -0
  303. ai_slopgate-1.2.1/tests/test_search_cli_commands.py +291 -0
  304. ai_slopgate-1.2.1/tests/test_search_completions.py +29 -0
  305. ai_slopgate-1.2.1/tests/test_search_config_public_api.py +72 -0
  306. ai_slopgate-1.2.1/tests/test_search_index_ops_public_api.py +129 -0
  307. ai_slopgate-1.2.1/tests/test_search_runtime_public_api.py +251 -0
  308. ai_slopgate-1.2.1/tests/test_search_scaffolds_public_api.py +129 -0
  309. ai_slopgate-1.2.1/tests/test_shared_find_binary.py +50 -0
  310. ai_slopgate-1.2.1/tests/test_shell_read_rules_public_api.py +163 -0
  311. ai_slopgate-1.2.1/tests/test_size_guard_hook_behavior.py +286 -0
  312. ai_slopgate-1.2.1/tests/test_stats.py +231 -0
  313. ai_slopgate-1.2.1/tests/test_stats_public_api.py +116 -0
  314. ai_slopgate-1.2.1/tests/test_stop_quality_reminder_gate.py +81 -0
  315. ai_slopgate-1.2.1/tests/test_suite_autoupdate.py +331 -0
  316. ai_slopgate-1.2.1/tests/test_suite_autoupdate_scheduler.py +340 -0
  317. ai_slopgate-1.2.1/tests/test_suite_update_semantics.py +87 -0
  318. ai_slopgate-1.2.1/tests/test_test_integrity_lint.py +309 -0
  319. ai_slopgate-1.2.1/tests/test_trace.py +82 -0
  320. ai_slopgate-1.2.1/tests/test_util_paths.py +125 -0
  321. ai_slopgate-1.2.1/tests/test_windows_compat.py +16 -0
  322. ai_slopgate-1.2.1/tests/test_windows_shell_command.py +80 -0
  323. ai_slopgate-1.2.1/tests/test_windows_task_path_xml.py +46 -0
@@ -0,0 +1,396 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-slopgate
3
+ Version: 1.2.1
4
+ Summary: Global CLI guardrails engine for AI coding agents — Claude Code, Codex, OpenCode
5
+ Author: trav
6
+ License: MIT
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: Environment :: Console
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Quality Assurance
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: tomli>=2.4.1
20
+ Requires-Dist: typing-extensions>=4.15.0
21
+
22
+ # slopgate
23
+
24
+ Global CLI guardrails engine for AI coding agents. **Real-time guardrails where the host platform supports them, plus batch code quality linting.** Claude Code has the richest runtime surface; Codex CLI and OpenCode are supported with platform-specific limitations.
25
+
26
+ ![Slopgate analytics dashboard — decision volume, event pipeline, top rules, severity mix](docs/assets/dashboard-overview.png)
27
+
28
+ ## Install
29
+
30
+ Install [uv](https://docs.astral.sh/uv/) first, then either install the global CLI or work from a project venv.
31
+
32
+ ```bash
33
+ # Global CLI on PATH (recommended)
34
+ uv tool install .
35
+
36
+ # From PyPI (when published)
37
+ # uv tool install slopgate
38
+
39
+ # Development: project venv + dev tools
40
+ uv sync
41
+ uv run slopgate test
42
+ ```
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ # Initialize config (creates ~/.config/slopgate/)
48
+ slopgate config init
49
+
50
+ # Install hooks for your platform
51
+ slopgate install claude # patches ~/.claude/settings.json
52
+ slopgate install codex # patches ~/.codex/hooks.json
53
+ slopgate install opencode # copies plugin to the user OpenCode plugins dir
54
+
55
+ # Or use the native all-harness installer and OS auto-updater
56
+ slopgate install all --with-autoupdate
57
+
58
+ # Run self-test
59
+ slopgate test
60
+
61
+ # Check stats
62
+ slopgate stats --days 7
63
+
64
+ # Lint the current project for code quality
65
+ slopgate lint check # scan project; fail only on NEW violations (agent stop hooks)
66
+ slopgate lint strict # fail on ANY violation (git pre-commit gate)
67
+ slopgate lint check --details # extended violations + repair prognosis
68
+ slopgate lint init . # scaffold slopgate.toml
69
+ ```
70
+
71
+ ## Dashboard
72
+
73
+ The [`dashboard/`](dashboard/) app visualizes Slopgate JSONL traces (`~/.config/slopgate/logs/*.jsonl`): decision volume, top rules, sessions, harness status, and rule toggles. It complements `slopgate stats` with interactive charts and file upload.
74
+
75
+ ### Live dashboard (default: port 18834)
76
+
77
+ Build static assets with trace data baked in, deploy to the canvas directory, then run the API/static server:
78
+
79
+ ```bash
80
+ # From repo root — local logs on this machine
81
+ make dashboard-build
82
+
83
+ # Or fetch logs + config from a remote host over SSH (default host: little)
84
+ make dashboard-build-ssh
85
+
86
+ # Serve UI + live APIs (snapshot, SSE stream, config read/write, harness status)
87
+ make dashboard-api
88
+ ```
89
+
90
+ Open **http://127.0.0.1:18834/** (or `http://0.0.0.0:18834/` when `BIND=0.0.0.0`).
91
+
92
+ | Variable | Default | Purpose |
93
+ |---|---|---|
94
+ | `PORT` | `18834` | HTTP listen port |
95
+ | `BIND` | `0.0.0.0` | Bind address |
96
+ | `SLOPGATE_SSH_HOST` | `little` | SSH host for live logs, config, and harness APIs |
97
+ | `SLOPGATE_CONFIG_PATH` | `~/.config/slopgate/config.json` | Documented config path (read via SSH) |
98
+ | `SLOPGATE_TRACE_DIR` | `~/.config/slopgate/logs` | Documented trace dir (read via SSH) |
99
+
100
+ `serve.py` serves files from `~/.openclaw/canvas/forcedash` (populated by `build-standalone.py`). Without a prior build, start `serve.py` only after `build-standalone.py` has run at least once.
101
+
102
+ ### UI development (port 18835)
103
+
104
+ For frontend work without the canvas deploy path:
105
+
106
+ ```bash
107
+ npm --prefix dashboard install # or: bun --cwd dashboard install
108
+ make dashboard-dev # Vite → http://localhost:18835
109
+ ```
110
+
111
+ - Starts with **mock** data unless `window.__SLOPGATE_DATA__` is injected.
112
+ - **Drop** `.jsonl` / `.ndjson` trace files onto the UI to explore local logs.
113
+ - Rule editing and harness panels need `make dashboard-api` on **18834**; Vite proxies `/api/*` to that server.
114
+
115
+ ### Trace inputs
116
+
117
+ | Source | How |
118
+ |---|---|
119
+ | Hooks (live) | `events.jsonl`, `rules.jsonl`, `results.jsonl`, `subprocess.jsonl` under `~/.config/slopgate/logs/` |
120
+ | CLI summary | `slopgate stats --days 7` (terminal; no UI) |
121
+ | Dashboard upload | Drag JSONL files in dev mode |
122
+ | Baked build | `build-standalone.py` inlines recent history into the deployed `index.html` |
123
+
124
+ ## Supported Platforms
125
+
126
+ | Platform | Status | Install |
127
+ |---|---|---|
128
+ | **Claude Code** | ✅ Production | `slopgate install claude [--install-scope user\|project\|both]` |
129
+ | **Cursor** | ⚠️ Partial | `slopgate install cursor [--install-scope user\|project\|both]` |
130
+ | **Codex CLI** | ⚠️ Partial | `slopgate install codex [--install-scope user\|project\|both]` |
131
+ | **OpenCode** | ⚠️ Degraded | `slopgate install opencode [--install-scope user\|project\|both]` |
132
+
133
+ `slopgate install all` is the multi-device path: each enrolled device installs hooks only for harnesses that already exist on that OS/user profile, then registers the native scheduler for that OS. Linux uses a user `systemd` timer, macOS uses a LaunchAgent, and native Windows uses `schtasks` plus a PowerShell shim. The scheduler polls the GitHub source and runs `slopgate update`, so a push to `github.com/vasceannie/slopgate` refreshes the package and rewrites the local Claude/Codex/OpenCode install sites when each device is online. Use `--include-missing` only when intentionally creating every supported harness config on that device. Pass `--disable-autoupdate` to skip the scheduler.
134
+
135
+ ## Agent bundle
136
+
137
+ The [`bundle/`](bundle/) directory is the repo-owned source of truth for Slopgate-facing agent assets that are safe to share across harnesses: recovery skills, rule shards, prompt fragments, Claude agents, and MCP templates.
138
+
139
+ Local development flow:
140
+
141
+ ```bash
142
+ ./bundle/scripts/link-local.sh --dry-run # review symlink targets
143
+ ./bundle/scripts/link-local.sh # link skills/rules/agents only
144
+ slopgate install all # hook files remain CLI-owned
145
+ ./bundle/scripts/verify-local.sh
146
+ ```
147
+
148
+ Important ownership boundary: the bundle **does not** symlink full prompt entrypoints (`~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, `~/.config/opencode/AGENTS.md`) and does **not** own Claude/Codex/Cursor `hooks.json` or Claude `settings.json` hook commands. Keep hook wiring under `slopgate install ...` so install/uninstall can merge safely, back up user config, and point at the correct local binary.
149
+
150
+ For Claude Code marketplace work, `bundle/claude-plugin/` is a plugin-shaped tree and `bundle/marketplace/` is a local marketplace catalog. Build/test locally with:
151
+
152
+ ```bash
153
+ ./bundle/scripts/build-claude-plugin.sh --copy
154
+ claude --plugin-dir ./bundle/claude-plugin
155
+ ```
156
+
157
+ ## Platform Notes
158
+
159
+ - **Claude Code**: full first-class hook target. Installs into `~/.claude/settings.json` and/or `.claude/settings.json` (`--install-scope`). Slopgate uses Claude's `hookSpecificOutput` permission and `decision`/`reason` shapes per the [hooks reference](https://code.claude.com/docs/en/hooks).
160
+ - **Cursor**: native hooks via `~/.cursor/hooks.json` (user) and/or `.cursor/hooks.json` (project). Install with `slopgate install <platform>` (user default), `--install-scope project|both`, and optional `--project-root /path/to/repo`. The same flags apply to `install all`, `setup`, `update`, and `uninstall`. Slopgate maps Cursor events to its canonical model and renders Cursor-native stdout (`permission` gates, `continue` for `beforeSubmitPrompt`, `additional_context` for `postToolUse`/`afterFileEdit`, `followup_message` for `stop`/`subagentStop`). Post-tool hooks cannot hard-block edits the way Claude `PostToolUse` denial does; use `preToolUse`, `beforeShellExecution`, or `beforeReadFile` for enforcement. Tab hooks (`beforeTabFileRead`, `afterTabFileEdit`) are installed for inline-completion policy; `workspaceOpen` is not wired yet.
161
+ - **Codex CLI**: partial hooks via `~/.codex/hooks.json` and/or `.codex/hooks.json`, with `features.hooks = true` enabled in the adjacent `config.toml` when that file exists. Matchers target `Bash|apply_patch|Edit|Write`. Post-tool critical blocks use Codex's top-level `continue`/`stopReason`; other findings use `hookSpecificOutput.additionalContext` or `decision`/`reason` per [Codex hooks docs](https://developers.openai.com/codex/config-reference).
162
+ - **OpenCode**: plugin shim at the user config plugins dir and/or `.opencode/plugins/slopgate-plugin.ts`. Native events (`tool.execute.before`, `tool.execute.after`, `session.created`, `session.idle`, `permission.asked`) map to the canonical model; blocking is strongest at `tool.execute.before`. `session.idle` stop guidance is advisory (`action: continue`) because OpenCode cannot force another turn from the plugin API.
163
+
164
+ ## Architecture
165
+
166
+ ```
167
+ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
168
+ │ Claude Code │ │ Cursor │ │ Codex CLI │ │ OpenCode │
169
+ │ settings.json│ │ hooks.json │ │ hooks.json │ │ TS plugin │
170
+ └──────┬───────┘ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
171
+ │ │ │ │
172
+ └─────────────────┴─────────────────┴─────────────────┘
173
+
174
+ ┌────────────────────┐
175
+ │ slopgate handle │
176
+ │ --platform X │
177
+ └─────────┬──────────┘
178
+
179
+ ┌────────────────────┐
180
+ │ Rule Engine │
181
+ │ 87 hook rules │
182
+ │ (42 Py + 45 regex) │
183
+ └─────────┬──────────┘
184
+
185
+ ┌────────────────────┐
186
+ │ Platform Adapter │
187
+ │ (per-platform) │
188
+ └────────────────────┘
189
+ ```
190
+
191
+ No shell wrappers. No bootstrap scripts. Just `slopgate handle` on PATH.
192
+
193
+ ## CLI
194
+
195
+ ### Hook Enforcement (real-time)
196
+
197
+ ```bash
198
+ # Core hook handler (called by platform hooks)
199
+ slopgate handle [--platform claude|cursor|codex|opencode]
200
+
201
+ # Replay a captured payload
202
+ slopgate replay --payload fixture.json [--platform codex] [--pretty]
203
+
204
+ # Check quality gate status for a repo
205
+ slopgate check [path]
206
+
207
+ # Install/uninstall hooks
208
+ slopgate install <platform|all> [--disable-autoupdate] [--dry-run]
209
+ slopgate uninstall <platform> [--disable-autoupdate] [--dry-run]
210
+ slopgate setup [--disable-autoupdate] [--dry-run]
211
+ slopgate update [--dry-run]
212
+
213
+ # Activity analysis
214
+ slopgate stats [--log results.jsonl] [--days N] [--json]
215
+
216
+ # Configuration
217
+ slopgate config show # show effective config
218
+ slopgate config init # create from defaults
219
+ slopgate config path # print config file location
220
+
221
+ # Self-test
222
+ slopgate test
223
+
224
+ # Version
225
+ slopgate version
226
+ ```
227
+
228
+ For Codex CLI and OpenCode, "real-time" should be read as best-effort within the host platform's current hook or plugin surface, not as Claude-equivalent parity.
229
+
230
+ ### Code Quality Linting (batch)
231
+
232
+ ```bash
233
+ # Scan the current project root for violations (compares against baseline)
234
+ # Intentionally accepts no path/file argument; use cd <project-root> first.
235
+ slopgate lint check [--details|--verbose]
236
+
237
+ # Repo-wide rebaselining is intentionally disabled
238
+ # Do not run slopgate lint baseline [path]
239
+
240
+ # One-time snapshot when baselines.json has empty rules (initial enrollment)
241
+ slopgate lint freeze
242
+
243
+ # Scaffold a slopgate.toml config
244
+ slopgate lint init [path]
245
+
246
+ # Merge missing config keys into existing slopgate.toml
247
+ slopgate lint update [path] [--dry-run]
248
+ ```
249
+
250
+ Set the lint baseline file under `[paths]` in `slopgate.toml` (relative paths are resolved from the repo root):
251
+
252
+ ```toml
253
+ [paths]
254
+ baseline_path = "baselines.json"
255
+ ```
256
+
257
+ `slopgate lint check` prints the resolved baseline path in its header and **syncs `baselines.json` after each run**: on a clean pass it mirrors current findings (dropping stale ids); when NEW violations block the gate it only prunes fixed debt (never auto-adds NEW ids). Run `slopgate lint freeze` once while `rules` is still empty for initial enrollment. Listed stable IDs remain real defects to fix — not permission to ignore them.
258
+
259
+ #### 38 batch lint detectors
260
+
261
+ Separate from hook rule IDs: `slopgate lint check` runs these AST/static detectors project-wide (baseline-gated). The real-time hook `QUALITY-LINT-001` reuses the same detector engine on touched files after edits.
262
+
263
+ | Category | Detectors |
264
+ |---|---|
265
+ | **Parse** | python-parse-error |
266
+ | **Code smells** | high-complexity, long-method, too-many-params, deep-nesting, god-class, oversized-module, oversized-module-soft |
267
+ | **Type safety** | banned-any, type-suppression |
268
+ | **Exception safety** | broad-except-swallow, silent-except, silent-datetime-fallback |
269
+ | **Test smells** | long-test, eager-test, assertion-free-test, assertion-roulette, conditional-assertion, fixture-outside-conftest |
270
+ | **Test integrity** | untested-production-code, missing-integration-test, hypothesis-candidate, obsolete-or-deprecated-test, weak-test-assertion, mock-theater, schema-bypass-test-data, hand-built-test-payload, mocked-integration-test |
271
+ | **Duplication** | semantic-clone, repeated-magic-number, repeated-string-literal, repeated-code-block, duplicate-call-sequence |
272
+ | **Logging** | direct-get-logger, wrong-logger-name |
273
+ | **Stale code** | deprecated-pattern |
274
+ | **Wrappers** | unnecessary-wrapper |
275
+ | **Style** | long-line |
276
+
277
+ ## Config Discovery
278
+
279
+ slopgate resolves config in this order:
280
+
281
+ 1. `$SLOPGATE_CONFIG` (explicit file path)
282
+ 2. `%APPDATA%\slopgate\config.json` on native Windows
283
+ 3. `~/.config/slopgate/config.json` (XDG/POSIX)
284
+ 4. `$CLAUDE_HOOK_LAYER_ROOT/.claude/hook-layer/config.json` (legacy)
285
+ 5. `~/.claude/hooks/enforcer/.claude/hook-layer/config.json` (legacy default)
286
+ 6. Bundled defaults
287
+
288
+ Per-repo overrides via `slopgate.toml` in the repo root.
289
+
290
+ ## Rules
291
+
292
+ Slopgate has **three surfaces** that are easy to conflate:
293
+
294
+ | Surface | Count (bundled defaults) | When it runs |
295
+ |---|---:|---|
296
+ | **Real-time hooks** | **87** rule evaluations | Agent tool events (`slopgate handle`) |
297
+ | ↳ Python classes | 42 (3 always-on + 39 repo-strict) | Path/git/AST quality, post-edit lint bridge, stop/session, LangGraph, etc. |
298
+ | ↳ Regex (`config.json`) | 45 | Pattern rules for Python/TS/Rust/shell/git/config paths |
299
+ | **Batch lint** | **38** detectors | `slopgate lint check` (project-wide, baseline-gated) |
300
+
301
+ Many IDs overlap *by design* (for example `PY-CODE-013` in hooks and `god-class` / wrapper detectors in batch lint). The dashboard “top rules” chart is dominated by high-volume hook IDs such as `QUALITY-LINT-001` (post-edit touched-file lint), `PY-LOG-002`, and `PY-CODE-013` — not by the older “30 + 39” inventory.
302
+
303
+ Repo mode still applies: **outside_repo** runs only the 3 always-on safety rules; **repo_strict** (with `slopgate.toml`) runs the full 87; **repo_relaxed** drops repo-strict families but keeps always-on safety.
304
+
305
+ ### Real-time hook rules (42 Python + 45 regex)
306
+
307
+ - **Always-on (3):** protected paths, sensitive data, system paths
308
+ - **Workflow & quality (repo-strict):** full-file read, git `--no-verify`, search reminders, post-edit quality commands, `QUALITY-LINT-001` / `QUALITY-POST-001`, baseline guard, enrollment, hook-infra protection, rulebook security, config-change guard, session/stop controls, bash error reinforcement
309
+ - **Python AST (19):** `PY-AST-001`, `PY-CODE-008`–`018`, `PY-EXC-001`/`002`, `PY-IMPORT-001`–`003`, `PY-LOG-002`, `PY-TEST-005`, etc.
310
+ - **LangGraph (3):** state reducers, mutation, deprecated API
311
+ - **Regex (45):** type/exception/logging/test/shell/QA-path/TS/Rust patterns in bundled `defaults.json` (override via `~/.config/slopgate/config.json`)
312
+
313
+ Availability depends on platform support:
314
+
315
+ - **Claude Code**: widest runtime coverage
316
+ - **Cursor**: partial — native `hooks.json` with Cursor-specific stdout shapes; strongest blocking on `preToolUse`, `beforeShellExecution`, and `beforeReadFile` (post-tool hooks are advisory/context-only, not hard blocks like Claude `PostToolUse` denial)
317
+ - **Codex CLI**: currently limited by Codex's narrower hook surface
318
+ - **OpenCode**: mediated through plugin event translation with advisory gaps around prompt and stop control
319
+
320
+ ### Batch lint (38 detectors)
321
+
322
+ - See the **38 batch lint detectors** table under Code Quality Linting
323
+ - Configured per repo via `slopgate.toml`; only *new* violations fail the gate
324
+ - Repo-wide baseline regeneration is disabled to prevent agents from normalizing technical debt
325
+
326
+ ### Declarative regex rules (45)
327
+
328
+ Configured in `config.json` (`regex_rules` in bundled defaults) — covers Python/TS/Rust quality and test patterns, shell bypasses, QA path protection, linter config guards, git reminders, and more. Disable or downgrade per rule via `disabled_rules` / `severity_overrides`.
329
+
330
+ ## Per-Repo Overrides
331
+
332
+ Create `slopgate.toml` in your repo root:
333
+
334
+ ```toml
335
+ [slopgate]
336
+ # Disable specific rules
337
+ disabled_rules = ["PY-CODE-013", "PY-TEST-004"]
338
+
339
+ # Downgrade rules to advisory
340
+ [slopgate.severity_overrides]
341
+ "PY-CODE-008" = "warn"
342
+
343
+ [thresholds]
344
+ max_method_lines = 80
345
+ max_params = 6
346
+ max_complexity = 15
347
+ max_nesting_depth = 5
348
+ max_line_length = 140
349
+ ```
350
+
351
+ ## Enforcement Modes
352
+
353
+ slopgate now enforces in two layers using `slopgate.toml` as the enrollment signal:
354
+
355
+ - **outside_repo**: no `slopgate.toml` in the current working repo root. Only always-on safety rules run.
356
+ - **repo_strict**: `slopgate.toml` exists and the repo is enabled. Always-on safety + full strict/project rules run.
357
+ - **repo_relaxed**: `slopgate.toml` exists, but `.noslopgate`, `.no-slop-gate`, or `[slopgate].enabled = false` is set. Only always-on safety rules run.
358
+
359
+ Always-on safety protections are:
360
+
361
+ - `BUILTIN-PROTECTED-PATHS`
362
+ - `GLOBAL-BUILTIN-SENSITIVE-DATA`
363
+ - `GLOBAL-BUILTIN-SYSTEM-PROTECTION`
364
+
365
+ `skip_paths` no longer bypasses the engine. Matching paths only suppress the repo-strict rule family; always-on safety still runs.
366
+
367
+ To place a repo into relaxed mode locally:
368
+
369
+ ```bash
370
+ touch .noslopgate
371
+ ```
372
+
373
+ Or in `slopgate.toml`:
374
+
375
+ ```toml
376
+ [slopgate]
377
+ enabled = false
378
+ ```
379
+
380
+ ## Windows / PowerShell Notes
381
+
382
+ - Native Windows installs use the standard console scripts generated by Python
383
+ packaging (`slopgate.exe`, `vfc.exe`, and `isx.exe`).
384
+ - Installed hook commands are quoted through a PowerShell-compatible launcher
385
+ on Windows so paths with spaces under `AppData` can execute reliably.
386
+ - PowerShell commands are inspected for common file operations such as
387
+ `Set-Content`, `Add-Content`, `Out-File`, `Copy-Item`, `Move-Item`, and
388
+ `Remove-Item`.
389
+ - OpenCode plugin installs use `%APPDATA%\\opencode\\plugins` on native
390
+ Windows and bake the discovered `slopgate.exe` path into the generated
391
+ plugin with JSON/TypeScript-safe escaping. `SLOPGATE_BIN` can still override
392
+ it at runtime.
393
+ - Codex CLI hook support on native Windows depends on the installed Codex
394
+ version. When Codex hooks are unavailable or degraded on Windows, use WSL or
395
+ Git Bash for runtime enforcement and use `slopgate lint check` natively for
396
+ batch quality checks.