projectconfig

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package projectconfig provides the ProjectConfig struct and loader for .waza.yaml project-level configuration files.

Index

Constants

View Source
const (
	DefaultSkillsDir  = "skills/"
	DefaultEvalsDir   = "evals/"
	DefaultResultsDir = "results/"

	DefaultEngine  = "copilot-sdk"
	DefaultModel   = "claude-sonnet-4.6"
	DefaultTimeout = 300
	DefaultWorkers = 4

	DefaultCacheDir = ".waza-cache"

	DefaultServerPort       = 3000
	DefaultServerResultsDir = "results/"

	DefaultDevModel         = "claude-sonnet-4-20250514"
	DefaultDevTarget        = "medium-high"
	DefaultDevMaxIterations = 5

	DefaultTokenWarningThreshold = 500
	DefaultTokenFallbackLimit    = 1000

	DefaultGraderProgramTimeout = 30

	DefaultStorageContainerName = "waza-results"
)

Default values for project configuration. These are the single source of truth — New() references them and no other code should duplicate them.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Enabled *bool  `yaml:"enabled,omitempty"`
	Dir     string `yaml:"dir,omitempty"`
}

CacheConfig holds cache settings.

type DefaultsConfig

type DefaultsConfig struct {
	Engine     string `yaml:"engine,omitempty"`
	Model      string `yaml:"model,omitempty"`
	JudgeModel string `yaml:"judgeModel,omitempty"`
	Timeout    int    `yaml:"timeout,omitempty"`
	Parallel   *bool  `yaml:"parallel,omitempty"`
	Workers    int    `yaml:"workers,omitempty"`
	Verbose    *bool  `yaml:"verbose,omitempty"`
	SessionLog *bool  `yaml:"sessionLog,omitempty"`
}

DefaultsConfig holds default execution parameters.

type DevConfig

type DevConfig struct {
	Model         string `yaml:"model,omitempty"`
	Target        string `yaml:"target,omitempty"`
	MaxIterations int    `yaml:"maxIterations,omitempty"`
}

DevConfig holds waza dev command settings.

type GradersConfig

type GradersConfig struct {
	ProgramTimeout int `yaml:"programTimeout,omitempty"`
}

GradersConfig holds grader execution settings.

type PathsConfig

type PathsConfig struct {
	Skills  string `yaml:"skills,omitempty"`
	Evals   string `yaml:"evals,omitempty"`
	Results string `yaml:"results,omitempty"`
}

PathsConfig holds directory paths for skills, evals, and results.

type ProjectConfig

type ProjectConfig struct {
	Paths    PathsConfig    `yaml:"paths,omitempty"`
	Defaults DefaultsConfig `yaml:"defaults,omitempty"`
	Cache    CacheConfig    `yaml:"cache,omitempty"`
	Server   ServerConfig   `yaml:"server,omitempty"`
	Dev      DevConfig      `yaml:"dev,omitempty"`
	Tokens   TokensConfig   `yaml:"tokens,omitempty"`
	Graders  GradersConfig  `yaml:"graders,omitempty"`
	Storage  StorageConfig  `yaml:"storage,omitempty"`
}

ProjectConfig is the top-level configuration loaded from .waza.yaml.

func Load

func Load(startDir string) (*ProjectConfig, error)

Load finds .waza.yaml by walking up from startDir (max 10 levels), unmarshals it, and fills in missing fields with defaults. If no config file is found, returns defaults with a nil error. Real I/O errors (e.g. permission denied) are returned to the caller.

func New

func New() *ProjectConfig

New returns a ProjectConfig with all hard-coded defaults populated.

type ServerConfig

type ServerConfig struct {
	Port       int    `yaml:"port,omitempty"`
	ResultsDir string `yaml:"resultsDir,omitempty"`
}

ServerConfig holds dashboard server settings.

type StorageConfig

type StorageConfig struct {
	Provider      string `yaml:"provider,omitempty"`      // "azure-blob" or empty for local
	AccountName   string `yaml:"accountName,omitempty"`   // Azure storage account name
	ContainerName string `yaml:"containerName,omitempty"` // blob container (default: "waza-results")
	Enabled       bool   `yaml:"enabled,omitempty"`       // true when remote storage is configured
}

StorageConfig holds remote result storage settings.

type TokenLimitsConfig

type TokenLimitsConfig struct {
	Defaults  map[string]int `yaml:"defaults,omitempty"`
	Overrides map[string]int `yaml:"overrides,omitempty"`
}

TokenLimitsConfig holds per-file token limit maps, keyed by glob/path patterns.

type TokensConfig

type TokensConfig struct {
	WarningThreshold int                `yaml:"warningThreshold,omitempty"`
	FallbackLimit    int                `yaml:"fallbackLimit,omitempty"`
	Limits           *TokenLimitsConfig `yaml:"limits,omitempty"`
}

TokensConfig holds token budget settings.

Jump to

Keyboard shortcuts

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