chore(observability): align AI service log format with web/worker logs (#51) - #56
Merged
Merged
Conversation
#51) The AI service JSON formatter now emits the pino key set used by web and worker: `level` (lower-case pino label, WARNING -> warn, CRITICAL -> fatal), `time` (UTC ISO 8601 with milliseconds and `Z`, like Date.toISOString) and `event`, plus the allow-listed IDs/extras as before. `ts` and `logger` are gone. jobId/companyId are not known to the AI service (it only receives X-Request-Id), so they stay web/worker-only. Documented once in operations.md; test pins the exact key set and level labels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1
… tests (#51 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1
Owner
Author
Frischer Review (read-only Subagent) – Ergebnis und UmgangNichts blockierend. Belegt: Schlüssel und Level-Namen entsprechen
Nach der Änderung: ruff/format/pyright sauber, pytest 428 passed / 2 skipped, Generated by Claude Code |
Fluory
marked this pull request as ready for review
September 24, 2026 11:20
15 tasks
…ormat-51 # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warum
Fixes #51 · Der KI-Dienst schrieb Logs mit anderen Schlüsseln (
ts,level: "WARNING",logger) als Web und Worker (pino:time,level: "warn",event). Eine gemeinsame Auswertung über alle drei Dienste war dadurch umständlich.Arbeitsstand
jobId/companyIdim KI-Dienst – er bekommt sie nie (zustandslos, ADR-0001 D8); das bräuchte eine Vertragsänderung.jsonlog.py, Tests,operations.md(„Shared log format“), CHANGELOG, frischer Review eingearbeitet (kompaktes JSON,loggernur bei Bibliotheken, Exception-Test), CI grün.Was ist passiert (Klartext)
Alle drei Teile des Systems (Webseite, Hintergrund-Worker, KI-Dienst) schreiben ihre Protokolle jetzt im gleichen Format: gleiche Feldnamen, gleiche Bezeichnungen für Warnungen und Fehler. So kann man eine Anfrage über ihre
requestIddurch alle drei Protokolle verfolgen, ohne umzurechnen. Meldet eine eingebaute Bibliothek (z. B. die Dokumentenerkennung) etwas, steht dabei, von wem es kommt. Inhaltlich wird nichts Neues geloggt – weiterhin nur IDs und Codes, keine Mail-Inhalte; bei Fehlern nur deren Art, nie deren Text.Plan-Pflicht (SYSTEM.md §4)
Geändert
services/ai/src/requestflow_ai/jsonlog.py: Schlüssellevel/time/event/requestId/documentId, pino-Level-Namen, kompaktes JSON,loggernur für Bibliotheks-Einträgeservices/ai/tests/test_jsonlog.py: gemeinsamer Schlüsselsatz, Level-Namen, kompakte Form, Exception nur als Typ, Bibliotheksquelledocs/technical/operations.md,CHANGELOG.mdNachweis (SYSTEM.md §11)
verify:changed: grün – ruff, ruff format, pyright, pytest 428 passed / 2 skippedverify: grün (CIcheckauf 0f223c4, inkl. AI-Service-Verify); TS unberührtverify:full/ E2E-Spec: nicht betroffenDoku-Entscheidung (genau eine)
docs/technical/operations.md[Unreleased](sichtbares Feature oder Verhalten – im selben PR, nie „später")Entferntes oder Umbenanntes:
docs/+ README gegrept, Treffer bereinigt: nichts entferntDateigrößen und neue Bausteine (SYSTEM.md §7)
Dateien über 500 Zeilen im Diff (Ausnahmen: generierter Code, Lockfiles, Fixtures, Migrationen, Schemas, Ressourcen, Doku, Konfiguration):
Über 800 Zeilen mit neuer Fachlogik oder über 1000 Zeilen (P1/P2): nicht betroffen
Neue Shared-Komponente, Utility-Datei, Adapter oder fachlicher Service:
Subagent-Einsätze
Risiken / offene Punkte
ts) in einer Auswertung nutzt, muss umstellen – bisher gibt es keine.🤖 Generated with Claude Code
https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1