Define an environment

Describe what this environment can provide.

presolve.env.toml describes which workloads can run here, the available resources, and the services/providers that can satisfy application requirements. It is not a secrets file or deployment plan.

Docs / Define an environment

The application says “I need relational SQL.” The environment says “I can provide SQLite here” or “I can provide PostgreSQL here.” Presolve compares those statements without putting connection strings or provider configuration into the application.

Where it fits

Environment supply becomes compatibility input.

AuthoredEnvironment filepresolve.env.toml
→
ValidatedEnvironment inventoryexact provider supply
→
Compared with app needsCompatibility + plancheck + selection
Representative example

A local multi-provider environment.

specification_version = "0.1"

[environment]
id = "env_5c4f14f0-5f7d-4f7a-8df7-b829ef9a0208"
name = "local-dev"

[resources]
memory_mib = 4096
cpu_millis = 4000

[execution]
workloads = ["component", "container"]

[[providers]]
id = "prv_e02be85a-84ab-4dd7-b604-b3690357ed90"
name = "state-services"

[[providers.capabilities]]
interface = "presolve:kv/store"
version = "0.1.0"

[[providers.capabilities]]
interface = "presolve:objects/store"
version = "0.1.0"
features = ["range-read"]

[[providers]]
id = "prv_a62d1d0c-55f4-4ebf-9027-d5ab0ab43081"
name = "sqlite-sql"

[[providers.capabilities]]
interface = "presolve:sql/database"
version = "0.1.0"
features = ["dialect-sqlite"]

[[providers]]
id = "prv_3fdadcf2-27ab-4fe2-9cb2-6c7649f130ad"
name = "memory-queue"

[[providers.capabilities]]
interface = "presolve:queue/work-queue"
version = "0.1.0"

The file says these providers and semantics exist. It still does not say where a SQLite file lives, which Redis host to dial, which S3 bucket to use, or which password unlocks PostgreSQL.

Stable identity

Names are for people. IDs are for stable joins.

EnvironmentId

env_<uuid> identifies the environment declaration across human-facing renames.

ProviderId

prv_<uuid> identifies one concrete supply instance and becomes the stable join into runtime materialization.

EnvironmentProviderprv_…
→
PlanSelected providerprovider_id = prv_…
→
RuntimeProvider registryprv_… → implementation
Service supply

Environments advertise exact versions.

[[providers.capabilities]]
interface = "presolve:objects/store"
version = "0.1.0"
features = ["range-read", "user-metadata"]

The application may request a version range such as ^0.1; the environment advertises an exact version because it represents concrete supply. A provider advertises only optional semantic features it actually supports.

Application requirementProvider supplyResult
objects ^0.1 + required range-readobjects 0.1.0 + range-readcompatible
sql ^0.1 + required dialect-postgresqlsql 0.1.0 + dialect-sqliterejected
queue ^0.1 + preferred ordered-receivequeue 0.1.0 baseline onlycompatible, lower rank
Resources + execution

Presolve also checks whether the workload fits.

[resources]
memory_mib = 4096
cpu_millis = 4000

[execution]
workloads = ["component", "container"]

Resource capacity is currently compatibility-visible supply; it is not a multi-application scheduler or reservation system. Workload execution support is explicit and is not inferred from whichever providers happen to be installed.

Runtime boundary

Operational settings stay outside the environment file.

Environment file
  • provider identity
  • capability interface + exact version
  • supported semantic features
  • resource capacity
  • workload classes
Runtime/provider configuration
  • Redis address
  • S3 endpoint/bucket/region
  • SQLite file path
  • PostgreSQL host/user/password
  • cloud account IDs and API credentials

This distinction keeps presolve.env.toml a declaration of what the environment can supply rather than turning it into a secrets file.

CLI workflow

Create and inspect environments without editing IDs by hand.

presolve env init local-dev
presolve env provider add memory-services --provides kv,objects
presolve env provider list
presolve env show
presolve env check

For the complete command behavior and advanced capability declarations, see CLI & workflows.

Validation

Environment inputs are treated as untrusted.

Presolve rejects malformed IDs, duplicate providers, unsupported specification versions, unknown fields, providers with no capabilities, malformed capability interfaces/versions/features, duplicate workload kinds, and other semantic inconsistencies before compatibility checks run.

Canonical environment reference on GitHub ↗
Continue

See what matching produces.