Skip to content

Capabilities

llms.txt lists every page for an agent

A capability is a typed leaf behavior, registered once and named after an operation. Components compose capabilities; the orchestrator dispatches to them by kind. This is the unit of reuse — smaller than a pipeline, smaller than a “kind” of component.

interface Capability<In, Out> {
kind: string; // "publish-image", "cfn-deploy", ...
run(ctx: DeployContext, input: In): Promise<Out>;
rollback?(ctx: DeployContext, input: In): Promise<void>; // paired compensation
plan?(ctx: DeployContext, input: In): Promise<CapabilityPlan>; // what run would change
outputs?(ctx: DeployContext, input: In): Promise<Record<string, unknown>>; // what run exposed when it last ran
}

Typed In/Out let compositions wire one step’s output into the next and let lint check the wiring before anything runs.

plan is optional. A capability that has it can say what run would change before it changes anything. It answers with a member name, that member’s plan digest and an artifact for run. A gated-wave fan-out calls it for each wave, binds the wave’s gate to the set digest of the answers, and hands the artifact back to run as ctx.plans[member] so the approved plan is the one applied. arm-deploy, cfn-deploy, gcp-apply, kubectl-apply and terraform-apply implement it. Plan previews lists every capability with whether it has plan and outputs, and what a pull request’s plan note shows for it.

A plan can also answer outputs, the outputs run will expose once it applies that plan: known holds each value it can say, by name, and unknown names the ones known only after apply (#3999). A pull request’s plan reads a dependent’s stackOutput() references from there when both are in the change. It reads them from outputs() when the upstream is not in the change. arm-deploy, terraform-apply, cfn-deploy, gcp-apply and kubectl-apply answer both.

A run handed ctx.plans[member] that finds the target moved since that plan applies nothing and throws an error with planMoved: true (#3997). The step fails like any other, and the command that ran it exits 4 (moved) where a failed step exits 1. That holds for chant run --components, components fan-out, pr-apply, promote, rollback and redeploy. An exitCode of 3 on the error counts the same. Any other exitCode is ignored, so a capability can’t choose the process’s exit code. arm-deploy, cfn-deploy, gcp-apply, kubectl-apply and terraform-apply on a choudoufu root mark their refusals this way.

A plan can also answer shape, a PlanShape from @intentius/chant/components: the resources the plan touches with their actions, replacement, type and changed properties, the properties an unknown input drives, and the inputs it was planned without (#4419). The lexicon decides what goes in it; core compares two shapes with planShapeDifferences. A pull request’s apply compares the shape of a member planned after its upstream applied with the shape it previewed, and the first approval covers the round only when core finds no difference. A plan without shape gets one derived from its change-set entries, which carries addresses and actions only. cfn-deploy answers shape.

A lexicon checks its shapes with checkPlanShapeConformance from its own tests. It takes five shapes made by the lexicon’s planner: a preview with unknown inputs, a fresh plan that matches it, and real changes that are added, missing or replaced against it. It returns the problems, an empty list when the lexicon conforms: the preview and the fresh plan each give the same digest twice, core finds no difference between them, and core finds a difference in each of the other three. lexicons/aws/src/components/cfn-plan-shape-conformance.test.ts runs it for cfn-deploy.

Many distinct components on the left, one generic orchestrator in the middle, and a small shared set of capabilities on the right that every component draws from. Many distinct components on the left, one generic orchestrator in the middle, and a small shared set of capabilities on the right that every component draws from.
The sprawl fix: unbounded components, one generic orchestrator, a bounded capability set.

The set is a plugin registry, not a closed enum. Verbs group into families. The Plugin column says who contributes each: core ships the cloud-agnostic verbs in its always-loaded starter set; a cloud lexicon contributes its own leaves through the same capability-plugin seam, loaded when a project’s chant.config.ts lists that lexicon (lexicons: ["aws"]). So a component’s cfn-deploy step resolves only when the aws lexicon is active — core itself has no AWS in it. See the cloud boundary.

FamilyVerbsPluginNotes
builddocker-build, zip-package, jvm-buildcoresource → archive, keyed by artifact type
sbomgenerate-sbomcoreartifact-type-keyed software SBOM (native SPDX/CycloneDX, hermetic lockfile backend) into the build archive — see Build Archive
supply chainsign, attest-provenance, verify, scan-vulnerabilities, vuln-gatecorekeyless cosign signing/attestation + a deploy-time verify gate and vulnerability policy gate
wait / verify (agnostic)wait-cluster-healthy, wait-endpoint, health-gatecorebolt-port cluster probe + HTTP readiness/health gates
secretsensure-secretcoregenerated-once materialization (#1365): read-then-write — present means done, never mints over an existing value, never rotates implicitly; a presence / declared key-set / metadata mismatch stops the apply naming key names only; needs-opt-out rollback (COMP003); store adapters come from provider lexicons
escape hatchshellcoretyped, lint-flagged
apply (Cloudflare Workers)wrangler-deploy, wrangler-versions-promote, r2-synccorewraps the wrangler/rclone CLIs directly — the Workers plane is deliberately ceded to wrangler (no cloudflare lexicon owns these; #1293); r2-sync mirrors s3-sync’s input shape
sbom (config)extract-config-bomawsIaC config-BOM (declared resources / nested stacks / external refs) from the synthesized CloudFormation template into the build archive
publish (registry)publish-imagecoreone verb; load, tag, push and the digest read-back are core’s. Each cloud lexicon contributes its registry login as a backend (aws ecr, azure acr, gcp artifact-registry), picked by the registry host or $env.publish.backend (#3142, #3143)
publish (artifact)publish-artifact (alias publish-asset)coreone verb; the content digest and object URI are core’s. Each cloud lexicon contributes an upload as a storage backend through CapabilityPlugin.storageBackends() (aws s3, azure azure-blob, gcp gcs), picked by $env.publish.backend or the destination URI (#4408)
publishload-image-on-host, publish-asset / publish-artifactawsdeploy-time, promote by identity
apply (azure)arm-deployazurenative per-resource ARM applier, owned-only prune
wait / verify (azure)wait-for-deployment, wait-container-appazureARM provisioning-state poll; Container App latest-revision poll
apply (gcp)gcp-applygcpnative REST applier over Config Connector manifests
wait / verify (gcp)wait-for-operation, wait-cloud-run-readygcplong-running operation poll; Cloud Run terminal-condition poll
applycfn-deploy, ecs-update-service, lambda-deploy, s3-sync, cdn-invalidate, run-migrationawscfn-deploy carries safety options (changeset preview, onReplace, stageGsi)
job submissionemr-start-job-run, emr-submit-stepawspoint a running compute service at an artifact; reusable for Glue / Batch / Step Functions
host / code deliverycode-deploy, copy-to-host, remote-execawscode-deploy = AWS CodeDeploy; the others are SSM host verbs (SSH transport pending)
wait / verify (cloud)wait-for-stack, wait-steady-state, wait-jobawsCloudFormation / ECS / EMR terminal-state polls
safety / rollbacksnapshot-before, rollback-previousawsDynamoDB/RDS/EBS snapshot + restore
applyarm-deployazurean ARM template into one resource group through azApply, the Op applier, so floci-az and Azure take the same path; plan reads each resource live (plan previews)
applygcp-applygcpa Config Connector manifest over the applier’s REST mappers, planned from a live read of each resource; honours GCP_ENDPOINT_URL for floci-gcp
applykubectl-apply, kustomize-applyk8sserver-side apply as chant:<stack> with the marker-scoped prune; kustomize renders in front of the same pipeline
gitopsargo-app, flux-reconcilek8sapply the controller’s CR through the same stack-labelled pipeline, then wait for convergence — Healthy+Synced for Argo, Ready (terminal on wedge reasons) for Flux
applyhelm-upgradehelmhelm upgrade --install of one release, on the cluster the environment’s k8s binding names; native rollback to the previous revision, so COMP003 asks no opt-out
applyterraform-applyterraformone Terraform root from terraform.roots, planned with terraform plan
stateterraform-state-unlock, terraform-state-pushterraforma state-lock release by its ID, and state files written with state push; each runs once under a gated request on the gate ledger (state operations)
actionterraform-actionterraformone Terraform action block invoked by its address with plan -invoke, then the saved plan applied, once, under a gated request at tf-action (actions)
copyterraform-copyterraforma root planned and applied under backend settings of its own, such as a pull request’s copy at a suffixed state key
engine outputsmember-outputscoreanother workspace member’s outputs, applied and planned, read through its engine; each engine’s lexicon contributes a source through CapabilityPlugin.engineOutputSources() (terraform: choudoufu; pulumi: pulumi). It reads and never applies (#4455, wiring)
applyfly-release, fly-rollbackflya release served by a Fly Machine, and going back to an earlier one
releaserelease-imagecorethe image a release recorded for the component, handed to the cut by digest; stands where a publish step would and gives uri and digest. A run under the release fills it in, and it fails in a run that names no release (#4694, an image built elsewhere)

A genuinely new apply family (job submission was one) is written once and then reused across every component of that shape. A new component is a declaration only. This is why the family count grows sub-linearly against components — see the cloud boundary for how each family’s leaf maps per cloud.

Some applies are sticky. A DynamoDB GSI updates one at a time; a key-schema change forces replacement; RDS and OpenSearch changes can trigger blue/green or replacement that loses data. That knowledge belongs inside the capability, configured by declarative options, not scripted per component:

phase("Apply", [
cfnDeploy({ stack: "ddb", template: "archive:ddb.template.json", onReplace: "block", stageGsi: true }), // sticky knowledge, captured once
]);

Every sticky resource reuses that one implementation. The alternative — each component scripting its own workaround — is exactly the sprawl the model exists to remove. Capabilities are allowed to be smart (preflight, guard, stage), not thin shells.

Cloudflare’s Worker versions are the same discipline paying off with a whole new cloud attached: wrangler-deploy returns the version id it just published, and wrangler-versions-promote moves live traffic to any version by id. Cloudflare’s own gradual-deployment rollback is exactly “promote to a prior version” — no bespoke undo to write — so wrangler-deploy declares a rollback that re-promotes to whatever version was live before it ran, landing on the same RollbackPolicy: "native" (../orchestration/#rollback-comes-free) every other native-rollback verb uses. r2-sync has no such native undo (an overwritten/deleted object is gone), so it carries needs-opt-out — the same disposition s3-sync does.

The pattern holds only if variance stays behind the capability interface. Three guardrails, enforced by lint:

  • Verbs, not nouns. A capability describes an operation (cfn-deploy), never a component (deploy-search-service). A capability used by exactly one component is a smell.
  • No orchestrator special-casing. The driver takes only the contract. A shell escape hatch is allowed but flagged, and must declare a reason.
  • No composition copy-paste. Identical compositions repeated across components are a declaration-sprawl signal — reach for a preset.

Capabilities give own-destiny, but the common shapes should not be retyped. Presets are named compositions, shipped like the ApplyOp composite:

EcsFargateComponent({ service: "search", image: "search", healthPath: "/healthz" });

A component uses a preset, or starts from one and drops to raw capabilities where it is special. Both produce the same contract and run through the same orchestrator, so presets remove copy-paste without creating a closed strategy set.

chant