config

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVersion  = 1
	DefaultIDLength = 3

	// Default values for context configuration.
	DefaultContextMaxTokens       = 4000
	DefaultContextAutoRefreshDays = 0
	DefaultContextTimeout         = 5 * time.Minute
)
View Source
const (
	DefaultMaxAttempts             = 3
	DefaultMaxNoProgressAttempts   = 2
	DefaultMaxSameVerifierFailures = 2
	DefaultRequireCommit           = false
	DefaultRequireVerifiersForPrio = 0
	DefaultSandbox                 = false
	DefaultAutonomousMode          = false
)

Default policy values.

Variables

This section is empty.

Functions

func Save

func Save(path string, cfg Config) error

Save writes a config to disk.

Types

type AgentConfig added in v0.12.2

type AgentConfig struct {
	// Backend selects the agent backend: "claude" (default, direct CLI) or "acp".
	// When "acp", the agent is launched as an ACP subprocess using the Name field.
	Backend *string `json:"backend,omitempty"`

	// Name is the ACP agent name (e.g., "claude", "codex", "gemini").
	// Only used when Backend is "acp". Defaults to "claude".
	Name *string `json:"name,omitempty"`

	// Command overrides the default ACP launch command for the agent.
	// Only used when Backend is "acp". Example: ["npx", "my-custom-acp-agent"].
	Command []string `json:"command,omitempty"`
}

AgentConfig holds agent selection and configuration.

func (*AgentConfig) GetBackend added in v0.12.2

func (c *AgentConfig) GetBackend() string

GetBackend returns the agent backend (default "claude").

func (*AgentConfig) GetCommand added in v0.12.2

func (c *AgentConfig) GetCommand() []string

GetCommand returns the custom ACP launch command, or nil for default.

func (*AgentConfig) GetName added in v0.12.2

func (c *AgentConfig) GetName() string

GetName returns the ACP agent name (default "claude").

type Config

type Config struct {
	Version      int                 `json:"version"`
	IDLength     int                 `json:"id_length"`
	Agent        *AgentConfig        `json:"agent,omitempty"`
	Verification *VerificationConfig `json:"verification,omitempty"`
	Context      *ContextConfig      `json:"context,omitempty"`
	Policy       *PolicyConfig       `json:"policy,omitempty"`
}

Config defines project configuration stored in .tick/config.json.

func Default

func Default() Config

Default returns the default config.

func Load

func Load(path string) (Config, error)

Load reads config from disk and applies defaults for zero values.

func LoadOrDefault added in v0.4.0

func LoadOrDefault(path string) (Config, error)

LoadOrDefault reads config from disk, returning defaults if file doesn't exist.

func (Config) Validate

func (c Config) Validate() error

Validate ensures config values are within supported ranges.

type ContextConfig added in v0.4.0

type ContextConfig struct {
	// Enabled controls whether context generation runs (default true).
	Enabled *bool `json:"enabled,omitempty"`

	// MaxTokens is the target size for context documents (default 4000).
	MaxTokens *int `json:"max_tokens,omitempty"`

	// AutoRefreshDays is how many days until auto-refresh (default 0 = never).
	AutoRefreshDays *int `json:"auto_refresh_days,omitempty"`

	// GenerationTimeout is the max duration for generation as a string (default "5m").
	GenerationTimeout *string `json:"generation_timeout,omitempty"`

	// GenerationModel overrides the model used for generation (default "" = use default agent).
	GenerationModel *string `json:"generation_model,omitempty"`
}

ContextConfig holds context generation configuration.

func (*ContextConfig) GetAutoRefreshDays added in v0.4.0

func (c *ContextConfig) GetAutoRefreshDays() int

GetAutoRefreshDays returns the auto-refresh days setting (default 0).

func (*ContextConfig) GetGenerationModel added in v0.4.0

func (c *ContextConfig) GetGenerationModel() string

GetGenerationModel returns the generation model override (default "").

func (*ContextConfig) GetGenerationTimeout added in v0.4.0

func (c *ContextConfig) GetGenerationTimeout() time.Duration

GetGenerationTimeout returns the generation timeout (default 5m).

func (*ContextConfig) GetMaxTokens added in v0.4.0

func (c *ContextConfig) GetMaxTokens() int

GetMaxTokens returns the max tokens setting (default 4000).

func (*ContextConfig) IsEnabled added in v0.4.0

func (c *ContextConfig) IsEnabled() bool

IsEnabled returns whether context generation is enabled (default true).

func (*ContextConfig) Validate added in v0.4.0

func (c *ContextConfig) Validate() error

ValidateContext checks that context config values are within sensible ranges.

type PolicyConfig added in v0.12.2

type PolicyConfig struct {
	// MaxAttempts is the maximum number of attempts per task (default 3).
	// After this many attempts, the task is marked as stuck.
	MaxAttempts *int `json:"max_attempts,omitempty"`

	// MaxNoProgressAttempts is how many consecutive attempts without
	// measurable progress before the task is marked stuck (default 2).
	MaxNoProgressAttempts *int `json:"max_no_progress_attempts,omitempty"`

	// MaxSameVerifierFailures is how many times the same verifier command
	// can fail before the task is escalated (default 2).
	MaxSameVerifierFailures *int `json:"max_same_verifier_failures,omitempty"`

	// RequireCommit controls whether the agent must produce at least one
	// git commit for a task to be considered complete (default false).
	RequireCommit *bool `json:"require_commit,omitempty"`

	// RequireVerifiersForPriority is the minimum priority level (1=highest)
	// at or above which verifier commands must pass for task closure.
	// 0 means disabled (default). Example: 2 means P1 and P2 tasks require
	// passing verifiers.
	RequireVerifiersForPriority *int `json:"require_verifiers_for_priority,omitempty"`

	// Sandbox controls whether agents run in a sandboxed environment
	// (default false). When true, filesystem and network access may be
	// restricted.
	Sandbox *bool `json:"sandbox,omitempty"`

	// AutonomousMode controls whether the run is fully autonomous (default
	// false). When true, a project-checkpoint boundary (a tick whose only
	// reason to be gated is awaiting: checkpoint) no longer halts continuation
	// — the orchestrator flows through the project boundary without waiting for
	// a human. It NEVER bypasses any other awaiting type: approval, input,
	// review, content, escalation, and work always gate.
	AutonomousMode *bool `json:"autonomous_mode,omitempty"`

	// SecretsExposure controls how secrets are made available to agents
	// (default "none"). Valid values: "none", "env", "file".
	SecretsExposure *SecretsExposure `json:"secrets_exposure,omitempty"`
}

PolicyConfig holds Tickflow run policy controls. These are supervisor-level constraints that govern persistence, retries, and verification behavior during autonomous runs.

func (*PolicyConfig) GetAutonomousMode added in v0.18.0

func (p *PolicyConfig) GetAutonomousMode() bool

GetAutonomousMode returns whether autonomous mode is enabled (default false). When enabled, project-checkpoint boundaries no longer gate continuation; no other awaiting type is affected.

func (*PolicyConfig) GetMaxAttempts added in v0.12.2

func (p *PolicyConfig) GetMaxAttempts() int

GetMaxAttempts returns the max attempts per task (default 3).

func (*PolicyConfig) GetMaxNoProgressAttempts added in v0.12.2

func (p *PolicyConfig) GetMaxNoProgressAttempts() int

GetMaxNoProgressAttempts returns the max no-progress attempts (default 2).

func (*PolicyConfig) GetMaxSameVerifierFailures added in v0.12.2

func (p *PolicyConfig) GetMaxSameVerifierFailures() int

GetMaxSameVerifierFailures returns the max same-verifier failures (default 2).

func (*PolicyConfig) GetRequireCommit added in v0.12.2

func (p *PolicyConfig) GetRequireCommit() bool

GetRequireCommit returns whether commits are required (default false).

func (*PolicyConfig) GetRequireVerifiersForPriority added in v0.12.2

func (p *PolicyConfig) GetRequireVerifiersForPriority() int

GetRequireVerifiersForPriority returns the priority threshold (default 0/disabled).

func (*PolicyConfig) GetSandbox added in v0.12.2

func (p *PolicyConfig) GetSandbox() bool

GetSandbox returns whether sandbox mode is enabled (default false).

func (*PolicyConfig) GetSecretsExposure added in v0.12.2

func (p *PolicyConfig) GetSecretsExposure() SecretsExposure

GetSecretsExposure returns the secrets exposure mode (default "none").

func (*PolicyConfig) Validate added in v0.12.2

func (p *PolicyConfig) Validate() error

Validate checks that policy config values are within sensible ranges.

type SecretsExposure added in v0.12.2

type SecretsExposure string

SecretsExposure controls how secrets are made available to agents.

const (
	// SecretsExposureNone means no secrets are exposed (default, safest).
	SecretsExposureNone SecretsExposure = "none"

	// SecretsExposureEnv exposes secrets via environment variables.
	SecretsExposureEnv SecretsExposure = "env"

	// SecretsExposureFile writes secrets to a temporary file.
	SecretsExposureFile SecretsExposure = "file"
)

type VerificationConfig added in v0.4.0

type VerificationConfig struct {
	// Enabled controls whether verification runs (default true).
	Enabled *bool `json:"enabled,omitempty"`
}

VerificationConfig holds verification settings.

func (*VerificationConfig) IsEnabled added in v0.4.0

func (c *VerificationConfig) IsEnabled() bool

IsEnabled returns whether verification is enabled (default true).

Jump to

Keyboard shortcuts

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