feat(02-07): add Pydantic v2 boundary-log schemas (OBS-01)

- Create src/gps_denied/obs/log_schemas.py with 3 models:
  MavlinkGpsInputEmitted (AC-4.3 + AC-1.4), ApiRequestCompleted,
  AnchorDecision (VERIFY-02)
- All models use ConfigDict(extra='forbid', frozen=True)
- SourceLabel Literal encodes AC-1.4 vocab; AnchorRejectReason encodes VERIFY-02
- Update gps_denied.obs barrel __init__.py to re-export all schemas + type aliases
This commit is contained in:
Yuzviak
2026-05-11 18:49:55 +03:00
parent e81b6fdfba
commit 94c1b76086
2 changed files with 130 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
"""Observability package — structlog spine + boundary log schemas.
Hot-path logging spine wired by ``configure_logging``; per-frame ``correlation_id``
(= frame_id) bound at ``pipeline/orchestrator.py:process_frame``.
Boundary log schemas (REST, FDR, anchor decisions) defined in ``log_schemas``.
"""
import structlog
from gps_denied.obs.log_schemas import (
AnchorDecision,
AnchorRejectReason,
ApiRequestCompleted,
MavlinkGpsInputEmitted,
SourceLabel,
)
from gps_denied.obs.logging_config import configure_logging
get_logger = structlog.get_logger # convenience re-export
__all__ = [
"configure_logging",
"get_logger",
# Boundary schemas
"MavlinkGpsInputEmitted",
"ApiRequestCompleted",
"AnchorDecision",
"SourceLabel",
"AnchorRejectReason",
]