Skip to content

Environment variables

mini-ork runs with no environment variables for a local project. Set the variables below only to change where state lives, separate the engine from the target repository, or enable a documented runtime behaviour.

The complete catalogue of behaviour switches is in Feature flags. This page covers the variables that define the path and identity contract every subcommand shares.

Core paths

Variable Default Purpose
MINI_ORK_ROOT resolved engine root Locates shipped recipes, migrations and configuration
MINI_ORK_HOME .mini-ork/ under the project Project state, configuration and run artifacts
MINI_ORK_DB $MINI_ORK_HOME/state.db Overrides the SQLite state database path
MINI_ORK_PROJECT_HOME current project Identifies the project mini-ork operates for
MINI_ORK_TARGET_REPO current project Repository available to agent and verifier work
MINI_ORK_ENGINE_ROOT resolved engine root Overrides engine discovery for installed launchers
MINI_ORK_PROVIDERS $MINI_ORK_HOME/config/providers.yaml Explicit provider registry path
MINI_ORK_AGENTS $MINI_ORK_HOME/config/agents.local.yaml Personal lane overlay merged over agents.yaml

MINI_ORK_DB takes precedence over the path derived from MINI_ORK_HOME. Keep each concurrent project or test run on its own home and database path — two writers on one SQLite file are not serialised by mini-ork.

Run identity

These are set by the executor and exported to nodes and child processes. Read them in a verifier script; do not set them by hand except when reproducing a run.

Variable Meaning
MINI_ORK_RUN_ID Current run id, e.g. run-20260530-143201-a3f9
MINI_ORK_RUN_DIR Absolute path to <home>/runs/<run-id>/
MINI_ORK_RECIPE Resolved recipe name
MINI_ORK_TASK_CLASS Resolved task class
MINI_ORK_WORKFLOW Workflow file the run is executing
MINI_ORK_PLAN_PATH Path to the run's plan.json
MINI_ORK_WORKFLOW_VERSION_ID Pins the workflow version stamped in traces
MINI_ORK_LEASE_TOKEN Single-writer lease token passed through recovery

Per-node dispatch

Published by the executor immediately before a node runs:

Variable Meaning
MO_NODE_ID Node identifier inside the workflow
MO_NODE_TYPE Node type, e.g. implementer
MO_DISPATCH_CHAIN Ordered lane fallback chain for this node
MO_TARGET_CWD Working directory the node runs in
MO_RESUME_SESSION_ID Session to resume, when a node is retried
MO_OBJECTIVE_DOMAIN Objective-domain slice for the learning router

Test and type-check scoping

These let a repository's own verifier scripts scope themselves to the change surface instead of the whole tree:

Variable Default Effect
MINI_ORK_TEST_CMD (recipe-declared) Command the test verifier runs
MINI_ORK_TYPECHECK_CMD (auto-detect) Explicit type-check command, run verbatim
MINI_ORK_TYPECHECK_FULL (unset) 1 forces an unscoped whole-project type check
MINI_ORK_TOUCHED_FILES (exported) Newline-separated repo-relative paths the run changed

A verifier that reads MINI_ORK_TOUCHED_FILES can narrow a compiler to the files the patch actually touched, which stops pre-existing diagnostics from reddening a lane for a reason the change did not cause.

Cost

Variable Default Effect
MO_DAILY_BUDGET_USD 50 Rolling-24-hour spend cap; the only enforcing budget knob

The window is rolling, not calendar-based. The gate fires before a run starts (exit 75, blocked_reason=cost_limit) and again per dispatch. If the state database is missing or unreadable the gate fails open — absent spend reads as $0.00.

budget: in agents.yaml is display-only

daily_cap_usd, per_run_usd and per_epic_usd under budget: are rendered by the IDE and the SDK. No gate reads them. Use MO_DAILY_BUDGET_USD.

Loop and routing selectors

Variable Purpose
MO_ROUTING_POLICY Chooses a registered native routing policy
MO_EMBED_PROVIDER Chooses a registered semantic-memory embedder
MO_REVISE_ROUNDS Revise rounds a failed retries-edge node may spend (default 2; 0 restores pre-revise behaviour)

Context and memory

Variable Default Effect
MINI_ORK_CTX_BUDGET_TOKENS 64000 Context-pack token budget
MO_CONTEXT_V2 shadow off · shadow record only · on inject v2 context
MO_SEMANTIC_MODEL haiku Semantic-memory helper model
MINI_ORK_STALE_DAYS 14 Stale-memory detection window
MINI_ORK_PROMOTION_MIN_FREQ 3 Minimum frequency before a pattern is promoted

Web and observability

Variable Default Effect
MINI_ORK_ACTIVE_STALE_SECONDS 21600 Fleet view staleness threshold
MINI_ORK_RUN_STALE_SECONDS 1800 Run-detail staleness threshold
MINI_ORK_PROJECTS_FILE (unset) Project registry for the switcher

Resolution rules

  1. Process environment wins over any file.
  2. The owner-only secrets.local.sh is parsed, never sourced, and never executed.
  3. A value is empty only if it is genuinely empty; a missing credential is an error, not a silent empty string.

Retired selector

MINI_ORK_RUNTIME is retired. The supported framework runtime is native Python; shell execution remains available only at declared recipe, target-repository, migration and sandbox boundaries.