Deploy a stack: topological order over metadata.dependsOn, sequential,
create-or-update per application (see module doc), best-effort storage
seeding via the injected seeder, stop (skip the rest of the order) on
the first failure. dryRun resolves the deploy order AND computes the
drift plan (plan) — the same report StacksClient.diff produces —
via READ-ONLY API calls (org application list + per-app declaration GETs);
it mutates nothing. Orphans are included in the plan only for a whole-stack
dry-run (no app filter).
Per-application drift: 'not-deployed' (would create), 'would-update'
(with the canonicalDiff change list against the deployed declaration
version), 'in-sync', or 'orphaned' (live in the org but not declared in
this stack file — report-only; deploy never deletes). A declaration fetch
failure is reported as 'would-update' with a <unknown> change rather
than failing the diff. Diff is always a whole-stack view (no app
filter), so orphans are always reported.
Declared-vs-observed cross-reference: one org-wide application list matched by metadata.name. Structured result — no rendering.
Tear down a stack: reverse dependency order (dependants first), skip-missing, continue past per-application delete failures.
Validate a stack without touching the API: parse + schema + name uniqueness + dependsOn cycle check, reported as structured issues.
sdk.stacks — declarative multi-application orchestration (see module doc).