python-pipeline-contract_v1.0

ID 6
UUID 650a0a9e-e57c-4b01-a45b-f94fbc6d3f6c
Version 2.0
Status active
Scope
Erstellt 2025-12-20 10:59:58 von migration
Aktualisiert 2025-12-22 09:43:03

YAML-Inhalt

contract:
  name: python-pipeline
  version: "2.0"
  status: active
  description: |
    Code-Qualitätsstandards für Python-Code in der KI-Pipeline.
    Migriert auf Meta-Schema v1.0 am 22.12.2025.

  created: "2025-12-20"
  author: migration

  scope:
    paths:
      - "/opt/scripts/pipeline/**/*.py"
    excludes:
      - "/opt/scripts/pipeline/venv/**"
      - "**/__pycache__/**"

  rules:
    - id: type-hints-required
      check_type: custom
      script: "/opt/scripts/pipeline/venv/bin/mypy"
      args: ["--strict"]
      severity: major
      description: "Type Hints sind erforderlich"

    - id: no-bare-except
      check_type: forbidden_pattern
      patterns:
        - "except:"
      in_files: "**/*.py"
      severity: critical
      description: "Bare except ist verboten"

    - id: no-eval
      check_type: forbidden_pattern
      patterns:
        - "eval("
        - "exec("
      in_files: "**/*.py"
      severity: critical
      description: "eval und exec sind verboten (Security)"

    - id: no-hardcoded-credentials
      check_type: forbidden_pattern
      patterns:
        - 'password = "'
        - "password = '"
        - 'secret = "'
        - "secret = '"
      in_files: "**/*.py"
      severity: critical
      description: "Keine hardcoded Credentials"

    - id: no-sql-injection
      check_type: forbidden_pattern
      patterns:
        - 'f"SELECT'
        - "f'SELECT"
        - 'f"INSERT'
        - 'f"UPDATE'
        - 'f"DELETE'
      in_files: "**/*.py"
      severity: critical
      description: "Keine f-Strings für SQL - verwende Parameterized Queries"

    - id: docstrings-required
      check_type: custom
      script: "/opt/scripts/pipeline/venv/bin/ruff"
      args: ["check", "--select=D100,D101,D102,D103"]
      severity: minor
      description: "Docstrings für Module, Klassen und Funktionen"

  enforcement:
    on_violation: block

  pass_threshold:
    critical_max: 0
    major_max: 2
    minor_max: 5

Aktionen

Bearbeiten

Versionshistorie

Version Geändert am Von Beschreibung
2.0 (aktuell) 2025-12-22 09:43:03 - -
1.0 2025-12-22 09:43:03 claude Migration auf Meta-Schema v1.0: scope.paths als Array, rules extrahiert

Letzte Validierungen

Datum Ergebnis Critical Major Minor Dauer
2025-12-24 16:01:21 passed 0 0 0 3ms

← Zurück zur Übersicht