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

@@ -100,12 +100,7 @@ class TestEventBuilder:
def test_custom_timestamp(self) -> None:
"""Custom timestamp can be set."""
ts = datetime(2026, 1, 15, 12, 0, 0, tzinfo=timezone.utc)
event = (
EventBuilder(instance_id=TEST_INSTANCE_ID)
.timestamp(ts)
.model("test-model")
.build()
)
event = EventBuilder(instance_id=TEST_INSTANCE_ID).timestamp(ts).model("test-model").build()
assert event.timestamp == ts