Concept

Documentation Layers: Editorial Ontology

The three-layer model that governs BSFG documentation

Audience: All readers. Use: Understand how BSFG documentation is organized and what guarantees each layer provides.

The Three-Layer Documentation Model

BSFG documentation is organized into three distinct layers, each with different scope and vocabulary rules. This model ensures that architectural principles remain clear and that implementation choices do not become confused with architecture.

Layer 1: Principle Layer

Defines what BSFG is.

This layer describes the invariants, guarantees, and exclusions that define BSFG's essence:

Vocabulary rules:

Key document: Architecture Specification is the authoritative principle-layer reference.

Documents in this layer:

Layer 2: Logical System Layer

Defines how BSFG operates as a system.

This layer explains the abstract protocol semantics, interfaces, and operational contracts that bind producers and consumers:

Vocabulary rules:

Documents in this layer:

Layer 3: Substrate Layer

Describes how BSFG can be implemented.

This layer documents concrete implementations and the mapping between principle/logical-system layers and infrastructure:

Vocabulary rules:

Documents in this layer:

Architecture Decision Records (ADRs)

ADRs retain their full historical context, including the rationale and implementation details that led to each decision. However:

Framed ADRs:


Editorial Rules

For Writers

  1. Identify your layer. Determine whether your doc belongs in principle, logical-system, or substrate layer.
  2. Use the vocabulary of your layer. Avoid terms from other layers.
  3. Cross-reference between layers. Principle docs should reference logical-system docs for detailed operation. Logical-system docs should reference substrate docs for implementation.
  4. When describing implementation, always use a substrate badge and include an explicit framing statement: "This document describes one possible implementation of BSFG..."
  5. When extracting implementation details from principle docs, move the entire section to a substrate doc and replace with a cross-reference.

For Readers


Examples

Example 1: ISB Buffer (Three-Layer Contrast)

Principle Layer (boundary-roles.md):

The Ingress Store Buffer (ISB) is a durable write-ahead log at the external zone perimeter. It accepts incoming facts and confirms durability.

Logical System Layer (architecture.md):

The ISB interface is append(payload: Bytes, metadata: Headers) → Promise<Offset>, guaranteeing a durable append-only log with monotonic offsets.

Substrate Layer (nats-jetstream.md):

The ISB is implemented as a JetStream stream (facts.operational.*) in the external zone. Producers append to the stream via the AppendFact RPC, which internally calls stream.publish(). Durability is confirmed once the message is replicated to the configured replication factor.

Example 2: Naming (Three-Layer Contrast)

Principle Layer (naming-conventions.md):

Identifiers follow lowercase ASCII naming conventions. Predicates use verb_object format (e.g., order_created). Zone names must be stable, unique, and DNS-friendly.

Logical System Layer (integration-contract.md):

Producers must generate stable, deterministic message_id values derived from business logic. Zone identities are transmitted in the envelope's from_zone and to_zone fields.

Substrate Layer (nats-naming.md):

JetStream streams follow the naming format facts.<category>[.<prefix>]. NATS accounts are named <zone>_account due to NATS naming conventions. The relationship between abstract naming grammar and NATS specifics is documented in detail here.


Authoritativeness

The Architecture Specification is the single authoritative source for what BSFG is. If you find a contradiction between the Architecture Specification and another document, the Architecture Specification is correct, and the other document should be updated.

For ADRs: If an ADR contradicts the current Architecture Specification, the Architecture Specification takes precedence. The ADR remains a historical record of the decision, but the current normative specification is authoritative.


Cross-Links