Architecture Pillar // 02
Transactional 2-Phase DAG Engine
Zero half-baked states. Deploy multi-container topologies as atomic transactions with deterministic rollbacks.
The Failure Mode of Shell Scripts
When an AI coding agent executes ad-hoc shell commands to deploy applications, steps often succeed partially: the database volume is allocated, the container image pulls, but the environment variable syntax contains an error. The container crashes on boot, leaving orphaned resources, broken port allocations, and dead proxies.
The Smoooth DAG Solution
Smoooth models infrastructure changes as a Directed Acyclic Graph (DAG). Deployments are executed across two distinct phases:
- Plan Phase (Dry Run): Dependencies are resolved (e.g. database must be healthy before web app boots). Resource constraints, volume paths, and port collisions are validated.
- Apply Phase (Transactional Execution): Operations execute in topological order. Smoooth polls container health probes (HTTP/TCP). If any probe times out or errors, execution is immediately halted, and the entire transaction is rolled back to the previous snapshot.
Atomic Checkpoint Rollback
# Automatic rollback sequence in daemon log:
[INFO] Applying plan #39: [pgdata] → [postgres] → [nextjs-app]
[OK] Volume pgdata mounted (persisted)
[OK] Container postgres:16 booted (port 5432 verified healthy)
[FAIL] Container nextjs-app health probe failed: HTTP 500 on /healthz
[WARN] Triggering automatic transactional rollback!
[OK] Restored previous container snapshot: nextjs-app:v1.2.0
[OK] Reverted Caddy reverse proxy routing cutover
[OK] Database state preserved. Downtime avoided.