internal/adapters/config
import "github.com/nilstate/scafld/v2/internal/adapters/config"
Package config loads and merges scafld workspace configuration files.
Functions
func Default() Config
Source: internal/adapters/config/config.go:182
Default returns the built-in workspace configuration.
func DetectExecution(root string) ExecutionDetection
Source: internal/adapters/config/toolchain.go:22
DetectExecution infers safe PATH additions from checked-in toolchain files.
Detection is intentionally limited to version-manager shim directories. It does not run shell startup files or infer per-command state. Project config remains the place for explicit environment variables and policy.
func EffectiveExecution(root string, explicit ExecutionConfig) ExecutionConfig
Source: internal/adapters/config/toolchain.go:46
EffectiveExecution merges auto-detected toolchain shims behind explicit config. Explicit config paths appear first in PATH and explicit environment keys override detected values.
func Load(ctx context.Context, root string) (Config, error)
Source: internal/adapters/config/config.go:101
Load reads base config and local overrides from root.
Types
type Config
Source: internal/adapters/config/config.go:17
Config is the merged runtime configuration for a scafld workspace.
type Config struct {
Version string `yaml:"version"`
Invariants InvariantConfig `yaml:"invariants"`
LLM LLMConfig `yaml:"llm"`
Execution ExecutionConfig `yaml:"execution"`
Harden HardenConfig `yaml:"harden"`
Review ReviewConfig `yaml:"review"`
}Fields
Version string`yaml:"version"`Invariants InvariantConfig`yaml:"invariants"`LLM LLMConfig`yaml:"llm"`Execution ExecutionConfig`yaml:"execution"`Harden HardenConfig`yaml:"harden"`Review ReviewConfig`yaml:"review"`
type ExecutionConfig
Source: internal/adapters/config/config.go:37
ExecutionConfig controls the deterministic environment for acceptance commands.
type ExecutionConfig struct {
PathPrepend []string `yaml:"path_prepend"`
Env map[string]string `yaml:"env"`
AbsoluteTimeoutSeconds int `yaml:"absolute_timeout_seconds"`
IdleTimeoutSeconds int `yaml:"idle_timeout_seconds"`
}Fields
PathPrepend []string`yaml:"path_prepend"`Env map[string]string`yaml:"env"`AbsoluteTimeoutSeconds int`yaml:"absolute_timeout_seconds"`IdleTimeoutSeconds int`yaml:"idle_timeout_seconds"`
func AbsoluteTimeout() time.Duration
Source: internal/adapters/config/config.go:480
AbsoluteTimeout returns the configured per-acceptance-command wall clock cap.
func IdleTimeout() time.Duration
Source: internal/adapters/config/config.go:488
IdleTimeout returns the configured idle-output watchdog duration.
func ProcessEnv() []string
Source: internal/adapters/config/config.go:444
ProcessEnv returns stable process environment overrides for acceptance commands.
type ExecutionDetection
Source: internal/adapters/config/toolchain.go:12
ExecutionDetection records repo-declared toolchain hints that can make non-login acceptance shells behave like the checked-in project expects.
type ExecutionDetection struct {
Execution ExecutionConfig
Sources []string
}Fields
Execution ExecutionConfigSources []string
type ExternalReviewConfig
Source: internal/adapters/config/config.go:75
ExternalReviewConfig configures external model-provider review execution.
type ExternalReviewConfig struct {
Provider string `yaml:"provider"`
Command string `yaml:"command"`
ProviderBinary string `yaml:"provider_binary"`
IdleTimeoutSeconds int `yaml:"idle_timeout_seconds"`
AbsoluteMaxSeconds int `yaml:"absolute_max_seconds"`
FallbackPolicy string `yaml:"fallback_policy"`
Codex ProviderConfig `yaml:"codex"`
Claude ProviderConfig `yaml:"claude"`
Gemini ProviderConfig `yaml:"gemini"`
}Fields
Provider string`yaml:"provider"`Command string`yaml:"command"`ProviderBinary string`yaml:"provider_binary"`IdleTimeoutSeconds int`yaml:"idle_timeout_seconds"`AbsoluteMaxSeconds int`yaml:"absolute_max_seconds"`FallbackPolicy string`yaml:"fallback_policy"`Codex ProviderConfig`yaml:"codex"`Claude ProviderConfig`yaml:"claude"`Gemini ProviderConfig`yaml:"gemini"`
type HardenConfig
Source: internal/adapters/config/config.go:45
HardenConfig controls hardening prompt behavior.
type HardenConfig struct {
MaxIssuesPerRound int `yaml:"max_issues_per_round"`
ContextMaxBytes int `yaml:"context_max_bytes"`
External ExternalReviewConfig `yaml:"external"`
}Fields
MaxIssuesPerRound int`yaml:"max_issues_per_round"`ContextMaxBytes int`yaml:"context_max_bytes"`External ExternalReviewConfig`yaml:"external"`
type InvariantConfig
Source: internal/adapters/config/config.go:27
InvariantConfig names project-level invariant IDs available to specs.
type InvariantConfig struct {
Canonical map[string]string `yaml:"canonical"`
}Fields
Canonical map[string]string`yaml:"canonical"`
type LLMConfig
Source: internal/adapters/config/config.go:32
LLMConfig contains shared model-profile settings.
type LLMConfig struct {
ModelProfile string `yaml:"model_profile"`
}Fields
ModelProfile string`yaml:"model_profile"`
type ProviderConfig
Source: internal/adapters/config/config.go:88
ProviderConfig configures a named external provider implementation.
type ProviderConfig struct {
Model string `yaml:"model"`
Binary string `yaml:"binary"`
}Fields
Model string`yaml:"model"`Binary string`yaml:"binary"`
type ReviewConfig
Source: internal/adapters/config/config.go:52
ReviewConfig controls automated and adversarial review behavior.
type ReviewConfig struct {
External ExternalReviewConfig `yaml:"external"`
Context ReviewContextConfig `yaml:"context"`
Dossier ReviewDossierConfig `yaml:"dossier"`
AutomatedPasses map[string]ReviewPassConfig `yaml:"automated_passes"`
AdversarialPasses map[string]ReviewPassConfig `yaml:"adversarial_passes"`
}Fields
External ExternalReviewConfig`yaml:"external"`Context ReviewContextConfig`yaml:"context"`Dossier ReviewDossierConfig`yaml:"dossier"`AutomatedPasses map[string]ReviewPassConfig`yaml:"automated_passes"`AdversarialPasses map[string]ReviewPassConfig`yaml:"adversarial_passes"`
type ReviewContextConfig
Source: internal/adapters/config/config.go:69
ReviewContextConfig controls bounded project context sent to reviewers.
type ReviewContextConfig struct {
MaxBytes int `yaml:"max_bytes"`
Files []string `yaml:"files"`
}Fields
MaxBytes int`yaml:"max_bytes"`Files []string`yaml:"files"`
type ReviewDossierConfig
Source: internal/adapters/config/config.go:61
ReviewDossierConfig controls default review dossier budget and rerun behavior.
type ReviewDossierConfig struct {
MaxFindings int `yaml:"max_findings"`
MinAttackAngles int `yaml:"min_attack_angles"`
ReviewDepth string `yaml:"review_depth"`
RerunPolicy string `yaml:"rerun_policy"`
}Fields
MaxFindings int`yaml:"max_findings"`MinAttackAngles int`yaml:"min_attack_angles"`ReviewDepth string`yaml:"review_depth"`RerunPolicy string`yaml:"rerun_policy"`
type ReviewPassConfig
Source: internal/adapters/config/config.go:94
ReviewPassConfig describes one review pass in the review agenda.
type ReviewPassConfig struct {
Order int `yaml:"order"`
Title string `yaml:"title"`
Description string `yaml:"description"`
}Fields
Order int`yaml:"order"`Title string`yaml:"title"`Description string`yaml:"description"`
