Project Structure๏ƒ

Overview of the ai-slop-gate directory layout. For architectural decisions, see ai_slop_gate_snapshot.json (v7.4.0).


Top-Level๏ƒ

ai-slop-gate/
โ”œโ”€โ”€ ai_slop_gate/       # Core Python package
โ”œโ”€โ”€ rulesets/           # Static analysis rule definitions
โ”‚   โ””โ”€โ”€ eslint/         # ESLint rules for JS/TS safety
โ”œโ”€โ”€ ci/                 # CI configuration
โ”œโ”€โ”€ docs/               # Project documentation
โ”œโ”€โ”€ scripts/            # Utility and build scripts
โ”œโ”€โ”€ action.yml          # GitHub Action definition
โ”œโ”€โ”€ policy.yml          # Default policy configuration
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ pytest.ini
โ”œโ”€โ”€ eslint.config.js
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ renovate.json

ai_slop_gate/๏ƒ

ai_slop_gate/
โ”œโ”€โ”€ cli/                    # CLI layer (thin โ€” arg parsing and wiring only)
โ”‚   โ”œโ”€โ”€ main.py             # Entrypoint: python -m ai_slop_gate.cli.main
โ”‚   โ”œโ”€โ”€ run.py              # run command: run_analysis()
โ”‚   โ”œโ”€โ”€ args.py             # Argument definitions
โ”‚   โ”œโ”€โ”€ context.py          # Runtime context object
โ”‚   โ”œโ”€โ”€ logger.py           # Logging configuration
โ”‚   โ””โ”€โ”€ utils.py
โ”‚
โ”œโ”€โ”€ engine/
โ”‚   โ””โ”€โ”€ provider_factory.py # Instantiates providers by name from registry
โ”‚
โ”œโ”€โ”€ domain/                 # Business logic โ€” no IO
โ”‚   โ”œโ”€โ”€ observation.py      # Observation dataclass (immutable)
โ”‚   โ”œโ”€โ”€ observation_factory.py
โ”‚   โ”œโ”€โ”€ observation_result.py
โ”‚   โ”œโ”€โ”€ decision.py         # Decision dataclass (allow|advisory|blocking)
โ”‚   โ”œโ”€โ”€ policy.py           # PolicyRule dataclass
โ”‚   โ”œโ”€โ”€ policy_engine.py    # Evaluates List[Observation] โ†’ Decision
โ”‚   โ”œโ”€โ”€ checks.py           # CheckReport
โ”‚   โ”œโ”€โ”€ check_mapper.py
โ”‚   โ”œโ”€โ”€ signals.py          # Signal type definitions
โ”‚   โ”œโ”€โ”€ contracts.py        # Policy evaluation contracts
โ”‚   โ””โ”€โ”€ compliance/         # Compliance sidecar
โ”‚       โ”œโ”€โ”€ config.py
โ”‚       โ”œโ”€โ”€ detector.py
โ”‚       โ”œโ”€โ”€ enforcement.py
โ”‚       โ”œโ”€โ”€ gateway.py
โ”‚       โ”œโ”€โ”€ pipeline.py
โ”‚       โ”œโ”€โ”€ profile_resolver.py
โ”‚       โ”œโ”€โ”€ profiles.py
โ”‚       โ””โ”€โ”€ rules.py
โ”‚
โ”œโ”€โ”€ providers/
โ”‚   โ”œโ”€โ”€ base.py             # BaseProvider ABC + ProviderObservation dataclass
โ”‚   โ”œโ”€โ”€ registry.py         # Provider registry
โ”‚   โ”œโ”€โ”€ cached_provider.py  # CachedProvider wrapper (LLM only)
โ”‚   โ”œโ”€โ”€ rate_limit_guard.py
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ llm/                # LLM providers (kind = "llm")
โ”‚   โ”‚   โ”œโ”€โ”€ llm_provider.py # LlmProvider base: chunked file scanning, prompt loading
โ”‚   โ”‚   โ”œโ”€โ”€ gemini.py       # GeminiProvider
โ”‚   โ”‚   โ”œโ”€โ”€ groq.py         # GroqProvider
โ”‚   โ”‚   โ”œโ”€โ”€ ollama.py       # OllamaProvider (local, no API key required)
โ”‚   โ”‚   โ””โ”€โ”€ prompts/        # Provider-specific prompt files
โ”‚   โ”‚       โ”œโ”€โ”€ gemini/
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ deep.prompt
โ”‚   โ”‚       โ”œโ”€โ”€ groq/
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ deep.prompt
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ fast.prompt
โ”‚   โ”‚       โ””โ”€โ”€ ollama/
โ”‚   โ”‚           โ”œโ”€โ”€ qwen.prompt
โ”‚   โ”‚           โ””โ”€โ”€ mistral.prompt
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ static/             # Static and infra providers
โ”‚       โ”œโ”€โ”€ static.py                   # StaticProvider
โ”‚       โ”œโ”€โ”€ static_security.py          # StaticSecurityProvider
โ”‚       โ”œโ”€โ”€ static_pipeline.py          # StaticPipelineProvider (CI/CD)
โ”‚       โ”œโ”€โ”€ static_python.py            # StaticPythonProvider (AST)
โ”‚       โ”œโ”€โ”€ static_js.py                # StaticJSProvider
โ”‚       โ”œโ”€โ”€ static_ts_js.py             # StaticTSJSProvider
โ”‚       โ”œโ”€โ”€ static_docker.py            # StaticDockerProvider
โ”‚       โ”œโ”€โ”€ cpp_static.py               # StaticCppProvider
โ”‚       โ”œโ”€โ”€ csharp_static.py            # StaticCSharpProvider
โ”‚       โ”œโ”€โ”€ java_static.py              # StaticJavaProvider
โ”‚       โ”œโ”€โ”€ ruby_static.py              # StaticRubyProvider
โ”‚       โ”œโ”€โ”€ eslint.py                   # ESLintProvider
โ”‚       โ”œโ”€โ”€ k8s_static.py               # KubernetesStaticProvider
โ”‚       โ”œโ”€โ”€ k8s_runtime.py              # K8sRuntimeProvider (kind = "infra")
โ”‚       โ”œโ”€โ”€ terraform_static.py         # TerraformStaticProvider
โ”‚       โ”œโ”€โ”€ terraform_plan.py           # TerraformPlanProvider
โ”‚       โ”œโ”€โ”€ supply_chain.py             # SupplyChainProvider
โ”‚       โ”œโ”€โ”€ trivy.py                    # TrivyProvider (CVE scanning)
โ”‚       โ”œโ”€โ”€ sbom.py                     # SBOMProvider (Syft, SPDX)
โ”‚       โ””โ”€โ”€ dead_code.py                # DeadCodeProvider
โ”‚
โ”œโ”€โ”€ reporters/
โ”‚   โ”œโ”€โ”€ base.py             # Reporter ABC: report(CheckReport) -> None
โ”‚   โ”œโ”€โ”€ console.py          # ConsoleReporter
โ”‚   โ”œโ”€โ”€ github_pr.py        # GitHubPRReporter
โ”‚   โ”œโ”€โ”€ github_checks.py    # GitHubChecksReporter
โ”‚   โ”œโ”€โ”€ gitlab_mr.py        # GitLabMRReporter
โ”‚   โ”œโ”€โ”€ formatter.py        # PR comment formatting
โ”‚   โ””โ”€โ”€ stdout.py
โ”‚
โ”œโ”€โ”€ github/
โ”‚   โ””โ”€โ”€ pr_commenter.py     # GitHub PR comment delivery
โ”‚
โ”œโ”€โ”€ cache/                  # LLM response cache (file + memory backends)
โ”‚
โ”œโ”€โ”€ fixtures/               # Test fixtures and sample data
โ”‚   โ””โ”€โ”€ k8s/                # Kubernetes fixture files
โ”‚
โ””โ”€โ”€ tests/
    โ”œโ”€โ”€ unit/
    โ”‚   โ”œโ”€โ”€ adapters/
    โ”‚   โ”œโ”€โ”€ cache/
    โ”‚   โ”œโ”€โ”€ cli/
    โ”‚   โ”œโ”€โ”€ domain/
    โ”‚   โ”‚   โ””โ”€โ”€ compliance/
    โ”‚   โ”œโ”€โ”€ loader/
    โ”‚   โ”œโ”€โ”€ policy_engine/
    โ”‚   โ”œโ”€โ”€ profiles/
    โ”‚   โ”œโ”€โ”€ providers/
    โ”‚   โ””โ”€โ”€ reporters/
    โ””โ”€โ”€ integration/

rulesets/eslint/๏ƒ

Pre-configured ESLint rule sets for JavaScript/TypeScript static analysis:

File

Purpose

base.mjs

Standard coding patterns

prod_safety.mjs

Production-ready safety checks

secrets.mjs

Leaked credential detection