Skip to content

Development surfaces

What a development run opens and a deployment never does — plain HTTP, public documentation, an emit, a seed — as a Surface field resolved by profile.

A config has one base, its Default, and what a development run opens is a value in it. Plain HTTP, public documentation, a committed artifact’s emit, a seed: each is a nest_rs::config::Surface field, ByProfile in Default. The code asks where it uses it, the framework’s at the boot and the seed below on its tick, so a process resolves it once it knows what it declares, and a process that declares no <PREFIX>_ENV runs as production and opens nothing.

crates/features/src/audio/config.rs
use nest_rs::config::{Surface, config};
#[config(namespace = "audio")]
#[derive(Clone, Default)]
pub struct AudioConfig {
pub synthetic_seed: Surface,
}
impl AudioConfig {
pub fn seeds(&self) -> bool {
self.synthetic_seed.is_open()
}
}
crates/features/src/audio/schedule/tasks.rs — the check
if !self.config.seeds() {
return Ok(());
}
The field holdsdevelopmentteststaging, production, undeclared
ByProfile, read with is_open()openopenclosed
ByProfile, read with writes()openclosedclosed
Open, or true from the variableopenopenopen
Closed, or false from the variableclosedclosedclosed

writes() is an emit’s reader: under test, parallel suites would rewrite a committed file. The framework’s storage, OpenAPI, GraphQL and Server-Timing configs use the same type, and each says at warn, where the value takes effect, when a deployment opens one: plain HTTP to a store, a public surface, an emit. opened_in_deployment() is the question they ask, the deployed profile it is open in, so a seed of your own says itself the same way, in the check its tick makes, once however often the tick asks:

crates/features/src/audio/config.rs — the check, with its line
static SEED_OPEN_SAID: Once = Once::new();
impl AudioConfig {
pub fn seeds(&self) -> bool {
if let Some(environment) = self.synthetic_seed.opened_in_deployment() {
SEED_OPEN_SAID.call_once(|| {
tracing::warn!(
target: TARGET,
environment = environment.as_str(),
"{SEED_OPEN}",
);
});
}
self.synthetic_seed.is_open()
}
}

The profile is read where the value is used, never in the overlay: the overlay also runs over a value pinned in code, and a profile rule there would silently rewrite a deliberate choice. A written Open or Closed is never touched, and a pin of any other field over ..Default::default() leaves the surface to the profile.

An address or a credential is never one, in any profile: no Default names a database, a Redis, a store or the pair to reach it. The profile’s .env file does — nestrs new writes compose.yml’s services into .env.development and .env.test — and a deployment names its own. The same file holds a value that differs by profile and opens nothing, a pool size or a level.