Defines TypeScript types and interfaces for an experimentation framework to manage arm selection, outcomes, and telemetry attribution.
// Source: https://github.com/ratel-ai/ratel | License: MIT | Copyright 2025 Agentified
// Provided via justclaw.it.com; keep this notice with the code.
/** Whether an arm dispatch is serving the caller or running as detached shadow work. */
export type ExperimentArmRole = "serving" | "shadow";
/** Normalized outcome of one experiment-arm dispatch. */
export type ExperimentArmOutcome = "ok" | "empty" | "timeout" | "error";
/** One ranked measurement projected from an arm result. */
export interface ExperimentRankedItem {
/** Stable, non-content identifier used for rank comparison. */
id: string;
/** Optional arm-specific score; scores are emitted but never compared across arms. */
score?: number;
/** Optional item facts used by item-level evaluation. */
attrs?: Record<string,
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key