babylon.engine.dialectics.base

Dialectic[A, B] — the fundamental primitive of Babylon v2.

A Dialectic is a 5-tuple D = (A, Ā, w, T, σ):

  • A, Ā are typed states — the two poles.

  • w [-1, 1] is the principal aspect weight.

  • T is the motion operator (implemented as step()).

  • σ is the sublation predicate (implemented as sublate()).

The engine enforces three universal invariants on every Dialectic at every tick: weight ∈ [-1, 1], type stability across motion, and that step returns a Dialectic of the declared type.

See also

babylon.engine.dialectics.volume_1: Concrete V1 dialectics. babylon.engine.dialectics.world: World graph model.

Classes

Dialectic(**data)

The fundamental type of the Babylon v2 engine.

EmptyPole(**data)

Placeholder pole when a Dialectic represents a unary transformation or state wrapper.

TickInputs(**data)

Upstream dialectic outputs feeding into this tick.

WorldView(**data)

Read-only projection of the World for context access.

class babylon.engine.dialectics.base.EmptyPole(**data)[source]

Bases: BaseModel

Placeholder pole when a Dialectic represents a unary transformation or state wrapper.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class babylon.engine.dialectics.base.TickInputs(**data)[source]

Bases: BaseModel

Upstream dialectic outputs feeding into this tick.

This carries the ε term from the formal definition — the output of upstream dialectics in the morphism graph that feed into this dialectic’s motion law.

Parameters:

upstream (dict[UUID, dict[str, Any]])

upstream

Mapping of source dialectic ID to its observe() output.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

upstream: dict[UUID, dict[str, Any]]
class babylon.engine.dialectics.base.WorldView(**data)[source]

Bases: BaseModel

Read-only projection of the World for context access.

Provides the World term from the formal definition — read-only access to the rest of the graph for context during step().

The previous field holds a frozen snapshot of the prior tick’s WorldView. This enables the cyclical step pattern from the Grundrisse: each dialectic reads peer outputs from the previous tick, not the current one. The cycle is in the runtime data flow, not the static type graph.

Parameters:
tick

Current simulation tick.

dialectics

Read-only view of all live dialectics by ID.

previous

Frozen snapshot of the prior tick’s WorldView (None at t=0).

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

tick: int
dialectics: dict[UUID, Any]
previous: WorldView | None
find_successor(dialectic_id)[source]

Locate the successor of a sublated dialectic.

Searches all dialectics in the current view for one whose parent_id matches the given dialectic_id.

Parameters:

dialectic_id (UUID) – UUID of the (potentially) sublated dialectic.

Return type:

Any | None

Returns:

The successor dialectic, or None if no successor exists.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.

class babylon.engine.dialectics.base.Dialectic(**data)[source]

Bases: BaseModel, Generic[A, B]

The fundamental type of the Babylon v2 engine.

Every world object is a Dialectic. The simulation is the time-evolution of a graph of dialectics under their motion laws.

Subclasses must: - Set type_tag as a class-level string (discriminator for serialization). - Implement step() — the motion law T. - Optionally override sublate(), observe(), invariants().

The model is frozen (immutable). step() returns a new Dialectic; it never mutates in place.

Parameters:
  • id (UUID)

  • type_tag (str)

  • pole_a (A)

  • pole_b (B)

  • weight (Annotated[float, Ge(ge=-1.0), Le(le=1.0)])

  • parent_id (UUID | None)

  • tick_created (int)

  • tick_updated (int)

id

Unique identifier for this dialectic instance.

type_tag

Discriminator string set by each subclass.

pole_a

The first pole (typed state A).

pole_b

The second pole (typed state B / Ā).

weight

Principal aspect weight ∈ [-1, 1]. <0 = pole A dominant, 0 = equilibrium, >0 = pole B dominant.

parent_id

UUID of the predecessor if this was produced by sublation.

tick_created

Tick when this dialectic was first instantiated.

tick_updated

Tick when this dialectic was last stepped.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

id: UUID
type_tag: str
pole_a: A
pole_b: B
weight: float
parent_id: UUID | None
tick_created: int
tick_updated: int
abstractmethod step(inputs, world)[source]

Motion law T.

Must return a new Dialectic of the same concrete type. The engine checks type stability as a universal invariant.

Parameters:
  • inputs (TickInputs) – Upstream dialectic outputs for this tick.

  • world (WorldView) – Read-only view of the full world graph.

Return type:

Dialectic

Returns:

A new Dialectic instance (same type) representing the next state.

sublate()[source]

Sublation predicate σ.

Returns a successor dialectic when the contradiction resolves into a higher-order form, or None if no sublation occurs.

The default implementation returns None (no sublation).

Return type:

Dialectic[Any, Any] | None

Returns:

Successor Dialectic, or None.

observe()[source]

Project onto a measurement basis.

Used by the frontend, analytics, and the morphism graph to read this dialectic’s state without accessing internals.

Returns:

id, type, weight, principal_aspect.

Return type:

Dictionary with at minimum

invariants()[source]

Return list of violated invariants for this tick.

An empty list means the dialectic is in a valid state. Subclasses should override to add domain-specific invariants (conservation of labor content, etc.).

Return type:

list[str]

Returns:

List of invariant violation descriptions. Empty = valid.