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.
- ai_slopgate-1.2.1/PKG-INFO +396 -0
- ai_slopgate-1.2.1/README.md +375 -0
- ai_slopgate-1.2.1/pyproject.toml +90 -0
- ai_slopgate-1.2.1/setup.cfg +4 -0
- ai_slopgate-1.2.1/src/ai_slopgate.egg-info/PKG-INFO +396 -0
- ai_slopgate-1.2.1/src/ai_slopgate.egg-info/SOURCES.txt +321 -0
- ai_slopgate-1.2.1/src/ai_slopgate.egg-info/dependency_links.txt +1 -0
- ai_slopgate-1.2.1/src/ai_slopgate.egg-info/entry_points.txt +5 -0
- ai_slopgate-1.2.1/src/ai_slopgate.egg-info/requires.txt +2 -0
- ai_slopgate-1.2.1/src/ai_slopgate.egg-info/top_level.txt +1 -0
- ai_slopgate-1.2.1/src/slopgate/__init__.py +5 -0
- ai_slopgate-1.2.1/src/slopgate/__main__.py +7 -0
- ai_slopgate-1.2.1/src/slopgate/_argparse_types.py +17 -0
- ai_slopgate-1.2.1/src/slopgate/_types.py +40 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/__init__.py +52 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/_payload_fields.py +68 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/base.py +104 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/claude.py +191 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/codex.py +253 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/cursor.py +209 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/cursor_output.py +191 -0
- ai_slopgate-1.2.1/src/slopgate/adapters/opencode.py +183 -0
- ai_slopgate-1.2.1/src/slopgate/async_jobs.py +49 -0
- ai_slopgate-1.2.1/src/slopgate/cli/__init__.py +51 -0
- ai_slopgate-1.2.1/src/slopgate/cli/_claude_retry.py +35 -0
- ai_slopgate-1.2.1/src/slopgate/cli/_config_commands.py +89 -0
- ai_slopgate-1.2.1/src/slopgate/cli/_lint_commands.py +331 -0
- ai_slopgate-1.2.1/src/slopgate/cli/_lint_report_format.py +30 -0
- ai_slopgate-1.2.1/src/slopgate/cli/_migrate.py +139 -0
- ai_slopgate-1.2.1/src/slopgate/cli/_self_test.py +106 -0
- ai_slopgate-1.2.1/src/slopgate/cli/cli.py +5 -0
- ai_slopgate-1.2.1/src/slopgate/cli/commands.py +329 -0
- ai_slopgate-1.2.1/src/slopgate/cli/lint.py +87 -0
- ai_slopgate-1.2.1/src/slopgate/cli/lint_report.py +332 -0
- ai_slopgate-1.2.1/src/slopgate/cli/main.py +156 -0
- ai_slopgate-1.2.1/src/slopgate/cli/parsers.py +335 -0
- ai_slopgate-1.2.1/src/slopgate/cli/parsers_lint.py +129 -0
- ai_slopgate-1.2.1/src/slopgate/config/__init__.py +50 -0
- ai_slopgate-1.2.1/src/slopgate/config/_coerce.py +54 -0
- ai_slopgate-1.2.1/src/slopgate/config/_discovery.py +96 -0
- ai_slopgate-1.2.1/src/slopgate/config/_io.py +67 -0
- ai_slopgate-1.2.1/src/slopgate/config/_loader.py +39 -0
- ai_slopgate-1.2.1/src/slopgate/config/_repo.py +192 -0
- ai_slopgate-1.2.1/src/slopgate/config/_settings.py +296 -0
- ai_slopgate-1.2.1/src/slopgate/constants.py +161 -0
- ai_slopgate-1.2.1/src/slopgate/context.py +89 -0
- ai_slopgate-1.2.1/src/slopgate/engine/__init__.py +20 -0
- ai_slopgate-1.2.1/src/slopgate/engine/_evaluation.py +120 -0
- ai_slopgate-1.2.1/src/slopgate/engine/_hints.py +350 -0
- ai_slopgate-1.2.1/src/slopgate/engine/_render.py +99 -0
- ai_slopgate-1.2.1/src/slopgate/engine/_retry.py +344 -0
- ai_slopgate-1.2.1/src/slopgate/engine/_runner.py +221 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/__init__.py +175 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/_helpers.py +104 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/_thin_wrapper_enricher.py +51 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/_types.py +20 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/code_enrichers.py +300 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/fixtures.py +137 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/local_context.py +43 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/logger_enrichers.py +120 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/pytest_enrichers.py +221 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/__init__.py +13 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_magic_number_import_hints.py +155 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_magic_numbers.py +219 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_models.py +21 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/quality_enrichers/_paths.py +74 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/silent_except.py +68 -0
- ai_slopgate-1.2.1/src/slopgate/enrichment/type_enrichers.py +166 -0
- ai_slopgate-1.2.1/src/slopgate/installer/__init__.py +132 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_claude.py +187 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_codex.py +295 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_cursor.py +218 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_install_scope.py +143 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_opencode.py +173 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_shared.py +291 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_suite.py +258 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_suite_autoupdate.py +292 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_suite_autoupdate_types.py +19 -0
- ai_slopgate-1.2.1/src/slopgate/installer/_suite_autoupdate_windows.py +81 -0
- ai_slopgate-1.2.1/src/slopgate/lint/__init__.py +81 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_baseline.py +248 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_collectors.py +248 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_config.py +164 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_details/__init__.py +11 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_details/_formatter.py +31 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_details/_metadata.py +156 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_details/_prognosis.py +176 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_details/_test_context.py +271 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/__init__.py +97 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/code_smells.py +250 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/declarative.py +168 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/__init__.py +80 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_blocks.py +121 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_literals.py +193 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_semantic.py +294 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/duplicates/_semantic_builtins.py +63 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/exception_safety.py +302 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/line_length.py +76 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/logging_conventions.py +172 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/stale_code.py +54 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/__init__.py +275 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_assertion_core.py +258 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_basic_detection.py +329 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_coverage_helpers.py +211 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_fixtures.py +77 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_hypothesis_obsolete.py +255 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_integrity_index.py +95 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_payload_core.py +182 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_payload_detectors.py +190 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_production_detectors.py +186 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/test_smells/_production_symbols.py +335 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/type_safety.py +271 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_detectors/wrappers.py +131 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_helpers.py +337 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_parity.py +234 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_parse_errors.py +39 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_toml_overrides.py +99 -0
- ai_slopgate-1.2.1/src/slopgate/lint/_updater.py +312 -0
- ai_slopgate-1.2.1/src/slopgate/lint/config_values.py +165 -0
- ai_slopgate-1.2.1/src/slopgate/models.py +122 -0
- ai_slopgate-1.2.1/src/slopgate/policy_defaults.py +242 -0
- ai_slopgate-1.2.1/src/slopgate/quality/__init__.py +1 -0
- ai_slopgate-1.2.1/src/slopgate/quality/constant_index.py +229 -0
- ai_slopgate-1.2.1/src/slopgate/resources/__init__.py +15 -0
- ai_slopgate-1.2.1/src/slopgate/resources/__pycache__/__init__.cpython-311.pyc +0 -0
- ai_slopgate-1.2.1/src/slopgate/resources/__pycache__/__init__.cpython-312.pyc +0 -0
- ai_slopgate-1.2.1/src/slopgate/resources/__pycache__/__init__.cpython-314.pyc +0 -0
- ai_slopgate-1.2.1/src/slopgate/resources/defaults.json +1093 -0
- ai_slopgate-1.2.1/src/slopgate/resources/opencode_plugin.ts +406 -0
- ai_slopgate-1.2.1/src/slopgate/resources/prompt_context/organization.md +6 -0
- ai_slopgate-1.2.1/src/slopgate/resources/prompt_context/repo.md +77 -0
- ai_slopgate-1.2.1/src/slopgate/resources/slopgate_template.toml +117 -0
- ai_slopgate-1.2.1/src/slopgate/rules/__init__.py +267 -0
- ai_slopgate-1.2.1/src/slopgate/rules/_error_output_signals.py +53 -0
- ai_slopgate-1.2.1/src/slopgate/rules/base.py +42 -0
- ai_slopgate-1.2.1/src/slopgate/rules/baseline_guard.py +225 -0
- ai_slopgate-1.2.1/src/slopgate/rules/common/__init__.py +112 -0
- ai_slopgate-1.2.1/src/slopgate/rules/common/_quality_lint.py +202 -0
- ai_slopgate-1.2.1/src/slopgate/rules/common/_quality_lint_guidance.py +109 -0
- ai_slopgate-1.2.1/src/slopgate/rules/common/_quality_postedit.py +142 -0
- ai_slopgate-1.2.1/src/slopgate/rules/common/_sensitive_system_git.py +257 -0
- ai_slopgate-1.2.1/src/slopgate/rules/common/_shell_read.py +282 -0
- ai_slopgate-1.2.1/src/slopgate/rules/common/_shell_safe_read.py +82 -0
- ai_slopgate-1.2.1/src/slopgate/rules/error_rules.py +286 -0
- ai_slopgate-1.2.1/src/slopgate/rules/langgraph.py +347 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/__init__.py +67 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_helpers.py +121 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio.py +227 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_ast.py +206 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_config.py +150 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_fixture_scope.py +150 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_messages.py +32 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_pytest_asyncio_scope.py +28 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/__init__.py +207 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_ast_health.py +113 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_boundary_helpers.py +217 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_boundary_rule.py +81 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_broad_silent.py +163 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_complexity_dead.py +170 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_feature_envy.py +185 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_flat_siblings.py +277 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_import_alias_rule.py +111 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_import_fanout_rule.py +115 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_import_helpers.py +124 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_method_style.py +281 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_module_size_guidance.py +81 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_module_size_projection.py +139 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_module_size_sources.py +227 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_private_imports.py +106 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_source_parse.py +125 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_rules/_wrapper_god.py +226 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/__init__.py +5 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/_test_smell_rule_helpers.py +111 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/__init__.py +37 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_blocks.py +152 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_call_sequences.py +114 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_magic_numbers.py +97 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_semantic.py +136 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/duplicate_rules/_shared.py +12 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit.py +142 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/__init__.py +28 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/_duplicate.py +238 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/_smells.py +202 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_audit_cases/_stability.py +48 -0
- ai_slopgate-1.2.1/src/slopgate/rules/python_ast/_staging/test_smell_rules.py +269 -0
- ai_slopgate-1.2.1/src/slopgate/rules/regex_rule.py +103 -0
- ai_slopgate-1.2.1/src/slopgate/rules/regex_rule_matching.py +54 -0
- ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/__init__.py +112 -0
- ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_enrollment.py +159 -0
- ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_git_quality.py +319 -0
- ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_infra_security.py +187 -0
- ai_slopgate-1.2.1/src/slopgate/rules/stop_rules/_session_config.py +119 -0
- ai_slopgate-1.2.1/src/slopgate/search/__init__.py +17 -0
- ai_slopgate-1.2.1/src/slopgate/search/_cli_command_specs.py +142 -0
- ai_slopgate-1.2.1/src/slopgate/search/_cli_doctor.py +76 -0
- ai_slopgate-1.2.1/src/slopgate/search/_cli_init.py +225 -0
- ai_slopgate-1.2.1/src/slopgate/search/_cli_parser.py +103 -0
- ai_slopgate-1.2.1/src/slopgate/search/cli.py +279 -0
- ai_slopgate-1.2.1/src/slopgate/search/completions.py +136 -0
- ai_slopgate-1.2.1/src/slopgate/search/config.py +147 -0
- ai_slopgate-1.2.1/src/slopgate/search/git_utils.py +121 -0
- ai_slopgate-1.2.1/src/slopgate/search/index_ops.py +131 -0
- ai_slopgate-1.2.1/src/slopgate/search/opencode_scaffold.py +266 -0
- ai_slopgate-1.2.1/src/slopgate/search/runtime.py +229 -0
- ai_slopgate-1.2.1/src/slopgate/search/scaffolds.py +110 -0
- ai_slopgate-1.2.1/src/slopgate/state/__init__.py +47 -0
- ai_slopgate-1.2.1/src/slopgate/state/_files.py +148 -0
- ai_slopgate-1.2.1/src/slopgate/state/_keys.py +231 -0
- ai_slopgate-1.2.1/src/slopgate/state/_locks_store.py +114 -0
- ai_slopgate-1.2.1/src/slopgate/state/_models.py +51 -0
- ai_slopgate-1.2.1/src/slopgate/stats/__init__.py +17 -0
- ai_slopgate-1.2.1/src/slopgate/stats/_analysis.py +227 -0
- ai_slopgate-1.2.1/src/slopgate/stats/_load.py +71 -0
- ai_slopgate-1.2.1/src/slopgate/stats/_report.py +182 -0
- ai_slopgate-1.2.1/src/slopgate/trace.py +54 -0
- ai_slopgate-1.2.1/src/slopgate/util/__init__.py +5 -0
- ai_slopgate-1.2.1/src/slopgate/util/logger.py +32 -0
- ai_slopgate-1.2.1/src/slopgate/util/path_filters.py +31 -0
- ai_slopgate-1.2.1/src/slopgate/util/payloads/__init__.py +62 -0
- ai_slopgate-1.2.1/src/slopgate/util/payloads/_basic.py +134 -0
- ai_slopgate-1.2.1/src/slopgate/util/payloads/_patches.py +36 -0
- ai_slopgate-1.2.1/src/slopgate/util/payloads/_payload.py +15 -0
- ai_slopgate-1.2.1/src/slopgate/util/payloads/_properties.py +121 -0
- ai_slopgate-1.2.1/src/slopgate/util/payloads/_shell.py +173 -0
- ai_slopgate-1.2.1/src/slopgate/util/payloads/_targets.py +110 -0
- ai_slopgate-1.2.1/src/slopgate/util/platform.py +62 -0
- ai_slopgate-1.2.1/src/slopgate/util/subprocesses.py +65 -0
- ai_slopgate-1.2.1/tests/test_adapter_payload_properties.py +62 -0
- ai_slopgate-1.2.1/tests/test_adapter_render_request_properties.py +65 -0
- ai_slopgate-1.2.1/tests/test_adapters.py +117 -0
- ai_slopgate-1.2.1/tests/test_ast_rules.py +70 -0
- ai_slopgate-1.2.1/tests/test_async_and_claude_retry_public_api.py +74 -0
- ai_slopgate-1.2.1/tests/test_boundary_logging_rule.py +190 -0
- ai_slopgate-1.2.1/tests/test_bundle_link_scripts.py +92 -0
- ai_slopgate-1.2.1/tests/test_cli.py +124 -0
- ai_slopgate-1.2.1/tests/test_cli_trust_regressions.py +213 -0
- ai_slopgate-1.2.1/tests/test_codex_config_toml.py +111 -0
- ai_slopgate-1.2.1/tests/test_config_enrichment_git_public_api.py +224 -0
- ai_slopgate-1.2.1/tests/test_config_enrollment.py +70 -0
- ai_slopgate-1.2.1/tests/test_constant_index_public_api.py +106 -0
- ai_slopgate-1.2.1/tests/test_duplicate_declarative_policy.py +71 -0
- ai_slopgate-1.2.1/tests/test_duplicate_detector.py +199 -0
- ai_slopgate-1.2.1/tests/test_duplicate_detector_literals.py +212 -0
- ai_slopgate-1.2.1/tests/test_engine.py +165 -0
- ai_slopgate-1.2.1/tests/test_engine_inline_deny_tests.py +247 -0
- ai_slopgate-1.2.1/tests/test_enrichment.py +92 -0
- ai_slopgate-1.2.1/tests/test_enrichment_helpers_public_api.py +190 -0
- ai_slopgate-1.2.1/tests/test_enrichment_public_api.py +334 -0
- ai_slopgate-1.2.1/tests/test_error_and_config_rules.py +301 -0
- ai_slopgate-1.2.1/tests/test_fixture_support_policy.py +171 -0
- ai_slopgate-1.2.1/tests/test_flat_file_sibling_packages.py +277 -0
- ai_slopgate-1.2.1/tests/test_harness_schema_context.py +321 -0
- ai_slopgate-1.2.1/tests/test_hook_state_spec.py +109 -0
- ai_slopgate-1.2.1/tests/test_hot_rule_recommendation_gate.py +228 -0
- ai_slopgate-1.2.1/tests/test_hot_rule_target_recovery_gate.py +129 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_candidate_public_api.py +170 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_cli_installer_properties.py +144 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_config_enrichment_util_properties.py +162 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_misc_properties.py +206 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_production_surface.py +348 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_refactored_public_symbol_coverage_a.py +298 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_refactored_public_symbol_coverage_b.py +242 -0
- ai_slopgate-1.2.1/tests/test_hypothesis_repo_cli_properties.py +234 -0
- ai_slopgate-1.2.1/tests/test_installer.py +342 -0
- ai_slopgate-1.2.1/tests/test_installer_claude_hooks.py +303 -0
- ai_slopgate-1.2.1/tests/test_installer_cursor_hooks.py +142 -0
- ai_slopgate-1.2.1/tests/test_installer_ownership.py +211 -0
- ai_slopgate-1.2.1/tests/test_installer_scope.py +132 -0
- ai_slopgate-1.2.1/tests/test_installer_scope_uninstall.py +277 -0
- ai_slopgate-1.2.1/tests/test_langgraph_rules.py +148 -0
- ai_slopgate-1.2.1/tests/test_line_length_detector.py +44 -0
- ai_slopgate-1.2.1/tests/test_lint_baseline_path_config.py +45 -0
- ai_slopgate-1.2.1/tests/test_lint_baseline_sync.py +187 -0
- ai_slopgate-1.2.1/tests/test_lint_cli_hardening.py +289 -0
- ai_slopgate-1.2.1/tests/test_lint_freeze.py +41 -0
- ai_slopgate-1.2.1/tests/test_lint_helpers.py +47 -0
- ai_slopgate-1.2.1/tests/test_lint_parity_contract.py +210 -0
- ai_slopgate-1.2.1/tests/test_lint_parse_reuse.py +138 -0
- ai_slopgate-1.2.1/tests/test_lint_paths_config.py +100 -0
- ai_slopgate-1.2.1/tests/test_lint_payload_detector_public_api.py +198 -0
- ai_slopgate-1.2.1/tests/test_lint_source_detector_public_api.py +204 -0
- ai_slopgate-1.2.1/tests/test_lint_strict.py +16 -0
- ai_slopgate-1.2.1/tests/test_lint_test_integrity_index.py +183 -0
- ai_slopgate-1.2.1/tests/test_lint_updater_public_api.py +119 -0
- ai_slopgate-1.2.1/tests/test_module_package_splits.py +93 -0
- ai_slopgate-1.2.1/tests/test_opencode_installer.py +144 -0
- ai_slopgate-1.2.1/tests/test_package_update.py +47 -0
- ai_slopgate-1.2.1/tests/test_payload_helpers_properties.py +168 -0
- ai_slopgate-1.2.1/tests/test_powershell_argv_parsing.py +80 -0
- ai_slopgate-1.2.1/tests/test_private_import_chain_rule.py +106 -0
- ai_slopgate-1.2.1/tests/test_production_symbol_coverage.py +237 -0
- ai_slopgate-1.2.1/tests/test_public_helper_contracts.py +238 -0
- ai_slopgate-1.2.1/tests/test_pytest_asyncio_rule.py +113 -0
- ai_slopgate-1.2.1/tests/test_python_ast_helpers_public_api.py +85 -0
- ai_slopgate-1.2.1/tests/test_quality_lint_response_rendering.py +184 -0
- ai_slopgate-1.2.1/tests/test_quality_lint_scope_references.py +66 -0
- ai_slopgate-1.2.1/tests/test_refactored_public_symbol_coverage_a.py +323 -0
- ai_slopgate-1.2.1/tests/test_refactored_public_symbol_coverage_b.py +344 -0
- ai_slopgate-1.2.1/tests/test_regex_targets.py +305 -0
- ai_slopgate-1.2.1/tests/test_rule_and_config_public_contracts.py +70 -0
- ai_slopgate-1.2.1/tests/test_scheduler_xml.py +72 -0
- ai_slopgate-1.2.1/tests/test_search_boundary.py +27 -0
- ai_slopgate-1.2.1/tests/test_search_cli_commands.py +291 -0
- ai_slopgate-1.2.1/tests/test_search_completions.py +29 -0
- ai_slopgate-1.2.1/tests/test_search_config_public_api.py +72 -0
- ai_slopgate-1.2.1/tests/test_search_index_ops_public_api.py +129 -0
- ai_slopgate-1.2.1/tests/test_search_runtime_public_api.py +251 -0
- ai_slopgate-1.2.1/tests/test_search_scaffolds_public_api.py +129 -0
- ai_slopgate-1.2.1/tests/test_shared_find_binary.py +50 -0
- ai_slopgate-1.2.1/tests/test_shell_read_rules_public_api.py +163 -0
- ai_slopgate-1.2.1/tests/test_size_guard_hook_behavior.py +286 -0
- ai_slopgate-1.2.1/tests/test_stats.py +231 -0
- ai_slopgate-1.2.1/tests/test_stats_public_api.py +116 -0
- ai_slopgate-1.2.1/tests/test_stop_quality_reminder_gate.py +81 -0
- ai_slopgate-1.2.1/tests/test_suite_autoupdate.py +331 -0
- ai_slopgate-1.2.1/tests/test_suite_autoupdate_scheduler.py +340 -0
- ai_slopgate-1.2.1/tests/test_suite_update_semantics.py +87 -0
- ai_slopgate-1.2.1/tests/test_test_integrity_lint.py +309 -0
- ai_slopgate-1.2.1/tests/test_trace.py +82 -0
- ai_slopgate-1.2.1/tests/test_util_paths.py +125 -0
- ai_slopgate-1.2.1/tests/test_windows_compat.py +16 -0
- ai_slopgate-1.2.1/tests/test_windows_shell_command.py +80 -0
- 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
|
+

|
|
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.
|