Architecture Decision Record

ADR-0020: Envelope Carries Boundary Metadata and Policy Labels

Status: Accepted · Date: 2026-03-06

Status: Accepted

Date: 2026-03-06

Context

BSFG separates transport meaning from domain meaning. Domain meaning lives in the fact:

fact = (subject, predicate, object_json)

The remaining metadata must answer different questions:

These concerns should not be embedded into the subject or predicate, and they should not be mixed into the semantic fact object.

Options Considered

Option Description Benefits Drawbacks
No explicit envelope Put origin, causal, and policy metadata into fact fields or transport-specific headers ad hoc.

|

| | Rigid closed envelope enum model | Constrain zone identity and metadata into fixed enums and tightly typed fixed slots only. |

|

| | Everything in generic headers only | Rely entirely on transport headers for all metadata instead of a first-class envelope model. |

|

| | Explicit envelope with stable core fields and extensible labels (Selected) | Use a first-class envelope for core boundary metadata, plus extensible labels for policy treatment. |

|

|

Decision

BSFG uses a first-class envelope to carry transport and policy metadata.

message = envelope + fact

The envelope contains the stable core fields:

message_id
from_zone
to_zone
produced_at_unix_ms
correlation_id
causation_id
object_media_type
object_schema
labels

Semantics of the core fields:

labels are defined as policy metadata, not semantic fact content. They are optional, extensible, and infrastructure-oriented.

Examples:

classification = GMP
retention      = 7y
site           = PlantA
source_system  = PASX
priority       = high

Labels may influence routing, retention, filtering, or operational treatment, but they do not change the meaning of the fact itself.

Consequences

Benefits:

Tradeoffs: