Dokumentation » Contracts
Contracts
Contracts sind normative YAML-Dokumente, die verbindliche Regeln für Code, Architektur und Dokumentation definieren. Sie ermöglichen automatisierte Validierung und stellen Qualitätsstandards sicher.
Was sind Contracts?
Normativ: Verbindliche Regeln, keine Empfehlungen
Maschinenlesbar: YAML-Format für automatisierte Prüfung
Versioniert: Änderungen erfordern explizite Versionierung
Validierbar: Klare Pass/Fail-Kriterien
Wann werden Contracts geprüft?
Zeitpunkt Contract Aktion bei Violation
Vor Sync zu Prod Alle aktiven Sync blockiert
Nach Dateiänderung Betriebsdokumentation Warnung
Bei neuem Modul Layered Architecture Ablehnung
Pfad
/var/www/docs/contracts/
Aktive Contracts
Betriebsdokumentation v1.1
Datei betriebsdokumentation-pruefung_v1.1.yaml
Status active
Scope /src/View/docs/**/*.php
Validiert Server- und Betriebsdokumentation:
Dateipfade müssen existieren
Befehle müssen syntaktisch korrekt sein
Ports/Versionen müssen aktuell sein
Struktur: Breadcrumb, h1, Intro, Tabelle, Commands
Layered Architecture v1.0
Datei layered-architecture-pruefung_v1.0.yaml
Status active
Scope /src/**/*.php, /app/**/*.php
Validiert die Schichtenarchitektur:
/src (MVC): Framework, Controller, Domain, UseCases, Infrastructure, View
/app (MVP): Presenter, View
Dependency Rules zwischen Layern
Verbotene Imports und Platzierungen
Zukünftige Contracts
JS Browser Architecture v2
Datei js-browser-architecture-contract_v2.yaml
Status future
Scope /public/js/**/*.js
Für komplexe Browser-Anwendungen:
ES Modules ohne Build-Tools
Dependency Injection (clock, rng, httpClient)
Adapter-Pattern für Globals
withBoundary Error Handling
Severity Levels
Level Bedeutung Aktion
critical Faktisch falsch Dokument abgelehnt
major Unvollständig Überarbeitung nötig
minor Kosmetisch Nur protokolliert
Pass-Schwelle
0 critical violations (sonst: rejected)
max 2 major violations (sonst: revision required)
max 5 minor violations (sonst: approved with notes)