Documentation
¶
Overview ¶
Package synth emits synthetic OTLP/HTTP (JSON) telemetry shaped like the real harnesses, for control vs treatment cohorts with a known injected effect. It exists to prove the collector -> ClickHouse -> analyze path (test/e2e/obs_test.go) and is a test helper, not a production dependency.
Shapes follow the vendors' docs: Claude Code sends claude_code.* delta sums with user.id/session.id/model/type/decision attributes; Codex and Gemini send the gen_ai.client.token.usage histogram. halo.harness is left unset for Claude Code and Gemini so the collector's transform must stamp it; Codex sets it.
Log events follow the vendors' documented names and attributes: Claude Code claude_code.api_request / api_error / tool_result (unprefixed event.name, full name in the body), Gemini gemini_cli.api_response / api_error / tool_call and Codex codex.api_request / tool_result (full name in event.name). Each session makes CallsPerSession API calls and tool calls with the cohort's latency and error-rate effects. Events draw from their own RNG stream so adding them did not change the metric data of a given seed.
Index ¶
Constants ¶
const CallsPerSession = 10
CallsPerSession is the number of API calls (and of tool calls) per session in the log events.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cohort ¶
type Cohort struct {
Experiment, Variant, Ring, Release string
CostMult float64 // multiplies per-session cost (1.3 = +30%)
AcceptRate float64 // P(edit accepted)
LatencyMult float64 // multiplies API call latency; 0 = 1
APIErrorRate float64 // P(API call fails)
ToolErrorRate float64 // P(tool call fails)
}
Cohort is one experiment arm.