ADL 0.6.0 reference · Review draft 1 · November 14, 2026.
Contents · Source map · Evidence
The 0.6 edition note
This chapter retains the detailed language contract and its source-specific observations. Its chapter number and numbered sections remain stable. The 0.6 additions do not by themselves change this subject’s defaults or supply fresh execution evidence for it.
Reverification should cover dispatch authority, source/purpose handling, and failure effects. Use the original examples and evidence links below to recover the earlier test context. The new edition’s source map records this chapter as inherited detail; the current draft does not claim those historical tests were rerun.
Retained reference detail
The numbered sections below are carried from 44-external-integrations.md. Their original baseline and evidence remain attached to the source. Statements about “current” or “checked” behavior in this retained text refer to those original observations unless the edition note explicitly updates them. This is a consolidated draft, not a claim of complete re-verification.
44.1 Scope and edition boundary
An integration can describe outbound HTTP operations or an inbound webhook that maps payload fields into resource actions. Declaration admission, authentication, request delivery, response handling, and the resulting resource mutation are separate parts of that contract. The examples verify each relevant boundary rather than treating an HTTP success response as proof that a business action completed.
The governing delta §18 item 30
renames the webhook event key mapping to fieldMap. The native parser rejects
the old key with KEY_RENAMED, and the independent modeller reports the same code
for the retired example.
The inherited integration chapter (v0.3.1, retired)
remains useful background, but its old webhook spelling must be updated.
ADL 21 owns resource authority, ADL 24 owns history, ADL 35 owns notifications, and the platform book owns transports, TLS, credentials, and provider deployment. This chapter does not turn parsed provider names into implemented protocols.
44.2 Declaration grammar
domain.integrations maps stable names to integration definitions. The parser
models these fields:
| Key | Shape and native default |
|---|---|
description | String, empty |
type | String, rest |
baseUrl | Outbound base URL string, empty |
path | Inbound webhook path string, empty |
auth | Authentication configuration object |
operations | Mapping of outbound operation names |
events | Mapping of webhook event names |
retry | Attempts/backoff configuration |
circuitBreaker | Enablement and thresholds |
rateLimit | Parsed rate/burst/on-exceeded settings |
deadLetter | Parsed enablement/retry/notification settings |
replayProtection | Webhook timestamp and nonce policy |
An operation has trigger, request, onSuccess, and onError blocks.
trigger supplies resource, event, and optional transition. request supplies
method, path, string-valued headers, and a JSON body template. Method defaults
to POST; nested request method/path take precedence over the older operation-level
method/path fields. Supply the request block explicitly for new documents.
A webhook event has filter: {field, value}, action, resource, target,
fieldMap, and optional history metadata. Action defaults to create. The
filter compares the selected payload value with its configured string value.
Names that are parsed but not consumed are not guaranteed extension points;
strict parser admission does not validate every provider-specific option.
44.3 Outbound body construction and authentication
This fragment from the complete integrations.yaml describes the outbound body:
# Under one integration's operations mapping.
send:
request:
method: POST
path: /ok
body:
reference: $record.id
label: $record.title
The mapper walks objects and arrays. $record substitutes the whole input
record; $record.path selects a dotted property and preserves its JSON value.
Recognized environment expressions expand through the integration helper.
Ordinary strings, numbers, booleans, and null pass through. These substitutions
are not general AEL: a string containing a proposed transform function does not
become an evaluated expression merely because it starts with $.
Authentication is provider-specific:
auth.type | Current runtime behavior |
|---|---|
api_key | value in named header, otherwise appended using queryParam |
bearer | Authorization: Bearer <value> |
basic | Base64 encoding of username:password in Authorization |
hmac_signature | Inbound body-signature verification, subject to §44.5 |
oauth2_client_credentials | Refused at domain submit and startup until implemented |
mtls, ip_whitelist, aws_sigv4 | Refused at domain submit and startup until implemented |
An omitted auth.type, or none, sends no credentials. Every other value is
refused. The parser still admits the string, so a document that names one of
these types parses cleanly and then fails when it reaches the engine. Domain
submit and migration preview answer 422 VALIDATION_ERROR with
Unsupported integration auth type '<type>' in integration '<name>'. Supported types: api_key, bearer, basic, hmac_signature. A domain file loaded at startup
goes through the same submit path and is refused with the same message. The
integration engine repeats the check when it is constructed and again before
building a request, so no path sends an unauthenticated request in place of the
declared one. This has been the behaviour since #422 (2ff6baa9, 2026-09-13).
Until a type is implemented, a domain that needs it cannot be loaded; declare one
of the four supported types or leave the integration out.
The local HTTP receiver verifies actual bearer, API-key, and Basic headers.
These fake credentials are deliberately public test values. The example
establishes wire behavior, not credential provisioning or real provider
authentication. Domains declaring oauth2_client_credentials or aws_sigv4
are refused at submit with 422 VALIDATION_ERROR, and the example asserts that
refusal; before #422 such an integration was admitted and sent without an
Authorization header (the record at revision 4d65e567).
Auth values support environment expansion where the helper reads them. Query-key appending is best-effort and does not supply a general URL-encoding contract. Configured request headers, URL paths, and arbitrary fields must not be assumed to share the body mapper’s substitution rules. The admin dry-run response exposes the constructed request, including resolved authentication headers.
44.4 Inbound fieldMap and observable effects
The complete webhook example contains:
# Under the incoming webhook integration.
events:
received:
filter: {field: kind, value: received}
action: create
resource: Receipt
fieldMap:
id: $payload.id
title: $payload.message
fieldMap keys name target resource fields. Values select $payload.path, the
whole $payload, environment expansion, or literal strings. This is not the
resource storage mapping construct owned by ADL 14. Non-string declaration
values are serialized by this parser, so do not assume an arbitrary numeric
literal has the same typed behavior as a payload value.
A verified signed payload creates a Receipt whose title is Accepted.
A nonmatching event reports matched: 0.
A failed write is the answer (#1404). Events run in declaration order. The first create or update that fails stops the delivery:
- the sender receives that write’s status and error. A missing required
title, for example, answers
422 VALIDATION_ERROR, not 200; - the inbound integration log records the failure;
- later events are not run.
Writes that earlier events in the same delivery already made stand: a
delivery is not one transaction. Before 0.102.68 the handler ignored the
write’s response and answered received: true with 200, so a sender never
retried a delivery that changed nothing.
A verified signature is the authorization (#1404). Each write dispatches
with transport integration and the trusted __system__ actor holding
admin, as scheduled tasks and seeds do. It therefore passes the resource’s
permissions, [admin]-only ones included. Before 0.102.68 it used transport
webhook, which authd refuses (#421), so on a server running authd no
delivery wrote anything. Keep the secret as safe as an admin credential.
There is no per-integration identity or role. Update target resolution uses a
separate expression helper; its supported substitutions are not identical to the
inbound field mapper. Optional history metadata in an event does not itself
establish a history side effect in this handler.
44.5 Signature bytes and replay protection
HMAC configuration models secret, header, algorithm (default sha256),
encoding (default hex), and optional signature prefix. The fixture computes
its signatures independently using Python HMAC-SHA-256. A configured nonempty
secret and wrong signature produce 401 INVALID_SIGNATURE before mapping.
An empty secret skips this HMAC check in the current handler; it does not reject
an incompletely configured endpoint at activation.
There is a byte-level limitation: the registered action verifies a compact re-serialization of parsed request JSON, not the original HTTP body bytes. The compact sorted fixture signature succeeds. A valid signature over an indented serialization of the same JSON object is rejected. Do not describe this as verification of arbitrary sender-signed raw JSON; transport/body preservation must be corrected or independently accounted for before that claim is made.
replayProtection accepts enabled (default false), timestampHeader,
nonceHeader, and maxAge (default 5m). Enabled protection checks only configured
headers. A timestamp check rejects missing, unparseable, too-old, and too-far-future
values. A nonce check rejects missing/empty or already-seen values. Failures are
401 REPLAY_REJECTED. A repeated signed fixture produces this error without a
second resource insert; an expired timestamp is also rejected.
The nonce cache is process memory, bounded and expired by the configured window. It is not persistent replay evidence across restarts or a coordinated cache across instances. Nonces are recorded after signature verification but before resource dispatch, so a failed business write can still consume one. Header handling also needs attention: replay lookup is case-insensitive, while the signature-header lookup in this handler uses an exact map key. These are current limits, not recommended protocol rules.
44.6 Dispatch, retry, and failure reporting
Manual management operations are admin/administrator-only. The generated API
provides list/status, operation trigger, dead-letter list, and dead-letter retry.
Trigger accepts integration name, operation, and input under record or
payload. With dryRun: true, it returns method, URL, headers, and mapped body
without sending a request. Without an input object, this path uses an empty
record rather than treating arbitrary top-level fields as a record.
A real manual trigger returns an outer 200 with nested status, success,
error, durationMs, and responseBody. The fixture receives two 503 attempts
and returns success: false, status: 503 inside that 200 envelope. Consumers
must inspect both levels.
Retry defaults are three attempts, exponential backoff, one-second base delay, thirty-second maximum delay, and statuses 500/502/503/504/429. The engine logs each attempt and retries listed statuses or a nonempty transport error, except a refusal by the outbound address policy below, which is not retried. The fixture uses two attempts and millisecond delays; its flaky endpoint returns 503 then 200, producing two attempts and success. Exhaustion can append a persistent dead-letter row when enabled.
The circuit breaker defaults disabled; threshold defaults are five failures and two successes with a nominal sixty-second timeout. Current execution supports closed/open behavior but does not implement the full timed half-open recovery suggested by those settings. Rate-limit settings are modeled, but no token-bucket enforcement is established by the reviewed request path. Dead-letter max-retry and notification settings similarly require consumer-specific evidence.
Event-triggered REST operations subscribe to resource/history topics and enqueue work off the event-publishing thread. The worker runs outbound delivery and then configured success/error handlers. Those handlers can dispatch update/transition operations as a system integration caller. Manual trigger uses the retry executor directly and does not run that worker’s success/error handler sequence. Event names, captured record fields, internal action authority, queue durability, and handler outcomes must be checked for the actual workflow; the manual HTTP probes do not establish event-worker end-to-end behavior.
44.6.1 Outbound address policy
Every outbound operation passes an address policy before anything is sent (#1399). The same policy applies to webhook notification channels (ADL 35).
| Destination | Result |
|---|---|
| A public address | Allowed |
| Loopback, RFC 1918 private, or IPv6 unique-local | Refused, unless the operator lists the origin in adl.outbound.allowedOrigins |
Link-local and cloud metadata (169.254.0.0/16), CGNAT, multicast, reserved, IPv4-mapped IPv6 | Always refused, even when listed |
An origin is scheme://host[:port]; the port is part of it, and the default
port is filled in. Every address the host resolves to must pass, and the
connection is pinned to the checked address, so DNS cannot change the answer
between the check and the connect. Redirects are never followed: a 3xx answer
is a failure (success: false, error: "REDIRECT_REFUSED: ..."), and the
redirect target is not contacted, so the integration’s credentials are never
resent to another host.
A refused call is never sent. The manual trigger reports
success: false with error: "OUTBOUND_REFUSED: <host> resolves to <address>, ...";
a webhook notification records failed with the same text. kalosd logs the
allowlist at startup.
{ "adl": { "outbound": { "allowedOrigins": ["http://127.0.0.1:9099"] } } }
44.7 Restoration and implementation limits
The checked source-backed registry reconstruction retains integrations. Export and source-free reconstruction lose their definitions at this revision. Preserving an operation log does not restore the configuration or subscriptions needed to resume it. This belongs in deployment/restart verification.
The current outbound implementation is HTTP. Parsed type strings such as s3,
smtp, amqp, or mqtt do not install those provider protocols. In particular,
a manual trigger being able to construct an HTTP request says nothing about
provider-specific behavior.
Evidence covers parser/rename behavior, constructed requests, actual local HTTP headers, response status, retries/dead letters, signed webhook dispatch, replay rejection, and final resource rows. It does not exercise real provider accounts, TLS/mTLS, REST transport preservation of signature bytes, cross-process replay, or exactly-once delivery. Those limits accompany the verified behavior rather than being inferred away by accepted YAML.