ADL 0.6.0 reference · Review draft 1 · November 14, 2026.
Contents · Source map · Evidence
The 0.6 edition note
History records selected events. Integrity adds a means of checking a chain of those records; it does not make the database untouchable. Retained §24.9 owns the 0.6 integrity and immutable additions.
The history example declares events, integrity: sha256Chain, and immutable: true. It passes both authoring validators. Fresh rejection fixtures show that these declarations require 0.6.0 and cannot be combined with a positive retention.days in this profile.
There is one chain per resource. Earlier rows remain unchained and are counted separately. The verification route requires list permission and is outside the documented row-policy gate. No external head anchor or signature is supplied by this implementation. Removing the tail is not detected by the local chain check; a database writer able to alter rows and recompute the chain is outside the protection of an unanchored digest sequence.
For privacy erasure, the current profile refuses a request that would rewrite immutable or chained history. retainHistory still defaults to true, so an erasure retaining history can leave captured personal values in place. Neither “immutable” nor “erased” should be interpreted without that operation’s parameters.
The handbook’s recorded SQLite check verifies two calibration transition events. It does not cover all tampering, retention, erasure, recovery, or concurrent-write cases. The current draft adds parser evidence while preserving the original integrity verification corpus and its own dates.
Retained reference detail
The numbered sections below are carried from 24-history-of-change.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.
24.1 Scope and the audit boundary
History records named business events on a resource: a ticket was created, its priority changed, or it was resolved. The declaration chooses which events to record and which values to preserve. Labels and details are rendered when the event is written; later edits to the record do not supply missing capture data.
Audit and history have separate configuration, engines, and tables.
features.audit: true enables the audit mechanism. A nonempty history.events
mapping activates history. Both may coexist, as they do in this chapter’s Ticket
example. Audit coverage has its own implementation boundaries; the word “audit”
does not establish that every write is recorded.
| Mechanism | What it describes | Boundary |
|---|---|---|
| Record | Current resource values | Changes over time |
| History | Author-selected business events and captures | Only selected, reached, successfully stored events remain in the timeline |
| Audit | Operation/change information from audit hooks | Separate hooks and storage; not a substitute for history coverage checks |
| Bus publication | A signal observed by current subscribers | Ordinary transactional events wait for outer commit and are discarded on rollback; explicit opt-out retains narrower boundaries (§24.6.3) |
A timeline entry alone proves neither complete change coverage, authenticated actor identity, tamper resistance, nor durable downstream delivery. The checked request context supplies the displayed actor. This chapter verifies how that context reaches history; it does not test an authentication provider.
This account develops the reduced v0.3.1 history chapter (retired), its fuller inherited text (v0.3.1, retired), Draft 05 §13 and §18 item 24, and the signed A3 ruling. The native source calls this subsystem Phase 21; the manual identifier is ADL 24.
Observed behavior below comes from revision d304c448, a fresh matching
Release build, and the verification record.
The chapter separates declaration requirements from current parser admission and
runtime gaps. Passing a check of a documented defect does not make it conformant.
24.2 Declaring history
Declare events inside the resource’s history block. There is no required
features.history switch. This fragment comes from the complete
lifecycle.yaml:
history:
events:
created:
trigger: create
capture: [title, priority, status]
label: Created {title} by {actorName}
edited:
trigger: update
fields: [title, priority, status]
capture: [title, priority, status]
label: Edited {title}
priorityChanged:
trigger: fieldChange
field: priority
label: Priority {previousValue} -> {newValue}
resolved:
trigger: transition
transition: resolve
capture: [title, note]
label: 'Resolved {title}: {from} -> {to}'
severity: success
The complete file also declares state-change, delete, and restore events; a
state machine; soft deletion; audit; and explicit permissions. Event names such
as priorityChanged are author-defined keys. They also name stored events and
bus suffixes. trigger selects the runtime event kind.
24.2.1 Event properties
Write an explicit string trigger and a useful label. A transition event needs
its transition name; a field-change event needs its field name.
| Property | Purpose | Current default or limit |
|---|---|---|
trigger | create, update, delete, restore, transition, fieldChange, rule, or template | Missing/non-string values admit as create; supply it explicitly |
transition | Named transition selected by trigger: transition | Empty string; exact match, not a wildcard |
field | Field selected by trigger: fieldChange | Empty string; exact match |
fields | Watched fields for an update event | Empty array means no watched-field filter |
capture | Record keys copied into event data | Empty array; automatic captures still apply |
label, detail | Text with capture placeholders | Empty strings |
icon | Presentation reference | Empty string; no icon resolution is established here |
severity | Presentation category: info, success, warning, error | info; checked critical also admits |
roles | Roles allowed to see the event through history feeds | Empty array permits all callers who pass the endpoint permission |
condition | AEL expression selecting whether to write this event | Empty string passes; evaluation errors skip silently |
snapshot | Reserved version-link declaration | false; no version linkage in the inspected history writer |
The current strict event-key set is exactly the properties in this table.
It excludes direct rule and template selector keys, despite those selectors
existing in the native model. Use the owning rule/template declarations described
in §24.3.3 for working generated events.
The parser and
history model also expose
admission limits. A scalar capture: title becomes an empty capture list.
Non-string members of capture, fields, and roles arrays are ignored. An
unknown captured field and an invalid condition function admit without a useful
native history diagnostic. Admission is therefore insufficient evidence that a
label will be complete or an event will fire.
24.2.2 The trigger rename
The current spelling is a scalar history-event trigger:
created:
trigger: create
label: Created
The retired on: create spelling rejects with KEY_RENAMED, including in the
checked compatibility parse. Quoting on does not restore its former meaning.
Strict parsing also rejects a literal event key true, the artifact produced
by YAML 1.1 tools that interpret an unquoted on key as a boolean.
An unknown trigger such as schemaChange rejects under strict resolution.
Compatibility resolution admits it with a warning and retains the native Create
fallback. Missing trigger also becomes Create, but without that warning; the
live missing-trigger control records a create event. These fallbacks are
implementation behavior, not recommended authoring forms.
History’s scalar trigger differs from a rule’s nested trigger.events and a
notification’s source. See ADL 23 and the
ADL 35 brief.
24.3 Trigger selection and operation coverage
An event fires only if the operation reaches the relevant history call, its selector matches, its watched-field filter passes, and its condition passes. Multiple matching declarations can produce multiple events for one operation.
24.3.1 Lifecycle events
The following table describes executed generated-action behavior for the Ticket fixtures. It is not a promise about every possible writer of the same table.
| Operation | History calls reached after successful record work | Checked observation |
|---|---|---|
| Create | create | Captures the initial open state and integer priority |
| PATCH | update, then matching fieldChange calls | Priority 2 → 3 writes edited and priorityChanged |
| PATCH changing the state field | Update, matching transition, and field-change calls (#1408) | Writes edited, resolved and stateChanged |
Named resolve transition | transition, matched by name | Writes only resolved, including its sets result |
| Soft delete | delete | Captures the previously stored title and priority |
| Hard delete | delete | History remains readable after the resource row is gone |
| Restore | restore | Writes restored; the checked priority capture is a string |
| PUT replacement | Update, matching transition when state moves, and field-change calls (#1445) | Replacement priority 2 → 4 writes edited and priorityChanged |
| Enabled data import | No history call on the checked path | Imported row exists without a create-history event |
| PATCH with the dry-run header | Returns before normal update history | Record and ordinary history remain unchanged |
The PUT row reflects #1445; the older published evidence predates that fix. The live PUT reproduction and native regressions check its history and state events.
A failed validation, denied create, invalid second transition, or forced failing record UPDATE produces no new ordinary lifecycle history in the checked cases. Rule history has different timing (§24.3.3).
The executed lifecycle sequence writes these events in insertion order:
create created
PATCH priority 2 -> 3 edited, priorityChanged
resolve resolved
delete deleted
restore restored
The feed orders by createdAt, not by this presentation order. Timestamp ties
have no additional ordering key in the query; do not infer a stable total order
from events created during the same clock tick.
24.3.2 Selectors and watched fields
An update event with fields: [priority] requires that both old and new objects
contain priority and that the values differ. Direct checks of an added or
removed key do not fire that event. An unchanged priority or an unrelated note
PATCH also skips the fixture’s watched update event.
Named transition matching is exact. Omitting transition: resolve does not
subscribe to all transitions. Likewise, a field-change declaration selects a
specific field; declaring its trigger alone is insufficient.
Named transition and PATCH are separate history paths. A transition’s sets
changes are available to its capture, but do not independently emit the fixture’s
update or field-change events. For the transition handler, $old contains only
the prior state field, not the complete prior record. A condition testing
$old.title skips even though the stored ticket has that title.
These boundaries follow the PATCH handler, named transition handler, and history engine. They explain why equivalent final record values need not imply equivalent history.
24.3.3 Rule and template events
A rule’s history block expands into a resource history event with the rule’s
name as its internal selector. The complete
rule-history.yaml includes:
history:
event: blocked
label: Blocked priority {priority}
Attached to the rejecting priorityLimit rule, this records a blocked event
with captured priority and automatic rule: priorityLimit. A rejected update
from priority 2 to 9 leaves the record at 2 but records candidate priority 9.
A subscriber also sees the stored record still at 2 during publication. A
rejected create has no record to attach history to and writes no history row.
ADL 23 §23.6
owns the rule-side behavior and diagnostic route.
The template-history.yaml
fixture uses a manual Markdown template associated with Ticket. Its nonempty
notification block causes the parser to create a history event named
template_<template name> (here template_receipt, for the template
receipt), with an internal template selector and a corresponding
history-source notification.
attachDocument: true adds documentId to the capture; it does not establish
that a file was attached to a delivered message.
The generated manual action writes a local receipt.md containing the ticket
title, stores a document row, and emits template_receipt. The history capture’s
documentId matches that document row. It also contains template: receipt.
The fixture has an empty channel list, so it exercises no external delivery.
The ADL 39 brief owns the complete template contract.
Since 2026-09-22 template generation binds plugin-owned background work, which
the dossier’s direct adapter cannot own, so the dossier excludes this case (see
the evidence record). The behaviour is verified instead through a real
kalosd and the shipping ADL plugin: the Repair Shop example’s check.py
generates a template on its probe domain and asserts the
template_memo_receipt history entry whose documentId matches the generated
document (#1054).
Bare direct trigger: rule or trigger: template declarations without internal
selectors do not match the tested named source. Strict author-supplied rule
and template event keys reject. This disagreement between the model and closed
parser grammar remains explicit; the generated routes above are the checked
working authoring paths.
24.4 Captures, messages, and actor identity
24.4.1 Explicit and automatic captures
Explicit capture copies exact keys from the operation’s new record, or from the
old record when new data is null, as on delete. It does not traverse nested
objects or interpret * as a wildcard. A capture of person.name does not fetch
name from a captured person object. Missing keys are omitted; present nulls
remain JSON null.
| Trigger | Automatic capture additions |
|---|---|
| Every event | actorId, actorName from the request context |
| Transition | from, to, inferred from changed string data supplied to the hook |
| Field change | previousValue, newValue for the event’s selected field |
| Generated rule event | rule, the internal selector name |
| Generated template event | template, the internal selector name |
There is no automatic fieldName, oldValue, transition name, full record,
actor email, or version ID. documentId is supplied by the template caller and
captured when the generated declaration requests it.
The transition capture helper scans for the first changed string key shared by
its old and new inputs. It does not use its transition-name argument to identify
the state field. The generated named-transition handler supplies only the old
state field, making from/to reliable for that checked route. Do not reuse the
helper’s result as proof that arbitrary callers supplied equivalent context.
Automatic actor values overwrite same-named explicit record captures. A record
containing actorId: spoofed and actorName: spoofed cannot replace the values
supplied by the request in the direct capture check. This establishes precedence,
not the trustworthiness of the request context.
Capture types follow the input supplied by each caller. Create/PATCH preserve integer priorities in these examples. Delete and restore pass raw database values and capture priority as a string. Consumers should not assume identical JSON types for the same field across every trigger.
24.4.2 Interpolation uses captured data
Labels and details use the same interpolation function. It first looks for an
exact non-null key in captured data, then resolves these actor aliases:
{user.name} / {actorName} and {user.id} / {actorId}. Strings are inserted
as text; booleans, arrays, numbers, and objects use JSON representations.
An unresolved placeholder becomes an empty string without a history diagnostic. The complete capture boundary example creates a record with a title but captures only priority. Its results are:
label: Title=; priority=2; actor=alice
detail: Missing=; prefixed=; email=
The missing title is not fetched from the record later. {$record.priority} is
also empty: the history message interpolator does not strip $record..
{user.email} is unsupported. A brace without a closing brace remains literal.
Nested paths are not evaluated as expressions.
The interpolation checks also correct a cross-subsystem comparison in the first ADL 23 draft: neither checked rule-message interpolation nor this history interpolator strips that prefix. Notification and document templates have their own interpolation implementations.
24.4.3 Hiding actor fields has limited scope
display.includeActor: false removes top-level actorId/actorName and those
same two keys from the feed item’s parsed capture. It does not rewrite stored
rows, bus messages, or already rendered label/detail text.
In the visibility example, the viewer receives no actor fields but still sees
Public Ticket one by alice. Its explicit ownerId capture also remains.
Choose labels and captures deliberately when presenting an anonymous timeline;
this display switch is not a general redaction mechanism.
24.5 Conditions and available context
History conditions receive a different context from rule conditions. An empty condition passes. A nonempty condition must evaluate truthy; expression errors and false results both silently skip this event without rejecting the operation.
| Expression/context | Checked result |
|---|---|
priority == 2 | Resolves against the current record |
$this.priority == 2 | Resolves against the current record |
record.priority == 2 | Resolves against the current record |
$record.priority == 2 | Does not resolve through the unprefixed record binding |
$old.priority == 1 | Works when that old-record value is supplied |
$previous.priority == 1 | No such binding in the history condition context |
$user.id == 'admin-1' | No user binding, despite automatic actor capture |
inState('open') | Works for the checked conventional status field |
| Unknown function or division by zero | Skips silently |
| Resource aggregate query | No query handler is supplied by this history evaluator |
ADL 18 owns AEL syntax and function behavior. Host bindings and function availability remain properties of the consumer calling AEL. The inspected history evaluator leaves its context at the default function scope; the table reports actual checks, not a dedicated history sandbox contract.
Conditions run before capture building. Delete supplies a null current record,
so title == 'Ticket one' skips its delete event while
$old.title == 'Ticket one' fires. Named transition supplies the synthetic old
state described in §24.3.2. A condition using a nonexistent function admits at
load time, permits the create operation, and produces no history event.
24.6 Storage, publication, and failure
24.6.1 Stored history
With nonempty history events, the
DDL generator creates
timeline_tickets_history for this example. It stores id, recordId, event,
rendered label and detail, icon, severity, JSON-encoded data, actor
columns, JSON-encoded roles, and createdAt.
id is a generated event UUID. recordId refers to the resource record, but the
history DDL declares no foreign key on it. An index supports record-ID lookup.
The hard-delete experiment verifies that history remains queryable when the
resource row is gone. This separation also means record existence is not
established by a history read.
The lifecycle example produces six history entries and four audit entries. Those counts describe this sequence and its separate hook paths; they are not an audit completeness claim. Neither history’s DDL nor its writer supplies a cryptographic chain, signed identity, or append-only database policy.
24.6.2 Bus names and timing
One create event is published under both of these observed channels:
adl.timeline.timeline_v1.ticket.history.created
adl.timeline.ticket.history.created
The canonical channel includes suite/runtime-domain identity. The second is the
compatibility channel. Both messages’ payload channel field contains the
canonical name. A subscriber to adl.> observes two deliveries for one history
entry, not two distinct entries. See the
bus helpers and
ADL 3.
The payload contains the event ID, record ID, event name, rendered text,
presentation fields, and captured data. It does not contain the stored roles
restriction. Feed visibility and includeActor do not filter publication.
In a successful create, the local subscriber can query both the newly written record and the history row during publication. That observation uses the same SQLite connection and is not a transaction-isolation or durable-commit test.
24.6.3 Failure and rollback boundaries
Since ADL 0.102.91 (#1373), default-on request transactions make a required
history insert failure abort the CRUD write. The record, applicable audit/version
writes and history roll back together; ordinary subscribers, including workflows,
receive no rolled-back events. Successful delivery is synchronous after the outer
commit and before the request returns. Explicit features.transactions: false
retains the earlier operation-specific behavior. Preflight rejection history
remains diagnostic, separate from the write phase. See
ADL 29 §29.7
and ADL 37.
The historical measurements below predate the current request/event scopes. Their shared-connection adapter did not establish an event hold; they do not describe the current default transactional guarantee.
In that earlier runtime, the engine attempted the history INSERT before publishing but ignored its boolean result. Removing the history table in a disposable store produces a successful create and both history bus publications, with no history row. A later history read returns an empty successful response even though its table query failed.
Bulk create shows a second boundary. The first valid item writes its history and publishes. A later invalid item rejects the operation. With the shared connection used by the fixture, application, audit, and history rows roll back, while the subscriber has already observed the earlier publication.
Those historical “publish after the insert attempt” observations do not establish durable history-before-delivery or exactly-once behavior. The current transaction guarantee likewise does not provide durable event replay or exactly-once delivery. The inherited chapter’s durable write wording is too strong for these observed paths. Rule history on a rejected update adds the separate candidate-versus-committed distinction in §24.3.3.
24.7 Reading history
24.7.1 Routes, filters, and pagination
The fixture registers these GET routes when history is active and
display.endpoint is true:
/api/v1/timeline/tickets/:id/history
/api/v1/timeline/tickets/history
The corresponding generated actions are .history and .history.list.
Setting endpoint: false removes both routes/actions while preserving history
storage and publication. Empty events create no active history subsystem.
The checked offline OpenAPI document omits the two real history routes.
| Parameter | Per-record timeline | Cross-record stream |
|---|---|---|
id | Required string record ID | Not its record filter |
recordId | Record selected by id | Optional string equality filter |
event, severity, actorId | Optional string equality filters | Same |
after, before | Exclusive createdAt > / < string comparisons | Same |
limit | Default from display; supplied number capped above by maxLimit | Same |
page | Offset (page - 1) * limit | Ignored |
offset | Ignored | Supplied numeric offset clamped to at least zero |
The default display is endpoint: true, defaultLimit: 50, maxLimit: 200,
order: desc, and includeActor: true. Only the exact order: asc selects
ascending query order. groupBy defaults empty; the response remains a flat list.
The route handlers are the authoritative observed implementation:
action_history.cpp.
The checked request handling lacks a lower bound on limit. Zero returns no
items. A supplied -1 uses SQLite’s unlimited behavior: with maxLimit: 2, the
three-event control returns all three events through either feed. Supply positive
limits; the current maximum alone is not an enforced resource bound. This is an
observed SQLite gap, not the intended pagination contract.
Responses contain items, returned count, and totalCount. An unknown string
record ID returns 200 with an empty timeline. Missing or numeric id returns
422. Equal timestamps lack a tie-breaker. The verification sets distinct
synthetic timestamps when it asserts page order.
24.7.2 Permissions and visibility
The per-record action checks the resource’s get permission; the cross-record
action checks list. Both checks occur without loading a resource row. A role
permission can allow the feed, but ownership does not receive the record context
it needs. In the owner control, the same user can GET the owned Ticket and receives
403 from both history actions.
The feeds query history directly. They do not reuse record-list scopes, so a
default scope that hides the Ticket from list leaves its history visible. They
do apply the caller’s field security to captured values: a field policy that
removes title from ordinary GET also removes it from the returned history
data, while the stored capture keeps it
(#864, 59514c3b; at Draft 1
the captured title was returned). Event roles are a separate visibility
choice, not inherited field security.
For each stored event, visibility compares roles against the caller’s primary
role and additional roles. Empty roles permit visibility after endpoint access.
The matcher uses literal role strings: * and authenticated are not public or
authentication pseudo-tokens here, and administrator does not implicitly match
an event restricted to admin. An additional literal admin role does match.
Malformed role JSON and non-array JSON are treated as visible; the deliberate
corruption controls retain that current fail-open behavior as a limitation.
The internal roles column is removed from returned items. Capture data is
parsed from JSON when possible; malformed data remains a string. This presentation
conversion does not add record-level authorization.
24.7.3 Counts and filtering order
The SQL query applies filters, ordering, and pagination first. The handler then removes events whose roles the caller lacks. A hidden event can occupy the entire first page while a visible event exists on the second page.
The two totalCount implementations differ:
| Feed | What totalCount counts |
|---|---|
| Per record | All history rows for recordId, ignoring optional filters and visibility |
| Cross record | Rows matching SQL filters, still ignoring visibility |
In the visibility example, one private and one public event exist. The viewer’s
first one-row page is empty with totalCount: 2; page two contains the public
event. Filtering the per-record feed to the public event still reports 2, while
the cross-record feed with the same event filter reports 1. A count is therefore
neither the number of visible events nor consistently the filtered total.
24.8 Retention, display metadata, and restoration
24.8.1 Retention is scheduled
history:
retention:
days: 30
A positive retention window is consumed by the current
action generator.
It collects eligible history tables into a per-domain worker, waits one hour,
then deletes rows whose createdAt precedes a UTC cutoff of days * 86400
seconds. It repeats hourly. Zero, the default, schedules no history cleanup.
The worker is not an immediate read filter; an expired row may remain visible
until a sweep executes successfully.
This is source-inspected, not an executed hourly cleanup claim. The chapter
parses and restores retained-history.yaml
but does not activate its positive retention policy in a disposable runtime or
wait an hour. The worker is a detached infinite thread in the inspected source;
shutdown ownership and actual scheduled deletion are outside this evidence.
The inherited full chapter contradicts itself: its revision note says retention is enforced, while its later retention paragraph says cleanup is unimplemented. The current worker supports the revision note. This chapter records the current source mechanism and its verification limit explicitly.
display.groupBy and event snapshot remain stored metadata without grouping
or version-link behavior in the inspected history path. The visibility fixture
executes groupBy: date and still receives ordinary flat items. Parsing
snapshot: true is not evidence of a version snapshot being written or linked.
24.8.2 Preserve the authored document
The checked exporter reports success for a history-only domain but omits history. Reparsing that exported document produces a resource with no events and default history display/retention. This is a silent lossy projection.
Normal registry loading with source available restores events, selectors, captures, roles, display settings, and retention by reparsing the stored source. In a disposable experiment that removes both source fields, the fallback serialized model loses history. A valid stored hash does not establish a complete semantic snapshot.
The rule and template examples encounter the exporter’s separate refusal for later subsystems; removing their source leaves no reconstructible model. These outcomes come from the exporter and registry. Preserve authored/resolved domain documents when maintaining or restoring these configurations. This is runtime model persistence, separate from the manual’s policy of linking directly to production source files.
24.9 Integrity and immutability (ADL 0.6.0)
A resource can ask that its history be tamper-evident and that nothing
rewrites it. Both keys need adl: "0.6.0" (#1563).
resources:
LedgerEntry:
history:
integrity: sha256Chain
immutable: true
events:
posted: { trigger: create, capture: [memo, amount], label: "Posted {memo}" }
| Key | Values | Meaning |
|---|---|---|
integrity | none (default), sha256Chain | Each history row carries the hash of the row before it |
immutable | false (default), true | The engine does not rewrite or delete this resource’s history rows |
24.9.1 The chain
There is one chain per resource. Each history row of a chained resource has three more columns:
| Column | Value |
|---|---|
sequence | 1, 2, 3 and so on, in the order the rows were written. Unique |
previousHash | The hash of the row with the sequence before it. Empty for the first row |
hash | SHA-256, in hexadecimal, of a JSON array of strings: sequence, previousHash, then the row’s id, recordId, event, label, detail, icon, severity, data, actorId, actorName, roles and createdAt as stored |
Two requests that write at the same moment take turns: on PostgreSQL a
transaction-scoped advisory lock orders them, and elsewhere the unique
sequence makes the loser read the new head and try again. The history list
returns sequence, previousHash and hash with each row.
A resource that gains integrity after it already has history keeps its old
rows. They carry no sequence, are not part of the chain, and are counted as
unchained by the check below. The chain starts with the next row written.
24.9.2 Verifying
GET <collection>/history/verify walks the chain from its first row. It
needs the resource’s list permission. On a resource that is not chained it
is 404.
{ "integrity": "sha256Chain", "valid": false, "checked": 41, "unchained": 0,
"head": { "sequence": 41, "hash": "9f2c..." },
"brokenAt": { "sequence": 42, "id": "...", "reason": "the row's content does not match its hash" } }
| Field | Meaning |
|---|---|
valid | False at the first row whose sequence, link or hash is wrong |
checked | Rows that verified before the walk stopped |
head | The last row that verified |
brokenAt | The first wrong row and why: its content changed, its link is not the previous row’s hash, or a sequence is missing before it |
A changed row, a removed row and an inserted row are each reported at the row where the chain stops agreeing.
Rows removed from the end of the chain are not detected. The remaining
rows still agree with each other. To detect that, keep head somewhere the
database’s owner cannot write, and compare it with a later answer: a head
with a lower sequence, or a different hash at the same sequence, means rows
were removed or the chain was rebuilt. Someone who can write the table and
recompute every hash from a changed row onward also produces a chain that
verifies; the kept head is what shows it.
24.9.3 What immutable covers
- The retention sweep (§24.8.1) cannot be declared with either key: a document
that sets
retention.daystogether withintegrity: sha256Chainorimmutable: trueis refused at submit. - Privacy erasure that would rewrite the history is refused
(Chapter 45 §45.4).
integrity: sha256Chainhas the same effect on erasure asimmutable: true, because rewriting a row breaks the chain. - The engine has no route that updates or deletes a history row.
It does not cover the database. Nothing stops a database user with write
access from changing the table: there is no trigger and no revoked grant.
integrity is what makes such a change visible.
24.9.4 Diagnostics
| Condition | Result |
|---|---|
integrity or immutable in a document that does not declare "0.6.0" | Submit refused, ADL_HISTORY_VERSION |
integrity other than none or sha256Chain; immutable not true or false; either with no events; either with retention.days | Submit refused, ADL_HISTORY_INVALID |
| Erasure that would rewrite kept history | 409 HISTORY_IMMUTABLE |
Checks: plugins/adl/tests/test_adl_action_policy.cpp, and over HTTP on
SQLite and PostgreSQL tools/repro/aegis/integrity.py.
24.10 Verification and related chapters
The example dossier contains nine complete YAML files, 87 native cases, and 597 explicit passing assertions at Draft 1 (86 cases and 583 assertions at the 2026-09-25 re-run, without the template case). The cases comprise 23 parser/model checks, 26 direct history-helper checks, and 38 isolated generated-action sequences. Nineteen existing focused native tests pass, and nine independent modeller projections expose additional grammar/model disagreements.
The modeller still reads history on, leaves current trigger unrepresented,
and flags supported actor/from/to/previousValue placeholders as unknown fields.
It also accepts an uncaptured real resource field in a label without proving
native interpolation can obtain that field. Its model lacks history display and
retention. These diagnostics do not replace the actual native results.
The historical test suite includes a parser-named test that reproduces old on
reading rather than calling today’s parser. The adapter supplies current strict
parsing and actual generated actions. The evidence report
records the method, source hashes, limitations, and publication checks.
Related ownership remains with ADL 3 for the platform/bus contract, ADL 16 for scopes, ADL 18 for AEL, ADL 21 for permissions, ADL 22 for machines, and ADL 23 for rules. The ADL 25, ADL 35, and ADL 39 briefs retain hooks, notifications, and document contracts beyond the history boundaries verified here.