constants

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package constants consolidates tunable system parameters: timeouts, intervals, retry counts, size limits, concurrency caps, and pagination defaults used across the wallfacer backend.

Package constants provides consolidated tunable system parameters used throughout wallfacer.

Rather than scattering magic numbers across packages, all timeouts, polling intervals, retry counts, size limits, concurrency caps, cache TTLs, and pagination defaults are defined here. This makes it easy to audit and adjust system behavior from a single location. Some values are declared as variables (not constants) to allow test overrides.

Connected packages

Consumed by nearly every internal package: [runner], [handler], [store], [cli], and [logger]. Changing a constant here has system-wide impact — verify all call sites before modifying a value. grep for the constant name to find all consumers.

Usage

timeout := constants.DefaultTaskTimeout
ticker := time.NewTicker(constants.AutoPromoteInterval)

Index

Constants

View Source
const (
	BodyLimitDefault      int64 = 1 << 20   // 1 MiB
	BodyLimitInstructions int64 = 5 << 20   // 5 MiB
	BodyLimitFeedback     int64 = 512 << 10 // 512 KiB
)

Request body size limits.

View Source
const (
	DefaultRetryHistoryLimit   = 10
	DefaultRefineSessionsLimit = 5
	DefaultPromptHistoryLimit  = 20
)

DefaultRetryHistoryLimit, DefaultRefineSessionsLimit, and DefaultPromptHistoryLimit cap the number of entries persisted for the three unboundedly-growing task slice fields.

View Source
const AutoPromoteInterval = 60 * time.Second

AutoPromoteInterval is the periodic ticker interval for the auto-promoter.

View Source
const AutoRefineInterval = 30 * time.Second

AutoRefineInterval is the polling interval for the auto-refine watcher.

View Source
const AutoSubmitInterval = 30 * time.Second

AutoSubmitInterval is the polling interval for the auto-submit watcher.

View Source
const AutoTestInterval = 30 * time.Second

AutoTestInterval is the polling interval for the auto-test watcher.

View Source
const ChurnLookbackDays = 90

ChurnLookbackDays only includes commits newer than this many days.

View Source
const CommitsBehindCacheTTL = 20 * time.Second

CommitsBehindCacheTTL is the time-to-live for cached CommitsBehind results.

View Source
const ContainerPollInterval = 5 * time.Second

ContainerPollInterval is the polling interval for container health monitoring.

View Source
const CurrentTaskSchemaVersion = 2

CurrentTaskSchemaVersion is the on-disk schema version for task.json.

View Source
const DefaultArchivedTasksPerPage = 20

DefaultArchivedTasksPerPage is the pagination size for archived task listings.

View Source
const DefaultCBThreshold = 5

DefaultCBThreshold is the number of consecutive container launch failures required to open the circuit breaker.

View Source
const DefaultIdeationExploitRatio = 0.8

DefaultIdeationExploitRatio is the default exploit/explore balance for ideation.

View Source
const DefaultIdeationImpactScore = 60

DefaultIdeationImpactScore is the default impact score threshold for ideation.

View Source
const DefaultIdeationInterval = 60 * time.Minute

DefaultIdeationInterval is the default interval between ideation brainstorm runs.

View Source
const DefaultMaxConcurrentTasks = 5

DefaultMaxConcurrentTasks is the default parallel task limit.

View Source
const DefaultMaxTestConcurrentTasks = 2

DefaultMaxTestConcurrentTasks is the default parallel test-run limit.

View Source
const DefaultMaxTurnOutputBytes = 8 * 1024 * 1024 // 8 MB

DefaultMaxTurnOutputBytes is the default per-turn stdout/stderr output size budget. Outputs exceeding this limit are truncated server-side.

View Source
const DefaultTaskTimeout = 60 * time.Minute

DefaultTaskTimeout is the default timeout for task execution.

View Source
const DefaultTombstoneRetentionDays = 7

DefaultTombstoneRetentionDays is the default number of days before pruning soft-deleted tasks.

View Source
const DefaultWorktreeGCInterval = 24 * time.Hour

DefaultWorktreeGCInterval is the interval between worktree garbage collection runs.

View Source
const DefaultWorktreeHealthInterval = 2 * time.Minute

DefaultWorktreeHealthInterval is the interval between worktree health checks.

View Source
const DiffCacheTTL = 10 * time.Second

DiffCacheTTL is the time-to-live for cached diff entries for non-terminal tasks.

View Source
const FetchErrorGracePeriod = 5 * time.Minute

FetchErrorGracePeriod is how long after a fetch error before retrying.

View Source
const FileIndexTTL = 30 * time.Second

FileIndexTTL is the time-to-live for a cached workspace file list.

View Source
const IdeaAgentDefaultTimeout = 60

IdeaAgentDefaultTimeout is the default timeout (minutes) for idea-agent task cards.

View Source
const LogValueMaxLen = 200

LogValueMaxLen is the maximum length for value truncation in pretty logging.

View Source
const MaxAutoRetries = 3

MaxAutoRetries is the global cap on automatic retries per task across all failure categories and retry paths (runner and handler).

View Source
const MaxBoardManifestBytes = 64 * 1024

MaxBoardManifestBytes is the maximum size for a board manifest JSON.

View Source
const MaxChurnCommits = 200

MaxChurnCommits is the hard cap so very active repos don't scan unboundedly.

View Source
const MaxCommitSubjectRunes = 72 - len("wallfacer: ")

MaxCommitSubjectRunes is the maximum number of runes allowed in the commit message subject line (after the "wallfacer: " prefix).

View Source
const MaxDiffBytes = 16000

MaxDiffBytes is the maximum number of bytes to include from the git diff in the test prompt.

View Source
const MaxFileListSize = 8000

MaxFileListSize caps the total number of files returned to keep responses fast.

View Source
const MaxIdeationChurnSignals = 6

MaxIdeationChurnSignals is the maximum number of churn signals collected.

View Source
const MaxIdeationIdeas = 3

MaxIdeationIdeas is the maximum number of ideas generated per ideation run.

View Source
const MaxIdeationTodoSignals = 6

MaxIdeationTodoSignals is the maximum number of TODO signals collected.

View Source
const MaxImmutableDiffEntries = 256

MaxImmutableDiffEntries caps the number of retained terminal-task diff entries.

View Source
const MaxOversightLogBytes = 40000

MaxOversightLogBytes caps the total log size to avoid exceeding prompt limits.

View Source
const MaxRebaseRetries = 3

MaxRebaseRetries is the maximum number of rebase attempts before giving up.

View Source
const MaxSearchResults = 50

MaxSearchResults caps the number of task search results returned.

View Source
const MaxTailLines = 15

MaxTailLines is the number of tail lines checked for test verdict detection.

View Source
const MaxTestFailRetries = 3

MaxTestFailRetries is the maximum number of consecutive test failures before the auto-resume cycle is halted.

View Source
const RefinementRecentCompleteWindow = 500 * time.Millisecond

RefinementRecentCompleteWindow is the grace window for clearing a refinement job that has just finished, allowing async startup/failure races to settle.

View Source
const RefinementTimeout = 30 * time.Minute

RefinementTimeout is the maximum time allowed for a refinement agent run.

View Source
const SnippetPadding = 60

SnippetPadding is the number of context characters shown on each side of a search match in task search results.

View Source
const WaitingSyncInterval = 30 * time.Second

WaitingSyncInterval is the polling interval for syncing waiting tasks.

View Source
const WorkspaceIdeationCommandTTL = 2 * time.Second

WorkspaceIdeationCommandTTL is the timeout for workspace-scanning shell commands during ideation.

Variables

View Source
var SSEKeepaliveInterval = 15 * time.Second

SSEKeepaliveInterval controls how often SSE streams send keepalive comments to prevent proxy and OS-level TCP idle timeouts from silently closing the connection. Tests can lower this for faster verification.

View Source
var WatcherSettleDelay = 1500 * time.Millisecond

WatcherSettleDelay is the pause after receiving a wake signal before calling the action. Tests can lower this for faster verification.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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