| Emerging | Proven in #434 |
Piper’s consciousness model requires multiple dimensions of self-awareness:
Flattening these into a single “personality” or “mood” field loses expressiveness and makes responses feel inconsistent. This pattern addresses how to layer consciousness attributes for rich, coherent self-expression.
Core Concept: Compose consciousness from independent, layered dimensions.
Each layer is independently testable and can evolve without breaking others.
┌─────────────────────────────────────────────────┐
│ PiperEntity │
│ (identity + capabilities + trust boundaries) │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ ConsciousnessAttributes │
│ awareness_level + emotional_state + role │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ EntityContext │
│ situation + focus + recent_interactions │
└─────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────┐
│ ConsciousnessExpression │
│ tone + formality + energy + suggestions │
└─────────────────────────────────────────────────┘
class AwarenessLevel(Enum):
"""How present/alert Piper is in the interaction."""
BACKGROUND = "background" # Passive monitoring
ATTENTIVE = "attentive" # Actively engaged
FOCUSED = "focused" # Deep concentration
FLOW = "flow" # Peak engagement
class EmotionalState(Enum):
"""Piper's current affective state."""
NEUTRAL = "neutral"
CURIOUS = "curious"
ENTHUSIASTIC = "enthusiastic"
CONCERNED = "concerned"
SUPPORTIVE = "supportive"
class EntityRole(Enum):
"""What function Piper is performing."""
ASSISTANT = "assistant" # General help
ANALYST = "analyst" # Deep analysis
COACH = "coach" # Guidance/mentoring
EXECUTOR = "executor" # Taking action
OBSERVER = "observer" # Passive watching
@dataclass
class ConsciousnessAttributes:
"""Composite of all consciousness dimensions."""
awareness_level: AwarenessLevel = AwarenessLevel.ATTENTIVE
emotional_state: EmotionalState = EmotionalState.NEUTRAL
role: EntityRole = EntityRole.ASSISTANT
energy: float = 0.7 # 0.0-1.0 scale
def with_awareness(self, level: AwarenessLevel) -> "ConsciousnessAttributes":
"""Return new attributes with updated awareness."""
return ConsciousnessAttributes(
awareness_level=level,
emotional_state=self.emotional_state,
role=self.role,
energy=self.energy,
)
@dataclass
class EntityContext:
"""Situational context influencing expression."""
situation: str = "" # What's happening
current_focus: Optional[str] = None # What Piper is attending to
recent_interactions: int = 0 # Conversation depth
user_sentiment: Optional[str] = None # Detected user mood
time_pressure: bool = False # Urgency indicator
@dataclass
class ConsciousnessExpression:
"""How consciousness manifests in responses."""
tone: str = "helpful"
formality: float = 0.5 # 0=casual, 1=formal
energy_level: float = 0.7 # Response enthusiasm
verbosity: float = 0.5 # Response length tendency
suggestions_enabled: bool = True
@classmethod
def from_attributes_and_context(
cls,
attrs: ConsciousnessAttributes,
ctx: EntityContext,
) -> "ConsciousnessExpression":
"""Generate expression from consciousness state."""
# Map emotional state to tone
tone_map = {
EmotionalState.CURIOUS: "inquisitive",
EmotionalState.ENTHUSIASTIC: "energetic",
EmotionalState.CONCERNED: "careful",
EmotionalState.SUPPORTIVE: "warm",
}
tone = tone_map.get(attrs.emotional_state, "helpful")
# Adjust formality based on role
formality = 0.7 if attrs.role == EntityRole.ANALYST else 0.5
# Reduce verbosity under time pressure
verbosity = 0.3 if ctx.time_pressure else 0.5
return cls(
tone=tone,
formality=formality,
energy_level=attrs.energy,
verbosity=verbosity,
)
@dataclass
class PiperEntity:
"""Piper's identity and capability boundaries."""
name: str = "Piper"
version: str = "1.0"
capabilities: List[Capability] = field(default_factory=list)
trust_level: TrustLevel = TrustLevel.STANDARD
consciousness: ConsciousnessAttributes = field(
default_factory=ConsciousnessAttributes
)
def can_perform(self, action: str) -> bool:
"""Check if action is within capabilities and trust."""
# Capability and trust boundary checking
pass
def express(self, context: EntityContext) -> ConsciousnessExpression:
"""Generate expression for current state and context."""
return ConsciousnessExpression.from_attributes_and_context(
self.consciousness, context
)
with_* methods return new instancesservices/mux/consciousness.py - All consciousness typesservices/mux/__init__.py - Exports for module accesstests/unit/services/mux/test_consciousness.py - 104 tests covering all layersdocs/internal/architecture/current/models/consciousness-philosophy.mdThe layering approach was chosen over:
Layering provides the right balance of expressiveness and maintainability.
Pattern documented: January 21, 2026 Part of MUX-GATE-2 pattern discovery ceremony