DCL Language Reference

This reference describes DCL by language construct. It is based on the repository's primitive contracts, surface syntax direction, compiler duties, context semantics, policy semantics, and lifecycle documents, adjusted to the current compiler-supported language shape.

Current language: DCL v1.0. Status: Stable language core. Compiler: 1.0.

For local AI-assisted validation and analysis, see the Tooling page and MCP setup guide.

Construct Index

Construct Purpose
Program Language declaration, source files, declaration order, compiler model.
Context Semantic ownership boundary, dependencies, visibility, hierarchy.
Shape Reusable structured data with fields and built-in value types.
Actor Initiating or participating human, system, agent, or scheduled process.
Event Named signal with optional structured payload.
Effect Externally meaningful action caused by a capability.
Policy Portable execution quality attached to semantic boundaries.
Capability Unit of system responsibility and the main authored construct.
Intent Transport-agnostic request accepted by a capability.
Outcome Finite named result class produced by capability evaluation.
Rule Named invariant or business condition used by outcome causation.
When Explicit outcome causation block.
Lifecycle Business progression through steps and transitions.
Observation Metrics and trace declarations derived from language semantics.

Program

A DCL program is a set of source files compiled together into a validated semantic model. Files are authoring units; compiler meaning must not depend on file order or declaration order.

Required

A language declaration, normally language dcl 1.0.

Compiler Duties

Parse source, resolve symbols, validate semantics, analyse ambiguity and soundness, classify portability, and generate IR.

The compiler is the source of truth for example validity. It rejects errors such as undefined symbols, missing capability intent, missing outcomes, invalid policy concerns, and invalid lifecycle references.

Context

A context is a semantic ownership boundary. It is not a file, folder, package, deployment unit, or runtime module. A context groups declarations into an area of architectural responsibility.

Ownership

Every declaration belongs to exactly one context: capability, actor, event, effect, policy, and shape declarations are all owned by their containing context.

Dependencies

Dependencies are explicit. A context that uses declarations from another context must declare depends on ContextName. Visibility is not transitive: if A depends on B, and B depends on C, A does not automatically see C.

Cycles

Circular dependencies are invalid. Resolve cycles by extracting common declarations into a shared context, by using events between contexts, or by moving ownership to a higher-level capability.

context-shared.dcl
language dcl 1.0

context Shared {
  actor Customer is human

  shape SharedOrderInput {
    orderId: Uuid required
    customerId: Uuid required
  }

  event SharedOrderSubmitted is {
    orderId: Uuid required
  }
}
context-sales.dcl
language dcl 1.0

context Sales {
  depends on Shared

  effect PersistSalesOrder is persistence

  capability AcceptSalesOrder {
    intent SharedOrderInput from Customer

    outcomes {
      SalesOrderAccepted
      SalesOrderDeferred
    }

    effect PersistSalesOrder

    observe {
      event SharedOrderSubmitted count as shared_orders_submitted
      outcome SalesOrderAccepted count as sales_orders_accepted
    }

    when {
      PersistSalesOrder unresolved then SalesOrderDeferred
      otherwise then SalesOrderAccepted
    }
  }
}

Shape

A shape defines reusable structured data. Shapes are used by intent inputs, event payloads, and outcome payloads.

Field Part Meaning
name Field name within the shape.
Type Built-in type or declared shape name.
required Marks a structurally mandatory field.

Built-in value types currently include Text, Boolean, Number, Date, DateTime, Uuid, Email, and Money.

Actor

An actor represents an initiating or participating party. DCL v1.0 accepts only the actor types listed below.

Actor TypeMeaning
humanA person or human role.
systemAn external or internal software/system participant.
agentAn autonomous or semi-autonomous reasoning participant.
scheduled_processA scheduled or time-driven participant.

Other actor type names are rejected by the DCL v1.0 compiler. Use system for software/system participants, and model approval or decision responsibility through rules, policies, and actor roles.

Required

Name and classification, authored as actor Customer is human or actor SupportAgent is agent.

Legal Relationships

Actors may provide intent, appear as named capability roles, and be referenced by lifecycle decision steps.

Event

An event is a named signal. Events may have structured payloads. Capability event declarations state which events the capability is an emission source for; they do not prescribe broker, topic, transport, or delivery semantics.

Lifecycle waits and transitions can reference events. In a local lifecycle, omitted event source means the owning capability when ownership is clear. In a supervising lifecycle, the source capability must be explicit.

Effect

An effect declares an externally meaningful action caused by a capability. Effects describe semantic change, not infrastructure mechanics.

Effects may be used singly or in an ordered effects block. after expresses explicit ordering.

Effect TypeMeaning
persistenceStores or updates state.
notificationNotifies a person or system.
invocationCalls another capability or system.
toolInvokes a tool, especially for agentic or AI workflows.

Policy

Policies express portable execution qualities. Authors declare policies and attach them to semantic boundaries. The compiler derives effective policy envelopes; authors do not write those envelopes directly.

Families

A policy block may contain one family block or several grouped family blocks. Concerns belong to the family block that contains them. The older family name line form is accepted for compatibility, but the grouped block form is preferred for DCL v1.0 examples.

Family Purpose Compiler-supported entries
reliabilityFailure handling and dependable execution.retry, backoff, timeout, idempotency, compensation, circuit_breaker
availabilityGraceful degradation and fallback.degradation, fallback, dependency_tolerance
scalabilityLoad and flow-control constraints.concurrency, rate_limit, queue, backpressure
performanceLatency, throughput, and budget targets.latency, throughput, budget
securityIdentity, access, and information protection.authentication, authorization, classification, encryption
complianceRegulatory and evidence requirements.audit, retention, approval, evidence
governanceReview, audit, and organizational control.audit, retention, approval, evidence
data_protectionPrivacy and data handling constraints.sensitivity, masking, minimization, retention, deletion
confidenceDecision or tool-result acceptance thresholds.threshold between 0 and 1
multi-family-policy.dcl
policy SupportExecution {
  reliability {
    retry { attempts 2 }
    idempotency required
  }

  governance {
    audit required
    evidence required
  }

  confidence {
    threshold 0.8
  }
}

confidence is a threshold family, not a full LLM evaluation or grounding model. Observability is expressed with observe blocks, not an observability policy family in DCL v1.0.

Attachment Targets

Policies may govern capability, effect, outcome, event, and lifecycle boundaries when supported by the compiler.

Composition

Multiple policies can apply to the same boundary. The compiler derives the effective policy envelope, checks family/concern compatibility, detects conflicts, and records obligations in IR.

policy-example.dcl
language dcl 1.0

actor Operator is human

effect PublishInvoice is notification
effect PersistInvoice is persistence

policy InvoiceExecution {
  performance {
    throughput above 100 per minute
  }

  governance {
    audit required
    evidence required
  }

  confidence {
    threshold 0.9
  }
}

policy InvoiceSecurity {
  security {
    authentication required
    authorization required
    encryption required
  }
}

shape InvoiceInput {
  invoiceId: Uuid required
  customerId: Uuid required
}

event InvoicePublished is {
  invoiceId: Uuid required
}

capability PublishCustomerInvoice {
  intent InvoiceInput from Operator

  outcomes {
    InvoiceAccepted
    InvoicePublishDeferred
  }

  effects {
    PersistInvoice
    PublishInvoice after PersistInvoice
  }

  policies {
    InvoiceExecution governs capability
    InvoiceSecurity governs event InvoicePublished
  }

  observe {
    capability duration as invoice_publish_duration
    effect PublishInvoice count failures as invoice_publish_failures
    event InvoicePublished count as invoices_published
    outcome InvoicePublishDeferred count as invoice_publish_deferred
  }

  when {
    PublishInvoice unresolved then InvoicePublishDeferred
    otherwise then InvoiceAccepted
  }
}

Capability

A capability is the main unit of DCL responsibility. It evaluates intent, enforces rules, applies policies, produces outcomes, and may cause effects, emit events, or own lifecycle state.

Part Status Meaning
intent Required At least one accepted request shape and actor source.
outcome / outcomes Required Finite named result classes.
rules Optional Named invariants used by capability semantics.
effects Optional Externally meaningful actions and ordering.
events Optional Events emitted by the capability.
policies Optional Policy attachments to semantic boundaries.
lifecycle Optional Local lifecycle owned by the capability.
supervises lifecycle Optional Lifecycle owned by this capability and influenced by contributors.
hello-world.dcl
language dcl 1.0

actor User is human

shape GreetingInput {
  name: Text required
}

capability SayHello {
  intent GreetingInput from User

  outcome GreetingPrepared

  when {
    always GreetingPrepared
  }
}

Intent

Intent is the transport-agnostic expression of a desired business action. It identifies the input shape and actor source for a capability.

Intent must belong to a capability. It does not imply HTTP, synchronous completion, queue semantics, or any specific runtime entry point.

Outcome

An outcome is a finite named result class. Outcomes represent success, rejection, deferral, expiry, failure, escalation, or other meaningful completions without treating failure as an exception by default.

Outcomes may drive lifecycle transitions, observations, policies, and future generated artifacts. The compiler rejects references to undeclared outcomes.

Rule

A rule is a named invariant or business condition. Rules may refer to input fields and named actor roles. Rule expressions prefer human-readable operators such as is true, is present, is less than, and is not equal to.

Rules become meaningful when they participate in outcome causation, usually through a when branch such as a rule being violated.

When

The when block declares explicit outcome causation. It connects rule violations, unresolved effects, unconditional causation, and fallback causation to declared outcomes.

Branch Type Meaning
always Outcome Unconditional outcome causation.
RuleName violated then Outcome Outcome caused by a failed rule.
EffectName unresolved then Outcome Outcome caused by an effect, tool, invocation, or agentic task that cannot produce a definitive result.
EffectName failed then Outcome Alias for unresolved; useful for tool or invocation failure paths.
policy PolicyName denied then Outcome Outcome caused by an authorization policy denial.
policy PolicyName fails then Outcome Outcome caused by a confidence policy not meeting its threshold.
otherwise then Outcome Fallback when earlier branches do not match; must be last.

DCL v1.0 does not support succeeded or expired as general when decision words. violated is for rule constraints being breached. Policy constraints use policy-specific words such as denied, fails, exhausted, times_out, open, degraded, or fallback_used when the matching policy concern can produce that state.

when-examples.dcl
when {
  EmailPresent violated then MissingEmail
  SearchKnowledgeBase failed then ToolUnavailable
  policy MinimumAnswerConfidence fails then InsufficientConfidence
  otherwise then AnswerPrepared
}
register-customer.dcl
language dcl 1.0

actor Customer is human

effect PersistRegistration is persistence
effect SendVerificationMessage is notification

shape RegistrationInput {
  email: Email required
  acceptedTerms: Boolean required
}

event VerificationMessageSent is {
  email: Email required
}

capability RegisterCustomer {
  intent RegistrationInput from Customer

  outcomes {
    RegistrationAccepted
    TermsRejected
    VerificationDeferred
  }

  rule TermsAccepted: input.acceptedTerms is true

  effects {
    PersistRegistration
    SendVerificationMessage after PersistRegistration
  }

  events {
    emits VerificationMessageSent
  }

  when {
    TermsAccepted violated then TermsRejected
    SendVerificationMessage unresolved then VerificationDeferred
    otherwise then RegistrationAccepted
  }
}

Lifecycle

A lifecycle describes business progression over time. It has an owner, steps, transitions, optional waits, optional deadlines, optional recovery, and terminal states.

Local Lifecycle

A lifecycle declared inside a capability is owned by that capability. Current syntax prefers semantic phrases such as waits for event and requires decision from over authored kind metadata.

payment-processing.dcl
language dcl 1.0

actor Customer is human

shape PaymentInput {
  orderId: Uuid required
  amount: Money required
}

event PaymentReceived is {
  orderId: Uuid required
}

capability CollectPayment {
  intent PaymentInput from Customer

  outcomes {
    PaymentRequested
    PaymentExpired
  }

  when {
    always PaymentRequested
  }

  events {
    emits PaymentReceived
  }

  lifecycle {
    begin AwaitingPayment

    step AwaitingPayment waits for event PaymentReceived {
      deadline 15 minutes causing outcome PaymentExpired
    }

    end Paid
    end Expired

    move AwaitingPayment to Paid
      on event PaymentReceived

    move AwaitingPayment to Expired
      on outcome PaymentExpired
  }
}

Supervising Lifecycle

A supervising lifecycle is owned by one capability and coordinated through contributor capabilities. Contributors may produce outcomes or events that cause movement, but they do not mutate lifecycle state directly.

Supervising lifecycle transitions must declare explicit sources. The compiler validates contributor existence, source outcomes/events, reachability, and unambiguous transition causes where possible.

supervising-lifecycle.dcl
language dcl 1.0

actor Customer is human
actor WarehouseOperator is human

effect ReserveStockRecord is persistence
effect CapturePaymentRecord is persistence
effect DispatchParcel is notification

shape OrderInput {
  orderId: Uuid required
  sku: Text required
  quantity: Number required
}

shape PickInput {
  orderId: Uuid required
}

event ParcelDispatched is {
  orderId: Uuid required
}

capability ReserveInventory {
  intent OrderInput from Customer
  outcomes {
    InventoryReserved
    InventoryUnavailable
  }
  effect ReserveStockRecord
  when {
    ReserveStockRecord unresolved then InventoryUnavailable
    otherwise then InventoryReserved
  }
}

capability CapturePayment {
  intent OrderInput from Customer
  outcomes {
    PaymentCaptured
    PaymentDeclined
  }
  effect CapturePaymentRecord
  when {
    CapturePaymentRecord unresolved then PaymentDeclined
    otherwise then PaymentCaptured
  }
}

capability ShipOrder {
  intent PickInput from WarehouseOperator
  outcomes {
    ShipmentStarted
    ShipmentBlocked
  }
  events {
    emits ParcelDispatched
  }
  effect DispatchParcel
  when {
    DispatchParcel unresolved then ShipmentBlocked
    otherwise then ShipmentStarted
  }
}

capability FulfilOrder {
  intent OrderInput from Customer
  outcome FulfilmentOpened

  when {
    always FulfilmentOpened
  }

  supervises lifecycle OrderFulfilment {
    identity orderId

    contributors {
      ReserveInventory
      CapturePayment
      ShipOrder
    }

    begin Created

    step Created

    step AwaitingPayment {
      waits for outcome PaymentCaptured from CapturePayment
      waits for outcome PaymentDeclined from CapturePayment
    }

    step ReadyToShip requires decision from WarehouseOperator

    step Dispatching waits for event ParcelDispatched from ShipOrder

    end Completed
    end Failed

    move Created to AwaitingPayment
      on outcome InventoryReserved from ReserveInventory

    move Created to Failed
      on outcome InventoryUnavailable from ReserveInventory

    move AwaitingPayment to ReadyToShip
      on outcome PaymentCaptured from CapturePayment

    move AwaitingPayment to Failed
      on outcome PaymentDeclined from CapturePayment

    move ReadyToShip to Dispatching
      on outcome ShipmentStarted from ShipOrder

    move Dispatching to Completed
      on event ParcelDispatched from ShipOrder

    move ReadyToShip to Failed
      on outcome ShipmentBlocked from ShipOrder
  }
}

Observation

Observations declare metrics and trace points derived from language semantics. They can count outcomes, effects, events, failures, violations, durations, and lifecycle transitions.

Observation declarations are not runtime vendor configuration. They are semantic instrumentation requirements that generated artifacts or runtime projections can use later.

observe-examples.dcl
observe {
  outcome AnswerPrepared count as answers_prepared
  effect SearchKnowledgeBase duration as knowledge_search_latency
  effect SearchKnowledgeBase failures as knowledge_search_failures
  capability violations as answer_policy_violations
  lifecycle transitions as support_lifecycle_transitions
}

Rule-specific and policy-specific observation targets are not supported in DCL v1.0. Use capability-level violations for compiler-visible rule or policy violation metrics, and attach policies explicitly for policy decision semantics.

Compiler Diagnostics

The compiler is responsible for semantic correctness, not just syntax. It emits errors for invalid programs and warnings for valid but risky or suspicious programs.

Diagnostic Class Examples
Errors Undefined symbols, unsupported language version, duplicate symbols, missing intent, missing outcomes, invalid lifecycle references.
Warnings Unused dependencies, unverified event ownership, redundant policy concerns, risky or incomplete semantics.
Derived Model Validated IR containing contexts, symbols, capabilities, policy attachments, effective policies, observations, and lifecycle structure.

Reference Sources

This page is distilled from the repository design documents for primitive contracts, surface syntax, compiler duties, context visibility/dependencies, policy composition, supervising lifecycles, lifecycle completion semantics, and the accepted v1.0 compiler behavior.