babylon.models.entities.attention_thread
Attention thread and Sparrow analysis entity models (Feature 039).
Defines: - AttentionThread: State intelligence resource tracking a specific target - SparrowAnalysis: Network vulnerability analysis results on G_observed
All models are frozen (immutable) Pydantic BaseModels.
See also
specs/039-state-apparatus-ai/data-model.md: Entity definitions.
babylon.models.entities.state_apparatus_ai: FactionBalance, StateAction, etc.
Module Attributes
Valid target types for attention threads. |
Classes
|
State intelligence resource tracking a specific target (Feature 039). |
|
Network vulnerability analysis results on G_observed (Feature 039). |
- babylon.models.entities.attention_thread.VALID_TARGET_TYPES: frozenset[str] = frozenset({'community', 'organization', 'territory'})
Valid target types for attention threads.
- class babylon.models.entities.attention_thread.AttentionThread(**data)[source]
Bases:
BaseModelState intelligence resource tracking a specific target (Feature 039).
Each thread maintains a growing G_observed subgraph (always incomplete, always distorted) of the target. Thread pool size derives from the sum of surveillance_capacity across all StateApparatus nodes. Sparrow analysis operates on G_observed per thread.
- Parameters:
thread_id (str)
target_type (str)
target_id (str)
phase (ThreadPhase)
intensity (Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=~babylon.kernel.math.quantize)])
intel_completeness (Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=~babylon.kernel.math.quantize)])
surveillance_methods (list[SurveillanceMethod])
stickiness (Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=~babylon.kernel.math.quantize)])
ticks_active (int)
owning_apparatus_id (str)
- thread_id
Unique identifier for this attention thread.
- target_type
Type of target entity.
- target_id
ID of target entity.
- phase
Current intelligence phase.
- intensity
Resource allocation intensity [0,1].
- intel_completeness
Accumulated intelligence [0,1].
- surveillance_methods
Active collection methods.
- observed_node_ids
Node IDs discovered in G_observed.
- observed_edge_ids
Edge ID pairs discovered in G_observed.
- stickiness
Resistance to reallocation by meta-OODA [0,1].
- ticks_active
Ticks since thread allocation.
- owning_apparatus_id
StateApparatus that owns this thread.
Reference: FR-A01 through FR-A08, R-002, R-007.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- phase: ThreadPhase
- intensity: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=quantize)]
- intel_completeness: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=quantize)]
- surveillance_methods: list[SurveillanceMethod]
- stickiness: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=quantize)]
- class babylon.models.entities.attention_thread.SparrowAnalysis(**data)[source]
Bases:
BaseModelNetwork vulnerability analysis results on G_observed (Feature 039).
Implements Sparrow’s framework: centrality computation, equivalence class identification, singleton detection, and minimal cutset analysis. All results are contingent on G_observed quality – they may be wrong because the state’s view is always incomplete.
This is a COMPUTED artifact – derived from G_observed, not stored in the graph. Constitution II.2: derived state, not primitive.
- Parameters:
thread_id (str)
tick (int)
confidence (Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=~babylon.kernel.math.quantize)])
- thread_id
Source thread ID.
- tick
Tick of computation.
- centrality_rankings
Per-node centrality scores.
- equivalence_classes
Groups of structurally equivalent nodes.
- identified_singletons
Nodes in singleton equivalence classes.
- known_cutsets
Minimal node cutsets in G_observed.
- confidence
Analysis confidence based on intel_completeness [0,1].
Reference: FR-A03, R-002.
- model_config: ClassVar[ConfigDict] = {'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- confidence: Annotated[float, FieldInfo(annotation=NoneType, required=True, description='Value in range [0.0, 1.0] representing likelihood', metadata=[Ge(ge=0.0), Le(le=1.0)]), AfterValidator(func=quantize)]