---
slug: "CausalBarrier"
name: "CausalBarrier"
type: "Time"
layer: "Physics"
ref: "CausalBarrier#cf54"
sema_id: "sema:CausalBarrier#mh:SHA-256:cf54b35c9236d8fd2db3ca4f35ab5bdaac79c17052d9095aaa5fa6f143507809"
tags: ["Physics","Time"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/CausalBarrier/
related: ["Agent","StateLock","TimeWarpLog"]
---

# CausalBarrier

Enforcing strict event ordering

Layer: Physics · Category: Time

## Mechanism

A middleware layer that buffers incoming messages and releases them to the agent ONLY when all their causal dependencies are met. Guarantees the agent never sees an 'impossible' state. It maintains a [StateLock](https://mindscape.pages.dev/bootstrap/StateLock.md) on the event processing queue, releasing it only when all causal predecessors have been observed.

## Invariants

- Causal Ordering: Event E cannot be processed until all Dependencies(E) are processed
- Events before barrier cannot affect events after.
- No Impossible States: [Agent](https://mindscape.pages.dev/bootstrap/Agent.md) state never violates causal consistency

## Failure modes

- Buffer overflow if dependencies never arrive.

## Parameters

- `on_undeliverable` (Enum, {block, drop, escalate}): What happens to a buffered message whose dependencies never arrive. The barrier never releases it out of order — that would breach causal ordering — so the choice is how long to hold it and what to do instead.
- `party_count` (Integer, [2, 100]): Participants tracked
- `timeout` (Duration, [1s, 1h]): How long a message waits before on_undeliverable applies

## Builds on

- [Agent](https://mindscape.pages.dev/bootstrap/Agent.md) (Mind; References)
- [StateLock](https://mindscape.pages.dev/bootstrap/StateLock.md) (Society; References)

## Used by

- [TimeWarpLog](https://mindscape.pages.dev/bootstrap/TimeWarpLog.md) (Infrastructure; References)

## Identity

- Sema ID: `sema:CausalBarrier#mh:SHA-256:cf54b35c9236d8fd2db3ca4f35ab5bdaac79c17052d9095aaa5fa6f143507809`
- Ref: `CausalBarrier#cf54`
- Supersedes:
  - `sema:CausalBarrier#mh:SHA-256:0904e3eb6ac5a36cfa3ec9d1c3fe374ad4eb817e1da35375ce8d32d8272b6128`
  - `sema:CausalBarrier#mh:SHA-256:d1b20d964f273174495ad103b4c7b31ae747e4ad56de14d9e935ca1705088c5d`
  - `sema:CausalBarrier#mh:SHA-256:9e178f07d754eefadad17a92a84f76badce58bd00571dca64b37e83176a57e94`
  - `sema:CausalBarrier#mh:SHA-256:39b3168c5b9bad18505b7af584fbb24b80ba7c5bf90e6ff0611fc2cd405f0178`
  - `sema:CausalBarrier#mh:SHA-256:a6d8167a05ffab8cf5fda4da7a81e2c196de8a182f0673b9a8a5cbf189222dfc`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/CausalBarrier/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#CausalBarrier)
- [JSON](https://mindscape.pages.dev/bootstrap/CausalBarrier.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
