babylon.models.entities.contradiction

Contradiction models for dialectical simulation.

Contradictions are structural tensions between opposing forces. They are the engine of historical change in the simulation.

This module consolidates: - ContradictionState (was in systems/contradiction_analysis.py) - ResolutionOutcome (was a dataclass in systems/contradiction_analysis.py) - Contradiction (was a dataclass in data/models/contradiction.py)

All models now use Sprint 1 types for consistency.

Classes

Contradiction(**data)

Full contradiction model with entities and resolution methods.

ContradictionState(**data)

The current state of a dialectical contradiction.

ResolutionOutcome(**data)

The result of a contradiction reaching resolution.

class babylon.models.entities.contradiction.ContradictionState(**data)[source]

Bases: BaseModel

The current state of a dialectical contradiction.

A contradiction is a structural tension between two forces that cannot both be satisfied within the current system. This is the primary model for tracking contradictions.

Parameters:
id

Unique identifier (flexible format for runtime use)

name

Human-readable name

description

Detailed explanation

thesis

The dominant position

antithesis

The opposing position

tension

Current tension level [0, 1]

momentum

Rate of change [-1, 1]

is_principal

Is this the principal contradiction?

resolved

Has this been resolved?

id: str
name: str
description: str
thesis: str
antithesis: str
tension: Annotated[float]
momentum: float
is_principal: bool
resolved: bool
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

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

property intensity_level: IntensityLevel

Convert continuous tension to discrete IntensityLevel.

property is_critical: bool

Check if tension is at critical level (rupture imminent).

class babylon.models.entities.contradiction.ResolutionOutcome(**data)[source]

Bases: BaseModel

The result of a contradiction reaching resolution.

When a contradiction resolves (tension reaches 0 or 1), this model captures what happened and the consequences.

Parameters:
contradiction_id

ID of the resolved contradiction

resolution_type

How it resolved (synthesis, rupture, suppression)

new_contradictions

IDs of contradictions spawned by resolution

system_changes

Metric deltas caused by resolution

contradiction_id: str
resolution_type: ResolutionType
new_contradictions: list[str]
system_changes: dict[str, float]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

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

class babylon.models.entities.contradiction.Contradiction(**data)[source]

Bases: BaseModel

Full contradiction model with entities and resolution methods.

This is a more detailed model for contradictions that includes references to entities and resolution mechanics. Used for game content definition.

Parameters:
  • id (Annotated[str, _PydanticGeneralMetadata(pattern='^CON[0-9]{3}$')])

  • name (str)

  • description (str)

  • entity_ids (list[str])

  • principal_aspect_id (str | None)

  • secondary_aspect_id (str | None)

  • principal_contradiction_id (str | None)

  • universality (Annotated[str, _PydanticGeneralMetadata(pattern='^(Universal|Particular)$')])

  • particularity (str)

  • antagonism (Annotated[str, _PydanticGeneralMetadata(pattern='^(Primary|Secondary)$')])

  • intensity (IntensityLevel)

  • state (Annotated[str, _PydanticGeneralMetadata(pattern='^(Active|Resolved|Latent)$')])

  • potential_for_transformation (IntensityLevel)

  • conditions_for_transformation (list[str])

  • resolution_methods (dict[str, list[Effect]])

  • intensity_history (list[Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Contradiction intensity from dormant (0) to rupture (1)', metadata=[Ge(ge=0.0), Le(le=1.0)])]])

id

Unique identifier

name

Human-readable name

description

Detailed explanation

entity_ids

IDs of entities involved in this contradiction

universality

Universal or Particular

particularity

Domain (Economic, Political, etc.)

principal_contradiction_id

ID of the principal contradiction (if this is secondary)

principal_aspect_id

ID of the entity representing the principal aspect

secondary_aspect_id

ID of the entity representing the secondary aspect

antagonism

Primary or Secondary antagonism

intensity

Current intensity level

state

Active, Resolved, or Latent

potential_for_transformation

How likely to transform

conditions_for_transformation

What conditions must be met

resolution_methods

Mapping of method names to Effects

id: str
name: str
description: str
entity_ids: list[str]
principal_aspect_id: str | None
secondary_aspect_id: str | None
principal_contradiction_id: str | None
universality: str
particularity: str
antagonism: str
intensity: IntensityLevel
state: str
potential_for_transformation: IntensityLevel
conditions_for_transformation: list[str]
resolution_methods: dict[str, list[Effect]]
intensity_history: list[Annotated[float]]
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

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

property intensity_value: float

Get numerical value for intensity.

record_intensity()[source]

Record current intensity in history.

Return type:

None