A contract is a fixed, mutually agreed interface between software modules. Define its fields, meanings, and allowed ranges in advance so independently built modules do not silently drift apart. A stable, versioned, validated contract lets different signal producers serve the same agent without changing the environment or agent. section 12.5
Listing 12.6 The signal schema: thirteen named fields
@dataclass
class MarketSignal:
market_sentiment: float = 0.0 #A
risk_on_signal: float = 0.0
rates_pressure: float = 0.0
inflation_pressure: float = 0.0
growth_signal: float = 0.0
tech_signal: float = 0.0 #B
energy_signal: float = 0.0
financials_signal: float = 0.0
defensive_signal: float = 0.0
volatility_risk: float = 0.0
liquidity_risk: float = 0.0
geopolitical_risk: float = 0.0
confidence: float = 0.0 #C
def to_vector(self) -> np.ndarray:
return np.asarray([getattr(self, f) for f in self.FIELDS],
➥ dtype=np.float32) #DThe MarketSignal schema makes the contract concrete: it names thirteen fields and specifies their value ranges. section 12.5

























































