feat: Python telemetry client SDK v0.1.0

Standalone Python package (mosaicstack-telemetry) for reporting
task-completion telemetry and querying predictions from the Mosaic
Stack Telemetry server.

- Sync/async TelemetryClient with context manager support
- Thread-safe EventQueue with bounded deque
- BatchSubmitter with httpx, exponential backoff, Retry-After
- PredictionCache with TTL
- EventBuilder convenience class
- All types standalone (no server dependency)
- 55 tests, 90% coverage, mypy strict clean

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-07 23:25:27 -06:00
parent 0b29302f43
commit f02207e33c
7 changed files with 752 additions and 56 deletions

View File

@@ -38,32 +38,28 @@ from mosaicstack_telemetry.types.predictions import (
__version__ = "0.1.0"
__all__ = [
# Client
"TelemetryClient",
"TelemetryConfig",
"EventBuilder",
"EventQueue",
"PredictionCache",
# Types - Events
"TaskCompletionEvent",
"TaskType",
"Complexity",
"Harness",
"Provider",
"QualityGate",
"Outcome",
"RepoSizeCategory",
# Types - Predictions
"PredictionQuery",
"PredictionResponse",
"PredictionData",
"PredictionMetadata",
"TokenDistribution",
"CorrectionFactors",
"QualityPrediction",
# Types - Common
"BatchEventRequest",
"BatchEventResponse",
"BatchEventResult",
"Complexity",
"CorrectionFactors",
"EventBuilder",
"EventQueue",
"Harness",
"Outcome",
"PredictionCache",
"PredictionData",
"PredictionMetadata",
"PredictionQuery",
"PredictionResponse",
"Provider",
"QualityGate",
"QualityPrediction",
"RepoSizeCategory",
"TaskCompletionEvent",
"TaskType",
"TelemetryClient",
"TelemetryConfig",
"TelemetryError",
"TokenDistribution",
]