Skip to content

Contract Schemas Reference

Human-readable documentation for the JSON contracts that define jinflow’s stable interfaces.

Contracts are pack-specific in content but follow a common structure. The fields shown here are from the interlogic pack as a representative example. Other packs (alptrack, millesime) define different Gold entities but use the same contract format and the same findings/verdict/smebit/bitbundle/report contracts.

Contracts define the schema for each layer’s output. They are the stable API between layers — internal table schemas may change, but contract fields are guaranteed. Signals reference gold.v1 entities by contract name (e.g. Shipment, not gold_shipments). Perspectives reference findings.v1. Theses produce verdict statuses consumed by verdicts via diagnosis.v1. The compiler validates all entity and field references against contracts before generating SQL.

The 7 contracts form a dependency chain:

Purpose: Defines the source-system-agnostic canonical dataset that signals operate on.

Contract ID: interlogic.gold.v1

Entitydbt modelPrimary keyDescription
Shipmentgold_shipmentsshipment_keyShipments with origin/destination, value, and delivery tracking
ShipmentItemgold_shipment_itemsitem_keyLine items within a shipment with HS classification and value
Checkpointgold_checkpointscheckpoint_keyTracking events along the shipment journey with geo-location
Warehousegold_warehouseswarehouse_keyWarehouse and facility master data with capacity and location
Routegold_routesroute_keyPredefined logistics routes with origin/destination and planned transit
RouteLeggold_route_legsleg_keyIndividual segments of a multi-leg route with carrier and distance
Carriergold_carrierscarrier_keyCarrier master data with type, SLA tier, and regional coverage
Customergold_customerscustomer_keyCustomer master data with type and location
Containergold_containerscontainer_keyContainer master data with type and weight/volume limits
CustomsDeclarationgold_customs_declarationsdeclaration_keyCustoms filings with duty calculation and clearance status
InventorySnapshotgold_inventory_snapshotssnapshot_keyPoint-in-time warehouse inventory snapshots by item and lot
Incidentgold_incidentsincident_keyOperational incidents with severity, cost, and root cause tracking
TaxonomyNodegold_taxonomy_nodestaxonomy_node_keyHierarchical classification trees
TaxonomyMemberMappinggold_taxonomy_member_mappingstaxonomy_mapping_keyLinks taxonomy nodes to dimension members
TaxonomyClosuregold_taxonomy_closure(taxonomy_id, ancestor_node_id, descendant_node_id)All ancestor-descendant pairs for roll-up queries
FieldTypeNullableDescription
shipment_keyvarcharNoSurrogate key
shipment_idvarcharNoBusiness identifier for the shipment
shipment_refvarcharNoHuman-readable shipment reference
customer_idvarcharNoFK to Customer
route_idvarcharNoFK to Route
container_idvarcharYesFK to Container
transport_modevarcharNoMode of transport (sea/air/road/rail/multimodal)
ship_datedateNoDate the shipment was dispatched
expected_delivery_datedateNoExpected delivery date
actual_delivery_datedateYesActual delivery date
origin_countryvarcharNoCountry of origin
origin_cityvarcharNoCity of origin
origin_latdecimalNoOrigin latitude
origin_londecimalNoOrigin longitude
destination_countryvarcharNoDestination country
destination_cityvarcharNoDestination city
destination_latdecimalNoDestination latitude
destination_londecimalNoDestination longitude
declared_value_usddecimalNoDeclared shipment value in USD
weight_kgdecimalNoTotal weight in kilograms
volume_m3decimalNoTotal volume in cubic meters
incotermvarcharNoINCOTERM (EXW, FOB, CIF, etc.)
shipment_statusvarcharNoCurrent status (booked/in_transit/delivered/delayed/lost)
transit_daysintegerNoComputed actual transit days
FieldTypeNullableDescription
checkpoint_keyvarcharNoSurrogate key
checkpoint_idvarcharNoBusiness identifier for the checkpoint
shipment_idvarcharNoFK to Shipment
warehouse_idvarcharYesFK to Warehouse
checkpoint_sequenceintegerNoOrder in the shipment journey
checkpoint_typevarcharNoType (pickup/warehouse_in/customs_hold/customs_cleared/loaded/in_transit/arrived/warehouse_out/out_for_delivery/delivered)
checkpoint_statusvarcharNoStatus (completed/pending/skipped/exception)
checkpoint_timestamptimestampNoTimestamp of the checkpoint event
checkpoint_timezonevarcharNoTimezone of the checkpoint
latdecimalNoLatitude
londecimalNoLongitude
carrier_idvarcharYesFK to Carrier
notesvarcharYesFree-text notes
FieldTypeNullableDescription
declaration_keyvarcharNoSurrogate key
declaration_idvarcharNoBusiness identifier for the declaration
shipment_idvarcharNoFK to Shipment
declaration_typevarcharNoType (export/import/transit)
filing_datedateNoDate the declaration was filed
clearance_datedateYesDate the declaration was cleared
port_locodevarcharNoPort of filing UN/LOCODE
hs_codevarcharNoHarmonized System tariff code
declared_quantityintegerNoDeclared quantity
declared_value_usddecimalNoDeclared value in USD
duty_rate_pctdecimalNoDuty rate as percentage
duty_amount_usddecimalNoComputed duty amount in USD
declaration_statusvarcharNoStatus (filed/cleared/held/rejected)
FieldTypeNullableDescription
incident_keyvarcharNoSurrogate key
incident_idvarcharNoBusiness identifier for the incident
shipment_idvarcharNoFK to Shipment
incident_typevarcharNoType (delay/damage/loss/customs_hold/temperature_breach/documentation_error)
reported_timestamptimestampNoTimestamp when the incident was reported
resolved_timestamptimestampYesTimestamp when the incident was resolved
severityvarcharNoSeverity (critical/major/minor)
estimated_cost_usddecimalNoEstimated cost impact in USD
root_causevarcharYesRoot cause
notesvarcharYesFree-text notes

ShipmentItem (10 fields): item_key, item_id, shipment_id, description, hs_code, hs_description, quantity, unit, item_value_usd, country_of_origin.

Warehouse (10 fields): warehouse_key, warehouse_id, name, warehouse_type (distribution_center/port_terminal/customs_bonded/cross_dock/cold_storage), country, city, lat, lon, capacity_m3, un_locode.

Route (8 fields): route_key, route_id, route_name, origin_locode, destination_locode, transport_mode, planned_transit_days, leg_count.

RouteLeg (10 fields): leg_key, leg_id, route_id, leg_sequence, origin_locode, destination_locode, carrier_id, mode, planned_days, distance_km.

Carrier (6 fields): carrier_key, carrier_id, name, carrier_type (ocean_line/airline/trucking/rail/courier), sla_tier (premium/standard/economy), regions.

Customer (7 fields): customer_key, customer_id, name, customer_type (shipper/consignee/broker/manufacturer), country, city, since_year.

Container (6 fields): container_key, container_id, container_type (TEU/FEU/reefer/open_top/flat_rack), max_weight_kg, max_volume_m3, tare_weight_kg.

InventorySnapshot (9 fields): snapshot_key, snapshot_id, warehouse_id, item_description, hs_code, snapshot_timestamp, quantity_units, quantity_kg, lot_number.

TaxonomyNode (10 fields): taxonomy_node_key, taxonomy_id, node_id, parent_node_id, node_name, depth, materialized_path, is_leaf, data_source, is_backfilled.

TaxonomyMemberMapping (4 fields): taxonomy_mapping_key, taxonomy_id, node_id, dimension_type, dimension_member_id.

TaxonomyClosure (4 fields): taxonomy_id, ancestor_node_id, descendant_node_id, depth.

Purpose: Defines the validated domain layer with data quality flags — the same entities as Gold plus lineage and validation columns.

Contract ID: interlogic.silver.v1

Every Silver entity mirrors its Gold counterpart (same fields, same types) with four additional columns:

FieldTypeNullableDescription
source_filevarcharNoSource CSV file that produced this row
row_numberintegerNoRow number within the source file
is_validbooleanNoWhether the row passed all validation rules
invalid_reasonvarcharYesFirst validation rule that failed (null if valid)

Gold views filter to is_valid = true. Silver retains all rows so that silver_audit signals can inspect what Gold excluded.

The Silver contract defines 13 entities, one per Gold entity (excluding taxonomy entities which are tables, not views):

Silver entitySilver modelGold counterpart
SilverShipmentsilver_shipmentsShipment
SilverShipmentItemsilver_shipment_itemsShipmentItem
SilverCheckpointsilver_checkpointsCheckpoint
SilverWarehousesilver_warehousesWarehouse
SilverRoutesilver_routesRoute
SilverRouteLegsilver_route_legsRouteLeg
SilverCarriersilver_carriersCarrier
SilverCustomersilver_customersCustomer
SilverContainersilver_containersContainer
SilverCustomsDeclarationsilver_customs_declarationsCustomsDeclaration
SilverInventorySnapshotsilver_inventory_snapshotsInventorySnapshot
SilverIncidentsilver_incidentsIncident

Purpose: Defines the standard output schema for all signals and perspectives, enabling cross-signal aggregation and thesis evaluation.

Contract ID: interlogic.findings.v1

FieldTypeNullableDescription
finding_idstringNoUnique identifier for the finding
tenant_idstringNoTenant that produced this finding
probe_idstringNoSignal that generated this finding
probe_versionstringNoVersion of the signal
severitystringNoSeverity level (critical/high/medium/low/info)
entity_typestringNoGold entity type (e.g. Shipment, CustomsDeclaration)
entity_idstringNoBusiness ID of the flagged entity
time_bucketstringYesTime grouping (month, quarter, etc.)
money_at_riskdecimalYesMonetary impact in base currency
qty_at_riskdecimalYesQuantity impact
health_scoredecimalYesHealth score (0.0-1.0, perspectives only)
evidencestringNoJSON blob with signal-specific detail

dbt model pattern: signal_findings__* (one model per signal/perspective)

Primary key: finding_id

Purpose: Defines the output schema for root cause verdicts attached to confirmed theses.

Contract ID: interlogic.diagnosis.v1

FieldTypeNullableDescription
diagnosis_idstringNoUnique identifier for the verdict
tenant_idstringNoTenant scope
hypothesis_idstringNoThe confirmed thesis this verdict explains
root_cause_categorystringNoCategory (process_failure/system_failure/data_quality/behavioral/structural/external)
root_cause_idstringNoSpecific root cause identifier
confidencedecimalNoConfidence score (0.0-1.0), includes base + boosts
finding_countintegerNoNumber of signal findings supporting this verdict
money_at_riskdecimalYesTotal monetary impact from supporting findings
hypothesis_evidence_scoredecimalNoEvidence score from the parent thesis

dbt model: diagnosis_verdicts

Primary key: diagnosis_id

Purpose: Defines the registry and verdict schemas for atomic expert knowledge artifacts.

Contract ID: interlogic.smebit.v1

FieldTypeNullableDescription
smebit_idstringNoUnique identifier (matches YAML filename)
smebit_versionstringNoVersion string
provider_namestringNoName of the knowledge provider
provider_rolestringNoRole of the provider
provider_datestringNoDate the knowledge was provided
scope_tenant_idstringYesTenant scope (null = cross-tenant)
scope_source_systemstringYesSource system scope
scope_time_fromstringYesStart of applicable time range
scope_time_untilstringYesEnd of applicable time range
categorystringNoCategory (data_quality/mapping/business_rule/process/system/seasonal/historical/structural)
tagsstringYesComma-separated tags
statusstringNoLifecycle status
superseded_bystringYesID of the Subject Matter entry that replaces this one
has_checkbooleanNoWhether this Subject Matter entry has an executable check (Level 1)
has_prescriptionbooleanNoWhether this Subject Matter entry includes a prescription
prescription_typestringYesPrescription type (if applicable)
prescription_statusstringYesPrescription status (proposed/accepted/implemented)
subject_enstringNoSubject line (English)
subject_destringNoSubject line (German)
subject_frstringNoSubject line (French)
why_enstringYesExplanation of why (English)
why_destringYesExplanation of why (German)
why_frstringYesExplanation of why (French)
content_enstringNoFull content (English)
content_destringNoFull content (German)
content_frstringNoFull content (French)
anchor_probesstringYesComma-separated signal IDs
anchor_hypothesesstringYesComma-separated thesis IDs
anchor_entitiesstringYesComma-separated entity type references

dbt model: smebit_registry

Primary key: smebit_id

FieldTypeNullableDescription
verdict_idstringNoUnique verdict identifier
tenant_idstringNoTenant scope
smebit_idstringNoFK to Subject Matter registry
smebit_versionstringNoVersion of the Subject Matter entry
statusstringNoVerdict status (confirmed/violated/no_data)
evidencestringNoJSON blob with check-specific detail

dbt model pattern: smebit_verdicts__* (one per Level 1 Subject Matter entry)

Primary key: verdict_id

Purpose: Defines the registry and membership schemas for curated narrative groupings of SMEbits.

Contract ID: interlogic.bitbundle.v1

FieldTypeNullableDescription
bitbundle_idstringNoUnique identifier (matches YAML filename, starts with bb_)
bitbundle_versionstringNoVersion string
tenant_idstringYesTenant scope (null = cross-tenant)
curator_namestringNoName of the curator
curator_rolestringNoRole of the curator
datestringNoCuration date
title_enstringNoBundle title (English)
title_destringNoBundle title (German)
title_frstringNoBundle title (French)
narrative_enstringNoFull narrative (English)
narrative_destringNoFull narrative (German)
narrative_frstringNoFull narrative (French)
tagsstringYesComma-separated tags
statusstringNoLifecycle status (active/archived)
smebit_countintegerNoNumber of member Subject Matter entries

dbt model: bitbundle_registry

Primary key: bitbundle_id

FieldTypeNullableDescription
bitbundle_idstringNoFK to Dossier
smebit_idstringNoFK to Subject Matter
note_enstringYesContextual note for this link (English)
note_destringYesContextual note for this link (German)
note_frstringYesContextual note for this link (French)
sort_orderintegerNoDisplay order within the bundle

dbt model: bitbundle_memberships

Primary key: (bitbundle_id, smebit_id)

Purpose: Defines the output schema for compiled analytical reports (data payload and registry metadata).

Contract ID: interlogic.report.v1

FieldTypeNullableDescription
tenant_idstringNoTenant scope
report_idstringNoReport identifier
report_versionstringNoVersion of the report
sectionsjsonNoJSON array of section data payloads

dbt model pattern: report_data__* (one per report)

Primary key: None (one row per tenant per report)

FieldTypeNullableDescription
report_idstringNoUnique report identifier
report_versionstringNoVersion string
title_enstringNoReport title (English)
title_destringNoReport title (German)
title_frstringNoReport title (French)
description_enstringNoReport description (English)
description_destringNoReport description (German)
description_frstringNoReport description (French)
audiencejsonNoJSON array of target audiences
orientationstringNoPage orientation (portrait/landscape)
page_sizestringNoPage size (A4, letter, etc.)
sectionsjsonNoJSON array of section definitions
created_atstringNoCreation timestamp
modified_atstringNoLast modification timestamp
compiled_atstringNoCompilation timestamp

dbt model: report_registry

Primary key: report_id

Surrogate keys alongside business IDs. Every Gold entity has both a *_key (surrogate, generated via dbt_utils.generate_surrogate_key) and a *_id (business identifier from the source system). Surrogate keys are stable across rebuilds; business IDs are human-readable.

Tri-lingual support. All user-facing text fields come in _en, _de, _fr variants. This applies to Subject Matter subjects/content/why, Dossier titles/narratives, report titles/descriptions, and signal registry display text.

Quality tracking. Silver adds is_valid and invalid_reason to every entity. Invalid rows are retained (not silently dropped) so that data quality signals can inspect rejection patterns. Gold filters to is_valid = true.

Tenant isolation. Every fact and verdict table includes tenant_id. Findings, verdicts, Subject Matter verdicts, and report data are all scoped to a single tenant. Platform views union across tenants but preserve the tenant_id column.

Nullable fields explicitly marked. Foreign keys that represent optional relationships (e.g. container_id on Shipment, warehouse_id on Checkpoint) and fields that depend on process completion (e.g. actual_delivery_date, clearance_date, resolved_timestamp) are nullable. Required fields are never null in Gold.

JSON for structured evidence. The evidence field on ProbeFinding and SubjectMatterVerdict, and the sections field on ReportData/ReportRegistry, carry structured data as JSON strings. This keeps the table schema stable while allowing signal-specific and report-specific detail to evolve independently.

jazzisnow jinflow is a jazzisnow product
v0.45.1 · built 2026-04-17 08:14 UTC