ADL 14 · Part II — Data, composition, and evolution

0.5.1 baseline + 0.6 edition note

Derivation: extends, derivedFrom, mapping, and abstract

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 inheritance and mapping rejection cases, including abstract resources. 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 14-derivation.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.

14.1 Scope and authority

Use domain extends to retain a relationship to a base domain, derivedFrom to record a detached fork, and resource base to declare a subtype within a domain. Resource mapping controls storage ownership and layout; abstract controls whether a resource has a direct instance surface. These choices solve different problems and have different persistence consequences.

Draft 05 §§7.2–7.3 and §9 supply the governing language provisions. The Phase 14 guides resolve the resource spelling to base, require table for foreign mappings, and define single subtyping as copying base columns. The decision log attributes R1–R3 to the Owner but immediately records that they were merged on the follow-the-guide directive with explicit countersignature still open. The later collision decision is also Owner-labelled; the suite addendum report still lists R1–R4 countersignatures open. This draft describes those implemented decisions with that provenance. It does not supply the missing countersignatures.

The old overloaded extends was recorded as never implemented. There is no legacy ADL 14 body to convert and no supported migration input inferred from historical examples. Draft 05 §9’s extends: Party example needs the guide’s base: Party correction; its old type: enum spelling also needs the ADL 11 enumeration form. The examples here declare adl: "0.5.1".

This chapter separates language requirements, guide decisions, and observations. Source inspection uses 315ee736; executable observations use the clone’s existing Release artifacts with compatible dcb5fa10 headers. They are not a fresh production build of that source revision. The evidence comprises 58 adapter cases, seven temporary-store sequences, three registry reloads, and 43 passing focused tests, with failures and limits retained explicitly.

Prerequisites are ADL 5 for suites/domains, ADL 7 for addresses, ADL 8 for locating packages, and ADL 13 for composition. ADL 12 owns relationships and write-authority grants; ADL 17 owns schema-evolution declarations and change classification.

14.2 Choose the relationship and storage ownership

DeclarationPlacementMeaningContinuing dependency
extends: {address, source?, overrides?}Domain bodyDerive a domain from another domain’s resolved definitionYes; retain the resolved base identity/version
derivedFrom: {address, source, sourceDigest, date}Domain bodyRecord the provenance of an independently authored copyNo upstream tracking or fetching
base: PartyResource bodyInherit from a resource in the same domainResource hierarchy within the domain
mapping: singleResource body; defaultOwn one table for that resource, including copied base fieldsNo shared base row for a single-mapped subtype
mapping: joinedResource body with baseOwn a subtype table joined to the base table by the shared primary keyA row spans base and subtype storage
mapping: foreignResource body with tableExpose an externally owned physical tableADL does not create or migrate that table
abstract: trueResource body; default falseDefine a base/reference type without direct instance operationsConcrete subtypes supply instance surfaces

Domain derivation copies definitions into the derived domain’s namespace; it does not copy the base domain’s application rows or make both domains share one physical table. protected limits modifications to inherited definitions. It does not make record values immutable, confidential, or access-controlled. Those runtime behaviors belong to the relevant field and permission contracts.

14.3 Declare linked domain derivation

extends.address names a domain, using the domain address form adl.<suite>.<domain> with an optional resolvable version constraint. An exact pin must match the selected base; a range resolves to one exact version. The persisted derivation record names that exact version. A resource address is not an eligible domain base. Draft 05 §7.2

source is mandatory for cross-suite derivation and follows the import locator rules: an absolute HTTPS locator, or an allowed file locator for offline use. An intra-suite derivation may omit it, using the suite’s resolution context. The manifest carries intent; extends does not admit digest keys. Fetching, package identity, lockfiles, and cross-suite installation belong to ADL 8. A source string in the small parser adapter is not proof of fetch support.

The complete base provides this domain:

adl: "0.5.1"
domain:
  name: permits
  version: "1.2.0"
  resources:
    Application:
      object:
        id:
          type: uuid
          primaryKey: true
          protected: true
        applicant:
          type: string
          required: true
        status:
          type: string
          default: draft
      permissions:
        create:
        - '*'
        read:
        - '*'
        update:
        - '*'
        delete:
          rule: 'false'
          protected: true
      validation:
        named:
          rule: applicant != ''
          message: Name required
      stateMachine:
        field: status
        initial: draft
        states:
          draft:
            transitions:
              submit:
                to: review
          review: {}
      indexes:
      - name: byStatus
        fields:
        - status

The following linked domain uses an illustrative source locator. The recorded Phase 14 checks supply permits locally, before parsing/submitting the derivative. They do not fetch that locator or verify cross-suite installation:

adl: "0.5.1"
domain:
  name: riverbend
  version: "1.0.0"
  extends:
    address: adl.permits.permits@[1.2.0]
    source: https://example.invalid/adl/permits
    overrides:
      resources:
        Application:
          add:
            fields:
              parcelId:
                type: string
          replace:
            permissions:
              read: hasRole('clerk')
          disable:
            validations:
            - named
          append:
            indexes:
            - name: byParcel
              fields:
              - parcelId
  resources:
    Inspection:
      object:
        notes:
          type: text

The derived identity is riverbend at 1.0.0; inherited Application fields come from permits at 1.2.0. The resource Inspection is new. The four changes to Application pass through the override vocabulary below. Merely redeclaring resources.Application, even with only one new field, is an EXTENDS_ADD_COLLISION under the implemented collision decision.

The resolver starts from the base’s resolved body, removes the base’s identity keys, retains the derived domain’s identity, and applies overrides. Base API routing identity (prefix and aliases) is excluded from copying. Its composition pass precedes the derived domain’s own traits and resource subtypes. Inherited fields can carry origin: extends:adl.permits.permits@[1.2.0]; new/replaced fields have explicit origin. Do not author internal $origin or $inherited markers.

The parser requires a supplied base provider. With none, this example returns EXTENDS_BASE_NOT_LOADED. The production registry provider also checks the suite segment: a bare domain’s implicit suite has the domain’s own name, hence adl.permits.permits. The adapter provider intentionally tests only an in-memory name match; suite identity is covered by the separate focused suite tests.

14.4 Apply overrides deliberately

Draft 05 §7.2 defines four verbs:

VerbPurposeFailure consequence
addIntroduce a construct absent from the inherited definitionExisting name: EXTENDS_ADD_COLLISION
replaceSubstitute the complete definition of an existing constructMissing target: EXTENDS_TARGET_UNKNOWN; protected target: EXTENDS_PROTECTED_CONSTRUCT
disableRemove a validation, rule, hook, or transitionMissing/protected target rejects; fields must never be disabled
appendAdd elements to an ordered constructCurrent override implementation supports index lists only

These verbs act at extends.overrides; ordinary child declarations add new names. A replacement is not an implicit patch: replacing applicant with {type: string, maxLength: 40} drops its inherited required: true. Include all requirements that the replacement should retain.

The implemented vocabulary is more specific than a generic deep merge:

Override locationSupported shapes in the inspected resolver
resources.<resource>.add / .replacefields, relationships, scopes, validations, rules, permissions, transitions: name-to-definition mappings; indexes, hooks: lists
resources.<resource>.disablevalidations, rules, hooks, transitions: lists of target names
resources.<resource>.appendindexes: an ordered list appended after existing entries
Domain rulesadd, replace: mappings; disable: a list of names
Domain enums, objects, propertiesadd and replace: mappings

fields addresses the resource’s object map; validations addresses its validation map. Transition names use state.transition, such as draft.submit. Hook list entries are matched by event; index entries by name. The guide’s phrase “named construct” does not imply that anonymous list entries acquire unique names or receive duplicate checking.

The complete example removes validation.named, adds parcelId, replaces the read permission, and appends byParcel after byStatus. The adapter confirms those effects. disable.fields yields EXTENDS_DISABLE_FIELD_FORBIDDEN; disable.permissions yields EXTENDS_DISABLE_KIND_INVALID; append.fields yields EXTENDS_APPEND_KIND_INVALID.

Draft 05 also mentions ordered $merge lists. The current domain-override pass consumes an already resolved base and only implements append.indexes. Document that narrower availability rather than publishing an invented append.$merge form. Final acceptance still depends on each construct’s parser; the matrix describes resolver coverage, not exhaustive execution evidence for every rule, hook, relationship, or transition combination.

14.5 Preserve protected constructs

Under Draft 05 §7.2.1, a protected inherited construct cannot be replaced, disabled, or unprotected. New siblings and permitted appends remain allowed. Protection survives republishing so a further linked derivative sees the same restriction. A detached fork has no continuing derivation constraint.

The guide implements model flags for six kinds: fields, permission rules, validations, rules, hooks, and transitions. A protected permission uses a mapping such as delete: {rule: "false", protected: true}. Draft 05’s broader “any construct” wording exceeds this explicit model inventory; do not assume uniform protection support at arbitrary container levels. Phase 14b guide

reject-protected.yaml attempts to replace the inherited id with protected: false. It is deliberately invalid. The existing build reports EXTENDS_PROTECTED_CONSTRUCT: the replacement guard fires before the separately named unprotect guard. Replacing the protected delete permission also fails. Adding parcelId succeeds beside the protected id.

The linked model reload preserves the id’s protection and origin after authored text is removed. This narrow persistence result does not establish that every mapping or construct survives every fallback path; see §14.12.

14.6 Record a detached fork

derivedFrom records a copy’s provenance. It does not request a copy operation: the new domain must contain its own definitions. extends and derivedFrom are mutually exclusive. The fork’s new name establishes a separate identity; its records, evolution, and future edits belong to that identity. Draft 05 §7.3

The complete fork contains copied Application definitions under independent and this domain-level record:

derivedFrom:
  address: adl.permits.permits@[1.2.0]
  source: https://example.invalid/adl/permits/1.2.0
  sourceDigest: sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  date: '2026-09-09'

address identifies a domain at an exact version. source records the artifact locator and is not fetched. sourceDigest is required, with sha256: followed by 64 lowercase hexadecimal digits; this provenance record is the exception to the manifest-digest prohibition. date is written as YYYY-MM-DD. The example’s example.invalid locator and repeated a digest are illustrative placeholders, not a claim that an artifact was downloaded or its provenance authenticated.

All fork adapter cases that reach the parser make zero base-provider calls. The complete fork accepts a local protected: false on its copied id. Updating permits does not add the new zone field to independent, and this fork alone does not block deactivating permits. Its provenance survives a registry reload.

Validation is incomplete: the inspected fork parser accepts a missing source as an empty string and accepts a date-shaped 2026-99-99. It rejects missing/malformed digest, range or absent version pin, unknown keys, and an incorrect date shape. Parse acceptance proves neither calendar validity nor that the recorded digest matches real source bytes.

14.7 Declare resource subtypes with base

base is a nonempty resource name in the same domain. Chains are admitted; unknown bases and cycles reject. Base fields precede subtype fields. A subtype cannot redeclare a base field, even with the same type, and cannot add a new primary key: it uses the base’s identity. The guide’s base spelling is distinct from domain extends. Phase 14a guide

The subtype resolver also copies relationships, scopes, indexes, and permissions. Subtype declarations win same-name relationships/scopes and same-operation permissions; indexes are combined. This permission replacement is different from ADL 13’s trait conjunction. In the checked case, a public subtype read rule replaces the base’s editor read rule. Do not assume a base permission automatically remains an additional required conjunct.

The base’s state machine is not inherited under the guide decision. Its ordinary state field is still a field and can be copied. The probe records a base machine, a copied status field, and no machine on Person. Domain extends, by contrast, copies the base resource’s resolved machine as part of the domain body. These are distinct composition operations.

A copied resource field’s origin may be extends:Party, even though its authoring keyword is base. For joined storage it also has inherited: true, meaning the column resides in base storage. A single-mapped subtype copies it as a physical column of its own and has inherited: false. Neither internal flag is authored YAML.

Resource chains currently have a storage limit: parser acceptance and transitive field expansion do not prove a working multi-level joined hierarchy. The adapter checks that boundary separately from the supported one-level example (§14.12).

14.8 Select a storage mapping

The complete joined example is:

adl: "0.5.1"
domain:
  name: crm
  version: "1.0.0"
  resources:
    Party:
      abstract: true
      object:
        id:
          type: uuid
          primaryKey: true
          allowUserProvided: true
        kind:
          type: string
        name:
          type: string
          required: true
      permissions: &id001
        create:
        - '*'
        read:
        - '*'
        update:
        - '*'
        delete:
        - '*'
    Person:
      base: Party
      mapping: joined
      object:
        email:
          type: email
          unique: true
    Organization:
      base: Party
      mapping: joined
      object:
        registrationNo:
          type: string
    LegacyAccount:
      mapping: foreign
      table: legacy_accounts
      object:
        acctNo:
          type: string
          primaryKey: true
        label:
          type: string
      permissions: *id001

Draft 05 §9.1 defines exactly single, joined, and foreign. Omitting mapping selects single; abstract defaults to false. Wrong mapping values/types reject with MAPPING_STRATEGY_UNKNOWN.

With single, a concrete resource has one owned table. A single-mapped subtype has its inherited and own columns in that table. The comparison fixture changes Person to single: crm_people contains id, kind, name, and email, and no Person join view is generated. Creating a Person need not create a Party row. Consequently a reference to a shared base table cannot span independently stored single subtypes. R3 requires joined storage for references spanning subtypes.

With joined, the base stores inherited columns and the subtype stores its own columns plus the shared primary key, referencing the base with delete cascade. In this example, crm_parties holds id/kind/name and crm_people holds id/email. SQLite generated operations use crm_people_v and its write triggers. Physical names here describe the identified existing build; the naming and export discrepancies recorded in ADL 12 still apply.

With foreign, table is required and schema is optional. Both are resource-body keys restricted to foreign mapping. They identify existing physical storage, not a resource address. The guide requires a dialect-valid quoted identifier. The current parser only checks that table is a nonempty string; an invalid-identifier probe is accepted, so validation/quoting cannot be inferred from parser success. A resource cannot combine foreign with base or with abstract: true, and a foreign resource cannot serve as a subtype base.

The DDL generator emits no table for LegacyAccount. The temporary-store example creates and seeds legacy_accounts separately, then reads its row through ADL. Foreign storage ownership is not conferred by declaring permissions.

14.9 Joined queries, writes, and uniqueness

Draft 05 §9.2 requires filtering and pagination on subtype columns to be pushed down to the joined read surface. The adapter creates Ada, updates her inherited name, and reads the combined row. A SQL query on the subtype email with a limit produces a subtype scan plus a base primary-key search in SQLite’s query plan; it does not materialize a separate joined table. This is evidence for this query and store, not a guarantee for every query shape or database.

Joined-subtype uniqueness must be described as application-level rather than a database UNIQUE constraint under §9.2, and generated output must disclose that distinction. The inspected implementation uses write-surface triggers for own unique fields. Duplicate Person.email returns 422 UNIQUE_VIOLATION, with data.field: email; the subtype table has only its primary-key autoindex. These triggers implement the restriction at the generated write surface; direct physical-table writes and concurrent PostgreSQL transactions were not verified. An inherited unique field lives in the base table, a different enforcement scope. DDL implementation

The create path with the example’s UUID primary key returns the full joined row. Deleting the Person returns 204 and removes both its subtype and base row in the checked one-level SQLite hierarchy. Sharing one base row among several sibling subtypes changes the cascade implications; that scenario is not established by this example. Multi-level storage, composite-key layouts, bulk operations, concurrency, and all generated metadata disclosures remain outside the passing write-path evidence.

Both SQLite and PostgreSQL SQL are retained in the verification record. PostgreSQL statements were generated only; they were not installed in a PostgreSQL server.

14.10 Abstract and foreign instance surfaces

An abstract resource has no direct instance routes/actions and cannot be instantiated through them. It still contributes a schema and, for a joined hierarchy, physical base storage. Abstract Party therefore appears in the checked OpenAPI components and schema output, while no Party instance paths are generated and its list action returns 404 ACTION_NOT_FOUND. Draft 05 §9.3, OpenAPI implementation

A reference spanning joined subtypes can address their shared abstract base. The Phase 14a report explicitly records REFERENCE_TARGET_ABSTRACT_SINGLE as not yet wired. This draft preserves R3’s storage restriction without promising that diagnostic at every reference site. ADL 12 owns the detailed reference contract and its independent enforcement gaps.

Foreign mappings are read-only unless the owning target grants write authority under §10.4. The current generated create/update/delete handlers reject foreign writes unconditionally with 403 WRITE_AUTHORITY_DENIED; the authority-granted exception is not established by this implementation. The complete fixture’s public permissions do not change that result. ADL 12 separately records the same limitation with authority-grant probes.

The checked Person OpenAPI component is flat, without the guide’s proposed inheritance allOf; it also omits the unique-field enforcement disclosure. Domain schema output retains unique: true, but does not explain the application-level distinction. These outputs do not fulfil §9.2’s disclosure requirement merely by recording a constraint.

Generated OpenAPI may still advertise operations that runtime rejects. Its existence does not authorize a write, demonstrate correct table exports, or prove that every joined uniqueness limitation is explained to clients. The catalog retains the actual schemas and paths for review rather than treating schema generation as execution evidence.

14.11 Evolve linked domains and mapping strategies

A persisting derivation is an ongoing relationship. The guide implements base resubmission by re-parsing dependents from authored source inside the registry transaction. Exact pins can block a base upgrade; a range can select the newly loaded compatible version. The local checked update from permits 1.2.0 to 1.2.1 adds zone to riverbend without changing riverbend’s own version, and its derivation record advances to the exact new base version.

With an exact 1.2.0 pin, the same attempted base update returns 422 EXTENDS_PIN_UNSATISFIED, names both base and derivative, and leaves the stored base at 1.2.0 without the new column. Deactivating a base with linked dependents returns 409 DOMAIN_REMOVAL_BLOCKED. These are checked local results; they do not establish cross-store rollback or recursive propagation through all levels. Domain actions

The implementation has two specific propagation gaps. An update reaches the direct derivative but leaves its derivative unchanged. If a direct derivative’s authored source is absent, it is skipped while the base update succeeds. Both conditions are recorded in temporary-store cases. Snapshot recovery of a model is not a replacement for preserving authored override intent.

Changing a mapping strategy is a data migration, not a metadata-only edit. Draft 05 §9.2 requires the differ and migration machinery to move data within the applicable site transaction. The inspected implementation classifies a mapping or base change as MappingChanged. It permits gated single/joined conversion with an unchanged base; foreign transitions and reparenting reject as MAPPING_STRATEGY_CHANGE_UNSUPPORTED.

The checked Person conversion from joined to single reports MappingChanged, rejects an ungated submission with 422 DESTRUCTIVE_MIGRATION, then returns 201 with allow_destructive: true in the submit request. Ada’s full row remains in the resulting wide table and is readable through the generated get action. This flag is not an ADL manifest key.

The existing preview simultaneously reports mapping_changes and is_destructive: false. Treat that flag as a known mismatch with admission: inspect the actual change list and rejection. The conversion does not establish reverse migration, reparenting, foreign-table takeover, mixed simultaneous changes, or transactional recovery for every affected runtime surface. ADL 17 and platform migration documentation own the complete migration procedure.

14.12 Diagnostics, persistence, and implementation limits

ConditionRecorded diagnostic or boundary
Non-domain base addressEXTENDS_ADDRESS_INVALID
Unavailable base or unsatisfied pinEXTENDS_BASE_NOT_LOADED, EXTENDS_PIN_UNSATISFIED
Wrong suite / cyclic suite derivationEXTENDS_SUITE_MISMATCH, EXTENDS_CYCLE in focused tests
Redefinition / absent override targetEXTENDS_ADD_COLLISION, EXTENDS_TARGET_UNKNOWN
Protected replacement or removalEXTENDS_PROTECTED_CONSTRUCT
Illegal disable/append kindEXTENDS_DISABLE_FIELD_FORBIDDEN, EXTENDS_DISABLE_KIND_INVALID, EXTENDS_APPEND_KIND_INVALID
Both linked and detached declarationsEXTENDS_AND_DERIVEDFROM_EXCLUSIVE
Missing or malformed fork digestDERIVEDFROM_DIGEST_REQUIRED
Unknown/cyclic resource baseBASE_UNKNOWN, BASE_CYCLE
Redeclared inherited field / new subtype PKBASE_FIELD_REDECLARED, BASE_PK_REDECLARED
Wrong mapping / missing foreign table / illegal combinationMAPPING_STRATEGY_UNKNOWN, MAPPING_FOREIGN_TABLE_MISSING, MAPPING_STRATEGY_INVALID
Mapping migration without request flagDESTRUCTIVE_MIGRATION

Do not equate diagnostic text across revisions. In particular, the existing artifact rejects extends.sourceDigest with UNKNOWN_KEY; inspected HEAD has the later dedicated MANIFEST_DIGEST_FORBIDDEN guard. Likewise the unprotect case reaches the generic protected-construct rejection before the more specific guide diagnostic. Wrapper error codes may differ from the embedded parser token.

Three model reload probes remove authored text before opening a new registry object on the same temporary database. Linked and detached projections compare equal and pass the registry hash check. The joined projection does not: Party’s abstract flag, subtype mapping/base/inherited metadata, and the foreign table mapping are lost, despite a passing hash check. The stored resolved hierarchy and fallback reconstruction need reconciliation; this is not a successful round-trip or a claim that every ordinary restart loses those fields. Registry implementation

Additional acceptance gaps remain visible: mapping: joined without base parses and generates ordinary table DDL; an invalid foreign identifier parses; a numeric linked source is ignored by the older adapter path; missing fork source and invalid calendar dates pass. These inputs illustrate validation limits, not additional valid authoring forms.

The parser also accepts a Party → Person → Employee joined chain and expands its fields. The generated view addresses inherited columns on the immediate base table, although those columns can live higher in the chain. The temporary store records the resulting create failure. Do not infer operational support for arbitrary joined depth from the resolver’s chain test alone.

14.13 Evidence and authoring checklist

The evidence record distinguishes current source, existing binaries, helper calls, generated SQL/OpenAPI, and real dispatched actions. Its JSON record records complete inputs/results, compile commands, executable hashes, test XML, and source hashes. The source register identifies the reviewed provisions and implementation files.

Before using these declarations:

  1. Choose a linked domain, a detached copy, or a resource subtype explicitly.
  2. For a linked domain, resolve the correct suite/domain/version and preserve authored overrides for later re-derivation.
  3. Use overrides for inherited constructs; carry required attributes into whole replacements and retain inherited protection.
  4. For a fork, supply meaningful provenance and verify the source bytes outside the no-fetch declaration parser.
  5. Choose storage ownership and key layout before creating records; use joined storage for a shared polymorphic base and check the intended hierarchy depth.
  6. Review actual routes, schemas, writes, and migration results against the named build, including the gaps above.

This checklist is informative guidance. Normative requirements remain those of the cited provisions; the draft does not promote an observed implementation gap into a language rule.