Documentation
¶
Overview ¶
Package settings provides configuration loading for Entire. This package is separate from cli to allow strategy package to import it without creating an import cycle (cli imports strategy).
Index ¶
- Constants
- func CheckpointsVersion(ctx context.Context) int
- func IsCheckpointsV2Enabled(ctx context.Context) bool
- func IsExternalAgentsEnabled(ctx context.Context) bool
- func IsFilteredFetchesEnabled(ctx context.Context) bool
- func IsPushV2RefsEnabled(ctx context.Context) bool
- func IsSetUp(ctx context.Context) bool
- func IsSetUpAndEnabled(ctx context.Context) bool
- func IsSetUpAny(ctx context.Context) bool
- func IsSignCheckpointCommitsEnabled(ctx context.Context) bool
- func IsSummarizeEnabled(ctx context.Context) bool
- func Save(ctx context.Context, settings *EntireSettings) error
- func SaveLocal(ctx context.Context, settings *EntireSettings) error
- type CheckpointRemoteConfig
- type EntireSettings
- func (s *EntireSettings) CheckpointsVersion() int
- func (s *EntireSettings) GetCheckpointRemote() *CheckpointRemoteConfig
- func (s *EntireSettings) GetCommitLinking() string
- func (s *EntireSettings) GetFullTranscriptGenerationRetentionDays() int
- func (s *EntireSettings) IsCheckpointsV2Enabled() bool
- func (s *EntireSettings) IsFilteredFetchesEnabled() bool
- func (s *EntireSettings) IsPushSessionsDisabled() bool
- func (s *EntireSettings) IsPushV2RefsEnabled() bool
- func (s *EntireSettings) IsSignCheckpointCommitsEnabled() bool
- func (s *EntireSettings) IsSummarizeEnabled() bool
- func (s *EntireSettings) SummaryTimeoutValue() time.Duration
- type PIISettings
- type RedactionSettings
- type SummaryGenerationSettings
Constants ¶
const ( // EntireSettingsFile is the path to the Entire settings file EntireSettingsFile = ".entire/settings.json" // EntireSettingsLocalFile is the path to the local settings override file (not committed) EntireSettingsLocalFile = ".entire/settings.local.json" )
const ( // CommitLinkingAlways auto-links commits to sessions without prompting. CommitLinkingAlways = "always" // CommitLinkingPrompt prompts the user on each commit (default for existing users). CommitLinkingPrompt = "prompt" )
Commit linking mode constants.
Variables ¶
This section is empty.
Functions ¶
func CheckpointsVersion ¶ added in v0.5.6
CheckpointsVersion returns the configured checkpoints format version, or 1 if settings cannot be loaded or the value is unset/invalid.
func IsCheckpointsV2Enabled ¶ added in v0.5.2
IsCheckpointsV2Enabled checks if checkpoints v2 is enabled in settings. Returns false by default if settings cannot be loaded or the key is missing.
func IsExternalAgentsEnabled ¶ added in v0.5.0
IsExternalAgentsEnabled checks if external agent discovery is enabled in settings. Returns false by default if settings cannot be loaded or the key is missing.
func IsFilteredFetchesEnabled ¶ added in v0.5.5
IsFilteredFetchesEnabled checks if filtered fetches should be used. When enabled, filtered fetches always resolve remote names to URLs first so git does not persist promisor settings onto named remotes in local config. Returns false by default.
func IsPushV2RefsEnabled ¶ added in v0.5.4
IsPushV2RefsEnabled checks if pushing v2 refs is enabled in settings. Returns false by default if settings cannot be loaded or flags are missing.
func IsSetUp ¶ added in v0.4.6
IsSetUp returns true if Entire has been set up in the current repository. This checks if .entire/settings.json exists. Use this to avoid creating files/directories in repos where Entire was never enabled.
func IsSetUpAndEnabled ¶ added in v0.4.6
IsSetUpAndEnabled returns true if Entire is both set up and enabled. This checks if .entire/settings.json exists AND has enabled: true. Use this for hooks that should be no-ops when Entire is not active.
func IsSetUpAny ¶ added in v0.5.1
IsSetUpAny returns true if Entire has been set up in the current repository, checking both .entire/settings.json and .entire/settings.local.json. Use this to detect any prior setup, even if only local settings exist.
func IsSignCheckpointCommitsEnabled ¶ added in v0.5.6
IsSignCheckpointCommitsEnabled checks if checkpoint commit signing is enabled in settings. Returns true by default if settings cannot be loaded or the key is missing.
func IsSummarizeEnabled ¶
IsSummarizeEnabled checks if auto-summarize is enabled in settings. Returns false by default if settings cannot be loaded or the key is missing.
Types ¶
type CheckpointRemoteConfig ¶ added in v0.5.1
type CheckpointRemoteConfig struct {
Provider string // e.g., "github"
Repo string // e.g., "org/checkpoints-repo"
}
CheckpointRemoteConfig holds the structured checkpoint remote configuration. Stored in strategy_options.checkpoint_remote as {"provider": "github", "repo": "org/repo"}.
func (*CheckpointRemoteConfig) Owner ¶ added in v0.5.1
func (c *CheckpointRemoteConfig) Owner() string
Owner returns the owner portion of the repo field (before the slash). Returns empty string if the repo field doesn't contain a slash.
type EntireSettings ¶
type EntireSettings struct {
// Enabled indicates whether Entire is active. When false, CLI commands
// show a disabled message and hooks exit silently. Defaults to true.
Enabled bool `json:"enabled"`
// LocalDev indicates whether to use "go run" instead of the "entire" binary
// This is used for development when the binary is not installed
LocalDev bool `json:"local_dev,omitempty"`
// LogLevel sets the logging verbosity (debug, info, warn, error).
// Can be overridden by ENTIRE_LOG_LEVEL environment variable.
// Defaults to "info".
LogLevel string `json:"log_level,omitempty"`
// StrategyOptions contains strategy-specific configuration
StrategyOptions map[string]any `json:"strategy_options,omitempty"`
// AbsoluteGitHookPath embeds the full binary path in git hooks instead of
// bare "entire". This is needed for GUI git clients (Xcode, Tower, etc.)
// that don't source shell profiles and can't find "entire" on PATH.
AbsoluteGitHookPath bool `json:"absolute_git_hook_path,omitempty"`
// Telemetry controls anonymous usage analytics.
// nil = not asked yet (show prompt), true = opted in, false = opted out
Telemetry *bool `json:"telemetry,omitempty"`
// Redaction configures PII redaction behavior for transcripts and metadata.
Redaction *RedactionSettings `json:"redaction,omitempty"`
// CommitLinking controls how commits are linked to agent sessions.
// "always" = auto-link without prompting, "prompt" = ask on each commit.
// Defaults to "prompt" (preserves existing user behavior).
CommitLinking string `json:"commit_linking,omitempty"`
// ExternalAgents enables discovery and registration of external agent
// plugins (entire-agent-* binaries on $PATH). Defaults to false.
ExternalAgents bool `json:"external_agents,omitempty"`
// SummaryGeneration stores provider preferences for explain --generate.
// This is separate from strategy_options.summarize, which controls
// checkpoint auto-summarize behavior.
SummaryGeneration *SummaryGenerationSettings `json:"summary_generation,omitempty"`
// Vercel indicates that the repository uses Vercel and the metadata branch
// should include a vercel.json that disables deployments for Entire branches.
Vercel bool `json:"vercel,omitempty"`
// SummaryTimeoutSeconds is an optional hard deadline (in seconds) for
// `entire explain --generate` summary generation. Zero or negative means
// "unset" -- the caller picks the default. Not yet consumed by the
// generate path; present so settings round-trip for a follow-up change
// that wires it into the deadline selection.
SummaryTimeoutSeconds int `json:"summary_timeout_seconds,omitempty"`
// SignCheckpointCommits controls whether checkpoint commits are signed.
// nil/true = sign (default), false = skip signing.
SignCheckpointCommits *bool `json:"sign_checkpoint_commits,omitempty"`
// Deprecated: no longer used. Exists to tolerate old settings files
// that still contain "strategy": "auto-commit" or similar.
Strategy string `json:"strategy,omitempty"`
}
EntireSettings represents the .entire/settings.json configuration
func Load ¶
func Load(ctx context.Context) (*EntireSettings, error)
Load loads the Entire settings from .entire/settings.json, then applies any overrides from .entire/settings.local.json if it exists. Returns default settings if neither file exists. Works correctly from any subdirectory within the repository.
func LoadFromBytes ¶ added in v0.5.4
func LoadFromBytes(data []byte) (*EntireSettings, error)
LoadFromBytes parses settings from raw JSON bytes without merging local overrides. Use this when you have settings content from a non-file source (e.g., git show).
func LoadFromFile ¶ added in v0.3.12
func LoadFromFile(filePath string) (*EntireSettings, error)
LoadFromFile loads settings from a specific file path without merging local overrides. Returns default settings if the file doesn't exist. Use this when you need to display individual settings files separately.
func (*EntireSettings) CheckpointsVersion ¶ added in v0.5.6
func (s *EntireSettings) CheckpointsVersion() int
CheckpointsVersion returns the configured checkpoints format version from strategy_options.checkpoints_version. Returns 1 when unset, invalid, or unsupported. The currently supported versions are 1 and 2.
func (*EntireSettings) GetCheckpointRemote ¶ added in v0.5.1
func (s *EntireSettings) GetCheckpointRemote() *CheckpointRemoteConfig
GetCheckpointRemote returns the configured checkpoint remote. Expects a structured object: {"provider": "github", "repo": "org/repo"}. Returns nil if not configured, wrong type, or missing required fields.
func (*EntireSettings) GetCommitLinking ¶ added in v0.4.8
func (s *EntireSettings) GetCommitLinking() string
GetCommitLinking returns the effective commit linking mode. Returns the explicit value if set, otherwise defaults to "prompt" to preserve existing user behavior.
func (*EntireSettings) GetFullTranscriptGenerationRetentionDays ¶ added in v0.5.6
func (s *EntireSettings) GetFullTranscriptGenerationRetentionDays() int
GetFullTranscriptGenerationRetentionDays returns the retention window for archived checkpoints v2 /full/* generations. Invalid, missing, or non-positive values fall back to the documented default.
func (*EntireSettings) IsCheckpointsV2Enabled ¶ added in v0.5.2
func (s *EntireSettings) IsCheckpointsV2Enabled() bool
IsCheckpointsV2Enabled checks if checkpoints v2 is enabled. Returns true when either checkpoints_v2 is set or checkpoints_version is 2.
func (*EntireSettings) IsFilteredFetchesEnabled ¶ added in v0.5.5
func (s *EntireSettings) IsFilteredFetchesEnabled() bool
IsFilteredFetchesEnabled checks if fetches should use --filter=blob:none. When enabled, filtered fetches always use resolved URLs rather than remote names to avoid persisting promisor settings onto named remotes.
func (*EntireSettings) IsPushSessionsDisabled ¶ added in v0.3.12
func (s *EntireSettings) IsPushSessionsDisabled() bool
IsPushSessionsDisabled checks if push_sessions is disabled in settings. Returns true if push_sessions is explicitly set to false.
func (*EntireSettings) IsPushV2RefsEnabled ¶ added in v0.5.4
func (s *EntireSettings) IsPushV2RefsEnabled() bool
IsPushV2RefsEnabled checks if pushing v2 refs is enabled. checkpoints_version: 2 forces v2 ref pushes on, regardless of push_v2_refs.
func (*EntireSettings) IsSignCheckpointCommitsEnabled ¶ added in v0.5.6
func (s *EntireSettings) IsSignCheckpointCommitsEnabled() bool
IsSignCheckpointCommitsEnabled returns true if checkpoint commits should be signed. Defaults to true when the setting is not explicitly set.
func (*EntireSettings) IsSummarizeEnabled ¶
func (s *EntireSettings) IsSummarizeEnabled() bool
IsSummarizeEnabled checks if auto-summarize is enabled in this settings instance.
func (*EntireSettings) SummaryTimeoutValue ¶ added in v0.5.6
func (s *EntireSettings) SummaryTimeoutValue() time.Duration
SummaryTimeoutValue returns the configured hard deadline for `entire explain --generate` summary generation. Zero means "unset" -- the caller picks the default. Negative values are treated as unset.
type PIISettings ¶ added in v0.5.1
type PIISettings struct {
Enabled bool `json:"enabled"`
Email *bool `json:"email,omitempty"`
Phone *bool `json:"phone,omitempty"`
Address *bool `json:"address,omitempty"`
CustomPatterns map[string]string `json:"custom_patterns,omitempty"`
}
PIISettings configures PII detection categories. When Enabled is true, email and phone default to true; address defaults to false.
type RedactionSettings ¶ added in v0.5.1
type RedactionSettings struct {
PII *PIISettings `json:"pii,omitempty"`
}
RedactionSettings configures redaction behavior beyond the default secret detection.
type SummaryGenerationSettings ¶ added in v0.5.6
type SummaryGenerationSettings struct {
// Provider is the selected summary provider agent name
// (for example "claude-code", "codex", or "gemini").
Provider string `json:"provider,omitempty"`
// Model is an optional model hint passed to the selected provider.
Model string `json:"model,omitempty"`
}
SummaryGenerationSettings configures provider selection for on-demand checkpoint summaries generated by explain --generate.
func (*SummaryGenerationSettings) SetProvider ¶ added in v0.5.6
func (s *SummaryGenerationSettings) SetProvider(newProvider, newModel string)
SetProvider updates the provider and optionally the model, clearing any stale model from the previous provider when switching without a replacement. An empty newProvider preserves the current provider; an empty newModel preserves the current model unless the provider is changing, in which case the old model is cleared to avoid passing (say) a Claude model to Codex.
func (*SummaryGenerationSettings) Validate ¶ added in v0.5.6
func (s *SummaryGenerationSettings) Validate() error
Validate returns an error if the settings combination is semantically invalid. A model without a provider is meaningless: the model hint needs a provider to route to. The load path calls Validate() after merging, catching hand-edited files that land in this state.