( override: string | undefined, configured: number | undefined, timeout: number, )
| 31 | |
| 32 | /** The agent's working budget: a development override, the stimulus constraint, or the whole trial timeout. */ |
| 33 | export function effectiveAgentBudget( |
| 34 | override: string | undefined, |
| 35 | configured: number | undefined, |
| 36 | timeout: number, |
| 37 | ): number { |
| 38 | const budget = override?.trim() ? parseDuration(override) : configured ?? timeout; |
| 39 | if (budget <= 0) throw new InfrastructureError("GH_EVAL_AGENT_BUDGET must be a positive duration"); |
| 40 | return budget; |
| 41 | } |
| 42 | |
| 43 | /** Validates a stimulus's `tags.variant` against the variants its suite accepts. */ |
| 44 | export function stimulusVariant(value: unknown, variants: readonly string[]): string { |
no outgoing calls
no test coverage detected