config

package
v0.5.58 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config defines run configuration for bench-cli.

Index

Constants

View Source
const DefaultNamespace = "bench"

DefaultNamespace is the default Kubernetes namespace for benchmark scenarios.

View Source
const GracefulStopTimeout = 30 * time.Second

GracefulStopTimeout is the timeout for graceful shutdown of River workers.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EnvironmentProvider string
	Scenario            string
	ScenariosDir        string
	Adapter             string
	A2AAgentURL         string
	AgentCommand        string
	RunsDir             string
	KubeconfigPath      string
	Timeout             time.Duration
	ReuseCluster        bool
	ClusterName         string
	DryRun              bool
	BenchURL            string
	BenchAPIKey         string
	EvidenceDir         string
	Model               string
	Provider            string
	MemoryWindow        int
	SystemPromptFile    string
	ContractVersion     string
	SkillFile           string // local skill prompt file; runner host must already have this path
	SkillID             string // stable skill identity for comparison/filtering
	SkillVersion        string // stable skill version for comparison/filtering
	SkillSource         string // source label such as local-file, local-temp, or registry name
	SkillSHA256         string // optional expected sha256 for the skill file
	MCPServer           string // MCP server command
	ToolServerID        string // stable MCP server identity for comparison/filtering
	ToolServerVersion   string // stable MCP server version for comparison/filtering
	ReportID            string // stable public/private report campaign identifier
	Parallel            int    // number of parallel workers (0 or 1 = sequential, >1 requires --database-url)
	DatabaseURL         string // PostgreSQL connection string for River job queue (env: BENCH_DATABASE_URL)
}

Config holds all settings for a benchmark run.

func Default

func Default() Config

Default returns a Config with sensible offline-first defaults. Reads BENCH_API_URL and BENCH_API_KEY from environment for bench reporting.

func (*Config) ResolveA2AAgentURL

func (c *Config) ResolveA2AAgentURL() string

ResolveA2AAgentURL returns the A2A agent URL from flag, env, or empty. Priority: flag > INFRA_BENCH_A2A_AGENT_URL > empty.

func (*Config) ResolveDatabaseURL

func (c *Config) ResolveDatabaseURL() string

ResolveDatabaseURL returns the database URL from flag, env, or empty. Priority: flag > BENCH_DATABASE_URL > empty.

func (*Config) ResolvePromptFile

func (c *Config) ResolvePromptFile() string

ResolvePromptFile returns the prompt file used for agent execution. Skill files are more specific than the legacy system-prompt file.

func (*Config) ResolveSkillFile

func (c *Config) ResolveSkillFile() string

ResolveSkillFile returns the local skill prompt path from flag, env, or empty. Priority: flag > BENCH_SKILL_FILE > empty.

func (*Config) ResolveSystemPromptFile

func (c *Config) ResolveSystemPromptFile() string

ResolveSystemPromptFile returns the system prompt file path from flag, env, or empty. Priority: flag > INFRA_BENCH_SYSTEM_PROMPT > empty (use default).

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that all required fields are set.

type VersionInfo

type VersionInfo struct {
	// infra-bench
	InfraBenchVersion string `json:"infra_bench_version"`
	InfraBenchCommit  string `json:"infra_bench_commit,omitempty"`

	// prompt/contract
	ContractVersion string `json:"contract_version,omitempty"`
	SkillVersion    string `json:"skill_version,omitempty"`
	PromptVersion   string `json:"prompt_version,omitempty"`
	PromptFile      string `json:"prompt_file,omitempty"`
	SkillFile       string `json:"skill_file,omitempty"`
	SkillID         string `json:"skill_id,omitempty"`
	SkillSource     string `json:"skill_source,omitempty"`
	SkillSHA256     string `json:"skill_sha256,omitempty"`
}

VersionInfo holds all version metadata for reproducible benchmarks. Every run must record these so results can be compared across time, models, prompts, and skill releases.

func CollectVersions

func CollectVersions(infraBenchVersion, infraBenchCommit string, cfg Config) VersionInfo

CollectVersions gathers version information from the prompt file and the infra-bench build.

func (VersionInfo) ToMetadata

func (v VersionInfo) ToMetadata() map[string]string

ToMetadata converts VersionInfo to a flat string map for run metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL