# jtc-byte/zmeta-spec architecture

> Architecture diagram of the GitHub repository jtc-byte/zmeta-spec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jtc-byte/zmeta-spec
- Repository: https://github.com/jtc-byte/zmeta-spec

## Overview

ZMeta is a transport-agnostic semantic contract and reference stack for translating heterogeneous ISR data into a shared event model, enforcing its schema and policy, and mapping events to downstream formats. The principal workflow is source-format ingress, ZMeta event validation at the gateway, then consumer-facing projection or egress; the README also documents the OBSERVATION → INFERENCE → FUSION → STATE → COMMAND authority stages and cross-cutting SYSTEM events. Edges use README statements or sampled source/index references; unsampled runtime wiring is not inferred.

Main entry points: [`schema/proto/zmeta_event_v1.proto`](https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto) (OBSERVATION events), [`adapters/ingress/time_utils.py`](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/time_utils.py) (Timing normalization), [`adapters/ingress/mavlink/mavlink_to_zmeta_template.py`](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/mavlink/mavlink_to_zmeta_template.py) (MAVLink ingress), [`adapters/ingress/sapient/sapient_to_zmeta.py`](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/sapient/sapient_to_zmeta.py) (SAPIENT ingress)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_adapters["Format adapters"]
  node_ingress_air["Air and maritime ingress<br/>[adsb_to_zmeta.py]"]
  node_ingress_rf["RF sensor ingress<br/>[kraken_to_zmeta.py]"]
  node_ingress_cv["EO/CV ingress<br/>[eo_cv_to_zmeta.py]"]
  node_ingress_mavlink["MAVLink ingress"]
  node_ingress_sapient["SAPIENT ingress"]
  node_timing["Timing normalization<br/>[time_utils.py]"]
  node_sapient_registration["Registration state"]
end

subgraph group_gateway["Gateway enforcement"]
  node_gateway_runtime["Gateway runtime<br/>[gateway.py]"]
  node_validation["Schema and policy validation<br/>[validators.py]"]
end

subgraph group_semantics["Event semantics"]
  node_observation["OBSERVATION events"]
  node_inference["INFERENCE events"]
  node_fusion["FUSION events"]
  node_state["STATE events"]
  node_command["COMMAND events"]
  node_system["SYSTEM events"]
  node_track_projection["Track projection<br/>[track_projector.py]"]
end

subgraph group_encoding["Wire encodings"]
  node_cbor["CBOR encoding<br/>[zmeta_cbor.py]"]
  node_compact["Compact encoding<br/>[zmeta_compact.py]"]
  node_protobuf["Protobuf encoding<br/>[zmeta_proto.py]"]
end

subgraph group_egress["Consumer egress"]
  node_cot_egress["CoT egress<br/>[zmeta_to_cot.py]"]
  node_other_egress["Other format egress"]
end

node_sensors(("Sensors and producers"))
node_consumers(("Gateway clients and mission systems"))

node_sensors -->|"supplies formats"| node_ingress_air
node_sensors -->|"supplies formats"| node_ingress_rf
node_sensors -->|"supplies detections"| node_ingress_cv
node_sensors -.->|"supplies telemetry"| node_ingress_mavlink
node_sensors -.->|"supplies messages"| node_ingress_sapient
node_ingress_air -->|"normalizes timing"| node_timing
node_ingress_rf -->|"normalizes timing"| node_timing
node_ingress_cv -->|"normalizes timing"| node_timing
node_ingress_mavlink -->|"normalizes timing"| node_timing
node_ingress_sapient -->|"normalizes timing"| node_timing
node_ingress_sapient -->|"uses registration"| node_sapient_registration
node_ingress_air -->|"translates to"| node_observation
node_ingress_rf -->|"translates to"| node_observation
node_ingress_cv -->|"translates to"| node_observation
node_ingress_mavlink -->|"translates to"| node_state
node_ingress_mavlink -->|"translates to"| node_system
node_ingress_sapient -->|"translates to"| node_observation
node_observation -->|"derives with lineage"| node_inference
node_inference -->|"contributes to"| node_fusion
node_fusion -->|"projects to"| node_state
node_state -->|"justifies"| node_command
node_system -->|"cross-cuts"| node_state
node_observation -->|"enters gateway"| node_gateway_runtime
node_gateway_runtime -->|"validates events"| node_validation
node_gateway_runtime -->|"forwards validated output"| node_consumers
node_state -->|"projects tracks"| node_track_projection
node_state -->|"maps to CoT"| node_cot_egress
node_command -->|"maps mission intent"| node_other_egress
node_consumers -->|"receives CoT"| node_cot_egress
node_consumers -->|"receives mappings"| node_other_egress
node_observation -->|"encodes event"| node_cbor
node_observation -->|"encodes event"| node_compact
node_observation -->|"encodes event"| node_protobuf
node_compact -->|"uses CBOR encoding"| node_cbor

click node_ingress_air "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/adsb/adsb_to_zmeta.py"
click node_ingress_rf "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/kraken/kraken_to_zmeta.py"
click node_ingress_cv "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/eo-cv/eo_cv_to_zmeta.py"
click node_ingress_mavlink "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/mavlink/mavlink_to_zmeta_template.py"
click node_ingress_sapient "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/sapient/sapient_to_zmeta.py"
click node_timing "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/time_utils.py"
click node_sapient_registration "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/sapient/registration_state.py"
click node_gateway_runtime "https://github.com/jtc-byte/zmeta-spec/blob/main/gateway/src/gateway.py"
click node_validation "https://github.com/jtc-byte/zmeta-spec/blob/main/gateway/src/validators.py"
click node_observation "https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto"
click node_inference "https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto"
click node_fusion "https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto"
click node_state "https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto"
click node_command "https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto"
click node_system "https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto"
click node_track_projection "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/projector/track/track_projector.py"
click node_cbor "https://github.com/jtc-byte/zmeta-spec/blob/main/zmeta_cbor.py"
click node_compact "https://github.com/jtc-byte/zmeta-spec/blob/main/zmeta_compact.py"
click node_protobuf "https://github.com/jtc-byte/zmeta-spec/blob/main/zmeta_proto.py"
click node_cot_egress "https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/egress/cot/zmeta_to_cot.py"
click node_other_egress "https://github.com/jtc-byte/zmeta-spec/tree/main/adapters/egress"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ingress_air,node_ingress_rf,node_ingress_cv,node_ingress_mavlink,node_ingress_sapient,node_timing,node_sapient_registration,node_consumers toneBlue
class node_gateway_runtime,node_validation toneAmber
class node_observation,node_inference,node_fusion,node_state,node_command,node_system,node_track_projection toneMint
class node_cbor,node_compact,node_protobuf toneRose
class node_cot_egress,node_other_egress,node_sensors toneIndigo
```

## Components

### Format adapters

- [Air and maritime ingress](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/adsb/adsb_to_zmeta.py): `adapters/ingress/adsb/adsb_to_zmeta.py`
- [RF sensor ingress](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/kraken/kraken_to_zmeta.py): `adapters/ingress/kraken/kraken_to_zmeta.py`
- [EO/CV ingress](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/eo-cv/eo_cv_to_zmeta.py): `adapters/ingress/eo-cv/eo_cv_to_zmeta.py`
- [MAVLink ingress](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/mavlink/mavlink_to_zmeta_template.py): `adapters/ingress/mavlink/mavlink_to_zmeta_template.py`
- [SAPIENT ingress](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/sapient/sapient_to_zmeta.py): `adapters/ingress/sapient/sapient_to_zmeta.py`
- [Timing normalization](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/time_utils.py): `adapters/ingress/time_utils.py`
- [Registration state](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/ingress/sapient/registration_state.py): `adapters/ingress/sapient/registration_state.py`

### Gateway enforcement

- [Gateway runtime](https://github.com/jtc-byte/zmeta-spec/blob/main/gateway/src/gateway.py): `gateway/src/gateway.py`
- [Schema and policy validation](https://github.com/jtc-byte/zmeta-spec/blob/main/gateway/src/validators.py): `gateway/src/validators.py`

### Event semantics

- [OBSERVATION events](https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto): `schema/proto/zmeta_event_v1.proto`
- [INFERENCE events](https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto): `schema/proto/zmeta_event_v1.proto`
- [FUSION events](https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto): `schema/proto/zmeta_event_v1.proto`
- [STATE events](https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto): `schema/proto/zmeta_event_v1.proto`
- [COMMAND events](https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto): `schema/proto/zmeta_event_v1.proto`
- [SYSTEM events](https://github.com/jtc-byte/zmeta-spec/blob/main/schema/proto/zmeta_event_v1.proto): `schema/proto/zmeta_event_v1.proto`
- [Track projection](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/projector/track/track_projector.py): `adapters/projector/track/track_projector.py`

### Wire encodings

- [CBOR encoding](https://github.com/jtc-byte/zmeta-spec/blob/main/zmeta_cbor.py): `zmeta_cbor.py`
- [Compact encoding](https://github.com/jtc-byte/zmeta-spec/blob/main/zmeta_compact.py): `zmeta_compact.py`
- [Protobuf encoding](https://github.com/jtc-byte/zmeta-spec/blob/main/zmeta_proto.py): `zmeta_proto.py`

### Consumer egress

- [CoT egress](https://github.com/jtc-byte/zmeta-spec/blob/main/adapters/egress/cot/zmeta_to_cot.py): `adapters/egress/cot/zmeta_to_cot.py`
- [Other format egress](https://github.com/jtc-byte/zmeta-spec/tree/main/adapters/egress): `adapters/egress`

### Other components

- **Sensors and producers**
- **Gateway clients and mission systems**

## Connections

- Sensors and producers → Air and maritime ingress: supplies formats (evidence: `README.md`)
- Sensors and producers → RF sensor ingress: supplies formats (evidence: `README.md`)
- Sensors and producers → EO/CV ingress: supplies detections (evidence: `README.md`)
- Sensors and producers → MAVLink ingress: supplies telemetry
- Sensors and producers → SAPIENT ingress: supplies messages
- Air and maritime ingress → Timing normalization: normalizes timing (evidence: `adapters/ingress/adsb/adsb_to_zmeta.py`)
- RF sensor ingress → Timing normalization: normalizes timing (evidence: `adapters/ingress/kraken/kraken_to_zmeta.py`)
- EO/CV ingress → Timing normalization: normalizes timing (evidence: `adapters/ingress/eo-cv/eo_cv_to_zmeta.py`)
- MAVLink ingress → Timing normalization: normalizes timing (evidence: `adapters/ingress/mavlink/mavlink_to_zmeta_template.py`)
- SAPIENT ingress → Timing normalization: normalizes timing (evidence: `adapters/ingress/sapient/sapient_to_zmeta.py`)
- SAPIENT ingress → Registration state: uses registration (evidence: `adapters/ingress/sapient/sapient_to_zmeta.py`)
- Air and maritime ingress → OBSERVATION events: translates to (evidence: `README.md`)
- RF sensor ingress → OBSERVATION events: translates to (evidence: `README.md`)
- EO/CV ingress → OBSERVATION events: translates to (evidence: `README.md`)
- MAVLink ingress → STATE events: translates to (evidence: `adapters/ingress/mavlink/mavlink_to_zmeta_template.py`)
- MAVLink ingress → SYSTEM events: translates to (evidence: `adapters/ingress/mavlink/mavlink_to_zmeta_template.py`)
- SAPIENT ingress → OBSERVATION events: translates to (evidence: `adapters/ingress/sapient/sapient_to_zmeta.py`)
- OBSERVATION events → INFERENCE events: derives with lineage (evidence: `README.md`)
- INFERENCE events → FUSION events: contributes to (evidence: `README.md`)
- FUSION events → STATE events: projects to (evidence: `README.md`)
- STATE events → COMMAND events: justifies (evidence: `README.md`)
- SYSTEM events → STATE events: cross-cuts (evidence: `README.md`)
- OBSERVATION events → Gateway runtime: enters gateway (evidence: `README.md`)
- Gateway runtime → Schema and policy validation: validates events (evidence: `gateway/src/gateway.py`)
- Gateway runtime → Gateway clients and mission systems: forwards validated output (evidence: `README.md`)
- STATE events → Track projection: projects tracks (evidence: `README.md`)
- STATE events → CoT egress: maps to CoT (evidence: `README.md`)
- COMMAND events → Other format egress: maps mission intent (evidence: `README.md`)
- Gateway clients and mission systems → CoT egress: receives CoT (evidence: `README.md`)
- Gateway clients and mission systems → Other format egress: receives mappings (evidence: `README.md`)
- OBSERVATION events → CBOR encoding: encodes event (evidence: `README.md`)
- OBSERVATION events → Compact encoding: encodes event (evidence: `README.md`)
- OBSERVATION events → Protobuf encoding: encodes event (evidence: `README.md`)
- Compact encoding → CBOR encoding: uses CBOR encoding (evidence: `zmeta_compact.py`)
