Contracts
Web-Oberfläche zur Verwaltung von Contracts - YAML-basierte Qualitätsverträge für Code und Dokumentation.
| URL | /contracts |
| Controller | ContractController |
| Views | /src/View/contracts/ |
| Datenbank | ki_protokoll.contracts |
| MCP-Server | mcp-contracts |
Funktionen
- Liste: Alle Contracts mit Status-Filter (draft, active, deprecated)
- Erstellen: Neue Contracts mit YAML-Editor
- Bearbeiten: Contract-YAML ändern (erstellt neue Version)
- Validieren: Contract gegen Scope ausführen
- Historie: Änderungshistorie mit Versionierung
Routes
| Route | Methode | Beschreibung |
| /contracts | GET | Contract-Liste |
| /contracts/new | GET | Neuer Contract (Formular) |
| /contracts | POST | Contract erstellen |
| /contracts/{id} | GET | Contract-Details |
| /contracts/{id}/edit | GET | Contract bearbeiten |
Views
| Datei | Funktion |
| index.php | Contract-Übersicht mit Filter und Statistiken |
| show.php | Contract-Details mit YAML-Anzeige und Validierung |
| new.php | Formular für neuen Contract |
| edit.php | Formular zum Bearbeiten |
Contract-Struktur (YAML)
name: example-contract
version: "1.0"
scope:
paths:
- /src/View/example/
patterns:
- "*.php"
rules:
- type: structure
check: required_elements
elements: [h1, table]
- type: content
check: no_hardcoded_paths
thresholds:
critical: 0
major: 2
minor: 5
Versionierung
Jede Änderung an einem Contract erstellt automatisch eine neue Version. Die Historie wird in ki_protokoll.contract_history gespeichert.
Integration
- MCP-Contracts: API-Zugriff via MCP-Tools (contracts_list, contracts_validate, etc.)
- Pre-Sync Hook: Validierung vor Deployment zu prod
- Claude Code: Automatische Prüfung bei Code-Änderungen
Siehe auch