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

Valid target types for attention threads.

Classes

AttentionThread(**data)

State intelligence resource tracking a specific target (Feature 039).

SparrowAnalysis(**data)

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: BaseModel

State 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

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].

thread_id: str
target_type: str
target_id: str
phase: ThreadPhase
intensity: Probability
intel_completeness: Probability
surveillance_methods: list[SurveillanceMethod]
observed_node_ids: frozenset[str]
observed_edge_ids: frozenset[tuple[str, str]]
stickiness: Probability
ticks_active: int
owning_apparatus_id: str
class babylon.models.entities.attention_thread.SparrowAnalysis(**data)[source]

Bases: BaseModel

Network 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

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].

thread_id: str
tick: int
centrality_rankings: dict[str, dict[str, float]]
equivalence_classes: list[frozenset[str]]
identified_singletons: frozenset[str]
known_cutsets: list[frozenset[str]]
confidence: Probability