Stack Schema Reference

This page is a generated YAML serialization appendix for the typed stack contract. The public API contract is the Rust type and validation model documented at /docs/stack-format; this schema projection exists for tooling and machine-readable checks.

Schema version: https://stackie.dev/schemas/composite-stack/v1.json

Formal specification for stackie stack YAML (v1). A stack file contains exactly one top-level key (the stack name) whose value is a CompositeStack object.

CompositeStack

A named collection of block instances with optional dependency ordering and per-instance overrides. Extra fields (e.g., ‘name’, ‘description’, ‘test’ for integration test harnesses) are permitted — stackie’s serde layer ignores unknown keys.

PropertyTypeRequiredDescription
schema_versionv1noOptional schema version declaration. When present, must match a supported version (currently ‘v1’).
blocksmap<string, StackBlockNode>noMap of block instances keyed by block identifier (e.g., ‘stackie.postgres’, ‘my-api’, ‘gateway.aws’).
ingredientsmap<string, StackBlockNode>noLegacy alias for ‘blocks’. Use ‘blocks’ for new stacks.
stacksmap<string, SubstackReference>noSubstacks to compose into this stack, keyed by substack name.
modemanaged | unmanagednoStack management mode controlling port-allocator activation.
storage_rootstringnoOptional storage root prefix for all block volume paths in this stack.

At least one of the following must be present: blocks, ingredients, stacks.

StackBlockNode

A single block instance within a stack. May be null (no overrides) or an object with optional override fields.

Scalar form: null

Object form (variant 2)

PropertyTypeRequiredDescription
pathstringnoLocal source directory for first-party blocks (relative to CWD).
depends_onarray<string>noNames of blocks that must start before this block.
consumesarray<string> | map<string, ConsumesEntry>noPort-consumption declarations. Accepts list of block names or map of alias → consumes entry.
providerstringnoProvider selector (e.g., ‘aws’, ‘gcp’). Required for gateway.* blocks.
namestringnoDisplay name for this block instance.
versionstringnoBlock version override.
environmentmap<string, string>noEnvironment variables for this block.
servesmap<string, PortConfig>noPorts served by this block.
portsmap<string, PortConfig>noLegacy alias for ‘serves’.
varsmap<string, string>noString variables accessed as ${vars.NAME}.
pathsmap<string, string>noNamed filesystem paths accessed as ${paths.NAME}.
hooksanynoLifecycle hooks (opaque JSON; stackie deserializes at runtime).
initarray<any>noAdditional init operations to run after block’s own init.
commandstring | array<string>noCommand to run (string or array of strings). Required for first-party blocks.
toolsarray<any>noRuntime tool requirements (e.g., [{node: '20'}, {python: '3.11'}]).
health_checkHealthChecknoHealth check configuration.
emojistringnoDisplay emoji for the topology view.
sandboxbooleannoSandbox opt-out for first-party blocks (true = sandboxed, the default).
bindingsmap<string, string>noFaaS dev-mode bindings: maps a function name to a user-defined block name. Only meaningful on gateway.* blocks. When present, the Gateways runtime resolves the block port at startup and routes invocations to that block instead of creating a new container.

ConsumesEntry

A single port-consumption descriptor. Accepts string shorthand or object form.

Scalar form: string

Object form (variant 2)

PropertyTypeRequiredDescription
port_typestringno
block_overridestringno

PortConfig

Port configuration. Accepts a bare integer (the port number), a string (for ${vars.X}-interpolated values resolved later at runtime), or an object with optional port/type/protocol plus extension fields like expose/label/value.

Scalar form: integer

Scalar form: string

Object form (variant 3)

PropertyTypeRequiredDescription
portinteger (min: 0, max: 65535) | stringno
valueinteger (min: 0, max: 65535) | stringno
typestringno
port_typestringno
protocolstringno
exposebooleanno
labelstringno

HealthCheck

Health check configuration (HTTP, TCP, command, or process-based).

No properties defined (opaque object — validated at runtime).

SubstackReference

Override settings for a substack included via the ‘stacks:’ field.

PropertyTypeRequiredDescription
varsmap<string, string>no
portsmap<string, map<string, PortConfig>>no
storage_rootstringno