🎉 Initial commit

This commit is contained in:
Jonas Bengtsson
2026-10-07 10:38:21 +02:00
commit 1c64aeb071
38 changed files with 3391 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
"""Rotating JSONL reporter — the primary evidence trail (IMPLEMENTATION_PLAN §5.1).
Phase 2 adds: size-based rotation with ``backups`` kept, atomic-ish append,
and a header line carrying the config digest for provenance.
"""
from __future__ import annotations
from pathlib import Path
from opcda_diagnozer.events import DiagEvent
class JsonlReporter:
"""One JSON event per line, rotated by size — implemented in Phase 2."""
def __init__(self, directory: str | Path, max_mb: int = 50, backups: int = 10) -> None:
self._directory = Path(directory)
self._max_mb = max_mb
self._backups = backups
def emit(self, event: DiagEvent) -> None:
raise NotImplementedError(
"Phase 2: JSONL reporter (docs/IMPLEMENTATION_PLAN.md §5.1)"
)