Engine reference — generated from the canonical engineering source. Do not edit this page by hand.
Configuration Reference
Canonical scope. This file is the canonical, source-verified configuration reference for the two ZERG config surfaces that share a namespace:
- Sol (orchestrator) — the
solapplication environment (server/config/sys.config,server/config/sys.prod.config, the optional config file, andSOL_*environment variables). Every key below is the exact atom passed tosol_config:get_env/2/application:get_env(sol, Key).- Luna (worker agent) —
client/core/config.lua(DEFAULT_CONFIGmerge),LUNA_*environment variables, and CLI arguments.Out of scope (separate namespaces, not documented here — see §Related configuration surfaces): Mango’s own service config (
mango/conf.py), the Limon console’s build env, and zerg-cli’s own config file.The portal page
docs-site/reference/configuration.mdis a projection of this file — keep fixes here and update the portal page alongside.
Configuration Hierarchy
Configuration is resolved in priority order (highest wins):
Sol Server
- Environment variables (
SOL_*) — applied last bysol_app:apply_env_overrides/0, so they override everything - Config file (optional) — loaded by
sol_config_file:load/0and applied AFTER the release profile has loaded, so it overridessys.prod.config/sys.config( corrects the previously documented inverse order). The boot log names every release-profile key the file overrides.: the search order isSOL_CONFIG_FILE(must be an ABSOLUTE path) →/etc/sol/sol.conf— the old CWD-relativesol.conffallback is GONE. The file must be owner-readable with no group-write and no other bits (0600/0640; 0644 is refused); unknown keys refuse the load loudly;load/1applies the same permission contract. Application is all-or-nothing — every value is normalized/validated first (list-typed keys use theSOL_CLUSTER_NODESgrammar), so a bad value applies NO keys. - Production config (
config/sys.prod.config) — production overrides - Development config (
config/sys.config) — defaults - VM args (
config/vm.args,config/vm.prod.args) — Erlang node settings (not application config; listed for completeness)
Defaults quoted below are the shipped sys.config values; where the code
fallback (what you get with the key absent) differs, both are stated.
The shipped profiles carry 165 top-level keys in sys.config and
174 top-level keys in sys.prod.config (the completeness test’s own
{key, regex; server/test/sol_prod_config_completeness_tests.erl —
).
Luna Agent
- CLI arguments (
--model,--permission-mode,--theme, etc.) - Environment variables (
LUNA_MODEL,LUNA_LOG_LEVEL, …) - Config files — merged lowest→highest by
client/core/config.luadiscover_config_files/1plus the profile file (config.lua:347mergescore/paths.luaprofile_config_pathlast, wins):
~/.luna.json < ~/.luna/settings.json < <cwd>/.luna.json <
<cwd>/.luna/settings.json < <cwd>/.luna/settings.local.json < profile
Security-relevant keys from the project-local files additionally require the repo-config consent gate (below).
Managed-settings precedence
The four config planes resolve highest-wins:
| Priority | Plane | Where it lives / who applies it |
|---|---|---|
| 1 (highest) | Managed settings (admin PUT; fleet push) | Sol managed_settings ETS + <data_dir>/managed_settings.json; pushed to workers via the managed_settings_update PUB and applied by client/core/managed_config.lua |
| 2 | Repo-config (project-local security families) | .luna.json / .luna/settings.json — consent-gated by a user-owned ~/.luna/approvals/trust-<sha256>.json record |
| 3 | Local config (user files + LUNA_* env) | client/core/config.lua merge order (~/.luna.json → … → profile) |
| 4 (lowest) | Built-in defaults | Luna DEFAULT_CONFIG, Sol shipped sys.config |
Only the schema keys (below) are applied; every out-of-schema managed key
is skipped LOUDLY and counted, never silently applied. Sol’s own
managed_settings store does NOT feed sol_config:get_env (application
env only) — the store is a fleet-push plane, not a fifth Sol env layer.
Sol Server Configuration
The Restart column classifies when a changed value takes effect: boot keys are read while the boot ladder / listener construction / child specs run, so a change requires a node restart; per-call keys are read at request/tick/spawn time and are hot-effective. The classification authority is contract/config-restart.yaml (pinned boot keys plus a reviewed per-call default); ci/config_restart_docs_lint.py gates this column against it two-directionally.
HTTP Server
Source: server/config/sys.config, sol_http.erl, sol_app.erl.
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
http_port | boot | integer | 21434 | SOL_HTTP_PORT | Cowboy HTTP listener port. Range 0–65535 (0 = OS-assigned, test posture; production refuses 0). Required |
http_ip | boot | string | "127.0.0.1" | SOL_HTTP_IP | Cowboy bind address. 0.0.0.0 for all interfaces. Non-loopback + auth_enabled=false refuses boot (sol_app:validate_auth_boundary/0) |
host | per-call | string | "0.0.0.0" | — | Default inference host (llama.cpp bind address) |
base_url | per-call | string | — (unset) | SOL_BASE_URL | External base URL override for generated links |
max_sse_connections | per-call | integer | 500 (shipped sys.config; code fallback 500 — sol_http_sse.erl; sys.prod.config OMITS the key, so prod runs 500) | — | Concurrent SSE stream cap. Range 10–10000 (sol_config.erl optional battery). corrected the pre-fix doc/dev 100 (a dev-only override that silently diverged from prod) |
conversation_max_per_user | per-call | integer | 100 | — | (HTTP-03): per-principal conversation quota. At the quota the caller’s OWN oldest conversation is evicted; the per-user eviction never selects another principal’s row. |
conversation_max_total | per-call | integer | 500 | — | (HTTP-03): global conversation-store memory backstop (reachable through aggregate multi-principal activity). When it trips, the globally oldest conversation is evicted regardless of principal — it is a process-memory bound, not a per-principal isolation guarantee. |
hook_deadline_total_ms | per-call | integer | 2000 | — | : total wall-clock budget for the sync-event hook fan-out (capped at 10000); the hook path cannot outlive the caller timeout. |
projection_debt_retry_ms | per-call | integer | 5000 | — | : projection-debt retry cadence; a crashed projector’s owed rows retry until the view converges. |
projection_debt_per_aggregate_cap | per-call | integer | 64 (clamped 1–10000) | — | : per-aggregate durable-debt row cap. At the cap the aggregate is quarantined: later debt rows are dropped and counted (projection_debt_quarantined_total) and the debt gate stops blocking new events, keeping debt rows bounded and lane depth O(queue). |
sync_event_caller_window_ms | per-call | integer | 44500 (code fallback ?CALL_TIMEOUT - 500 = 44500 — sol_sync_event.erl; capped at that value; minimum 1000) | — | review: absolute per-admission caller window. A queued admission never commits after this window; an expired queued item is answered with the typed unknown verdict (sync_event_append_deadline_killed_total). |
worker_usage_max_tokens_per_attempt | per-call | integer | 100000000 | — | : plausibility cap on a worker-reported usage total. An implausible frame is refused (settlement degrades to undefined, counted + logged) instead of exhausting the task owner’s ledger; the real terminal frame still settles. |
worker_cancel_drain_ms | per-call | integer | 10000 | — | (XSV-02): drain bound for the worker cancel line before the turn is force-abandoned. |
mnesia_create_bound_ms | per-call | integer | 5000 | — | (SOLOTP-03): bounded mnesia:create_table wait; a wedged schema lock yields a typed boot refusal instead of a hang. |
max_sse_connections_per_principal | per-call | integer | max(1, max_sse_connections div 4) | — | (HTTP-20): per-principal SSE sub-budget — one principal cannot consume the whole admission pool. Refusals bump sse_principal_limit_refusals_total. |
sse_headroom_reservation | per-call | integer | min(50, max_sse_connections div 10) | — | (HTTP-20): slots reserved for the internal/system principal so the server’s own streams can still open under a hostile per-IP fleet. Ordinary principals are refused at max_sse_connections - sse_headroom_reservation. |
stream_relay_high_watermark | per-call | integer | 128 | — | : relay mailbox high-water mark — at or above it the provider pipeline is suspended (gun flow closes, upstream pauses). Minimum 8. |
stream_relay_low_watermark | per-call | integer | 32 | — | : relay mailbox low-water mark — at or below it the suspended pipeline resumes. Always < the high watermark. |
stream_flow_suspend_max_ms | per-call | integer | 30000 | — | : maximum time a flow-controlled provider pipeline may stay suspended before the per-stream controller resumes it (min 1000 ms). A relay death at the pause instant resumes first; the bound closes the indefinite-wedge class. |
limon_origin | per-call | string | "*" in dev sys.config; empty in sys.prod.config (prod must set SOL_LIMON_ORIGIN; empty omits ACAO entirely) | SOL_LIMON_ORIGIN | CORS/WS-Origin anchor for the Limon bridge; code fallback is <<>>. (There is no cors_origin key — this is the only CORS knob.) |
share_max_views | per-call | integer | 100 | — | Session-share view cap: read N+1 after the cap is the gone-dialect 404; clamp lever. |
enable_pprof | per-call | boolean | — (unset → false) | SOL_ENABLE_PPROF | Expose /debug/pprof/*. Opt-in |
deployment_mode | boot | atom | — (unset → dev) | SOL_DEPLOYMENT_MODE | dev | prod. In prod, auth_enabled, mango_auth_enabled, rate_limit_enabled and worker_path become hard-required (sol_app:validate_production_config/0), and placeholder secrets refuse the boot. The container entrypoint renders it explicitly and refuses to render prod unless SOL_MANGO_AUTH_ENABLED is set |
Native TLS
Sol’s Cowboy listener can terminate TLS natively (no reverse proxy required).
Source: sol_http.erl (TransOpts) + the tls key section of
sol_config_file.erl; env mappings in sol_app.erl.
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
tls_enabled | boot | boolean | false | SOL_TLS_ENABLED | Enable the TLS listener ({tls, Opts} vs {clear, Opts}) |
tls_cert_file | boot | string | "/etc/sol/tls/server.crt" | SOL_TLS_CERT_FILE | PEM certificate file |
tls_key_file | boot | string | "/etc/sol/tls/server.key" | SOL_TLS_KEY_FILE | PEM private key file |
tls_ca_file | boot | string | "/etc/sol/tls/ca.crt" (shipped; the listener adds cacertfile ONLY when the file exists) | SOL_TLS_CA_FILE | CA bundle |
tls_plaintext_ack | boot | boolean | false | SOL_TLS_PLAINTEXT_ACK | : explicit acknowledgement for serving PLAIN HTTP when tls_enabled=true but the cert/key is missing/unreadable. Non-dev modes refuse boot without it; dev falls back CRITICAL-logged. The ZMQ zmq_transport_plaintext_ack posture is the precedent |
http_transport_plaintext_ack | boot | boolean | false | SOL_HTTP_TRANSPORT_PLAINTEXT_ACK | : explicit acknowledgement for a PLAINTEXT HTTP listener when tls_enabled=false on a NON-LOOPBACK http_ip in deployment_mode=prod — without it (or http_transport_tunnel) the boot REFUSES with {refuse_boot, http_plaintext_external_bind}. Loopback binds and dev keep the open posture; other non-dev modes CRITICAL-banner |
http_transport_tunnel | boot | string | "" | SOL_HTTP_TRANSPORT_TUNNEL | : declares an encrypted upstream terminator/tunnel (http-terminator/wireguard/mtls-sidecar) that satisfies the HTTP plaintext boundary for a non-loopback prod bind |
In the config file the same keys are written under the tls section:
{tls, [{enabled, true}, {cert_file, "/etc/sol/tls/server.crt"}, {key_file, "/etc/sol/tls/server.key"}, {ca_file, "/etc/sol/tls/ca.crt"}]}.
When tls_enabled=true but the cert or key file is missing/unreadable:
deployment_mode=prod (and any non-dev mode) refuses to boot with the
typed {invalid_config, {refuse_boot, {tls_cert_missing, Cert, Key}}} —
serving plaintext silently is no longer possible. dev keeps the fallback
but logs CRITICAL; any mode can explicitly acknowledge plaintext with
tls_plaintext_ack=true (CRITICAL-bannered)..
Prefer the OpenResty reverse-proxy termination on production hosts (wild
blueprint); native TLS is for standalone deployments.
Inference
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
llama_server_path | per-call | string | "/usr/src/llama.cpp/llama-server" | SOL_LLAMA_SERVER_PATH | Path to llama.cpp server binary (the legacy/no-root engine resolution) |
inference_engine_root | per-call | string | undefined | undefined (dev) / "/opt/llama" (prod) | — | : engine install root. Unset → the legacy llama_server_path; set → <root>/<engine.build>/bin/llama-server, or <root>/current/bin/llama-server when the engine’s build is absent/unbuilt. A resolved path that is not an executable refuses the start with {engine_binary_missing, Path} |
inference_loading_interval_ms | per-call | integer | 500 | — | : the loading-state health probe interval (ms). Typed; a non-positive-integer value falls back to 500. The slow-load tests shrink it instead of waiting out 90s |
inference_loading_probes | per-call | integer | 60 | — | : the GLOBAL loading probe budget (failures before the crash-class stop + bounded restart). Precedence: lane loading_probes → this key → 60. The ATX/UD lanes carry loading_probes => 600 (300s at 500ms) |
base_port | per-call | integer | 18001 (shipped sys.config; code fallback 8001 — sol_registry.erl ?DEFAULT_BASE_PORT) | SOL_BASE_PORT | First port of the lane allocation window [base_port, base_port+inference_port_range) with wraparound.: 18001-18010 is the range wild publishes on every node (8001-8010 was crowded; 18080 + k0s 31000-32767 excluded) — an allocation outside it is unreachable cross-node.: rendered by the container entrypoint (validated integer; base_port + inference_port_range must stay inside the TCP port space); sol_inference_port_base/_range/_used/_free expose the live window |
inference_port_range | per-call | positive integer | 10 | SOL_INFERENCE_PORT_RANGE | : width of the port window the registry wraps within starting at base_port (next_port/2 wraps wrap_cursor(Base, Range, Port + 1)); a non-positive-integer value falls back to 10 with a warning. Keep base_port + inference_port_range inside the node’s published range.: rendered by the entrypoint (validated integer 1..1000) and exposed as sol_inference_port_range |
inference_tool_result_max_bytes | per-call | positive integer | 262144 (256 KiB) | — | : per-tool-result size cap in bytes; larger content is truncated at the boundary with a marker (the model never receives an unbounded tool payload). A non-positive-integer value falls back to 262144 |
host | per-call | string | "0.0.0.0" (code fallback; shipped sys.prod.config pins "127.0.0.1") | SOL_LLAMA_BIND_HOST | llama.cpp bind host. The effective bind is 127.0.0.1 unless llama_bind_nonloopback=true; also settable via [inference] host in sol.conf. The grant endpoint host is derived separately (advertise-host rule below) and never advertises 0.0.0.0 — a wildcard bind advertises node_host (SOL_NODE_HOST). |
llama_bind_nonloopback | per-call | boolean | false everywhere | SOL_LLAMA_BIND_NONLOOPBACK | : the non-loopback bind opt-in for cross-node lane traffic. With it TRUE the configured host is used (fallback "0.0.0.0" when no host is pinned) and a loud once-per-VM warning is logged — llama.cpp’s HTTP API has no auth, so the exposure must be restricted to a trusted network. Also settable via [inference] bind_nonloopback in sol.conf. Off in every committed config; use the env twin per GPU host |
data_dir | boot | string | "/tmp/sol" | — | Sol scratch/data directory. (LIFE-19): under a non-dev deployment_mode a missing/relative value is a typed PRE-SUP refusal ({invalid_data_dir,...} → invalid_config), no longer an unclassified maintenance-child crash.: the anchored <data_dir>/backups default follows the same absolute-path rule |
Grant advertise-host rule. sol_registry:advertise_host/1
derives the lane-grant endpoint host from the FINAL llama bind host: a
wildcard bind (0.0.0.0 / ::) advertises the operator-configured
node_host (SOL_NODE_HOST), loopback aliases (127.0.0.1 / ::1 /
localhost) collapse to 127.0.0.1, and a concrete non-loopback host is
advertised as-is. A grant endpoint is a dial target, not a bind directive — it
is never 0.0.0.0. For worker grants, sol_lane_orchestrator grants a
bind_mode=loopback lane only when the worker’s READY hostname matches the
target node’s machine hostname (case-insensitive first label,
inet:gethostname/0); a worker that sent no hostname keeps the legacy
same-Sol-node grace. A bind_mode=nonloopback lane relies on the advertised
routable endpoint. Otherwise the grant refuses typed
{lane_not_reachable, Lane, Node}. Cross-node traffic additionally needs the
bind opt-in + port publish — see the runbook’s cluster section (the port
publish is wild-owned).
Model parameter keys
temp, top_p, min_p, batch_size, ubatch_size are not standalone
app-env atoms — they are per-model inference parameters accepted in the
config-file inference section and in model_templates values
(sol_config_file.erl section map; consumed by the model gen_statem). The
defaults below are the shipped model_templates values (config/sys.config):
| Parameter | default template | Also set in |
|---|---|---|
temp | 1.0 | coding 0.3, chat 0.7, reasoning 0.6 |
top_p | 0.95 | coding 0.95, chat 0.9, reasoning 0.95 |
min_p | 0.01 | — |
batch_size | 2048 | coding 2048, chat 2048 |
ubatch_size | — | per-model config |
top_k | — | reasoning 40 |
| Key | Restart | Type | Default | Description |
|---|---|---|---|---|
model_templates | per-call | map | see table above | Per-template sampler defaults, selectable via --template |
Autoscaling
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
autoscaling_enabled | per-call | boolean | false | — | Model-instance autoscaler (sol_autoscaler_handler) |
autoscaling_interval_ms | per-call | integer | 10000 | — | Autoscaler poll interval. Range 1000–3600000 |
autoscaling_min_models | per-call | integer | 1 | — | Legacy floor; used only when the live policy map omits min_instances. Range 0–100 |
autoscaling_max_models | per-call | integer | 4 (shipped sys.config; code fallback 8 — sol_autoscaler_action.erl) | — | Legacy ceiling; used only when the live policy map omits max_instances. Range 1–100. Hard-capped by the license GPU cap: scale-up consults sol_license:check(gpus, N+1) and fails closed |
autoscaling_policy | per-call | map | derived defaults (scale_up_tps=100, scale_down_tps=10, min_instances=1, max_instances=8, cooldown_ms=30000) | — | Validated policy map (autoscaling_policy env or the validated set_policy/1 map; idle is the legacy disabled/unset sentinel). min_instances/max_instances drive the action layer and override the flat env fallback; scale_up_tps, scale_down_tps, cooldown_ms drive evaluation |
Inference Lanes
Adds the declarative lane/engine/host-policy
registry (sol_lane_registry.erl) — the sole lane truth: Sol alone picks
the lane/engine/profile; workers never self-select. The values are nested
Erlang maps, so this surface is sys.config-only: it cannot be expressed
in sol.conf (the scalar parser has no map syntax — the model_templates
precedent) and the keys are deliberately not in the plugin-bridge
allowlist (lane pins and model paths leak topology; removed the
same class). sol_config:validate_optional/0 validates the whole registry at
boot and refuses with the accumulated typed violations:
{invalid_inference_lane, LaneId, Reason}
{invalid_inference_engine, EngineId, Reason}
{invalid_node_class, LabelOrClass, Reason}
{invalid_host_policy, Class, Reason}
{invalid_lane_config, Key, Reason}
| Key | Restart | Type | Shipped default | Env Var | Description |
|---|---|---|---|---|---|
inference_lanes | per-call | map | 10 production lanes + llama_agentic_staged (test: fixture_sse) | — | Lane rows. kind => local | remote | staged (default local). Local/staged require engine + files + pin + ctx + caps + modes_allowed; remote (the api_tier) carries caps only. Local lanes also carry the grantable surface wire_format (openai default) / http_auth (none default) / bind_mode (loopback default). modes_allowed ⊆ [on_demand, cron, duration, attended] |
inference_engines | per-call | map | cuda_sm86_main (b11011), cpu_epyc, fork_turboquant, llama_agentic_staged | — | Engine rows. kind => cuda | cpu | experimental | fixture; production => true requires a full 40-hex ref (an optional repo@ prefix is accepted) and a non-empty build. A production lane bound to a production => false engine refuses unless the lane sets engine_ack => true (loud WARNING) |
node_classes | per-call | map | #{blue => cpu_host, red => gpu_3090_full, green => gpu_3090_64g} | — | This deployment’s node label → class map (test => test_host in sys.test.config). An unknown label refuses boot |
lane_host_policy | per-call | map | class-keyed #{kind, vram_mib, ram_mib, max_sessions, lanes, ctx_overrides, host_env} | — | Per-class facts + lane policy. lanes => all_gpu is the sentinel (every GPU-capable local lane); explicit lists are validated lane-by-lane and must never name a staged lane (remote is allowed). host_env is enforced by (validated + merged into the spawn env; host_env_ack gates LD_LIBRARY_PATH); ctx_overrides enforcement rides |
node_label | per-call | atom | blue (test in sys.test.config) | SOL_NODE_LABEL | This node’s label; must resolve through node_classes into lane_host_policy. The env override carries the label as a string and is normalized to the config atom |
lane_model_root | per-call | string | "/fun/models" | — | The serving-weights root the local/staged files.model paths must live under (absolute). This is not model_source_dir (the staging root) — the serving weights live on the GPU hosts |
lane_path_ack | per-call | boolean | false (true in sys.test.config for the relative _build scratch root) | — | Acknowledges lane model paths outside lane_model_root (or relative); CRITICAL-adjacent loud posture, never silent |
Pin rules: pin.repo / pin.file are non-empty binaries; pin.sha256 is a
full lowercase 64-hex digest or the literal <<"unhashed">> with lane
pin_ack => true (ghost carries a full on-host hash only for qwen38_atx);
pin.license is non-empty, or <<"unknown">> with license_ack => true
(qwen38_flashnext); <<"none">> is allowed only for a fixture-engine lane.
The frozen per-lane ghost provenance (file:line, measured refs, license
sources) lives in plan/fixtures/ghost-p7-standard-b0454f2.md, checked
bidirectionally by ci/lane_registry_export_lint.py.
- lane keys (validated at boot by
sol_lane_registry:validate/0 + sol_lane_profile:validate_profile/1;
violations are typed {invalid_inference_profile, LaneId, Reason}):
| Lane key | Type | Meaning |
|---|---|---|
loading_probes | positive integer | Per-lane loading budget (probe count at inference_loading_interval_ms). ATX + UD seed 600 (the 60-90s load class) |
kv_fastpath_ack | boolean | Acknowledges a KV quant outside the fast-path set {f16, bf16, q4_0, q8_0} (the q4_1/q5 PP-collapse lesson). Without it, a non-fast-path KV refuses |
fallback | atom (lane id) | Fallback lane when the primary’s pin cannot be verified (must exist, be kind => local, and not be the lane itself). Selection is receipt-first: a verified lane-model-receipt.json beside the weights is accepted without hashing; missing/stale refuses as primary_pin_unverified (never a 15.6 GB start-path hash). The fallback reason is recorded (inference_lane_fallback event + sol_inference_lane_fallback_total{reason}) |
flash_attn | on | off (optional) | Lane-level FA override. The effective FA is this value or the engine’s require.fa; quantized KV REQUIRES effective on (argv truth is re-checked at the run_llama/1 gate) |
rope | #{scaling, orig_ctx, context_length?, rope_scale?} | YaRN pairing: when the context exceeds orig_ctx, rope_scale MUST equal ctx/orig_ctx and an explicit context_length MUST equal ctx (the n_ctx_train clamp law). scaling ∈ {yarn, linear, none}; orig_ctx is a positive integer |
Other laws enforced at the same gates: threads =< physical cores
(erlang:system_info(cpu_topology), with an optional host-policy
physical_cores override; threads => auto resolves to the count at
start), the per-model draft_mtp law (a spec.type => draft_mtp lane
needs caps.mtp => true or a files.draft), and parallel == limits.slots_max when both are present. Engine rows gained NO per-engine
flag list (recorded decision; owns certification
constraints).
** lane keys** (validated at boot by
sol_lane_registry:validate/0):
| Lane key | Type | Meaning |
|---|---|---|
priority | integer (optional, default 0) | Deterministic-order preference. After cap specificity (fewest unrequested true caps), higher priority wins; remaining ties prefer production => true and finally the lexical lane id |
engine_requirements | #{Cap => #{pr => pos_integer}} (optional) | Blocks a capability flip until the bound ENGINE’s ref carries the recorded pr<N> marker. Keys must be caps the lane declares; only pr is a legal requirement key; an unmet requirement refuses {error, {engine_requirement_unmet, Lane, Cap, Req}} |
Capability routing: sol_lane_router:route/1
(and route/2 with #{host_class => Class}) is the PURE routing core
’s sol_lane_orchestrator:request/2 calls through its dynamic
seam. Requirements are flat and fail-loud: vision, tool_calls,
strict_json, mtp (booleans), min_ctx (positive integer, compared
against effective_ctx — host-policy ctx_overrides[Lane] else the
lane’s declared ctx), throughput (#{min_eval_tps => N} against the
optional expected.eval_tps), mode, host_pref (a placement
hint the router validates but does not use), deep_reasoning, and lane
(an explicit pin that still passes every gate). Unknown keys refuse
{error, {unknown_requirement, K}}; bad values refuse
{error, {bad_requirement, K, V}}. Returns {ok, Lane} for a local
lane, {remote, api_tier} as a DECISION (deep-reasoning or no local
fit; api_tier has no provider/model binding — remote_binding/0
answers the typed {error, {remote_tier_unbound, api_tier}}), or a typed
refusal (no_lane, {unknown_lane, _}, {staged_not_grantable, _},
{not_allowed_on_host, _}, {strict_json_unsupported, _},
{engine_requirement_unmet, _, _, _}, {ctx_insufficient, _, _, _},
{ctx_unknown, _}, {throughput_unmet, _, _, _},
{throughput_unmeasured, _}, {mode_not_allowed, _, _},
{deep_reasoning_requires_remote, _}) — never a silent fallback.
Eligibility: kind => staged is never selectable; explicit host-policy
lists filter by membership; lanes => all_gpu means every local lane
whose engine class is a GPU class (the CPU lane, the remote tier and
staged lanes are excluded).
response_format: the field is extracted at both
HTTP ingresses (sol_http_validation:extract_inference_opts/1; a
non-object value is a 400 on both dialects) and gated once the serving
lane is known. A lane with caps.strict_json => true (and any
engine_requirements satisfied) keeps the field and the OpenAI-wire body
builder forwards it to the lane. An incapable lane STRIPS it for a
tolerant request ({"type":"json_object"}) with the labeled counter
inference_response_format_stripped_total{lane} and a
lane_response_format_stripped event; a strict demand
({"type":"json_schema"} or "strict": true) refuses 400 with the typed
{strict_json_unsupported, Lane} / {engine_requirement_unmet,...}
message. Remote/provider/legacy lane-less legs keep the historical drop
but are counted (lane label remote / unknown) — no silent drop.
ATX forwards; the Ling lanes strip/refuse until #28682 flips their
strict_json cap (blocked by their engine_requirements row until the
engine bump carries the marker).
Needle + rows: sol_lane_needle is the reusable
recall gate — a deterministic 16k-token haystack with
AMBER-KEYLINE-7741 at position 0, chat path only, temperature 0, exact
substring assert, wall + decode timing. run/2 resolves a RUNNING lane
and never starts one ({error, lane_not_running}). The shared row shape
(20 benchmark columns + the at freshness timestamp) is pinned by
server/test/fixtures/lane_benchmark_row.json; fresh_row/6 is the pure
freshness predicate ’s advertisement gate consumes (an engine bump
changes engine_ref/build and invalidates). scripts/lane-needle.sh
and scripts/lane-agentic-suite.sh are operator entry points (GPU-driven,
off required checks); the GPU-less CT proves the mechanics against the
extended fixture lane. tests/lane/run_agentic_suite.py ports the ghost
6-case + 10-case agentic ids; strict-JSON cases report gated (never
pass) while is open.
Instance identity: the registry row key is the
INSTANCE id — <<"<lane>/<model_slug>">> for lane starts, the bare model
slug for legacy starts. sol_registry:start_model(Slug, #{lane => L, engine_override => E}) mints sol_model_<lane>__<slug> (legacy starts
keep sol_model_<slug> exactly). Two lanes may serve the same GGUF; a
duplicate instance-key collision with a different model slug refuses with
{duplicate_instance, Lane, Slug}. /api/v1/models local rows expose
slug (instance), model_slug, lane and engine.
Status/grant descriptor: every sol_inference:status/1
reply carries the additive flat tags lane, engine, endpoint,
wire_format, http_auth, bind_mode, caps, ctx, slots_max,
model, lease_id, expires_at (always present, undefined where
unknown; endpoint = http://Host:Port, never /v1). The pure
sol_inference:grant_descriptor/1 projects exactly the pinned seven keys
{lane, endpoint, wire_format, caps, ctx, lease_id, expires_at} and
returns {error, not_running} / {error, no_lane} otherwise.
lease_id/expires_at are present-but-undefined until fills
them; the contract fixture is
server/test/fixtures/inference_grant_descriptor.json (
consume it byte-for-byte).
The fixture lane (sys.test.config only): fixture_openai engine
(kind => fixture, production => false) + fixture_sse lane
(kind => local, production => false, files.model under
./_build/test/tmp/models/, loading_probes => 20). starts it
through the real sol_inference lifecycle —
sol_inference_fixture_lane_SUITE (the Wave B exit proof: real start →
/health → status descriptor → stop → port closed).
Lane Governor
Adds the node-local resource governor:
sol_lane_lease (admission, monotonic leases, lifecycle modes), the
bounded sol_gpu_probe sampler, the spawn-options seam
(env/kill_timeout/kill_group), pidfile orphan reaping, and the
lane metrics/alerts. The scalar keys below are validated by
sol_config:validate_optional/0; lane_evict_hooks (an argv list) and
lane_cron (a window map) are nested shapes the scalar sol.conf parser
cannot express — they ship in sys.config/sys.prod.config (empty by
default) and are deliberately absent from the plugin-bridge allowlist.
| Key | Restart | Type | Shipped default | Env Var | Description |
|---|---|---|---|---|---|
lane_kill_timeout_s | boot | integer | 10 | — | The erlexec SIGTERM→SIGKILL window per managed child ({kill_timeout, N}, erlexec 2.3.4 semantics — ONE window, not a poll). Range 0–60. The sol_inference_sup child shutdown budget follows it (max(5s, (N+2)s)) |
lane_idle_release_ms | per-call | integer | 900000 | — | Default on_demand idle-release TTL; every admit resets it. Per-lane idle_release_ms overrides; false opts out (the test fixture lane opts out). Range 0–86400000 |
lane_duration_max_ms | per-call | integer | 86400000 | — | Ceiling for a duration-mode start (duration_ms, request or lane row). Range 1–604800000 |
lane_lease_sweep_ms | per-call | integer | 5000 | — | Expiry sweep cadence of the governor singleton. Range 100–600000 |
lane_lease_retry_after_ms | per-call | integer | 5000 | — | retry_after_ms hint returned with {lane_busy, Holder, RetryAfterMs} (HTTP 409). Range 100–600000 |
lane_vram_sample_ms | per-call | integer | 5000 | — | sol_gpu_probe cache TTL (nvidia-smi is never run per scrape/request). Range 100–3600000 |
lane_vram_headroom_mib | per-call | integer | 1229 | — | Free-VRAM margin required at lease acquire (ghost docs/benchmark-serving.md:488: “keep ≥1.2 GB free for image work”). Range 0–1000000 |
lane_release_tolerance_mib | per-call | integer | 2048 | — | Post-stop release verification tolerance: a delayed sample below pre_free − tolerance bumps sol_lane_release_verify_failed_total (CRITICAL alert). Range 0–1000000 |
lane_orphan_ttl_ms | per-call | integer | 3600000 | — | Pidfile age horizon for the orphan sweep: older pidfiles are stale authority (the OS pid may have been reused) and are deleted WITHOUT touching the process; younger ones go through the full identity-checked reap. Range 1000–86400000 |
lane_evict_ack | per-call | boolean | false | — | Acknowledges executing lane_evict_hooks. Without it the configured hooks are refused (logged) |
lane_evict_hooks | per-call | list of argv lists | [] | — | External-producer eviction commands (argv-only, ≤4, each non-empty; e.g. ghost’s ComfyUI /free POST). Executed once on a measured-budget refusal, then the budget is re-checked. Not expressible via sol.conf |
lane_cron | per-call | map | #{} | — | #{<lane> => #{model => Slug, start => CronExpr, stop => CronExpr, duration_ms => N}} windows validated with sol_cron:validate_schedule/1. A start that cannot acquire is counted (lane_cron_start_refused_total) and skipped — never queued. Not expressible via sol.conf |
Per-lane governor keys (validated by sol_lane_registry:validate/0;
violations are typed {invalid_inference_lane, LaneId, Reason}):
| Lane key | Type | Meaning |
|---|---|---|
idle_release_ms | non-negative integer | false | Per-lane idle-release override; false = resident until an explicit stop |
duration_ms | positive integer | Per-lane default duration for duration-mode starts (request duration_ms wins) |
Mode matrix: on_demand (default; start→use→idle-release),
attended (idle-release policy; an explicit TTL/duration makes the lease fixed), duration
(requires duration_ms, ≤ lane_duration_max_ms), cron (window map).
A mode outside the lane’s modes_allowed refuses with
{mode_not_allowed, Mode, Allowed} (HTTP 409 — never a 500). The start
body gains "mode" and "duration_ms".
Slot/quota posture:
lease acquire enforces big-lane exclusivity, the static VRAM sum
(Σ expected.vram_mib + headroom ≤ host_policy.vram_mib), slot
accounting (Σ slots_max + new ≤ host_policy.max_sessions), and the lane
validator caps big lanes at 2 slots and tiny lanes at 5. A busy lane
refuses {lane_busy, Holder, RetryAfterMs} (HTTP 409). The per-model
admission cap is bounded by the lane’s parallel ( maps
limits.slots_max); VRAM budgets are enforced statically for lanes that
declare expected.vram_mib and advisory (typed unverified) elsewhere.
Engine env: inference_engines.<id>.env (validated map; keys
^[A-Z_][A-Z0-9_]*$; LD_PRELOAD/LD_AUDIT refused; LD_LIBRARY_PATH
requires env_ack => true) merges under
lane_host_policy.<class>.host_env (now enforced, no longer stored-only;
host_env_ack gates LD_LIBRARY_PATH). Explicit stop releases the lease;
a crash/health-fail keeps it in recovering so the bounded auto-restart
can renew it (a restart whose lease expired is denied, counted in
sol_lane_restart_denied_total, and stays stopped).
Fleet Inventory & Orchestrator
Adds the replicated fleet read model
(sol_inventory + the sol_lane_inventory ETS table, one row per node,
pushed over explicit rpc:cast) and the placement brain
(sol_lane_orchestrator:request/2). All scalar keys are validated by
sol_config:validate_optional/0. replaces the old
in-config lane_validation map with a DERIVED status over a runtime
measurement record at <data_dir>/lane-validation.json (written 0600
atomically by sol_lane_validation, single writer = the admin validate
route); the legacy lane_validation env map remains ONLY as the
eunit/CT injection seam and is never shipped in sys.config.
| Key | Restart | Type | Shipped default | Env Var | Description |
|---|---|---|---|---|---|
lane_inventory_heartbeat_ms | per-call | integer | 30000 | — | Re-push cadence even without a content change; staleness TTL = multiplier × this. Range 1000–600000 |
lane_inventory_scan_ms | per-call | integer | 5000 | — | Local fact re-derivation cadence (running instances, leases, GPU sample, disconnected-node poll). Range 1000–60000 |
lane_inventory_coalesce_ms | per-call | integer | 1000 | — | Minimum interval between peer pushes when content churns (the write-storm bound; the local row is refreshed regardless). Range 0–60000 |
lane_inventory_stale_multiplier | per-call | integer | 3 | — | Staleness = multiplier × heartbeat (default 3×30 s = 90 s). Range 2–10 |
lane_queue_max | per-call | integer | 8 | — | Bounded admission waiters per lane on the target node; overflow → queue_full (0 refuses all waiting). Range 0–1000 |
lane_queue_wait_ms | per-call | integer | 30000 | — | Default blocking wait for a busy lane; wait_ms=0 in the request is the async probe and returns {queued, Q} immediately. Range 0–600000 |
lane_queue_poll_ms | per-call | integer | 1000 | — | Waiter re-check cadence (poll, not gen_event coupling). Range 100–60000 |
lane_ready_slack_ms | per-call | integer | 2000 | — | Added to the per-lane loading budget (loading_probes × inference_loading_interval_ms) before the ready-wait gives up. Range 0–60000 |
lane_ready_wait_max_ms | per-call | integer | 600000 | — | Absolute cap on the ready-wait budget. On timeout the instance is stopped (releasing its lease) and loading_timeout is returned. Range 1000–3600000 |
lane_failover_enabled | per-call | boolean | true | — | Enables placement failover to the next candidate node |
lane_failover_require_validation | per-call | boolean | true | — | Requires the destination’s lane verdict state => validated before a move; otherwise {engine_unvalidated, Lane, Reason} |
lane_request_id_ttl_ms | per-call | integer | 300000 | — | Idempotency LRU TTL for request_id replay (bounded at 256 entries). Range 1000–3600000 |
lane_validation_ttl_ms | per-call | integer | 2592000000 | SOL_LANE_VALIDATION_TTL_MS | : age after which a lane validation record is stale and the lane projects unvalidated (default 30 days). Range 3600000–15552000000 (1 h–180 d) |
Operator surface: GET /api/v1/inference/lanes (RBAC inference:list)
returns the sanitized merged view (?lane= / ?node= filters); the
response never contains pids, env, model paths, or lease ids.
request/2 is the single resolver: an explicit lane grants the
7-key descriptor plus a nested status map; requirements dispatch to
’s sol_lane_router:route/1 when present (otherwise no_lane).
Model Management
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
model_source_dir | per-call | string | "/fun/models" | SOL_MODEL_SOURCE_DIR | NFS or remote model directory (GGUF files) |
model_store_dir | per-call | string | "/tmp/sol/models" | SOL_MODEL_STORE_DIR | Local model cache (rsync target) |
model_local_dirs | per-call | list | [] | — | Additional local model directories (no rsync) |
Worker Management
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
worker_path | per-call | string | "client/build/luna" | SOL_WORKER_PATH | Path to Luna worker binary. Validated against prefix. Hard-required in deployment_mode=prod |
worker_path_prefix | per-call | string | "" | SOL_WORKER_PATH_PREFIX | Prefix for spawned worker paths |
max_workers | per-call | integer | 16 | SOL_MAX_WORKERS | Maximum concurrent agent workers. Range 1–1000 (sol_app:validate_config/0 boot validation); 1–10000 accepted by the optional validation battery (sol_config:validate_optional/0). The container entrypoint default is 100. |
initial_workers | per-call | integer | 1 (code fallback — sol_zmq_gateway.erl spawns initial_workers at boot; unset = 1) | SOL_INITIAL_WORKERS | Workers spawned at boot. Range 0–1000 |
worker_heartbeat_timeout_ms | boot | integer | 15000 (shipped sys.config; code fallback 45000 — sol_zmq_gateway.erl/sol_zmq_worker_manager.erl/sol_health.erl) | SOL_WORKER_HEARTBEAT_TIMEOUT_MS | Worker heartbeat timeout in milliseconds (silent-worker eviction threshold). Range 1000–300000 |
worker_heartbeat_check_ms | boot | integer | 10000 | — | Worker heartbeat check interval in milliseconds. Range 1000–60000 |
worker_busy_heartbeat_timeout_ms | boot | integer | 60000 | — | Busy-worker eviction window: a worker holding an in-flight task is evicted only after this much TOTAL frame silence (no heartbeat AND no accepted token progress) — the plain worker_heartbeat_timeout_ms sweep can no longer orphan a busy-but-alive worker whose heartbeat timer is starved by its own task. Genuinely-dead busy workers are still reaped at this window (and independently by the task lease). Range 1000–600000 |
max_spawn_depth | per-call | integer | 3 (shipped sys.config; code fallback 2 — sol_zmq_worker_manager.erl) | — | Max nested spawn depth. Range 1–20 |
agent_slots_per_principal | per-call | integer | 0 — derive ceil(max_workers/2) at admission | — | : per-principal agent-slot FAIR-SHARE ceiling (one user cannot occupy every slot). 0 derives ceil(cap/2); a set value is the absolute ceiling, clamped to the global cap. Fleet-internal principals (internal/system) are not gated. Range 0–10000 (sol_config:validate_optional/0) |
sync_enabled | per-call | boolean | true | — | Installs sol_sync_event_forwarder — every store-routed event (incl. inference.complete, the spend-ledger rebuild’s source) is written to the durable event log. false leaves the advertised durable ledger/workflow consumers starved. The sol_event_sync_forwarder_installed gauge is absent when disabled |
workspace_root | per-call | string | undefined (shipped sys.config; sol_http_workspace.erl falls back to "." when unset) | — | Workspace files root for the HTTP workspace API |
ZMQ
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
zmq_enabled | boot | boolean | true | SOL_ZMQ_ENABLED | Required — the only key in sol_config’s REQUIRED_KEYS (missing = loud warning; ZMQ-dependent features dead). Enables the ROUTER/PUB gateway |
zmq_router_port | per-call | integer | 5555 | SOL_ZMQ_ROUTER_PORT | ROUTER socket port (workers connect as DEALER). Range 1–65535 |
zmq_pub_port | per-call | integer | 5556 | SOL_ZMQ_PUB_PORT | PUB socket port (event broadcasting). Range 1–65535 |
zmq_bind_addr | boot | string | "127.0.0.1" | SOL_ZMQ_BIND_ADDR | Bind address for both sockets |
zmq_error_strategy | boot | atom | skip | SOL_ZMQ_ERROR_STRATEGY | Worker-failure strategy: skip | retry | abort |
zmq_max_retries | boot | integer | 3 | — | Max retries under the retry strategy. Range 0–100 |
zmq_worker_cap | boot | integer | 100 (shipped sys.config; code fallback 256 — sol_zmq.hrl/sol_zmq_gateway.erl) | — | Max registered workers. Range 1–10000 |
zmq_listener_cap | boot | integer | 1000 (shipped sys.config; code fallback 1024 — sol_zmq.hrl/sol_zmq_gateway.erl) | — | Max event listeners. Range 1–1000 |
zmq_pid_cap | boot | integer | 10000 (shipped sys.config; code fallback 1024 — sol_zmq.hrl/sol_zmq_gateway.erl) | — | Max tracked pids. Range 50–10000 |
zmq_max_queue_depth | boot | integer | 1000 (shipped sys.config; code fallback 10000 — sol_zmq.hrl/sol_zmq_gateway.erl) | — | Task queue depth cap. Range 1–100000 |
max_pending_tasks | boot | integer | 100 | — | Pending tasks per worker. Range 1–10000 |
dispatch_scheduled_pending_reserve | per-call | integer | 10 | — | : per-worker pending slots RESERVED for scheduled/workflow dispatch classes. Interactive (and channel/plugin) stop at max_pending_tasks - reserve; the reserved classes use the whole budget. Clamped to [0, max_pending_tasks - 1], so at least one non-reserved slot always remains. Range 0–10000 |
dispatch_scheduled_queue_reserve | per-call | integer | 100 | — | : queued-seat slots RESERVED for scheduled/workflow classes. Interactive (and channel/plugin) stop at zmq_max_queue_depth - reserve; the reserved classes use the whole queue. The shipped default is 10% of the shipped zmq_max_queue_depth (100 of 1000) — the original 1000 equalled the queue and left interactive one seat. Clamped to [0, max - 1]; a configured reserve at/above its budget refuses boot (validate_optional/0). Range 0–100000 |
shutdown_event_backlog_shed_threshold | per-call | integer | 5000 | — | : at set_shutting_down (prep_stop), when the observed event backlog (sol_events + durable lane, or sol_sync_event’s admission queue) is at/over this many events, the shutdown pre-shed latch is armed: new store-routed events go straight to the durable shed journal (replayed at boot) and non-store events are dropped with the existing counter, so the bounded handler-completion drain cannot be re-flooded. Range 1–1000000 |
worker_boot_grace_ms | per-call | integer | 15000 | — | How long a dispatch arriving while the session worker is still booting (spawning) is parked for readiness before the typed {not_available, spawning} refusal answers. On expiry — or if the worker dies mid-boot — the shared worker_unavailable classification answers unchanged |
zmq_ownership_enforced | boot | boolean | — (unset → true) | SOL_ZMQ_OWNERSHIP_ENFORCED | Message-level ownership gates (result/token/error/event/spawn — sol_zmq_ownership.erl) |
zmq_worker_secret | boot | string | — (unset) | SOL_ZMQ_WORKER_SECRET | When ≥16 bytes, every ZMQ ready frame must carry HMAC-SHA256(secret, nonce || u16(len(identity)) || identity || u16(len(worker_id)) || worker_id || u32(child_depth) || u64(ctr)) (v2 material via registration_signed_material/5; the 4-arity legacy material is the explicit zmq_enrollment_ctr_required=false escape hatch) or registration is refused (fail-closed) |
allow_shared_worker | per-call | boolean | false | SOL_ALLOW_SHARED_WORKER | : the deployment acknowledges a SHARED worker. The shipped posture is single-tenant per worker; a READY declaring tenancy="shared" (or shared_worker=true) is refused with shared_worker_requires_declaration unless this is true. Even when true no multi-tenant isolation is claimed (one org per Sol; see docs/tenancy-posture.md) |
zmq_allow_local_unregistered | per-call | boolean | false | SOL_ZMQ_ALLOW_LOCAL_UNREGISTERED | : the dev-only escape from the credential requirement — with a LOOPBACK zmq_bind_addr and deployment_mode=dev, setting this permits credential-less worker registration (any local process can then register; CRITICAL-logged). A non-dev mode ignores it. The acknowledged external dev bind is the separate zmq_dev_external_bind_ack lever |
zmq_dev_external_bind_ack | boot | boolean | false | SOL_ZMQ_DEV_EXTERNAL_BIND_ACK | : the ONLY way to boot ZMQ in deployment_mode=dev (the default) on a non-loopback zmq_bind_addr. Without it the boot REFUSES (dev_mode_external_zmq_bind) — the open dev posture (unauthenticated, MAC-optional registration) is never a silent default on a reachable interface. Acknowledged boots CRITICAL-banner at the gate; the effective posture is exported as the sol_zmq_deployment_posture gauge (0 = loopback, 1 = dev+external, 2 = staging/qa, 3 = prod, 4 = ZMQ disabled) |
zmq_curve_enabled | per-call | atom | auto | SOL_ZMQ_CURVE_ENABLED | CURVE transport: auto = on when the bind is non-loopback, true = always, false = never. A curve-enabled node whose crypto backend is missing refuses boot |
zmq_curve_secretkey | per-call | string | — (unset → generated) | SOL_ZMQ_CURVE_SECRETKEY | Server CURVE key (Z85 or 32-byte binary); unset → generated and persisted to zmq_curve_keyfile |
zmq_curve_keyfile | per-call | string | <data_dir>/curve_server.cert | SOL_ZMQ_CURVE_KEYFILE | chumak_cert-format keypair file (z85), mode 0600, gitignored |
zmq_curve_clientkeys | per-call | list | any | SOL_ZMQ_CURVE_CLIENTKEYS | Allowed client public keys (Z85 list); any accepts any |
zmq_transport_plaintext_ack | boot | boolean | false | SOL_ZMQ_TRANSPORT_PLAINTEXT_ACK | Operator acknowledgement for a non-loopback plaintext bind (CRITICAL-logged); refuses boot in prod without it |
zmq_transport_tunnel | boot | string | "" | SOL_ZMQ_TRANSPORT_TUNNEL | Declared encrypted tunnel (wireguard/mtls-sidecar) satisfying the plaintext posture |
zmq_enrollment_keys | per-call | map | #{} | SOL_ZMQ_ENROLLMENT_KEYS | Per-worker keys: #{KeyId => #{worker_id, secret}} (JSON via the env var); a key bound to a worker_id cannot re-register as another worker |
zmq_enrollment_revoked | per-call | list | [] | SOL_ZMQ_ENROLLMENT_REVOKED | Revoked key ids (comma-separated via the env var) |
zmq_fleet_legacy_compat | per-call | boolean | false | SOL_ZMQ_FLEET_LEGACY_COMPAT | Fleet-secret (SOL_ZMQ_WORKER_SECRET) registration window; deprecation 2026-11-01 |
zmq_fleet_legacy_compat_until | boot | string | — (unset) | SOL_ZMQ_FLEET_LEGACY_COMPAT_UNTIL | : the dated compat window (ISO YYYY-MM-DD) — the boot gate CRITICAL-banners while the window is open and REFUSES (fleet_compat_window_expired) once the date has passed; a window without a date stays CRITICAL-banner’d |
zmq_local_enrollment | per-call | boolean | true | SOL_ZMQ_LOCAL_ENROLLMENT | : locally-spawned workers (init-wkr-N, sol_worker spawns) are first-class enrollment clients — the spawn path mints (or reuses, persisted at <data_dir>/zmq_enrollment_local.json, 0600) a per-worker key in the reserved local: namespace bound to the exact worker_id, and the worker env carries LUNA_ZMQ_KEY_ID + the minted secret INSTEAD of the shared fleet secret. false restores the legacy fleet-secret env (which refuses registration while the compat window is closed) |
zmq_registration_plane_ack | boot | boolean | false | SOL_ZMQ_REGISTRATION_PLANE_ACK | : the ack lever for the knowably dead registration plane (fleet secret set + compat closed + no enrollment keys + local minting disabled) — boot REFUSES (zmq_registration_plane_dead) unless this is set (CRITICAL-banner’d) |
zmq_register_rate_limit | per-call | integer | 60 | SOL_ZMQ_REGISTER_RATE_LIMIT | Successful registrations/min PER CREDENTIAL bucket before the rate-anomaly refusal/alarm; a flood on one enrollment key never blocks another |
lane_control_max_per_10s | per-call | integer | 60 | — | : per-identity sliding-window budget for lane-control operations (a remote lease lookup is deferred/refused with a typed rate_limited ack beyond it); bounds the resolver fan-out from one worker. |
zmq_reready_rate_limit | per-call | integer | 30 | — (sys.config only) | : successful re-READYs per identity per 60s for an ESTABLISHED registration before the typed registration_rate_limited refusal. Separate from zmq_register_rate_limit (new identities) and per IDENTITY, so one worker’s flood never spends another’s budget |
zmq_preauth_pipe_limit | per-call | integer | 20 | — (sys.config only) | (ADV-A-02): per-delivering-pipe unregistered-frame replies allowed per 60s window before the pre-identity bucket drops them (counted zmq_preauth_heartbeat_dropped_total); the cap runs before any control reply |
zmq_preauth_global_limit | per-call | integer | 2000 | — (sys.config only) | (ADV-A-02): global ceiling for unregistered-frame replies per 60s window across all delivering pipes |
zmq_reready_resync_cooldown_ms | per-call | integer | 5000 | — (sys.config only) | : per-identity cooldown between READY resyncs (skills/settings/mail), alongside the at-most-one-queued-worker rule. 0 allows back-to-back admitted resyncs (the re-READY budget still bounds the rate) |
zmq_replay_tx_max_age_ms | per-call | integer | 600000 | — (sys.config only) | : frame-tx past-freshness window (ms) — a tx older than this refuses as replay_stale; this is what makes idle replay-tombstone reaping safe. Rows older than the window are reaped on the liveness cadence |
zmq_anonymous_cap | per-call | integer | 1 | — (sys.config only) | : the explicit local-unregistered (dev) posture admits at most this many distinct anonymous identities; an already-registered anonymous identity reconnects freely. Provision enrollment keys or raise this explicitly |
zmq_identity_binding | per-call | atom | strict | SOL_ZMQ_IDENTITY_BINDING | : the READY-path identity invariant. strict — the routing identity must equal the claimed worker_id (a wildcard "*"-bound key binds to its CLAIMED worker_id, so it no longer accepts arbitrary identity/worker_id pairs); provisioned — the enrollment record’s optional identity field must equal the routing identity. Refusals are typed (identity_mismatch / worker_id_missing / key_binding_invalid) and counted in sol_zmq_registration_refused_total{reason}. Invalid values refuse the boot (sol_config battery) |
zmq_identity_binding_ack | per-call | boolean | false | SOL_ZMQ_IDENTITY_BINDING_ACK | : the ack lever for zmq_identity_binding=provisioned — boot REFUSES while any loaded enrollment record lacks the identity field unless this is set (CRITICAL-banner’d; those keys refuse registration with key_binding_invalid) |
zmq_identity_ceiling | per-call | integer | 4096 | SOL_ZMQ_IDENTITY_CEILING | : the replay-identity ceiling — a NEW identity’s registration refuses (identity_ceiling_reached) once this many identities are tracked in the identity-lifetime replay tombstone stores (sol_zmq_frame_tx / sol_zmq_ready_ctr; re-registration of a tracked identity never refuses). Exported as the sol_zmq_replay_rows_tx/sol_zmq_replay_rows_ctr gauges; SolZmqReplayRowsGrowth pages at 80%. Range 1–100000 |
zmq_wire_skew_window | per-call | boolean | true | SOL_ZMQ_WIRE_SKEW_WINDOW | : admits a READY at the N−1 protocol version (version = current−1) during a rolling upgrade; task frames to that worker are stamped min(SolVersion, WorkerVersion) so its inbound validator accepts them. false restores strict version equality. Skew is counted by the sol_zmq_fleet_skew{version} gauge and WARNING-logged at registration |
task_timeout_ms | boot | integer | 300000 | SOL_ZMQ_TASK_TIMEOUT_MS | Task idle deadline (ms); 0 disables the GATEWAY deadline. Since the deadline is re-armed by token/heartbeat progress (progress-renewed lease); a task with no frames for this long resolves to the task_timeout terminal error (sol_zmq_gateway.erl). (XS-07): the task frame never omits the field — a disabled deadline is stamped with the shared 24h sentinel (docs/fixtures/task_timeout_contract.json, disabled_wire_sentinel_ms=86400000) so Luna’s max(task_timeout_ms or 300000, 30000) wedge watchdog cannot preempt Sol’s decision. A per-task timeout_ms in dispatch opts overrides it |
task_max_lifetime_ms | boot | integer | 1200000 | SOL_TASK_MAX_LIFETIME_MS | : total-lifetime cap (ms) of the progress-renewed task lease — a chatty-but-endless task is cancelled at the cap even while it streams; 0 = uncapped. Range 0–86400000 |
task_lease_renewal | boot | boolean | true | SOL_TASK_LEASE_RENEWAL | : the lease-renewal rollback lever — false reverts to the legacy dispatch-armed deadline (no progress re-arm; the lifetime cap becomes unreachable in practice) |
token_shed_window_ms | per-call | integer | 5000 | SOL_TOKEN_SHED_WINDOW_MS | : the sustained-pause token shed window (ms) — only after a pause this long does the recv dispatcher shed a bounded fraction (every 2nd) of token frames, counted in zmq_token_shed_total and surfaced as truncated on the terminal row (honest truncation). 0 = off (tokens unsheddable) |
orchestrator_lease_enabled | per-call | boolean | true | SOL_ORCHESTRATOR_LEASE_ENABLED | : the single-writer lease (requires mango_auth_enabled=true; otherwise disabled). A second Sol boot against the same Mango refuses typed ({refuse_boot, {orchestrator_lease_held, Holder}}); a lease LOST at runtime self-fences the gateway (dispatch quiesced).: Mango unreachable at boot resolves the DURABLE marker — a confirmed holder stays unknown only inside the 30s TTL and self-fences on the wall-clock deadline (background retry active), while a NEVER-confirmed boot HOLDS dispatches by default (gateway quiesced; /ready 503) unless orchestrator_lease_stale_hold_ack=true preserves the historical unfenced posture |
orchestrator_lease_takeover | per-call | boolean | false | SOL_ORCHESTRATOR_LEASE_TAKEOVER | : the operator takeover lever (there is no Sol CLI parser — this env/config ack replaces the phase’s --takeover). Forces the lease CAS to this node (epoch+1); the old holder loses its next heartbeat and self-fences |
orchestrator_lease_stale_hold_ack | per-call | boolean | false | SOL_ORCHESTRATOR_LEASE_STALE_HOLD_ACK | : the never-confirmed-boot / stale-hold acknowledgement. Default false = an unconfirmed lease HOLDS dispatches (gateway quiesced) and /ready is 503 (fail closed). true preserves the historical unfenced boot (dispatch + readiness stay available) and is the only way an unknown/stale lease row is not a readiness error. A fenced verdict is never cleared by this lever |
orchestrator_lease_max_missed_heartbeats | per-call | integer | 2 | SOL_ORCHESTRATOR_LEASE_MAX_MISSED_HEARTBEATS | : k consecutive 10s heartbeat transport failures (default 2 = 20s, inside Mango’s 30s lease TTL) after which a CONFIRMED holder self-fences. Non-consecutive blips never fence; a never-confirmed boot uses the ack lever above. A durable marker keeps a confirmed-then-stale/fenced verdict across a gateway or node restart |
memory_recovery_barrier_ms | per-call | integer | 5000 | SOL_MEMORY_RECOVERY_BARRIER_MS | : the bound on the WAL recovery drain that runs BEFORE the ETS read model hydrates. On timeout/queued ops hydration is HELD (memory_recovery_deferred, critical log + hydration_status/0 recovery=deferred) and retried on the cleanup tick — never a silent stale serve |
orchestrator_lease_heartbeat_ms | per-call | integer | 10000 | SOL_ORCHESTRATOR_LEASE_HEARTBEAT_MS | : lease heartbeat cadence (ms); Mango’s lease TTL is 30s. Range 100–600000.: the CONFIRMED-holder fence deadline is min(k × heartbeat, 30000) measured on the wall clock from the last confirmation and is (re-)armed on EVERY successful confirmation (and on a transport failure), not only when a heartbeat fails — a configured heartbeat longer than the TTL self-fences at the TTL even if no tick or failure ever occurs inside the stealable window |
The #state{} record in server/include/sol_zmq.hrl has internal fallback
defaults (worker_cap=256, listener_cap=1024, pid_cap=1024,
heartbeat_timeout_ms=45000, max_queue_depth=10000). The shipped
sys.config overrides these; the values above are what operators get.
The trust-plane keys above (zmq_curve_*, zmq_transport_*,
zmq_enrollment_*, zmq_fleet_legacy_compat, zmq_register_rate_limit)
and task_timeout_ms are documented in depth in
zmq-security.md and
zmq-protocol-reference.md; the rows here pin
their env mappings so every entrypoint/sol_app read has a documented lever
.
Cluster
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
inet_dist_listen_min / inet_dist_listen_max (kernel) | boot | integer | — (unset → random dist port) | SOL_DIST_PORT | When set, the container entrypoint (server/bin/entrypoint.sh) renders a kernel section pinning the Erlang distribution listener to this single port (min = max) — cluster deployments pin one port through firewalls (the live cluster uses 9150). Unset/empty = no pins, exactly the pre-cluster random-port behaviour. Range 1–65535; a non-integer or out-of-range value REFUSES the boot (exit 78) instead of rendering invalid Erlang. |
cluster_nodes | boot | list | [] in sys.config and in the shipped sys.prod.config | SOL_CLUSTER_NODES | Seed nodes pinged at boot (sol_cluster init) and rendered into sys.config by the container entrypoint. Grammar (validated at BOTH layers — entrypoint render time and sol_app:nodes_val/1; malformed values are a loud typed boot refusal, never a silent drop): the Erlang list literal ['sol@peer1','sol@peer2'] (canonical — what the wild create scripts set), or the bare comma-separated form sol@peer1,sol@peer2, or [] for none. Names must be longnames (exactly one @, local@host, ≤253 chars); short names are refused — unqualified peers pang-fail against FQDN nodes. The union list is self-filtering (sol_cluster drops the local node before probing), so every node may ship the same list; wild’s per-host SOL_CLUSTER_NODES env still wins where set. The config-file [clustering] nodes value is normalized through the SAME grammar at apply time — a malformed value refuses the file (typed invalid_config) and applies NO keys (all-or-nothing). Seeds are re-probed asynchronously and on every 30s resync tick while unconnected (bounded: one probe per seed, bounded by the seed list). |
cluster_expected_nodes | per-call | integer | 1 | SOL_CLUSTER_EXPECTED_NODES | Expected cluster node count, self included. Exposed as sol_cluster_expected_nodes{deployment}; the alert rule sol-cluster-expected-nodes (observability/grafana/alerting/sol-alerts.yml, warning, for 5m) fires when sol_cluster_node_count < sol_cluster_expected_nodes. The sol_config default is 1 (key absent); a SEPARATE unset derivation lives in the sol_prometheus metric reader — max(1, length(cluster_nodes) + 1) (sol_prometheus:cluster_expected_nodes/0, the gauge fallback when the key is unset). That reader-level derivation is not the configuration default: with a 3-node union list it yields 4, a false-negative on the exact day a node drops, which is why a fleet deployment pins the value (wild’s per-host SOL_CLUSTER_EXPECTED_NODES); the shipped artifact pins the standalone 1. |
cluster_leave_persist | per-call | boolean | false in dev, true in prod | — | (OTP-10): persist the cluster-left set to <data_dir>/cluster_left.json through sol_durable_file so sol_cluster:leave survives a consumer restart and a VM restart. Prod always persists; dev/test keeps the historical memory-only set unless the operator sets cluster_leave_persist=true (a CT-case leave cannot poison successor suites). |
cluster_version_guard_ack | per-call | boolean | false (pinned in sys.config + sys.prod.config) | — | : the Sol↔Sol join-guard acknowledgement. The join guard is DEFAULT-ON (join generation N/N−1 admitted + sol_cluster_version_skew gauge + the maintenance-503 posture marker; N−2/newer-than-N+1 and schema-epoch mismatches REFUSED + peer disconnected). true downgrades a refusal to a CRITICAL-logged ACKED admission for a DELIBERATE mixed-version/schema drill only — never a silent pass. See docs/version-matrix.md §Sol ↔ Sol. |
cluster_deployment | per-call | string | default; the shipped sys.prod.config pins "blue-red-green" | SOL_CLUSTER_DEPLOYMENT | Deployment label stamped on sol_cluster_node_count / sol_cluster_expected_nodes — one series pair per labeled deployment. |
node_host | per-call | string | "127.0.0.1" | SOL_NODE_HOST | Hostname suffix for node |
node_name (-name in vm.args) | boot | string | sol@zerg-sol | SOL_NODE_NAME | Erlang distribution node name rendered into vm.args by the container entrypoint. The cluster era requires a longname (local@host, e.g. sol@zerg-sol.example.com or sol@192.168.100.2) — short names pang-fail against FQDN peers. Must be identical to the name peers put in SOL_CLUSTER_NODES |
allow_schema_drift | boot | boolean | false | — | : the boot schema-drift ack. When false, a local disc table whose disc_copies name a node outside cluster_nodes ∪ {self} REFUSES boot ({refuse_boot, {foreign_schema_nodes, Nodes}}). true boots WARNING + mnesia_schema_drift_boot_total for the documented repair window only. |
mnesia_backup_interval | per-call | integer (seconds) | 3600 | — | Mnesia backup interval. Range 0–86400 (sol_config.erl optional battery — seconds, not ms) |
mnesia_disc_fallback | per-call | ram | refuse | ram | — | : posture when a store cannot create its disc_copies table. ram keeps the historical availability behavior but logs CRITICAL and counts mnesia_disc_ram_fallback_total (the store is RAM-only until the schema dir is repaired); refuse fails the store’s init so boot refuses the silent downgrade. |
mnesia_backup_dir | boot | string | anchored <mnesia_dir>/backups (sys.config ships /tmp/sol/mnesia_backups; prod /var/lib/sol/data/mnesia_backups; the container entrypoint derives it from SOL_DATA_DIR) | SOL_MNESIA_BACKUP_DIR (container render) | Mnesia backup destination. Resolution order: this config key > anchored <mnesia_dir>/backups. Set it ABSOLUTE — a CWD-relative value silently orphans backups on a different-CWD restart. mnesia_backup_retention_days (default 7) prunes by age; MAX_BACKUPS=5 is a per-UTC-day cap, not a global one |
maintenance_drain_deadline_ms | per-call | integer | 5000 | — | (CORE-01): deadline for the maintenance-enable drain (sol_maintenance). Range 100–60000; out-of-range values fall back to 5000. A drain timeout leaves the gate ENABLED and returns a typed error (never a silent bypass). |
mnesia_dir | boot | string | anchored <data_dir>/mnesia when unset; /var/lib/sol/data/mnesia in sys.prod.config | SOL_MNESIA_DIR | Mnesia data directory. The standalone prod profile pins it under the unit’s writable state root; the container render derives it from SOL_DATA_DIR. An unset value in a prod boot whose data_dir is also unset/relative refuses typed ({mnesia_dir_unset, _}), never a silent CWD schema |
Container Entrypoint (server/bin/entrypoint.sh)
The canonical container entrypoint translates SOL_* env into the release
sys.config + vm.args before exec’ing the BEAM. Beyond the keys mapped
elsewhere in this reference, it reads these path/layout vars (all optional;
unset = the container defaults shown). The former OTLP and
plugin_system_dir/templates_dir sys.config renders were DELETED — none
had an in-VM reader (the OTLP facade was retired in; system
plugins are the bundled priv/plugins root; ).
| Env Var | Default | Description |
|---|---|---|
SOL_ROOT | /opt/sol | Release root the entrypoint probes for the BEAM runtime ($SOL_ROOT/erts-*/bin/erl) when performing the sys.config authority merge; a missing erl binary refuses the boot rather than serving a 32-key-only render |
SOL_MERGE_ERL | — (unset → probed under SOL_ROOT) | Explicit erl binary used for the sys.config authority merge; when set it must be executable, else the probe path is used |
SOL_COOKIE_FILE | ${HOME:-/opt/sol/data}/.erlang.cookie | Distribution cookie file the entrypoint reads/creates for vm.args cookie rendering |
SOL_DIST_TLS_ENABLED | false | : render the distribution-TLS posture into vm.args (-proto_dist inet_tls + -ssl_dist_optfile). Only true/false; true refuses the boot (exit 78) when the optfile is missing — never a silent plaintext boot. |
SOL_DIST_TLS_OPTFILE | /etc/zerg/tls/ssl_dist.conf | Staged Erlang distribution-TLS optfile used when SOL_DIST_TLS_ENABLED=true (wild’s stage-dist-tls.sh writes it). |
SOL_RELEASE_DIR | unset | : explicit release directory for the container entrypoint (wins over all other selectors). With SOL_RELEASE_VSN and the <root>/current symlink, it replaces the pre-fix nondeterministic `ls releases |
SOL_NOFILE_LIMIT | 65536 | : the fd ceiling the entrypoint applies with ulimit -n before exec (>=1024; a hard limit may refuse the raise loudly). The runtime gauges sol_http_nofile_{limit,required,headroom} expose the effective value vs http_max_connections + max_sse_connections + 1024. |
SOL_RELEASE_VSN | unset | : explicit release version directory under $SOL_ROOT/releases/<vsn> (second to SOL_RELEASE_DIR/current); the single-release and bare-image fallbacks are logged. |
SOL_DATA_DIR | /opt/sol/data | Container data root; the entrypoint derives the default SOL_MNESIA_DIR, SOL_AUDIT_LOG_PATH (<data>/logs), SOL_AUDIT_DATA_DIR (<data>/audit-data), SOL_MNESIA_BACKUP_DIR (<data>/mnesia_backups), model/plugin/template dirs from it. data_dir/audit_data_dir/mnesia_backup_dir are RENDERED over the release profile |
SOL_MNESIA_BACKUP_DIR | <SOL_DATA_DIR>/mnesia_backups | : Mnesia backup destination for a container boot; rendered as mnesia_backup_dir over the release profile |
SOL_ETC_DIR | the release dir | Directory the entrypoint writes the rendered sys.config + vm.args into |
SOL_PLUGIN_DIR | <data>/plugins | Container directory the entrypoint CREATES for plugin payloads |
SOL_TEMPLATES_DIR | <data>/templates | Container directory the entrypoint creates for workflow/plugin templates |
SOL_OTEL_ENABLED | false | Accepted for compatibility; NOT rendered and read by no Sol module |
SOL_OTEL_ENDPOINT | http://127.0.0.1:4318 | Accepted for compatibility; NOT rendered, no reader |
SOL_OTEL_SERVICE_NAME | sol | Accepted for compatibility; NOT rendered, no reader |
Circuit Breaker
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
circuit_breaker_failure_threshold | per-call | integer | 5 | — | Failures before circuit opens. Range 1–100 |
circuit_breaker_window_ms | per-call | integer | 60000 | — | Failure counting window (ms). Range 1000–3600000 |
circuit_breaker_cooldown_ms | per-call | integer | 30000 | — | Cooldown before half-open (ms). Range 1000–3600000 |
provider_pool_strategy | per-call | atom | round_robin | — | Provider key selection strategy |
provider_key_store | per-call | boolean or path | true (shipped sys.config; code fallback false — sol_provider_key_store.erl; absent disables the store) | — | : persists OPERATOR-added provider-pool keys (sol_provider_pool:add_key/3, the documented remote-shell ceremony) AES-256-GCM at rest. true derives <data_dir>/provider_keys.bin (0600); a path overrides. Declarative keys stay config/keyring/OAuth-derived and are never copied to the store. A corrupt/unreadable store logs + counts and fails OPEN (the pool still boots) |
provider_key_store_secret | per-call | string | unset | — | : explicit encryption secret for the key store (recommended when the data dir is backed up/shared). Unset → a generated 0600 <store>.key keyfile carries the key |
Cost / Spend Guard
Per-principal daily inference enforcement (sol_spend_guard). The caps are
UTC-day scoped and checked before every streaming ingress dispatch; an
in-flight request is never interrupted, so the overshoot is bounded by the
concurrently admitted requests’ projected usage (see cost.md).
0 disables either axis. A USD cap makes an unpriced model a typed
model_unpriced refusal unless the policy allows it.
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
inference_daily_budget_usd | per-call | number | 0 (disabled) | — | Per-principal daily USD cap. Settled cost comes from sol_cost/sol_model_metadata; 0 disables the USD axis |
inference_daily_token_budget | per-call | integer | 0 (disabled) | — | Per-principal daily token cap (input + output settled). 0 disables the token axis |
inference_unknown_price_policy | per-call | atom/binary | deny | — | With a USD cap enabled: deny refuses unpriced models (model_unpriced); allow admits them and records cost 0 (counted in cost_unknown_price_total / inference_model_unpriced_total) |
inference_spend_reservation_ttl_ms | per-call | integer | 600000 | — | : a parked admission reservation older than this is reclaimed by the lock-scoped sweep on the next reserve for the same principal/day (a caller crash between reserve and dispatch can never hold pending forever). 0 reclaims on the next reserve |
completion_lease_ttl_ms | per-call | integer | 300000 | — | Fixed TTL for the attended lease a /v1/completions request takes on its FIM lane. It must not exceed lane_duration_max_ms (an over-max value is REFUSED with duration_exceeds_max; it is not silently clamped). Keeps one ghost-text request from pinning a big lane for the 15-minute on_demand class |
inference_worker_daily_task_budget | per-call | integer | 0 (disabled) | — | Per-principal daily worker-task cap enforced at every worker-send funnel (ZMQ dispatch, stdio chat/WS/REST sol_worker:send_task/2, one-shot sol_worker_bg, ZMQ background child spawn); counts admitted placements (not tokens), refunded when placement is refused; 0 disables |
inference_daily_budget_overrides | per-call | map | #{} | — | Optional per-user cap overrides keyed by user_uuid: #{<<"uuid">> => #{daily_budget_usd => N, daily_token_budget => N, daily_worker_task_budget => N}}; a missing axis falls back to the global value |
inference_ledger_rebuild_on_boot | per-call | boolean | true | — | (PRV-05): rebuild the per-tenant daily spend ledger from the durable inference.complete event log when the ETS ledger is created (bounded window, deduped by request_id). false skips the rebuild; an absent/degraded event store never blocks admission. |
inference_ledger_rebuild_retry_ms | per-call | integer | 60000 | — | : bounded retry interval for a failed ledger rebuild/reconcile; the boot caller retries after this interval instead of leaving the day empty until the next restart. |
inference_ledger_rebuild_page_size | per-call | integer | 10000 | — | : event-log page size for the boot ledger rebuild; non-positive values fall back to 10000. |
inference_ledger_rebuild_max_events | per-call | integer | 1000000 | — | : cap on events replayed by the boot ledger rebuild; the walk stops at this bound and the ledger continues from the last settled cursor. Non-positive values fall back to 1000000. |
inference_ledger_marker_ttl_ms | per-call | integer | 86400000 | — | : TTL (ms) for the settlement/worker-turn idempotency markers before the bounded prune may delete them (0 = delete on the next pass). Negative values fall back to 24h. |
inference_ledger_prune_interval_ms | per-call | integer | 60000 | — | : minimum interval (ms) between marker-prune passes; a marker row claims the interval so concurrent settles do not re-walk the table. Negative values fall back to 60000. |
Auth / Security
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
auth_enabled | boot | boolean | false (shipped sys.config; sys.prod.config sets true) | SOL_AUTH_ENABLED | Enable Bearer token authentication. false grants the dev principal (permissions=[<<"*">>]) ONLY when deployment_mode=dev AND the request is loopback-topology (peer + forwarded headers); a proxied/non-loopback request is refused typed (auth_disabled_but_proxied) and logged CRITICAL. The non-loopback + auth_enabled=false boot refusal remains (sol_app:validate_auth_boundary/0) |
auth_tokens | boot | list | map | [] | SOL_AUTH_TOKENS | Valid API tokens for Bearer auth (local mode).: entries may carry per-token permissions — [{<<"reader">>, [<<"tasks:read">>]}] (or the map form #{<<"reader">> => [<<"tasks:read">>]}); a bare token keeps the historic * grant and is CRITICAL-logged at boot (the POST /api/v1/lua/eval superuser exposure) until migrated. The SOL_AUTH_TOKENS env form stays the CSV of bare tokens |
auth_exempt_paths | per-call | list | [] (additive) | — | Additional paths that skip auth. Entries are ADDED to the built-in exempt list — see below (sol_auth_middleware.erl ?DEFAULT_EXEMPT_PATHS). The list is read per call but cached in persistent_term; after changing it call POST /api/v1/infra/cache-invalidate (no restart required) |
allow_token_query | per-call | boolean | — (unset → false) | SOL_ALLOW_TOKEN_QUERY | Accept ?token= query-string auth. Deprecated — leaks credentials into proxy logs (sol_auth_middleware.erl) |
rate_limit_enabled | boot | boolean | true | SOL_RATE_LIMIT_ENABLED | Per-token request rate limiting. Posture split: code default is ON (sol_auth_middleware.erl rate_limit_default/0), the shipped dev sys.config sets false (explicit off) and sys.prod.config sets true. When the dedicated limiter is enabled, accounting uses rate_limit_rpm/rate_limit_burst; the middleware’s built-in per-token budget (used before/without the limiter process) is 300 rpm + 30 burst (?RATE_LIMIT_RPM_DEFAULT/?RATE_LIMIT_BURST_DEFAULT) |
rate_limit_rpm | boot | integer | 60 | SOL_RATE_LIMIT_RPM | Requests per minute per key (dedicated sol_rate_limiter; default 60 also in sol_security_sup.erl fallback). Range 1–100000 |
rate_limit_burst | boot | integer | 10 | SOL_RATE_LIMIT_BURST | Burst capacity (dedicated limiter). Range 1–10000 |
rate_limit_principal | per-call | atom | ip+token | SOL_RATE_LIMIT_PRINCIPAL | : bucket principal. ip+token (default): every request consumes the resolved peer-IP bucket pre-auth and, after a successful token validation, the verified-token bucket. ip: rollback lever — the token bucket is never consulted |
rate_limit_ip_rpm | per-call | integer | 60 (shipped sys.config; the built-in middleware code fallback is 300 — sol_auth_middleware.erl ?RATE_LIMIT_RPM_DEFAULT) | SOL_RATE_LIMIT_IP_RPM | : per-IP requests/minute enforced on BOTH limiter paths; the shipped configs set 60/10 per class explicitly. Range 0–100000. Shared/NAT deployments raise this without weakening the per-token budget |
rate_limit_ip_burst | per-call | integer | 10 (shipped sys.config; the built-in middleware code fallback is 30 — sol_auth_middleware.erl ?RATE_LIMIT_BURST_DEFAULT) | SOL_RATE_LIMIT_IP_BURST | : per-IP burst for the built-in default budget. Range 0–10000 |
rate_limit_token_rpm | per-call | integer | 60 (shipped sys.config; the built-in middleware code fallback is 300 — sol_auth_middleware.erl ?RATE_LIMIT_RPM_DEFAULT) | SOL_RATE_LIMIT_TOKEN_RPM | : per-token requests/minute enforced on BOTH limiter paths; the shipped configs set 60/10 per class explicitly. Range 0–100000 |
rate_limit_token_burst | per-call | integer | 10 (shipped sys.config; the built-in middleware code fallback is 30 — sol_auth_middleware.erl ?RATE_LIMIT_BURST_DEFAULT) | SOL_RATE_LIMIT_TOKEN_BURST | : per-token burst for the built-in default budget. Range 0–10000 |
locality_secret | per-call | string | — (unset) | SOL_LOCALITY_SECRET | (HTTP-03): the POSITIVE host-locality proof for the tokenless /metrics + /api/v1/metrics gate and the auth-disabled dev principal. When set (≥16 bytes), an on-host proxy must inject x-zerg-locality: <unix-seconds>:<hex HMAC-SHA256(secret, METHOD "\n" PATH "\n" TIMESTAMP)> (acceptance window ±300 s, constant-time compare); loopback topology alone then no longer suffices. Unset requires an explicit loopback Host authority in addition to loopback topology — reported at boot as EXPLICIT-LOOPBACK and on first gated request with a one-time WARNING. A configured secret shorter than 16 bytes fails CLOSED (FAIL-CLOSED boot datum). Contract in security.md |
trusted_proxies | per-call | list | comma-string | [127.0.0.1] | SOL_TRUSTED_PROXIES | : TCP peers allowed to set X-Forwarded-For/X-Real-IP. Bare IPs and CIDR entries (10.0.0.0/8) both match; invalid entries drop fail-safe with a warning, a /0 CIDR drops with a CRITICAL unless allow_global_trust=true, and an invalid (or /0-unacknowledged) SET value refuses the boot (sol_net:validate_trusted_proxies/1). Client-IP resolution is the Mango-parity rightmost-untrusted walk with the anti-mint-loopback rule |
allow_global_trust | per-call | boolean | false | SOL_ALLOW_GLOBAL_TRUST | : ack lever for a /0 entry in trusted_proxies (trust-everything deployments). Without it the entry is dropped, and a boot with it set refuses (sol_config:http_trust_config_violations/0) |
legacy_write_implies_execute | per-call | boolean | true | SOL_LEGACY_WRITE_IMPLIES_EXECUTE | : the coarse rule granting execute-class permission from write-class. Kept true for existing installs; new installs set false (execute-grade tools then require tasks:execute). Migration note in security.md |
permission_max_pending | per-call | integer | 100 | — | : maximum outstanding permission asks the registry keeps; beyond it new asks are refused typed (backpressure, never an unbounded queue). Code fallback 100 — sol_permission_registry.erl ?MAX_DEFAULT_PENDING |
worker_control_timeout_ms | per-call | integer | 10000 | — | : bounded wait for a chat worker session_control reply (branches/snapshots/restore); a timeout is a typed control_timeout, never a worker kill |
Cluster scope of the limiter: the
limiter’s distributed mode is wired but UNEXERCISED in production —
the mechanism is a distributed => true start option on
sol_rate_limiter (joins a pg scope and sums remote counts), but the
production security supervisor passes only {enabled, rpm, burst} and
there is no env/config key that flips it. Per-node budgets are the
recorded posture: N nodes ⇒ up to N× the effective budget per principal.
A distributed limiter is a successor design item only if per-account
global budgets become a requirement.
Deleted key: the Sol-side “Cluster API key” app-env key
(api_key, placeholder REPLACE_WITH_GENERATED_KEY) was removed — it had
No Sol reader and the entrypoint rendered a second spelling with zero
consumers. Cluster API auth is RBAC tokens (auth_tokens). The similarly
named environment variable consumed by the Luna client as its bearer
token is client configuration, documented with the client (not a Sol boot key).
ci/config_consumer_lint.py now also fails when an entrypoint-rendered
app-env key has no read site.
Mango bridge (Sol-side keys)
These are Sol app-env keys that configure Sol’s client connection TO the
Mango identity service — Mango’s own service config lives in mango/conf.py
(see §Related configuration surfaces).
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
mango_auth_enabled | boot | boolean | false | SOL_MANGO_AUTH_ENABLED | Delegate auth to Mango (mango_host:mango_port). When true, mango_service_token is required |
mango_host | boot | string | "127.0.0.1" | SOL_MANGO_HOST | Mango auth/identity service host |
mango_port | boot | integer | 5800 | SOL_MANGO_PORT | Mango service port |
mango_service_token | boot | string | "" | SOL_MANGO_SERVICE_TOKEN | Service token for Sol→Mango calls. Placeholder REPLACE_WITH_GENERATED_SECRET is a fatal boot error |
mango_pub_url | boot | string | — (unset) | SOL_MANGO_PUB_URL | Mango public-facing URL (for redirects) |
mango_tls | boot | boolean | false | SOL_MANGO_TLS | TLS for Sol→Mango |
mango_ca_file | per-call | string | — (unset) | SOL_MANGO_CA_FILE | CA bundle for Sol→Mango TLS |
mango_transport_tunnel | boot | string | "" | SOL_MANGO_TRANSPORT_TUNNEL | Tunnel marker exempting Sol→Mango from the plaintext refusal |
Audit & recording
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
audit_hmac_secret | per-call | string | undefined | SOL_AUDIT_HMAC_SECRET | HMAC key for the audit log tamper-evidence chain. Must be stable across restarts — random keys break the chain. : prod + unconfigured secret REFUSES BOOT unless audit_chain_ephemeral_ack=true (the chain is then valid within one run only — verify_integrity/1 flags pre-restart segments after every restart); dev/loopback keeps the historical warn posture. The boot log records the secret’s provenance (provisioning env vs sys.config).: the container entrypoint renders this as base64 in sys.config (sol_app:decode_b64_secrets/0 decodes it before validation), so quotes/newlines in the secret cannot break the rendered term. (CORE-3): the b64: rendering is decoded on BOTH config arms — a SOL_AUDIT_HMAC_SECRET="b64:<base64>" process-env value is normalized after the env override pass (malformed base64 on either arm is a typed boot refusal) |
audit_chain_ephemeral_ack | boot | boolean | false | SOL_AUDIT_CHAIN_EPHEMERAL_ACK | : explicit acknowledgment letting a prod boot start WITHOUT audit_hmac_secret. CRITICAL-banner’d; the tamper-evidence chain is valid within a single run only |
audit_log_path | per-call | string | "/opt/zerg/logs" (code fallback); /var/lib/sol/data/logs in sys.prod.config | SOL_AUDIT_LOG_PATH | Directory (not a file). Daily files audit-YYYYMMDD.jsonl. moved the prod/container default under the data root. The shipped systemd unit overrides it to /var/log/sol/audit (its LogsDirectory), which is equally writable |
audit_data_dir | boot | string | "/opt/zerg/data" (code fallback ?DEFAULT_DATA_DIR, sol_audit_log.erl); /var/lib/sol/data/audit-data in sys.prod.config | SOL_AUDIT_DATA_DIR | Audit chain state directory (chain checkpoint + seq/sig sidecars). moved the prod/container default under the data root |
audit_enabled | per-call | boolean | — (unset → true, sol_audit_log.erl) | SOL_AUDIT_ENABLED | Master audit switch |
audit_verify_interval_ms | per-call | integer (ms) | 300000 | — | : cadence of the scheduled anchored audit-chain verification (runs in a monitored side process; values below 100 fall back to the default). The verdict feeds audit_chain_verified_seq/audit_chain_last_verify_timestamp; staleness pages via the dead-man rule. |
Auth-exempt paths (as-implemented)
Generated source: the auth-exempt and maintenance-exempt lists are single-sourced from
sol_auth_middleware.erl(?DEFAULT_EXEMPT_PATHS+is_maintenance_exempt/1) and rendered intodocs/auth-flow.mdbyci/docs_constant_parity_lint.py --write. Do not hand-copy the lists here; the generated block is the only inventory and the parity lint gates it.
Semantics: a request with no token on an exempt path runs FULL RBAC as
anonymous; exempt means “no token required”, never “skip
authorization”. /api/v1/ready runs 19 subsystem checks (503 when degraded).
/metrics is not auth-exempt: a tokenless scrape is
allowed only when the loopback TOPOLOGY holds (the TCP peer, not proxy
headers), otherwise it needs metrics:read. Cookie-leg logout still requires
the zerg_csrf double-submit pair; /api/v1/webhook/ is unauthenticated by
design because the per-channel signature IS the auth; the WS one-time ticket
is honored only on the WS handshake route.
Retry-After: three shapes (as-implemented)
Retry-After is emitted in three different shapes depending on the producer
(they are NOT interchangeable — parse both the header and the body):
| Shape | Where | Example |
|---|---|---|
| Header only | 429 seat/worker capacity denials — sol_http_chat.erl capacity_reply (429 seat_cap_reached / max_workers_reached) | Retry-After: 1 + body {"ok":false,"error":"seat_cap_reached"} |
| Body-embedded only | 429 bulk worker-mgmt soft-cap — sol_http_worker_mgmt.erl (429 cap_reached) | body {"error":"cap_reached","retry_after":"30","results":[...]} (NO header) |
| Header + body-embedded | 429 auth rate limit — sol_auth_middleware.erl do_auth (rate-limit path) | Retry-After: <N> + body {"error":"rate_limited","retry_after":<N>} |
Auth-rate-limit saturation is a fail-closed 503 + Retry-After
(rate_limiter_unavailable), never a 401.
Provider Routing
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
default_routing | per-call | map | — | — | Default routing policy per capability mode (build/plan/general) (config-file routing section, sol_config_file.erl) |
provider_mappings | per-call | list | [] | — | Model-to-provider routing overrides: a list of {ModelName, ProviderAtom} pairs (sol_provider_boot:register_config_mappings/0 accepts ONLY is_list/1). A map was previously documented and silently ignored — changed the shipped profile to [] and ci/config_divergence_lint.py now refuses a non-list shape (boot validation lives in the config/CI layer until the provider-boot module is touched). |
allow_insecure_provider_http | per-call | boolean | false | — | (PRV-12): explicit ack allowing a NON-loopback http:// provider endpoint (config or a declarative provider’s allow_insecure_provider_http). The default REFUSES plaintext remote endpoints (the provider key would travel in cleartext) and counts provider_plaintext_refused_total; https:// is always accepted (case-insensitive) and loopback http:// needs no ack. |
provider_trusted_egress_ack | per-call | boolean | false | — | : the operator-trusted PROVIDER egress ack. With the ack, declarative registration accepts LOOPBACK endpoints (any scheme — plaintext never leaves the host) and PRIVATE/LAN endpoints over https:// only, stamping trusted_target into the registry POpts so the pipeline pin allows the private/loopback target. Default (and LAN plain-http:// even when acked) REFUSES with ssrf_rejected; webhooks keep the unconditional sol_http_validation SSRF gate. |
cluster_trust_cidrs | per-call | string | [] | — | : comma-separated IPv4 CIDR allowlist of cluster-local networks (e.g. "10.0.0.0/8,192.168.0.0/16"). A remote provider target whose RESOLVED address falls inside a listed CIDR is pinnable without a per-provider trusted_target stamp — the operator-declared list IS the trust. Default empty: no cluster exemption. |
ollama_url | per-call | string | "http://localhost:11434" | — | Ollama API base URL |
oauth_redirect_uri | per-call | string | "http://127.0.0.1:21337/callback" | — | OAuth redirect URI for the PKCE browser-login flow. Override it when 21337 is taken; only loopback redirect URIs are bindable by the CLI. |
oauth_allow_loopback_http | per-call | boolean | false | — | : explicit ack permitting http:// OAuth authorize/token URLs ONLY when the host is loopback (a local test IdP). The default refuses with the typed insecure_oauth_url; https:// always goes through the pinned-IP SSRF validator. |
Provider pipeline
Timeout keys of the remote-provider request pipeline (sol_pipeline.erl;
the total default strictly exceeds first-token + idle):
| Key | Restart | Default | Description |
|---|---|---|---|
provider_request_timeout_ms | per-call | 300000 | Total budget — armed at the FIRST connect attempt, covers pinning + connect + body |
provider_first_token_timeout_ms | per-call | 60000 | Max wait for the first token |
provider_idle_timeout_ms | per-call | 30000 | Max inter-token gap (stall detection) |
provider_bodyless_200_grace_ms | per-call | 500 | (BVI-052): grace window (ms) for a 200 response that has not produced a first token yet before the pipeline types the terminal empty_response (0 disables the fast-fail and restores the historical first-token-budget wait; clamped 0–10000) |
provider_max_retries | per-call | 2 | Connect retry budget (exponential backoff + jitter) |
provider_stream_flow_window_bytes | per-call | 102400 | : the streaming flow-control window (gun flow credit trigger; never a truncation point). Minimum 1024. |
provider_sse_event_max_bytes | per-call | 1048576 | : the SSE EVENT cap — the parser-residual bound. Separate from the flow window so one legal >100 KiB event is not fatal; a boundary-less residual that reaches this cap is a typed oversized_sse_event. Minimum 1024. |
provider_anthropic_version | per-call | 2023-06-01 | : the anthropic-version header value Sol sends on every anthropic-wire request (sol_provider_wire:anthropic_version/0; config-overridable for future Messages-API rollouts) |
provider_response_max_bytes | per-call | 1048576 | Non-streaming response cap (breach → output_exceeded_cap + circuit failure) |
provider_tls_cacerts | per-call | OTP bundled cacerts | CA list for TLS provider endpoints (SNI + verify_peer under IP pinning) |
provider_gun_up_watchdog_ms | per-call | 10000 | Gun-up watchdog (defaults to 2× the ?CONNECT_TIMEOUT macro) |
provider_conn_reuse | per-call | true (shipped sys.config; absent = disabled) | : per-target idle gun connection reuse. HTTP/1.1 only: a conn is checked out exclusively (no pipelining), liveness-probed before reuse, and checked in ONLY on a clean fully-consumed 2xx terminal; every error/interrupted path closes it. Test VMs leave it off so a mocked gun conn is never pooled |
provider_conn_pool_idle_ms | per-call | 30000 | Idle age at which the reaper closes a pooled conn |
provider_conn_pool_reap_ms | per-call | 5000 | Reaper sweep cadence |
provider_conn_pool_max_idle_per_target | per-call | 4 | Idle-conn cap per {transport, host, port, SNI} target (oldest evicted) |
provider_conn_pool_max_idle | per-call | 32 | Total idle-conn cap across targets (the fd bound) |
The TCP connect timeout itself is the ?CONNECT_TIMEOUT macro — 5000 ms,
not operator-configurable.
Retry taxonomy: a 429/503 at the response head is transient —
one bounded retry, then terminal; any other 4xx/5xx is terminal
({http_error, Status} + circuit failure); connect exhaustion is terminal
({connect_exhausted, Host, Port}); TLS handshake/verification failures are
permanent, single-attempt. Mid-stream retry never happens. The streaming
chunk window (?MAX_BUFFER_BYTES, 102400) is a flow-control trigger —
parser residuals are always preserved across chunk boundaries, and
overflows are counted (buffer_overflow metric).
Memory, Embedding & Vector Storage
Read consistency: per-key reads read through to PostgreSQL
on an ETS miss; the stats/reflections enumeration reads are served by
sol_memory_read from the NODE-LOCAL sol_memory ETS read model hydrated from
PG. A row written on another cluster node becomes visible after that node
re-reads/hydrates, not immediately.
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
memory_pg_enabled | boot | boolean | false | SOL_MEMORY_PG_ENABLED | Persistent memory via PostgreSQL |
memory_pg_url | per-call | string | "" | SOL_MEMORY_PG_URL | PostgreSQL connection URL |
memory_pg_pool_size | per-call | integer | 4 | SOL_MEMORY_PG_POOL_SIZE | General DB connection pool size. Range 1–64 |
memory_pg_ssl | per-call | boolean | false | SOL_MEMORY_PG_SSL | PG TLS for the memory pool. true requires memory_pg_ca_file; the connection is verify_peer — never blind encrypt. An ssl-without-CA connect refuses loud (typed {refuse_pg_connect, pg_ca_file_required}) |
memory_pg_ca_file | per-call | string | "" | SOL_MEMORY_PG_CA_FILE | CA bundle for memory_pg_ssl. Path to the PG server CA certificate; unreadable/absent with ssl on refuses the connection |
memory_hydrate_max_entries | per-call | integer | 100000 | — | (EV-02b): the ETS read-model TOTAL cap — hydration stops at this bound with the truncated datum (hydration_status/0) instead of fighting the owner’s eviction sweep forever |
memory_max_entries | per-call | integer | 100000 | — | (EV-02b): the sol_memory ETS cap. The owner’s sweep evicts the OLDEST rows up to memory_cap_eviction_budget per 60 s pass until the table fits |
memory_cap_eviction_budget | per-call | integer | 5000 | — | (EV-02b): per-sweep eviction budget (rows). A 2×-over table converges in ~10 passes |
memory_wal_batch_size | per-call | integer | 50 | — | WAL batch size. Range 1–10000 |
memory_wal_flush_ms | per-call | integer | 100 | — | WAL flush interval. Range 100–60000 |
memory_http_durable_writes | per-call | boolean | false | — | : HTTP memory writes use the durable ack contract (ok only after the WAL drained / PG committed; an unconfirmed flush answers 503). Default false = cache-durable (RAM-crash-safe; power-loss-durable to the last WAL flush) |
task_store_backend | per-call | enum | ets | — | : the task-store behaviour seam selector. ets is the existing ETS+Mnesia adapter (sol_task_store_ets); any other value refuses boot via sol_config:validate_optional/0. The PG backend is a documented follow-on (see server/src/sol_task_store_backend.erl) |
pg_query_timeout_ms | per-call | integer | 10000 | SOL_PG_QUERY_TIMEOUT_MS | Per-query statement/socket bound; a hung query is killed and its connection culled. Range 100–600000 |
pg_pool_max_lease_ms | per-call | integer | 300000 | SOL_PG_POOL_MAX_LEASE_MS | Last-resort lease-age bound: a lease older than this is reclaimed with a CRITICAL log, its connection culled, and the reconnect ladder armed. Must be greater than pg_query_timeout_ms. Range 1000–3600000 |
pg_pool_health_reserved | per-call | integer | 1 | SOL_PG_POOL_HEALTH_RESERVED | Reserved health-probe connections, added on top of memory_pg_pool_size and never handed to general callers. Must be less than memory_pg_pool_size (out-of-range values are clamped loudly). 0 = probe through the general pool without queueing. Range 0–63 |
pg_reconnect_delay_ms | per-call | integer | 5000 | SOL_PG_RECONNECT_DELAY_MS | PG reconnect backoff. Range 100–300000 |
pgvector_enabled | per-call | boolean | false | SOL_PGVECTOR_ENABLED | pgvector storage (requires pgvector extension + memory_pg_enabled=true). Opt-in per |
pgvector_similarity_threshold | per-call | float | 0.75 | — | Cosine similarity cutoff |
embedding_enabled | per-call | boolean | false (shipped sys.config; code fallback is conditional — true when memory_pg_enabled=true AND memory_pg_url is set — sol_embedding.erl) | — | Compute embeddings |
embedding_backend | per-call | atom | ollama | — | Embedding backend |
embedding_model | per-call | string | "nomic-embed-text" | — | Embedding model id |
embedding_url | per-call | string | "http://localhost:11434" | — | Embedding backend URL |
embedding_api_key | per-call | string | unset | — | Optional bearer for an authenticated embedding backend (sent as Authorization: Bearer …) |
embedding_dimension | per-call | integer | 768 | — | Embedding vector dimension |
memory_decay_enabled | per-call | boolean | false (shipped sys.config; code fallback true — sol_memory_decay_worker.erl) | — | Exponential memory decay |
memory_decay_interval_ms | per-call | integer | 3600000 | — | Decay sweep. Range 60000–86400000 |
memory_forget_threshold | per-call | float | 0.1 | — | Weight below which a memory is forgotten |
memory_decay_halflife_seconds | per-call | integer | 86400 | — | Decay half-life (24h). Range 3600–2592000 |
memory_reflection_enabled | per-call | boolean | false | — | Background reflection/consolidation pass |
memory_reflection_interval_ms | per-call | integer | 21600000 | — | Reflection sweep (6h). Range 60000–86400000 |
memory_reflection_cluster_threshold | per-call | float | 0.85 | — | Similarity to merge memories |
memory_reflection_min_cluster_size | per-call | integer | 5 | — | Minimum cluster size before consolidation |
Embeddings use the embedding_* family. No memory_embed_model key exists.
Related typed-guard keys validated by the optional battery:
embed_max_concurrency (range 1–64), embed_max_queue (1–10000).
Scheduler
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
max_scheduled_jobs | per-call | integer | 1000 | — | Global maximum scheduled jobs (429 max_jobs_reached on exceed). Range 1–10000 |
max_scheduled_jobs_per_user | per-call | integer | 100 | — | Per-user quota of active (pending+running) jobs |
scheduler_catchup_batch_max | per-call | integer | 5 (code fallback ?MAX_CATCHUP_RUNS, sol_scheduler.erl) | — | Max missed jobs dispatched in the boot catch-up burst; the remaining overdue tail is deferred with per-job jitter |
scheduler_lease_reaper_interval_ms | per-call | integer | 720000 (2× the 360 s stuck-job grace) | — | Phantom-lease reaper cadence. The scheduler’s running-lease (currently_running) is deliberately not persisted: a node crash mid-run re-dispatches the job only after the boot grace — the documented redispatch window is 360 s. The legacy alias workflow_lease_reaper_interval_ms is read one release for upgrade continuity |
Channels
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
channel_enabled | per-call | boolean | true (dev); false in sys.prod.config | SOL_CHANNEL_ENABLED | Enable channel delivery system. The production profile ships the channel plane OFF |
channel_rate_limit_ms | per-call | integer | 100 | — | Minimum interval between messages (ms) |
channel_reply_routing | per-call | on | broadcast | on | — | : task-reply routing. on addresses the originating chat (send_to) for tasks dispatched from a channel; broadcast is the rollback posture. |
channel_origin_max | per-call | integer | 1024 | — | (CON-12): hard cap on live channel-origin rows. Expired rows prune first; at the cap the oldest LIVE origins are replaced by same-store tombstones and counted (channel_origin_pruned_total), and their eventual terminal is a counted drop (channel_reply_dropped_total) — never a silent “not a channel task”. |
channel_origin_ttl_ms | per-call | integer | max(3600000, task_timeout_ms + 3600000); 86400000 when task_timeout_ms=0 | — | (CON-12): channel-origin retention. Rows past the monotonic deadline are pruned and counted (channel_origin_expired_total). The task deadline is progress-renewed, so a channel task that stays live past this window is pruned and its eventual reply is a counted drop; raise this for tasks that can exceed it. |
Plugins
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
plugin_user_dir | per-call | string | "" | SOL_PLUGIN_USER_DIR | User plugin directory. Empty = ~/.sol/plugins/ |
plugin_config_path | per-call | string | "" | SOL_PLUGIN_CONFIG_PATH | Path to plugins.json |
plugin_user_dir_load_ack | per-call | boolean | false | SOL_PLUGIN_USER_DIR_LOAD_ACK | Explicit operator consent for UNPINNED ~/.sol/plugins plugins. Without a sha256 pin or this ack, user-dir plugins REFUSE to load — and a pin mismatch refuses the boot |
plugin_env_allowlist | per-call | string list | bundled channel vars | SOL_PLUGIN_ENV_ALLOWLIST | The ONLY env vars plugin config ${VAR} expansion may interpolate; non-allowlisted names expand to empty, never the host environment |
plugin_tls_verify | per-call | boolean | true (shipped sys.config; code fallback verify_peer — sol_plugin_bridge_http.erl/sol_oauth_store.erl) | — | Verify TLS on plugin fetches |
plugin_max_reductions | per-call | integer | 5000000 | — | Luerl VM reduction budget per plugin call (range 1000–2000000000) |
plugin_max_heap_mb | per-call | integer | 256 | — | Heap budget (MB) for every plugin runner — allocation bombs are killed ({error, heap_budget_exceeded}, metric plugin_heap_killed_total) |
plugin_max_binary_mb | per-call | integer | 256 | — | Referenced-binary byte budget (MB) per plugin runner: Lua strings are refc binaries OUTSIDE the heap cap, so the watchdog also polls process_info(Pid, binary) and kills at this cap ({error, binary_budget_exceeded}, metric plugin_binary_killed_total) |
plugin_budget_poll_ms | per-call | integer | 100 | — | Watchdog poll interval (ms) for the plugin heap/binary/reduction budgets. Lower polls kill allocation bombs sooner at a small scheduling cost |
plugin_lifecycle_timeout_ms | per-call | integer | 3000 | — | Wall-clock budget for lifecycle/poll/on_event calls |
plugin_max_result_bytes | per-call | integer | 1048576 | — | Wire result cap for plugin tool calls (result_too_large beyond; sol_zmq_protocol.erl) |
plugin_max_event_types | per-call | integer | 1024 | — | Bounded sol.events.emit atom admission |
plugin_max_queue_len | per-call | integer | 32 | — | Per-plugin FIFO cap |
plugin_http_max_body | per-call | integer | 5242880 | — | sol.http response body cap (5 MB; {error, body_too_large} beyond) |
Deleted key: plugin_system_dir (env-rendered) had
no reader anywhere — system plugins are the bundled priv/plugins root and
the user root is plugin_user_dir; the inert render was deleted rather than
turned into an auto-loaded system trust root.
Skills
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
skill_body_max_bytes | per-call | integer | 262144 | — | ONE cap for skill bodies across the registry push (skill_sync v2), the marketplace publish path and the install endpoint. Register/publish over the cap answer the typed body_too_large (HTTP 413 at the API boundary); a value ≤ 0 or non-integer degrades to the default. Luna enforces the same default locally (LUNA_SKILL_BODY_MAX_BYTES overrides) |
Lua Workers
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
lua_eval_timeout | per-call | integer | 30000 (dev); 5000 in sys.prod.config | — | Lua eval timeout in milliseconds. Range 1000–60000. The production profile tightens it 6×. Code fallback 10000 (sol_lua_worker.erl ?DEFAULT_EVAL_TIMEOUT) |
lua_eval_max_len | per-call | integer | 4096 | — | Max Lua eval input length in bytes |
lua_default_script | per-call | string | — (undefined) | — | Default Lua script for workers |
lua_script_dir | per-call | string | "" | — | Directory for Lua script files |
Process Management
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
exec_user | boot | string | nobody | SOL_EXEC_USER | Downgrade to this OS user for spawned processes |
latency_validate | per-call | boolean | true | — | Validate latency histogram entries |
max_active_requests | per-call | integer | 100 (shipped sys.config); 1000 in sys.prod.config (10× dev; code fallback 32 — sol_inference.erl ?MAX_ACTIVE_REQUESTS) | — | Per-model concurrent inference requests admitted by the model gen_statem (llama-server --parallel slots are separate — emitted only when a model config carries it). Draining on stop refuses admission until in-flight requests finish or scale_down_grace_ms elapses. Validated range 1–10000 |
max_active_requests_per_principal | per-call | integer | half max_active_requests, clamped to it | — | : per-principal fair share of admitted requests (sol_inference_admission). Over-share requests get the typed 429 inference_budget_exceeded carrying the owner principal; reserved system/internal callers are exempt from the share but still count against the global cap |
metrics_max_entries | per-call | integer | 10000 | — | Max entries in latency histogram |
Workflow Engine
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
workflow_max_parallel_steps | per-call | integer | 8 (shipped sys.config; code fallback 4 — sol_workflow.erl/sol_workflow_instance.erl) | — | Max parallel steps in a workflow. Range 1–100 |
workflow_timeout_ms | per-call | integer | 3600000 (shipped sys.config; code fallback 3600000 — sol_workflow_instance.erl; sys.prod.config OMITS the key, so prod runs 3600000; valid range 10000–86400000) | — | Workflow hard timeout. corrected the pre-fix dev 300000 (a dev-only override that silently diverged from prod) |
workflow_bridge_enabled | per-call | boolean | true | — | Workflow→worker bridge: subscribes to task.* from the durable sync store and dispatches prompt steps. The sol_workflow_bridge_installed gauge is absent when disabled |
workflow_bridge_dispatch_timeout | per-call | integer | 30000 | — | Bridge dispatch timeout in milliseconds. Range 1000–300000 |
workflow_user_dir | per-call | string | "" | — | User workflow definition directory |
Events, Backpressure & Archival
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
event_worker_pool | per-call | integer | 32 (code fallback ?DEFAULT_EVENT_WORKER_POOL, sol_sync_event.erl) | — | Bounded concurrent event workers; overflow queues (FIFO) |
event_queue_limit | per-call | integer | 10000 (code fallback, sol_sync_event.erl) | — | Core-event queue cap; exceed → callers get {error, overloaded} (telemetry-class events shed with slo_event_loss_total instead) |
event_append_deadline_ms | per-call | integer | 30000 (code fallback ?APPEND_DEADLINE_MS) | — | (EV-25): per-lane append watchdog — a worker whose Mnesia append exceeds this deadline is KILLED (sync_event_append_deadline_killed_total) and its event sheds through the durable funnel |
projector_deadline_ms | per-call | integer | 30000 (code fallback ?PROJECTOR_DEADLINE_MS, sol_sync_event.erl) | — | Per-projector watchdog; a hung projector is killed at the deadline (projection_hung_killed_total) |
projector_deadline_total_ms | per-call | integer | 40000 (clamped to ≤ 40000, below the 45 s run/2 call budget) | — | Aggregate projector budget per emitted event; projectors run sequentially under min(per-projector deadline, remaining total) and the remainder is skipped on exhaustion |
event_retention_days | per-call | integer | 7 (shipped sys.config; code fallback is 30) | — | sync_event retention before compaction. Range 1–365 |
telemetry_retention_days | per-call | integer | 7 (code fallback ?DEFAULT_TELEMETRY_RETENTION_DAYS, sol_event_compactor.erl) | — | telemetry_event retention (hourly compaction pass) |
event_compaction_enabled | per-call | boolean | true | — | Compact the event store |
event_retention_max_rows | per-call | integer | 1000000 | — | Retained-event volume budget in rows. The compactor ENFORCES it: when the log exceeds the budget, the oldest rows join the terminality-aware reap (bounded per pass); the sweep-end gauge sync_event_retained_bytes_estimate and event_retention_over_budget_total report the residual |
event_retention_per_aggregate_cap | per-call | integer | 10000 (code fallback ?DEFAULT_EVENT_RETENTION_PER_AGGREGATE_CAP) | — | : per-aggregate hard cap — a never-terminating aggregate keeps at most this many events (the overflow is compacted and counted event_retention_cap_forced_total) |
staging_backlog_max_events | per-call | integer | 20000 (code fallback ?DEFAULT_STAGING_BACKLOG_MAX_EVENTS) | — | : staging backlog cap; a write that would exceed it is refused (events stay in Mnesia) and staging_backlog_cap_total is counted |
compaction_terminality_check | per-call | boolean | true (code fallback, sol_event_compactor.erl) | — | Terminality-aware paired sweep: an expired event is retained while its aggregate’s projection view row is non-terminal or fresher than the retention cutoff. false restores the timestamp-only retention match spec (rollback lever) |
event_compaction_interval_ms | per-call | integer | 3600000 | — | Compaction sweep. Range 60000–86400000 |
event_lane_spill_window | per-call | integer | 0 (code fallback, sol_sync_event.erl) | — | Lane-queue spill window: an admitted event that must wait in a lane queue past this in-RAM depth is appended to the durable spill segment (<mnesia dir>/event_lane_spill/lane_spill.log) before enqueue and replayed on boot. 0 = every queued event spills (no RAM-only pre-durability window) |
event_lane_spill_compact_bytes | per-call | integer | 1048576 (code fallback, sol_sync_event.erl) | — | : spill-segment byte trigger for the atomic rewrite-to-outstanding compaction (outbox-journal discipline). The segment stays ~O(outstanding) under a sustained backlog instead of growing with every retire marker; a failure leaves the segment intact and retries at most once per second. Gauge: event_lane_spill_bytes. |
event_lane_spill_sync_ms | per-call | integer | 1000 (code fallback, sol_sync_event.erl) | — | : bounded-interval fsync of the spill segment while appended bytes are outstanding — the power-loss window is the interval, not the whole outstanding lifetime. The timer is only armed while dirty. |
sol_events_mailbox_max | per-call | integer | 10000 (code fallback, sol_events.erl) | — | : gen_event manager mailbox bound. At/over the bound a store-routed event goes to the durable shed journal and any other event is dropped with events_mailbox_dropped_total; gauge events_mailbox_len. |
sync_event_shed_mailbox_max | per-call | integer | 10000 (code fallback, sol_sync_event_shed.erl) | — | : bound on the supervised shed-worker queue (store-down/over-bound shed records). A drop at the cap is counted sync_event_shed_mailbox_dropped_total; the journal itself is separately byte-capped. |
log_metadata | per-call | boolean | true (shipped sys.config/sys.prod.config; code fallback in sol_log_middleware.erl) | — | Append request/task correlation ids to the default logger template. false restores the stock OTP template for log parsers that cannot tolerate the suffix; process metadata itself stays attached either way |
event_archive_before_compaction | boot | boolean | true | — | Archive events before compacting |
archive_enabled | per-call | bool | true | — | Enable event archival to Mango PostgreSQL. Single canonical resolver: sol_event_compactor:archive_enabled/0 |
event_archive_http_requests | per-call | boolean | false | — | : archive generic-dispatch http_request rows. Off by default — request rows track Sol’s request rate into Mango write load; metrics + request logs already cover them |
archive_mango_url | per-call | string | "http://127.0.0.1:5800" (shipped; code fallback unset) | — | Mango service URL for archival. : loopback http:// is the dev posture; a NON-LOOPBACK plaintext http:// target is REFUSED at boot AND at flush time (the audit stream + HMAC over a plaintext hop). Remote archive transport requires https:// (+ mango_ca_file for a private CA). Operator precondition: a live deployment whose archive_mango_url points at a remote plaintext URL must be updated to https before/with this release (the boot refusal is explicit, never silent; an operator-disabled archive — archive_enabled=false — is exempt). |
bg_task_ttl_ms | per-call | integer | 86400000 | — | Background-task record TTL. Range 60000–604800000 |
shutdown_drain_timeout_ms | per-call | integer | 5000 | SOL_SHUTDOWN_DRAIN_MS | HTTP-request drain budget. Must be ≤ the container stop grace (podman ~10s / runit ~7s; see production-runbook.md “Shutdown budget”) — ci/shutdown_budget_lint.py pins the shipped configs to ≤5000. The pre-fix default (30000) exceeded the grace, so the drain never completed before SIGKILL. Range 1000–300000 |
Compaction durability: compaction no longer deletes
before the archive confirms. The full compacted events are staged to a
durable file (sol_event_compactor_staging.dump under the Mnesia dir,
temp+rename) first; deletion happens only when a durable copy exists (the
archive ack or the staging file itself). A restart mid-compaction
re-archives any unacknowledged staging file on boot (compaction_skipped_total
counts cycles where no durable copy could be staged).
Chat History
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
chat_checkpoint_tokens | per-call | integer | 64 (code fallback ?DEFAULT_CHECKPOINT_TOKENS, sol_chat_history.erl) | — | Persist the streamed buffer every N tokens (crash loses ≤ 1 window) |
chat_checkpoint_ms | per-call | integer | 2000 (code fallback ?DEFAULT_CHECKPOINT_MS) | — | …or every T ms, whichever comes first |
Infrastructure & Observability
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
prometheus_enabled | per-call | boolean | true | — | Enable Prometheus /metrics endpoint |
grafana_url | per-call | string | — (undefined) | — | Grafana URL for infra status page link |
ACP (Agent Control Protocol — opt-in)
Source: sol_acp_listener.erl, sol_acp_session.erl, env mappings in
sol_app.erl. No auth middleware in front of this listener — keep disabled
unless HMAC is configured.
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
acp_enabled | boot | boolean | — (unset → false) | SOL_ACP_ENABLED | Raw-TCP ACP listener |
acp_listener_port | per-call | integer | — (unset; code fallback 9120) | SOL_ACP_LISTENER_PORT | ACP port. Range 1024–65535 |
acp_listener_ip | per-call | string (parsed IP) | — (unset → {127,0,0,1}) | SOL_ACP_LISTENER_IP | ACP bind IP. A non-loopback bind refuses boot without SOL_ACP_LISTENER_PLAINTEXT_ACK=true |
acp_shared_secret | per-call | string | — (unset → <<>>; listener refuses to enable with a too-short secret) | SOL_ACP_SHARED_SECRET | HMAC secret for ACP messages |
acp_session_timeout | per-call | integer (seconds) | 300 (code fallback ?SESSION_TIMEOUT, sol_acp_session.erl) | SOL_ACP_SESSION_TIMEOUT | ACP session timeout. Range 10–3600 |
acp_request_wait_timeout_ms | per-call | integer | 30000 | — | (SC-03): how long the synchronous HTTP ACP arm waits for the reply frame before answering a typed 504 (acp_reply_timeout); the registry entry is consumed by its own timer, so a late reply can still land. |
acp_packet_size | per-call | integer | 1048576 (clamped at 16777216 at listener boot) | SOL_ACP_PACKET_SIZE | ACP frame-size cap; oversized declared lengths are refused in the driver before allocation. Range 1024–16777216 |
acp_listener_plaintext_ack | per-call | boolean | false | SOL_ACP_LISTENER_PLAINTEXT_ACK | Explicit acknowledgement that the ACP plane (HMAC-only raw TCP) may bind non-loopback |
acp_replay_max | per-call | integer | 65536 | SOL_ACP_REPLAY_MAX | Global replay digest cache LRU cap (oldest-evicted). Range 16–1048576 |
acp_replay_scope | per-call | string (global | peer) | global | SOL_ACP_REPLAY_SCOPE | Replay cache scope. peer is the one-window rollback lever (cross-connection replay NOT refused; CRITICAL boot banner) |
acp_key_id | per-call | binary | <<"default">> | — (sys.config only) | Key identity bound to TCP-leg capability registrations; flipping it between connections is a key rotation — a mismatched key for a taken AgentId is refused |
acp_shared_secrets | per-call | map | #{} | — (sys.config only) | : named ACP HMAC secrets #{KeyId => Secret} (≥16 bytes each). The verified key id is bound to the peer on capability registration; a different key for a taken AgentId, or the same key from a different peer address, is refused |
acp_max_sessions | per-call | integer | 500 | — (sys.config only) | : the ACP session-table ceiling. Sessions are created only after a frame authenticates (unauthenticated connects never allocate) |
acp_max_sessions_per_ip | per-call | integer | 50 | — (sys.config only) | : per-IP fairness cap on ACP sessions (one peer cannot occupy the whole table) |
Seats & Licensing
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
seats_enabled | per-call | bool | false | SOL_SEATS_ENABLED | Master switch; off = checks pass, Community defaults. Off in production until the release gate. See seats.md |
license_file | per-call | string | — | SOL_LICENSE_FILE | CLF v1 license file path (cold start / air-gap) |
license_pubkey | per-call | string | — | SOL_LICENSE_PUBKEY | PEM ed25519 pubkey for CLF signature verification (empty = trusted config in dev) |
seats_url | per-call | string | — | SOL_SEATS_URL | Control-plane seat endpoint (ZERGBASE panel /api/seats). https:// required under enforcement — http:// is refused at boot; since then (LIFE-19) that refusal is a typed PRE-SUP violation ({forbidden_http_seats_url, Url} → invalid_config), so the license child never raises |
seats_token | per-call | string | — | SOL_SEATS_TOKEN | Bearer token for the seat endpoint |
seats_signing_key | per-call | string | — | SOL_SEATS_SIGNING_KEY | HMAC-SHA256 key for /api/seats signatures — required when seats_url is set |
seats_url_allow_http | per-call | bool | false | SOL_SEATS_URL_ALLOW_HTTP | Test-only loopback override of the http:// refusal. NEVER in production |
seats_refresh_ms | per-call | integer | 30000 | SOL_SEATS_REFRESH_MS | Seat refresh interval (bounds 5000–86400000) |
seat_cluster_occupancy_ttl_ms | per-call | integer | 2000 | — | (BVI-014): TTL (ms) of the cached cluster-occupancy verdict after a degraded peer read (range 1000–5000, outside → 2000). A flapping peer cannot mint one spawn per dispatch inside the TTL. |
seat_cluster_occupancy_bound_ms | per-call | integer | 1500 | — | (BVI-014): bound (ms) on one cluster-occupancy peer read before the verdict degrades to this node’s live count (range 100–5000, outside → 1500). |
Managed Settings — the admin fleet-push plane
Admin-only (PUT /api/v1/managed-settings) fleet settings that every Luna
worker applies. The key set is CLOSED by the shared fixture
docs/fixtures/managed_settings_schema.json — consumed by Sol’s PUT
validator (sol_managed_settings_schema), Luna’s applier
(client/core/managed_config.lua M.SCHEMA), the Limon form, and
ci/managed_settings_schema_lint.py. This is the highest-precedence
plane (see Managed-settings precedence).
| Key | Type | Bounds | Luna target (consumer) |
|---|---|---|---|
execution.policy | enum | strict | standard | permissive | execution.policy (core.command_policy PROFILES) |
execution.max_iterations | integer | 1–200 | max_iterations (core.agent) |
execution.session_budget_usd | number | 0–1000000 | session_budget_usd (core.agent_budget; 0 = unlimited) |
- PUT refusals are TYPED:
400 unknown_setting_key(message lists the nearest known keys),400 setting_out_of_bounds,400 setting_type_mismatch. Refusals never persist, audit or publish. GET /api/v1/managed-settingsanswers{ok, data, schema}; the server-injecteddata._schema_revis metadata (never persisted) and a worker running an older schema rev SKIPS the payload loudly (upgrade Luna) rather than applying a partial contract.- Stored keys written before the schema existed (
theme, arbitrary maps) remain in the snapshot but are IGNORED by Luna (loud skip + counter) and rendered read-only by the console — no free-text JSON editing. - Sol-side runtime consumers: honestly NONE today. The plane’s
contract is fleet-push-to-Luna; the Sol
managed_settingsstore is read only by this API. Wire: PUT → PUBmanaged_settings_update→ Luna bounded refetch (≥5 s between fetches, cache preserved on failure).
Advanced & Regeneration Tuning Keys
These keys are read directly from the sol application env (config file, or the env mapping named below) and were previously discoverable only by reading source (E-4). Defaults are the code fallbacks; a shipped sys.config/sys.prod.config value wins when set. Keys whose default is shown as — (unset) are optional overrides.
ZMQ transport & bridge
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
zmq_frame_mac | per-call | enum | required | — | Worker-plane frame MAC posture: required / prefer / off. required refuses unsigned frames. |
zmq_frame_mac_legacy | per-call | boolean | false | — | Legacy-window acceptance for v1 (Z1, tx-less) MACs during the material-v2 cutover. |
zmq_frame_mac_d1542_legacy | per-call | boolean | false | — | Type-scoped straggler window for cancel_task/plugin_tool_call frames from previous workers. |
zmq_enrollment_allow_invalid | per-call | boolean | false | — | Test-only escape hatch: admit syntactically invalid enrollment records (never set in production). |
zmq_enrollment_ctr_required | per-call | boolean | true | — | Require the monotonic ready-counter in the registration material. |
zmq_frame_mac_rollback_ack | per-call | boolean | false | SOL_ZMQ_FRAME_MAC_ROLLBACK_ACK | : acknowledge a zmq_frame_mac value other than required. Without this the boot REFUSES (unsigned frames accepted). |
zmq_frame_mac_legacy_ack | per-call | boolean | false | SOL_ZMQ_FRAME_MAC_LEGACY_ACK | : acknowledge zmq_frame_mac_legacy=true (tx-less MAC material accepted). Without this the boot REFUSES. |
zmq_frame_mac_d1542_legacy_ack | per-call | boolean | false | SOL_ZMQ_FRAME_MAC_D1542_LEGACY_ACK | : acknowledge zmq_frame_mac_d1542_legacy=true (unsigned cancel_task/plugin_tool_call accepted). Without this the boot REFUSES. |
zmq_enrollment_ctr_required_ack | per-call | boolean | false | SOL_ZMQ_ENROLLMENT_CTR_REQUIRED_ACK | : acknowledge zmq_enrollment_ctr_required=false (nonce-only replay bound). Without this the boot REFUSES. |
zmq_ownership_enforced_ack | per-call | boolean | false | SOL_ZMQ_OWNERSHIP_ENFORCED_ACK | : acknowledge zmq_ownership_enforced=false (executor-ownership gates off). Without this the boot REFUSES. |
zmq_bridge_allow_unsigned | per-call | boolean | false | — | Mango bridge: accept unsigned inbound frames (fail-closed default; the bridge refuses to boot without a secret). |
zmq_bridge_ts_window_ms | per-call | integer | 120000 | — | Mango bridge HMAC timestamp freshness window (ms). |
zmq_mango_recv_watchdog_ms | per-call | integer | 30000 | — | Mango bridge receive-watchdog bound: a silent SUB pipe reconnects after this. |
zmq_mango_resync_ms | per-call | integer | 60000 | — | Mango revocation-resync interval during normal operation (ms). |
zmq_mango_sub_rcvhwm | per-call | integer | 5000 | — | Mango bridge SUB socket receive high-water mark. |
zmq_pub_linger | per-call | integer | 1000 | — | PUB socket linger (ms) at close. |
zmq_pub_sndhwm | per-call | integer | 5000 | — | PUB socket send high-water mark. |
zmq_pub_sndtimeo_ms | per-call | integer | 5000 | — | PUB send timeout (ms) — chumak has no SNDTIMEO, the send bound is enforced at the call site. |
zmq_router_rcvhwm | per-call | integer | 10000 | — | ROUTER socket receive high-water mark. |
zmq_router_sndhwm | per-call | integer | 10000 | — | ROUTER socket send high-water mark. |
zmq_sender_outbound_bound | per-call | integer | 512 | — | Per-identity outbound frame bound per 60s window (control lane keeps a +64 reserve); drops are counted loudly. |
zmq_cancel_tombstone_ttl_ms | per-call | integer | 300000 | — | Recent-cancel tombstone TTL (ms) — dedupes duplicate cancel deliveries. |
zmq_ready_ctr_max_age_ms | per-call | integer | 600000 | — | Ready-counter freshness bound (ms) — a counter older than this cannot admit a reconnect. |
zmq_recv_watchdog_ms | per-call | integer | 30000 | — | Gateway receive-watchdog bound (ms) — a silent ROUTER pipe forces a reconnect. |
zmq_replay_fence_file | per-call | string | — (unset) | — | Path of the durable replay-fence state file; unset uses the anchored data dir. |
zmq_replay_fence_journal_file | per-call | string | — (unset) | — | Path of the durable replay-fence append journal; unset derives it from the snapshot path. |
zmq_bridge_nonce_journal_file | per-call | string | — (unset) | — | Path of the durable Mango bridge nonce journal; unset uses the anchored data dir. |
zmq_fallback_max_rearms | per-call | integer | 10 | — | HTTP streaming ZMQ-fallback re-arm bound per stream. |
zmq_control_journal_ttl_ms | per-call | integer | 21600000 | — (sys.config only) | : TTL (ms; 6h) for a journaled control frame (cancel/spawn_ack) targeting an unreachable identity; older records are no longer replayed. |
zmq_control_replay_attempt_cap | per-call | integer | 8 | — (sys.config only) | : replay-attempt cap for a live journaled control frame; at the cap the record is retired (the outstanding-control gauge drains). |
zmq_egress_quarantine_ms | per-call | integer | 5000 | — (sys.config only) | : how long a task whose egress repeatedly fails is quarantined before the recovery lane retries it (ms). |
zmq_preauth_global_known_limit | per-call | integer | 2000 | — (sys.config only) | (ADV-A-02): global 60s ceiling for unregistered-frame replies from KNOWN (previously registered) delivering pipes; distinct from zmq_preauth_global_limit (unknown pipes). |
zmq_replay_tx_max_future_ms | per-call | integer | 120000 | — (sys.config only) | : future-tx tolerance (ms) — a frame tx more than this ahead of the Sol wall clock is refused as skew (never silently stamped). |
zmq_transport_retry_backoff_ms | per-call | integer | 300 | — (sys.config only) | : base retry backoff (ms) for a failed egress send; values below 250 fall back to 300. |
zmq_transport_retry_cap | per-call | integer | 8 | — (sys.config only) | : consecutive transport retry attempts before the task is quarantined for zmq_egress_quarantine_ms. |
Events & archive
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
event_lane_count | boot | integer | 8 | — | Number of per-aggregate event sequencer lanes; frozen at boot (sol_sync_event:init/1). |
event_payload_max_bytes | per-call | integer | 1048576 | — | Maximum encoded event payload size (bytes); larger payloads are refused at admission. |
event_replay_on_boot | boot | boolean | true | — | Replay the durable event store into projections at boot. |
event_replay_disabled_ack | boot | boolean | false | — | Explicit degraded-posture ack for event_replay_on_boot=false: unset refuses boot (the RAM views would be empty); true proceeds unproven with /ready 503 and event retention refused until a successful replay. |
replay_all_max_events | per-call | integer | 50000 | — | Cap for the paged sol_sync_event:replay_all/1 projector walk; the walk stops page-aligned and counts replay_all_truncated_total. |
projection_outbox_max_rows | per-call | integer | 10000 | — | Projection outbox row cap; a NEW owed row past the cap is quarantined (projection_outbox_quarantined_total), refreshes always allowed. |
event_forwarder_rearm_ms | per-call | integer | 60000 | — | Cadence (ms) of the durable lane’s store-forwarder re-arm/gauge refresh after an N-strike handler removal. |
schema_quarantine_max_events | per-call | integer | 50000 | — | Cap for the durable archive schema-quarantine dead-letter; a 4xx page is accounted there and the drain advances. |
event_compaction_budget_ms | per-call | integer | 15000 | — | Per-compaction-cycle wall-clock budget (ms). Code fallback 15000 — sol_event_compactor.erl ?COMPACT_BUDGET_MS. |
event_seq_cleanup_threshold | per-call | integer | 100000 | — | Compacted-sequence rows retained before the seq table cleanup runs. |
event_router_subscribe_retry_ms | per-call | integer | 5000 | — | Event-router subscription retry cadence (ms) when the store is not yet up. |
staging_recover_max_chunks | per-call | integer | 64 | — | Maximum staged WAL chunks recovered per boot pass. |
archive_ack_drain_budget_ms | per-call | integer | 10000 | — | Mango archive-ack drain budget per cycle (ms). |
archive_ack_max_passes | per-call | integer | 64 | — | Maximum ack-drain passes per archive cycle. |
archive_mailbox_max | per-call | integer | 5000 | — | Live-archive gen_server mailbox bound; live metadata casts are refused (counted) at/over this depth while a slow archive holds the flush. |
archive_gen_server_mailbox_bound | per-call | integer | 1200 | — | (EV-09): the archive gen_server’s OWN mailbox bound (above the 1000 queue + 100 batch so a legitimate burst still exercises the queue overflow). At/over it the incoming cast is dropped loudly (event_archive_mailbox_dropped_total; the Mnesia row + staging retain the event). |
archive_overflow_log_interval_ms | per-call | integer | 60000 | — | Minimum interval between live-archive queue-overflow warnings (the drop counter still counts every refused event). |
subscriber_queue_limit | per-call | integer | 256 | — | Per-subscriber bounded event queue depth (overflow is shed + counted). |
max_subscriptions_per_process | per-call | integer | 16 | — | SSE/event subscriptions admitted per process (per-process cap). |
sync_event_async_mailbox_max | per-call | integer | 10000 | — | Async event-forwarder mailbox bound before shedding. |
sync_event_shed_journal_max_bytes | per-call | integer | 4194304 | — | Durable shed-journal segment bound (bytes). |
telemetry_archive_enabled | per-call | boolean | true | — | Persist telemetry events into the ETS telemetry store + archive leg. |
metrics_persist_dir | per-call | string | — (unset) | — | Metrics-counter dump directory override; unset uses the anchored data dir. |
path_latency_max_paths | per-call | integer | 64 | — | Maximum distinct paths tracked by the latency histogram owner. |
goal_projector_sub_retry_ms | per-call | integer | 1000 | — | Goal projector subscription retry cadence (ms). |
goal_catchup_max_events | per-call | integer | 1000 | — | Max workflow events replayed per goal catch-up window. |
goal_projector_sub_retry_max | per-call | integer | 10 | — | Goal projector subscription retry attempts before giving up loudly. |
goal_retention_ms | per-call | integer | 2592000000 | — | Terminal-goal retention window (ms; 30 days). |
bridge_correlation_ttl_ms | per-call | integer | 300000 | — | Workflow-bridge correlation entry TTL (ms). |
Task store & idempotency
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
idempotency_window_ms | per-call | integer | 86400000 | — | Idempotency discard-table window (ms; 24h) — duplicate task ids inside the window replay the stored verdict. |
idempotency_max_rows_per_user | per-call | integer | 1024 | — | (BVI-013): per-user cap on live idempotency claims; an insert over it is refused typed ({over, per_user}) and the caller gets a 429. Non-positive values fall back to 1024. |
idempotency_max_rows_global | per-call | integer | 100000 | — | (BVI-013): fleet-wide cap on the idempotency table; an insert over it is refused typed ({over, global}) and the caller gets a 429. Non-positive values fall back to 100000. |
task_idempotency_sweep_budget | per-call | integer | 2000 | — | (BVI-013): rows deleted per paged idempotency-sweep pass (range 1–20000, outside → 2000). The sweep runs in a spawned worker, never inside the store writer. |
task_store_terminal_mnesia_bound_ms | per-call | integer | 5000 | — | (BVI-012): production-sized bound (ms) for the terminal durable write + failure-readback leg (range 1000–12000, outside → 5000). The 1s task_store_mnesia_bound_ms stays the liveness seam for probes/reads; the terminal leg needs the larger dump-tolerant window. |
task_ttl_ms | per-call | integer | 3600000 | — | Task-store row TTL (ms) for non-terminal rows swept by retention. |
task_result_retention_ms | per-call | integer | 604800000 | — | Terminal task-result retention window (ms; 7 days). |
task_retention_sweep_budget_ms | per-call | integer | 400 | — | Retention-sweep pass budget (ms) — a pass yields and resumes next tick. |
task_store_mnesia_bound_ms | per-call | integer | 1000 | — | Per-operation Mnesia bound (ms) before the ETS fallback verdict is used. |
task_store_terminal_marker_pages_per_pass | per-call | integer | 8 | — | : per-reconcile-pass page budget for the continuation-threaded needs_reconcile terminal-marker walk (500 markers per page). A deferred tail is counted task_store_terminal_marker_walk_deferred_total and resumes next pass. |
task_store_terminal_marker_walk_bound_ms | per-call | integer | 10000 | — | : bound (ms) on one marker-walk activity (the mnesia select continuation must stay inside the activity that created it, so the walk owns a longer explicit bound than the store’s default 1s). |
outbox_journal_compact_bytes | per-call | integer | 8388608 | — | Dispatch-outbox journal size (bytes) above which the clear chokepoint atomically rewrites it to the outstanding receipt set. |
zmq_store_mailbox_shed_threshold | per-call | integer | 5000 | — (sys.config only) | : task-store mailbox depth at which new writes are shed (counted) instead of deepening the mailbox; 0 disables the shed latch. |
zmq_store_shed_after_ms | per-call | integer | 5000 | — (sys.config only) | : age (ms) after which a latched mailbox-shed posture is cleared/re-probed. |
outbox_journal_compact_min_interval_ms | per-call | integer | 60000 | — | Minimum interval (ms) between outbox journal compactions. |
Chat history
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
chat_seq_backfill_budget | per-call | integer | 50000 | — | Chat-history seq backfill batch budget per pass. |
chat_session_boot_restore_cap | boot | integer | 2000 | — | Maximum chat sessions re-hydrated from disk at boot (sol_chat_sessions_owner:init/1 restore). |
chat_session_retention_days | per-call | integer | 30 | — | Chat-session metadata retention window (days; the message store keeps its own retention). |
Workflow engine
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
workflow_recovery_enabled | boot | boolean | true | — | Run boot recovery (compensation of crashed instances) for the workflow engine. |
workflow_boot_recovery_grace_ms | per-call | integer | 60000 | — | Boot-recovery grace before an instance is considered crashed (ms). |
workflow_boot_rescan_margin_ms | per-call | integer | 1000 | — | : extra margin before the post-boot stale-row rescan (ms); keeps the rescan outside the crash-recovery grace window. |
workflow_force_resume_stale_ms | per-call | integer | 60000 | — | : a recovered instance whose last progress is older than this is force-resumed by the recovery pass (ms). |
workflow_legacy_unscoped_completion | per-call | boolean | false | — | migration window: accept unscoped/first-attempt workflow completions from pre-marker producers. Default false (fail-closed); remove after the migration window. |
workflow_recovery_compensation_budget_ms | per-call | integer | 30000 | — | Per-instance boot-compensation budget (ms). |
workflow_recovery_max_compensations | per-call | integer | 100 | — | Maximum instances compensated per boot-recovery pass. |
workflow_compensation_timeout_ms | per-call | integer | 65000 | — | Compensation step timeout (ms). Code floor 65000 = the 60000 ms worker kill ceiling + 5000 ms margin (sol_workflow_instance.erl ?COMP_KILL_CEILING_MS + ?COMP_WINDOW_MARGIN_MS); values below the floor are clamped UP and warned once per boot — the pre-fix doc’s 60000 was not settable. |
workflow_inline_compensation_timeout_ms | per-call | integer | 60000 | — | Inline-compensation kill ceiling (ms) — must stay under the instance kill window. |
workflow_revocation_mark_window_ms | per-call | integer | compensation window + 5000 | — | (WSC-14): bounded post-cancel revocation-marker fallback window (ms; default derives from workflow_compensation_timeout_ms). Values ≤5000 fall back to the derived default — the old fixed 5s window could not outlive a slow unwind. |
workflow_budget_auto_stop_ms | per-call | integer | 86400000 | — | Wall-clock budget after which a running workflow auto-stops (ms; 24h). |
workflow_state_retention_ms | per-call | integer | 2592000000 | — | Terminal workflow-state retention window (ms; 30 days). |
workflow_decomp_definition_cap | per-call | integer | 5000 | — | Decomposition-definition registry row cap. |
workflow_decomp_definition_ttl_ms | per-call | integer | 3600000 | — | Decomposition-definition registry row TTL (ms). |
workflow_decomp_definition_durable_ttl_ms | per-call | integer | 2678400000 | — | : durable decomp-* definition retention (ms; default 31 days — one day past the terminal workflow-state retention so a resumable row never outlives its definition). The ETS cache TTL/cap never shortens it. |
workflow_max_active_per_user | per-call | integer | 500 | — | : live workflow-instance admission cap per principal (0 disables the axis); refusal is {workflow_limit_reached, {principal, Cap}} → HTTP 429 + workflow_admission_refused_total. |
workflow_max_active | per-call | integer | 5000 | — | : live workflow-instance admission cap for the whole node (0 disables the axis); refusal is {workflow_limit_reached, {global, Cap}} → HTTP 429. |
workflow_store_resub_ms | per-call | integer | 1000 | — | Workflow-store resubscribe retry cadence (ms). |
workflow_store_resub_max | per-call | integer | 10 | — | Workflow-store resubscribe attempts before the instance is marked crashed_unrecovered. |
workflow_lease_reaper_interval_ms | per-call | integer | 720000 | — | LEGACY ALIAS of scheduler_lease_reaper_interval_ms. The effective default is 2 *?STUCK_JOB_GRACE_MS = 2 × 360000 = 720000 ms (sol_scheduler:stuck_grace_ms/0, which is itself max(?STUCK_JOB_GRACE_MS, plugin_execute_timeout_ms + slack + plugin dwell) = 360000 at the shipped plugin budget); the alias is nested inside the scheduler key read, so the scheduler key wins when both are set. |
instance_cleanup_ttl_ms | per-call | integer | 600000 | — | Terminal workflow-instance in-memory record TTL (ms) before GC. |
Scheduler
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
scheduler_store_debounce_ms | per-call | integer | 2000 | — | Scheduler store persistence debounce (ms) for bulk edits. |
scheduler_journal_compact_bytes | per-call | integer | 262144 | — | : appended-byte threshold that arms the scheduler journal’s compaction tick. Claims append one fsynced frame (O(1) in job count); crossing the threshold schedules the whole-table snapshot compaction on the store’s idle tick (never on the claim call). flush/0 always compacts synchronously under the shutdown bound. |
scheduler_mirror_claims | per-call | boolean | false | — | Mirror single-writer job claims across the cluster. |
scheduler_await_ceiling_ms | per-call | integer | 0 (derive: task_max_lifetime_ms + 120 s) | — | Ceiling (ms) for the scheduler’s bounded wait-for-terminal loop around dispatched tasks; an exhausted await is the typed dispatch_timeout class (no job-error increment). 0 derives the ceiling; an explicit override is floored at 300000. |
max_stored_jobs | per-call | integer | 10000 | — (sys.config only) | : cap on persisted scheduler jobs (active + retained terminal rows); a create over the cap answers the typed cap verdict instead of growing the store. |
scheduler_terminal_retention_ms | per-call | integer | 604800000 | — (sys.config only) | : terminal scheduler-job retention window (ms; 7 days) before the sweep removes the row. |
Plugins
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
plugin_execute_timeout_ms | per-call | integer | 60000 | — | Per plugin tool-execution timeout (ms). |
plugin_lifecycle_wall_clock_ms | per-call | integer | 30000 | — | Plugin lifecycle-call wall-clock watchdog (ms). |
plugin_max_concurrent_executors | boot | integer | 64 | — | Plugin executor process cap. |
plugin_max_scheduled_jobs | per-call | integer | 100 | — | Per-plugin scheduled-job cap. |
plugin_max_subscriptions | per-call | integer | 64 | — | Per-plugin event-subscription cap. |
plugin_min_interval_ms | per-call | integer | 1000 | — | Minimum interval floor for plugin scheduled jobs (ms). |
plugin_queue_dwell_max | per-call | integer | 16 | — | Per-plugin FIFO queue-dwell cap before a 429 busy-with-retry-hint. |
plugin_http_sweep_ms | per-call | integer | 60000 | — | Plugin HTTP connection-pool sweep cadence (ms). |
plugin_http_conn_max_age_ms | per-call | integer | 300000 | — | Plugin HTTP pooled-connection max age (ms). |
Inference & model registry
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
inference_restart_retries | per-call | integer | 3 | — | llama.cpp restart attempts before the lane is marked failed. |
inference_restart_backoff_ms | per-call | integer | 5000 | — | llama.cpp restart backoff (ms). |
inference_restart_strike_decay_ms | per-call | integer | 1800000 | — | Stable-ready window that clears one auto-restart strike (default 30 min); an exhausted lane is quarantined and re-probed on this cadence. |
ready_health_interval_ms | per-call | integer | 30000 | — | READY health-probe interval (ms) for loading engines. |
scale_down_grace_ms | per-call | integer | 15000 | — | Autoscaler scale-down drain grace (ms). |
pipeline_admission_timeout_ms | per-call | integer | 30000 | — | Admission wait bound (ms) before a request is answered 503/429. |
provider_health_tls_verify | per-call | boolean | true | — | TLS peer verification for the provider-health probe (must stay true outside loopback). |
model_prepare_tmp_ttl_ms | per-call | integer | 3600000 | — | Registry prepare staging-file TTL (ms) before the boot sweep removes it. |
embed_max_concurrency | per-call | integer | 4 | — | Embedding-pool concurrent request cap (the async bounded pool). |
embed_max_batch | per-call | integer | 256 | — | : the embed_batch/2 fan-out wave size — helper processes are spawned in bounded chunks, never one per input text. |
cost_legacy_metadata_price | per-call | boolean | false | — | : re-enables the LEGACY bundled-metadata rate source when the catalog has no row. Off by default — the catalog is the one rate source. |
embed_max_queue | per-call | integer | 64 | — | Embedding-pool queue depth cap. |
lane_benchmark_csv | per-call | string | — (unset) | — | Benchmark-artifact path consumed by lane validation (prod config points at /opt/sol/data/local-inference-benchmark.csv). |
lane_inventory_expire_after_ms | per-call | integer | — (unset) | — | Fleet-inventory row expiry override (ms); unset derives the bound from the heartbeat cadence. |
lane_placement_inflight_max | per-call | integer | 8 | — | Maximum in-flight lane placements admitted by the orchestrator. |
lane_resolve_cold_async | per-call | boolean | true | — | Resolve cold lanes asynchronously instead of blocking the dispatch path. |
Workers & licensing
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
license_fail_mode | per-call | enum | — (unset → refuse) | — | License-check failure posture for worker spawns (refuse is the shipped behavior; the lever is read by sol_worker_sup). |
team_ghost_grace_ms | per-call | integer | 3600000 | — | Team ghost-member expiry grace (ms) before the sweeper removes the member. |
Auth, audit & shares
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
audit_archive_secret | per-call | string | — (unset) | SOL_AUDIT_ARCHIVE_SECRET | HMAC secret for the Mango audit-archive POST leg; must equal Mango’s MANGO_AUDIT_ARCHIVE_SECRET. |
audit_retention_days | per-call | integer | 30 | — | Audit JSONL retention window (days). Range 1–3650, validated at boot. Config-file twin: [audit] retention_days. The daily sweep deletes only CLOSED day files strictly older than the clamped cutoff — today’s open file and the newest closed day always survive. |
audit_strong_consistency | per-call | boolean | true | — | fsync audit appends before acknowledging (tamper-evidence first). |
mango_bridge_hmac_secret | per-call | string | — (unset) | — | Shared HMAC secret for the Mango event bridge (boot refuses without it when the bridge is enabled). |
auth_flush_on_reconnect | per-call | boolean | true | — | Flush every Sol-side auth cache once when the Mango bridge reconnects: a role/team/user demotion made during a bridge outage lands within the reconnect window, not the per-user cache TTL. The flush is O(cache size) per reconnect; set false to restore the previous costed posture. |
share_quota_per_user | per-call | integer | 100 | — | Session-share links per user before the quota 429. |
share_rate_limit_per_min | per-call | integer | 30 | — | Per-IP session-share read rate limit (requests/min). |
share_rate_max_keys | per-call | integer | 10000 | — | Bound on the share rate-limiter key table: distinct per-IP buckets tracked before new keys are refused admission to the table (existing buckets keep counting), so a hostile address spray cannot grow memory without bound. |
share_reap_budget | per-call | integer | 2000 | — | Expired-share reap budget per sweep pass. |
Mango audit-archive cutover levers. Mango’s own
receiver config is mango/conf.py, but these two env-only levers belong to
the Sol↔Mango archive wire and are set on the MANGO leg:
| Variable | Default | Meaning |
|---|---|---|
MANGO_AUDIT_ARCHIVE_ALLOW_V1 | unset (v1 refused) | Accept the legacy v1 archive HMAC during a documented one-window cutover. Leave unset on a stock deployment: the Sol sender shipped since then speaks HMAC v2 (X-Audit-Archive-Timestamp/-Nonce + body-bound material), so no ack is needed. Mango logs a once-per-boot WARNING when the ack IS set (the replayable-wire posture); MANGO_AUDIT_ARCHIVE_REQUIRE_V2=1 refuses v1 even under the ack. Strict boolean: a typo refuses boot. |
MANGO_AUDIT_ARCHIVE_REQUIRE_V2 | unset | Hard-refuse v1 (overrides the ack). Set only AFTER the Sol sender upgrade to the v2 timestamp/nonce material. Strict boolean. |
Mango identity-plane levers. These are Mango-process env
levers (read by mango/); Sol does not read them.
| Variable | Default | Meaning |
|---|---|---|
MANGO_SERVICE_TOKEN_DEFAULT_SCOPE | unset → the read-only inventory | Default scope minted when a service-token request carries no explicit scope. default selects users:read,orgs:read,teams:read,tasks:read,roles:read; a comma-separated verb list is clamped to the owner’s live grant (an empty clamp is now a typed 400 refusal, never an inert token); legacy/none/unscoped restores the previous full-RBAC mint LOUDLY (one migration window). A malformed value refuses the mint (503), never a silent widening. NOTE: the read-only inventory does NOT include orchestrator:lease or revocations:read — a Sol service account minted with the default must request those explicitly (or mint in the legacy/unscoped window). |
MANGO_SERVICE_TOKEN_ALLOW_UNSCOPED | false | One-window legacy lever: with no MANGO_SERVICE_TOKEN_DEFAULT_SCOPE set, true mints the historical full-RBAC (NULL-scope) service token by default and logs a warning. Unset it after rotating integrations to explicit scopes. |
MANGO_LDAP_BREAK_GLASS_DURING_OUTAGE | false | While the LDAP outage circuit is open, email-shaped logins answer ONE uniform typed 503. true explicitly restores the local break-glass fallback for local accounts during an outage; a deliberate, visible weakening. |
MANGO_LEGACY_SESSION_COOKIE | false | Session auth reads only the __Host--prefixed cookie. true re-enables the legacy zerg_session reader for the documented migration window. The legacy name is still EMITTED for Sol/Limon readers either way; CSRF cookies keep their migration fallback (not a credential). |
MANGO_LIMITER_KNOWN_HEADROOM | MAX_KEYS // 10 (1000 of 10000) | Capacity reserved for RESOLVED identities: unknown keys stop at MAX_KEYS - headroom, so a junk-identity flood cannot deny a known user’s login. Absolute MAX_KEYS still caps every class; a malformed value falls back to the default. |
MANGO_MAX_LOCK_ENTRIES | 10000 | Live hard-lockout entries retained before overflow eviction (counted, with a transition warning + once-per-1000 log bound). |
MANGO_MAX_LOCK_ENTRIES_HARD | 2 × MANGO_MAX_LOCK_ENTRIES | Hard ceiling for the lockout dict; when an ACTIVE entry must be evicted the operation is counted (the per-account bucket still bounds the attacker). Never below MANGO_MAX_LOCK_ENTRIES. |
MANGO_MAX_USERS | unset (NOT enforced) | DE-CLAIMED: Mango does not enforce a user cap. The Sol seat map still carries max_users, but docs/seats.md records the non-claim (no signed Sol→Mango seat datum exists); the name is reserved for that future datum. |
Chat turn lease & idempotency
The session turn plane (sol_chat_sessions_owner + sol_chat_turn_plane)
enforces one live turn per session across WS and REST and powers the
client_turn_id replay contract (see docs/api-reference.md, chat message).
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
chat_turn_lease_ttl_ms | per-call | integer | task_timeout_ms + chat_turn_lease_grace_ms (360000) | — | Absolute lease TTL override (ms). Unset derives from the task deadline plus the grace; a live holder is extended, never preempted by wall clock alone. |
chat_turn_lease_grace_ms | per-call | integer | 60000 | — | Grace added to task_timeout_ms when chat_turn_lease_ttl_ms is unset (the no-relay TTL fallback window). |
chat_turn_lease_renew_ms | per-call | integer | derived: min(30000, max(1000, ttl div 4)) | — | Caller-side renewal throttle for a live turn’s lease (token/progress renews at most once per window). |
chat_turn_dedupe_ttl_ms | per-call | integer | 300000 (5 min) | — | Content-bound client_turn_id replay window; replayed after the window duplicates by contract. |
chat_turn_dedupe_max_per_session | per-call | integer | 32 | — | Per-session cap on the dedupe side table (oldest evicted at insert). |
HTTP & streaming
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
client_timeout_max_ms | per-call | integer | 600000 | — | Ceiling for client-supplied per-request timeouts (sol_http_validation). |
sse_heartbeat_ms | per-call | integer | 15000 | — | SSE heartbeat cadence (ms) — keeps idle streams alive through proxies. |
sse_stream_shutdown_grace_ms | per-call | integer | 2000 | — | : grace after the age sweep’s typed {sol_stream_shutdown} before the reaper kills the stream process; accounting is released only after the DOWN (never a released-but-alive slot). |
sse_write_ack_timeout_ms | per-call | integer | 15000 | — | : the bounded Cowboy data-ack deadline for FOREIGN stream writers (sol_http_stream — chat pumps and replay producers). A timeout/connection DOWN is a typed error + stream_writer_abandoned_total, so the caller releases its admission/session row; non-positive/non-integer values fall back to 15000. |
Health & backups
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
sol_health_process_warn | per-call | number | 0.8 | — | Process-count warn threshold (fraction of the Erlang process limit). |
sol_health_process_crit | per-call | number | 0.95 | — | Process-count critical threshold (fraction of the Erlang process limit). |
sol_health_memory_warn_bytes | per-call | integer | 4294967296 | — | Memory warn threshold (bytes). |
sol_health_disk_warn_bytes | per-call | integer | 1073741824 | — | Disk free-space warn threshold (bytes). |
sol_health_disk_crit_bytes | per-call | integer | 104857600 | — | Disk free-space critical threshold (bytes). |
sol_health_mq_warn | per-call | integer | 100 | — | Message-queue depth warn threshold. |
sol_health_check_budget_ms | per-call | integer | 300 | — | : per-check budget for the bounded readiness runner. A check that misses its budget is a typed timeout error row (never a healthy default). Range 10–60000. |
sol_health_total_budget_ms | per-call | integer | 900 | — | : total deadline for the readiness fan-out; checks past it are typed total_deadline_exceeded rows. Keeps a wedged dependency under 1s. Range 10–120000. |
sol_health_disk_sample_ms | per-call | integer | 15000 | — | : the supervised disk sampler’s cadence (ms). Requests/scrapes only read the sampled cache; a sample older than 90s makes the disk check degraded (probe_stale). Range 1000–3600000. |
sol_health_core_queue_warn | per-call | integer | 5000 | — | (LIFE-13): message-queue warn tier for the core data-plane children (task store, workflow manager, scheduler, event store, cluster). Range 100–1000000. |
sol_health_core_queue_crit | per-call | integer | 20000 | — | : message-queue critical tier for the core data-plane children (readiness error). Range 100–1000000. |
health_expect_models | per-call | boolean | derived | — | : force the readiness model expectation. Unset = expect a serving model whenever the registry has rows; true makes an empty registry an error too. |
sol_health_owner_registry_check | per-call | boolean | true | — | (LIFE-4): owner-plane content check in the readiness ets probe. A registry (sol_models, sol_channels, sol_provider_registry) that had content under the same app instance but returns EMPTY under a NEW owner is a readiness error until the content is restored (or the same owner deliberately empties it). Set false to run an intentionally empty channel plane without the red verdict. |
health_expect_workers | per-call | boolean | derived | — | (LIFE-12): force the readiness worker expectation. Unset = expect workers when zmq_enabled and initial_workers > 0; true/false pin the verdict. |
http_max_connections | per-call | integer | 16384 | — | : the explicit HTTP listener admission cap, applied through ranch:set_max_connections/2 after the transport tail starts (the pre-fix ranch default was 1024 shared with the SSE budget). max_sse_connections stays a separate streaming budget within this pool. Exported as sol_http_connections_{active,max,utilization_pct}; the nofile requirement is max_connections + max_sse_connections + 1024. Range 1–1000000. |
mnesia_load_strict | per-call | boolean | set by sol_app to true for the release boot | — | (BVI-006): the durability-table load/create posture. true makes a failed disc-table create or an unloaded durability table a TYPED BOOT REFUSAL; eunit/partial boots leave it unset (loud degrade). Internal boot flag — operators never set it directly |
mnesia_force_load_on_timeout | per-call | boolean | false | — | (BVI-006): ack-gated operator lever — on a load-barrier timeout, force_load_table re-reads the local log. Enable ONLY after confirming the local log copy is authoritative (docs/operations #mnesia-load) |
sol_mnesia_load_bound_ms | per-call | integer | 15000 | — | (BVI-006): the boot load barrier’s wait_for_tables bound; a timeout publishes the typed pending verdict (strict boot refuses) |
maintenance_worker_settle_ms | per-call | integer | 1500 | — | Maintenance drain settle window (ms): the bounded wait for in-flight worker tasks before the gate flips. A drain that cannot settle returns the typed drain_incomplete, never a silent success. |
worker_bootstrap_retry_ms | per-call | integer | 1000 | — | First backoff (ms) when a worker’s async bootstrap (lane resolve/spawn) fails; doubles per attempt up to worker_bootstrap_retry_max_ms. |
worker_bootstrap_retry_max_ms | per-call | integer | 30000 | — | Backoff ceiling (ms) for the async worker bootstrap retry loop. |
worker_bootstrap_max_attempts | per-call | integer | 5 | — | Consecutive bootstrap failures before a parked worker GIVES UP: it exits {shutdown,{unavailable,_}} (no supervisor restart, slot released) instead of retrying forever. Bounds a deterministic spawn failure (missing binary, denied lane) to one slot and zero pool-budget burn. |
data_plane_check_ms | per-call | integer | 5000 | — | sol_data_plane_restorer keeper tick (100–60000): restore a missing data plane after the boot ladder completed, and monitor the live one. |
data_plane_restore_retry_ms | per-call | integer | 5000 | — | Delay (100–60000) between bounded data-plane restore attempts. |
data_plane_restore_max_attempts | per-call | integer | 5 | — | Consecutive restore failures (1–100) before the keeper logs CRITICAL and calls application:stop(sol) — a node never serves a dead data plane. |
worker_resolve_deadline_ms | per-call | integer | 10000 | — | Bounded deadline (ms) for the lane-resolve probe moved out of init/1 into the async bootstrap. |
mnesia_backup_retention_days | per-call | integer | 7 | — | Mnesia backup retention window (days). Range 1–3650, validated at boot. Config-file twin: [mnesia] retention_days. Rotation never deletes the artifact it just wrote; the success gauge is stamped only after the backup file exists and the manifest checksum reads back. |
sol_mnesia_backup_remote_path | per-call | string | "" | — | Remote backup copy target — an rsync DESTINATION DIRECTORY; the data file and its .manifest are copied as a verified pair. Empty disables the remote leg; a local absolute path is copied directly (temp+fsync+rename). |
mnesia_backup_offsite_lifecycle_managed | per-call | boolean | false | — | : operator attestation that a REMOTE offsite destination has an external lifecycle/retention policy. A locally-mounted destination is pruned by Sol automatically (same age + per-day retention); false on a remote destination makes sol_mnesia_backup_offsite_managed 0 and pages SolBackupOffsiteUnmanaged. |
scrape_deadline_ms | per-call | integer | 5000 | — | : the whole /metrics scrape deadline (ms). Once spent, remaining formatters are skipped (their families are ABSENT, counted in sol_scrape_deadline_exceeded_total) — a wedged dependency can never lose the whole scrape or the dead-man. Bound ≥500. |
airgap_mode | per-call | boolean | false | SOL_AIRGAP_MODE | : explicit air-gap posture ack. In prod, readiness normally requires an off-host backup target (offhost_target_required); airgap_mode=true makes the off-host leg optional while the LOCAL scheduled Mnesia backup stays mandatory (mnesia_backup_interval > 0 — 0 is a readiness local_backup_required error in an air-gapped prod node). Boolean grammar is strict (a non-boolean value refuses the boot). |
sol_exec_default_timeout_ms | per-call | integer | 120000 | — | Default wall-clock timeout for sol_exec-managed child processes (ms). |
Channels & marketplace
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
channel_max_concurrent | per-call | integer | 5 | — | Maximum concurrent channel event deliveries. |
teams_validation_rate_per_minute | per-call | integer | 30 | — | Per-channel rate limit for the Teams subscription-validation echo (fixed one-minute window; over-limit answers a bounded 429). The echo also requires a configured teams_auth_token. |
unsigned_webhook_rate_per_minute | per-call | integer | 60 | — | Per-channel fixed-window body budget for allow_unsigned_webhooks=true channels (anonymous plugin dispatch). Over budget the webhook answers a bounded 429 + Retry-After: 60; each accepted delivery carries input_trust=anonymous_input in the audit event and dispatch log. |
marketplace_ratings_max_age_ms | per-call | integer | 7776000000 | — | Marketplace rating-row max age (ms; 90 days) before refresh. |
marketplace_ratings_sweep_ms | per-call | integer | 86400000 | — | Marketplace ratings sweep cadence (ms). |
memory_wal_drop_policy | per-call | enum | block | — | Memory-WAL overflow policy when the durable leg is down: block or drop (drop is counted loudly). |
memory_wal_sync_every_ops | per-call | integer | 0 | — | Fsync the active memory-WAL segment every N accepted enqueues (0 = off; the default keeps the historical throughput — ack means segmented/page-cache durable, power-loss is bounded by the flush cadence). |
memory_wal_sync_every_ms | per-call | integer | 0 | — | Fsync the active memory-WAL segment on the first enqueue after this interval (0 = off; no timer wakeups). |
cluster_lease_reports | per-call | boolean | — (unset → on) | — | Cross-node lease-report exchange lever (cluster maintenance). |
Air-Gapped Deployment
airgap_mode (SOL_AIRGAP_MODE) is the explicit air-gap posture ack. It
has ONE effect: in prod it relaxes the readiness requirement for an
off-host backup target (the local scheduled Mnesia backup remains
mandatory). It is not an egress switch. Egress is enforced by the opt-in
gates documented in security.md §Egress inventory: LUNA_ALLOW_OSV_CHECK (Luna/MCP OSV lookups — fail-closed,
default off), LUNA_ALLOW_TOOL_INSTALL (Luna tool auto-install downloads
and package-manager legs — fail-closed, default off; ) and
ZERG_ALLOW_EGRESS_UPDATE (zerg-cli update checks). Sol’s own outbound
sockets target deployment-configured endpoints only — but the inventory
also includes the license/seat refresh (seats_url;
seats_refresh_ms=30000) and OAuth token refresh for declarative
providers. In an air-gap, leave seats_url empty, disable unused OAuth
providers, and point Mango/provider/webhook URLs at in-cluster services.
Bind defaults (http_ip 127.0.0.1, zmq_bind_addr 127.0.0.1) keep the
control plane off the network. See
air-gap-install.md for the walkthrough.
Boot Validation & Strict Boot
The boot ladder is contractual — the HTTP listener (bound inside
sol_http:start/0 under sol_transport_sup) and the ZMQ sockets start only
AFTER the event store is initialized. The order, pinned by the
boot_order_lint CI gate:
sol_sup:start_link (static tree, no transport tail)
→ sol_config:validate_all (required keys, ranges, placeholder secrets)
→ sol_config:validate_optional (the ~44-entry optional battery — LIVE)
→ init_event_store (tables, registrations, boot replay)
→ gate_event_store_boot (strict refusal OR maintenance degrade)
→ supervisor:start_child (DEFERRED TRANSPORT: sol_transport_sup,
sol_plugin_sup, sol_memory_sup)
→ remaining init labels (workflow defs/compensations/providers,
workflow recovery)
→ check_strict_boot (post-init strict gate)
Before this change the transport tail was a static part of sol_sup, so
HTTP+ZMQ served stale/empty projections during the whole boot-replay window.
Strict boot is per-label. A failed init label is recorded per boot; what happens next depends on the levers, evaluated per label:
| Lever | Semantics |
|---|---|
| (no env set) | event_store defaults strict — the boot REFUSES ({refuse_boot, {strict_boot_init_failed, [event_store]}}) before any listener binds. Every other label defaults non-strict (warn-and-boot). |
{strict_boot, event_store} = false | The documented degraded posture: the boot continues, and maintenance mode is enabled BEFORE the transport starts — projection routes serve 503 maintenance_mode (the sol_auth_middleware gate; /health, /api/v1/health, /api/v1/ready, /metrics stay exempt) until the operator resolves the store. |
strict_boot = true (global master-override) | The data-integrity set (event_store, workflow_recovery) refuses the boot — unchanged from its pre- contract. |
{strict_boot, Label} = true/false | Per-label lever; wins over both the global override and the default for that label. |
The global master-override itself is a Sol app-env key:
| Key | Restart | Type | Default | Env Var | Description |
|---|---|---|---|---|---|
strict_boot | boot | boolean | false | — | global master-override: true makes the data-integrity init labels (event_store, workflow_recovery) refuse the boot; the per-label {strict_boot, Label} lever wins over it. Read once by sol_app:check_strict_boot/0 (boot-time only) |
validate_optional boot gate: the optional-key battery (range checks for
keys like max_active_requests, scale_down_grace_ms, embed_max_concurrency;
boolean-type checks for zmq_enabled, mango_auth_enabled, …) ACCUMULATES
every violation and refuses the boot with {error, {invalid_config, [Violation, …]}}, logging each violated entry loudly. Undefined keys are
exempt — the battery only judges keys the operator actually set. Violation
shapes mirror validate_config’s range checks: {out_of_range, Key, Val, Min, Max} and {wrong_type, Key, Val}.
VM Args
Defined in config/vm.args (development) and config/vm.prod.args (production).
| Arg | Default | Description |
|---|---|---|
-name | sol@127.0.0.1 | Erlang node name. Must be unique in cluster. |
SOL_CLUSTER_COOKIE | unset (dev) / required (prod) | Distribution cookie. The vm.args carry NO -setcookie line: the entrypoint installs the cookie as $HOME/.erlang.cookie mode 0400 (or SOL_COOKIE_FILE), so it never appears in ps/argv. Charset [A-Za-z0-9_@-], max 64 chars. prod: must be explicitly set, at least 16 chars, and must not be sol_cookie or the CHANGE_ME_GENERATE_A_UNIQUE_COOKIE placeholder — otherwise the boot refuses. The cookie must match across cluster nodes. sol_app:rotate_cookie/0 generates a 64-char hex cookie |
SOL_COOKIE | unset | Legacy alias for the distribution cookie (read only when SOL_CLUSTER_COOKIE is unset): sol_app:apply_cookie_override/0 calls erlang:set_cookie/2 at runtime (charset [A-Za-z0-9_-@], max 256 chars; invalid values are ignored with a warning). Prefer SOL_CLUSTER_COOKIE — the prod gate consumes that name. |
+A | 4 | Number of async threads |
+S | 4 | Number of scheduler threads |
+K | true | Enable kernel poll (epoll/kqueue) |
+hms | 8192 | Minimum heap size (words) |
+hmbs | 8192 | Minimum binary heap size (words) |
+zdbbl | 32768 | Distribution buffer busy limit (production only) |
Luna Agent Configuration
Luna loads configuration from JSON files, CLI arguments, and environment
variables (client/core/config.lua).
Config File Locations
Config files merge in this order (later wins — client/core/config.lua
discover_config_files/1, profile merged last at config.lua:347):
~/.luna.json < ~/.luna/settings.json < .luna.json < .luna/settings.json < .luna/settings.local.json < profile (Paths.profile_config_path)
| Location | Priority | Example |
|---|---|---|
| CLI arguments | Highest | --model glm-5.1 |
.luna/config.json | High | Project-local config |
~/.luna/config.json | Medium | User global config |
Each file is deep-merged on top of DEFAULT_CONFIG. Encrypted fields are
decrypted via core.age_crypto if present. Schema version lives in
_config_version (currently 1).
Security-relevant keys from the project-local files additionally require the repo-config consent gate (below).
CLI Arguments
| Argument | Short | Type | Default | Description |
|---|---|---|---|---|
--model | -m | string | glm-5.1 | Model alias or ID |
--permission-mode | -p | string | default | Permission mode: default, allow-all, deny-all, read-only, plan, auto |
--resume | -r | flag | false | Resume last session |
--print | — | flag | false | Non-interactive: print response and exit |
--session | -s | string | auto | Session file path |
--gc-sessions | — | flag | false | Dry-run the session-corpus GC and exit (no session/provider boot) |
--gc-apply | — | flag | false | Apply the session-corpus GC and exit (age/idle/lease guarded) |
--gc-max-age-days | — | number | config (30) | Age cutoff override for a GC run |
--gc-limit | — | number | unlimited | Maximum eligible sessions processed by one GC run |
--theme | — | string | default | Color theme: default, onedark |
--connect | — | string | — | Headless ZMQ worker mode: connect to the Sol ROUTER endpoint (e.g. tcp://127.0.0.1:5555) |
--id | — | string | — | Worker identity for --connect mode |
--pub-endpoint | — | string | — | Sol PUB endpoint for --connect mode (events) |
--editor | — | flag | false | Editor session posture (requires --connect): hold ONE lane lease across turns — adopt the first task-scoped grant, refresh it while active, release on exit. The lease rides the existing lane_control plane; there is no stdio lane-control verb |
--session-lane | — | string | — | Preferred lane/use case for the editor session (implies --editor); advisory — Sol still owns placement and may refuse typed |
--propose-edits | — | flag | false | Headless editor edit turn: write-class calls surface one validated tool_use proposal and are never executed; execute-class calls are refused. The editor reviews the diff and applies only on accept. See client/docs/vim-integration.md § |
Environment Variables
| Variable | Default | Description |
|---|---|---|
LUNA_MODEL | glm-5.1 | Default model (zmq_worker.lua; connect-mode task fallback) |
LUNA_LOG_LEVEL | info | Log level: debug, info, warn, error (main.lua) |
LUNA_CONFIG_PROVENANCE | unset (off) | boolean |
LUNA_SQLITE_PATH | ~/.luna/sessions.db | SQLite session DB path override (session_backend.lua) |
LUNA_BLOB_MAX_BYTES | 10485760 | Per-blob cap at store time (loud error on exceed); retrieve verifies content hash — torn blobs raise, never silently nil (blob_store.lua) |
LUNA_BWRAP_ALLOW_ROOT | unset | Explicit ack to run bwrap as real root |
LUNA_CLASSIFIER_ENABLED | unset | Force the AI permission classifier on/off (true/false; ai_classifier.lua) |
LUNA_PERMISSION_ASK_TIMEOUT_MS | 120000 | Worker-side ask wait timeout (ms) before a typed deny; the Sol registry owns the authoritative timeout |
LUNA_LEGACY_WRITE_IMPLIES_EXECUTE | unset | Override the coarse write⇒execute RBAC rule (config.lua/permission_checker.lua; default true — new installs set false) |
LUNA_ZMQ_ALLOWED_WORKSPACE_ROOTS | unset | Comma-separated allowlist of wire-supplied workspace roots (fail-safe; zmq_worker.lua) |
LUNA_ALLOW_OSV_CHECK | unset (off) | Opt-in egress gate for MCP/OSV vulnerability lookups (fail-closed; see security.md) |
LUNA_ALLOW_TOOL_INSTALL | unset (off) | Opt-in egress gate for tool auto-install network legs. Package-manager installs that use sudo additionally require explicit caller consent |
Advanced environment overrides
The production levers below were read by code with no live-doc mention
(the UW-6 audit). Defaults are the code defaults; ci/config_env_docs_parity_lint.py
keeps this table and the client/ READ corpus in lockstep (both
directions).
| Variable | Default | Description |
|---|---|---|
LUNA_MEMORY_MODE | dual | Memory backend selector: dual (default), json, sqlite, file, vector, hybrid, graph. Config key memory.mode wins over the env. graph is a real scoped KV-over-triples backend (one has_value triple per key); graph neighbour expansion is prefix-scoped. Memory refuses to start without $HOME (no /tmp fallback). |
LUNA_ANALYTICS_DB | ~/.luna/analytics.db | Local analytics SQLite path override (CLI/tests). |
LUNA_DATA_DIR | ~/.luna-relative | Packaging/deployment data-dir override. |
LUNA_SESSION_MAX_MESSAGES | 1000 (code default when unset) | Per-session record ceiling (Session.MAX_ALL_MESSAGES); older records are dropped with a counted WARN. This is an in-memory/JSONL cap, not a corpus GC — 0 drops all but the newest record set, it is NOT unbounded |
LUNA_SESSION_TOOL_RESULT_TURN_BUDGET_BYTES | 40000 | Per-operator-turn aggregate tool-result text budget; overflow renders a persisted-output marker + read_tool_output handle. 0 disables. |
LUNA_SESSION_FULL_OUTPUT_BLOB_BYTES | unset | Blob-spill threshold for tool output in sessions. |
LUNA_BLOB_MIGRATE_MAX_BYTES / LUNA_BLOB_MIGRATE_MAX_FILES | unset | One-shot blob-store migration bounds. |
LUNA_KEYRING_REQUIRED | config keyring_required (false) | Refuse the plaintext config fallback when no OS keyring exists. |
LUNA_SHA256_CLI | unset (off) | Opt-in openssl dgst backend for SHA-256/HMAC on large buffers; only 1/true arms it. Default OFF keeps MAC’d planes zero-fork (FFI, then the pure-Lua floor) — see crypto.md. |
LUNA_ALLOW_SESSION_KEYS | unset | SECURITY ACK: allow model-driven session-key combos (ctrl+alt+F2, alt+F2,…). Default REFUSE; only 1 consents (computer_use.lua). |
LUNA_ALLOW_INSECURE_TLS | unset | SECURITY ACK: acknowledge a caller’s verify_peer=false request. The transport still pins CURLOPT_SSL_VERIFYPEER=1 — this ack can never weaken TLS; it only silences the refusal and logs a warning (web_fetch_shared.lua). |
LUNA_ALLOW_PLAINTEXT_HTTP | unset | SECURITY ACK: permit plaintext http:// for NON-loopback in-process targets. Default REFUSE — non-loopback targets need https://; loopback is always reachable. The config twin is execution.sandbox.allow_plaintext_http=true (transport.lua). A failed TLS probe never downgrades silently. |
LUNA_SNAPSHOT_CLEANUP_AGE_HOURS | 24 | Git-snapshot auto-cleanup age. |
LUNA_SNAPSHOT_CLEANUP_INTERVAL_MS | 3600000 | Git-snapshot cleanup cadence. |
LUNA_SNAPSHOT_DEBOUNCE_MS | 2000 | Debounce after a mutating-tool completion. |
LUNA_SNAPSHOT_RETRY_BASE_MS | 500 | Git-snapshot retry backoff base (exponential). |
LUNA_SNAPSHOT_RETRY_CAP_MS | 30000 | Git-snapshot retry backoff cap. |
LUNA_SNAPSHOT_RETRY_MAX | 5 | Git-snapshot retry attempt bound. |
LUNA_TOOL_OUTPUT_COMPACT_THRESHOLD | code default | Token threshold for compact tool-output rendering. |
LUNA_TOOL_OUTPUT_COMPACT_HEAD_CHARS | code default | Head-chars kept by the compact renderer. |
LUNA_LANE_RESOLVE_TIMEOUT_MS | 120000 | Lane-resolve deadline override (clamped by the task timeout). |
LUNA_MCP_START_BUDGET_MS | 1500 | Bounded MCP bootstrap budget. |
LUNA_SIXEL / LUNA_IMAGE_PROTOCOL | unset | Terminal image protocol: LUNA_SIXEL=1 or LUNA_IMAGE_PROTOCOL=sixel enables sixel (term_probe.lua). |
LUNA_ZMQ_CURVE_PUBLICKEY / LUNA_ZMQ_CURVE_SECRETKEY | unset | Worker CURVE keypair (z85; non-loopback transport posture — see docs/zmq-security.md). |
LUNA_ZMQ_HANDSHAKE_IVL_MS | liveness default | ZMTP handshake interval. |
LUNA_ZMQ_HEARTBEAT_MS | liveness default | ZMTP heartbeat interval. |
LUNA_ZMQ_RCVHWM / LUNA_ZMQ_SNDHWM | liveness default | ZMQ high-water marks. |
LUNA_ZMQ_TCP_KEEPALIVE (+ _CNT / _IDLE_S / _INTVL_S) | 1 / OS defaults | ZMQ TCP keepalive posture. |
LUNA_ZMQ_TOKEN_BATCH_BYTES | transport default | Token-batch flush bound. |
LUNA_ZMQ_BUSY_LIVENESS_MS | liveness default | Busy-worker liveness window. |
LUNA_ZMQ_IDLE_NO_INBOUND_MS | max(4×idle window, 60000) | (RV-044): the HARD no-inbound ceiling for an idle registered worker. A successful fire-and-forget send (the 5 s heartbeat) is not bidirectional evidence — the send-success suppression only defers the trip to this ceiling. >0 sets an explicit ceiling in ms; 0 restores the legacy send-only suppression (never trips while sends succeed). Deliberately a bounded reconnect cadence, not a “never trip” posture (client/core/zmq_liveness.lua). |
LUNA_AI_PROVIDER / LUNA_AI_MODEL | config provider/model | Provider and model overrides for the headless/ZMQ task path (the config keys win when set). |
LUNA_AI_API_KEY | unset | API key for the shell/headless provider path. |
LUNA_WORKSPACE | unset | Declared config-resolver override for workspace_root (wins=fill: only when no file layer set it). |
LUNA_ZMQ_LIVENESS_MS | liveness default | Worker-liveness window (frame-stamp freshness). |
LUNA_ZMQ_TCP_KEEPALIVE_CNT | OS default | ZMQ keepalive probe count. |
LUNA_ZMQ_TCP_KEEPALIVE_IDLE_S | OS default | ZMQ keepalive idle seconds. |
LUNA_ZMQ_TCP_KEEPALIVE_INTVL_S | OS default | ZMQ keepalive probe interval. |
LUNA_ZMQ_TOKEN_BATCH_MS | 20 | Token-batch flush interval; 0 disables batching. |
LUNA_WEDGE_WATCHDOG_MS | task-timeout-derived | Wedge-watchdog progress-age threshold override. |
LUNA_CONCURRENT_TOOL_WAIT_MS | 300000 | Drain deadline for in-flight concurrent tools. |
LUNA_PENDING_RESULTS_MAX | 4096 | (BVI-068): cap on the in-RAM terminal-retransmit ledger (_pending_results). The cap matches the durable terminal spool; insert over it drops the OLDEST entry loudly (counted, with the durable row surviving when the spool is available). A non-positive/invalid value falls back to 4096. |
LUNA_SPAWN_GROUP_REGISTRY | unset (off) | (BVI-017): opt-in supervisor marker (=1) that enables the <data>/spawn_pgids registry consumed by client/contrib/luna-orphan-sweep.sh (starttime-checked orphan-group kill after a SIGKILLed Luna). Default off keeps test/embedded spawns out of the user’s real data dir; the runit unit sets it in production. |
LUNA_PTB_TIMEOUT_MS | plugin-bridge default | Plugin-bridge call timeout (Sol’s plugin_execute_timeout_ms twin). |
LUNA_REFUSE_WITHOUT_MONOTONIC | unset | Refuse startup when the real monotonic clock is unavailable (otherwise the watchdog degrades to wall clock, loudly). |
LUNA_SIGNAL_SHIM | built-in path | Dev/test path to the signal shim shared object (production uses the built binary). |
Luna→Sol endpoint family (the memory/vector-search and completion
client legs read these; the single documented port is SOL_HTTP_PORT,
). There is no SOL_PORT env var (retired; use
SOL_HTTP_PORT).
| Variable | Default | Description |
|---|---|---|
ZERG_API_URL | unset | Full base URL override; wins over host/port. |
SOL_HOST / SOL_HTTP_HOST | 127.0.0.1 | Sol HTTP host. |
SOL_HTTP_PORT | 21434 | Sol HTTP port. |
SOL_TOKEN / SOL_API_KEY | unset | Luna→Sol HTTP bearer (MANGO_TOKEN is also accepted). |
Luna completion entry — client/run --complete
reads one JSON object on stdin and writes raw completion text on stdout
(exit 0). It posts only to POST /v1/completions on Sol; it never calls
a lane /infill endpoint or ollama. Protocol and trim behavior:
docs/cli-reference.md.
Input: {"prefix","suffix","model?","max_tokens?","stop?","temperature?"};
an empty prefix is a no-op (no request). A configured bearer is attached as
Authorization: Bearer; plaintext credential transport is allowed only to a
loopback host unless ZERG_ALLOW_INSECURE=1 (the CLI transport matrix).
| Variable | Default | Description |
|---|---|---|
ZERG_COMPLETE_MODEL | unset | Completion model when the request and --model omit one; unset = Sol default. Do not point this at a non-FIM model. |
ZERG_COMPLETE_TOKENS | 96 | Completion-token budget when the request omits max_tokens (clamped to the server ceiling of 1024). |
ZERG_COMPLETE_TIMEOUT | 15 | Completion HTTP timeout (seconds). |
ZERG_COMPLETE_MAX_PREFIX_BYTES | 8000 | Prefix tail kept (nearest the cursor); 0 = unlimited. UTF-8 codepoint-safe. |
ZERG_COMPLETE_MAX_SUFFIX_BYTES | 1000 | Suffix head kept; 0 = unlimited. UTF-8 codepoint-safe. |
Defaults (client/core/config.lua DEFAULT_CONFIG)
All rows below are read from config.lua:15-131.
| Key | Default | Notes |
|---|---|---|
model | "sonnet" | string |
max_tokens | 8192 | must be > 0 |
max_iterations | 50 | capped at 200 |
permission_mode | "default" | one of allow-all, deny-all, read-only, default, plan, auto |
steering_mode | "all" | all or one-at-a-time — steer-queue drain mode |
follow_up_mode | "all" | all or one-at-a-time — follow-up-queue drain mode |
auto_compaction_input_tokens_threshold | 100000 | min 1000 |
provider_base_url | nil | string |
providers | {} | Settings-level custom providers — see Settings providers |
api_key | nil | string |
mcp_servers | {} | table |
permission_rules | {allow={}, deny={}, ask={}} | table |
thinking_level | nil | one of none, minimal, low, medium, high, xhigh |
system_prompt | nil | string |
append_system_prompt | nil | string |
lsp_enabled | false | boolean |
lsp_servers | {} | table |
agents_dir | nil | string |
extensions_enabled | false | boolean — opt-in (allow-listed sandbox is the prerequisite) |
local_agents_dir | nil | string |
session_budget_usd | 0 | number — 0 disables |
tool_timeout_ms | 60000 | number |
tool_timeout_max_ms | 600000 | Upper clamp for model-supplied command timeouts; the expiry alarm kills the child process group |
fallback_providers | {} | table |
response_format | nil | string |
model_low / model_medium / model_high | nil | string |
auto_continue_after_compaction | false | boolean |
slot_isolation | false | boolean |
format_on_write | false | boolean |
lint_on_write | false | boolean |
budget_grace_enabled | true | boolean |
tool_guardrails | {} | table |
fork_turns | "none" | string |
verification_enabled | false | boolean |
git_step_tracking | false | boolean |
track_git_diffs | false | boolean |
persistent_retry_max_duration | 21600 | number (seconds) |
fallback_model | nil | string |
legacy_write_implies_execute | true | boolean |
keyring_required | false | boolean — refuse plaintext-config fallback when no OS keyring |
otel_endpoint | nil | string — Luna-local span sink; no cross-service tracing |
metrics_port | nil | number — opt-in loopback worker /metrics port |
summarize_turns | false | Opt-in per-turn summary generation (uses provider tokens) |
web_search_provider | "duckduckgo" | Search provider: duckduckgo, searxng, brave, bing |
brave_api_key | — | API key for Brave search provider |
web_search_url | — | Required for the searxng provider (loopback targets refused at the egress gate) |
mcp_sampling_enabled | false | Allow MCP servers to request LLM sampling |
mcp_elicitation_enabled | true | Register the production MCP elicitation/create handler and advertise the client capability. false removes the handler and the capability; headless/default responses are always decline — the optional operator responder is the only accept path |
command_policy | "standard" | Execution policy: strict, standard, permissive |
session_backend | "dual" | Session storage mode: "dual" (JSONL + SQLite, default), "jsonl" (JSONL only) (session_backend.lua DEFAULT_MODE) |
session_sqlite_path | "~/.luna/sessions.db" | SQLite database path — resolved from the SessionBackend.init db-path arg, the LUNA_SQLITE_PATH env, then the default |
session_gc | {enabled=false, max_age_days=30, min_idle_seconds=600, page_size=100, dry_run=true, delete_trajectory=true, delete_orphan_tmp=true} | Opt-in session-corpus GC. See Session corpus GC |
zmq | {} | ZMQ worker-mode options (incl. allowed workspace roots) |
Nested defaults
{
"compaction": {
"trigger_percent": 70,
"protected_turns": 5,
"cooldown_seconds": 120,
"max_consecutive": 3,
"max_tool_output_chars": 2048
},
"retry_config": { "max_retries": 3, "base_backoff_ms": 1000 },
"token_guard": {
"budget_ratio": 0.8,
"max_input_tokens": null,
"max_output_tokens": null,
"adaptive_truncation": true,
"truncation_scale_min": 0.25
},
"auxiliary": {
"model": null, "provider": null, "api_key": null, "base_url": null,
"max_tokens": 2048, "temperature": 0.3, "tasks": {}
},
"team": { "queue_backend": "durable" },
"search": { "cjk_trigram": false },
"session_gc": {
"enabled": false,
"max_age_days": 30,
"min_idle_seconds": 600,
"page_size": 100,
"dry_run": true,
"delete_trajectory": true,
"delete_orphan_tmp": true
},
"execution": {
"sandbox": {
"enabled": true,
"bwrap": "auto",
"landlock": "auto",
"network": false,
"allow_plaintext_http": false,
"read_only_dirs": {}, "allowed_write_paths": {},
"rw_dirs": {}, "denied_paths": {}, "denied_read_paths": null,
"deny_sockets": null, "deny_sockets_ack": false,
"allow_git_trust_writes": false,
"posture_downgrade_ack": false
}
}
}
Sandbox is ON by default (fail-closed). A prompt-injected agent does not get unsandboxed shell. Operators wanting the legacy insecure behavior set
execution.sandbox.enabled = false(config.lua; documented insecure option)."auto"backends prefer bwrap, fall back to landlock-in-fork, and error when neither is available.execution.sandbox.deny_socketsreplaces the/dev/nullsocket-shadow list ( — docker/podman/containerd*.sockdenied by default; adds the build-time-resolved/run/user/<uid>/{keyring,gnupg},/run/gnupg, and$SSH_AUTH_SOCK;/tmp/ssh-*/agentstays an accepted residual).deny_sockets = []denies none ONLY withdeny_sockets_ack = true— without the ack the empty override is ignored and the defaults apply (the dangerous-override ack discipline; a non-empty list replaces the defaults without an ack).
execution.sandbox.read_only_dirsentries must NOT be nested under a granted write root (workspace root,allowed_write_paths, orrw_dirs): the Landlock fork layer’s path-beneath rules are additive and cannot subtract a child from a parent grant, so such a config is refused with the typedlandlock_ro_overlap:<path>:<write-root>error ( — the spawn refuses in every mode rather than pretending the path is read-only). A read-only entry that is an ANCESTOR of a write root is supported (the nested write grant is dropped). Use bwrap’s ro-binds for subtractive read-only semantics.
execution.sandbox.allow_git_trust_writes(defaultfalse) is the explicit model-tool rollback lever for the git trust-file write-deny.git/{config,hooks,attributes,info,modules}and.gitmodulesare write-denied for every model tool because a planted textconv/filter/hook turns a later READ-class git call into command execution. Setting ittrueadmits those writes (the operator takes the trust decision); absent/false refuses with a typedgit trust fileerror. The deny also resolves symlinked parents (a repoevil ->.gitcannot carry a write through).
execution.sandbox.allow_any_commit_restore(defaultfalse) is the snapshot-restore scope lever:git_snapshot restore(and the undo snapshot replay) only restores commits reachable from a Luna-ownedrefs/luna-snapshot/*ref. The pre-fix shape accepted any hex commit and wrote its tree into the worktree through a path-addressed redirect; combined with a repo symlink (evil ->.git) that overwrote.git/config. Restore now also runs the shared write policy per target and writes each file through the fd-relative no-follow workspace primitive. Setting this keytrueadmits an explicit non-Luna commit (the operator takes the trust decision); the refusal otherwise names the restriction and this lever. Session checkpoint restore is an internal caller and is unaffected.
execution.sandbox.posture_downgrade_ack(defaultfalse) is the operator acknowledgement for a bwrap→Landlock-only posture downgrade- a payload cannot flip the latch (wrapper- attributed failures only, N consecutive), and a posture that requires a bwrap-only property (
network=false,read_mode=allowlist, a non-emptydenied_read_paths,deny_socketsunlessdeny_sockets={}+deny_sockets_ack=true,bwrap=required,require_effective_layer=true) REFUSES the spawn instead of silently losing it. Setting the ack re-arms the wrapper attempt and clears a latched downgrade (counted + EventBus-visible).
Settings providers
providers declares custom OpenAI/Anthropic-compatible endpoints in the
layered settings (user/project keys merge like every other key). Entries are
validated and registered at config load through the shared
core.provider validator — a malformed entry fails the load loudly; it is
never deferred to first use.
{
"providers": {
"local": {
"base_url": "http://localhost:11434",
"wire_format": "openai",
"models": ["qwen2.5-coder:7b"],
"no_api_key": true
},
"remote": {
"base_url": "https://api.example.com",
"wire_format": "openai",
"models": ["example-large"],
"api_key_env": "EXAMPLE_API_KEY"
}
}
}
| Field | Required | Rules |
|---|---|---|
base_url | yes | http(s)://host[:port] — the bare host:port. The provider appends /v1/chat/completions (openai) or /v1/messages (anthropic); a base_url ending in /v1 is refused at load (it would 404). A query/fragment is refused; trailing slashes are trimmed. |
wire_format | no | openai (default) or anthropic. |
models | no | Array of non-empty model names. Matching is the historical register semantics: exact or prefix (qwen2.5-coder:7b matches model qwen2.5-coder:7b-…). Custom providers are consulted before the prefix heuristics, so a models entry for a qwen* name routes to your endpoint instead of the alibaba cloud provider. |
api_key_env | keyed providers | Environment-variable name (never a raw key; api_key is refused). The key is read from the env, then the OS keyring. |
no_api_key | keyless providers | Boolean. The explicit keyless rule: no env/keyring lookup and no auth header. Loopback only — localhost, 127.0.0.0/8, or ::1; a non-loopback no_api_key provider is refused at load (fail-closed). Cannot be combined with api_key_env. |
Either api_key_env or no_api_key: true is required per provider.
Duplicate names: last definition wins. A settings entry replaces a programmatically registered provider of the same name (the operator’s settings are authoritative), the next config load re-asserts it, and a name that disappears from the settings is unregistered. Within the file layers, the normal merge precedence applies (later user/project layer wins).
Consent: providers is part of the provider plane, so a
project-local (.luna.json, .luna/settings.json,
.luna/settings.local.json) providers table is stripped unless the repo
has the trust marker — a cloned repo cannot redirect inference (or a
key-bearing request) without approval.
Repo-config consent gate
Project-local config files (.luna.json, .luna/settings.json,
.luna/settings.local.json) deep-merge OVER user config — a cloned repo
can carry security-relevant keys. Those keys apply ONLY with a consent
marker. Source: client/core/repo_config_security.lua (the family list +
strip) and client/core/repo_config_trust.lua (all semantics below).
Security-relevant key families (from project-local files):
| Family | Meaning |
|---|---|
execution.* | Sandbox posture (execution.sandbox.enabled, bwrap mode, network flag) |
permission_* | Any key starting with permission (e.g. permission_mode, permission_override) |
server_permissions | Server-grant RBAC list |
workspace, workspace_root | Workspace roots |
workdir, _workspace | Workspace-root aliases — first candidates for the bwrap bind root AND the Landlock grant root (sandbox.lua); _workspace is first precedence in tools/init.lua, workdir in formatters.lua/linters.lua — covered by this gate per (LUNSBX-1) |
provider_base_url | Wire destination of every provider request |
providers | Settings-level custom provider definitions — base_url/wire_format/models and api_key_env or no_api_key |
api_key, api_keys | Provider credential sources |
auxiliary | Auxiliary model plane — base_url/api_key |
fallback_providers | Failover destinations |
otel_endpoint | Luna-local span sink (fire-and-forget HTTP POST from the worker; no cross-service tracing — Sol/Mango export no spans) |
classifier | AI permission-classifier provider plane — enabled/model/provider/base_url; base_url is a network destination for classifier traffic |
system_prompt, append_system_prompt | Prompt-injection planes: project-supplied prompt text |
tool_validation, tool_guardrails | Execution-policy planes: disabling validation or loosening guardrails |
desktop_override | Display-global input injection opt-in |
web_search_url | Search destination (credentialed search API keys ride along) |
memory | Memory backend selection — mode/backends incl. a remote vector_host |
extensions_enabled, agents_dir, local_agents_dir, mode | Extension opt-in and agent-mode discovery/selection |
Trust-marker flow:
Consent is a hash-keyed marker in the USER’s approval dir:
~/.luna/approvals/trust-<sha256>.json.
A marker inside the repo is deliberately NOT used — an attacker shipping
the repo also ships the marker; user-owned storage is the only trust
boundary that survives git clone attacker && cd repo && luna.
Record-validated, atomic: all three consent planes share
client/core/approvals_store.lua. Existence alone is not approval: a
corrupt/truncated record, a record whose hash/kind names a different
identity, or an unknown record version is IGNORED (fail closed). Legacy
records without v/kind/hash (including {} rows) stay valid. Writes
use FFI.atomic_write (mkostemp 0600 from birth + fsync + checked rename);
the previous trust-marker writer was umask-dependent for the write window.
Filenames and hash domains are preserved: trust-<hash>.json (config),
<hash>.json (MCP), extension-<hash>.json (extensions). See
consent.md.
The hash covers BOTH file-sets: the config security keys (in merge
precedence order) AND permission_override values from .luna/agents/
mode files — one marker approves both, so a config-only approval can never
silently authorize mode overrides.
Fail-closed without TTY: no marker and no TTY → the security-relevant
project-local keys are IGNORED (stripped with a loud stderr warning,
sandbox stays ON). With a TTY the operator is prompted once (y/N) and
consent writes the marker; anything but an explicit y/yes is a
decline. Verdicts are memoized per working directory for the process
lifetime (M.reload clears them).
Fingerprint: the permission-cache fingerprint derives
from the sandbox posture (enabled/bwrap/network) and — per —
includes the workspace root, so a re-rooted boundary (a repo that
changes workdir/_workspace/workspace_root) invalidates cached allow
decisions even with an identical sandbox posture.
Defensive provider gate: provider.from_model/3
independently refuses a provider_base_url whose effective value equals
the project-carried value while the consent verdict is false — a strip
bypass falls back to the built-in destination with a CRITICAL line and a
repo_base_url_refusals count. Value equality (not presence) keeps a
same-key user-supplied URL legitimate.
Project mode files: without consent, EVERY
behaviour-bearing project mode field is dropped (permission_override,
the permissions ruleset, system_prompt, system_prompt_section,
tool_filter, tools, extra_tools, model, temperature,
max_steps, max_iterations, max_turns, category), and a project
file whose name collides with a NATIVE mode (build, plan, …) is
refused entirely — a cloned repo cannot shadow the operator’s modes or
apply a hidden ruleset.
Custom/extension handler config: custom and
plugin/extension handlers receive a deep, sanitized READ-ONLY COPY of the
agent config — no _agent (provider key), credentials/provider-plane
keys, server_permissions, or permission policy. Workspace context and
the sandbox execution posture stay visible; mutations only touch the
copy (the framework re-sanitizes on every dispatch).
Audit pattern: the consent-gate corpus rows — workdir="/",
_workspace="/", array/object variants, and the approved-repo-gains-
workdir re-prompt.
Session & Search
| Key | Type | Default | Description |
|---|---|---|---|
search.cjk_trigram | boolean | false | Use the FTS5 trigram tokenizer for the CJK session-search table (messages_fts_cjk). Requires SQLite built with the trigram tokenizer. When enabled the table is created with tokenize='trigram'; when disabled unicode61. Switching the setting on an existing database drops-and-recreates the table and reindexes once. Threaded from main.lua → SessionBackend.init → session_sqlite.open. |
{ "search": { "cjk_trigram": false } }
Session corpus GC (session_gc)
. The session corpus is retain-forever by default; this table
opts into a whole-session sweep. Manual surfaces: --gc-sessions (dry
run), --gc-apply, --gc-max-age-days N, --gc-limit N; TUI /gc
(dry run) and /gc run [DAYS] (explicit apply). There is no LUNA_*
env override for these keys.
| Key | Type | Default | Description |
|---|---|---|---|
session_gc.enabled | boolean | false | Opt-in idle cleanup. false means no automatic sweep ever runs |
session_gc.max_age_days | number | 30 | A candidate’s last activity (max file mtime, index updated_at, SQLite updated_at) must be at least this old |
session_gc.min_idle_seconds | number | 600 | Additional recent-activity guard (corpora touched inside this window are skipped) |
session_gc.page_size | number | 100 | Scan/deletion page size (1–10000; cursors resume a sweep) |
session_gc.dry_run | boolean | true | Default for programmatic/manual runs; --gc-apply and /gc run override explicitly |
session_gc.delete_trajectory | boolean | true | Remove trajectory_<id>.jsonl with the session |
session_gc.delete_orphan_tmp | boolean | true | Remove age-gated orphan .luna_session_* / .luna_edit_* temps in the sessions dir |
A candidate is the primary JSONL + rotations (.1/.2) + a stranded
.rotate.tmp; deletion also covers SQLite rows (both FTS tables via the
DELETE triggers), the JSON index entry, the optionally-included
trajectory, and a stale .active lease. Content-addressed blobs,
analytics, git snapshots, and session-scoped memory are explicit
exclusions. Held leases, the current session, recent corpora, and
symlinks are refused. See sessions.md
for the operator contract and secure-deletion limits.
AI Permission Classifier (Ollama, client-side)
Defaults from client/core/ai_classifier.lua; env override
LUNA_CLASSIFIER_ENABLED.
| Key | Type | Default | Description |
|---|---|---|---|
classifier.enabled | boolean | false | Enable AI permission classifier |
classifier.model | string | qwen2.5-coder:7b | Ollama model for classification |
classifier.base_url | string | http://localhost:11434 | Ollama API base URL |
classifier.confidence_threshold | float | 0.85 | Minimum confidence for auto-decision |
classifier.timeout | integer | 5 | Request timeout in seconds |
classifier.cache_size | integer | 64 | LRU decision cache entries |
Worker metrics exposition
Luna can expose a loopback-only Prometheus text endpoint for
worker-local health (client/core/metrics_exposition.lua). It binds
127.0.0.1 only — any other host is refused — and serves GET /metrics
with a bounded request/accept posture. Families: sandbox zero-layer
spawns/refusals, tool errors, memory entries/bytes/flush-unlocked, and FTS
rebuilds. This is worker-local: the scrape target/wiring is a
deployment decision (there is no central Sol claim over Luna metrics).
{ "metrics_port": 9477 }
metrics_port = nil (the default) keeps the endpoint off. A port below
1024 requires privileges; prefer an unprivileged port and a per-worker
offset when multiple workers share a host.
Keymaps (~/.luna/keymaps.json)
Customize TUI key bindings. Overrides defaults for specified modes.
{
"normal": { "Ctrl+P": "command" },
"input": { "Ctrl+A": "beginning_of_line" }
}
Modes: normal, input, search, menu. View all bindings with /keymaps TUI command.
Memory Taxonomy
Memory extractor uses 4 types: fact, preference, procedure, relationship. Consolidator deduplicates within each category.
TUI Commands
| Command | Description |
|---|---|
/compact | Compact entire session |
/compact --from <id> | Compact messages before the specified entry |
/compact --up-to <id> | Compact messages up to and including the specified entry |
/keymaps | Display all key bindings |
Search Providers
| Provider | Auth | Notes |
|---|---|---|
duckduckgo | None | Default, HTML scraping |
searxng | None | Self-hosted, requires web_search_url config (loopback targets refused at the egress gate) |
brave | API key | Set brave_api_key in config |
bing | None | HTML scraping, no API key needed |
Example Configurations
Development (Single Machine)
%% config/sys.config
[
{sol, [
{http_port, 21434},
{http_ip, "127.0.0.1"},
{llama_server_path, "/usr/src/llama.cpp/llama-server"},
{model_source_dir, "/fun/models"},
{model_store_dir, "/tmp/sol/models"},
{zmq_enabled, true},
{max_workers, 4}
]}
].
Production (Cluster Node)
%% config/sys.prod.config
[
{sol, [
{http_port, 21434},
{http_ip, "0.0.0.0"},
{llama_server_path, "/usr/local/bin/llama-server"},
{model_source_dir, "/mnt/nfs/models"},
{model_store_dir, "/var/lib/sol/models"},
{worker_path, "/opt/sol/etc/luna"},
{max_workers, 32},
{cluster_nodes, ['sol@gpu-node-2', 'sol@gpu-node-3']},
{zmq_enabled, true},
{zmq_bind_addr, "0.0.0.0"}
]}
].
## config/vm.prod.args
-name sol@gpu-node-1
-setcookie production_secret_cookie
+A 8
+S 8
+K true
+zdbbl 32768
Luna (User Config)
// ~/.luna/config.json
{
"model": "glm-5.1",
"provider": {
"type": "anthropic",
"api_key": "sk-..."
},
"permission_mode": "auto",
"theme": "onedark",
"classifier": {
"enabled": true,
"model": "qwen2.5-coder:7b",
"confidence_threshold": 0.85,
"timeout": 5,
"cache_size": 64
}
}
Custom Agent Modes
Agent modes are defined as JSON or Markdown files in ~/.luna/agents/ or .luna/agents/.
JSON Format
{
"name": "security-review",
"display": "Security",
"description": "Security-focused code review mode",
"badge": "S",
"color": "red",
"category": "primary",
"permissions": {
"*": "deny",
"read_file": "allow",
"grep_search": "allow",
"glob_search": "allow",
"bash": { "default": "ask", "patterns": { "npm audit*": "allow" } }
},
"tool_filter": "all",
"model": "glm-5.1",
"max_steps": 25
}
Markdown Format
name: security-review
display: Security
description: Security-focused code review mode
badge: S
color: red
category: primary
permissions:
"*": deny
read_file: allow
grep_search: allow
glob_search: allow
tool_filter: all
model: glm-5.1
max_steps: 25
# System Prompt
You are a security-focused code reviewer...
Mode Definition Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique mode identifier (lowercase, hyphens) |
display | string | Yes | Display name in TUI |
description | string | Yes | One-line description |
badge | string | No | Single-char TUI badge (auto-assigned if missing) |
color | string | No | TUI color name |
category | string | No | primary (Tab-cyclable) or secondary |
permissions | object | No | Per-tool ruleset (see permissions.md) |
tool_filter | string | No | all or tool list |
model | string | No | Override model for this mode |
temperature | float | No | Override temperature |
max_steps | integer | No | Override max iterations |
system_prompt | string | No | Additional system prompt section (Markdown body) |
Ollama Integration
Server-Side (Sol)
Ollama is auto-discovered at http://localhost:11434 (ollama_url). Models
registered via sol_provider_boot with the ollama atom mapping; the model
list refreshes every 5 minutes.
Client-Side (Luna Classifier)
See AI Permission Classifier
above — classifier.* keys with defaults from ai_classifier.lua.
Related configuration surfaces (out of scope)
These are separate config namespaces with their own sources of truth —
not part of the sol app env or the Luna merge, so they are not tabulated
here:
| Surface | Where | Notes |
|---|---|---|
| Mango (identity service) | mango/conf.py + env | Own settings module; Sol-side bridge keys (mango_*) are in Auth / Security above |
| Limon (ops console) | limon/ build env (VITE_*) | Client-side build-time env, not runtime Sol config. The one Sol-side CORS knob is limon_origin |
| zerg-cli (operator binary) | own config file + env | See zerg-cli/ docs / zerg status |
| Production injection | runit env files /etc/sv/zerg-sol/env/ (wild blueprint) | SOL_* env vars are the primary production surface — see wild/AGENTS.md |