Data engineering & quality

Build Sequence Features from the History a Request Could See

Register heterogeneous events, store their original granularity and compare read-time sequence contracts without training a sequence model.

Banking & PaymentsIndependent technical study

Source case: Coinbase. The article separates the published design from the data, methods and observations in this local experiment.

The same activity counts can describe different journeys

A payments team wants to investigate what happened before a request. One history contains a sign-in, a payee addition and then a transfer. Another contains a transfer before those other actions. Both can produce the same event counts. After aggregation, a model cannot recover the missing order merely by becoming more sophisticated.

There is a second problem. A transfer recorded with a 09:55 event timestamp might arrive at 10:05. A later warehouse reconstruction knows about it; a service handling a 10:00 request did not. Preserving sequence order while including that event would still describe the wrong information set.

Coinbase’s 13 May 2025 engineering article describes registered heterogeneous events, event-level storage and read-time sequence construction. It separates event selection, lookback, maximum length and freshness requirements. The published implementation connects Kafka and Delta Lake inputs through Tecton and Databricks to online and offline stores. This study implements a smaller storage/read contract, adding explicit historical visibility and duplicate handling as independent design choices.

Store reusable events instead of one irreversible aggregation

Coinbase's published diagram shows a registry, streaming and batch sources, feature computation, online and offline stores, and inference and training consumers.Open full-size diagram (opens in a new tab)

Coinbase's original architecture. Event registration and reusable storage are separate from the consumers requesting a particular sequence.

Source: Coinbase Engineering · 13 May 2025

The important boundary for my implementation is between preserving observations and choosing a representation. If ingestion immediately emits only a thirty-minute count, a later experiment with event order, a different window or amount metadata needs another upstream pipeline. Event-level storage keeps those alternatives available, at the cost of more history and read work.

My local path is deliberately concrete: registered source envelopes enter a normalizer; canonical rows and delivery dispositions enter SQLite; a reader applies a feature specification; the consumer receives ordered tokens, event metadata, ages and a padding mask. The same stored rows support the comparison paths below. No streaming framework, remote store or trained sequence encoder is needed to examine that boundary.

This is also why a registry is useful before a generic event table. It defines what each source’s fields mean, not just whether a JSON record can be parsed. The payment account and authentication user happen to share the fixture’s A/B identifiers. Resolving those identifiers across actual banking systems would be a separate upstream responsibility.

Make event identity and availability explicit

The authored input has thirteen deliveries from authentication, payments and security. Their envelopes disagree on field names: authentication uses user, at and kind; payments uses account, occurred and operation. A registered source/version mapping converts these into a common entity, event type, timestamp and typed metadata. The mapping itself is stored in SQLite and its hash accompanies each canonical event.

There are ten stored events. One exact retransmission does not create another event or move its first receipt time. Another delivery reuses an existing payment event ID with a different payee; it is recorded as a conflict without replacing the original. An unregistered authentication schema is rejected. This is an immutable-event policy, not a general correction protocol: a real amendment would require explicit revision or retraction semantics.

Two clocks answer different questions. event_at says when the producer reports the action. available_at is this experiment’s trusted host receipt time. It is not accepted from the producer body. The replay assumes immediate usability at receipt; a real service would need to capture completed processing and downstream visibility rather than borrowing a convenient warehouse timestamp.

Keeping the duplicate’s first receipt is consequential. Replacing it with the most recent retransmission would make an originally available event appear unavailable during historical replay. Conversely, silently backdating a late delivery would introduce information the service never possessed.

Metadata remains attached to its event: an integer minor-unit amount and currency belong to the transfer that supplied them. They are not flattened into a bag of unrelated values. The current token array encodes event type only; a numerical or categorical metadata encoder remains a separate consumer design.

Select by two clocks, then truncate in a declared order

The actual reader below fixes a half-open event window, applies historical visibility and only then retains the last N rows. It selects newest rows efficiently for the length cap and reverses the selected rows into chronological output. The additional source/ID tie-break makes simultaneous timestamps reproducible; it does not establish a causal ordering between them.

Actual SQLite selection: event window, visibility and last-N are separate decisionsPython19 lines
def select_events(db, entity, as_of, window_seconds, length, visible=True):
    if (type(window_seconds) is not int or window_seconds <= 0
            or type(length) is not int or not 1 <= length <= 64):
        raise ValueError("invalid_sequence_spec")
    if type(visible) is not bool:
        raise ValueError("invalid_visibility_flag")
    at = epoch(as_of)
    predicates = "entity=? AND event_at>=? AND event_at<?"
    parameters = [entity, at - window_seconds, at]
    if visible:
        predicates += " AND available_at<=?"
        parameters.append(at)
    count_sql = "SELECT COUNT(*) FROM events WHERE " + predicates
    count = db.execute(count_sql, parameters).fetchone()[0]
    sql = ("SELECT source,event_id,event_type,event_at,available_at,metadata "
           "FROM events WHERE " + predicates
           + " ORDER BY event_at DESC,source DESC,event_id DESC LIMIT ?")
    rows = db.execute(sql, parameters + [length]).fetchall()[::-1]
    return count, rows

The fixture’s request is fixed at 10:00 UTC. Account A’s 09:55 transfer arrives at 10:05. Reading the fully populated store by event time alone produces four events; adding the availability condition leaves three. An event at 10:02 is excluded by either method, because it lies beyond the request’s event-time boundary.

Actual sequence reads: retrospective A includes an unavailable transfer; visible A and B differ at length five but share their last three event-type tokens.Open full-size figure (opens in a new tab)
Generated from actual SQLite outputs. The highlighted transfer is unavailable at the request. The last-three comparison concerns token arrays; the complete feature packets still have different event ages.

An as-of read is therefore not interchangeable with sorting today’s complete history. It answers a narrower question about recorded visibility. It cannot infer an event that never arrived, correct a wrong producer timestamp or prove that both source clocks were synchronized.

Test what each representation has deliberately discarded

For the order comparison, use complete retained histories: retrospective A and visible B each contain one sign-in, payee addition, transfer and OTP confirmation. Their full count vectors are identical. An authored temporal predicate asks whether a payee addition precedes a transfer within ten minutes. It is true for A and false for B.

Any predictor receiving only those count vectors must treat these inputs identically, assuming its other features are equal. A sequence can distinguish them. That is a representational argument, not evidence that the order predicts fraud, approval or customer intent. A useful count/rate model could still outperform a more expensive sequence model if this extra information is irrelevant or too sparse.

Length and lookback discard information differently:

SpecificationActual visible outputConsequence
Thirty-minute window, last fiveA retains three events; B retains fourB’s earlier transfer remains available
Thirty-minute window, last threeBoth token arrays become sign-in → payee → OTPEarlier context disappears; event ages still distinguish the packets
Ten-minute window, last fiveA retains two events; B retains threeThe window removes older actions even though capacity remains

Increasing N would not recover an event outside the window. Increasing the window would not recover an event displaced by a small N during a busy session. A fixed length also represents very different elapsed time for a quiet account and a high-activity account. Recording eligible and truncated counts makes that loss inspectable instead of hiding it inside an array.

Padding introduces another semantic choice. A’s length-five tokens are [0,0,1,3,5], with mask [0,0,1,1,1] and ages [null,null,1200,600,120]. Padding positions contain no observation; they do not mean two inactive actions. A downstream consumer must respect the mask. Merely returning it does not demonstrate that a future model uses it correctly.

Make the next modelling decision conditional on the consumer

For a banking application, I would begin with a concrete decision and its allowed history: for example, preparing evidence for a transfer-review analyst from account events already available at that request. The sequence would be an input to investigation or modelling, not an instruction to block or approve a payment.

The first candidate comparison would retain a regularized count/rate baseline, add a few interpretable temporal features, then consider a sequence encoder if the labels and sample size justify it. All variants would use the same request identities, visibility rule and outcome horizon. Splitting chronologically and grouping related identities where appropriate would matter more than demonstrating that a deep architecture accepts the tensor shape.

The feature contract would pin vocabulary, registry mappings, event selection, time window, N, ordering, metadata units and padding. A mapping change can alter historical semantics; a longer N changes the consumer’s shape and cost. Neither should silently reuse an old trained artifact. Historical source corrections would require an explicit policy rather than overwriting evidence that a previous request consumed.

Operationally, I would inspect delay distributions, truncation by activity level, unknown schemas and event-to-entity mapping failures before selecting storage retention or a serving budget. These are proposed production measurements. The thirteen-delivery replay establishes none of their population frequencies and contains no latency, throughput or outcome benchmark.

My decision here is to keep the flexible event substrate and a strict read specification. It remains reasonable to serve aggregates from that substrate. Preserving the option to learn from sequences is valuable; claiming that the option has already improved predictions would go beyond the experiment.

Inspect the saved reads and reproduce the construction

The standard-library runner creates the SQLite database, ingests the heterogeneous deliveries and recomputes every comparison and figure. The saved record includes event IDs, timestamps, aligned packets and input/code hashes. All examples are authored diagnostics; there is no held-out sample, external model call or Coinbase event data.

Recorded construction, limitations and offline commands

Recorded experiment

What the experiment actually shows

Independent SQLite sequence-feature construction over authored fictional events; no trained model or Coinbase production data.

Data and comparison boundary

Methods compared

Retrospective event-time read
Half-open 30-minute event-time window, ignoring when the server received each event.
Historical visibility read
The identical event-time window additionally requires first host receipt at or before the request.
Representation comparisons
Compare full retained-event counts with chronological order, then last-three/last-five and 10-/30-minute specifications. No predictive model is fitted.

Recorded findings

Ingestion
10 stored / 13 deliveries

One retransmission is deduplicated; one conflicting identity and one unknown schema are held in the delivery log.

Historical visibility
3 visible versus 4 retrospective

A's 09:55 transfer arrives at 10:05, after the 10:00 request. A later 10:02 event is outside both reads.

Count compression
Same counts, different temporal predicate

Retrospective A and visible B each contain the same four event types once. Only A contains payee addition followed by transfer within ten minutes.

Length compression
Last-three token arrays collide

Visible A and B both end [1,3,5]. Length five retains B's earlier transfer and records distinct masks and ages; even last-three ages differ.

Window choice
A: 3 → 2; B: 4 → 3

Reducing the visible event window from 30 to 10 minutes removes different context in each history. No outcome labels establish a best window.

Inspect a recorded example

A request at 10:00 cannot use a transfer received at 10:05
Input

A; event window [09:30,10:00); full later store

Baseline output

sign_in → payee_added → transfer_requested → otp_confirmed

Candidate output

sign_in → payee_added → otp_confirmed

These are saved results. Switching examples runs no model or external service.

Limits of this experiment

  • Known authored examples have no predictive labels, natural traffic distribution or statistical performance estimate.
  • The canonical A/B identity is explicit fixture data, not account/user entity resolution.
  • available_at is a trusted authored host receipt clock. Real processing completion, replication and outage histories are not simulated.
  • An immutable source-scoped ID rejects amendments; production correction/retraction semantics would need a separate design.
  • SQLite replay is not Kafka/Tecton/Databricks/DynamoDB, a live serving system or an online/offline consistency benchmark.
  • Padding is metadata, not inactivity; a downstream model must consume the mask and preserve vocabulary/specification versions.
Inspect the recorded provenance
{
  "sources": {
    "csv_row": 15,
    "title": "How Coinbase Builds Sequence Features for Machine Learning",
    "url": "https://www.coinbase.com/en-ar/blog/how-coinbase-builds-sequence-features-for-machine-learning",
    "published": "2025-05-13",
    "checked": "2026-12-01",
    "adapted": [
      "Registered heterogeneous event schemas",
      "Event-level storage with read-time sequence construction",
      "Explicit event selection, window and maximum length"
    ],
    "independent_extensions": [
      "Historical visibility using host receipt time",
      "Immutable event-ID duplicate/conflict handling",
      "Explicit padding/mask protocol and count-vs-order diagnostic"
    ],
    "not_reproduced": "No Coinbase events, streaming platform, Tecton, Databricks, DynamoDB, sequence-model training or fraud/recommendation result.",
    "original_diagram": {
      "url": "https://images.ctfassets.net/sygt3q11s4a9/24UQh4GBk4zE1FkwXPEeYe/853f1d467c0a2fdebd03f0b07528a2f8/computing_sequence_features.png",
      "width": 1267,
      "height": 458,
      "sha256": "45b3da227a90b5eddd05c8aec4ba81515b68227202d8020deba40aa956df4c84"
    }
  },
  "sha256": {
    "core.py": "b831d85cd6b00a36f7bfdff781afdfca803cf469c2af14096dd2ce9e6eef706e",
    "run.py": "acef789e2c68166ed3cf168b0a7ab3f4554731a36bdade382fb7e60be05cc161",
    "registry.json": "910ae784574c7423c50fb614d2f375eedacdaa12969eeabfc13f218cc2dac244",
    "deliveries.json": "bde3d98c6ad6acfe1762f6aaa2fda6d69ec9bc455e003aa04cfc5694ee6db829",
    "protocol.json": "48410b3d00f923f81742ae77caab901bd2381b8d7d5e8be65da011c27a3890c1",
    "sources.json": "d7519443902a6fa5c1874fd32c87ab46ddebf00f1a572e576314269ccf7a282d"
  },
  "clock_contract": "UTC; fixture host receipt is authoritative for this replay",
  "observations": {
    "protocol": {
      "as_of": "2026-12-01T10:00:00Z",
      "window_seconds": 1800,
      "lengths": [
        3,
        5
      ],
      "short_window_seconds": 600,
      "half_open_window": "[as_of-window, as_of)",
      "padding": "left",
      "receipt_order": "received_at, delivery_id",
      "event_order": "event_at, source, event_id",
      "contract": "An immutable source-scoped event ID; identical retransmissions retain first receipt time. Conflicting revisions are rejected, not silently merged."
    },
    "delivery_results": [
      {
        "delivery_id": "D01",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D02",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D03",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D04",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D05",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D06",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D07",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D08",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D09",
        "status": "rejected",
        "detail": "unregistered_schema"
      },
      {
        "delivery_id": "D10",
        "status": "duplicate",
        "detail": "Original canonical event and first receipt retained."
      },
      {
        "delivery_id": "D11",
        "status": "conflict",
        "detail": "Original canonical event and first receipt retained."
      },
      {
        "delivery_id": "D12",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      },
      {
        "delivery_id": "D13",
        "status": "inserted",
        "detail": "Registered event stored at event granularity."
      }
    ],
    "ingestion_counts": {
      "conflict": 1,
      "duplicate": 1,
      "inserted": 10,
      "rejected": 1
    },
    "canonical_event_count": 10,
    "original_payee": {
      "available_at": 1796118601,
      "metadata": {
        "payee_id": "P-A"
      }
    },
    "sequences": {
      "A_visible_3": {
        "entity": "A",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 3,
        "availability_filter": true,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 3,
        "truncated_events": 0,
        "events": [
          {
            "source": "authentication",
            "event_id": "A-login",
            "type": "sign_in",
            "event_at": 1796118000,
            "available_at": 1796118001,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "A-payee",
            "type": "payee_added",
            "event_at": 1796118600,
            "available_at": 1796118601,
            "metadata": {
              "payee_id": "P-A"
            }
          },
          {
            "source": "security",
            "event_id": "A-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119081,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          1,
          3,
          5
        ],
        "mask": [
          1,
          1,
          1
        ],
        "age_seconds": [
          1200,
          600,
          120
        ]
      },
      "A_visible_5": {
        "entity": "A",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 5,
        "availability_filter": true,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 3,
        "truncated_events": 0,
        "events": [
          {
            "source": "authentication",
            "event_id": "A-login",
            "type": "sign_in",
            "event_at": 1796118000,
            "available_at": 1796118001,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "A-payee",
            "type": "payee_added",
            "event_at": 1796118600,
            "available_at": 1796118601,
            "metadata": {
              "payee_id": "P-A"
            }
          },
          {
            "source": "security",
            "event_id": "A-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119081,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          0,
          0,
          1,
          3,
          5
        ],
        "mask": [
          0,
          0,
          1,
          1,
          1
        ],
        "age_seconds": [
          null,
          null,
          1200,
          600,
          120
        ]
      },
      "A_retrospective_3": {
        "entity": "A",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 3,
        "availability_filter": false,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 4,
        "truncated_events": 1,
        "events": [
          {
            "source": "payments",
            "event_id": "A-payee",
            "type": "payee_added",
            "event_at": 1796118600,
            "available_at": 1796118601,
            "metadata": {
              "payee_id": "P-A"
            }
          },
          {
            "source": "payments",
            "event_id": "A-transfer",
            "type": "transfer_requested",
            "event_at": 1796118900,
            "available_at": 1796119500,
            "metadata": {
              "amount_minor": 1500,
              "currency": "EUR"
            }
          },
          {
            "source": "security",
            "event_id": "A-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119081,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          3,
          4,
          5
        ],
        "mask": [
          1,
          1,
          1
        ],
        "age_seconds": [
          600,
          300,
          120
        ]
      },
      "A_retrospective_5": {
        "entity": "A",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 5,
        "availability_filter": false,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 4,
        "truncated_events": 0,
        "events": [
          {
            "source": "authentication",
            "event_id": "A-login",
            "type": "sign_in",
            "event_at": 1796118000,
            "available_at": 1796118001,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "A-payee",
            "type": "payee_added",
            "event_at": 1796118600,
            "available_at": 1796118601,
            "metadata": {
              "payee_id": "P-A"
            }
          },
          {
            "source": "payments",
            "event_id": "A-transfer",
            "type": "transfer_requested",
            "event_at": 1796118900,
            "available_at": 1796119500,
            "metadata": {
              "amount_minor": 1500,
              "currency": "EUR"
            }
          },
          {
            "source": "security",
            "event_id": "A-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119081,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          0,
          1,
          3,
          4,
          5
        ],
        "mask": [
          0,
          1,
          1,
          1,
          1
        ],
        "age_seconds": [
          null,
          1200,
          600,
          300,
          120
        ]
      },
      "A_short_window": {
        "entity": "A",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 600,
        "max_length": 5,
        "availability_filter": true,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 2,
        "truncated_events": 0,
        "events": [
          {
            "source": "payments",
            "event_id": "A-payee",
            "type": "payee_added",
            "event_at": 1796118600,
            "available_at": 1796118601,
            "metadata": {
              "payee_id": "P-A"
            }
          },
          {
            "source": "security",
            "event_id": "A-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119081,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          0,
          0,
          0,
          3,
          5
        ],
        "mask": [
          0,
          0,
          0,
          1,
          1
        ],
        "age_seconds": [
          null,
          null,
          null,
          600,
          120
        ]
      },
      "B_visible_3": {
        "entity": "B",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 3,
        "availability_filter": true,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 4,
        "truncated_events": 1,
        "events": [
          {
            "source": "authentication",
            "event_id": "B-login",
            "type": "sign_in",
            "event_at": 1796118600,
            "available_at": 1796118602,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "B-payee",
            "type": "payee_added",
            "event_at": 1796118900,
            "available_at": 1796118901,
            "metadata": {
              "payee_id": "P-B"
            }
          },
          {
            "source": "security",
            "event_id": "B-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119082,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          1,
          3,
          5
        ],
        "mask": [
          1,
          1,
          1
        ],
        "age_seconds": [
          600,
          300,
          120
        ]
      },
      "B_visible_5": {
        "entity": "B",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 5,
        "availability_filter": true,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 4,
        "truncated_events": 0,
        "events": [
          {
            "source": "payments",
            "event_id": "B-transfer",
            "type": "transfer_requested",
            "event_at": 1796118000,
            "available_at": 1796118002,
            "metadata": {
              "amount_minor": 1500,
              "currency": "EUR"
            }
          },
          {
            "source": "authentication",
            "event_id": "B-login",
            "type": "sign_in",
            "event_at": 1796118600,
            "available_at": 1796118602,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "B-payee",
            "type": "payee_added",
            "event_at": 1796118900,
            "available_at": 1796118901,
            "metadata": {
              "payee_id": "P-B"
            }
          },
          {
            "source": "security",
            "event_id": "B-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119082,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          0,
          4,
          1,
          3,
          5
        ],
        "mask": [
          0,
          1,
          1,
          1,
          1
        ],
        "age_seconds": [
          null,
          1200,
          600,
          300,
          120
        ]
      },
      "B_retrospective_3": {
        "entity": "B",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 3,
        "availability_filter": false,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 4,
        "truncated_events": 1,
        "events": [
          {
            "source": "authentication",
            "event_id": "B-login",
            "type": "sign_in",
            "event_at": 1796118600,
            "available_at": 1796118602,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "B-payee",
            "type": "payee_added",
            "event_at": 1796118900,
            "available_at": 1796118901,
            "metadata": {
              "payee_id": "P-B"
            }
          },
          {
            "source": "security",
            "event_id": "B-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119082,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          1,
          3,
          5
        ],
        "mask": [
          1,
          1,
          1
        ],
        "age_seconds": [
          600,
          300,
          120
        ]
      },
      "B_retrospective_5": {
        "entity": "B",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 1800,
        "max_length": 5,
        "availability_filter": false,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 4,
        "truncated_events": 0,
        "events": [
          {
            "source": "payments",
            "event_id": "B-transfer",
            "type": "transfer_requested",
            "event_at": 1796118000,
            "available_at": 1796118002,
            "metadata": {
              "amount_minor": 1500,
              "currency": "EUR"
            }
          },
          {
            "source": "authentication",
            "event_id": "B-login",
            "type": "sign_in",
            "event_at": 1796118600,
            "available_at": 1796118602,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "B-payee",
            "type": "payee_added",
            "event_at": 1796118900,
            "available_at": 1796118901,
            "metadata": {
              "payee_id": "P-B"
            }
          },
          {
            "source": "security",
            "event_id": "B-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119082,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          0,
          4,
          1,
          3,
          5
        ],
        "mask": [
          0,
          1,
          1,
          1,
          1
        ],
        "age_seconds": [
          null,
          1200,
          600,
          300,
          120
        ]
      },
      "B_short_window": {
        "entity": "B",
        "as_of": "2026-12-01T10:00:00Z",
        "window_seconds": 600,
        "max_length": 5,
        "availability_filter": true,
        "vocabulary_id": "fictional-event-tokens-v1",
        "eligible_events": 3,
        "truncated_events": 0,
        "events": [
          {
            "source": "authentication",
            "event_id": "B-login",
            "type": "sign_in",
            "event_at": 1796118600,
            "available_at": 1796118602,
            "metadata": {
              "method": "password"
            }
          },
          {
            "source": "payments",
            "event_id": "B-payee",
            "type": "payee_added",
            "event_at": 1796118900,
            "available_at": 1796118901,
            "metadata": {
              "payee_id": "P-B"
            }
          },
          {
            "source": "security",
            "event_id": "B-otp",
            "type": "otp_confirmed",
            "event_at": 1796119080,
            "available_at": 1796119082,
            "metadata": {
              "channel": "app"
            }
          }
        ],
        "tokens": [
          0,
          0,
          1,
          3,
          5
        ],
        "mask": [
          0,
          0,
          1,
          1,
          1
        ],
        "age_seconds": [
          null,
          null,
          600,
          300,
          120
        ]
      }
    },
    "comparison": {
      "A_visible_events": 3,
      "A_retrospective_events": 4,
      "retrospective_A_and_visible_B_same_counts": true,
      "shared_counts": {
        "otp_confirmed": 1,
        "payee_added": 1,
        "sign_in": 1,
        "transfer_requested": 1
      },
      "retrospective_A_payee_then_transfer": true,
      "visible_A_payee_then_transfer": false,
      "visible_B_payee_then_transfer": false,
      "visible_last3_token_collision": true,
      "visible_last5_token_collision": false
    }
  },
  "new_model_calls": 0
}

From the repository root:

python3 engineering-lab/coinbase-sequences/run.py
python3 engineering-lab/coinbase-sequences/verify.py
python3 engineering-lab/coinbase-sequences/smoke.py

In a standalone copy of the allowlisted directory, run the same three filenames without the directory prefix. run.py regenerates observations and the result figure. verify.py checks a fresh replay; smoke.py checks a few independent protocol boundaries. The primary article and source manifest distinguish the published architecture from the receipt, identity and mask policies developed here.