factoryenv

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package factoryenv turns the FACTORY_* and GITHUB_APP_* environment into the options of the agent factory. It is shared by the processes that must install the same factory: harness-web (which dispatches tasks and serves the API) and harness-worker (which executes the runs, so it must fire the end-of-run hooks, serve the tools and enforce the policy and the budget of the tasks it runs).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHubFromEnv

func GitHubFromEnv(getenv func(string) string) (*product.GitHubApp, error)

GitHubFromEnv builds the GitHub App from GITHUB_APP_ID, GITHUB_APP_SLUG and GITHUB_APP_PRIVATE_KEY (PEM) or GITHUB_APP_PRIVATE_KEY_FILE; nil when no App is set.

Types

type Wiring

type Wiring struct {
	Options   harness.FactoryOptions
	Escalator *product.FactoryEscalator
	Hooks     *product.FactoryHooks
}

Wiring is what FACTORY_* turns into: the facade's options and the escalator and hooks the product binds to.

func FromEnv

func FromEnv(getenv func(string) string, cfg *config.Config, st factory.Store, gh *product.GitHubApp, team store.TeamStore) (Wiring, bool, error)

FromEnv reads the FACTORY_* variables. The factory is off (enabled false) unless FACTORY=1.

FACTORY=1                       turn the agent factory on (team mode)
FACTORY_RUN=0                   do not run the dispatcher, scheduler and PR loop in this process (default 1)
FACTORY_WEBHOOK_SECRET          GitHub webhook secret (POST /hooks/github); without it deliveries are refused
FACTORY_REVIEW_MODEL            model of the independent reviewer that gates merges (needs the GitHub App)
FACTORY_NO_REVIEW=1             merge on green CI without the reviewer (deliberate opt-out)
FACTORY_REQUIRE_TESTS=1         the reviewer flags source changes that touch no test
FACTORY_PROTECTED               comma-separated path globs no agent change may touch
FACTORY_MAX_CONCURRENT          tasks running at once (default 4)
FACTORY_MAX_ATTEMPTS            attempts per task (default 3)
FACTORY_POLICY                  default autonomy: supervised | sandboxed | autonomous (default sandboxed)
(a task's budget is set by whoever creates the task or the trigger; there is no global one)
FACTORY_DAILY_BUDGET_USD / _TOKENS   cap on all factory spend per 24h (FACTORY_DAILY_PER_PROJECT=1: per project)
FACTORY_LESSONS=1               distil lessons from finished tasks into project memory

st is the task store (nil: in memory, nothing survives the process; harness-web passes a file-backed or Postgres one). team links the threads of a task to its project; nil leaves them private to the owner, which is what a process without the team store wants.

Jump to

Keyboard shortcuts

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