peptiderepo
ff6ad5eba1
Opik Wave 1 Commit 1: Client, Trace Context, and test infrastructure
Add the core Opik observability classes:
- class-opik-client.php: HTTP REST client for Comet Opik
* POST traces and spans with exponential backoff (3 retries)
* Batch endpoints support (max 100 items per batch)
* Auth headers: Authorization + Comet-Workspace
* Never logs secrets; errors logged with context
- class-opik-trace-context.php: Per-request trace singleton
* Initialized at article generation start
* Manages span stack: start_span(), end_span()
* Finalizes complete trace with all child spans
* Teardown clears context for next request
- class-opik-settings.php: WordPress Settings API integration
* Toggle: 'Enable Opik tracing' (default off)
* Text field: 'Opik project name' (default 'prautoblogger')
* Checkbox: 'Capture full prompt text' (opt-in)
* Read-only status: API key configured, last dispatch, queue depth
* Never renders API key in admin HTML
- Unit tests: test-opik-client.php, test-opik-trace-context.php
* Mock HTTP via Brain\Monkey
* Verify batch size limits, auth headers, retry logic
* Verify UUID generation, span stacking, context teardown
All files ≤ 300 LOC per 300-line rule.
Feature flag default OFF (PRAUTOBLOGGER_OPIK_ENABLED option).
Part of Wave 1 (observability skeleton).
Target: v0.12.0
2026-04-23 14:48:27 +00:00
..
2026-04-23 12:11:59 +07:00
2026-04-23 03:26:50 +00:00
2026-04-23 12:11:59 +07:00
2026-04-23 03:26:50 +00:00
2026-04-23 03:52:55 +00:00
2026-04-23 03:26:50 +00:00
2026-04-23 03:26:50 +00:00
2026-04-23 03:26:50 +00:00
2026-04-23 14:48:27 +00:00
2026-04-23 03:26:50 +00:00
2026-04-23 03:26:50 +00:00
2026-04-23 03:26:50 +00:00
2026-04-23 03:26:50 +00:00
2026-04-23 03:26:50 +00:00