Documentation
¶
Index ¶
- Constants
- func DataDir() string
- func FindFieldByTOMLKey(v reflect.Value, key string) (reflect.Value, error)
- func FindOrCreateFieldByTOMLKey(v reflect.Value, key string) (reflect.Value, error)
- func GetConfigValue(cfg any, key string) (string, error)
- func GetDisplayName(repoPath string) string
- func GlobalConfigPath() string
- func IsBranchExcluded(repoPath, branch string) bool
- func IsConfigParseError(err error) bool
- func IsConfigValueSet(cfg any, key string) bool
- func IsDefaultReviewType(rt string) bool
- func IsGlobalKey(key string) bool
- func IsKeyInTOMLFile(raw map[string]any, key string) bool
- func IsSensitiveKey(key string) bool
- func IsValidKey(key string) bool
- func LoadRawGlobal() (map[string]any, error)
- func LoadRawRepo(repoPath string) (map[string]any, error)
- func LoadRawTOML(path string) (map[string]any, error)
- func MaskValue(val string) string
- func NormalizeMinSeverity(value string) (string, error)
- func NormalizeReasoning(value string) (string, error)
- func ReadRoborevID(repoPath string) (string, error)
- func ResolveAgent(explicit string, repoPath string, globalCfg *Config) string
- func ResolveAgentForWorkflow(cli, repoPath string, globalCfg *Config, workflow, level string) string
- func ResolveBackupAgentForWorkflow(repoPath string, globalCfg *Config, workflow string) string
- func ResolveBackupModelForWorkflow(repoPath string, globalCfg *Config, workflow string) string
- func ResolveFixReasoning(explicit string, repoPath string) (string, error)
- func ResolveJobTimeout(repoPath string, globalCfg *Config) int
- func ResolveMaxPromptSize(repoPath string, globalCfg *Config) int
- func ResolveModel(explicit string, repoPath string, globalCfg *Config) string
- func ResolveModelForWorkflow(cli, repoPath string, globalCfg *Config, workflow, level string) string
- func ResolveRefineReasoning(explicit string, repoPath string) (string, error)
- func ResolveRepoIdentity(repoPath string, getRemoteURL func(repoPath, remoteName string) string) string
- func ResolveReviewReasoning(explicit string, repoPath string) (string, error)
- func ResolveWorkflowModel(repoPath string, globalCfg *Config, workflow, level string) string
- func SaveGlobal(cfg *Config) error
- func SetConfigValue(cfg any, key string, value string) error
- func ValidateReviewTypes(types []string) ([]string, error)
- func ValidateRoborevID(id string) string
- type ACPAgentConfig
- type AdvancedConfig
- type AgentReviewType
- type CIConfig
- func (c *CIConfig) IsThrottleBypassed(login string) bool
- func (c *CIConfig) ResolvedAgents() []string
- func (c *CIConfig) ResolvedMaxRepos() int
- func (c *CIConfig) ResolvedReviewMatrix() []AgentReviewType
- func (c *CIConfig) ResolvedReviewTypes() []string
- func (c *CIConfig) ResolvedThrottleInterval() time.Duration
- type Config
- type ConfigParseError
- type GitHubAppConfig
- type HookConfig
- type KeyValue
- type KeyValueOrigin
- type RepoCIConfig
- type RepoConfig
- type SyncConfig
Constants ¶
const ( ReviewTypeDefault = "default" ReviewTypeSecurity = "security" ReviewTypeDesign = "design" )
Canonical review type names.
const DefaultMaxPromptSize = 200 * 1024
DefaultMaxPromptSize is the default maximum prompt size in bytes (200KB)
Variables ¶
This section is empty.
Functions ¶
func DataDir ¶
func DataDir() string
DataDir returns the roborev data directory. Uses ROBOREV_DATA_DIR env var if set, otherwise ~/.roborev
func FindFieldByTOMLKey ¶ added in v0.31.0
FindFieldByTOMLKey locates a struct field by its TOML tag, supporting dot notation. It never mutates the struct; nil pointer fields are resolved via a throwaway zero struct.
func FindOrCreateFieldByTOMLKey ¶ added in v0.31.0
FindOrCreateFieldByTOMLKey is like FindFieldByTOMLKey but initializes nil pointer fields so the returned field is settable. Use this in SetConfigValue.
func GetConfigValue ¶ added in v0.31.0
GetConfigValue retrieves a value from a config struct by its TOML key. Supports dot-separated keys for nested structs (e.g., "sync.enabled").
func GetDisplayName ¶
GetDisplayName returns the display name for a repo, or empty if not set
func GlobalConfigPath ¶
func GlobalConfigPath() string
GlobalConfigPath returns the path to the global config file
func IsBranchExcluded ¶
IsBranchExcluded checks if a branch should be excluded from reviews
func IsConfigParseError ¶ added in v0.33.0
IsConfigParseError reports whether err (or any error in its chain) is a ConfigParseError.
func IsConfigValueSet ¶ added in v0.31.0
IsConfigValueSet returns true if the field for key exists and is non-zero.
func IsDefaultReviewType ¶ added in v0.27.0
IsDefaultReviewType returns true if the review type represents the standard (non-specialized) code review. The canonical name is "default"; "general" and "review" are accepted as backward-compatible aliases.
func IsGlobalKey ¶ added in v0.31.0
IsGlobalKey returns true if the key belongs to the global Config struct.
func IsKeyInTOMLFile ¶ added in v0.31.0
IsKeyInTOMLFile checks whether a dot-separated key was explicitly present in a raw TOML map (as returned by toml.Decode into map[string]interface{}). This correctly detects explicit false/0 values that IsZero would miss.
func IsSensitiveKey ¶ added in v0.31.0
IsSensitiveKey returns true if the key holds a secret that should be masked.
func IsValidKey ¶ added in v0.31.0
IsValidKey returns true if the key is recognized by either Config or RepoConfig.
func LoadRawGlobal ¶ added in v0.31.0
LoadRawGlobal loads the global config file as a raw TOML map.
func LoadRawRepo ¶ added in v0.31.0
LoadRawRepo loads the repo config file as a raw TOML map.
func LoadRawTOML ¶ added in v0.31.0
LoadRawTOML loads a TOML file as a raw map.
func MaskValue ¶ added in v0.31.0
MaskValue returns a masked version of a sensitive value, showing only the last 4 chars.
func NormalizeMinSeverity ¶ added in v0.26.0
NormalizeMinSeverity validates and normalizes a minimum severity level string. Returns the canonical form (critical, high, medium, low) or an error if invalid. Returns empty string (no error) for empty input.
func NormalizeReasoning ¶ added in v0.26.0
NormalizeReasoning validates and normalizes a reasoning level string. Returns the canonical form (thorough, standard, fast) or an error if invalid. Returns empty string (no error) for empty input.
func ReadRoborevID ¶
ReadRoborevID reads and validates the .roborev-id file from a repo. Returns the ID if valid, empty string if file doesn't exist or is invalid. If invalid, the error describes why.
func ResolveAgent ¶
ResolveAgent determines which agent to use based on config priority: 1. Explicit agent parameter (if non-empty) 2. Per-repo config 3. Global config 4. Default ("codex")
func ResolveAgentForWorkflow ¶ added in v0.19.0
func ResolveAgentForWorkflow(cli, repoPath string, globalCfg *Config, workflow, level string) string
ResolveAgentForWorkflow determines which agent to use based on workflow and level. Priority (Option A - layer wins first, then specificity): 1. CLI explicit 2. Repo {workflow}_agent_{level} 3. Repo {workflow}_agent 4. Repo agent 5. Global {workflow}_agent_{level} 6. Global {workflow}_agent 7. Global default_agent 8. "codex"
func ResolveBackupAgentForWorkflow ¶ added in v0.33.0
ResolveBackupAgentForWorkflow returns the backup agent for a workflow, or empty string if none is configured. Priority:
- Repo {workflow}_backup_agent
- Repo backup_agent (generic)
- Global {workflow}_backup_agent
- Global default_backup_agent
- "" (no backup)
func ResolveBackupModelForWorkflow ¶ added in v0.43.0
ResolveBackupModelForWorkflow returns the backup model for a workflow, or empty string if none is configured. Priority:
- Repo {workflow}_backup_model
- Repo backup_model (generic)
- Global {workflow}_backup_model
- Global default_backup_model
- "" (no override — agent uses its default)
func ResolveFixReasoning ¶ added in v0.21.0
ResolveFixReasoning determines reasoning level for fix. Priority: explicit > per-repo config > default (standard)
func ResolveJobTimeout ¶
ResolveJobTimeout determines job timeout based on config priority: 1. Per-repo config (if set and > 0) 2. Global config (if set and > 0) 3. Default (30 minutes)
func ResolveMaxPromptSize ¶ added in v0.20.0
ResolveMaxPromptSize determines the maximum prompt size based on config priority: 1. Per-repo config (max_prompt_size in .roborev.toml) 2. Global config (default_max_prompt_size in config.toml) 3. Default (200KB)
func ResolveModel ¶ added in v0.17.0
ResolveModel determines which model to use based on config priority: 1. Explicit model parameter (if non-empty) 2. Per-repo config (model in .roborev.toml) 3. Global config (default_model in config.toml) 4. Default (empty string, agent uses its default)
func ResolveModelForWorkflow ¶ added in v0.19.0
func ResolveModelForWorkflow(cli, repoPath string, globalCfg *Config, workflow, level string) string
ResolveModelForWorkflow determines which model to use based on workflow and level. Same priority as ResolveAgentForWorkflow, but returns empty string as default.
func ResolveRefineReasoning ¶
ResolveRefineReasoning determines reasoning level for refine. Priority: explicit > per-repo config > default (standard)
func ResolveRepoIdentity ¶
func ResolveRepoIdentity(repoPath string, getRemoteURL func(repoPath, remoteName string) string) string
ResolveRepoIdentity determines the unique identity for a repository. Resolution order: 1. .roborev-id file in repo root (if exists and valid) 2. Git remote "origin" URL 3. Any git remote URL 4. Fallback: local://{absolute_path}
Note: Credentials are stripped from git remote URLs to prevent secrets from being persisted in the database or synced to PostgreSQL.
The getRemoteURL parameter allows injection of git remote lookup for testing. Pass nil to use the default git.GetRemoteURL function.
func ResolveReviewReasoning ¶
ResolveReviewReasoning determines reasoning level for reviews. Priority: explicit > per-repo config > default (thorough)
func ResolveWorkflowModel ¶ added in v0.43.0
ResolveWorkflowModel resolves a model from workflow-specific config only, skipping generic defaults (repo model, global default_model). Use this when the agent was overridden from a different source (e.g., CLI --agent) and the generic model is likely paired with a different default agent.
func SetConfigValue ¶ added in v0.31.0
SetConfigValue sets a value on a config struct by its TOML key. Converts the string value to the appropriate Go type.
func ValidateReviewTypes ¶ added in v0.34.0
ValidateReviewTypes canonicalizes, validates, and deduplicates a list of review type strings. Aliases ("general", "review") are normalized to "default". Returns an error if any type is empty or unrecognized.
func ValidateRoborevID ¶
ValidateReporevID validates the content of a .roborev-id file. Returns empty string if valid, or an error message if invalid.
Types ¶
type ACPAgentConfig ¶ added in v0.40.0
type ACPAgentConfig struct {
Name string `toml:"name"` // Agent name (required)
Command string `toml:"command"` // ACP agent command (required)
Args []string `toml:"args"` // Additional arguments for the agent
ReadOnlyMode string `toml:"read_only_mode"` // Read-only mode. Valid values depend on the underlying agent, e.g. "plan"
AutoApproveMode string `toml:"auto_approve_mode"` // Auto-approve mode. Valid values depend on the underlying agent, e.g. "auto-approve"
Mode string `toml:"mode"` // Default agent mode. Use read_only_mode for review flows unless explicitly opting in.
// DisableModeNegotiation skips ACP SetSessionMode while keeping
// authorization behavior based on agentic/read-only mode selection.
DisableModeNegotiation bool `toml:"disable_mode_negotiation"`
Model string `toml:"model"` // Default model to use
Timeout int `toml:"timeout"` // Command timeout in seconds (default: 600)
}
ACPAgentConfig holds configuration for a single ACP agent
type AdvancedConfig ¶ added in v0.43.0
type AdvancedConfig struct {
TasksEnabled bool `toml:"tasks_enabled"` // Enables advanced TUI tasks workflow
}
type AgentReviewType ¶ added in v0.40.0
AgentReviewType pairs an agent name with a review type for the review matrix.
type CIConfig ¶ added in v0.26.0
type CIConfig struct {
// Enabled enables the CI poller
Enabled bool `toml:"enabled"`
// PollInterval is how often to poll for PRs (e.g., "5m", "10m"). Default: 5m
PollInterval string `toml:"poll_interval"`
// Repos is the list of GitHub repos to poll in "owner/repo" format.
// Supports glob patterns (e.g., "myorg/*", "myorg/api-*") using path.Match syntax.
// The owner part must be literal — no wildcards before the "/".
Repos []string `toml:"repos"`
// ExcludeRepos is a list of glob patterns to exclude from the resolved repo list.
// Applies to both exact entries and wildcard-expanded entries.
ExcludeRepos []string `toml:"exclude_repos"`
// MaxRepos is a safety cap on the total number of expanded repos. Default: 100.
MaxRepos int `toml:"max_repos"`
// ReviewTypes is the list of review types to run for each PR (e.g., ["security", "default"]).
// Defaults to ["security"] if empty.
ReviewTypes []string `toml:"review_types"`
// Agents is the list of agents to run for each PR (e.g., ["codex", "gemini"]).
// Defaults to auto-detection if empty.
Agents []string `toml:"agents"`
// Reviews maps agent names to review type lists. When set, replaces
// the ReviewTypes x Agents cross-product with a granular matrix.
// Example: {"codex": ["security", "review"], "gemini": ["review"]}
Reviews map[string][]string `toml:"reviews"`
// ThrottleInterval is the minimum time between reviews of the same PR.
// If a PR was reviewed within this interval, new pushes are deferred.
// Default: "1h". Set to "0" to disable throttling.
ThrottleInterval string `toml:"throttle_interval"`
// ThrottleBypassUsers is a list of GitHub usernames whose PRs
// bypass the throttle interval and are always reviewed immediately.
ThrottleBypassUsers []string `toml:"throttle_bypass_users"`
// Model overrides the model for CI reviews (empty = use workflow resolution)
Model string `toml:"model"`
// SynthesisAgent is the agent used to synthesize multiple review outputs into one comment.
// Defaults to the first available agent.
SynthesisAgent string `toml:"synthesis_agent"`
// SynthesisBackupAgent is tried when the primary synthesis
// agent fails. Empty means no backup — failures fall through
// to raw formatting.
SynthesisBackupAgent string `toml:"synthesis_backup_agent"`
// SynthesisModel overrides the model used for synthesis.
SynthesisModel string `toml:"synthesis_model"`
// MinSeverity filters out findings below this severity level during synthesis.
// Valid values: critical, high, medium, low. Empty means no filter (include all).
MinSeverity string `toml:"min_severity"`
// UpsertComments enables updating existing PR comments instead of
// creating new ones. When true, roborev searches for its marker
// comment and patches it. Default: false (create a new comment each run).
UpsertComments bool `toml:"upsert_comments"`
// GitHub App authentication (optional — comments appear as bot instead of personal account)
GitHubAppConfig
}
CIConfig holds configuration for the CI poller that watches GitHub PRs
func (*CIConfig) IsThrottleBypassed ¶ added in v0.40.0
IsThrottleBypassed reports whether the given GitHub login is in the ThrottleBypassUsers list. Comparison is case-insensitive.
func (*CIConfig) ResolvedAgents ¶ added in v0.26.0
ResolvedAgents returns the list of agents to use. Defaults to [""] (empty = auto-detect) if empty.
func (*CIConfig) ResolvedMaxRepos ¶ added in v0.36.0
ResolvedMaxRepos returns the maximum number of repos to poll. Defaults to 100 if not set or non-positive.
func (*CIConfig) ResolvedReviewMatrix ¶ added in v0.40.0
func (c *CIConfig) ResolvedReviewMatrix() []AgentReviewType
ResolvedReviewMatrix returns (agent, reviewType) pairs. If Reviews is set, uses it directly. Otherwise falls back to the cross-product of ResolvedAgents() x ResolvedReviewTypes().
func (*CIConfig) ResolvedReviewTypes ¶ added in v0.26.0
ResolvedReviewTypes returns the list of review types to use. Defaults to ["security"] if empty.
func (*CIConfig) ResolvedThrottleInterval ¶ added in v0.40.0
ResolvedThrottleInterval returns the minimum time between reviews of the same PR. Defaults to 1h if empty or unparseable. Returns 0 (disabled) if explicitly set to "0".
type Config ¶
type Config struct {
ServerAddr string `toml:"server_addr"`
MaxWorkers int `toml:"max_workers"`
ReviewContextCount int `toml:"review_context_count"`
DefaultAgent string `toml:"default_agent"`
DefaultModel string `toml:"default_model"` // Default model for agents (format varies by agent)
DefaultBackupAgent string `toml:"default_backup_agent"`
DefaultBackupModel string `toml:"default_backup_model"`
JobTimeoutMinutes int `toml:"job_timeout_minutes"`
// Workflow-specific agent/model configuration
ReviewAgent string `toml:"review_agent"`
ReviewAgentFast string `toml:"review_agent_fast"`
ReviewAgentStandard string `toml:"review_agent_standard"`
ReviewAgentThorough string `toml:"review_agent_thorough"`
RefineAgent string `toml:"refine_agent"`
RefineAgentFast string `toml:"refine_agent_fast"`
RefineAgentStandard string `toml:"refine_agent_standard"`
RefineAgentThorough string `toml:"refine_agent_thorough"`
ReviewModel string `toml:"review_model"`
ReviewModelFast string `toml:"review_model_fast"`
ReviewModelStandard string `toml:"review_model_standard"`
ReviewModelThorough string `toml:"review_model_thorough"`
RefineModel string `toml:"refine_model"`
RefineModelFast string `toml:"refine_model_fast"`
RefineModelStandard string `toml:"refine_model_standard"`
RefineModelThorough string `toml:"refine_model_thorough"`
FixAgent string `toml:"fix_agent"`
FixAgentFast string `toml:"fix_agent_fast"`
FixAgentStandard string `toml:"fix_agent_standard"`
FixAgentThorough string `toml:"fix_agent_thorough"`
FixModel string `toml:"fix_model"`
FixModelFast string `toml:"fix_model_fast"`
FixModelStandard string `toml:"fix_model_standard"`
FixModelThorough string `toml:"fix_model_thorough"`
SecurityAgent string `toml:"security_agent"`
SecurityAgentFast string `toml:"security_agent_fast"`
SecurityAgentStandard string `toml:"security_agent_standard"`
SecurityAgentThorough string `toml:"security_agent_thorough"`
SecurityModel string `toml:"security_model"`
SecurityModelFast string `toml:"security_model_fast"`
SecurityModelStandard string `toml:"security_model_standard"`
SecurityModelThorough string `toml:"security_model_thorough"`
DesignAgent string `toml:"design_agent"`
DesignAgentFast string `toml:"design_agent_fast"`
DesignAgentStandard string `toml:"design_agent_standard"`
DesignAgentThorough string `toml:"design_agent_thorough"`
DesignModel string `toml:"design_model"`
DesignModelFast string `toml:"design_model_fast"`
DesignModelStandard string `toml:"design_model_standard"`
DesignModelThorough string `toml:"design_model_thorough"`
// Backup agents for failover
ReviewBackupAgent string `toml:"review_backup_agent"`
RefineBackupAgent string `toml:"refine_backup_agent"`
FixBackupAgent string `toml:"fix_backup_agent"`
SecurityBackupAgent string `toml:"security_backup_agent"`
DesignBackupAgent string `toml:"design_backup_agent"`
// Backup models for failover (used when failing over to backup agent)
ReviewBackupModel string `toml:"review_backup_model"`
RefineBackupModel string `toml:"refine_backup_model"`
FixBackupModel string `toml:"fix_backup_model"`
SecurityBackupModel string `toml:"security_backup_model"`
DesignBackupModel string `toml:"design_backup_model"`
AllowUnsafeAgents *bool `toml:"allow_unsafe_agents"` // nil = not set, allows commands to choose their own default
// Agent commands
CodexCmd string `toml:"codex_cmd"`
ClaudeCodeCmd string `toml:"claude_code_cmd"`
CursorCmd string `toml:"cursor_cmd"`
PiCmd string `toml:"pi_cmd"`
// API keys (optional - agents use subscription auth by default)
AnthropicAPIKey string `toml:"anthropic_api_key" sensitive:"true"`
// Hooks configuration
Hooks []HookConfig `toml:"hooks"`
// Sync configuration for PostgreSQL
Sync SyncConfig `toml:"sync"`
// CI poller configuration
CI CIConfig `toml:"ci"`
// Analysis settings
DefaultMaxPromptSize int `toml:"default_max_prompt_size"` // Max prompt size in bytes before falling back to paths (default: 200KB)
// UI preferences
HideClosedByDefault bool `toml:"hide_closed_by_default"`
HideAddressedByDefault bool `toml:"hide_addressed_by_default"` // deprecated: use hide_closed_by_default
AutoFilterRepo bool `toml:"auto_filter_repo"`
TabWidth int `toml:"tab_width"` // Tab expansion width for TUI rendering (default: 2)
HiddenColumns []string `toml:"hidden_columns"` // Column names to hide in queue table (e.g. ["branch", "agent"])
ColumnBorders bool `toml:"column_borders"` // Show ▕ separators between columns
ColumnOrder []string `toml:"column_order"` // Custom queue column display order
TaskColumnOrder []string `toml:"task_column_order"` // Custom task column display order
// Advanced feature flags
Advanced AdvancedConfig `toml:"advanced"`
// ACP (Agent Client Protocol) configuration
ACP *ACPAgentConfig `toml:"acp"`
}
Config holds the daemon configuration
func LoadGlobal ¶
LoadGlobal loads the global configuration from the default path
func LoadGlobalFrom ¶
LoadGlobalFrom loads the global configuration from a specific path
type ConfigParseError ¶ added in v0.33.0
ConfigParseError is returned when .roborev.toml exists but contains invalid TOML. Callers can check with errors.As.
func (*ConfigParseError) Error ¶ added in v0.33.0
func (e *ConfigParseError) Error() string
func (*ConfigParseError) Unwrap ¶ added in v0.33.0
func (e *ConfigParseError) Unwrap() error
type GitHubAppConfig ¶ added in v0.31.0
type GitHubAppConfig struct {
GitHubAppID int64 `toml:"github_app_id"`
GitHubAppPrivateKey string `toml:"github_app_private_key" sensitive:"true"` // PEM file path or inline; supports ${ENV_VAR}
GitHubAppInstallationID int64 `toml:"github_app_installation_id"`
// Multi-installation: map of owner → installation_id
GitHubAppInstallations map[string]int64 `toml:"github_app_installations"`
}
GitHubAppConfig holds GitHub App authentication settings. Extracted from CIConfig for cohesion; embedded so TOML keys remain flat under [ci].
func (*GitHubAppConfig) GitHubAppConfigured ¶ added in v0.31.0
func (c *GitHubAppConfig) GitHubAppConfigured() bool
GitHubAppConfigured returns true if GitHub App authentication can be used. Requires app ID, private key, and at least one installation ID (singular or map).
func (*GitHubAppConfig) GitHubAppPrivateKeyResolved ¶ added in v0.31.0
func (c *GitHubAppConfig) GitHubAppPrivateKeyResolved() (string, error)
GitHubAppPrivateKeyResolved expands env vars in the private key value, reads the file if it's a path, and returns the PEM content.
func (*GitHubAppConfig) InstallationIDForOwner ¶ added in v0.31.0
func (c *GitHubAppConfig) InstallationIDForOwner(owner string) int64
InstallationIDForOwner returns the installation ID for a GitHub owner. Checks the normalized installations map first (skipping non-positive values), then falls back to the singular field. Owner comparison is case-insensitive.
func (*GitHubAppConfig) NormalizeInstallations ¶ added in v0.31.0
func (c *GitHubAppConfig) NormalizeInstallations() error
NormalizeInstallations lowercases all keys in GitHubAppInstallations so lookups are case-insensitive via direct map access. Returns an error if two keys collide after lowercasing (e.g., "wesm" and "Wesm").
type HookConfig ¶ added in v0.22.0
type HookConfig struct {
Event string `toml:"event"` // "review.failed", "review.completed", "review.*"
Command string `toml:"command"` // shell command with {var} templates
Type string `toml:"type"` // "beads" for built-in, empty for command
}
HookConfig defines a hook that runs on review events
type KeyValue ¶ added in v0.31.0
KeyValue represents a config key and its value
func ListConfigKeys ¶ added in v0.31.0
ListConfigKeys returns all non-zero values from a config struct as key-value pairs.
type KeyValueOrigin ¶ added in v0.31.0
type KeyValueOrigin struct {
Key string
Value string
Origin string // "global", "local", "default"
}
KeyValueOrigin represents a config key, its value, and where it came from
func MergedConfigWithOrigin ¶ added in v0.31.0
func MergedConfigWithOrigin(global *Config, repo *RepoConfig, rawGlobal, rawRepo map[string]any) []KeyValueOrigin
MergedConfigWithOrigin returns all effective config values with their origin. global is the loaded global config (already has defaults applied by LoadGlobal). repo is the loaded repo config (nil if no .roborev.toml). rawGlobal and rawRepo are raw TOML maps for detecting explicit presence of false/0 values. Pass nil if not available.
type RepoCIConfig ¶ added in v0.26.0
type RepoCIConfig struct {
// Agents overrides the list of agents for CI reviews of this repo.
Agents []string `toml:"agents"`
// ReviewTypes overrides the list of review types for CI reviews of this repo.
ReviewTypes []string `toml:"review_types"`
// Reviews maps agent names to review type lists. When set, replaces
// the ReviewTypes x Agents cross-product for this repo.
Reviews map[string][]string `toml:"reviews"`
// Reasoning overrides the reasoning level for CI reviews (thorough, standard, fast).
Reasoning string `toml:"reasoning"`
// MinSeverity overrides the minimum severity filter for CI synthesis.
MinSeverity string `toml:"min_severity"`
// UpsertComments overrides the global ci.upsert_comments setting.
// Use a pointer so we can distinguish "not set" from "explicitly false".
UpsertComments *bool `toml:"upsert_comments"`
}
RepoCIConfig holds per-repo CI overrides (used by the CI poller for this repo). These override the global [ci] settings when reviewing this specific repo.
func (*RepoCIConfig) ResolvedReviewMatrix ¶ added in v0.40.0
func (c *RepoCIConfig) ResolvedReviewMatrix() []AgentReviewType
ResolvedReviewMatrixForRepo returns the review matrix for a RepoCIConfig. If Reviews is set, uses it directly. Otherwise falls back to the cross-product of Agents x ReviewTypes (which may be empty, meaning "use global").
type RepoConfig ¶
type RepoConfig struct {
Agent string `toml:"agent"`
Model string `toml:"model"` // Model for agents (format varies by agent)
BackupAgent string `toml:"backup_agent"`
BackupModel string `toml:"backup_model"`
ReviewContextCount int `toml:"review_context_count"`
ReviewGuidelines string `toml:"review_guidelines"`
JobTimeoutMinutes int `toml:"job_timeout_minutes"`
ExcludedBranches []string `toml:"excluded_branches"`
DisplayName string `toml:"display_name"`
ReviewReasoning string `toml:"review_reasoning"` // Reasoning level for reviews: thorough, standard, fast
RefineReasoning string `toml:"refine_reasoning"` // Reasoning level for refine: thorough, standard, fast
FixReasoning string `toml:"fix_reasoning"` // Reasoning level for fix: thorough, standard, fast
// CI-specific overrides (used by CI poller for this repo)
CI RepoCIConfig `toml:"ci"`
// Workflow-specific agent/model configuration
ReviewAgent string `toml:"review_agent"`
ReviewAgentFast string `toml:"review_agent_fast"`
ReviewAgentStandard string `toml:"review_agent_standard"`
ReviewAgentThorough string `toml:"review_agent_thorough"`
RefineAgent string `toml:"refine_agent"`
RefineAgentFast string `toml:"refine_agent_fast"`
RefineAgentStandard string `toml:"refine_agent_standard"`
RefineAgentThorough string `toml:"refine_agent_thorough"`
ReviewModel string `toml:"review_model"`
ReviewModelFast string `toml:"review_model_fast"`
ReviewModelStandard string `toml:"review_model_standard"`
ReviewModelThorough string `toml:"review_model_thorough"`
RefineModel string `toml:"refine_model"`
RefineModelFast string `toml:"refine_model_fast"`
RefineModelStandard string `toml:"refine_model_standard"`
RefineModelThorough string `toml:"refine_model_thorough"`
FixAgent string `toml:"fix_agent"`
FixAgentFast string `toml:"fix_agent_fast"`
FixAgentStandard string `toml:"fix_agent_standard"`
FixAgentThorough string `toml:"fix_agent_thorough"`
FixModel string `toml:"fix_model"`
FixModelFast string `toml:"fix_model_fast"`
FixModelStandard string `toml:"fix_model_standard"`
FixModelThorough string `toml:"fix_model_thorough"`
SecurityAgent string `toml:"security_agent"`
SecurityAgentFast string `toml:"security_agent_fast"`
SecurityAgentStandard string `toml:"security_agent_standard"`
SecurityAgentThorough string `toml:"security_agent_thorough"`
SecurityModel string `toml:"security_model"`
SecurityModelFast string `toml:"security_model_fast"`
SecurityModelStandard string `toml:"security_model_standard"`
SecurityModelThorough string `toml:"security_model_thorough"`
DesignAgent string `toml:"design_agent"`
DesignAgentFast string `toml:"design_agent_fast"`
DesignAgentStandard string `toml:"design_agent_standard"`
DesignAgentThorough string `toml:"design_agent_thorough"`
DesignModel string `toml:"design_model"`
DesignModelFast string `toml:"design_model_fast"`
DesignModelStandard string `toml:"design_model_standard"`
DesignModelThorough string `toml:"design_model_thorough"`
// Backup agents for failover
ReviewBackupAgent string `toml:"review_backup_agent"`
RefineBackupAgent string `toml:"refine_backup_agent"`
FixBackupAgent string `toml:"fix_backup_agent"`
SecurityBackupAgent string `toml:"security_backup_agent"`
DesignBackupAgent string `toml:"design_backup_agent"`
// Backup models for failover (used when failing over to backup agent)
ReviewBackupModel string `toml:"review_backup_model"`
RefineBackupModel string `toml:"refine_backup_model"`
FixBackupModel string `toml:"fix_backup_model"`
SecurityBackupModel string `toml:"security_backup_model"`
DesignBackupModel string `toml:"design_backup_model"`
// Hooks configuration (per-repo)
Hooks []HookConfig `toml:"hooks"`
// Analysis settings
MaxPromptSize int `toml:"max_prompt_size"` // Max prompt size in bytes before falling back to paths (overrides global default)
}
RepoConfig holds per-repo overrides
func LoadRepoConfig ¶
func LoadRepoConfig(repoPath string) (*RepoConfig, error)
LoadRepoConfig loads per-repo config from .roborev.toml
func LoadRepoConfigFromRef ¶ added in v0.33.0
func LoadRepoConfigFromRef(repoPath, ref string) (*RepoConfig, error)
LoadRepoConfigFromRef loads per-repo config from .roborev.toml at a specific git ref (e.g., a commit SHA or "origin/main"). Returns (nil, nil) if the file doesn't exist at that ref. Returns an error for unexpected git failures (bad repo, corrupted objects, etc.).
type SyncConfig ¶
type SyncConfig struct {
// Enabled enables sync to PostgreSQL
Enabled bool `toml:"enabled"`
// PostgresURL is the connection string for PostgreSQL.
// Supports environment variable expansion via ${VAR} syntax.
PostgresURL string `toml:"postgres_url" sensitive:"true"`
// Interval is how often to sync (e.g., "5m", "1h"). Default: 1h
Interval string `toml:"interval"`
// MachineName is a friendly name for this machine (optional)
MachineName string `toml:"machine_name"`
// ConnectTimeout is the connection timeout (e.g., "5s"). Default: 5s
ConnectTimeout string `toml:"connect_timeout"`
// RepoNames provides custom display names for synced repos by identity.
// Example: {"git@github.com:org/repo.git": "my-project"}
RepoNames map[string]string `toml:"repo_names"`
}
SyncConfig holds configuration for PostgreSQL sync
func (*SyncConfig) GetRepoDisplayName ¶ added in v0.18.0
func (c *SyncConfig) GetRepoDisplayName(identity string) string
GetRepoDisplayName returns the configured display name for a repo identity, or empty string if no override is configured.
func (*SyncConfig) PostgresURLExpanded ¶
func (c *SyncConfig) PostgresURLExpanded() string
PostgresURLExpanded returns the PostgreSQL URL with environment variables expanded. Returns empty string if URL is not set.
func (*SyncConfig) Validate ¶
func (c *SyncConfig) Validate() []string
Validate checks the sync configuration for common issues. Returns a list of warnings (non-fatal issues).