DD 105: Machine-Readable Endpoint and Method Documentation

Contents

23.106. DD 105: Machine-Readable Endpoint and Method Documentation#

Design status:

Draft

Implementation status:

Not started

DD shepherd:

TBD

Historical contributors:

TBD

First published:

2026-10-06

Last substantive change:

2026-10-06

Normative references:

Endpoint and Method Documentation Requirements

23.106.1. Summary#

Every HTTP endpoint and every wallet-core operation in the Taler documentation is described in exactly one .rst file, and every semantic claim in that file that tooling could need — versioning, maturity, idempotency, actor visibility, error semantics, state observation, world effects, identifier roles, timers — is expressed in a directive option or typed block, never only in prose. A small number of registries (entities with lifecycles, timers, identifiers; per-component notification channels) hold the cross-method anchors. From this corpus, tooling derives per-entity state tables, per-actor visibility projections, cross-component flows, and sequence diagrams, and generates client types and validators, with drift against implementations caught in CI.

The format is language-agnostic: the shape layer describes wire-level types (JSON messages exchanged between client and server) via the historically named ts:def / ts:op directives, and generated artifacts may target any implementation language.

This document records the intent, the diagnostic of the current state, the design decisions, and the migration plan. The normative field-by-field format, controlled vocabularies, and lint rules are specified in Endpoint and Method Documentation Requirements; where the two disagree during evolution, the requirements document wins for format questions and this DD wins for why.

23.106.2. Motivation#

The documentation corpus is large (~490 per-endpoint files across exchange, merchant, bank-, corebank, challenger, taldir, mailbox, donau, auditor, plus 152 wallet-core operations) and already uniform in *shape: identity directive, request, response, prose details. But the semantics a reader most needs are locked in prose or absent:

  • Error codes are overloaded across flows. A 404 on an unfunded reserve means “wait”; a 404 on an expired order means “gone”; a 402 on the order status page is the normal unpaid state. Same codes, opposite meanings, not inferable.

  • Retry safety is never stated. POST /withdraw is replay-safe by careful design; POST /private/orders without an order_id duplicates. In a system built on at-least-once networking, this is the most frequent operational question a client faces, and the corpus answers it only occasionally, in prose.

  • State lives between methods. No per-endpoint file can honestly describe the machine the endpoints collectively implement — the order lifecycle, the withdrawal operation, the TAN challenge — so those machines exist only implicitly, and cross-component causality (the exchange’s wirewatch driving a bank-owned state; the merchant tracking exchange wire arrivals) exists only as narrative.

  • Docs and code drift silently. Doc-versus-code audits on this corpus repeatedly find stale state names, missing error codes, and endpoints whose real behavior has moved on. One-sided declarations rot; the fix is two-sided, machine-checkable declarations.

  • Deriving anything requires reading prose. Use-case walkthroughs, persona-specific API surfaces (“what can a tax auditor see?”), state tables, and sequence diagrams are today hand-authored and immediately stale.

The goal is a documentation corpus that is the authoritative source of truth in the spec-first sense: implementations conform to it, code is generated from its shape layer, and derived artifacts are produced without reading prose.

23.106.3. Current state of the corpus#

This section is the diagnostic: what the corpus provides today, and which gaps the requirements document closes.

23.106.3.1. What files contain today#

The current corpus already provides, per file:

ID

Element

Encoding today

E1

Method identity (HTTP method + path / op)

.. http:get:: /p / .. ts:op:: op

E2

One-line + prose description

directive body

E3

Request parameters

:query:, body as .. ts:def::

E4

Response per status code

:http:statuscode: + ts:def

E5

Error codes

TALER_EC_* names in status prose

E6

Field-level versioning

@since **vN** / @deprecated comments

E7

Chapter-level version history

“Version History” section of api-*.rst

E8

Chapter-level auth model

prose section of api-*.rst

E9

Long-poll parameters

:query timeout_ms: + :ref: to convention

E10

Idempotency

occasionally, prose only (e.g. post-withdraw.rst)

E11

Read-only / deprecated flags (wallet ops)

:read-only:, :deprecated: on ts:op

E12

Expected errors + side effects (wallet ops)

prose lists in Details:

Verified against the corpus (2026-10): the only options the identity directives accept today are deprecated/noindex/synopsis (HTTP domain) and read-only/deprecated (ts:op). None of the new header options, and none of the entity / lifecycle / timer / identifier / notification-channel directives, exist anywhere outside the specification documents themselves — all are new _exts/ work. core/entities.rst does not exist. core/wallet-core/notifications.rst exists, but as a flat list of notification types with payload definitions — no channel, delivery, or event structure — and must be restructured into the channel form.

23.106.3.2. Gaps to close#

ID

Missing element

Why derivation needs it

G1

Method maturity (stable/draft/…)

drafts must be excludable from derivation

G2

Per-method actor visibility

persona closures are computed from who may call what

G3

Error semantics

same status/code is transient in one flow, terminal in another, and sometimes not an error at all (progress); cannot be inferred

G4

Idempotency label

retries are safe or not — never guessable

G5

Lifecycles with triggers and guards

the entity machine: what causes each transition, and when that path exists at all (config/data forks such as KYC thresholds)

G6

Timers

expiry/deadline edges of state tables

G7

Observation channels

how an actor learns a state changed

G8

Identifier joins

which values are created/carried/read/consumed where — the cross-component join keys

G9

Effects (structured)

what changed in the world beyond the response

23.106.3.3. Structural mismatches found by verification#

  • ~20 files violate one-method-per-file as-is, some deliberately: auditor/delete-monitoring-records.rst carries 24 identity directives (one per monitoring-record type); KYC webhook and AML transfer files carry 2–4; long-poll variants (e.g. get-purses-PURSE_PUB-merge.rst) are documented as two directives in one file.

  • ~12 files are proxy stanzas, not methods: .. http:any:: wildcard reverse-proxy delegation declarations (merchant/any-star.rst, seven corebank any-...-star.rst files) with no request/response semantics.

  • sync and terminal have no per-endpoint files at all: 3 and 10 endpoints respectively live inline in api-sync.rst / api-terminal.rst.

  • KYC state is cross-cutting: 23+ KYC-related files across six components; exchange, merchant, bank-wire, and wallet all hold projections, so naive single-owner modeling fails.

  • Wallet transaction machines (DD37) need four lifecycle-model extensions; see D10.

23.106.4. Requirements#

R1 Each endpoint/method is documented in exactly one .rst file whose

semantic content is completely machine-readable.

R2 From the corpus, without reading prose, tooling can derive:

per-entity state tables (states, transitions, timers, failure exits), per-actor observation projections, cross-component identifier flows, and sequence diagrams (messages from transitions, alt from guards, loop from timers).

R3 The shape layer (ts:def types, request/response schemas) is

complete enough to generate client/server types and validators; drift is caught by CI in the implementation repositories.

R4 Documented intent (drafts, unimplemented proposals) is visibly and

mechanically distinguishable from documented behavior, and excluded from derivation.

R5 The format must cover the existing corpus without exceptions that

swallow rules: HTTP APIs, wallet-core operations, long-poll dialects, non-2xx progress signals, capability-gated access, config/data forks (KYC thresholds), and wallet transaction lifecycles per DD37.

R6 Every cross-reference a lint can check must be resolvable: entity

names, state values, timers, identifiers, trigger targets, channel events. Free strings are lint errors.

R7 Migration is incremental: the current corpus is mostly compliant in

shape, and backfill proceeds slice by slice (bank-integrated withdrawal first), with the lint warn-only until a slice is done.

23.106.5. Proposed Solution#

The full format is normatively specified in Endpoint and Method Documentation Requirements. This section states the design as a sequence of decisions and their reasons.

23.106.5.1. D1: Derive edges, declare anchors#

The organizing philosophy. Anything that is an edge — a transition, an arming, an observation, a carriage of a value — is written exactly once, on the edge itself (the lifecycle transition, the method header, the effect, the identifier tag). Anything that acts as a resolution anchor — an entity, a timer name, an identifier, a notification channel — is declared once, minimally, so edges can be checked against it. If a fact can be derived from edges it is never also declared; if a name must be resolvable it is never left implicit.

This is what keeps the system from collapsing under its own bookkeeping: timers are slim anchors (name + prose) because their armed-by, exposed-in, fires-to, and gates facts are all derivable from timer-refs, error entries, and lifecycle triggers; identifiers are name + :capability: + prose because their created-by/carried-by/read-by/consumed-by story is the union of method-side tags. The alternative — restating everything at the anchor — guarantees drift.

23.106.5.2. D2: One file per method, machine-readable header#

Each method’s identity card is its existing directive (.. http:get:: / .. ts:op::) extended with options: version (:since: / :deprecated:), maturity, idempotency, actor visibility, observation binding, timer relationships, and long-poll dialect. Every option exists because a named consumer needs it (lint, generator, exclusion filter); none is decorative.

Decision: the maturity option is named ``:maturity:``, not ``:status:``. The vendored sphinxcontrib-httpdomain in _exts/ already accepts :status: as a field-name alias for status codes (names=('statuscode','status','code')); a new header option with that name collides.

Decision: file-naming and one-directive-per-file rules get two explicit exemptions, not silent violations.

  • Variant groups: a small number of files legitimately document several directive instances of one logical method (auditor/delete-monitoring-records.rst with 24 record types, KYC webhook provider variants, long-poll variants such as exchange/get-purses-PURSE_PUB-merge.rst). These are declared variant groups and linted as one method with variants, rather than being split into near-identical files.

  • Proxy stanzas: ~12 files using .. http:any:: with wildcard paths (merchant/any-star.rst, the corebank any-...-star.rst reverse- proxy delegation declarations) are not methods with request/response semantics. They get their own minimal stanza class and are excluded from request/response/idempotency requirements.

Decision: sync and terminal are split. Both APIs currently live inline in their chapter files (3 and 10 endpoints). They are split into per-endpoint files like every other API; chapter files keep only version history and shared conventions.

23.106.5.3. D3: Errors carry temporality and recovery#

Every non-2xx outcome — including codes that are not failures (202 pending, 304 unchanged, 402 unpaid) — gets a structured entry with :temporality: (transient-state / terminal / fixable / rate-limited / gate / progress) and :recovery: (retry-same / retry-modified / retry-after / long-poll / poll-later / refresh-config / start-kyc / user-action / abort / give-up / none). This pair is what makes the failure and timer columns of derived state tables computable instead of guessed, and what tells the generator when not to derive a failure edge (progress entries are state signals, not errors).

23.106.5.4. D4: Idempotency is a first-class label#

readonly / replay-safe / keyed:<field> / unsafe. Retries are the universal response to network failure, and a request that arrived-but-lost-its-response is indistinguishable from one that never arrived; whether a verbatim replay is safe decides whether the client’s failure branch exists at all. The label also flags design smells: an unsafe mutating method in this ecosystem deserves review, and the lint requires the field on every mutating method.

23.106.5.5. D5: Authorization is one fact: the actor#

:visible-to: declares the actor surface (wallet-user, merchant-staff[:scope], aml-officer[:readonly], exchange-operator, auditor, tax-auditor, bank-customer, bank-admin, kyc-provider, any-unauthenticated, external), and the credential mechanism is implied by a fixed table. Declaring both actor and mechanism would duplicate one fact in two drift-prone places. Capability-gated access (unguessable identifiers such as wtid or withdrawal-id) is annotated in parentheses and resolved against the identifier registry, which is where the :capability: property of the value lives. Persona projections are computed as closures over this field.

23.106.5.6. D6: Methods bind to entity machines in exactly two ways#

Mutators declare transitions in an Effects block (entity, exact edge, observation endpoint). Readers declare an observation binding (:observes-state: <entity>.<field>) stating that the response is a view onto that entity’s machine. Both are checked two-sided against the entity registry: the lifecycle says “call X drives A→B”, the method says “I drive A→B on entity E”, and disagreement is a lint error. One-sided declarations silently rot; that is the lesson of every doc-versus-code audit on this corpus.

23.106.5.7. D7: Identifiers are the join keys#

Methods tag their role in each identifier’s life: creates / carries / reads / consumes. The union over ~490 files yields the cross-component value-flow graph and the lint’s join checks (exactly one creator per carried/read value, or an internal-creation note at the anchor for values like wtid minted by the exchange’s aggregator). The registry holds only the anchor: name, :capability:, prose.

23.106.5.8. D8: Entities, lifecycles, triggers, guards#

The entity registry declares, per entity: :owner: (the component holding authoritative state and executing transitions — not merely where the entity is displayed), a transition list, a declared terminal set, timer anchors, and identifier anchors. States are inferred from transitions; terminal states are declared so that use-case success conditions are anchored, the absorbing property is checkable, and truncated machines are visible (a non-terminal state with no outgoing edges is a lint warning).

Every transition names its trigger — call <method>, timer <entity>.<timer>, watch <component>.<observable>, or external <description> — and optionally a guard (:if:) for config/data forks (KYC on/off, thresholds, feature flags). Triggers are the causality layer no per-endpoint doc can see locally; guards keep one canonical machine with guarded edges instead of a combinatorial family of near-identical machines.

23.106.5.9. D9: Notifications live on per-component pages#

How an actor learns that state changed is declared once per component: channel, registration, delivery semantics (lossy-hint / at-least-once / rendezvous / honestly-unspecified), events, and — critically — the authoritative read backing each event family, per the doctrine signals are hints; reads are truth. Method files never declare push channels; the link from effect to signal is derived. Long-poll is not a notification channel: it is a property of the read endpoint (:wait:), since a long-poll response is authoritative state delivered late, not a hint. Components with no push channels (the exchange) declare that negative fact explicitly.

23.106.5.10. D10: Wallet transaction lifecycles need four model extensions#

The wallet-core variant maps HTTP concepts onto ts:op files, with effects expressed as transitions on per-transaction-type entities (transaction-withdrawal, transaction-payment, …) whose state vocabulary is DD37’s major[:minor][/working]. Verification against DD37 and the wallet-core implementation surfaced four places where the base lifecycle model does not fit; each gets an explicit extension rather than a workaround:

D10.1 Final states may be reactivatable. DD37 done is not absorbing: a payment is reactivated by refund queries and rebind-session; a deposit in finalizing:track can fall back to pending when new KYC requirements appear. The lifecycle model therefore distinguishes :terminal: (absorbing) from :final-reactivatable: (success anchor for use cases, but reactivation edges are legal and must be listed). The absorbing lint applies only to :terminal:.

D10.2 ``/working`` and the suspended shadow states are orthogonal modifiers, not states. DD37’s public state value is a tuple (major, minor, working); working is a transitional presentation flag explicitly slated to become major states later, and nearly every non-terminal state has paired suspended / suspended-aborting / suspended-finalizing shadow states plus retry self-loops that DD37 deliberately omits from its diagrams. Encoding all of this as literal states and transitions would explode every table. Instead, wallet transaction entities declare:

  • working as a lifecycle-level orthogonal flag (same mechanism as the order entity’s :modifiers:);

  • a :standard-edges: suspend-retry declaration that implies the suspend/resume/retry edge family on every non-final state, so the inferred state set and edge set include them without authoring them.

State values in :transition: fields use DD37 notation, and DD37’s state-expression language (pending:*, pending:-, /idle, comma alternation) is accepted wherever a state set is matched.

D10.3 Ownership is inside-out, and that is fine. A wallet transaction entity is owned by wallet-core (it holds the authoritative record and executes transitions), but its triggers are almost entirely watch <component>.<observable> (bank withdrawal operations, exchange reserves/KYC, merchant refunds, another wallet in p2p) plus local user actions and timers — the inverse of the tan-challenge reference example where the owner executes on call. This is not a violation of the owner rule but its second mode, and the worked examples below include a watch-driven wallet entity alongside call-driven bank entities. Corollaries: one logical p2p transfer is two entities (debit and credit) with no shared machine (“public states describe each wallet’s local progress”, DD37), and hidden child transactions (internal-withdrawal) are separate entities, not states of the parent.

D10.4 Some truths are not derivable from the machine. Three are declared as explicit non-goals of derivation for wallet transactions:

  • txActions are computed per state and context and are not derivable from the lifecycle (DD37: frontends must use the returned txActions). No “possible actions” column is generated.

  • deleted is notification-only, never a stored state; its observation is the absence of the record (WALLET_TRANSACTION_NOT_FOUND). The observation model gains the notion “absence as signal” for exactly this case (and wallet-core’s none pseudo-state appearing in transition notifications).

  • Internal states are intentionally collapsed on exposure (e.g. redenomination phases report as pending:withdraw/working). The registry describes the public machine; the mapping from internal status enums is implementation detail, checked by CI drift detection, not authored in docs.

23.106.5.11. D11: DD37’s tables are generated, not mirrored#

The registry entries for wallet transaction entities become the canonical machine-readable form of DD37’s machines, and DD37’s per-type state tables are generated from the registry (with DD37 remaining the human-oriented prose and diagrams). Re-encoding DD37 by hand in the registry would create the very two-sided drift problem this system exists to eliminate. The lint’s wallet rule resolves state names against the get-transaction-by-id.rst enums and state edges against the registry.

23.106.5.12. D12: Lint as build checks, warn-only during migration#

A doc lint in taler-docs/_exts/ enforces the rules (identity, vocabulary, resolvability, two-sided lifecycle agreement, identifier joins, lifecycle integrity, filename/location) as Sphinx build warnings/errors. New rules land warn-only per slice and flip to error when the slice is backfilled.

23.106.5.13. D13: KYC/AML is one exchange-owned entity; decisions are data, not states#

KYC is the hardest entity to model because its state is genuinely cross-cutting: the wallet blocks transactions on it, the merchant shows a status page for it, the bank carries its wire transfers, the auditor observes its holds, and AML officers act on it. Verification against the exchange’s actual schema (DD23) shows that the authoritative state lives entirely in the exchange: per wire target (h_payto), the exchange holds the access token, the currently triggered legitimization measures, the active decision/rule-set ledger, and the external provider processes. Everything else — the wallet’s ExchangeWalletKycStatus and transaction minors, the merchant’s MerchantAccountKycRedirect.status enum, the KYC SPA’s requirement list, the auditor’s AML-hold view — is a projection, named as such under the owner (per the owner rule’s projection clause).

Decision: one entity, ``kyc-account``, owned by the exchange. Its observable surface is GET /kyc-check/$H_NORMALIZED_PAYTO (200 = no mandatory action, 202 = redirect user to legitimization, 409 = account not yet bound to a public key, i.e. KYC-auth wire transfer required) plus the aml_review flag, the monotonic rule_gen counter (the long-poll rendezvous), and the access token that authorizes the SPA. Its states are client-meaningful, not DB-meaningful: clean, auth-required, action-required (measures open), in-process (external provider engaged), under-review (aml_review). There are no terminal states: a bank account never stops existing; dormancy and closure are modifiers.

Decision: officer decisions and rule sets are guards and modifiers, not states. An AML officer decision (POST /aml/$OFFICER_PUB/decision) does four things: installs a new LegitimizationRuleSet (which changes which transitions exist — hence :if: guards on threshold rules, not new states), sets account properties (is_frozen, was_reported, pep, high_risk — declared as :modifiers: on kyc-account), triggers immediate measures (a call trigger into action-required), and sets keep_investigating (the under-investigation modifier). This is exactly how the implementation works (the active row of legitimization_outcomes is superseded, not stacked): decisions rewrite the machine’s guard data. The concurrency guard of the API (409 AML_DECISION_MORE_RECENT_PRESENT) is an ordinary fixable error with retry-modified recovery (re-read, then re-decide). Officer provisioning (POST /management/aml-officers, master-key signed) is the exchange-operator actor acting on the officer registry — separate entity, not part of kyc-account.

Decision: projections may be restricted or lossy, and that is declared. The KYC SPA’s projection is deliberately restricted (the law may forbid disclosing true status; aml_review is only a hint), so :observes-state: on the SPA endpoints is annotated as restricted. The merchant’s status enum mixes entity states (kyc-required, awaiting-aml-review) with observation failures (exchange-unreachable, logic-bug); the lint resolves only the former against the lifecycle — projection-local failure members are declared at the observing method, not added to the entity’s machine. The wallet deliberately conflates “user must act” with “staff review in progress” in pending:kyc; the docs must not model it as user-actionable only.

Decision: Challenger is a separate entity, plugged in by trigger. An address-validation process (Challenger or another provider) has its own machine (setup → challenged → solved/failed/expired, OAuth-flavored), owned by the provider component. It never decides KYC: its outcome enters kyc-account via watch kyc-provider.webhook / call GET /kyc-proof/$PROVIDER triggers. Provider processes have their own expiration timers, distinct from the account’s rule-set expiration.

23.106.6. Worked examples#

These examples show the target format applied to real corpus content. They illustrate the requirements document; they are not themselves normative additions to it.

23.106.6.1. A compliant method file#

core/bank-integration/get-withdrawal-operation-WITHDRAWAL_ID.rst brought into compliance — added structure marked with ※:

.. http:get:: /withdrawal-operation/$WITHDRAWAL_ID
   :since: v1
   :maturity: stable
   :idempotency: readonly
   :observes-state: withdrawal-operation.status              ※
   :visible-to: wallet-user, bank-customer (capability withdrawal-id)
   :wait: long-poll(timeout_ms, old_state)                   ※

  Query information about a withdrawal operation, identified by the
  ``WITHDRAWAL_ID``.

  **Request:**

  :query timeout_ms: *Optional.*
    Timeout in milliseconds, for :ref:`long-polling <long-polling>`,
    to wait for operation state to be different from ``old_state``.
    Since protocol **v3**.
  :query old_state:
    *Optional.* Defaults to "pending".
  :query long_poll_ms: *Optional.*
    Deprecated in protocol **v3**. Use *timeout_ms* instead.

  **Response:**

  :http:statuscode:`200 OK`:
    :schema: BankWithdrawalOperationStatus                  ※
    The withdrawal operation is known to the bank, and details
    are given in the `BankWithdrawalOperationStatus` response body.

  **Errors:**                                               ※

  :error 404 none:
    :temporality: terminal
    :recovery: give-up
    The operation was not found.  (A not-yet-propagated operation
    id may also 404 briefly; clients that just received the id from
    a ``taler://withdraw`` URI may retry briefly.)

  **Identifiers:**                                          ※

  :identifier withdrawal-id:
    :role: reads
    :registry: :ref:`identifier-withdrawal-id`
    The lookup key of the operation, conveyed via
    ``taler://withdraw``.
  :identifier reserve_pub:
    :role: reads
    :registry: :ref:`identifier-reserve-pub`
    Wallet-selected reserve public key, returned here as part of
    the operation state.

  **Details:**

  .. ts:def:: BankWithdrawalOperationStatus
    ... (unchanged) ...

Notes on the example:

  • The 404 entry shows the G3 problem and its resolution: the same code is terminal for a stale id and transient for a not-yet-visible one — the condition is documented, the default classification is explicit.

  • :visible-to: carries the only authorization fact: wallet user and bank customer, holding the unguessable withdrawal-id. The mechanism (no credentials, capability in the URL) follows from the actor vocabulary and the registry entry — no separate auth field.

  • :wait: acknowledges long-polling and names its parameters (the lint checks them against the :query: list). There is no push channel for this entity; had there been one, it would be declared in the bank’s notification page, not here.

  • The withdrawal operation’s missing expiry timer is recorded once, at the entity (next example) — not here, and not scattered.

23.106.6.2. Entity, timer, and identifier anchors#

withdrawal-operation (owner: bank):

.. entity:: withdrawal-operation
   :owner: bank (libeufin/corebank; exposed via the
   bank-integration API and reused by the terminal API)

   A bank-side operation coordinating one withdrawal: exchange and
   reserve selection by the wallet, confirmation by the account
   owner, wire transfer to the exchange.

   .. lifecycle::
      :terminal: aborted, confirmed

      :transition none -> pending:
        :trigger: call POST /accounts/$USERNAME/withdrawals
        :trigger: external bank customer creates the operation in
          the bank UI
        The operation exists; the ``withdrawal-id`` is distributed
        via a ``taler://withdraw`` URI.
      :transition pending -> selected:
        :trigger: call POST /withdrawal-operation/$WITHDRAWAL_ID
        The wallet submits its selection (exchange, ``reserve_pub``).
      :transition selected -> confirmed:
        :trigger: call POST .../withdrawals/$WITHDRAWAL_ID/confirm
        :trigger: external account owner confirms (2FA) in the
          bank UI
        The bank registers the transfer; the exchange observes the
        funded reserve through its incoming wire history
        (``reserve_pub`` as wire subject).
      :transition pending|selected -> aborted:
        :trigger: call POST /withdrawal-operation/$WITHDRAWAL_ID/abort
        :trigger: external bank-side abort
        409 ``CONFIRM_ABORT_CONFLICT`` if already confirmed — the
        absorbing property of ``confirmed`` in action.

   .. timer:: operation-expiration
      ⚠ not yet specified: no documented expiration exists today.
      Recorded here as the single visible gap instead of silence
      across all method files.

   .. identifier:: withdrawal-id
      :capability: yes (unguessable; possession authorizes)
      Bank-generated operation id, distributed via
      ``taler://withdraw`` URIs.  Created by
      ``POST /accounts/$U/withdrawals`` or the bank UI; carried and
      read across bank, wallet and exchange endpoints (derived from
      the method files' **Identifiers:** blocks).

   .. identifier:: reserve_pub
      :capability: yes
      Wallet-generated reserve key; becomes the wire subject of the
      funding transfer and names the reserve at the exchange.

tan-challenge (owner: corebank) is the reference example of a fully specified entity: declared terminal set, trigger-typed transitions (call, timer, guarded call), and two slim timer anchors whose structural facts (fires-to, armed-by, exposed-in, gates) are all derived from transitions, timer-refs and error entries — see the requirements document, §4.

order (owner: merchant backend) — implicit machine made explicit:

.. entity:: order
   :owner: merchant backend

   .. lifecycle::
      :terminal: wired
      :modifiers: refunded (any state at or after paid)

      :transition none -> unpaid:
        :trigger: call POST /private/orders
        :trigger: call POST /templates/$TEMPLATE_ID
        Order created; a wallet can now claim it.
      :transition unpaid -> claimed:
        :trigger: call POST /orders/$ORDER_ID/claim
        The wallet binds its nonce; contract terms signed.
      :transition claimed -> unpaid:
        :trigger: call POST /orders/$ORDER_ID/unclaim
        The claim is released; another wallet may claim.
      :transition claimed -> paid:
        :trigger: call POST /orders/$ORDER_ID/pay
        :if: coins cover the amount and any age/token requirements
        Coins deposited; fulfillment unlocked.
      :transition paid -> wired:
        :trigger: watch exchange.outgoing-wire-arrivals
        :trigger: call POST /private/transfers
        The exchange aggregates and wires the funds; the merchant
        confirms the bank credit and the backend reconciles.

   .. timer:: pay-deadline
      After the deadline the order can no longer be paid.
      (Armed by order creation's ``pay_deadline`` and exposed in
      order status responses — both derived from timer-refs.)

   .. timer:: refund-deadline
      Closes the refund window; wallet refund pickup returns 410
      afterwards.  (Arming, exposure and gating all derived.)

   .. identifier:: order-id
      :capability: yes
      The public status/payment page is authorized by the
      unguessable order id (plus claim token); management views
      require bearer scopes instead — two different access
      classes over the same value.

Note that :modifiers: records orthogonal boolean flags (refunded, confirmed) that the API exposes alongside the main chain — they extend the state space without entering the transition graph. This is the same mechanism wallet transaction entities use for working and the suspended shadow states (D10.2).

23.106.6.3. Notification pages#

Wallet (core/wallet-core/notifications.rst, restructured from today’s flat list into channel form):

.. notification-channel:: wallet-message
   :component: wallet-core
   :registration: implicit (clients of the wallet-core message
   protocol receive notifications)
   :delivery: lossy-hint
   :events: transaction-state-transition, exchange-state-transition,
            balance-change, withdrawal-transition, ...

   All notifications are hints, not authoritative state
   (``api-wallet-core.rst``): the authoritative read is the
   corresponding getter — e.g. ``transaction-state-transition`` ->
   ``getTransactionById``; ``balance-change`` -> ``getBalances``.

Merchant (to be extracted from api-merchant.rst):

.. notification-channel:: webhook
   :component: merchant
   :registration: POST /private/webhooks
   :delivery: unspecified  ⚠ retry/ordering/duplication semantics
     are not documented today
   :events: order_created, pay, refund, order_settled,
            category_created, category_update, category_delete,
            inventory_update, inventory_product_created, ...

   Authoritative reads: order events ->
   ``GET /private/orders/$ORDER_ID``; inventory events ->
   ``GET /private/products/$PRODUCT_ID``.

Exchange (honest negative declaration):

.. notification-page:: exchange

The exchange offers **no** push notification channels.  All
observation is by pull; several status endpoints accept long-poll
parameters (``:wait: long-poll(...)`` in their method files), e.g.
``GET /reserves/$RESERVE_PUB``, ``GET /purses/$PURSE_PUB/merge``,
``GET /kyc-info/$ACCESS_TOKEN``.

23.106.6.4. KYC account (owner: exchange) — the D13 machine#

.. entity:: kyc-account
   :owner: exchange (exposed via /kyc-check, /kyc-info, /kyc-spa and
   the /aml/$OFFICER_PUB/... officer API; projected into the merchant's
   /private/kyc status, the wallet's ExchangeWalletKycStatus and
   transaction minors, and the auditor's AML-hold view)

   KYC/AML state of one bank account (wire target) at one exchange.
   There are no terminal states; the account exists as long as the
   exchange knows it.  Officer-set properties (frozen, reported, pep,
   high-risk) and investigation status are modifiers.

   .. lifecycle::
      :terminal: (none)
      :modifiers: frozen, reported, pep, high-risk, under-investigation

      :transition none -> clean:
        :trigger: watch bank.incoming-wire-arrivals
        :trigger: call <any exchange operation naming the account>
        The exchange learns the account exists; default rules apply.
      :transition clean -> auth-required:
        :trigger: call <any guarded operation, e.g. POST /withdraw>
        :if: /keys.kyc_enabled and no KYC-auth wire transfer has
          bound the account to a public key
        The operation is denied (409 AUTHORIZATION_KEY_UNKNOWN or
        451 with bad_kyc_auth); the client must send a KYC-auth
        transfer whose subject carries the account public key.
      :transition auth-required -> clean:
        :trigger: watch bank.incoming-kycauth-wires
        The KYC-auth transfer binds target_pub; /kyc-check becomes
        usable for this account.
      :transition clean -> action-required:
        :trigger: watch bank.incoming-wire-arrivals
        :trigger: call POST /kyc-wallet (balance threshold pre-announcement)
        :trigger: call POST /aml/$OFFICER_PUB/decision (new_measures)
        :if: the active rule set's threshold for the operation type
          (WITHDRAW/DEPOSIT/MERGE/BALANCE/CLOSE/AGGREGATE/REFUND/
          TRANSACTION) is crossed within its timeframe; "verboten"
          measures deny instead of gating
        The triggering operation is denied with 451
        LegitimizationNeededResponse; the wallet enters pending:kyc.
      :transition action-required -> in-process:
        :trigger: call POST /kyc-start/$ID (via the KYC SPA)
        An external provider process is created with its own
        expiration.
      :transition in-process -> action-required:
        :trigger: timer kyc-account.process-expiration
        :trigger: watch kyc-provider.webhook (user-failure /
          provider-failure)
      :transition in-process -> clean:
        :trigger: watch kyc-provider.webhook (success)
        :trigger: call POST /kyc-upload/$ID (form evidence)
        :trigger: call GET /kyc-proof/$PROVIDER (OAuth redirect)
        The AML program evaluates the outcome and installs a new
        rule set; the blocked operation may now be retried.
      :transition action-required|in-process -> under-review:
        :trigger: watch aml-program.outcome (to_investigate)
        :trigger: call POST /aml/$OFFICER_PUB/decision
          (keep_investigating)
        Staff review; clients only see aml_review=true and wait.
      :transition under-review -> clean:
        :trigger: call POST /aml/$OFFICER_PUB/decision
        The officer's new rule set supersedes the active outcome.
      :transition clean -> action-required:
        :trigger: timer kyc-account.rule-set-expiration
        :if: a successor measure is configured
        Rule-set expiry re-triggers legitimization.

   .. timer:: rule-set-expiration
      LegitimizationRuleSet.expiration_time of the active outcome;
      fires into the successor measure (or default rules).
   .. timer:: process-expiration
      Per external provider process; armed by /kyc-start, fires
      in-process -> action-required.
   .. timer:: kyc-auth-subject-expiration
      Validity of KYC-auth wire instructions (merchant kycauth
      response field ``expiration``).
   .. timer:: wallet-threshold-expiration
      WalletKycCheckResponse.expiration_time; the wallet's granted
      balance threshold lapses and the wallet re-checks.

   .. identifier:: kyc-access-token
      :capability: yes
      Bearer of the SPA session; issued per wire target, distributed
      via /kyc-check responses to authenticated clients.
   .. identifier:: account-pub
      :capability: no (bound by KYC-auth wire transfer)
      The public key a KYC-auth transfer binds to the account.

Notes:

  • GET /kyc-check carries :observes-state: kyc-account.status; its min_rule / lpt parameters are the long-poll dialect (:wait: long-poll(timeout_ms, min_rule, lpt)), and rule_gen is the monotonic rendezvous counter.

  • The officer decision endpoint is :idempotency: unsafe in appearance but guarded: 409 AML_DECISION_MORE_RECENT_PRESENT (:temporality: fixable, :recovery: retry-modified) forces the officer to re-read the ledger before re-deciding.

  • Challenger’s address validation is a separate entity (address-validation, owner: challenger) with states setup / challenged / solved / failed / expired; its OAuth code is consumed by POST /token and its outcome reaches kyc-account only through the watch kyc-provider.webhook trigger.

23.106.6.5. Flow: bank-integrated withdrawal#

Entities in play: withdrawal-operation (bank, shown above), reserve (exchange), transaction-withdrawal (wallet-core). Join key: reserve_pub — created by the wallet (confirmWithdrawal / acceptManualWithdrawal), carried to the bank by POST /withdrawal-operation/$WITHDRAWAL_ID, becomes the wire subject (read by the exchange’s wirewatch), read by GET /reserves/$RESERVE_PUB and POST /withdraw.

.. entity:: reserve
   :owner: exchange

   Funds pooled under a reserve public key by an incoming wire
   transfer; drained by withdrawals.

   .. lifecycle::
      :terminal: closed

      :transition none -> open:
        :trigger: watch bank.incoming-wire-arrivals
        The wire subject is the reserve_pub.  There is no create
        call: the wallet long-polls GET /reserves/$RESERVE_PUB
        (404 transient-state, recovery long-poll) until the wire
        arrives.
      :transition open -> closed:
        :trigger: call POST /reserves/$RESERVE_PUB/close
        :trigger: timer reserve.expiration
        Residual value is wired back to last_origin.

   .. timer:: expiration
      Armed by the funding wire (per exchange configuration);
      exposed in ReserveSummary.reserve_expiration.

.. entity:: transaction-withdrawal
   :owner: wallet-core

   The wallet's withdrawal transaction group (DD37), here the
   bank-integrated variant.  Note the D10 extensions: working as a
   modifier, implied suspend/retry edges, and watch-driven triggers.

   .. lifecycle::
      :terminal: done, failed, aborted
      :modifiers: working
      :standard-edges: suspend-retry

      :transition none -> dialog:proposed:
        :trigger: call prepareBankIntegratedWithdrawal
        The taler://withdraw URI is resolved against the
        bank-integration API.
      :transition dialog:proposed -> pending:bank-register-reserve/working:
        :trigger: call confirmWithdrawal
        The wallet creates reserve_pub and registers it with the
        bank (POST /withdrawal-operation/$WITHDRAWAL_ID).
      :transition pending:bank-register-reserve -> pending:bank-confirm-transfer:
        :trigger: watch bank.withdrawal-operation.status (= selected)
      :transition pending:bank-confirm-transfer -> pending:exchange-wait-reserve:
        :trigger: watch bank.withdrawal-operation.status (= confirmed)
        The account owner confirmed; the bank wires the funds.
      :transition pending:exchange-wait-reserve -> pending:withdraw/working:
        :trigger: watch exchange.reserve (GET /reserves/$RESERVE_PUB
          long-poll returns 200)
      :transition pending:withdraw -> done:
        :trigger: internal coins withdrawn (POST /withdraw replay-safe)
      :transition pending:* -> pending:kyc:
        :trigger: call <guarded operation>
        :if: exchange signals legitimization (451 /
          wallet_balance_limit_without_kyc)
      :transition pending:kyc -> pending:*:
        :trigger: watch exchange.kyc-account (GET /kyc-check long-poll)
      :transition pending:bank-confirm-transfer -> aborting:bank/working:
        :trigger: call abortTransaction
      :transition aborting:bank -> aborted:bank:
        :trigger: watch bank.withdrawal-operation.status (= aborted)
        A 409 from the bank abort means it confirmed concurrently —
        the standard-edges retry path returns to exchange-wait-reserve.

23.106.6.6. Flow: payment from a template#

Entities in play: order (merchant, shown above — note its none -> unpaid transition already lists call POST /templates/$TEMPLATE_ID as a second trigger), transaction-payment (wallet-core). Identifiers: order-id (created by the template instantiation), the claim nonce (created by the wallet at claim, consumed at pay), h_contract_terms (derived from the claim response, carried into every later public call and into the exchange’s deposit).

The template itself is a static merchant resource, not a lifecycle entity: POST /private/templates and its siblings are CRUD with no machine, and say so (:idempotency: keyed:template_id and no Effects).

.. entity:: transaction-payment
   :owner: wallet-core

   DD37 payment transaction.  Demonstrates :final-reactivatable::
   a done payment is reactivated by explicit refund queries.

   .. lifecycle::
      :terminal: failed, aborted, expired
      :final-reactivatable: done
      :modifiers: working
      :standard-edges: suspend-retry

      :transition none -> dialog:proposed:
        :trigger: call preparePayForTemplateV2
        Instantiates the template at the merchant (public
        POST /templates/$TEMPLATE_ID): order none -> unpaid.
      :transition dialog:proposed -> pending:submit-payment/working:
        :trigger: call confirmPay
        The wallet claims the order (nonce bound) and signs.
      :transition pending:submit-payment -> done:
        :trigger: watch merchant.order (POST /orders/$ORDER_ID/pay 200)
      :transition done -> pending:check-refund/working:
        :trigger: call startRefundQuery
        :trigger: timer order.auto-refund (auto-refund probing)
        Reactivation edge out of a final-reactivatable state.
      :transition pending:check-refund -> done:
        :trigger: watch merchant.order.refunds (GET /orders/$ORDER_ID
          long-poll await_refund_obtained)
      :transition dialog:proposed -> expired:
        :trigger: timer order.pay-deadline
      :transition dialog:* -> dialog:waiting-for-other-wallet:
        :trigger: call unclaimPayment
        The claim nonce is released; another wallet may claim.

   .. timer:: auto-refund
      Armed from contract terms (auto_refund); exposed to the wallet
      in contract terms, fires the refund-probing reactivation.

23.106.6.7. Flow: deposit to a bank account#

Entities in play: deposit (exchange), transaction-deposit (wallet-core), and kyc-account (the deposit flow is its most frequent client). Identifiers: h_wire (hash of the target payto), h_contract_terms, wtid (created internally by the exchange’s aggregator, carried into the tracking response and onward to merchant reconciliation).

.. entity:: deposit
   :owner: exchange

   A batch deposit of coins to one wire target.

   .. lifecycle::
      :terminal: wired, refunded

      :transition none -> accepted:
        :trigger: call POST /batch-deposit
        Coins are deposited; the exchange wires after the refund
        deadline and before wire_transfer_deadline.
      :transition accepted -> held:
        :trigger: watch aml-program.outcome
        :if: aggregation KYC triggers (tracking returns 202 with
          kyc_ok:false; auditor reports deferral_reason="KYC")
      :transition held -> wired:
        :trigger: watch exchange.kyc-account (clearance)
      :transition accepted -> wired:
        :trigger: timer deposit.wire-deadline (aggregation runs)
        GET /deposits/$H_WIRE/... now returns 200 with wtid and
        execution_time.
      :transition accepted -> refunded:
        :trigger: call <merchant refund before deadline>

   .. timer:: wire-deadline
      Armed by BatchDepositRequest.wire_transfer_deadline ("never"
      is rejected); exposed in tracking responses as execution_time.

.. entity:: transaction-deposit
   :owner: wallet-core

   DD37 deposit transaction — the KYC-richest machine: pre-submission
   KYC (kyc-auth transfer) and post-submission aggregation KYC are
   distinct guarded regions.

   .. lifecycle::
      :terminal: failed, aborted
      :final-reactivatable: done
      :modifiers: working
      :standard-edges: suspend-retry

      :transition none -> pending:deposit/working:
        :trigger: call createDepositGroup
      :transition pending:deposit -> pending:kyc-auth:
        :trigger: call POST /batch-deposit (denied)
        :if: target account not yet bound (409 AUTHORIZATION_KEY_UNKNOWN)
        kycAuthTransferInfo names the debit account that must send
        the KYC-auth transfer.
      :transition pending:kyc-auth -> pending:deposit:
        :trigger: watch exchange.kyc-account (auth wire observed via
          GET /kyc-check long-poll lpt=1)
      :transition pending:deposit -> finalizing:track:
        :trigger: watch exchange.deposit (POST /batch-deposit 200)
      :transition finalizing:track -> pending:kyc:
        :trigger: watch exchange.deposit (tracking 202, kyc_ok:false)
        :if: aggregation KYC required
      :transition pending:kyc -> finalizing:track:
        :trigger: watch exchange.kyc-account (kyc_ok via lpt=2)
      :transition finalizing:track -> done:
        :trigger: watch exchange.deposit (tracking 200, wtid)
      :transition pending:deposit -> aborting/working:
        :trigger: call abortTransaction
      :transition aborting -> aborted:deposit-abort-recovered:
        :trigger: internal (refund + refresh completed)
      :transition aborting -> done:deposit-abort-too-late:
        :trigger: watch exchange.deposit (already wired)
        Terminal done-with-minor: the money arrived despite the abort.

23.106.7. Migration plan#

Compliance snapshot (verified file counts, 2026-10):

Corpus

Files

Status vs. the requirements

wallet-core ops

152 (plus the notifications page)

E1–E6, E11, E12 ✔; need: header options, structured errors, :wait:, effects/observation links to the DD37 machine via the D10 extensions

exchange

65

E1–E7 ✔, retry/idempotency prose good → convert to fields; need: lifecycle registry entries (reserve, purse), :visible-to:, notification page (declares: no push channels)

merchant

114

E1–E7 ✔; documented scopes become :visible-to: merchant-staff:<scope>; webhooks move to the merchant notification page; need: order lifecycle, structured errors

bank-side

65 (bank-integration 4, corebank 39, bank-wire 10, bank-transfer 3, bank-revenue 2, bank-conversion-info 5, account-directory 2)

E1–E7 ✔; withdrawal/TAN states exist as unions → lifecycle registry entries; need: error classification, timers, cashout status gap flagged (API lacks a status field)

identity/misc

92 (challenger 7, taldir 5, mailbox 6, donau 13, ebisync 3, auditor 58)

mixed; challenger close to compliant; taldir/mailbox need timers + error fields; drafts get :maturity: banners

sync, terminal

3 + 10 endpoints, inline today

must be split into per-endpoint files first (D2)

Steps, in order:

  1. Build the tooling in taler-docs/_exts/: the new directive options, the entity / lifecycle / timer / identifier / notification-channel directives, and the lint (all rules warn-only initially).

  2. Backfill the bank-integrated withdrawal slice end to end: bank-integration, corebank withdrawal + TAN, exchange reserve + withdraw, wallet withdrawal ops, registry entries for withdrawal-operation, tan-challenge, reserve, reserve_pub and withdrawal-id, wallet and exchange notification pages. Flip the lint to error for this slice. This is the acceptance gate for the format itself.

  3. Payment/refund slice: merchant order lifecycle, wallet payment and refund ops, merchant notification page, order / order-id anchors.

  4. P2P slice: purse entities, wallet peer-push/peer-pull transaction entities, deposit.

  5. The long tail: KYC/AML (with the shared-ownership treatment of D8’s owner rule), sync + terminal splitting, auditor, drafts and banners.

23.106.7.1. Corpus corrections folded into the requirements document#

Verification against the corpus produced these adjustments, which the requirements document incorporates:

  • :maturity: instead of :status: (httpdomain field-name collision; D2).

  • Variant-group and proxy-stanza exemptions to the one-method-per-file rule (D2).

  • Sync and terminal APIs are to be split into per-endpoint files (D2).

  • The wallet notification page exists but must be restructured into channel form; it is not already compliant (D9).

  • wallet-core op count is 152, not 153 (the 153rd file is notifications.rst).

  • KYC state is cross-cutting and gets the projections-named-under-owner treatment rather than a naive single owner.

  • Wallet transaction entities get the four extensions of D10 and the canonical-registry relationship to DD37 of D11.

23.106.8. Test Plan#

  • The lint (V1–V21 in the requirements document) runs in the documentation CI; the bank-integrated withdrawal slice (bank- integration, corebank withdrawal + TAN, exchange reserve + withdraw, wallet withdrawal ops, registry entries for reserve_pub and withdrawal-id) must lint clean as the acceptance gate for the format itself.

  • Codegen dry-run: generate client types and validators from the slice’s ts:def layer and diff against wallet-core’s and the exchange’s corresponding wire types; mismatches fail the implementation CI.

  • Derivation smoke tests: generate the withdrawal-operation state table, the bank-customer persona projection, and a withdrawal sequence diagram from the corpus; review against the hand-written flow documentation.

  • Wallet extension tests: lint the transaction-withdrawal registry entry against DD37’s generated tables; check that reactivation edges out of done are legal under :final-reactivatable: and rejected under :terminal:.

23.106.9. Definition of Done#

  • All new directives (entity, lifecycle, timer, identifier, notification-channel, extended http:*/ts:op options) are implemented in _exts/ and render correctly.

  • The lint enforces the full rule set as errors on the backfilled slices.

  • Every per-endpoint file (including the newly split sync and terminal endpoints) is compliant or carries an explicit draft/banner maturity.

  • The entity registry covers at minimum the withdrawal, payment/refund, and p2p flows end to end, including wallet transaction entities with the D10 extensions.

  • DD37’s state tables are generated from the registry.

  • At least one implementation repository runs codegen drift detection in CI against the corpus.

23.106.10. Alternatives#

OpenAPI/Swagger as the source of truth. Covers the shape layer well but has no home for lifecycles, temporality semantics, actor projections, identifier roles, or notification doctrine — the parts this design exists for. The ts:def layer already plays OpenAPI’s shape role inside the prose-capable Sphinx corpus; replacing the corpus would lose the prose that remains the human interface.

Generate docs from code. Inverts the authority relationship: the design intent (idempotency guarantees, temporality classification, capability properties) is not present in code in checkable form, so generated docs would silently reflect implementation bugs as specification. The spec-first model with CI drift detection keeps the docs authoritative while still catching divergence.

Full anchor-side declarations (state sets, timer facts, identifier life stories restated at the registry). Rejected: every derivable fact declared twice is a drift bug waiting to happen (D1).

Per-type substate unions instead of DD37’s flat minor-state union. Rejected for this design: the flat global union is the deployed, implemented vocabulary; partitioning it is a DD37 change, out of scope.

Modeling ``/working`` and suspended states as literal states. Rejected: combinatorial table explosion for zero informational gain; orthogonal modifiers plus implied standard edges carry the same semantics (D10.2).

A separate ``:auth:`` field. Rejected: actor implies mechanism; duplication invites contradiction (D5).

23.106.11. Drawbacks#

  • Authoring cost. Compliant files are substantially more work than prose, and ~490 files need backfill. Mitigated by incremental migration and by the lint telling authors exactly what is missing.

  • Format rigidity. Edge cases that do not fit (today: variant groups, proxy stanzas, KYC’s shared ownership) need explicit format extensions rather than prose escape hatches, which slows documentation of unusual endpoints. Accepted: silent exceptions are worse than visible ones.

  • Two specification artifacts to maintain. This DD, the requirements document, and (for wallets) DD37 must evolve together. Mitigated by the normative-reference hierarchy and by generating DD37’s tables from the registry (D11).

  • Tooling must exist before the value does. Until the lint and at least one generator land, the new fields are overhead without payoff. Mitigated by doing the withdrawal slice end-to-end first, tooling included.

  • The wallet extensions add vocabulary (:final-reactivatable:, :standard-edges:, modifier flags) that only wallet transaction entities use, slightly diluting the “one vocab fits all” property.

23.106.12. Discussion / Q&A#

Why not put triggers on the method files instead of the lifecycle? A method can honestly describe its own effects (and does, in Effects), but timer firings, watches of other components, and external human actions have no method file to live in. Causality is a property of the entity’s machine, so triggers live on transitions; the two-sided check with method effects keeps both honest.

Why is long-poll not a notification channel? A long-poll response is authoritative state delivered late; a notification is a hint that must be backed by a read. The delivery semantics, the lint rules, and the generated sequence-diagram edges differ. Conflating them would make “pull + long-poll only” components (the exchange) look like they offer push.

Why does the tax auditor have no credentials? That is the system as designed: the auditor’s access is authorized by possession of unguessable identifiers (wtid). The format makes this visible (capability annotations resolving to :capability: yes anchors) rather than hiding it in prose.

Are wallet transaction entities really “owned” by wallet-core if nothing calls wallet-core to drive them? Yes: ownership is about authoritative state and transition execution, not about the trigger kind. Wallet-core’s DB record is the truth; its transitions execute locally, driven by watches, timers, and user actions. The bank-owned withdrawal operation the wallet watches is a different entity with its own owner and machine — the two are joined by the watch trigger, which is exactly the cross-component causality link the old prose never made.