Skip to content

Lexicons

A lexicon is a collection of types and semantic lint rules for an operational area. The core system is lexicon-agnostic — it discovers files, collects exports, resolves dependencies, and runs semantic lint rules. Each lexicon plugs into this pipeline with its own types and rules.

LexiconPackageResourcesReference
AWS CloudFormation@intentius/chant-lexicon-aws1500+Reference
Azure ARM@intentius/chant-lexicon-azure200+Reference
GCP Config Connector@intentius/chant-lexicon-gcp150+Reference
Kubernetes@intentius/chant-lexicon-k8s50+ resources, 35+ propertiesReference
Helm@intentius/chant-lexicon-helm10+ resourcesReference
GitHub Actions@intentius/chant-lexicon-github2 resources, 13 compositesReference
GitLab CI/CD@intentius/chant-lexicon-gitlab3 resources, 16 propertiesReference — also ships GitHub Actions migration
Docker@intentius/chant-lexicon-docker6 resources (Compose + Dockerfile)Reference
Temporal@intentius/chant-lexicon-temporal4 resources + Op workflow engineReference

Lexicons opt into the chant lifecycle diff <env> --live pipeline by implementing one of two plugin methods: describeResources() (entity-keyed — for 1:1 cloud resources) or listArtifacts() (context-keyed — for runtime concepts created by tooling outside chant’s entity model). See Drift Detection — Resources and artifacts for the conceptual distinction, and Implementing Observation for the author-side walkthrough.

LexicondescribeResources()listArtifacts()OwnershipNotes
AWSTagsaws cloudformation describe-stack-resources; --owned available on live export (not on describe — tags absent there)
AzureTagsaz resource show per declared entity; resource-group is the env name. --owned available on live export (az group export carries tags; not on describe)
GCP (Config Connector)Labelskubectl get <gvk> against the GKE management cluster
KubernetesLabelskubectl get <kind> per declared entity; ~20 common types
TemporalTemporal client — namespaces, search attributes, schedules
Helmhelm list -A -o json — releases as artifacts
Dockerdocker ps, docker image ls, docker network ls (NDJSON)
GitHub ActionsN/A — workflow definitions are git-tracked; drift is git diff (rationale)
GitLab CI/CDN/A — same rationale (README)

Lexicons that implement neither are warn-skipped — --live doesn’t fail the whole command for them.

The Ownership column shows the marker channel a lexicon queries for the --owned filter (ownership marking). means the --owned query isn’t available for that lexicon — it has no durable marker channel. Where a lexicon is asked for owned resources but can’t read a marker on a given path — e.g. AWS and Azure describeResources, which the filter degrades to detect-only — it logs that ownership is unavailable and returns everything rather than silently filtering. The --owned filter is honored on live export, where the full config (with tags) is available.

The GitLab lexicon ships a chant migrate source for from: github — translates .github/workflows/*.yml into .gitlab-ci.yml (or typed chant TypeScript), with provenance recorded as SARIF and a curated mapping table for the top 33 marketplace actions. See GitLab → Migration for the full surface, or the chant migrate CLI reference.

Future lexicons can opt into the same machinery by implementing migrationSource(from: string) on their plugin.

TypeScript definition files that describe available resource classes, their properties, and intrinsic functions. These types power editor autocompletion, inline documentation, and compile-time checks.

Lint rules specific to the target ecosystem. These integrate with chant lint to catch provider-specific mistakes like invalid resource configurations or naming convention violations.

Each lexicon implements the Serializer interface to convert evaluated resources into the target platform’s output format.

interface Serializer {
name: string;
rulePrefix: string;
serialize(entities: Map<string, Declarable>, outputs?: LexiconOutput[]): string | SerializerResult;
}

A bundle is the distributable form of a lexicon — a dist/ directory containing everything chant needs at build time:

ArtifactDescription
manifest.jsonLexicon metadata (name, version, intrinsics, pseudo-parameters)
meta.jsonResource registry mapping type names to definitions
types/index.d.tsTypeScript declarations for all resource and property types
integrity.jsonPer-artifact xxhash64 checksums
rules/Lint rule implementations
skills/AI assistant skill definitions

When you install a lexicon package (e.g. @intentius/chant-lexicon-aws), the bundle is what ships inside it. Lexicon authors produce bundles with chant dev publish.

chant is provider-agnostic by design. The core handles parsing, module resolution, evaluation, and serialization — but knows nothing about specific infrastructure platforms.

Lexicons bridge this gap:

  • The core stays lean — no bundled provider SDKs or type catalogs
  • Providers update independently — new resource types ship as lexicon updates
  • Custom targets are first-class — organizations can author internal lexicons
  • Projects declare exactly what they need — explicit, reproducible dependencies