Data contracts#
Generated runs are portable Parquet artifacts with a JSON manifest. The manifest records the effective configuration, seed, schema versions, counts, and fingerprints needed to reproduce or audit a run.
Artifact |
Grain |
Purpose |
|---|---|---|
|
One row per entity |
Customers, accounts, cards, merchants, devices, and institutions. |
|
One row per payment |
Business payment identity, parties, rail, amount, and timestamps. |
|
One row per lifecycle event |
Authorization, settlement, reversal, refund, and return events. |
|
One row per ledger posting |
Balanced financial postings for every settled movement. |
|
One row per fraud attempt |
Scenario and campaign truth retained in the oracle boundary. |
|
One row per prediction entity/time |
Point-in-time-safe features, labels, and split metadata. |
The operational view never exposes future labels or latent campaign links.
Oracle sidecars are explicitly named and should be used only for evaluation or
audit. The Avro payment-event contracts are versioned under
contracts/avro/payment-event and are validated by the schema registry
commands described in CLI reference.
Output directory layout#
Persisted runs use this stable layout. Optional directories are omitted when their configuration section is disabled.
RUN-.../
├── manifest.json
├── entities/{customers,accounts,cards,merchants,devices,institutions}.parquet
├── payments/{payments,payment_events}.parquet
├── ledger/ledger_entries.parquet
├── fraud/{fraud_records,alerts,cases}.parquet
├── labels/{observed_labels,label_history}.parquet
├── ml/dataset.parquet
├── graph/{nodes,edges,evidence}.parquet
├── scale/checkpoint.json
├── kafka-chaos/{manifest.json,envelopes.jsonl}
└── schemas/...
The manifest is the join point for every artifact. It records the effective configuration, package/schema versions, seed, row counts, and fingerprints. Do not compare files from different runs without first comparing their source run and configuration fingerprints.
Core column contracts#
The following tables document the stable columns used by the most common
workflows. Parquet types are represented using Polars terminology; nullable
columns are marked yes. The schema files and generated model reference are
authoritative if a table and a release differ.
Payments#
Column |
Type |
Nullable |
Meaning and timing |
|---|---|---|---|
|
|
no |
Stable business identity for the payment. |
|
|
no |
Payer ownership at payment creation. |
|
|
yes |
Destination identity when the rail provides it. |
|
|
no |
Configured rail such as |
|
|
no |
Positive currency amount in the generated currency. |
|
|
no |
Currency code associated with |
|
|
no |
Business time; it is not an ingestion timestamp. |
|
|
no |
Earliest operational availability boundary. |
Payment lifecycle events#
Column |
Type |
Nullable |
Meaning |
|---|---|---|---|
|
|
no |
Stable event identity used for deduplication. |
|
|
no |
Parent payment identity. |
|
|
no |
Lifecycle state such as authorization, settlement, refund, or reversal. |
|
|
no |
Domain occurrence time. |
|
|
no |
Source-system creation time. |
|
|
no |
Time at which a point-in-time consumer may observe the event. |
|
|
no |
Transport and processing timestamps; these may differ from event time. |
Ledger and labels#
Ledger rows are one posting per financial movement. payment_id and
entry_id identify the business movement and posting; account_id,
direction, amount, currency, and posted_at describe the
double-entry leg. A valid settled movement balances debits and credits.
Observed label rows are versioned by label_id/label_version and carry
label_available_at. label describes the observed classification,
whereas oracle fraud records can contain latent scenario and campaign truth.
Point-in-time datasets may use only versions whose availability is no later
than prediction_time.
Artifact |
Key columns |
Timing/visibility |
|---|---|---|
|
|
Entity snapshot; observable unless marked oracle-only |
|
|
Parent references must resolve in the same run |
|
|
Card lifecycle timestamps define availability |
|
|
Merchant attributes available from source creation |
|
|
Device history is observable only up to the selected cutoff |
|
|
Stable reference data for account and transfer relationships |
Artifact |
Required identity/grain |
Oracle boundary |
|---|---|---|
|
|
Scenario truth and campaign membership are oracle-only |
|
|
Operational workflow; no latent truth required |
|
|
Operational case lifecycle |
|
label identity/version and |
Observable label projection; may be unresolved or corrected |
|
all label versions and corrections |
Oracle/audit sidecar; never use as an online feature |
Scale checkpoints contain resolved configuration and seed-tree fingerprints, shard/chunk descriptors, completed ranges, row counts, and checksums. A checkpoint is valid only with the same package/schema compatibility policy; do not edit it manually or mix it with a different configuration.
ML and graph contracts#
ml/dataset.parquet has one row per prediction entity/time and includes the
entity key, prediction_time, feature columns, label state, split name, and
source/run fingerprints. Feature values must be available at prediction time;
future labels and oracle-only campaign fields are excluded from the observable
view.
Graph tables preserve provenance. Nodes have a stable node_id and entity
type; edges have source/target IDs, relation type, event_time, and source
event/payment IDs. as_of and interval filters define temporal visibility.
Oracle evidence and hyperedge sidecars are evaluation artifacts, not
operational features.
Avro and transport contracts#
Avro schemas live under contracts/avro/<subject>/<version>.avsc and the
registry metadata is in contracts/avro/registry.yaml. The observable
payment-event contract includes required identity, timing, producer, rail,
and amount fields plus nullable scenario/entity references. Timestamps are
UTC timestamp-micros values and amounts use decimal precision 18/scale 2.
New optional fields require reader defaults and must remain FULL_TRANSITIVE
compatible. A breaking change uses a new major subject and leaves the previous
subject immutable. Validate before publication:
$ fraudtwin schema validate
Drift and chaos reports#
Drift reports record reference/comparison window names, input fingerprints,
sample counts, metric method, threshold, alert status, and label policy. Chaos
kafka-chaos/manifest.json records seed/configuration, input/output fingerprints, envelope
identity, topic/partition, attempt, scheduled/delivered timestamps, and counts
for dropped, retried, duplicated, delayed, reordered, late, and deduplicated
records. These report schemas are experimental and must be version-pinned when
used in an automated alert pipeline.
Contract verification checklist#
Before sharing an artifact, verify:
the manifest references the intended package and contract versions;
row counts and fingerprints match the generated files;
business IDs are unique at their documented grain;
timestamps include timezone and availability semantics;
observable outputs do not contain oracle-only truth;
Avro fingerprints and compatibility checks pass;
the output directory contains no credentials or service state.