Skip to content

State Schema

Field reference for .dwe/deploy/state.yml.

FieldTypeDescription
schema_versionstringAlways "1"; reserved for future format changes
projectobjectProject-level state (deployed_at, config_hash, status, etc.)
servicesmapPer-service state, keyed by service folder name (workspace/services/<name>/)
pendingobjectPending operations that need to be applied; present only when dwe services enable/disable was run without --apply. Written atomically by the toggle command; cleared by dwe restart, dwe deploy run, or dwe reset run
FieldTypeDescription
deployed_atISO 8601 timestampWhen the project was last fully deployed
config_hashsha256 hexFingerprint of tracked services + top-level deploy config + per-service deploy configs. Edits to enabled-but-untracked service variants (e.g., main-debug) do not change this hash.
statusenumdeployed, partial, failed, not_deployed, in_progress
last_runobjectTiming and outcome of the last deploy attempt (status, started_at, finished_at)
phasesmapPer-phase state for project-level (non-service) phases
FieldTypeDescription
statusenumdeployed, partial, failed, not_deployed (service never ran, or all steps skipped)
deployed_atISO 8601 timestampWhen this service was last fully deployed
config_hashsha256 hexFingerprint of workspace/services/<name>/service.yml + workspace/services/<name>/deploy.yml
last_runobjectTiming and outcome of the last deploy attempt for this service
phasesmapPer-phase state for this service’s phases
FieldTypeDescription
statusenumok, failed
stepsmapPer-step state, keyed by step name
FieldTypeDescription
statusenumok, failed, skipped
finished_atISO 8601 timestampWhen this step completed
action_hashsha256 hexFingerprint of the step’s type, cmd, and with: parameters
duration_msintegerHow long the step took to execute, in milliseconds

When dwe services enable or dwe services disable is run without --apply, the toggle command writes the local.yml change immediately but defers the apply step. The pending field in the state file tracks what still needs to run.

Pending entries are recorded only once a deploy has been attempted at least once on this stack. Any prior attempt counts: the journal lists at least one service in a non-not_deployed status (deployed / failed / in_progress / partial / skipped), OR project.last_run is present, OR project.status is set to anything other than not_deployed. If the journal file is corrupt (load error), the toggle still attempts the pending write so the corruption surfaces — silent pending loss would be worse.

Before any deploy attempt, pending has no meaning — the next dwe deploy picks up the new local.yml fresh — so the toggle silently updates local.yml/.env, writes no journal entry, and prints a one-line run dwe deploy hint after the plan.

FieldTypeDescription
operationslistOrdered list of pending operations
config_hashsha256 hexConfig hash at toggle time; used to detect stale pending entries
created_atISO 8601 timestampWhen the pending entry was written
FieldTypeDescription
kindstringrestart (stack-wide) or deploy (per-service)
serviceslistFor deploy kind: the service names that need deploying. Empty for restart.
EventEffect on pending
dwe services enable/disable (without --apply), no deploy attempt on recordNo-op on pending; local.yml/.env updated and a one-line hint suggests dwe deploy
dwe services enable/disable (without --apply), any deploy attempt on record (incl. failed/partial/project-only)Writes pending.operations; adds/merges ops for restart or deploy contributors
dwe services enable/disable --apply successClears only the pending ops that this apply step performed (unrelated pending ops from other sessions survive)
dwe run successClears the restart op (the run itself satisfies it); deploy op survives
dwe stop successClears the restart op (the next run will pick up toggled state); deploy op survives
dwe restart successClears the restart op; deploy op (if any) survives
dwe deploy run (full project) successClears the deploy op; restart op (if any) survives
dwe deploy run --service <name> successRemoves <name> from the deploy op’s service list; if empty, removes the op
dwe reset run (project-wide) successClears all pending (full journal wipe)
dwe reset run --service <name> successWrites {kind: deploy, services: [<name>]} atomically alongside removing service deployed state

dwe status (and its subcommands apps, tools, infra, deploy) display a warning banner when pending is non-nil:

⚠ Pending: deploy required for: svc-a, svc-b
Run: dwe deploy run
⚠ Pending: restart required
Run: dwe restart

The banner is rendered from pending.operations — one line per op. When pending is empty, no banner is shown.